@esoteric-logic/praxis-harness 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +192 -0
  3. package/base/CLAUDE.md +148 -0
  4. package/base/commands/context-reset.md +72 -0
  5. package/base/commands/debug.md +63 -0
  6. package/base/commands/discover.md +49 -0
  7. package/base/commands/gsd-discuss.md +53 -0
  8. package/base/commands/gsd-execute.md +60 -0
  9. package/base/commands/gsd-verify.md +78 -0
  10. package/base/commands/kit.md +62 -0
  11. package/base/commands/plan.md +91 -0
  12. package/base/commands/ralph.md +110 -0
  13. package/base/commands/review.md +81 -0
  14. package/base/commands/risk.md +53 -0
  15. package/base/commands/ship.md +74 -0
  16. package/base/commands/spec.md +121 -0
  17. package/base/commands/standup.md +57 -0
  18. package/base/rules/architecture.md +51 -0
  19. package/base/rules/azure.md +90 -0
  20. package/base/rules/code-quality.md +65 -0
  21. package/base/rules/coding.md +139 -0
  22. package/base/rules/communication.md +69 -0
  23. package/base/rules/context-management.md +136 -0
  24. package/base/rules/execution-loop.md +84 -0
  25. package/base/rules/git-workflow.md +51 -0
  26. package/base/rules/github-actions.md +48 -0
  27. package/base/rules/powershell.md +72 -0
  28. package/base/rules/profile.md +31 -0
  29. package/base/rules/security.md +40 -0
  30. package/base/rules/terraform.md +48 -0
  31. package/base/rules/vault.md +134 -0
  32. package/base/skills/code-gc/SKILL.md +205 -0
  33. package/base/skills/code-simplifier/SKILL.md +132 -0
  34. package/base/skills/prd-writer/SKILL.md +108 -0
  35. package/base/skills/prd-writer/references/prd-template.md +22 -0
  36. package/base/skills/pre-commit-lint/SKILL.md +71 -0
  37. package/base/skills/scaffold-exist/SKILL.md +85 -0
  38. package/base/skills/scaffold-new/SKILL.md +177 -0
  39. package/base/skills/scaffold-new/references/claude-progress-template.json +24 -0
  40. package/base/skills/scaffold-new/references/gitignore-template.txt +65 -0
  41. package/base/skills/scaffold-new/references/repo-CLAUDE-md-template.md +87 -0
  42. package/base/skills/scaffold-new/references/vault-index-template.md +31 -0
  43. package/base/skills/scaffold-new/references/vault-learnings-template.md +21 -0
  44. package/base/skills/scaffold-new/references/vault-status-template.md +21 -0
  45. package/base/skills/scaffold-new/references/vault-tasks-template.md +20 -0
  46. package/base/skills/session-retro/SKILL.md +146 -0
  47. package/base/skills/subagent-review/SKILL.md +126 -0
  48. package/base/skills/vault-gc/SKILL.md +93 -0
  49. package/base/skills/verify-app/SKILL.md +156 -0
  50. package/bin/praxis.js +385 -0
  51. package/kits/infrastructure/KIT.md +66 -0
  52. package/kits/infrastructure/commands/infra-apply.md +44 -0
  53. package/kits/infrastructure/commands/infra-compliance.md +65 -0
  54. package/kits/infrastructure/commands/infra-drift.md +45 -0
  55. package/kits/infrastructure/commands/infra-plan.md +45 -0
  56. package/kits/infrastructure/install.sh +43 -0
  57. package/kits/infrastructure/rules/infrastructure.md +82 -0
  58. package/kits/infrastructure/teardown.sh +14 -0
  59. package/kits/web-designer/KIT.md +76 -0
  60. package/kits/web-designer/commands/web-audit.md +67 -0
  61. package/kits/web-designer/commands/web-component.md +54 -0
  62. package/kits/web-designer/commands/web-init.md +42 -0
  63. package/kits/web-designer/commands/web-tokens-sync.md +49 -0
  64. package/kits/web-designer/install.sh +41 -0
  65. package/kits/web-designer/rules/web-design.md +79 -0
  66. package/kits/web-designer/teardown.sh +26 -0
  67. package/package.json +28 -0
  68. package/scripts/health-check.sh +160 -0
  69. package/scripts/lint-harness.sh +195 -0
  70. package/scripts/onboard-mcp.sh +326 -0
  71. package/scripts/update.sh +88 -0
  72. package/templates/_index.md +33 -0
  73. package/templates/adr.md +28 -0
  74. package/templates/claude-progress.json +24 -0
  75. package/templates/plan.md +46 -0
  76. package/templates/project-index.md +31 -0
  77. package/templates/session-note.md +21 -0
  78. package/templates/status.md +27 -0
  79. package/templates/tasks.md +27 -0
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: subagent-review
3
+ disable-model-invocation: true
4
+ description: Reusable code review subagent. Accepts a diff, optional spec, and rules
5
+ files. Launches a subagent with zero conversation history to review for bugs,
6
+ security, and convention violations. Called by /review and gsd-verify — never
7
+ invoked directly by users.
8
+ allowed-tools: Bash, Read
9
+ ---
10
+
11
+ # subagent-review Skill
12
+
13
+ ## Purpose
14
+ Encapsulates the Self-Review Protocol as a reusable skill. Callers provide the
15
+ diff and context; this skill launches the subagent and returns structured findings.
16
+
17
+ ## Inputs
18
+
19
+ | Input | Required | Default | Description |
20
+ |-------|----------|---------|-------------|
21
+ | diff | Yes | — | The diff to review (string or file path) |
22
+ | spec_path | No | — | Path to the SPEC/plan for context |
23
+ | rules_files | No | `CLAUDE.md`, `coding.md`, `security.md` | Rules files to load |
24
+
25
+ ## DONE-WHEN
26
+ - [ ] Subagent launched with ONLY diff + spec + rules (zero conversation history)
27
+ - [ ] Findings returned in structured format
28
+ - [ ] Each finding rated Critical / Major / Minor
29
+
30
+ ## NON-GOALS
31
+ - Does NOT fix findings — callers handle remediation
32
+ - Does NOT write to vault — callers decide what to persist
33
+ - Does NOT interact with the user — callers present findings
34
+
35
+ ---
36
+
37
+ ## Phase 1 — Validate Inputs
38
+
39
+ - Diff must be non-empty. If empty: return `{ "findings": [], "status": "empty_diff" }`.
40
+ - If spec_path provided: verify the file exists. If not: proceed without spec.
41
+ - If rules_files not provided: default to:
42
+ - `~/.claude/CLAUDE.md`
43
+ - `~/.claude/rules/coding.md`
44
+ - `~/.claude/rules/security.md`
45
+
46
+ ## Phase 2 — Compose Subagent Prompt
47
+
48
+ Build the subagent prompt from these components ONLY:
49
+
50
+ ```
51
+ You are a critical code reviewer. Review the following diff.
52
+
53
+ ## Rules
54
+ {contents of each rules file}
55
+
56
+ ## SPEC (if available)
57
+ {contents of spec file, or "No spec provided."}
58
+
59
+ ## Diff
60
+ {the diff}
61
+
62
+ ## Instructions
63
+ Review for:
64
+ 1. Bugs and logic errors
65
+ 2. Edge cases and off-by-one errors
66
+ 3. Error handling gaps (missing catches, swallowed errors)
67
+ 4. Security issues (injection, secrets, auth gaps)
68
+ 5. Convention violations (from the Rules above)
69
+
70
+ Rate each finding: Critical / Major / Minor.
71
+ Format each as: `{file}:{line} — {severity} — {description} — {fix}`
72
+
73
+ If the diff is clean, say "No findings."
74
+ ```
75
+
76
+ Do NOT include any conversation history, project context, or user preferences
77
+ beyond the explicitly provided inputs.
78
+
79
+ ## Phase 3 — Launch Subagent
80
+
81
+ - Launch a subagent (Task tool) with the composed prompt.
82
+ - The subagent runs in isolation — fresh context, no memory of the current session.
83
+
84
+ ## Phase 4 — Return Structured Findings
85
+
86
+ Parse the subagent output into:
87
+
88
+ ```json
89
+ {
90
+ "status": "findings" | "clean" | "empty_diff",
91
+ "critical": [{ "file": "", "line": 0, "description": "", "fix": "" }],
92
+ "major": [{ "file": "", "line": 0, "description": "", "fix": "" }],
93
+ "minor": [{ "file": "", "line": 0, "description": "", "fix": "" }],
94
+ "summary": "1 critical, 2 major, 0 minor"
95
+ }
96
+ ```
97
+
98
+ Return this structure to the caller. The caller decides:
99
+ - Whether to present findings to the user
100
+ - Whether to trigger remediation
101
+ - Whether to re-run (max 3 rounds, managed by caller)
102
+
103
+ ## Callers
104
+
105
+ | Caller | Context |
106
+ |--------|---------|
107
+ | `/review` (commit 6) | Manual review trigger, writes summary to vault |
108
+ | `gsd-verify` Step 5 | Post-milestone Self-Review Protocol |
109
+ | `execution-loop.md` | Self-Review Protocol description (future: replace inline with skill ref) |
110
+
111
+ Note: `execution-loop.md` and `gsd-verify.md` still contain inline descriptions of the
112
+ review pattern. Future cleanup can replace those with a reference to this skill. Both
113
+ approaches produce identical behavior — the duplication is accepted for now.
114
+
115
+ ## Error Handling
116
+
117
+ | Condition | Action |
118
+ |-----------|--------|
119
+ | Empty diff | Return `empty_diff` status immediately |
120
+ | Subagent fails to launch | Return error to caller, do not retry |
121
+ | Subagent output unparseable | Return raw output as single Minor finding |
122
+ | Rules file missing | Warn, proceed with available rules |
123
+
124
+ ## Removal Condition
125
+ Remove when code review is fully handled by a dedicated external service
126
+ integrated via MCP, making subagent-based review redundant.
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: vault-gc
3
+ disable-model-invocation: true
4
+ description: Audit vault health and detect entropy. Invoke manually with /vault-gc
5
+ only. Two modes — full audit (manual) and lightweight staleness check (called
6
+ inline by session-retro). Never auto-deletes. Side-effect skill — never auto-triggers.
7
+ allowed-tools: Bash, Read, Write
8
+ ---
9
+
10
+ # vault-gc Skill
11
+
12
+ ## Vault Path Resolution
13
+ Read vault_path from `~/.claude/praxis.config.json`. Scan projects under `{vault_path}/01_Projects/`.
14
+
15
+ ## Two Modes
16
+
17
+ | Mode | Trigger | Scope | Output |
18
+ |------|---------|-------|--------|
19
+ | **Lightweight** | Called by session-retro | Staleness check only | One line or silence |
20
+ | **Full Audit** | Manual `/vault-gc` | All entropy categories | Prioritized report |
21
+
22
+ ---
23
+
24
+ ## Mode A — Lightweight
25
+
26
+ Scan `last_updated` from every `status.md` in active project directories.
27
+ Flag any project >14 days stale.
28
+
29
+ - Silent if 0 stale
30
+ - One line if 1–2: `⚠ vault-gc: 2 projects stale (project-a, project-b)`
31
+ - Escalate if 3+: `⚠ vault-gc: {N} projects stale — run /vault-gc for details`
32
+ - Exit 0 always — never block the session
33
+
34
+ ---
35
+
36
+ ## Mode B — Full Audit
37
+
38
+ ### Check 1: Stale Projects
39
+ For each project in active directories:
40
+ - CRITICAL: >60 days stale
41
+ - HIGH: 30–60 days stale
42
+ - MEDIUM: 14–30 days stale
43
+
44
+ ### Check 2: Orphan Plans
45
+ Plans in `plans/` not referenced by `current_plan:` in `status.md`,
46
+ and not status: completed or archived.
47
+
48
+ ### Check 3: Vault↔Repo Drift
49
+ Projects with `local_path` in `_index.md` where the repo no longer exists on disk,
50
+ or repo exists but is missing CLAUDE.md.
51
+
52
+ ### Check 4: Secret Exposure Scan
53
+ Scan last 10 commits across all active repos for accidental secret patterns.
54
+
55
+ ### Report Format
56
+ ```
57
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
58
+ VAULT GC — Full Audit ({today_date})
59
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
60
+
61
+ CRITICAL ({n})
62
+ ✗ [secret-exposure] project-a — potential secret in last 10 commits
63
+ ✗ [stale] project-b — 72 days since last update
64
+
65
+ HIGH ({n})
66
+ ✗ [repo-drift] project-c — local_path not found
67
+
68
+ MEDIUM ({n})
69
+ ⚠ [orphan-plan] project-d — old-plan.md (status: active, not current)
70
+
71
+ CLEAN ({n} projects)
72
+ ✓ project-e, project-f
73
+
74
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
75
+ {total} findings | {clean} clean
76
+ vault-gc never auto-deletes — act on findings manually
77
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
78
+ ```
79
+
80
+ After report: ask user if they want to address any specific finding.
81
+ Do NOT auto-remediate.
82
+
83
+ ## Error Handling
84
+
85
+ | Condition | Action |
86
+ |-----------|--------|
87
+ | `status.md` missing | Use `_index.md` mtime as fallback |
88
+ | `last_updated` malformed | Skip project, note in report |
89
+ | `local_path` expansion fails | Skip drift check, note in report |
90
+ | `git log` fails | Skip secret scan, note in report |
91
+
92
+ ## Removal Condition
93
+ Remove when a dedicated vault health dashboard covers all four entropy categories.
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: verify-app
3
+ disable-model-invocation: true
4
+ description: End-to-end application verification. Launches a subagent to run the full
5
+ test suite, check build, verify runtime behavior, and confirm acceptance criteria.
6
+ Use after implementation to catch integration issues that unit tests miss.
7
+ Side-effect skill — never auto-triggers.
8
+ allowed-tools: Bash, Read
9
+ ---
10
+
11
+ # verify-app Skill
12
+
13
+ ## Vault Path Resolution
14
+ Read vault_path from `~/.claude/praxis.config.json`.
15
+ Detect current project by matching CWD to `local_path` in vault `_index.md`.
16
+
17
+ ## DONE-WHEN
18
+ - [ ] Full test suite passes (not just changed tests)
19
+ - [ ] Build succeeds with zero warnings
20
+ - [ ] Lint passes with zero warnings
21
+ - [ ] Typecheck passes (if applicable)
22
+ - [ ] Acceptance criteria verified (from active plan done-when)
23
+ - [ ] No regressions detected in related functionality
24
+ - [ ] Verification report written
25
+
26
+ ## NON-GOALS
27
+ - Does not fix issues — reports them for the user to address
28
+ - Does not modify code
29
+ - Does not deploy or publish
30
+
31
+ ---
32
+
33
+ ## Phase 1 — Load Verification Context
34
+
35
+ - Read project CLAUDE.md `## Commands` section for test/build/lint commands
36
+ - If no commands defined: STOP. Ask user for the correct commands.
37
+ - Read active plan (if `current_plan:` set in status.md) — extract `## Done When` criteria
38
+ - Read `claude-progress.json` for current milestone context
39
+
40
+ ## Phase 2 — Run Verification Suite
41
+
42
+ Execute in order, capturing ALL output:
43
+
44
+ ### 2a — Build
45
+ ```bash
46
+ {build_command from CLAUDE.md}
47
+ ```
48
+ - PASS: zero exit code, zero warnings
49
+ - FAIL: capture full error output
50
+
51
+ ### 2b — Lint
52
+ ```bash
53
+ {lint_command from CLAUDE.md}
54
+ ```
55
+ - PASS: zero exit code, zero warnings
56
+ - FAIL: capture warnings/errors with file:line
57
+
58
+ ### 2c — Typecheck
59
+ ```bash
60
+ {typecheck_command from CLAUDE.md}
61
+ ```
62
+ - PASS: zero exit code
63
+ - FAIL: capture type errors
64
+ - SKIP: if no typecheck command configured
65
+
66
+ ### 2d — Test Suite
67
+ ```bash
68
+ {test_command from CLAUDE.md}
69
+ ```
70
+ - PASS: all tests pass
71
+ - FAIL: capture failing test names + error output
72
+
73
+ ### 2e — Acceptance Criteria
74
+ For each item in the plan's `## Done When`:
75
+ - If it's a command: run it and check output
76
+ - If it's a manual check: present to user for confirmation
77
+ - If it's a URL or UI check: ask user to verify
78
+ - Mark each criterion: PASS / FAIL / NEEDS HUMAN
79
+
80
+ ## Phase 3 — Regression Check
81
+
82
+ Launch a subagent with zero conversation history:
83
+
84
+ ```
85
+ You are a regression analyst. Given the following changes and test results,
86
+ identify potential regressions in related functionality.
87
+
88
+ ## Recent changes
89
+ {git diff HEAD~1 --stat}
90
+
91
+ ## Changed files
92
+ {list of modified files}
93
+
94
+ ## Test output
95
+ {test suite output}
96
+
97
+ ## Questions to answer:
98
+ 1. Are there changed files with no corresponding test coverage?
99
+ 2. Do any changed files have downstream consumers that weren't tested?
100
+ 3. Are there integration points (API boundaries, shared state, event handlers)
101
+ that the unit tests might miss?
102
+ 4. Based on the file names and structure, what manual checks would you recommend?
103
+
104
+ Format each concern as:
105
+ - {file} — {concern} — {recommended verification step}
106
+ ```
107
+
108
+ ## Phase 4 — Report
109
+
110
+ ```
111
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
112
+ VERIFY-APP — {project} ({date})
113
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
114
+
115
+ Build: {PASS | FAIL}
116
+ Lint: {PASS | FAIL | {n} warnings}
117
+ Typecheck: {PASS | FAIL | SKIP}
118
+ Tests: {PASS | FAIL — {n}/{total} passed}
119
+
120
+ Acceptance Criteria:
121
+ {criterion 1}: {PASS | FAIL | NEEDS HUMAN}
122
+ {criterion 2}: {PASS | FAIL | NEEDS HUMAN}
123
+
124
+ Regression Concerns:
125
+ {file} — {concern}
126
+
127
+ Overall: {READY TO SHIP | ISSUES FOUND}
128
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
129
+ ```
130
+
131
+ ## Phase 5 — Guidance
132
+
133
+ - **READY TO SHIP**: "All checks pass. Run `/ship` to commit, push, and PR."
134
+ - **ISSUES FOUND**: List each issue with recommended fix. Do not attempt to fix.
135
+ - **NEEDS HUMAN**: List what the user needs to manually verify.
136
+
137
+ ## Error Handling
138
+
139
+ | Condition | Action |
140
+ |-----------|--------|
141
+ | No test command | STOP. Ask user for commands. |
142
+ | Build/test command crashes | Report crash, suggest checking deps |
143
+ | No active plan | Run checks without acceptance criteria |
144
+ | All checks pass but regression concerns exist | Report as READY with caveats |
145
+
146
+ ## Integration Points
147
+
148
+ | Caller | When |
149
+ |--------|------|
150
+ | Manual `/verify-app` | After any implementation |
151
+ | `/gsd:verify` | Can replace or complement Step 1 |
152
+ | Ralph iteration | After story completion |
153
+
154
+ ## Removal Condition
155
+ Remove when CI/CD pipeline covers all verification steps and results are
156
+ accessible via MCP or CLI, making local verification redundant.