diff --git a/README.md b/README.md index ba19cda..ff331a7 100644 --- a/README.md +++ b/README.md @@ -197,15 +197,15 @@ Pipeline control: | Role | Agent file | Writes | | ------------ | ------------------------ | -------------------------- | -| Orchestrator | `agents/orchestrator.md` | — (routes work) | +| Orchestrator | `agents/orchestrator.md` | `.team/07-build.md` (aggregation) | | Analyst | `agents/analyst.md` | `.team/01-research.md` | | PM | `agents/pm.md` | `.team/02-prd.md` | | PO | `agents/po.md` | `.team/03-backlog.md` | | UX Designer | `agents/ux.md` | `.team/04-ux.md` | | Brand | `agents/brand.md` | `.team/05-brand.md` | | Architect | `agents/architect.md` | `.team/06-architecture.md` | -| Frontend | `agents/fe.md` | `.team/07-build.md` | -| Backend | `agents/be.md` | `.team/07-build.md` | +| Frontend | `agents/fe.md` | `.team/07-build-fe.md` | +| Backend | `agents/be.md` | `.team/07-build-be.md` | | QA | `agents/qa.md` | `.team/08-qa.md` | | Security | `agents/security.md` | `.team/09-security.md` | | Docs | `agents/docs.md` | `.team/10-docs.md` | @@ -245,6 +245,8 @@ Every stage writes a markdown artifact: 12-launch.md ``` +The build stage also writes intermediate `.team/07-build-fe.md` and `.team/07-build-be.md`; the orchestrator consolidates them into `07-build.md`. + Project-local agent memory also lives under `.team/`: ``` diff --git a/README.tr.md b/README.tr.md index 97040f7..e640cf2 100644 --- a/README.tr.md +++ b/README.tr.md @@ -197,15 +197,15 @@ Boru hattı kontrolü: | Rol | Ajan dosyası | Yazdığı çıktı | | -------------- | ------------------------ | -------------------------- | -| Orkestratör | `agents/orchestrator.md` | — (işi dağıtır) | +| Orkestratör | `agents/orchestrator.md` | `.team/07-build.md` (birleştirme) | | Analist | `agents/analyst.md` | `.team/01-research.md` | | PM | `agents/pm.md` | `.team/02-prd.md` | | PO | `agents/po.md` | `.team/03-backlog.md` | | UX Tasarımcısı | `agents/ux.md` | `.team/04-ux.md` | | Marka | `agents/brand.md` | `.team/05-brand.md` | | Mimar | `agents/architect.md` | `.team/06-architecture.md` | -| Frontend | `agents/fe.md` | `.team/07-build.md` | -| Backend | `agents/be.md` | `.team/07-build.md` | +| Frontend | `agents/fe.md` | `.team/07-build-fe.md` | +| Backend | `agents/be.md` | `.team/07-build-be.md` | | QA | `agents/qa.md` | `.team/08-qa.md` | | Güvenlik | `agents/security.md` | `.team/09-security.md` | | Doküman | `agents/docs.md` | `.team/10-docs.md` | @@ -245,6 +245,8 @@ Her aşama bir markdown artefaktı yazar: 12-launch.md ``` +Build aşaması ayrıca ara çıktı olarak `.team/07-build-fe.md` ve `.team/07-build-be.md` üretir; orkestratör bunları `07-build.md` içinde birleştirir. + Proje-yerel ajan hafızası da `.team/` altında bulunur: ``` diff --git a/agents/be.md b/agents/be.md index 378e5e4..71cf398 100644 --- a/agents/be.md +++ b/agents/be.md @@ -53,13 +53,15 @@ Your process: 1. Read architecture from .team/06-architecture.md 2. Implement backend API and database 3. Write tests for backend code -4. Write to .team/07-build.md +4. Write your backend report to .team/07-build-be.md Rules: - Code and comments in English - Follow existing project conventions - Write tests for your code - Do not design architecture; implement what architect specifies +- Do not write `.team/07-build.md`; the orchestrator consolidates the specialist reports +- Keep to the backend scope the orchestrator assigned; do not change shared contracts or frontend-owned files ## Memory diff --git a/agents/fe.md b/agents/fe.md index f6fb129..75a5c03 100644 --- a/agents/fe.md +++ b/agents/fe.md @@ -54,13 +54,15 @@ Your process: 2. Read UX design from .team/04-ux.md 3. Implement frontend components 4. Write tests for frontend components -5. Write to .team/07-build.md +5. Write your frontend report to .team/07-build-fe.md Rules: - Code and comments in English - Follow existing project conventions - Write tests for your components - Do not design architecture; implement what architect specifies +- Do not write `.team/07-build.md`; the orchestrator consolidates the specialist reports +- Keep to the frontend scope the orchestrator assigned; do not change shared contracts or backend-owned files ## Memory diff --git a/agents/orchestrator.md b/agents/orchestrator.md index 864a0da..206944d 100644 --- a/agents/orchestrator.md +++ b/agents/orchestrator.md @@ -56,6 +56,25 @@ Communication rules: Current pipeline stages: research → prd → backlog → ux → brand → architecture → build → qa → security → docs → release → launch +## Build stage + +Frontend and backend can run in parallel. Give each specialist a disjoint file scope; shared contracts and types stay with the architect's contract and get a single owner. + +Each specialist writes its own report: +- `fe` → `.team/07-build-fe.md` +- `be` → `.team/07-build-be.md` + +Wait for every specialist requested for the build. If one fails, is cancelled, or does not produce a report, the build stage is incomplete: say what remains and do not write `.team/07-build.md` as complete. + +When all requested specialists finish successfully, read their reports and write the consolidated `.team/07-build.md`: +- what was built, per ticket and acceptance criterion; +- tests and evidence from each specialist; +- links to the source reports; +- known gaps, shortcuts and risks; +- an explicit statement that every requested specialist completed. + +Aggregation must be idempotent: rerunning it must not duplicate sections or drop a specialist. + ## Memory lifecycle Read `skills/team-memory/SKILL.md` before seeding, dispatching or compacting memory. diff --git a/commands/build.md b/commands/build.md index 6d08d5c..a48f66f 100644 --- a/commands/build.md +++ b/commands/build.md @@ -1,9 +1,9 @@ --- name: build -description: "Run the build stage: call the frontend and backend agents according to the brief of the build stage in team.yaml, and write the output to .team/07-build.md." +description: "Run the build stage: call the frontend and backend agents according to the brief in team.yaml. Each writes a specialist report; consolidate them into .team/07-build.md only after every requested specialist finishes successfully." agent: orchestrator --- -Run the build stage: call the frontend and backend agents according to the brief of the build stage in team.yaml, and write the output to .team/07-build.md. +Run the build stage: call the frontend and backend agents according to the brief in team.yaml. Each writes a specialist report; consolidate them into .team/07-build.md only after every requested specialist finishes successfully. $ARGUMENTS diff --git a/docs/agents.md b/docs/agents.md index ec990e7..1374d2c 100644 --- a/docs/agents.md +++ b/docs/agents.md @@ -6,7 +6,7 @@ OpenCode Team defines 14 agent roles in `agents/*.md`. Every role uses `mode: al - **`@agent-name`** to mention one directly - the orchestrator can launch it as a subagent through the `task` tool -The orchestrator is the default agent. It routes an idea through the pipeline and asks for approval at each gate. A specialist owns one stage and writes that stage's artifact. +The orchestrator is the default agent. It routes an idea through the pipeline and asks for approval at each gate. A specialist owns one stage and writes that stage's artifact. In the build stage, `fe` and `be` write specialist reports and the orchestrator consolidates them into `.team/07-build.md`. ## Direct invocation diff --git a/docs/pipeline.md b/docs/pipeline.md index 6110151..119b19a 100644 --- a/docs/pipeline.md +++ b/docs/pipeline.md @@ -19,6 +19,8 @@ OpenCode Team runs an idea-to-launch pipeline with 12 stages. Each stage is a ga | release | devops | `.team/11-release.md` | Yes | | launch | marketing | `.team/12-launch.md` | Yes | +The build stage has two writers: `fe` writes `.team/07-build-fe.md` and `be` writes `.team/07-build-be.md`. The orchestrator consolidates both into `.team/07-build.md` only after every requested specialist finishes successfully. + ## Profiles `team.yaml` defines two profiles. The orchestrator picks `new` in an empty directory and `change` in an existing repository, unless you say otherwise. diff --git a/docs/reference/commands.md b/docs/reference/commands.md index b7e5ae0..f9aa684 100644 --- a/docs/reference/commands.md +++ b/docs/reference/commands.md @@ -9,7 +9,7 @@ The 19 slash commands defined in `commands/*.md`. Edit the command file, not thi | `/architecture` | Design the technical architecture. Write the output to .team/06-architecture.md. First read .team/02-prd.md and .team/04-ux.md. | `architect` | | `/backlog` | Break the PRD down into work items. Write the output to .team/03-backlog.md. First read .team/02-prd.md. | `po` | | `/brand` | With the team-brand skill: concept -> SVG -> test -> color -> favicon set -> guidelines. | `brand` | -| `/build` | Run the build stage: call the frontend and backend agents according to the brief of the build stage in team.yaml, and write the output to .team/07-build.md. | `orchestrator` | +| `/build` | Run the build stage: call the frontend and backend agents according to the brief in team.yaml. Each writes a specialist report; consolidate them into .team/07-build.md only after every requested specialist finishes successfully. | `orchestrator` | | `/docs` | Write technical documentation. Write the output to .team/10-docs.md. | `docs` | | `/launch` | Write the marketing and launch plan. Write the output to .team/12-launch.md. | `marketing` | | `/memory` | Inspect, seed, or compact project-local agent memory. | `orchestrator` | diff --git a/scripts/validate.rb b/scripts/validate.rb index 3b82ed9..2fe2870 100755 --- a/scripts/validate.rb +++ b/scripts/validate.rb @@ -65,6 +65,25 @@ def check(errors, path, ok, msg) end end +# --- one writer per stage artifact --- +# Write paths live in prose. Flag two roles being told to write the same .team +# artifact; parallel specialists would otherwise overwrite each other. +writes = Hash.new { |h, k| h[k] = [] } +Dir[File.join(ROOT, "agents/*.md")].sort.each do |path| + role = File.basename(path, ".md") + File.readlines(path).each do |line| + next if line.match?(/do not write/i) + next unless line.match?(/\bwrite\b/i) + + line.scan(/\.team\/\d{2}-[a-z-]+\.md/i) { |artifact| writes[artifact] << role } + end +end +writes.each do |artifact, roles| + next if roles.uniq.size < 2 + + errors << "agents/*.md: #{roles.uniq.join(", ")} all write #{artifact}; use one writer per artifact" +end + # --- skills --- skills.each do |path| rel = path.sub("#{ROOT}/", "") diff --git a/skills/team-build/SKILL.md b/skills/team-build/SKILL.md index d4c8fa5..9312b21 100644 --- a/skills/team-build/SKILL.md +++ b/skills/team-build/SKILL.md @@ -77,13 +77,15 @@ The build is done only when all of these are true: ## Handoff to QA -After implementation and tests are green, write `.team/07-build.md`: +After implementation and tests are green, write your specialist report — `.team/07-build-fe.md` for frontend, `.team/07-build-be.md` for backend: - What was built, per ticket and per acceptance criterion. - Tests added, with the criterion each one covers. - Exact commands run and their exact output (or "not run"). - Known gaps, shortcuts and risks. +The orchestrator consolidates the specialist reports into `.team/07-build.md` after every requested specialist has completed successfully. Do not write the consolidated report yourself. + Then hand off to the **QA stage**: the `qa` agent ([agents/qa.md](../../agents/qa.md)) reads `.team/06-architecture.md` and `.team/07-build.md`, follows the `team-qa` skill ([SKILL.md](../team-qa/SKILL.md)), and independently verifies the acceptance criteria. Do not report the QA stage as passed from the build stage; only QA can do that. > Adapted from the MIT-licensed test-driven development skill by Matt Pocock. See THIRD_PARTY_NOTICES.md. diff --git a/team.yaml b/team.yaml index 7f1eccf..c1cbb7f 100644 --- a/team.yaml +++ b/team.yaml @@ -126,7 +126,10 @@ stages: support: [be] brief: > Implement the approved architecture. Tests are written first. Frontend and - backend work can run in parallel; merge once both are done. + backend work can run in parallel. Each specialist writes its own report + (.team/07-build-fe.md, .team/07-build-be.md); the orchestrator consolidates + them into .team/07-build.md only after every requested specialist finishes + successfully. - id: qa title: Testing and quality assurance diff --git a/team/AGENTS.md b/team/AGENTS.md index b8763b9..50f5c56 100644 --- a/team/AGENTS.md +++ b/team/AGENTS.md @@ -35,7 +35,7 @@ research → prd → backlog → ux → brand → architecture → build → qa ## Artifacts -Every stage writes one markdown file into `.team/`: +Every stage writes one markdown file into `.team/`. The build stage additionally produces `fe` and `be` specialist reports (`.team/07-build-fe.md`, `.team/07-build-be.md`), which the orchestrator consolidates into `.team/07-build.md`. ``` .team/01-research.md