En esta guía (12 elementos)
AI-Native SDLC
AI-Native SDLC — The Artifact Chain
MANDATORY FOR ALL AI AGENTS: Every stage of work commits one artifact that the next stage reads. You MUST NOT start a stage whose input artifact does not exist and is not approved. The chain of commits — author, timestamp, SHA — IS the audit trail; there is no second system of record to reconcile it against. An agent may act up to a gate and MUST NOT pass one.
The bottleneck is no longer writing code. It is the human-speed steps around it: getting an idea into a reviewable shape, turning requirements into a plan, waiting for a first review, noticing a regression. This file is the spine that says which artifact each stage owes, who approves it, and what gets measured.
Companion files: evals.md (Test stage gate), hooks.md (where controls live), gsd-guide.md (the command surface that executes stages 1–5), adr.md (decisions that outlive a phase), observability.md (the signal the Maintain loop watches).
1. The chain
intent.md ──▶ spec.md ──▶ plan.md ──▶ diff + tests ──▶ PR + review ──▶ production ▲ │ └──────────────── band breach / scan finding / incident ◀──────────────┘Each arrow is a trigger, not a handoff meeting. Each box is a commit.
| Artifact | Answers | Owner approves |
|---|---|---|
intent.md | What problem, for whom, under what constraints | Product owner |
spec.md | What it must do, which policies bind it, what is still open | Product owner (+ tech lead if high-risk) |
plan.md | Which files change, in what order, proven by what | Engineer |
| diff + tests | Does it work, verified without a human watching | The feedback loop itself |
| PR + findings | Is it correct, safe, and what it said it would be | Human code owner — never the agent |
Why commits and not a tracker: the chain is already immutable, attributed and timestamped. A separate tool means reconciling two records, and the one nobody updates becomes the one the auditor reads.
When a legacy system is authoritative for an artifact — a compliance tool of record — designate it as the source of truth for that one artifact and link to it from the commit. Do not maintain both.
2. Stages, mapped to what exists here
| Stage | Playbook artifact | This setup | State |
|---|---|---|---|
| 1. Plan | intent.md | /gsd:capture, /gsd:explore | Gap — capture is note-shaped, not a committed intent artifact with an approver |
| 2. Design | spec.md | /gsd:spec-phase, spec-funcional.md, spec-trazabilidad.md | Strong — more rigorous than the playbook (traceability matrix, S-/B- blockers) |
| 3. Build | plan.md, CLAUDE.md, skills, hooks | /gsd:plan-phase → PLAN.md, gsd-plan-checker, /gsd:execute-phase | Strong |
| 4. Test | feedback loop, evals | rules/testing.md, testing.md, evals.md | Code testing strong; config evals newly added, not yet green |
| 5. Deploy | PR review, gates, CI/CD | /gsd:code-review, /gsd:ship, code-reviewer | Partial — no written review policy, no approval gates (hooks.md §3) |
| 6. Maintain | metric bands → intent.md | — | Gap — the loop does not close (§5) |
Where each control belongs
| Concern | Control | Stage |
|---|---|---|
| Convention, architecture, style | Guideline + skill | Build |
| Must-never-happen, cheap to check | Hook, blocking | Build |
| Configuration correctness | Eval suite | Test |
| Judgement, intent, risk | Human review | Deploy |
| Irreversible outward action | Approval gate | Deploy |
Putting any row in the wrong stage is the single most common structural mistake: an approval prompt during Build (stalls everything), or a convention left to review (found weeks late, by a person, repeatedly).
3. Institutional knowledge
CLAUDE.md — one page
Build/test/lint commands, conventions, architecture pointers, the mistakes made twice. Not research dumps, version comparison tables, or link lists.
This is currently violated. The ForgeOS
CLAUDE.mdcarries the full technology-stack research — version matrices, sources, alternatives considered, what-not-to-use. That is an ADR and adocs/context/document; every turn of every session pays for it in tokens and in dilution of the instructions that actually change behaviour. Move it out, leave pointers.
The maintenance rule is mechanical: the agent makes the same mistake twice → the correction goes in CLAUDE.md, and something of equal length comes out. A file that only grows stops being read carefully, by humans and models alike.
Skills — policy, versioned centrally
A skill is a policy with a trigger. Its frontmatter decides whether it fires at all, which makes the description the most load-bearing line in the file — and the one most likely to silently regress. That is precisely what evals.md cases with "bare": false defend.
Fifty-plus skills is past the point where the index in CLAUDE.md can be trusted by inspection. Trust it by test.
4. Metrics
Measure the process, not only the code. Coverage at 80% says nothing about whether the loop is working.
| Stage | Leading | Lagging | Source |
|---|---|---|---|
| Plan | Hours from conversation to committed intent | Intent acceptance rate | git history |
| Design | Days intent → spec | Requirements rework after build | spec commit count post-plan |
| Build | Share of PRs merging first pass | Rework cycles; drift plan vs final diff | PR history |
| Test | First-pass CI success on agent changes; eval pass rate | Change failure rate | CI, evals/results/ |
| Deploy | Time to first review | Defects escaping to production | PR timestamps, incidents |
| Maintain | Band breach → intent in queue | Repeat-incident rate | trigger logs |
The substrate already exists: ~/.claude/metrics/usage.jsonl and gsd-context-monitor.js collect per-tool telemetry today, unused for any of the above. Deriving even two rows from it beats deriving none perfectly.
Read leading indicators weekly and lagging ones monthly. A leading indicator checked monthly is a lagging indicator.
5. Closing the loop — the missing stage
Everything upstream of production is covered here. Nothing downstream is: a metric degrades, and it re-enters the pipeline only when a human notices and files it by hand.
The loop closes with deterministic detection and a tiered agent response.
# bands.yaml — version-controlled, reviewed like codemetric: ci_failure_ratewindow: 14dtiers: - sigma: 1 # noise action: log - sigma: 2 # something moved action: diagnose # read-only agent, no write access - sigma: 3 # act action: propose # agent opens a PR, or runs a pre-approved runbookDetection is a script, not a model. Mean and standard deviation over a window, Western Electric rules or equivalent. An agent asked “is this bad?” gives a different answer on Tuesday; a control chart does not. The agent’s job starts after the breach is established: diagnose, evidence, proposal.
Response at tier 3 is an intent.md in a triage queue — anomaly, evidence, proposed outcome, affected systems, open questions. It re-enters at Stage 1 and takes the same approval path as any other idea. Dismissals tune the bands. When the fix ships, the incident becomes a permanent eval case (evals.md §5).
Start with one metric that is already stable and already collected. CI failure rate is the usual first pick; post-deploy 5xx and PR cycle time follow.
For ForgeOS this is not just process hygiene — it is the product’s own thesis, dogfooded. Story → Spec → Agent → PR is exactly what tier 3 emits.
6. Parallelism
One task per session, one worktree per session (superpowers:using-git-worktrees, git-workflow.md). Split from PLAN.md, choosing tasks that touch disjoint files. Start at two or three concurrent sessions and raise the number only while review quality holds — throughput that outruns review is not throughput, it is queue.
Known hazard on this machine: parallel GSD orchestrators on one checkout collide on
.planning/STATE.mdandROADMAP.md, and race.git/config.lock, even when the source files are disjoint. The planning ledger is shared state that the worktree split does not isolate. Check forstatus: executingbefore dispatching anotherexecute-phase.
7. Roadmap
Dependency-ordered. Each item is cheap only because the one above it is done.
| # | Item | Depends on | Status |
|---|---|---|---|
| 1 | Eval suite green in CI | credential with balance | suite written, INCONCLUSIVE |
| 2 | Attribution gate | — | DONE — claude-attribution-gate.sh, 8/8 branches tested |
| 3 | Control-path protection hook | — | DONE — claude-control-path-guard.sh, 24/24 branches tested |
| 4 | REVIEW.md review policy | — | §8 |
| 5 | Trim both CLAUDE.md to one page | — | §3 |
| 6 | Two metrics derived from usage.jsonl | — | §4 |
| 7 | bands.yaml + detector on one metric | 1, 6 | §5 |
| 8 | intent.md template + approver | 4 | §2 |
| 9 | Deploy approval gate | 3 | hooks.md §2 |
| 10 | Scheduled codebase security scan | 2, 4 | — |
8. REVIEW.md — the review policy
Agent reviewers today run on implicit criteria, which makes their findings unarguable and untunable. Write the policy down, in the repo:
- Passes: Bugs and logic. Security, injection, PII. Compliance — does the diff match
spec.mdandplan.md. - Important vs Nit: defined explicitly, with a cap of five nits per review. An uncapped reviewer produces a wall that gets skimmed, and the one real finding dies in it.
- Exclusions: generated code, vendored paths, formatting owned by Spotless.
- Threshold: findings neither approve nor block. Branch protection plus a human code owner does. The agent that wrote the code has no route to approving it.
- Tuning: monthly. Rate the findings, cut the classes that were never actionable.
- Feedback: a review finding raised twice becomes a
CLAUDE.mdline or an eval case — not a third finding.
9. Anti-patterns
| Anti-pattern | Why it fails |
|---|---|
| Starting a stage without its input artifact | Nothing to review the output against |
| Agent approves its own work | No separation of duties; the audit trail is theatre |
| Approval prompts during Build | Human on the critical path, reflexive approval |
CLAUDE.md as a knowledge base | Token cost every turn, dilutes the instructions that matter |
| Config changes merged without evals | Fifty skills, no tests |
| Measuring only code quality | The loop’s own latency stays invisible |
| Declaring a production gate before rehearsing rollback | The gate is untested in the only case it exists for |
| A tracker parallel to the commit chain | Two records, one of them stale, the auditor reads the stale one |