一键导入
dev-loop
The full develop-validate-test-review-improve loop. Use as the primary workflow after implementing any feature or fix.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
The full develop-validate-test-review-improve loop. Use as the primary workflow after implementing any feature or fix.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate a Word document from ingested source documents using the agnostic Document tree (CommonMark/Pandoc-aligned)
Generate a single Document (Word/PowerPoint) from all source documents in a collection, with attributions back to each source
Generate a PDF from ingested source documents using the agnostic Document tree
Generate a PowerPoint deck from ingested source documents using the agnostic Document tree (parametrised by slide_count, style, audience, tone)
Generate an Excel workbook (.xlsx) from ingested source documents — tabular with charts, formulas, KPI cells
Find PII (emails, phones, SSN, credit cards, IBANs, names, addresses, DOB) in an ingested document; return redaction plan
| name | dev-loop |
| description | The full develop-validate-test-review-improve loop. Use as the primary workflow after implementing any feature or fix. |
| argument-hint | ["description of what was implemented"] |
Run the full agent development loop: plan → validate → test → review → improve (repeat until all pass).
Project config: Before starting, read
harness.config.shat the project root to getHARNESS_PROJECT_SLUG,BACKEND_RUN, andFRONTEND_DIR. All contract paths and marker commands below use these values.
TEST PLAN ──→ VALIDATE ──→ TEST ──→ REVIEW ──→ (all pass?) ──→ ENTROPY CHECK ──→ DOC CHECK ──→ (docs pass?) ──→ SCORECARD ──→ DONE
↑ │ no │ no
└──────── IMPROVE ←───────────────┘←──────────────────────────────────────────┘
Max iterations: 5. If not converging, stop and report what was tried.
Before any validation, analyze what changed and produce a test contract and a doc contract — machine-readable lists of what MUST be tested and what docs MUST be updated before the loop can exit. The test-inspector in Step 3 verifies the test contract; Step 5 verifies the doc contract. Uncovered CRITICAL/HIGH items in either contract cause a FAIL.
Run git diff main --name-only (or git diff HEAD~1 if on main) to identify changed files. Group changes into independently testable features/behaviors. Name them F1, F2, ..., Fn.
For each feature, identify:
Score each feature on three axes (Low/Medium/High):
| Axis | Low | Medium | High |
|---|---|---|---|
| Blast radius | Internal helper | Single endpoint | Cross-service, user-facing |
| Likelihood of failure | Simple CRUD, no new logic | New logic, but follows patterns | New integration, multiple systems, async |
| Detection difficulty | Loud crash (500, TypeError) | Wrong response shape | Silent wrong data, subtle state corruption |
Derive overall risk: any axis High → CRITICAL. Two Medium → HIGH. Otherwise MEDIUM/LOW.
For CRITICAL and HIGH risk features, list required test cases using equivalence partitioning:
For MEDIUM risk: happy path + 1 error path minimum. For LOW risk: 1 smoke test sufficient.
For each test case, specify which layer:
[pytest] — backend integration test[postman] — Newman regression test (if endpoint added/changed)[playwright] — browser E2E test (if UI added/changed)[manual] — curl / Playwright MCP verification against running appRead HARNESS_PROJECT_SLUG from harness.config.sh. Write the contract to /tmp/.test-contract-<HARNESS_PROJECT_SLUG>.md:
# Test Contract — [feature description]
Generated: [timestamp]
## Features
| # | Feature | Risk | Required Layers |
|---|---------|------|-----------------|
| F1 | ... | CRITICAL | pytest, postman, manual |
| F2 | ... | HIGH | pytest, manual |
| F3 | ... | LOW | pytest (smoke) |
## Required Test Cases
- [ ] F1: Happy path — [description] [pytest]
- [ ] F1: Auth guard — [description] [pytest]
- [ ] F1: Error — [description] [pytest]
- [ ] F1: Regression — [description] [postman]
- [ ] F2: Happy path — [description] [pytest]
...
## Coverage Gaps (pre-existing)
List any existing features that are ALREADY untested (from prior work).
Mark as `[gap]` — these are informational, not blocking.
Analyze the same git diff from Step 0a. For each changed file, determine what documentation needs updating. Write the contract to /tmp/.doc-contract-<HARNESS_PROJECT_SLUG>.md:
Rules for what triggers a doc update:
| Change detected | Doc action required | Priority |
|---|---|---|
| New/changed endpoint | Postman collection needs updating | HIGH |
| New/changed endpoint | docs/dev/testing.md may need new test instructions | MEDIUM |
| Cross-service decision made | ADR should be created in docs/adr/ | HIGH |
| Execution plan phase completed | EP checkboxes need updating | HIGH |
| Tech debt item fixed | docs/exec-plans/tech-debt-tracker.md needs updating | MEDIUM |
| New script/file added | Reference in CLAUDE.md if agent-facing | HIGH |
| Hooks/skills/agents changed | docs/design/enforcement-architecture.md needs updating | HIGH |
| New pattern/convention | docs/design/core-beliefs.md if it should be enforced | MEDIUM |
Contract format:
# Doc Contract — [feature description]
Generated: [timestamp]
## Required Doc Updates
- [ ] Postman collection updated for POST /evals/runs [HIGH]
- [ ] ADR created for agent UUID resolution pattern [HIGH]
- [ ] EP006 checkboxes updated [HIGH]
- [ ] enforcement-architecture.md updated for new hook markers [HIGH]
- [ ] CLAUDE.md references check-fsd.sh [MEDIUM]
## Not Applicable
- No tech debt items fixed
- No new conventions introduced
If no doc updates are required, write the contract with an empty "Required Doc Updates" section and list all categories as "Not Applicable". The contract must always exist after Step 0 so the stop-gate can verify it.
This step runs ONCE at the start (together with the test contract). It does not repeat on loop iterations. If the loop cycles back from Step 5, the contract remains — the agent updates the docs and re-verifies.
Run all quality checks via the unified entrypoint. Stop and fix on first failure before proceeding.
./scripts/check-all.sh # all checks (backend + frontend)
./scripts/check-all.sh backend # backend only (if only .py changed)
./scripts/check-all.sh frontend # frontend only (if only .ts/.tsx changed)
Pipeline: ruff check → ruff format → ty check (advisory) → python -m checks (advisory) → pytest → tsc → eslint → build.
If any hard failure (✗) → fix the issues and re-run validation. Advisory warnings (⚠) → note them but continue to Step 2.
# Read BACKEND_RUN from harness.config.sh
$BACKEND_RUN pytest -x -q
If API changed, also run Newman:
docker run --rm --network host -v "$(pwd)/postman:/etc/newman" \
postman/newman:latest run collections/agent-builder-collection.json \
--environment environments/localhost-environment.json
If frontend changed:
cd $FRONTEND_DIR && npm run build
This is mandatory for every change — not just infrastructure. Pytest runs in a test container, not against the real running app. You must verify your changes work end-to-end against the live local stack.
Use the test contract from Step 0 — every [manual] item must be executed here. For each:
playwright-cli, Docker command)Tools for E2E verification:
curl against localhost:8000 (backend), localhost:8001 (registry)playwright-cli — see /playwright skill for commands. Use snapshot to inspect page, screenshot to capture proof.playwright-cli video-start / video-stop to record a flowRun every scenario against the running services. Check off [manual] items in the contract as you verify them.
Do not trust syntax checks or pytest alone. Three bugs in a shell script passed bash -n and full pytest but failed when actually executed against the running system.
If any test fails → fix the issues, return to Step 1.
Run specialized agent reviews based on what changed:
.py files → delegate to arch-guardian, security-auditor, ddd-solid-reviewer.ts/.tsx files → delegate to fsd-guardianWhen delegating to test-inspector, include in the prompt:
Read the test contract at
/tmp/.test-contract-<HARNESS_PROJECT_SLUG>.md. For each CRITICAL/HIGH item marked- [ ](unchecked), verify whether a corresponding test exists. If covered, update the line in the contract from- [ ]to- [x]. Report uncovered CRITICAL items as FAIL and uncovered HIGH items as FAIL. MEDIUM/LOW uncovered items are WARN.
Why the edit matters: The stop-gate hook (quality-gate.sh) mechanically verifies the contract — it greps for unchecked CRITICAL/HIGH lines. If any remain, the agent cannot exit the session. test-inspector checking off items is what unlocks the gate.
Run applicable reviewers in parallel. Collect all findings.
If any reviewer reports FAIL → fix the issues, return to Step 1. If only WARN findings → report them but continue (human can decide).
If this was a major feature (multiple files, new patterns introduced), run a targeted entropy sweep:
--dry-run and the scope of changed filesSkip this step for small changes (single-file bug fixes, config tweaks).
Verify the doc contract written in Step 0e. This is the same mechanical pattern as test-inspector verifying the test contract.
/tmp/.doc-contract-<HARNESS_PROJECT_SLUG>.md- [ ] item in "Required Doc Updates":
- [ ] to - [x]Why this matters: The stop-gate hook (quality-gate.sh) mechanically verifies the doc contract — it greps for unchecked HIGH lines. If any remain, the agent cannot exit the session. Checking off items here is what unlocks the gate.
Run ./scripts/check-docs.sh after any doc edits to verify links and index completeness.
If any HIGH items uncovered → update the docs, check them off, return to Step 1. If only MEDIUM items uncovered → report them as WARN but continue to Step 6.
Only if all checks passed and all tests passed, regenerate the quality scorecard to capture the current state:
./scripts/generate-scorecard.sh --fast
This updates docs/generated/quality-scorecard.md and appends to score-history.csv. Uses --fast (mechanical only) during the loop — full Opus analysis is for on-demand runs.
Skip this step if tests failed or were skipped.
When all checks pass, all tests pass, and all reviewers report PASS/WARN:
# Read HARNESS_PROJECT_SLUG from harness.config.sh first
touch /tmp/.claude-reviewed-<HARNESS_PROJECT_SLUG>
[gap] items noted for future work