agentleFS
KoshuxKoshux/agentic-sdlc-scaffold/AGENTS.md

agentic-sdlc-scaffold

AGENTS.md0 starsChanged 4 months agoMITView on GitHub

This file is the single canonical operating manual for every AI coding agent working in this repository — GitHub Copilot reads it natively as workspace instructions, and Claude Code reads it from the project root. CLAUDE.md and .github/copilot-instructions.md are thin pointers back to this file plus tool-specific layout notes — never let them diverge into parallel manuals. Duplicated policy text drifts; when substance changes, it changes here, and the pointers keep routing. All concrete examples use the Acme Tracker reference…

The file

We split this AGENTS.md into the rules it gives an agent

10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Implementation log before substantive work: Create IMPLEMENTATION_<YYYY-MM-DD_HH-MM>.md (from the template) before the first substantive …

    line 25
  2. Very specific:

    Containers running before tests: Start the exact services a test needs (docker compose up -d postgres-main && docker compose ps, extended …

    line 37
  3. Distinctive:

    Before modifying any file, understand where it sits in this tree and what depends on it.

    line 92
  4. Distinctive:

    Every spec-backed feature follows this lifecycle.

    line 98
  5. Distinctive:

    If the same fix fails twice with the same approach, stop and re-derive root cause (§7).

    line 168
  6. Distinctive:

    Delegation is a spend, not a free speed-up: Default sequential; cap 1–3 sub-agents.

    line 169
  7. Distinctive:

    Every worker writes its own log first.

    line 183
  8. Distinctive:

    Delegation costs real money — the default is sequential: Never investigate *and* delegate the same question.

    line 185
  9. Distinctive:

    Document failed attempts in the implementation log.

    line 204
  10. Distinctive:

    Clean up: Remove temp records, revert debug logging, leave no commented-out code.

    line 207

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md — Acme Tracker Agent Operating Manual

This file is the single canonical operating manual for every AI coding agent working in this repository — GitHub Copilot reads it natively as workspace instructions, and Claude Code reads it from the project root. CLAUDE.md and .github/copilot-instructions.md are thin pointers back to this file plus tool-specific layout notes — never let them diverge into parallel manuals. Duplicated policy text drifts; when substance changes, it changes here, and the pointers keep routing.

All concrete examples use the Acme Tracker reference stack. Run the adopt skill to rewrite that vocabulary for your real repo. This scaffold's file inventory: docs/manifest.md.


1. Hard rules

Numbered so reviews and logs can cite them. Each names its enforcement mechanism.

  1. Agents never merge to main. Agents branch, implement, test, self-review, and stop at an open PR. The operator reviews, browser-verifies, and merges. Enforcement: review gate — operator-only merge. Branch protection where available; otherwise convention — call it out if you see it broken.
  2. Implementation log before substantive work. Create IMPLEMENTATION_<YYYY-MM-DD_HH-MM>.md (from the template) before the first substantive edit, on the feature branch, with the branch name in it. Update it as work happens, not after the fact. Enforcement: hook on the Claude side — .claude/hooks/enforce-implementation-log.cjs, wired as a TaskCompleted hook in .claude/settings.json. On the Copilot side this rule is a convention backed by review. (The two PreToolUse guards — block-powershell, remind-selective-tests — are mirrored in .github/hooks/enforce-repo-policy.json where the Copilot environment supports repository hooks — verify yours fires them.)
  3. Containers running before tests. Start the exact services a test needs (docker compose up -d postgres-main && docker compose ps, extended per the matrix in docs/testing.md) and wait for healthy status before running the test. A failure caused by a stopped container is a setup failure, not a product bug. Enforcement: convention — the preflight in .claude/rules/testing.md; call it out if you see it skipped.
  4. Never hand-edit generated files. frontend/layers/shared/zod/ is written only by pnpm zod:generate; the hand-written schemas in apps/api-core/src/schemas/ are the source of truth. The same applies to any file a generator owns. Enforcement: convention — the single-owner list in .claude/rules/codemap.md; review gate 5.5 flags violations.
  5. Permission reference data lives in apps/auth-service/prisma/seed.ts — never in a migration. The seed is idempotent (upserts) and runs on every container start, so a seed entry reaches every environment; a migration entry reaches only databases that haven't run it yet. Migrations are for schema shape only. Enforcement: review gates 2.5 and 5.5 — see .claude/rules/database.md.
  6. Soft-delete and audit logging are not optional. Mutations write an ActivityLog row via audit.service.ts (inside the transaction, with field-level diffs); deletes set deletedAt, never hard-delete; reads filter deletedAt: null. Setup and reset paths are not exempt. SSE broadcasts fire after the transaction commits. Enforcement: review gate 5.5 + the spec-review security lens (gate 2.5).
  7. Never assume success — verify. Confirm every change with the cheapest sufficient check: pnpm tsc --noEmit, a targeted test, an API call, a log read, or browser verification for UI. "It should work" is not a completion state. Enforcement: convention + gate 5.5; the verification matrix in docs/testing.md defines minimum depth per change type.

2. Project structure

Acme Tracker is a team project/task tracker: projects contain tasks, tasks have comments and attachments, every change is audit-logged, boards update live over SSE.

acme-tracker/
├── apps/
│   ├── api-core/           # Express + Prisma API (controllers/ repositories/ services/
│   │   │                   #   schemas/ routes/) — CRUD via BaseController<T>/BaseRepository<T>
│   │   └── prisma/         # schema.prisma, migrations/, seed.ts
│   └── auth-service/       # Login, JWT, permissions
│       └── prisma/         # seed.ts owns permission reference data (rule 5)
├── frontend/
│   ├── apps/web/           # Nuxt 3 app (pages/, components/)
│   ├── layers/shared/      # Shared components/ composables/ stores/ utils/ zod/ (zod/ generated)
│   └── e2e/                # Browser test specs
├── docs/specs/             # SPEC-NNN contracts
├── docker-compose.yml      # postgres-main, api-core, auth-service, web, gateway
└── scripts/

Both databases (acme_core_db, acme_auth_db) run on the postgres-main container; the full stack is served through the local gateway at https://localhost:8443. For a task → files navigation table, see .claude/rules/codemap.md. Before modifying any file, understand where it sits in this tree and what depends on it.


3. The 7-stage SDLC

Every spec-backed feature follows this lifecycle. Never skip or reorder stages; code before spec is not allowed. Trivial fixes (typos, one-liners, doc-only edits) take the fast path — see effort discipline. Full reference: docs/sdlc.md.

StageOutputGate / skill
1. JourneyThe operator flow, documented first—
2. Specdocs/specs/SPEC-NNN-<name>.md (template)—
2.5. Spec self-reviewEvery HIGH resolved in the spec, before any code/spec-review
3. Branchfeature/spec-NNN-<name>, always from latest main—
4. ImplementCode + implementation log on the branchrule 2 hook
5. Automated testsTargeted unit/integration/e2e, containers preflightedrule 3
5.5. Self code reviewEvery HIGH fixed on-branch (or filed as iteration spec), pass recorded in the log/self-code-review
5.6. PR-bot triageBot review validated finding-by-finding, triage recorded/pr-review
6. Operator reviewBrowser verification + approval + merge — operator onlyrule 1
7. BackfillJourney/spec updated with what implementation clarified—

Canonical gate invocations (verbatim, or adapted with extra focus areas):

/spec-review review SPEC-NNN + its journey against the live codebase: verify we extend existing infrastructure rather than duplicate it, run the review + security design threat-model + gap analysis, and resolve every HIGH in the spec.
/self-code-review review changes in this branch for bugs, regressions, and non-alignment
with repo conventions such as component reuse and centralized formatting.
/pr-review fetch the PR-bot review on the open PR, validate every finding against the
live codebase and spec, fix the valid ones on-branch, and record the triage.

Why the gates exist: 2.5 catches wrong-shape designs before they cost an implementation; 5.5 means the operator review finds behaviour observations, not avoidable bugs; 5.6 runs without being re-instructed once a PR is open (the bot review lands minutes later — validate each finding, never blind-apply). Stage 5.6 applies only when the repo has a PR-bot reviewer. Follow-on work on an unmerged spec is an iteration spec (SPEC-NNN<letter>-...) on the parent's branch — see docs/sdlc.md.


4. Verification matrix (summary)

Match verification depth to change type; full matrix and container preflight in docs/testing.md.

ChangeMinimum verification
Schema / Zodmigrate → pnpm db:generate → pnpm zod:generate → pnpm tsc --noEmit
Backend route/servicetargeted test + a real API call + server-log check
Frontend page/componentpnpm e2e (from frontend/) + browser verification or pending-operator record
Migrationup → verify → down → up again
Mutation with audit/SSEtransaction test + audit-row check + SSE event check

pnpm tsc --noEmit is cheap — run it freely. Full suites are expensive — run only the tests relevant to the change, batch edits before verifying, and never run a full suite twice per task without a reason.


5. Effort discipline

Match rigor to leverage. Full rule: .claude/rules/effort-discipline.md.

  • High-leverage (full SDLC + gates): schema/migrations, auth/permissions, cross-service contracts, new write paths.
  • Low-leverage (quick-fix-first, minimal ceremony): typos, copy, comments, one-line fixes. Do not wrap these in a spec or a review pass.
  • Answer a question as a question. Don't tangent; surface adjacent work as a one-line choice.
  • If the same fix fails twice with the same approach, stop and re-derive root cause (§7).
  • Delegation is a spend, not a free speed-up. Default sequential; cap 1–3 sub-agents; never investigate and delegate the same question. See §6 and docs/parallelisation.md §1.5.

6. Parallel work (summary)

Optional module — full doctrine in docs/parallelisation.md, driven by the orchestrate skill.

  • Hard ceiling: 3 concurrent workers. More means phase the work sequentially.
  • Every file has exactly one owner at a time. The single-owner high-contention files in .claude/rules/codemap.md are sequential-only.
  • Every worker writes its own log first; on a crash, read the log before resuming — never respawn blindly.
  • Delegation costs real money — the default is sequential. Never investigate and delegate the same question; that pays twice for one finding. Delegate only for breadth beyond one context (30+ files) or for independence from your own reasoning on something you authored. Never scale agent count with the number of findings — require reviewers to verify their own findings inline. Full budget and the measured evidence: docs/parallelisation.md §1.5.

7. Agent behavior expectations

  • Read before you write. Open the relevant spec, rule file, and the code you're changing before editing. Dependency graph first.
  • Lead with the outcome. Reports start with what happened and whether it's verified — then detail. Distinguish validated claims (ran the check) from assumed ones.
  • Surface adjacent work as a choice. One line, operator decides. Never silently expand scope.
  • Two-attempt rule. Same approach failed twice → stop, re-read the full failure, question the root-cause assumption, try a fundamentally different angle or escalate. Document failed attempts in the implementation log.
  • Confirm before destructive or outward-facing ops — file deletion, git reset, force-push, publishing, creating remote resources.
  • Clean up. Remove temp records, revert debug logging, leave no commented-out code.

8. Dual-tool concern map

Both tools share this manual and the SDLC. Their layouts mirror each other; when a rule's substance changes, update both sides (thin twins summarize-and-route — they never fork).

ConcernClaude Code homeGitHub Copilot home
Operating manualAGENTS.md (+ CLAUDE.md pointer)AGENTS.md (+ .github/copilot-instructions.md pointer)
Operational rules.claude/rules/*.md.github/instructions/*.instructions.md (thin twins)
File-scoped guidancerules routed via codemapapplyTo: globs in each .instructions.md
Workflows / skills.claude/skills/*/SKILL.md.github/skills/*/SKILL.md + .github/prompts/*.prompt.md
Subagents.claude/agents/*.md.github/agents/*.agent.md
Enforcement hooks.claude/hooks/*.cjs via .claude/settings.json.github/hooks/enforce-repo-policy.json (mirrors the two PreToolUse guard scripts, where the environment supports repository hooks — see rule 2)

Deeper references: docs/sdlc.md · docs/testing.md · docs/operating-model.md · docs/memory-convention.md · docs/parallelisation.md.


agentic-sdlc-scaffold v0.1.0 — see CHANGELOG.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.