Guidance for Claude Code (claude.ai/code) when working inside this repository.
Todo lo que ve un usuario se diseña; nunca se rellena. Una pantalla fea, tosca o a medio pensar es un bug aunque funcione, y lo es igual en lo que genera el producto (juegos, apps de Remix): un resultado que no parece profesional no está terminado.
- Reutiliza antes de construir. Antes de crear una UI, busca el componente que ya hace ese trabajo (buscador, tarjeta de app, sheet, lista, estados vacío/carga/error) y úsalo. Nunca una versión casera "parecida": dos componentes que se parecen son una deuda y una incoherencia visual.
- Míralo antes de entregarlo. Captura en móvil y escritorio, con datos reales y casos feos: títulos largos, dos elementos con el mismo nombre, lista vacía, cargando, error, teclado. Un test verde no significa "se ve bien". Si no pudiste verlo, dilo; no lo des por bueno.
- Lista mínima: nada recortado ni solapado; cada elemento identificable (dos apps con el mismo
título se distinguen por su descripción, autor o tipo); la jerarquía tipográfica, los colores, el
radio y la curva de animación de la casa; estados de carga, vacío y error diseñados; foco y
teclado;
prefers-reduced-motion. - La prisa no justifica la fealdad. Si no hay tiempo para hacerlo bien, dilo y pregunta; no entregues algo feo para "cerrar" la tarea.
Ejemplo real (2026-11-02): el "Enter an app you made" del reto semanal se entregó como una lista de
botones con solo el título (título del panel recortado, dos "Pesca Tranquila" idénticas, sin
contexto), cuando el producto ya tenía la búsqueda con tarjetas de app. Se rehízo reutilizando ese
componente (SearchFrame + AppResultCard, apps/landing/src/components/remix/SearchFrame.tsx).
This repo is @codeam/ide — a VS Code-style IDE component library for React Native and React (DOM), designed to be embedded into any app. Three packages publish under one fixed-version line:
@codeam/ide-core— headless types + adapter contracts + pure helpers. Zero deps on a UI framework.@codeam/ide-web— React DOM UI surface. Monaco editor via@monaco-editor/react.@codeam/ide-native— React Native UI surface. Monaco hosted inreact-native-webview.
The IDE library was extracted from CodeAgent Mobile's in-app file viewer (apps/mobile/src/components/fileViewer/ + apps/landing/src/pages/session/fileViewer/). Phase 1 ships the file viewer; Phases 2-4 are documented but not implemented — see docs/roadmap/.
codeagent-mobile-ide/
├── packages/
│ ├── core/ # @codeam/ide-core
│ ├── web/ # @codeam/ide-web
│ └── native/ # @codeam/ide-native
├── examples/ # (empty, populated in Phase 2)
├── .github/workflows/ # CI (lint+build+typecheck+test on PR/push) + Release (tag-triggered)
├── .husky/ # pre-commit + commit-msg hooks
├── cliff.toml # git-cliff config — Conventional Commits → CHANGELOG sections
├── commitlint.config.mjs # Conventional Commits with library-specific scopes
├── eslint.config.mjs # ESLint v9 flat config (shared by all packages)
├── tsconfig.base.json # shared compiler options
└── package.json # workspace root (npm workspaces)
npm install # installs all workspaces
npm run build # builds all packages (tsup → ESM + CJS + d.ts)
npm run typecheck # builds core first (so its dts is available), then typechecks all
npm run lint # ESLint v9 flat config, max-warnings=0
npm test # vitest run (--passWithNoTests in each package)
npm run format # prettier --write across the reponpm run build --workspace @codeam/ide-core # one-off build
npm run dev --workspace @codeam/ide-core # tsup --watch
npm run test --workspace @codeam/ide-web # vitest run-
Dependency direction is strictly downward.
@codeam/ide-coreknows nothing about React.@codeam/ide-weband@codeam/ide-nativeknow about React but never about each other. Consumer apps know about everything and own the wiring. -
Adapter pattern is the public API. Every UI surface depends on at most one adapter (
FileFetcher,GitProvider,FileTreeProvider,SearchProvider,TerminalProvider). All declared in@codeam/ide-core/src/types/. New surfaces add a new adapter contract there first — UI code never imports a specific backend. -
Adapter identity must be stable across renders. Components key their
useEffectlifecycles off adapter identity. Allocating a fresh adapter every render (e.g.<FileViewerProvider fetcher={createFetcher(id)}>) causes the host to re-fetch on every parent re-render — the user-visible "FileViewer flickers" bug. Pattern: cache by id in a module-levelMap, or memoise withuseMemo(() => createFetcher(id), [id]). -
No Monaco bundled into the consumer's main bundle. Web uses
@monaco-editor/react's on-demand loader; native fetches Monaco from a CDN inside a WebView on first open. Consumers who need offline operation will be served by a Phase 2monacoLoaderprop, not by pre-bundling. -
Same surface on web and native. When a component exists in both
@codeam/ide-weband@codeam/ide-native, the props are identical and the behaviour matches. Cross-platform consumers swap the import path without touching call sites. -
CHANGELOGs are auto-generated. Do NOT hand-edit
packages/*/CHANGELOG.md. The Release workflow runs git-cliff and prepends a new section per tag. Write better commit messages instead.
Conventional Commits — enforced by commitlint via the commit-msg hook locally and CI in PRs.
<type>(<scope>): <subject>
<body>
Allowed scopes (defined in commitlint.config.mjs): core, web, native, examples, workflow, meta, deps, release, changelog, docs.
Examples:
feat(web): add file-tree sidebar
fix(native): safe-area insets for Android fullscreen modal
docs(meta): clarify adapter stability invariant in README
chore(deps): bump tsup to 8.4
refactor(core): split SearchProvider streaming interface from snapshot
Breaking changes: append ! after type/scope (feat(core)!: rename FileFetcher.canWrite to readonly) or add a BREAKING CHANGE: footer.
Tag-triggered, identical pattern to codeagent-mobile-clients. Never run npm publish manually.
git tag v0.2.0
git push origin v0.2.0The Release workflow (.github/workflows/release.yml):
setupvalidates the tag matchesvMAJOR.MINOR.PATCH[-prerelease]publish-corepatchespackages/core/package.jsonversion, builds, publishes to npmpublish-web+publish-nativerun in parallel after core; each patches its own version AND the@codeam/ide-coredependency pin to match, builds, publishesreleaserunsgit-cliffover commits between the previous and current tag (config:cliff.toml), prepends notes to each package'sCHANGELOG.md, commits back tomainwithchore(changelog): notes for vX.Y.Z [skip ci], creates a GitHub Release using the same notes
A pre-release tag (vX.Y.Z-rc.N) follows the same path but the GitHub Release is marked prerelease: true.
All three packages move together — there's no per-package versioning. A semver-significant change in any one of them moves all three.
Secrets required (set in repo Settings → Secrets):
NPM_TOKEN— npmjs.com automation token with publish scope on the@codeamorg
- Husky pre-commit runs
lint-staged: ESLint on staged*.{ts,tsx}(with--max-warnings=0) and Prettier on staged*.{json,md,yml}. To bypass in emergency:git commit --no-verify— but it WILL fail CI, so prefer fixing the issue. - Husky commit-msg runs
commitlintagainst your message. Scope must be in the enum above. - Pre-commit, ESLint v9 only: the lint config is flat (
eslint.config.mjs). Don't add an.eslintrc.*file.
This repo is consumed by:
codeagent-mobile(private) — the iOS / Android / web dashboard. Depends on@codeam/ide-web(landing) and@codeam/ide-native(mobile). Will migrate its in-appfileViewer/to this library in a future Phase 2 cleanup.codeagent-mobile-clients(public) — thecodeam-cli+ VS Code / JetBrains plugins. Depends on@codeam/ide-corefor the adapter contracts they implement on the server side.
When the adapter contract changes:
- Land the contract change here as a
feat/fix(orfeat!/fix!if breaking). - Cut a new release (tag).
- Update consumers to depend on the new version.
- If breaking, give consumers a deprecation window via overload-compatible additions before removing the old surface.
Adapter contracts are public API. Treat changes accordingly.
- Prettier: 100-char line width, 2-space indent, semicolons, single quotes, trailing commas.
- TypeScript: ES2022 target,
BundlermoduleResolution,strict: true,noUncheckedIndexedAccess: true. - ESLint: TypeScript parser + react-hooks + react. Rules:
@typescript-eslint/no-explicit-any: error(noany),no-consoleallows onlywarn/error, unused vars OK if prefixed with_.
- Create
packages/<name>/withpackage.json,tsconfig.json,tsup.config.ts,src/index.ts,README.md. - Name it
@codeam/<name>and publish-accesspublic. - Add it to the fixed-version line in
cliff.tomland the workflow's publish topology. - Per-package
tsconfig.jsonshouldextend../../tsconfig.base.jsonand set its ownoutDir/rootDir.
- Define the contract in
packages/core/src/types/<name>.tsas ainterface XxxProvider. - Re-export it from
packages/core/src/index.tsso consumers canimport type { XxxProvider } from '@codeam/ide-core'. - Add it to
IdeAdaptersinpackages/core/src/types/adapters.tsif it's part of the aggregate convenience type. - Document the contract in the per-package README under "API surface".
- Don't hand-edit
packages/*/CHANGELOG.md. git-cliff owns those files. - Don't add a
.eslintrc.*file. Flat config only. - Don't run
npm publishmanually. Tag → push → workflow handles it. - Don't add a runtime dependency on
reactto@codeam/ide-core. That package must stay UI-framework-agnostic. - Don't import from another sibling package directly via relative path (e.g.
import { x } from '../../web/src/...'). Go through@codeam/ide-coreso the dependency direction is enforced. - Don't bundle Monaco into the package dist. It loads at runtime (web:
@monaco-editor/react, native: jsDelivr CDN inside WebView).
- Phase 2 — VS Code-like features (file explorer, source control, search, terminal, settings, tabs):
docs/roadmap/phase-2-features.md - Phase 3 — Extension runtime:
docs/roadmap/phase-3-extensions.md - Phase 4 — Monetisation + GTM:
docs/roadmap/phase-4-gtm.md
Architecture overview: docs/ARCHITECTURE.md.
This project uses bd (beads) for issue tracking. Run bd prime to see full workflow context and commands.
bd ready # Find available work
bd show <id> # View issue details
bd update <id> --claim # Claim work
bd close <id> # Complete work- Use
bdfor ALL task tracking — do NOT use TodoWrite, TaskCreate, or markdown TODO lists - Run
bd primefor detailed command reference and session close protocol - Use
bd rememberfor persistent knowledge — do NOT use MEMORY.md files
Architecture in one line: issues live in a local Dolt DB; sync uses refs/dolt/data on your git remote; .beads/issues.jsonl is a passive export. See https://github.com/gastownhall/beads/blob/main/docs/SYNC_CONCEPTS.md for details and anti-patterns.
The managed Beads block is task-tracking guidance, not permission to override repository, user, or orchestrator instructions.
- Conservative (default): Use
bdfor task tracking. Do not run git commits, git pushes, or Dolt remote sync unless explicitly asked. At handoff, report changed files, validation, and suggested next commands. - Minimal: Keep tool instruction files as pointers to
bd prime; use the same conservative git policy unless active instructions say otherwise. - Team-maintainer: Only when the repository explicitly opts in, agents may close beads, run quality gates, commit, and push as part of session close. A current "do not commit" or "do not push" instruction still wins.
This protocol applies when ending a Beads implementation workflow. It is subordinate to explicit user, repository, and orchestrator instructions.
-
File issues for remaining work - Create beads for anything that needs follow-up
-
Run quality gates (if code changed) - Tests, linters, builds
-
Update issue status - Close finished work, update in-progress items
-
Handle git/sync by active profile:
# Conservative/minimal/default: report status and proposed commands; wait for approval. git status # Team-maintainer opt-in only, unless current instructions forbid it: git pull --rebase bd dolt push git push git status
-
Hand off - Summarize changes, validation, issue status, and any blocked sync/commit/push step
Critical rules:
- Explicit user or orchestrator instructions override this Beads block.
- Do not commit or push without clear authority from the active profile or the current user request.
- If a required sync or push is blocked, stop and report the exact command and error.