# OpenMotion repository guidelines OpenMotion is a standalone npm application at the repository root. Run commands here with the Node version pinned in `.github/workflows/ci.yml`. Preserve `package-lock.json` and `scripts/runtime-lock.json`; do not introduce workspace-only dependencies. Follow the [migration guide](docs/repository-migration.md), keep user data and credentials outside the checkout, and preserve third-party licenses. ## Local validation Before publishing a branch, select local checks for the changed boundary. Run `npm ci` when dependencies or lockfiles change, or installed dependencies are missing or stale; otherwise reuse the existing installation. - Runtime or Studio changes: run `npm run check`, `npm run typecheck:studio`, `npm run build:studio` and affected deterministic tests. - Skill, contract, installer or distribution changes: run the affected deterministic and packaging/installation checks. - Prose-only changes that do not alter those boundaries: check links and run `git diff --check`; no dependency reinstall or Studio build is required. PR CI keeps repository policy, source scanning and release controls for every change. Only the explicit presentation-document allowlist skips Studio, rendering and package checks when installation sections and code blocks are unchanged; Skills, installation guides, examples and unknown paths retain the full gate. Maintainability analysis runs for code and configuration changes. Distinguish CI, target-machine installation, model creation and human content acceptance. This feature migration must not merge or publish packages unless separately authorized. ## Repository collaboration instructions Keep persistent user instructions for repository work in this file, and keep `CLAUDE.md` aligned with this shared source so every Agent follows the same rules. 1. All commit messages must be in English, including both the subject and body, as well as merge and revert messages. 2. All repository collaboration content you create or update must be in English: issue and pull request titles and descriptions, comments, review summaries, discussions, and release notes. This applies even when the user's request is in another language. 3. Before committing or submitting repository content, verify that it follows these English-language requirements. 4. Branch new work from the latest `main` and target all pull requests at `main`. Merge reviewed changes directly into `main` when authorized; do not use `feature/motion` as an intermediate integration branch. ## Repository PR review follow-up For repository PR work, follow the [contributor review checklist](CONTRIBUTING.md#follow-through-on-review). Creating a PR or pushing a fix does not finish an active review task. 1. Read the live PR head, unresolved threads, latest reviews, CI and mergeability before acting. Do not rely on a previous commit's status. 2. Verify each review claim. Fix real issues, run boundary-appropriate validation and push follow-up commits while preserving shared history. For incorrect feedback, reply with concrete code or reproduction evidence. 3. Reply to each addressed thread with the commit and checks, then resolve it when permitted. Keep unanswered or disputed feedback visible and report what remains; do not dismiss change requests or close discussions merely to unblock merging. 4. Address failing required CI and conflicts. Use an isolated worktree when the active checkout contains unrelated work. After a fix push, re-request prior reviewers who have not reviewed the new head when permitted; otherwise report pending re-review. Do not add or ping unrelated people to solicit a merge. 5. Re-read the live state before reporting. Summarize what was fixed, unresolved threads, CI and conflicts, including pending re-review or an external blocker. When waiting, state what is pending rather than claiming completion. Merge and publication authorization remain separate from review cleanup. These steps do not grant permission to merge, bypass required checks or publish a package. ### Automatic waiting during PR follow-up During an ongoing PR follow-up task, use the current client's available monitoring or waiting tools to continue when CI or reviews change: - **Claude Code:** when this session exposes `Monitor`, prefer it to watch the PR and resume the review loop on relevant changes. Use persistent monitoring only as supported by the actual tool; inspect its schema rather than assuming every client/version has it. - **Codex, OpenCode and other clients:** prefer a native monitor/wait capability when exposed. Otherwise keep a lightweight shell wait active in the current agent session, sampling PR metadata about every 30 seconds and returning when the state changes or its wait deadline is reached. Re-arm the wait while follow-up remains active. - Compare the head/base commits, review threads (including replies/edits and resolution), latest reviews and mergeability. Fold checks into one CI phase (`pending`, `passed`, `failed` or `missing`) so each individual green job does not restart the review pass. Wake the Agent for a changed state, then verify the actual feedback/check before acting. - Stop when the requested follow-up is complete, the PR closes/merges, the user stops it or an external blocker needs the user. Report the exact remaining state. An approved PR with required checks green still needs existing merge authorization. - A session wait does not survive closing the client. Only promise unattended follow-up after session closure when a durable runner has actually been configured for that scope; otherwise leave the PR URL, head, pending items and resume instructions for the next session. ## Repository contribution Skills Source-checkout contributor Skills live under `.agents/skills/`. When adding or maintaining a built-in BYOK media provider, read `.agents/skills/add-byok-provider/SKILL.md` in this checkout. It covers provider research, implementation, references and verification. These repository-local Skills are excluded from application/plugin distribution and host installation; root `skills/` continues to hold product workflows. Installed product copies may not contain `.agents/skills/`. Other Agents following `CLAUDE.md` use this same source-checkout guidance. When applying or migrating an existing shared control in Studio, follow the [ODUI apply Skill](.agents/skills/odui-apply/SKILL.md). For Open Design UI work, choose the repository-local Skill by intent. Use [odui-dev](.agents/skills/odui-dev/SKILL.md) for the local catalogue and live preview, [odui-build](.agents/skills/odui-build/SKILL.md) to create or evolve a component, [odui-apply](.agents/skills/odui-apply/SKILL.md) to adopt an existing component in Studio, and [odui-check](.agents/skills/odui-check/SKILL.md) before review. The component registry and component guide remain the shared source of truth. ## Shared design system — required for every Agent All Agents must use [packages/design-system](packages/design-system/README.md) for interface styling. Read that package's integration and change rules before creating or changing CSS, component appearance, themes, icons, fonts, loading states or brand assets. [docs/design-system.md](docs/design-system.md) describes the product integration; [brand guidance](packages/design-system/brand/BRANDKIT.md) governs public brand material. 1. **One maintained source.** Define shared visual decisions in `packages/design-system`: `tokens.json` owns theme values and Studio aliases; package styles own reusable controls, materials and states; package assets own icons, fonts and brand artwork. Never create a second palette, font stack or copied component recipe inside a feature module. 2. **Reference, do not duplicate.** Application modules consume the package's CSS entry points, semantic variables, generated utilities and asset exports. Use existing roles for colors, typography, spacing, radii, shadows and motion. If a needed reusable role or recipe is missing, extend the design system first and then reference it from consumers. Do not introduce literal interface colors, fallback palettes or arbitrary visual values to bypass it. 3. **Keep the boundary useful.** Features retain their layout, content, interactions and measured geometry. Domain values such as timeline coordinates, user-selected artwork colors, image pixels and authored video styles are not application-theme tokens. Do not theme project iframes, templates or third-party artwork as a side effect of changing the editor. 4. **Change the source, then generate.** Run `npm run design:tokens` after changing token values or mirrored brand assets. Do not hand-edit generated CSS or compatibility mirrors. Old entry paths may forward to the package but must not become independent implementations. Preserve upstream attribution and font licenses. 5. **Verify propagation.** For shared visual changes, check the affected surfaces together, including both themes, startup/loading, controls and dialogs, template browsing and narrow layouts where applicable. Run `npm run design:check` and the boundary-appropriate validation above. Keep automated checks, browser inspection and human visual acceptance distinct. 6. **Keep the visual workbench independent.** `npm run design:dev` launches only the package-owned workbench. Its UI and Node service may depend on design-system sources and Node built-ins, never Studio, application services, project data or business modules. UI saves and Agent edits share `tokens.json`; downstream modules consume the generated system through their normal build/refresh. Run `npm run design:test` for workbench changes. 7. **Keep every Agent aligned.** `AGENTS.md` is authoritative; `CLAUDE.md` points to this section. Include this requirement in delegated task context and code reviews. A feature-local style exception must have a concrete domain reason; an older hard-coded value elsewhere is not permission to add another one. The package is a local source module within the standalone root npm application. Do not add workspace-only dependencies or publish it without separate authorization. ## README writing and acknowledgements When creating or updating any README, including alternative drafts and translations, describe OpenMotion's own capabilities, workflows and the meaning of each example. Do not introduce other products as comparisons, inspiration or source labels in the main narrative, headings, feature descriptions or showcase copy. Avoid wording such as "From MotionGit", "inspired by Hypit" or "the alternative to ...". Consolidate references to other products, upstream origins, comparisons and source acknowledgements in the final **Acknowledgements** section. Preserve required licenses, copyright notices and detailed provenance in their source files, and link them from that section. Describe external examples accurately without presenting them as OpenMotion-generated results. Keep technical identifiers needed for setup, supported agent/model names and explicitly requested example brand names accurate; these factual labels are not invitations to add product comparisons or inspiration commentary. Before finishing a README edit, check that product-reference commentary appears only in the final acknowledgements. ## UI design system and interaction feedback Check the [component library registry and contribution guide](packages/open-design-ui/README.md) before adding a shared Studio control. Use the listed source import and update the live example when its recommended usage or behavior changes. Record an exercised Studio consumer and an explicit adoption decision for each registered control. Follow the [contribution steps](packages/open-design-ui/README.md#contribute-a-control) when deciding whether to enforce reuse. Use the shared Button, IconButton or Slider for new Studio actions and range controls. The design check blocks native `