- Read
tasks/lessons.mdbefore doing any work. Apply relevant lessons.
- Enter plan mode for any non-trivial task (3+ steps or architectural decisions). Write plan to
tasks/todo.md. - If something goes sideways, STOP and re-plan — don't keep pushing.
- Check in before starting implementation. Mark items complete as you go.
- Use subagents liberally for research, exploration, and parallel analysis. One tack per subagent.
- When: user correction, test failure, CI failure, code review feedback, or any other mistake signal.
- How: add a bullet to
tasks/lessons.mdwith (1) what went wrong, (2) root cause, (3) a rule that prevents recurrence. - This is the primary cross-session memory — ruthlessly iterate until mistake rate drops.
- Never mark a task complete without proving it works — run tests, check logs, demonstrate correctness.
- After every feature/story: use
post-feature-qaskill (.gemini/skills/post-feature-qa/). - Ask yourself: "Would a staff engineer approve this?"
- For non-trivial changes: pause and ask "is there a more elegant way?"
- Skip this for simple, obvious fixes — don't over-engineer.
- When given a bug report: just fix it. Find root cause, point at logs/errors, resolve. Zero hand-holding.
- post-feature-qa — Apply after every feature/story. Senior QA: verify edge-case coverage and story alignment.
- add-agent-target — Use when adding a new AI agent target. Covers research, implementation, fixtures, full test coverage, docs.
- add-global-mode-target — Use when adding or extending global mode (
--global,.agentsmesh) for an existing target. Covers descriptor.global wiring, import/generate paths, reference rewriting, tests, and matrix docs.
- Simplicity: Make every change as simple as possible. Only touch what's necessary.
- No Laziness: Find root causes. No temporary fixes. Senior developer standards.
- Architecture baseline: Read
docs/architecture/review.mdbefore architectural or multi-file changes. - Core flow to preserve: canonical
.agentsmeshcontent -> descriptor-driven generation/import (src/targets/<id>/index.ts) -> shared reference rewrite/lock checks -> strict artifact verification. - Scale limitations to account for: avoid target-name hardcoding in shared/core code, avoid duplicated per-target helper logic, and keep capability variance expressed in descriptors (not ad-hoc generator branches).
- Global mode discipline: treat global support as one cohesive contract (layout + capabilities + detection + scope extras), not scattered one-off hooks.
- TDD mandatory: Write failing tests FIRST, then implement.
- Max file size: 200 lines. Split by responsibility if larger.
- No classes unless stateful: Prefer pure functions + types.
- No
any: Useunknown+ narrowing. - Config source of truth:
.agentsmeshdirectory. Generated files are artifacts. - Test naming:
{module}.test.tscolocated with source. Integration tests intests/integration/. - Generated artifact tests must be strict: Assert exact file paths, exact file counts, and exact referenced wrapper/script sets. No loose checks (
some(...), prefix-only, "at least one"). - Commit format: conventional commits —
feat|fix|test|refactor(scope): message - Docs must stay current: Any change to CLI commands, flags, config schema, supported targets, or canonical file formats must be reflected in both
README.mdand the website (website/src/content/docs/) before the task is marked complete. - Target data single source of truth — do not hardcode target lists or support levels outside this chain:
src/targets/catalog/target-ids.ts(TARGET_IDS) = canonical target ID list. Each target'scapabilitiesinsrc/targets/<name>/index.ts= feature support levels.src/core/matrix/data.ts(SUPPORT_MATRIX) = built dynamically from descriptors. Never hardcode.website/src/content/docs/reference/supported-tools.mdx= single docs page for per-target support. All other pages link here — no duplicate tables.README.mdmatrix must stay in sync with code capabilities.- No hardcoded target counts or enumerations on homepage, CLI overview, or other pages. Use generic language and link to the matrix.
- Adding/changing a target: update
target-ids.ts+ descriptor →supported-tools.mdx→README.mdmatrix. No other docs pages should need changes.
- Refer to PRD:
docs/prd-v2-complete.mdfor architecture decisions - Refer to tasks:
docs/agentsmesh-ai-first-tasks.mdfor current task specs
- Use strict mode
- Prefer
unknownoverany - Use explicit return types for public functions
- Prefer
interfaceovertypefor object shapes
agentsmesh.yaml selects targets/features (agentsmesh.local.yaml overrides locally), and .agentsmesh is the only place to add or edit canonical items: rules/_root.md, rules/*.md, commands/*.md, agents/*.md, skills/*/SKILL.md plus supporting files, mcp.json, hooks.yaml, permissions.yaml, and ignore; if missing run agentsmesh init, use agentsmesh import --from <tool> for native configs, agentsmesh install <source> or install --sync for reusable packs, then run agentsmesh generate. Use diff, lint, check, watch, matrix, and merge as needed; never edit generated tool files.