Programmatic verification of KB state: tickets, phases, tests, integrity. Provides scripts for automated checking at each workflow stage. SCRIPTS: - check_ticket.py: Ticket docs, tests, final status → next step - check_phase.py: Phase progress, all tickets complete? - check_tests.py: Trajectory, RED verification, coverage vs spec - check_integrity.py: Index.md matches dirs, roadmap has all active items Use when: - Checking ticket/phase completion - Validating before commit/archive - CI/CD automation - User says "status", "check", "verify"
Programmatic verification scripts for KB workflow integrity. Automatically checks ticket completion, phase progress, test coverage, and index consistency at each stage of the TDD process.
/plugin marketplace add jayprimer/pmc-marketplace/plugin install jayprimer-pmc-plugins-pmc@jayprimer/pmc-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
scripts/check_integrity.pyscripts/check_phase.pyscripts/check_tests.pyscripts/check_ticket.pyProgrammatic verification scripts for KB workflow.
ALWAYS run /pmc:kb first to understand ticket structure and TDD workflow.
| Script | Purpose | Use When |
|---|---|---|
check_ticket.py | Ticket docs + tests + status | Per-ticket verification |
check_phase.py | Phase progress + all tickets | Before phase archive |
check_tests.py | Trajectory + RED + coverage | After TDD cycle |
check_integrity.py | Index + roadmap consistency | Before commit |
Check individual ticket completion status.
python scripts/check_ticket.py T00001
python scripts/check_ticket.py T00001 --json
missing-docs → needs-spec → needs-tests → red-phase → needs-impl → needs-final → complete
↓ ↓
tests-blocked tests-failing
↓ ↓
blocked (retry impl)
| Step | Meaning | Action |
|---|---|---|
missing-docs | Required docs missing | Create 1-definition.md, 2-plan.md, 3-spec.md |
needs-spec | 3-spec.md empty | Write test specification |
needs-tests | No tests.json | Create tests.json from 3-spec.md |
red-phase | Tests not RED verified | Run tests, verify they fail, set red_verified |
needs-impl | RED done, needs code | Implement to make tests pass |
tests-failing | Implementation incomplete | Fix code until tests pass |
tests-blocked | Tests need human input | Resolve blocked_reason |
needs-final | Tests pass, no 5-final.md | Create 5-final.md with Status: COMPLETE |
blocked | Marked BLOCKED | Resolve blocker or escalate |
complete | All done | Archive ticket |
| Code | Meaning |
|---|---|
| 0 | Complete |
| 1 | In progress (needs work) |
| 2 | Blocked |
Required documents (must exist):
1-definition.md - What: scope, success criteria2-plan.md - How: steps, decisions3-spec.md - TDD: test cases, edge casesOptional documents:
4-progress.md - Log: TDD cycles, notes (created during work)5-final.md - Done: status, learnings (required for completion)For TDD tickets (default), verifies:
tests.json exists in .pmc/docs/tests/tickets/T0000N/red_verified timestamp (RED phase done)required: true tests have status: passedstatus: blocked# Ticket Status: T00001
## Documents
| Document | Exists | Content |
|----------|--------|---------|
| 1-definition.md | OK | OK |
| 2-plan.md | OK | OK |
| 3-spec.md | OK | OK |
| 4-progress.md | OK | OK |
| 5-final.md | MISSING | - |
## TDD: enabled
## Tests
Total: 3 | Passed: 2 | Failed: 1 | Blocked: 0 | Pending: 0
Required: 2/2 passed
RED verified: all
| Test | Status | Required | RED |
|------|--------|----------|-----|
| T00001-01 | passed | yes | OK |
| T00001-02 | passed | yes | OK |
| T00001-03 | failed | no | OK |
## Status
5-final.md: not set
## Next Step
**FIX TESTS**
Failing tests: T00001-03
{
"ticket_id": "T00001",
"exists": true,
"docs": {
"1-definition.md": {"exists": true, "has_content": true},
"2-plan.md": {"exists": true, "has_content": true},
"3-spec.md": {"exists": true, "has_content": true},
"4-progress.md": {"exists": true, "has_content": true},
"5-final.md": {"exists": false, "has_content": false}
},
"final_status": null,
"tests": {
"exists": true,
"total": 3,
"passed": 2,
"failed": 1,
"blocked": 0,
"pending": 0,
"required_passed": 2,
"required_total": 2,
"all_red_verified": true
},
"next_step": "tests-failing",
"next_step_detail": "Failing tests: T00001-03",
"tdd_enabled": true
}
Tickets with TDD: no in 1-definition.md skip test checks:
# Check all active tickets
for dir in .pmc/docs/tickets/T*/; do
ticket=$(basename "$dir")
python scripts/check_ticket.py "$ticket" --json
done
# Fail CI if ticket not complete
python scripts/check_ticket.py T00001
if [ $? -ne 0 ]; then
echo "Ticket not complete"
exit 1
fi
Before archiving a ticket:
python scripts/check_ticket.py T00001
# Only archive if exit code is 0
Check phase completion - all tickets in phase done?
python scripts/check_phase.py 1
python scripts/check_phase.py 1 --json
| Code | Meaning |
|---|---|
| 0 | Phase complete |
| 1 | In progress |
| 2 | Has blocked tickets |
| 3 | Phase not found |
# Phase 1 Status
**Goal:** Implement user authentication
Progress: [████████████░░░░░░░░] 60%
## Summary
| Status | Count |
|--------|-------|
| Complete | 3 |
| Blocked | 0 |
| In Progress | 2 |
| **Total** | **5** |
## Next Step
**2 ticket(s) remaining - next: T00004**
Detailed test verification: trajectory, RED markers, coverage.
python scripts/check_tests.py T00001
python scripts/check_tests.py T00001 --json
red_verified timestamp# Test Status: T00001
## Summary
| Metric | Value |
|--------|-------|
| Total tests | 4 |
| Passed | 3 |
| Failed | 1 |
| RED verified | incomplete |
| Trajectories | incomplete |
## Tests
| ID | Name | Status | RED | Trajectory | Issues |
|----|------|--------|-----|------------|--------|
| T00001-01 | Login flow | passed | + | 12 | - |
| T00001-02 | Logout flow | passed | + | 8 | - |
| T00001-03 | Session timeout | failed | x | none | Missing RED |
| T00001-04 | Remember me | passed | + | 5 | - |
## Coverage vs 3-spec.md
Coverage: 75%
| Spec Case | Covered | Test |
|-----------|---------|------|
| login_valid | + | T00001-01 |
| login_invalid | + | T00001-01 |
| session_timeout | x | - |
| remember_me | + | T00001-04 |
## Next Step
**Run RED phase for tests missing red_verified**
Verify KB consistency: indexes match directories, roadmap has all active items.
python scripts/check_integrity.py
python scripts/check_integrity.py --json
tickets/index.mdroadmap.md# KB Integrity Check
## Summary
| Type | Active | Archived | In Index | In Roadmap |
|------|--------|----------|----------|------------|
| Tickets | 5 | 12 | 5 | 4 |
## Issues Found
| Type | Item | Detail |
|------|------|--------|
| missing_roadmap | T00021 | T00021 is active but not in roadmap.md |
## Result
**INVALID** - 1 issues found
Use these scripts at each workflow stage:
| Stage | Script | Check |
|---|---|---|
| After PLAN | check_integrity.py | Ticket in index + roadmap |
| After create tests.json | check_tests.py | Tests defined |
| After RED phase | check_tests.py | red_verified set |
| After GREEN phase | check_tests.py | Trajectory complete |
| Before 5-final.md | check_ticket.py | All tests pass |
| Before archive | check_ticket.py | Status: COMPLETE |
| Before phase archive | check_phase.py | All tickets complete |
| Before commit | check_integrity.py | Index + roadmap valid |
# Full verification sequence
python scripts/check_integrity.py # KB consistent?
python scripts/check_ticket.py T00001 # Ticket status?
python scripts/check_tests.py T00001 # Tests valid?
python scripts/check_phase.py 1 # Phase done?
# JSON for automation
python scripts/check_ticket.py T00001 --json | jq '.next_step'
python scripts/check_phase.py 1 --json | jq '.phase_complete'
This skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.