sprint-contract
Skill1 starsChanged 6 months agoMITView on GitHub
Use before any implementation with 3+ file changes or complex tasks. Creates structured JSON contracts with default-FAIL criteria, validation commands, and quality dimensions. Based on Anthropic's long-running agents (Planner/Generator/Evaluator). Supports spec-driven development, parallel sprint execution, and fresh-context evaluation. Trigger: implement feature, run sprint, execute contract, develop feature, create a contract, spec-first, write spec, parallel sprints
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- academic-evaluationSkill
- academic-writingSkill
- agent-orchestrationSkill
- agents-md-writerSkill
- algorithmic-artSkill
- brand-guidelinesSkill
- codebase-architectureSkill
- code-reviewSkill
- commit-workflowSkill
- context-checkpointSkill
- doc-coauthoringSkill
- docxSkill
- etl-runnerSkill
- eval-runnerSkill
- feature-devSkill
- frontend-designSkill
- hpc-deucalionSkill
- internal-commsSkill
- langchainSkill
- langfuseSkill
- langgraphSkill
- llm-observability-stackSkill
- mcp-builderSkill
- neo4j-verifySkill
- pdfSkill
- pptxSkill
- project-conventionsSkill
- python-best-practicesSkill
- react-namingSkill
- security-hooksSkill
- service-verifySkill
- skill-creatorSkill
- skill-inspectorSkill
- slack-gif-creatorSkill
- theme-factorySkill
- uml-modelingSkill
- webapp-testingSkill
- web-artifacts-builderSkill
- web-debugSkill
- xlsxSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 11 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
When you need verifiable implementation criteria
- Distinctive: line 17
When unsure about scope or acceptance criteria
- Distinctive: line 36
Rule: a SEQUENCE of contracts shares ONE branch: Do NOT create a branch per contract.
- Very specific: line 59
Never create -v2, -rich, -part2, -2nd-pass for the same sequence — continue on the existing branch.
- Distinctive: line 62
If a branch for the same goal already exists (local or remote) and is not merged → reuse it, do not create a sibling.
- Very specific: line 115
MANDATORY: Read execution/LESSONS.md before starting any sprint.
- Distinctive: line 128
Write SPEC.md from template (context, requirements, architecture, acceptance criteria)
- Very specific: line 147
If NEEDS_WORK → Generator fixes → Evaluator re-grades (max 3 cycles)
- Distinctive: line 149
After all PASS → update Quality Log
- Very specific: line 154
Read execution/LESSONS.md (especially §3 Bottleneck Files and §4 Edit Tool Discipline)
- Distinctive: line 157
Run the convention validation commands to establish baseline
- Distinctive: line 159
If the Generator skips this, the Evaluator MUST reject the work.
- Distinctive: line 165
Every MUST criterion needs a Tier 3 (behavioral) validation — not just syntax.
- Distinctive: line 224
If user reaffirms the original intent after P0 → comply without re-litigation (P7).
- Distinctive: line 236
STOP and ask user when:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
Sprint Contract Skill
Creates structured implementation contracts before coding. Based on Anthropic's long-running agents research: a three-role architecture (Planner, Generator, Evaluator) with default-FAIL contracts, fresh-context evaluation, and agent-maintained handoff.
When to Activate
- Tasks with 3+ file changes
- Complex features requiring multiple steps
- Large goals that may need phased decomposition
- When you need verifiable implementation criteria
- Any implementation that needs validation
- When unsure about scope or acceptance criteria
- When user says "spec-first" or "write spec first" — activate spec-driven development
- When pipeline has independent sprints — enable parallel execution
What It Covers
- Contract Creation — JSON contract with default-FAIL criteria
- Three-Role Dispatch — Planner writes spec, Generator implements, Evaluator verifies (fresh context)
- Validation Tiers — T1-T4 system for ensuring criteria are actually testable
- Process Enforcement — Rules that prevent self-implementation and self-verification
- Phased Goals — Decompose large goals into sequential sprints
- Quality Tracking — Quality Log, Calibration Log, Harness Audit
- Spec-Driven Development — Write spec before contract for complex features
- Parallel Execution — Independent sprints execute simultaneously in groups
- Default-FAIL Contract — Every criterion starts
false; cannot be marked passing without evidence - Fresh-Context Evaluator — Separate agent with no Write/Edit tools grades from a context that never saw the build
Branching (1 branch per contract sequence)
Rule: a SEQUENCE of contracts shares ONE branch. Do NOT create a branch per contract.
| Scenario | Branch |
| Single contract | Current branch (no new branch) |
| Sequence of contracts (goal decomposed into multiple contracts) | ONE branch for the whole sequence — feature/<goal-name> |
| Hotfix / isolated experiment | Separate branch (merge to main when ready) |
Examples:
CORRECT:
feature/aegis-p2-case01-tech-agnostic
├─ contract 1 → commit
├─ contract 2 → commit
└─ contract 3 → commit
WRONG (anti-pattern):
feature/aegis-p2-case01-tech-agnostic # NO
feature/aegis-p2-case01-tech-agnostic-v2 # NO
feature/aegis-p2-case01-rich # NORules:
- Never create
-v2,-rich,-part2,-2nd-passfor the same sequence — continue on the existing branch. - Each contract in the sequence = one or more commits on the sequence branch.
- One PR per sequence branch; merge once at the end.
- If a branch for the same goal already exists (local or remote) and is not merged → reuse it, do not create a sibling.
Three Roles (Anthropic Architecture)
| Role | Job | Tools | Context |
| Planner | Expands prompt → spec, scopes sprints, writes CONTRACT.json | Read, Write | Warms up once |
| Generator | Implements against contract, no access to Evaluator's session | Read, Write, Bash | Fresh per sprint |
| Evaluator | Reviews contract BEFORE code, grades result after (fresh context, no Write/Edit) | Read, Bash (read-only) | Fresh per eval |
Rule: Generator NEVER grades its own work. Evaluator NEVER saw the build.
Trials
Non-deterministic agents (LLM-based) produce different outputs on each run. To account for variance, contracts support pass@k evaluation: run the same task k times and measure how many trials pass.
- Default:
trials: 3in the contract header - A criterion passes if it succeeds in ≥1 of k trials (pass@k)
- For deterministic changes (refactors, config),
trials: 1is sufficient
Full reference: references/trials-and-passk.md
Contract Workflow
SPEC (optional) → CONTRACT.json (default-FAIL) → NEGOTIATE (Evaluator reviews)
→ GENERATE (parallel groups) → EVALUATE (fresh context) → COMMITCRITICAL: Generator and Evaluator are SEQUENTIAL, never parallel
CORRECT:
Group 0: [S1, S3]
├─ Generator(S1) ┐
├─ Generator(S3) ├─ WAIT ALL finish
└────────────────┘
├─ Evaluator(S1) ┐
├─ Evaluator(S3) ├─ WAIT ALL finish
└────────────────┘
→ Commit
WRONG (NEVER DO THIS):
├─ Generator(S1) ┐
├─ Evaluator(S1) │ ← WRONG! Evaluator before Generator finishes
├─ Generator(S3) ├─
└────────────────┘Rule: Generators write code, Evaluators read code. Evaluators CANNOT evaluate code that doesn't exist yet.
Step 0 — Pre-Flight (Planner, BEFORE writing contract)
MANDATORY: Read execution/LESSONS.md before starting any sprint. This file contains:
- Model reliability guide (which model for which task)
- Token waste anti-patterns (subagent explosion, context loops)
- Bottleneck files (frequently-read files to avoid)
- Edit tool discipline (re-read before edit)
- Recurring debugging themes (RAG, Langfuse, Neo4j)
Then activate the project-conventions skill (AEGIS-KG specific rules) before writing the contract.
Step 0.5 — Write Spec (Spec-Driven Development, OPTIONAL)
When: Features with 3+ files, architectural decisions, or multi-sprint pipelines.
- Write SPEC.md from template (context, requirements, architecture, acceptance criteria)
- Present spec to user (max 2 revision rounds)
- User approves spec
- Save as
execution/SPEC.md
When to skip: Simple bugfixes, single-file changes, trivial refactors.
Full reference: references/spec-driven-development.md
Step 1 — Contract Creation (Planner)
- Planner writes CONTRACT.json (from template, default-FAIL: all criteria
passed: false) - If spec exists: Map spec requirements → contract criteria (add
spec_filefield) - User approves (max 3 negotiation rounds)
- If this contract is part of a sequence: confirm the sequence branch exists and reuse it (see Branching). Do NOT create a branch per contract.
- Record git baseline:
BASE_COMMIT=$(git rev-parse HEAD)and derive each sprint'sOWNED_FILESfromfiles_to_change. - LAUNCH Generator subagent(s) —
task(subagent_type="general")(parallel if in same group) - WAIT for ALL Generators to finish — NEVER launch Evaluator before Generator completes
- LAUNCH Evaluator subagent(s) —
task(subagent_type="general")(fresh context, no Write/Edit) - If NEEDS_WORK → Generator fixes → Evaluator re-grades (max 3 cycles)
- COMMIT validated sprint — Planner does this, not Generator, using
git add <OWNED_FILES> + git commit(nevergit add --allin a parallel group) - After all PASS → update Quality Log
Step 1.5 — Generator Pre-Implementation (MANDATORY)
Before Generator writes any code, it MUST:
- Read
execution/LESSONS.md(especially §3 Bottleneck Files and §4 Edit Tool Discipline) - Activate the
project-conventionsskill - Re-read all target files within the last 3 tool calls (per LESSONS §4)
- Run the convention validation commands to establish baseline
If the Generator skips this, the Evaluator MUST reject the work.
Rule: Planner NEVER implements. Planner NEVER verifies. Planner only delegates.
Validation Tiers
Every MUST criterion needs a Tier 3 (behavioral) validation — not just syntax.
| Tier | Tests | Required for |
| T1 Syntax | python -m py_compile | NICE only |
| T2 Import | python -c "from module import X" | SHOULD minimum |
| T3 Behavioral | python -c "assert function_behavior" | MUST minimum |
| T4 Integration | python -c "graph.invoke(state)" | Complex features |
MUST criterion with only T1/T2 validation → NEEDS_WORK the criterion
Full reference: references/validation-tiers.md
Process Rules (Enforcement)
| Rule | What |
| Never Self-Implement | Always dispatch Generator |
| Never Self-Verify | Always dispatch Evaluator (fresh context) |
| Commit Per Sprint | git add <OWNED_FILES> + commit per validated sprint — NEVER git add --all in a parallel group |
| Tier Enforcement | MUST requires T3+ validation |
| Read LESSONS.md First | Both Planner and Generator MUST read execution/LESSONS.md before starting |
| Activate project-conventions | Both Generator and Evaluator MUST activate the project conventions skill |
| Re-Read Before Edit | Generator MUST re-read target files within last 3 tool calls before editing |
| Validation Required | No criterion without command |
| Spec-First | Complex features (3+ files) MUST write spec before contract |
| Default-FAIL | Every criterion starts passed: false; cannot flip to true without opening evidence |
| Fresh-Context Evaluator | Evaluator has NO Write/Edit tools, never saw the build |
| Upfront Negotiation | Evaluator reviews CONTRACT.json BEFORE Generator writes code |
| Evidence Enforcement | Criterion stays false unless evidence file is Read first |
| NEVER Parallelize Generator + Evaluator | Generators write code, Evaluators read code. MUST wait for ALL Generators to finish BEFORE launching ANY Evaluator |
| Dependency Analysis | Multi-sprint pipelines MUST build dependency graph before execution |
| Parallel Groups | Independent sprints execute simultaneously in groups |
| Scoped Git Discipline | In parallel groups, every git status/diff/add MUST be path-scoped to OWNED_FILES. Never bare git diff, git status, or git add --all |
| File Conflict = HARD GATE | Same file in same parallel group BLOCKS the group → force sequential. Not a WARN |
| Commit Per Sprint | Commit each validated sprint with git add <OWNED_FILES> — atomic and attributable; no group-level git add --all |
| 1 Branch Per Sequence | A sequence of contracts shares one branch. Never branch per contract (see Branching section) |
P0 Escalation Loop
P0 (Reasoned Disagreement) is not a failure — it is a required protocol. Subagents (Generator/Evaluator) MUST raise P0 when the task conflicts with established methodology, has unconsidered repercussions, or rests on wrong assumptions. The Orchestrator MUST NOT override a valid P0 by re-dispatching the same instructions.
Loop:
1. Subagent audits the target (read-only) BEFORE executing.
2. Subagent detects conflict with methodology/reality.
→ STOPS, reports P0 with evidence (file:line, commands run).
3. Orchestrator verifies the claim (does NOT blindly accept or reject).
4. Orchestrator revises scope (Option A/B/C) and re-dispatches with the revised prompt.
5. Subagent re-audits and only then executes. No re-litigation after user reaffirms.Real cases (Methodology repo, 2026-08):
- Phase 1 PG/SG→PO/SO: plan assumed Doc 10 had live PG/SG IDs to migrate. Audit found 42 hits — all in Appendix A (DEPRECATED alias table). Migration would corrupt provenance. → P0 raised, scope revised to "skip migration", zero commits.
- Phase 2 PF 1.0: plan proposed renaming
NIST_Privacy_FW_1.1_subcategories.md→ 1.0. Audit found the canonicalNIST_PF_1.0_subcategories.mdalready existed (100 subcats). Rename would create duplicate authoritative lists. → P0 raised, Orchestrator picked Option B (field names → 1.0 + body paths → canonical), no rename.
Rules:
- Generator/Evaluator MUST audit before executing (never skip to "just do it").
- Orchestrator MUST verify a P0 claim with its own read-only checks before revising.
- If user reaffirms the original intent after P0 → comply without re-litigation (P7).
Quality Tracking
- Quality Log — Record score after each validated sprint
- Calibration Log — Track divergences between evaluator and user judgment
- Harness Audit — Every 5 sprints, review what never catches issues
Full reference: references/quality-tracking.md
Escape Hatches
STOP and ask user when:
| Situation | Action |
| 3 failures on any criterion | STOP, report to user |
| Context >70% | Activate context-checkpoint skill |
| Generator finds unexpected blocker | STOP, ask user for guidance |
| User rejects contract | Revise and re-present (max 3 rounds) |
Resources
Templates
templates/CONTRACT.json— Canonical JSON contract with default-FAIL criteriatemplates/SPEC.md— Spec-driven development template (spec-first)templates/GOAL_DECOMPOSITION.md— Phased goal decomposition templatetemplates/QUALITY_LOG.md— Quality log formattemplates/CALIBRATION_LOG.md— Calibration log for evaluator tuningtemplates/SESSION_STATE.md— Session state format
References
references/contract-workflow.md— Detailed workflow, negotiation rounds, correction loopreferences/json-contract-format.md— JSON structure, default-FAIL, evidence enforcementreferences/fresh-context-evaluator.md— Fresh-context evaluator pattern, calibrationreferences/phased-decomposition.md— When to decompose, phased goal workflowreferences/validation-tiers.md— Tier system examples and checklistreferences/quality-tracking.md— Quality Log, Calibration Log, Saturation Detection, Harness Auditreferences/git-integration.md— Commit strategy, message format, branch management, security hooksreferences/execution-phases.md— All phases including Phase 0.5 (Spec), pre-flight checks, generator/evaluator templatesreferences/generator-prompt-template.md— Full Generator prompt with tier enforcementreferences/evaluator-prompt-template.md— Full Evaluator prompt with tier checksreferences/pipeline-template.md— Multi-sprint pipeline with parallel groups, escape hatchesreferences/trials-and-passk.md— Trials, pass@k evaluation, and scoringreferences/parallel-execution.md— Dependency graph, parallel groups, commit strategy, conflict detectionreferences/spec-driven-development.md— Spec-first workflow, spec→contract mapping, quality checklist
Use When
You need a systematic implementation approach with verifiable criteria and independent verification, aligned with Anthropic's long-running agents research.
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.

