PactKit's core methodology is the PDCA cycle — Plan, Act, Check, Done — with quality gates at every stage.
The Hierarchy of Truth
Before understanding the workflow, you must understand the governance model:
| Tier | Source | Role |
|---|---|---|
| Tier 1 | Specs (docs/specs/*.md) and Test Cases | The Law |
| Tier 2 | Tests | Verification of the law |
| Tier 3 | Implementation code | The mutable reality |
Conflict resolution: When Spec conflicts with code, Spec wins — modify the code. When Spec conflicts with tests, Spec wins — modify the tests. Code is never the source of truth.
The Four Phases
1. Plan (/project-plan)
Agent: System Architect
The architect analyzes requirements and produces a Spec:
- Init Guard — automatically checks if the project is initialized; runs
/project-initif needed - Visual Scan — run
visualizeto understand current codebase structure - Logic Trace — if modifying existing logic, run
/project-tracefirst - Design — update the high-level design diagram
- Spec — create
docs/specs/{ID}.mdwith RFC 2119 requirements and Given/When/Then acceptance criteria - Board — add a Story to the Sprint Board
2. Act (/project-act)
Agent: Senior Developer
The developer implements code strictly per Spec, following TDD:
- Read Spec — understand the requirements
- Test First — write unit tests (RED)
- Implement — write code to make tests pass (GREEN)
- Verify — ensure the full test suite passes
3. Check (/project-check)
Agent: QA Engineer
The QA engineer runs a 6-phase deep audit:
- Security scan (OWASP baseline)
- Test case generation (Gherkin scenarios)
- Layer decision (API-level or browser-level testing)
- Test execution
- Spec alignment verification
- PASS / FAIL verdict
4. Done (/project-done)
Agent: Repo Maintainer
The maintainer finalizes the delivery:
- Clean — remove temporary files
- Regression Gate — run full test suite; stop if anything fails
- Hygiene — confirm all Board tasks are checked off
- Archive — move completed Stories to archive
- Commit — conventional commit (
feat(scope): description)
Sprint Automation
Run the entire PDCA cycle in one command:
/project-sprint "Add user authentication"This orchestrates all four phases automatically using a multi-agent team. Requires the Opus model for agent coordination.
File Structure
| Path | Purpose |
|---|---|
docs/specs/{ID}.md | Requirement Specifications (The Law) |
docs/test_cases/{ID}_case.md | Gherkin Acceptance Scenarios |
docs/product/sprint_board.md | Sprint Board |
docs/product/prd.md | Product Requirements Document |
docs/architecture/graphs/*.mmd | Mermaid Architecture Diagrams |
tests/unit/ | Unit Tests |
tests/e2e/ | E2E Integration Tests |
docs/product/archive/ | Archived Stories |