Synthesize Brief
[claude-django] Synthesize/update docs/PROJECT.md from docs/** input documents (via feature branch + PR).
---
model: sonnet
description: "[claude-django] Synthesize/update docs/PROJECT.md from docs/** input documents (via feature branch + PR)."
---
Recursively synthesize/update `docs/PROJECT.md` from input documents in `docs/**`. Always commits via feature branch + PR — NEVER direct push to `main`.
## Log
```bash
python scripts/log-cmd.py /synthesize-brief $ARGUMENTS
Input
Optional $ARGUMENTS:
- nothing -> full re-synthesis of all input documents in
docs/**. - a subpath (e.g.
docs/briefs/) -> limit input discovery to that subtree.
Steps
Discovery. List files under
docs/**EXCLUDING service folders and files (they are project bookkeeping, not source briefs):- Folders:
docs/api/,docs/decisions/,docs/plans/ - Files:
docs/WORKLOG.md,docs/STUBS.md,docs/lessons.md,docs/APP_README.md,docs/PROJECT.md(the output itself)
Supported extensions:
.md,.txt— read viaRead..pdf— invokeanthropic-skills:pdfskill..docx— invokeanthropic-skills:docxskill.- Images (
.png,.jpg,.jpeg,.webp) — described visually by the multimodal agent.
Any other binary extension (
.xlsx,.zip,.fig, ...) is listed under Source documents with the noteunprocessed: unsupported format.- Folders:
Delegate to
brief-synthesizer(subagent_type: "brief-synthesizer"). Pass the discovered file list. The agent producesdocs/PROJECT.md. Three fields are required — the brief is NOT complete until all three are resolved:- Maturity stage (
demo / prototype / PoC / MVP / production / other) — controls pipeline depth and Quality Gate rigour (@.claude/rules/project-maturity.md). If absent from all source documents, it becomes the first Open Question and the orchestrator asks the user viaAskUserQuestion(options: demo / prototype / PoC / MVP / production / other) before the brief is finalized. - Contract (
CONTRACT_VERSION=vX.Y.Z, repoVadayI/claude-api-contract) — whichclaude-api-contracttag this backend consumes. Without it/preflightwill fail. If absent from sources, add as Open Question: "Which claude-api-contract version does this backend consume?". - Definition of Done §7 — standard Django CI gates (pre-filled) plus project-specific criteria agreed with the team. If no source provides project-specific criteria, ask the user explicitly — the section must never remain
{TODO}. "None beyond standard gates" is a valid explicit answer.
The fixed 9 sections remain: Purpose, Domain, Scope (in/out), Key requirements, Non-functional requirements, Constraints, Stakeholders, Definition of Done (§7), Open questions, plus a Source documents table.
- Maturity stage (
Branch + PR (orchestrator handles git — agent is forbidden from running git):
git checkout main && git pullgit checkout -b docs/synthesize-brief-$(date +%Y%m%d)- Agent has written
docs/PROJECT.md; verify it exists and is non-empty. git add docs/PROJECT.mdgit commit -m "docs: synthesize project brief from docs/"git push -u origin docs/synthesize-brief-$(date +%Y%m%d)gh pr create --fill --title "docs: synthesize project brief"
Log + summary. Append to
.claude/memory/command-log.jsonland print: how many source documents were read, which wereunprocessed, the PR URL, whether maturity stage and DoD were resolved or remain as Open Questions, and the next step (review the PR diff before merging).
Hard limits
- Never direct-commit or push to
main— always a feature branch + PR. - Never invent facts not in source documents. If a section has no source, the agent writes
TODO — source missingand the Source documents table makes the gap auditable. Exception: the standard DoD gates are pre-filled from the template (they are always required, not invented). - Never write outside
docs/PROJECT.md(no edits to source docs, no new files, notemplates/writes). - The brief is incomplete while any of the three required fields (maturity stage, contract, DoD project-specific criteria) remains unresolved — surface them to the user before closing.
Run AFTER
/bootstrapMode A, BEFORE/preflightand the first feature pipeline. Re-runnable as briefs evolve — each run opens its own dated PR.
Maintain Synthesize Brief?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Synthesize Brief on getagentictools](https://getagentictools.com/loops/vadayi-synthesize-brief?ref=badge)