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…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository16 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- adoptSkill
- browser-verifySkill
- create-spec-promptSkill
- feature-planSkill
- implement-specSkill
- orchestrateSkill
- pr-reviewSkill
- security-reviewSkill
- self-code-reviewSkill
- spec-reviewSkill
- browser-verifySkill
- create-specSkill
- implement-specSkill
- spec-reviewSkill
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
- Very specific: line 25
Implementation log before substantive work: Create IMPLEMENTATION_<YYYY-MM-DD_HH-MM>.md (from the template) before the first substantive …
- Very specific: line 37
Containers running before tests: Start the exact services a test needs (docker compose up -d postgres-main && docker compose ps, extended …
- Distinctive: line 92
Before modifying any file, understand where it sits in this tree and what depends on it.
- Distinctive: line 98
Every spec-backed feature follows this lifecycle.
- Distinctive: line 168
If the same fix fails twice with the same approach, stop and re-derive root cause (§7).
- Distinctive: line 169
Delegation is a spend, not a free speed-up: Default sequential; cap 1–3 sub-agents.
- Distinctive: line 183
Every worker writes its own log first.
- Distinctive: line 185
Delegation costs real money — the default is sequential: Never investigate *and* delegate the same question.
- Distinctive: line 204
Document failed attempts in the implementation log.
- Distinctive: line 207
Clean up: Remove temp records, revert debug logging, leave no commented-out code.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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.
Files
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
adoptskill 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.
- 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. - 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 aTaskCompletedhook 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.jsonwhere the Copilot environment supports repository hooks — verify yours fires them.) - 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. - Never hand-edit generated files.
frontend/layers/shared/zod/is written only bypnpm zod:generate; the hand-written schemas inapps/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. - 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. - Soft-delete and audit logging are not optional. Mutations write an
ActivityLogrow viaaudit.service.ts(inside the transaction, with field-level diffs); deletes setdeletedAt, never hard-delete; reads filterdeletedAt: 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). - 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.
| Stage | Output | Gate / skill |
| 1. Journey | The operator flow, documented first | — |
| 2. Spec | docs/specs/SPEC-NNN-<name>.md (template) | — |
| 2.5. Spec self-review | Every HIGH resolved in the spec, before any code | /spec-review |
| 3. Branch | feature/spec-NNN-<name>, always from latest main | — |
| 4. Implement | Code + implementation log on the branch | rule 2 hook |
| 5. Automated tests | Targeted unit/integration/e2e, containers preflighted | rule 3 |
| 5.5. Self code review | Every HIGH fixed on-branch (or filed as iteration spec), pass recorded in the log | /self-code-review |
| 5.6. PR-bot triage | Bot review validated finding-by-finding, triage recorded | /pr-review |
| 6. Operator review | Browser verification + approval + merge — operator only | rule 1 |
| 7. Backfill | Journey/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.
| Change | Minimum verification |
| Schema / Zod | migrate → pnpm db:generate → pnpm zod:generate → pnpm tsc --noEmit |
| Backend route/service | targeted test + a real API call + server-log check |
| Frontend page/component | pnpm e2e (from frontend/) + browser verification or pending-operator record |
| Migration | up → verify → down → up again |
| Mutation with audit/SSE | transaction 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).
| Concern | Claude Code home | GitHub Copilot home |
| Operating manual | AGENTS.md (+ CLAUDE.md pointer) | AGENTS.md (+ .github/copilot-instructions.md pointer) |
| Operational rules | .claude/rules/*.md | .github/instructions/*.instructions.md (thin twins) |
| File-scoped guidance | rules routed via codemap | applyTo: 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.
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
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.

