Skip to content

Understanding the output

Canonical tree: .ai/

Everything else is derived from here. Commit .ai/ (and your chosen IDE files) like normal project config. The CLI creates repo instructions and adapter files, not a runnable backend service. Treat the generated .ai/ tree as a starting operating manual for your project and edit it after reviewing the output.

text
.ai/
├── AGENT.md                 # Core agent identity + principles + quality gates
├── lifecycle/               # Think, Plan, Build, Review, Test, Ship, Reflect
├── rules/                   # Always-on standards (Markdown)
├── skills/<name>/           # Workflows (SKILL.md, sometimes checklist.md)
├── context/                 # You refine: domain map + approved tech stack
└── tracking/                # Optional metrics / iteration notes

rules/data-layer.md is omitted when you chose no ORM. Skills appear only for workflows you selected.

Lifecycle

Lifecycle files live under .ai/lifecycle/:

StagePurpose
think.mdUnderstand the backend goal, stack, contracts, data/auth risks, and constraints before planning
plan.mdName affected APIs, data models, migrations, auth boundaries, integrations, jobs, risks, and tests
build.mdImplement only the approved backend scope
review.mdCheck correctness, API compatibility, data integrity, security, observability, and adapter output
test.mdRun or define validation proportional to backend risk
ship.mdSummarize changes, validation, release notes, breaking changes, and rollback notes
reflect.mdCapture backend template gaps and follow-up tasks

Rules (what they steer)

Rule fileWhat it controls
architecture.mdModule/router/plugin layout, DI, repository pattern, shutdown
api-patterns.mdValidation, OpenAPI, pagination, rate limits, CORS, versioning
errors-logging-security.mdErrors, logging, authz, observability hooks
external-integrations.mdThird-party clients, retries, mapping failures
testing.mdUnit vs e2e, framework idioms, mocking
pre-commit.mdBuild / lint / test gates before commit
async-patterns.mdQueues, jobs, idempotency, cron
environment.mdConfig, env files, Docker, flags
git-conventions.mdBranches, commits, PR focus
data-layer.mdORM schema, migrations, repositories (if ORM ≠ none)

Skills (when to run them)

SkillPurposeTypical moment
plan-reviewStaff-level plan before codeAfter a written plan, before implementation
code-reviewDiff review with checklistBefore merge / after a big change
qaBuild, tests, API health-style passBefore calling a feature “done”
shipCommit, push, open PRWhen you are ready to land work
document-releaseRefresh README / changelog from last changeAfter shipping
retroShort productivity retroEnd of week / sprint
db-migration-reviewSafe migrationsBefore merging schema changes
api-contract-checkBreaking API detectionWhen DTOs or routes change
dependency-auditnpm audit + necessityDependency bumps

Context and tracking

  • context/domain-map.md — Fill in real domains, directories, and pitfalls for your product.
  • context/tech-stack.md — Table of approved libraries; keeps the agent from freelancing new deps.
  • tracking/efficiency.md — Space to log accept/reject patterns and tighten rules over time.

IDE adapters

.cursor/rules/index.mdc      # from AGENT.md
.cursor/rules/lifecycle.mdc  # from lifecycle/*.md
.cursor/rules/*.mdc          # from rules/*.md (globs where relevant)
.cursor/skills/<skill>/     # copied from .ai/skills/
CLAUDE.md                    # AGENT + lifecycle + rules merged
.claude/skills/<skill>/      # copied skills
.github/copilot-instructions.md   # AGENT + lifecycle + rules merged
.agents/workflows/<skill>.md      # one workflow per skill
.windsurfrules               # AGENT + lifecycle + rules merged

Concrete example (NestJS + Prisma preset)

A typical output includes .ai/ plus adapter folders from the preset’s IDE list, for example:

text
my-nestjs-app/
├── .ai/
│   ├── AGENT.md
│   ├── lifecycle/
│   │   ├── think.md
│   │   ├── plan.md
│   │   └── …
│   ├── rules/
│   │   ├── architecture.md
│   │   ├── data-layer.md
│   │   └── …
│   ├── skills/plan-review/SKILL.md
│   ├── skills/code-review/SKILL.md
│   ├── skills/code-review/checklist.md
│   └── …
├── .cursor/rules/*.mdc
├── CLAUDE.md
└── .claude/skills/…

Next: put it together in a day-to-day loop — Recommended workflow.

Released under the MIT License.