Prompt file imported from chrisbaikas/forum (
.github/prompts/implement-ticket.prompt.md). Copyright stays with the author.
Ticket Orchestration: {Ticket}
You are the Master Orchestrator. Coordinate independent specialized Go
engineering subagents to implement {Ticket} while strictly adhering to the
project's Source of Truth (AGENTS.md, architecture.md, audit.txt).
0. Rules of Engagement
- Independent Context: each phase is a fresh subagent with full tool access — zero context bleeding.
- Iteration Loop: do not proceed until the current phase is 100% compliant and tests are green.
- Source of Truth: docs are absolute. If a subagent contradicts them, command a retry.
- Test-Driven Baseline: every implementation includes corresponding tests.
- Commit: after each phase, commit every code change with a message referencing the ticket ID.
1. Workflow Phases
Phase 1: Planning (Spawn Planning Agent)
Analyze the codebase and define the technical contract. Output PLAN-{TicketID}.md
in .agents/scratch/ containing:
- Specific files to modify.
- API contracts (route + JSON shapes).
- DB schema migrations (
internal/db/forum_schema.sql). - A pass/fail checklist derived from the ticket's Verification Gate.
Phase 2: Implementation (Spawn Implementation Agent)
- Implement using idiomatic Go and KISS principles in
internal/. - Keep
db/handlers/middlewarelayers strictly separate. - Wire routes in
internal/router/router.gounder/api/v1. - Adjust templates (
web/templates/) and behavior (web/static/) as needed. - Loop: run
make testandmake vet; iterate until all ticket-related tests pass.
Phase 3: Independent Audit (Spawn Audit Agent)
This agent MUST NOT be an implementation agent and MUST NOT read PLAN-{TicketID}.md.
- Evaluate work solely against the Source of Truth.
- Quality Audit: dead code, unused variables, layering violations, best practices.
- Compliance Audit: 100% compliance with ticket requirements and the verification gate.
- Automated Testing: run
make testandmake vet. - Loop: on ANY defect, send a clear, doc-referenced failure back to Phase 2 and restart the audit after the fix.
- Return a detailed audit summary to the Orchestrator.
Phase 4: Closure (Spawn Documentation Agent)
- Update
docs/ticket-tracker.mdto[x]. - Create a PR summary in
docs/pr-message/using{TicketID}-{Description}-pr.mdand thepr-template.mdstructure. - Integrate the Phase 3 audit report into the PR's verification sections.
- Commit the PR.
2. Technical Standards
- KISS — readable code over clever abstractions.
- Layering — Handler vs DB separation is mandatory;
internal/db/imports nonet/http/json. - Atomic Transactions for multi-step writes.
- Zero-Trust Dependencies — standard library + currently-permitted packages only (
go-sqlite3,bcrypt,uuid). - Security —
HttpOnlysession cookies; bcrypt password hashing.
3. Ticket Context: {Ticket}
[!IMPORTANT] {TicketDefinition}
Execution Directive: Phase 1 → review PLAN → Phase 2 → review implementation → Phase 3 (audit) → review report → Phase 4 (closure).