Learn PactKit through practical examples. Each scenario shows a complete workflow from requirement to delivery.
Example 1: Add a Feature (Full PDCA)
A typical feature addition using the complete Plan-Act-Check-Done cycle.
Scenario: Add a /health endpoint to a FastAPI application.
Step 1: Plan
/project-plan "Add a /health endpoint that returns service status and uptime"The System Architect will:
- Scan the codebase with
visualize - Generate a Spec at
docs/specs/STORY-001.md - Add a Story to the Sprint Board
- Update
docs/product/context.md
Output: A Spec file like this:
# STORY-001: Add Health Endpoint
| Field | Value |
|---------|---------------|
| ID | STORY-001 |
| Type | Feature |
| Status | Plan |
| Release | TBD |
## Requirements
### R1: Health endpoint returns service status
The system MUST expose a `GET /health` endpoint that returns...
## Acceptance Criteria
### AC1: Basic health check
- Given the service is running
- When a GET request is made to /health
- Then the response status is 200 with JSON body containing "status": "healthy"Step 2: Act
/project-act STORY-001The Senior Developer will:
- Spec Lint Gate — validate the Spec structure
- Consistency Check — cross-reference Spec with Board tasks
- Write tests first (RED) — create
tests/test_health.py - Implement (GREEN) — write the endpoint code
- Verify — run the full test suite
Step 3: Check
/project-checkThe QA Engineer will:
- Run security checklist (SEC-1 through SEC-8)
- Generate test cases in Gherkin format
- Execute tests and verify Spec alignment
- Issue a PASS or FAIL verdict
Step 4: Done
/project-doneThe Repo Maintainer will:
- Run regression gate (full test suite)
- Run lint gate
- Archive the Story
- Create a conventional commit:
feat(api): STORY-001 add /health endpoint - Offer to create a Pull Request
Example 2: Quick Hotfix
Skip the full PDCA cycle for trivial fixes.
/project-hotfix "Fix typo in README: 'recieve' → 'receive'"The Senior Developer will fix the issue, run a quick test, and commit directly. No Spec or Board entry needed.
Example 3: Greenfield Product Design
Start a brand new product from scratch.
/project-design "Build a bookmark manager with tagging and search"The Product Designer will:
- Generate a PRD at
docs/product/prd.md - Decompose into 5-10 Stories with prioritization
- Create Spec files for each Story
- Populate the Sprint Board
- Generate architecture diagrams
Then execute the Stories one by one:
/project-act STORY-001 # Framework setup
/project-done
/project-act STORY-002 # Core bookmark CRUD
/project-done
# ... and so onExample 4: Automated Sprint
Run the entire PDCA cycle in one command.
/project-sprint "Add user authentication with JWT tokens"This orchestrates all four phases automatically:
- Plan — System Architect creates Spec
- Act — Senior Developer implements with TDD
- Check — QA Engineer audits
- Done — Repo Maintainer commits
Sprint mode requires the Opus model for multi-agent coordination. For Sonnet-level models, run each phase manually.
Example 5: Multi-Developer Collaboration
Two developers working on the same project without conflicts.
Developer A (pactkit.yaml):
developer: aliceDeveloper B (pactkit.yaml):
developer: bobNow Story IDs are namespaced:
- Alice creates
STORY-alice-001,STORY-alice-002 - Bob creates
STORY-bob-001,STORY-bob-002
No file conflicts during merge. Each developer has their own Spec and Board entries.
Example 6: Using Skills Directly
Skills can be invoked independently outside the PDCA workflow.
Visualize codebase
# File-level dependency graph
visualize
# Class diagram
visualize --mode class
# Call chain from a specific function
visualize --mode call --entry handle_requestBoard operations
# Add a story manually
board add_story STORY-042 "Fix login timeout" "Investigate root cause|Implement fix|Add test"
# Mark a task done
board update_task STORY-042 "Implement fix"
# Archive completed stories
board archiveTrace execution flow
/pactkit-trace "How does the authentication middleware work?"Generate architecture diagram
/pactkit-draw "System architecture showing API, DB, and cache layers"Example 7: OpenCode with Model Routing
When using OpenCode, commands automatically route to the best model for each task.
# Uses main model (Opus) — deep reasoning
/project-plan "Redesign the caching layer for horizontal scaling"
# Uses Sonnet — implementation
/project-act STORY-003
# Uses Sonnet — QA audit
/project-check
# Uses Sonnet — commit and cleanup
/project-doneCustomize routing in .opencode/pactkit.yaml:
command_models:
project-act: sonnet
project-plan: opus # Override: force Opus for planning
project-check: haiku # Override: use Haiku for quick checks