Skip to content

docs: give the repo an operating contract for its AI squad - #37

Merged
devRMA merged 5 commits into
fix/standardsfrom
docs/agent-squad
Nov 20, 2026
Merged

devRMA merged 5 commits into
fix/standardsfrom
docs/agent-squad

Conversation

@devRMA

@devRMA devRMA commented Sep 14, 2026

Copy link
Copy Markdown
Owner

6 of 6 — stacked. Base: fix/standards (#36).

The rules an agent needed lived in one file describing a generic React project. This product is a labor-law calculator: the numbers on screen are what someone decides their month on, and a beautiful screen showing a wrong INSS bracket is the worst defect this repo can ship. The contract says that now, and everything else follows from it.

AGENTS.md — the single source of truth

For every runtime: Claude Code, Antigravity, Codex, Cursor, Copilot. .agents/ is the source; .claude/ and agent/ are symlinks into it, so nobody edits a copy.

Ten agents, each owning one decision domain and forbidden from the others' — that separation is what makes the output better than one agent doing everything.

opus sonnet
judgment and taste decide product-manager · labor-law-analyst · product-designer · content-writer · tech-lead
verification against a written standard frontend-dev · qa-engineer · web-standards-auditor · refactor-scout · release-manager

The portfolio squad's tech-recruiter has no analogue here. Its seat belongs to labor-law-analyst, because "was this worth building" matters less than "is this number legally correct". It blocks at G2, before anyone draws a screen, and again at G6 against what shipped. It verifies figures with search rather than recall, every number carrying its norm, effective date and source URL. Its rejection is not overruled by design, scope or schedule — only by the human, recorded in the spec.

That gate exists because of an asymmetry: design and copy can be revised at the cost of a bounce, but a wrong tax bracket that ships is a user making a financial decision on a number this project invented.

G1 spec → G2 law [blocking] → G3 design ∥ copy → G4 plan → G5 build
   → G6 qa ∥ audit ∥ law-check ∥ ponytail → G7 docs → G8 release
   → G9 preview → G10 compound

A gate passes or rejects — there is no partial pass. Every rejection routes through the tech-lead. Two bounces per gate is the ceiling; on the third the pipeline stops and hands the impasse to a human. Reviewing agents never edit source files — a reviewer who fixes stops being able to see.

PRODUCT.md

Who it serves, what it may claim, and an Evidence on hand table: anything not in that table is not a claim the product may make, in the UI or in the README. Plus what it will deliberately never do, recorded so no agent proposes them as improvements.

DESIGN.md

The system as actually shipped — 118 tokens, every colour pair carrying its measured contrast ratio, reconciled against app/globals.css after implementation deviated from the plan in thirteen places.

.specs/ and the rebuild contract

Delete app/, components/, lib/ and hooks/, hand an agent .specs/ plus PRODUCT.md and DESIGN.md, and it rebuilds a materially equivalent calculator — including every legal table, to the centavo.

0001-foundation is that document for the product as it stands: spec, the full legal record with sources and worked examples, design, every pt-BR string, the build order, and the decisions log. docs-check.mjs enforces the structure and blocks the first commit when it drifts.

.agents/memory/ — the part that compounds

A lesson is written when a gate rejects, confirmed when it prevents a repeat, promoted into a rule at three confirmations, and retired when it goes stale. Hard cap of thirty active lessons: at the cap nothing new is written until something is promoted or retired. The pressure is the point — this is where learning systems fail, remembering everything until nothing is readable.

Also here

The skills the agents load are vendored and hashed in skills-lock.json, because an agent's behaviour is only reproducible if the instructions it read are pinned with the code that read them.

And the README is rewritten. It used to open with the tooling and lead with which AI wrote it; a reader arriving at a labor-law calculator wants to know what it computes and whether they can trust the number. It opens with the three questions the product answers and lists what is computed with the article that governs it.

Verified

node .agents/tools/docs-check.mjs — 0 failures, 0 warnings. All ten agents present with intact symlinks.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
workload Ready Ready Preview Nov 20, 2026 8:27am UTC

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

devRMA and others added 4 commits September 14, 2026 17:18
Skills are instructions the agents load at runtime, so an agent's behaviour
is only reproducible if the skill it read is pinned with the code that read
it. skills-lock.json records the source and content hash of each one.

.agents/skills is the source; .claude/skills and agent/skills are symlinks
into it, so Claude Code and every runtime that reads the universal path see
the same files rather than three copies drifting apart.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The rules an agent needed lived in one file that described a generic React
project. This product is a labor-law calculator: the numbers on screen are
what someone decides their month on, and a beautiful screen showing a wrong
INSS bracket is the worst defect this repo can ship. The contract now says
that, and everything else follows from it.

AGENTS.md is the single source of truth for every runtime — Claude Code,
Antigravity, Codex, Cursor. Ten agents, each owning one decision domain and
forbidden from the others', run a gated pipeline where the law is settled
before anyone draws a screen: labor-law-analyst blocks at G2 and again at
G6, and its rejection is not overruled by design, scope or schedule.

PRODUCT.md records who the product serves, what it may claim, and the
things it will deliberately never do, so no agent proposes them as
improvements. DESIGN.md is the system as actually shipped, every colour pair
carrying its measured contrast ratio.

.specs/ holds the rebuild contract: delete app/, components/, lib/ and
hooks/, hand an agent .specs/ plus PRODUCT.md and DESIGN.md, and it rebuilds
a materially equivalent calculator — including every legal table, to the
centavo. 0001-foundation is that document for the product as it stands, and
docs-check.mjs enforces the structure before any commit.

.agents/memory/ is the part that compounds: a lesson is written when a gate
rejects, confirmed when it prevents a repeat, promoted into a rule at three
confirmations, and retired when it goes stale. Thirty active lessons is a
hard cap — the pressure to promote is the point.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The old README opened with the tooling and led with which AI wrote it. A
reader arriving at a labor-law calculator wants to know what it computes and
whether they can trust the number.

It now opens with the three questions the product answers, states the promise
that every number is traceable to a norm in force, and lists what is computed
with the article that governs it. The stack section says what the choices buy
rather than that they exist, and the AI section documents the squad, the
gates and the rebuild contract so a contributor — human or agent — knows where
the rules live.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lessons/ and archive/ start empty, so git dropped them and docs-check.mjs
crashed on a squad that had not learned anything yet.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: GPT-6.2-sol <noreply@openai.com>
devRMA added a commit that referenced this pull request Nov 20, 2026
Co-Authored-By: GPT-6.2-sol <noreply@openai.com>
@devRMA devRMA self-assigned this Nov 20, 2026
@devRMA
devRMA merged commit 00cc57e into main Nov 20, 2026
4 checks passed
@devRMA
devRMA deleted the docs/agent-squad branch November 20, 2026 20:29

This branch was successfully deployed

1 active deployment
Preview — 113d124b Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants