@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,78 @@
1
+ ---
2
+ description: Validation phase — runs test/lint/typecheck/build and reports PASS or FAIL. Use after each milestone completion.
3
+ ---
4
+
5
+ You are running the GSD verification phase for the current milestone.
6
+
7
+ **Step 1 — Run validation sequence**
8
+ Execute in order, showing actual output (never assertions):
9
+ 1. **Test suite** → run the project test command → show output
10
+ 2. **Linter** → run the project lint command → show output, fix ALL warnings
11
+ 3. **Typecheck** (if applicable) → show output
12
+ 4. **Build** (if applicable) → show output
13
+ 5. **Functional check** — ask: "Is there a smoke test, `terraform plan` output, or browser check needed for this milestone?" If yes: block until user confirms it passed. If no: proceed.
14
+
15
+ Read test/lint/build commands from the project CLAUDE.md `## Commands` section.
16
+ If no commands are defined: warn and ask user for the correct commands.
17
+
18
+ **Step 2 — Report result**
19
+ - **PASS**: All checks green. Proceed to Step 3.
20
+ - **FAIL**: Trigger repair (Step 4).
21
+
22
+ **Step 3 — On PASS**
23
+ 1. Update the active plan file: mark milestone status as complete
24
+ 2. Prompt: "Milestone verified. Ready to commit — proceed?"
25
+ 3. After commit: check if more milestones remain
26
+ - Yes → "Run `/gsd:execute` for the next milestone."
27
+ - No → "All milestones complete. Running self-review."
28
+ 4. After ALL milestones: trigger Self-Review Protocol
29
+ - Launch a subagent to review the full diff as a critical code reviewer
30
+ - Subagent receives ONLY: the diff, the SPEC, relevant rules files
31
+ - Address all Critical and Major findings before reporting done
32
+
33
+ **Step 3b — UNIFY (mandatory after all milestones verified)**
34
+ After self-review passes, write phase summary:
35
+ - Write `{vault_path}/plans/current-phase-summary.md`:
36
+ ```markdown
37
+ ---
38
+ tags: [unify, {project-slug}]
39
+ date: {YYYY-MM-DD}
40
+ source: agent
41
+ ---
42
+ # Phase Summary: {plan title}
43
+
44
+ ## Planned vs Actual
45
+ - Original milestones: {list from plan}
46
+ - Completed: {list with dates}
47
+ - Changed or dropped: {list with reasons}
48
+
49
+ ## Decisions Made
50
+ - {decision}: {rationale}
51
+
52
+ ## Acceptance Criteria
53
+ | Criterion | Status |
54
+ |-----------|--------|
55
+ | {from Done When} | PASS / FAIL |
56
+
57
+ ## Deferred Items
58
+ - {item}: {reason deferred, suggested next step}
59
+ ```
60
+ - Run `/simplify` on the full diff to clean up implementation
61
+ - Report: "Phase summary written. Run `/verify-app` for e2e checks, then `/ship` to commit+push+PR."
62
+
63
+ **Rules:**
64
+ - UNIFY fires after ALL milestones verified, not per-milestone. session-retro still runs at session end for learnings — complementary, not redundant.
65
+ - `/simplify` runs after UNIFY, before shipping. It is the quality gate between "it works" and "it's clean".
66
+
67
+ **Step 4 — On FAIL (Stop-and-Fix)**
68
+ 1. Identify the failure: exact error, file, line
69
+ 2. Fix NOW. Do not proceed to the next milestone.
70
+ 3. Re-run the full validation sequence (Step 1)
71
+ 4. If still failing after 3 attempts: STOP.
72
+ Report: **What** (full error + 3 attempts) → **So What** (root cause) → **Now What** (next steps)
73
+ 5. Write failure details to the active plan file if >1 attempt was needed
74
+
75
+ **Rules:**
76
+ - Never say "tests pass" without showing output.
77
+ - Never skip lint warnings — they compound into tech debt.
78
+ - Validation is the evidence. Conversation claims are not.
@@ -0,0 +1,62 @@
1
+ ---
2
+ description: Activate or deactivate a domain AI-Kit. Use /kit:web-designer to activate, /kit:off to deactivate, /kit:list to show installed kits.
3
+ allowed-tools: Bash(ls ~/.claude/kits/*)
4
+ ---
5
+
6
+ You are managing AI-Kit activation.
7
+
8
+ ## /kit:list
9
+ List all installed kits by reading `~/.claude/kits/*/KIT.md` manifests.
10
+ Print a table:
11
+ ```
12
+ Kit Status Domain
13
+ web-designer inactive Design system → components → accessibility → lint
14
+ ```
15
+ If `~/.claude/praxis.config.json` has `installed_kits`, cross-reference to show install status.
16
+
17
+ ## /kit:<name> (activate)
18
+
19
+ 1. Check if `~/.claude/kits/<name>/KIT.md` exists. If not: report "Kit not found. Run /kit:list."
20
+ 2. Read `KIT.md` manifest to get skills_chain, rules, and mcp_servers.
21
+ 3. **Idempotency check**: If this kit is already active in the current session, report "Kit already active" and do nothing. This is critical for Ralph integration where every iteration may re-activate.
22
+ 4. Print the skills chain:
23
+ ```
24
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
25
+ AI-Kit activated: web-designer
26
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
27
+
28
+ Skills chain:
29
+ 1. Design system init → ui-ux-pro-max, design-system-patterns
30
+ 2. Component build → frontend-design, shadcn-ui, 21st.dev MCP
31
+ 3. Audit → web-accessibility, ui-skills
32
+ 4. Final lint → web-design-guidelines
33
+
34
+ Domain rules loaded: web-design.md
35
+ MCP servers: 21st-magic
36
+
37
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
38
+ ```
39
+ 5. Load the kit's rules from `~/.claude/kits/<name>/rules/`.
40
+ 6. Note: MCP servers registered via `claude mcp add` persist globally. The kit activation confirms they are available but does not re-register.
41
+
42
+ ## /kit:off (deactivate)
43
+
44
+ 1. Report which kit is being deactivated.
45
+ 2. Unload kit-specific rules from the active context.
46
+ 3. Note: MCP servers persist globally — they are not unregistered on deactivation.
47
+ 4. Print: `✓ Kit deactivated. Universal base (GSD + Superpowers) still active.`
48
+
49
+ ## /kit:update <name>
50
+
51
+ 1. Run `~/.claude/kits/<name>/install.sh` to pull latest skill versions.
52
+ 2. Update `installed_kits` in `~/.claude/praxis.config.json`.
53
+ 3. Report results.
54
+
55
+ ## Error Handling
56
+
57
+ | Condition | Action |
58
+ |-----------|--------|
59
+ | Kit not found | Report available kits from /kit:list |
60
+ | Kit dependencies not installed | Suggest running `~/.claude/kits/<name>/install.sh` |
61
+ | Double activation | No-op — report already active |
62
+ | KIT.md malformed | Report parse error, do not activate |
@@ -0,0 +1,91 @@
1
+ ---
2
+ description: Create a dated work plan for the current project. Writes to vault plans/ directory and updates status.md current_plan field. Use when starting any multi-step task.
3
+ ---
4
+
5
+ You are creating a work plan for the current project.
6
+
7
+ **Step 1 — Detect project**
8
+ - Read vault_path from `~/.claude/praxis.config.json`
9
+ - Match CWD to `local_path` in vault `_index.md`
10
+ - Read `status.md` — check if `current_plan:` is already set
11
+ - If current_plan is set: warn. Ask if starting a new plan or updating the existing one.
12
+
13
+ **Step 2 — Gather plan details**
14
+ Ask in a single message:
15
+ - What is the task or feature this plan covers?
16
+ - What is the target completion date (or "open" if no deadline)?
17
+ - Any known blockers or dependencies upfront?
18
+
19
+ **Step 3 — Build the plan**
20
+
21
+ ```markdown
22
+ ---
23
+ tags: [plan, {project-slug}]
24
+ date: {YYYY-MM-DD}
25
+ status: active
26
+ target: {date or open}
27
+ execution_type: execute | tdd | research
28
+ source: agent
29
+ ---
30
+ # Plan: {title}
31
+
32
+ ## Objective
33
+ One sentence.
34
+
35
+ ## Context
36
+ Why this work is happening now.
37
+
38
+ ## Milestones
39
+ - [ ] {milestone 1} — {date}
40
+ - [ ] {milestone 2} — {date} | depends_on: milestone 1
41
+ - [ ] {milestone 3} — {date} | depends_on: milestone 2 | checkpoint: decision
42
+ - [ ] {milestone 4} — {date} | checkpoint: human-verify
43
+
44
+ ## Steps
45
+ ### {Milestone 1}
46
+ 1. {step}
47
+ 2. {step}
48
+
49
+ ## Done When
50
+ - [ ] {specific verifiable check}
51
+
52
+ ## Boundaries
53
+ <!-- Required. Files/systems that MUST NOT change during this plan. -->
54
+ <!-- Override requires explicit "OVERRIDE: {reason}" from user. -->
55
+ - DO NOT CHANGE: {file or system list}
56
+
57
+ ## Blockers
58
+ <!-- Known blockers at plan creation time -->
59
+
60
+ ## Session Log
61
+ <!-- Updated by session-retro -->
62
+ ```
63
+
64
+ Checkpoint types:
65
+ - `checkpoint: decision` — user must confirm a choice before proceeding
66
+ - `checkpoint: human-verify` — user must validate output before proceeding
67
+ - No annotation = autonomous (default)
68
+
69
+ **Step 3b — Dependency and boundary validation**
70
+ After building the milestone list:
71
+ - Scan for circular dependencies (topological sort). If cycle detected:
72
+ report the cycle and ask user to break it.
73
+ - Validate that every `depends_on:` reference exists in the milestone list.
74
+ - If user provided milestones out of order: reorder and note the change.
75
+ - Milestones with no `depends_on:` are independent — this is valid.
76
+ - Validate Boundaries: if user did not specify any, ask:
77
+ "What files or systems should NOT be touched during this plan?"
78
+ Empty boundaries are valid only if explicitly confirmed.
79
+ - Validate checkpoints: milestones with architectural decisions or user-facing output
80
+ should be annotated as `checkpoint: decision` or `checkpoint: human-verify`.
81
+
82
+ **Step 4 — Write and wire**
83
+ - Write to: `{vault_path}/plans/{YYYY-MM-DD}_{kebab-title}.md`
84
+ - Update `status.md`: set `current_plan:`, update `last_updated`, update `## Now What`
85
+ - Update `claude-progress.json` milestones array
86
+ - Report:
87
+ ```
88
+ ✓ Plan created: {vault_path}/plans/{filename}
89
+ ✓ status.md: current_plan updated
90
+ ✓ progress.json: milestone added
91
+ ```
@@ -0,0 +1,110 @@
1
+ ---
2
+ description: Ralph autonomous execution command. Runs multi-story iterations from a PRD with fresh context per story. Use for >5 independent stories or overnight execution.
3
+ ---
4
+
5
+ You are running Ralph — autonomous multi-story execution.
6
+
7
+ **Step 1 — Read state**
8
+ - Read vault_path from `~/.claude/praxis.config.json`
9
+ - Read `{vault_path}/claude-progress.json` → check `ralph_state`
10
+ - If `ralph_state.mode` is `"active"` and `current_story` is set: resume that story
11
+ - If `ralph_state.mode` is `"idle"`: begin new iteration (Step 2)
12
+
13
+ **Step 2 — PRD validation**
14
+ - Read the PRD file at `ralph_state.prd_path`
15
+ - Validate each story against size constraints:
16
+ - Must be completable in ~10k output tokens
17
+ - Must touch ≤3 file groups
18
+ - Must require ≤1 architectural decision
19
+ - Reject stories that exceed constraints. Report which stories need splitting.
20
+ - Stories requiring cross-story reasoning belong in GSD, not Ralph.
21
+
22
+ **Step 2b — PRD format (canonical)**
23
+ Ralph PRDs must follow this structure:
24
+ ```markdown
25
+ ---
26
+ title: {PRD title}
27
+ date: YYYY-MM-DD
28
+ status: active
29
+ stories_total: {n}
30
+ ---
31
+ # PRD: {title}
32
+
33
+ ## Context
34
+ Why this work exists. 1-3 sentences.
35
+
36
+ ## Stories
37
+
38
+ ### Story: {story-id}
39
+ **As a**: {role}
40
+ **I want**: {capability}
41
+ **So that**: {outcome}
42
+ **Done when**:
43
+ - [ ] {verifiable check}
44
+ **File group**: {list of files, max 3 groups}
45
+ **Dependencies**: {story-ids that must complete first, or "none"}
46
+ **Estimate**: S / M / L
47
+ ```
48
+ - Size validation: before starting any Ralph run, scan every story.
49
+ Any story marked L or missing a File group: STOP. Fix the PRD first.
50
+ - S = <3 files. M = 3-5 files. L = 5+ files (must split before Ralph).
51
+
52
+ **Step 3 — State bridge**
53
+ - `ralph_state` in `claude-progress.json` is the ONLY state between iterations
54
+ - Never reference conversation history as source of truth
55
+ - Read `ralph_state` at iteration start, write at iteration end
56
+ - Fields:
57
+ - `mode`: "idle" | "active"
58
+ - `prd_path`: path to PRD file
59
+ - `current_story`: story identifier currently being executed
60
+ - `completed_stories`: array of finished story identifiers
61
+ - `blocked_stories`: array of stories that could not complete
62
+ - `learnings`: array of [LEARN:tag] entries discovered during iterations
63
+ - `last_iteration`: ISO timestamp of last completed iteration
64
+ - `session_count`: number of iterations completed
65
+
66
+ **Step 4 — Iteration bootstrap**
67
+ For each story, in a fresh context:
68
+ 1. Read project CLAUDE.md (always first)
69
+ 2. Read `claude-progress.json` → `ralph_state` (authoritative)
70
+ 3. Read PRD → current story ONLY (not full PRD)
71
+ 4. Activate kit if specified in project CLAUDE.md (`## Active kit`)
72
+ 5. Execute the story using GSD execute + verify phases
73
+
74
+ **Step 4b — Blocked story protocol**
75
+ When a story cannot complete (test fails after 3 attempts, dependency missing, etc.):
76
+ 1. Do NOT retry the story. Ralph stories get one attempt.
77
+ 2. Record in `ralph_state.blocked_stories`:
78
+ ```json
79
+ { "story": "{story-id}", "reason": "{specific error}", "blocked_at": "{ISO timestamp}" }
80
+ ```
81
+ 3. Write the blocker to the active plan file under the story entry.
82
+ 4. Move to the next unblocked story. Never halt the entire Ralph run.
83
+ 5. At run end: report all blocked stories as a group for human resolution.
84
+
85
+ **Step 5 — Iteration end**
86
+ After each story completes:
87
+ 1. Run session-retro in Ralph-auto mode (summary + learnings, skip user-facing phases)
88
+ 2. Update `ralph_state`:
89
+ - Push `current_story` to `completed_stories`
90
+ - Set `current_story` to next story (or null if done)
91
+ - Update `last_iteration` timestamp
92
+ - Increment `session_count`
93
+ 3. Git commit the story's changes
94
+ 4. Advance to next story or report completion
95
+
96
+ **Step 6 — Decision table**
97
+
98
+ | Condition | Use Ralph | Use GSD |
99
+ |-----------|-----------|---------|
100
+ | >5 independent stories | Yes | - |
101
+ | Overnight/unattended execution | Yes | - |
102
+ | Mechanical transformations (migrations, renames) | Yes | - |
103
+ | Cross-story reasoning required | - | Yes |
104
+ | Architectural decisions span stories | - | Yes |
105
+ | Human checkpoints needed | - | Yes |
106
+
107
+ **Rules:**
108
+ - Kit activation is idempotent via `/kit:<name>` — safe to activate every iteration.
109
+ - Ralph never asks for user input mid-story. If blocked: add to `blocked_stories`, skip, continue.
110
+ - Default to GSD. Use Ralph only when stories are clearly independent and well-scoped.
@@ -0,0 +1,81 @@
1
+ ---
2
+ description: Manual code review trigger. Launches a subagent to review a diff for bugs, security, and convention violations. Use independently of GSD phases.
3
+ ---
4
+
5
+ You are running a manual code review.
6
+
7
+ **Step 1 — Determine diff scope**
8
+ Ask: "Review staged changes, last commit, or specific SHA?"
9
+ - Default to `git diff HEAD` if no answer within 10 seconds.
10
+ - Accept: `staged`, `HEAD`, `HEAD~N`, or a specific SHA.
11
+
12
+ **Step 2 — Gather the diff**
13
+ - Run the appropriate `git diff` command.
14
+ - If the diff is empty: "Nothing to review." Exit.
15
+ - If the diff exceeds 2000 lines: warn and ask whether to proceed or narrow scope.
16
+
17
+ **Step 3 — Load review context**
18
+ - Read project CLAUDE.md (if it exists in the repo root).
19
+ - Read the active plan (if `current_plan:` is set in vault status.md) — extract the SPEC only.
20
+ - Load rules based on file types in the diff:
21
+ - `.tf` / `.tfvars` → `~/.claude/rules/terraform.md`
22
+ - `.yml` / `.yaml` in `.github/` → `~/.claude/rules/github-actions.md`
23
+ - `.ps1` / `.psm1` → `~/.claude/rules/powershell.md`
24
+ - Any file → `~/.claude/rules/coding.md`, `~/.claude/rules/security.md`
25
+
26
+ **Step 4 — Launch subagent review**
27
+ Launch a subagent with ONLY these inputs (zero conversation history):
28
+ - The diff
29
+ - The SPEC (if available from Step 3)
30
+ - Relevant rules files (from Step 3)
31
+
32
+ Subagent prompt:
33
+ > Review this diff for bugs, edge cases, error handling gaps, security issues,
34
+ > and convention violations. Rate each finding:
35
+ > Critical / Major / Minor.
36
+ > Format: `{file}:{line} — {severity} — {description} — {fix}`
37
+
38
+ **Step 5 — Present findings**
39
+ Structure output by severity:
40
+
41
+ ```
42
+ ━━━ REVIEW RESULTS ━━━
43
+
44
+ CRITICAL ({n})
45
+ {file}:{line} — {description} — {fix}
46
+
47
+ MAJOR ({n})
48
+ {file}:{line} — {description} — {fix}
49
+
50
+ MINOR ({n})
51
+ {file}:{line} — {description} — {fix}
52
+
53
+ CLEAN
54
+ {files with no findings}
55
+ ━━━━━━━━━━━━━━━━━━━━━━
56
+ ```
57
+
58
+ **Step 6 — Remediation guidance**
59
+ - Critical: address immediately before proceeding.
60
+ - Major: recommend fixing before merge.
61
+ - Minor: note for future cleanup.
62
+ - If >3 findings: offer to re-run after fixes (max 3 rounds).
63
+
64
+ **Step 7 — Write review summary**
65
+ - Read vault_path from `~/.claude/praxis.config.json`
66
+ - Write summary to `{vault_path}/specs/review-{YYYY-MM-DD}-{slug}.md` with frontmatter:
67
+ ```yaml
68
+ ---
69
+ tags: [review, {project-slug}]
70
+ date: {YYYY-MM-DD}
71
+ status: complete
72
+ source: agent
73
+ ---
74
+ ```
75
+ - Vault indexing is automatic.
76
+
77
+ **Rules:**
78
+ - Works independently of GSD phases.
79
+ - Never skip the subagent — review must come from fresh context.
80
+ - Subagent receives zero conversation history.
81
+ - If no project CLAUDE.md exists: proceed with base rules only.
@@ -0,0 +1,53 @@
1
+ ---
2
+ description: Add a new risk register entry to the current project vault. Assigns a risk ID, severity, mitigation, and writes to specs/risk-register.md.
3
+ ---
4
+
5
+ You are adding a risk register entry for the current project.
6
+
7
+ **Step 1 — Detect project and existing risks**
8
+ - Read vault_path from `~/.claude/praxis.config.json`
9
+ - Detect project from CWD
10
+ - Run: `obsidian search query="risk register {project-slug}" limit=3`
11
+ - Check if `{vault_path}/specs/risk-register.md` exists
12
+ - If found: read it to determine next sequential risk ID (R-01, R-02, etc.)
13
+
14
+ **Step 2 — Gather risk details**
15
+ Ask in a single message:
16
+ - What is the risk? (one sentence)
17
+ - What triggers it?
18
+ - Severity: Critical / High / Medium / Low
19
+ - Who owns this risk?
20
+ - What is the mitigation? (must be specific — "monitor" is not a mitigation)
21
+
22
+ **Step 3 — Write the entry**
23
+
24
+ If no risk register exists, create `{vault_path}/specs/risk-register.md`:
25
+ ```markdown
26
+ ---
27
+ tags: [risk-register, {project-slug}]
28
+ date: {YYYY-MM-DD}
29
+ last_updated: {YYYY-MM-DD}
30
+ source: agent
31
+ ---
32
+ # {Project Name} — Risk Register
33
+ ```
34
+
35
+ Append entry:
36
+ ```markdown
37
+ ## {R-ID} — {title}
38
+ - **Severity**: {Critical | High | Medium | Low}
39
+ - **Status**: Open
40
+ - **Trigger**: {what causes this risk to materialize}
41
+ - **Impact**: {what happens if it does}
42
+ - **Mitigation**: {specific steps — never TBD}
43
+ - **Owner**: {name or role}
44
+ - **Date identified**: {YYYY-MM-DD}
45
+ ```
46
+
47
+ **Step 4 — Surface critical risks**
48
+ - If severity is Critical: add to `status.md` under `## So What` immediately.
49
+ **Step 5 — Report**
50
+ ```
51
+ ✓ Risk {R-ID} added: {title} [{severity}]
52
+ ✓ Risk register: {vault_path}/specs/risk-register.md
53
+ ```
@@ -0,0 +1,74 @@
1
+ ---
2
+ description: Commit, push, and open a PR in one shot. Runs pre-commit checks, crafts a commit message, pushes, and creates a PR with structured description. Use when a milestone or feature is complete and verified.
3
+ ---
4
+
5
+ You are running the ship workflow — commit, push, and PR in one command.
6
+
7
+ **Step 1 — Pre-flight checks**
8
+ - Read project CLAUDE.md for build/test/lint commands
9
+ - Run in order (all must pass):
10
+ 1. Secret scan: `rg "(sk-|ghp_|pplx-|AKIA|Bearer [A-Za-z0-9+/]{20,})" $(git diff --staged --name-only)`
11
+ 2. Linter (from CLAUDE.md `## Commands`)
12
+ 3. Typecheck (if applicable)
13
+ 4. Test suite (from CLAUDE.md `## Commands`)
14
+ 5. Identity check: `git --no-pager config user.email` must match expected
15
+ - If ANY check fails: STOP. Fix first, then re-run `/ship`.
16
+
17
+ **Step 2 — Stage and review changes**
18
+ - Run `git status` and `git diff --stat`
19
+ - Show the user what will be committed
20
+ - If nothing to commit: "Nothing to ship." Exit.
21
+ - If unstaged files exist: ask which to include
22
+
23
+ **Step 3 — Craft commit message**
24
+ - Use conventional commits: `feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`
25
+ - Read the active plan (if set) for context on what was accomplished
26
+ - Format:
27
+ ```
28
+ {type}({scope}): {short description}
29
+
30
+ {optional body — what changed and why, not how}
31
+ ```
32
+ - Show the commit message for approval before committing
33
+
34
+ **Step 4 — Commit and push**
35
+ - `git add` the agreed files
36
+ - `git commit` with the approved message
37
+ - `git push -u origin HEAD`
38
+ - If push fails (no remote, branch conflict): report and suggest fix
39
+
40
+ **Step 5 — Create PR**
41
+ Ask: "Open a PR?" (default: yes)
42
+
43
+ If yes:
44
+ - Detect base branch from git config or default to `main`
45
+ - Read vault_path from `~/.claude/praxis.config.json`
46
+ - If active plan exists: extract objective and done-when for PR description
47
+ - Create PR using `gh pr create`:
48
+ ```
49
+ ## What changed
50
+ {summary from commit + plan context}
51
+
52
+ ## Why
53
+ {from plan objective or user context}
54
+
55
+ ## How to verify
56
+ {from plan done-when, or suggest specific commands}
57
+ ```
58
+
59
+ **Step 6 — Report**
60
+ ```
61
+ SHIPPED
62
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
63
+ Commit: {short sha} {message}
64
+ Branch: {branch} → {base}
65
+ PR: {url}
66
+ Checks: secrets ✓ lint ✓ types ✓ tests ✓
67
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
68
+ ```
69
+
70
+ **Rules:**
71
+ - Never skip pre-flight checks. They are the safety net.
72
+ - Never force-push without explicit user approval.
73
+ - If the diff touches >20 files: warn about PR size and suggest splitting.
74
+ - This command is the end of a GSD cycle — run after `/gsd:verify` passes.
@@ -0,0 +1,121 @@
1
+ ---
2
+ description: Create a structured spec or ADR for the current project. Writes directly to vault specs/ directory. Use for any significant decision, design, or work item that needs documentation before implementation.
3
+ ---
4
+
5
+ You are creating a spec for the current project.
6
+
7
+ **Step 1 — Identify project context**
8
+ - Read vault_path from `~/.claude/praxis.config.json`
9
+ - Detect project from CWD matching `local_path` in vault `_index.md`
10
+ - Read `status.md` to understand current state
11
+ - If no project detected: ask which project before continuing
12
+
13
+ **Step 2 — Gather spec details**
14
+ Ask the following in a single message:
15
+ - What is this spec for? (one sentence)
16
+ - Type: ADR (architecture decision) / PLAN (work plan) / RISK (risk register entry) / SPEC (technical spec)
17
+ - Is there an existing related spec in `specs/`? (run `obsidian search query="{topic}" limit=3` first)
18
+
19
+ **Step 2b — Cross-spec conflict check**
20
+ After the vault search from Step 2, check for conflicts with accepted ADRs:
21
+ - Run: `obsidian search query="{topic}" limit=10`
22
+ - For each result with `status: accepted` or `status: proposed`:
23
+ - Compare the decision direction. Does the new spec contradict an accepted decision?
24
+ - If conflict detected, present:
25
+ ```
26
+ This conflicts with {spec-path} (accepted {date}).
27
+ Options:
28
+ 1. Supersede — update existing ADR status to 'superseded', link to this one
29
+ 2. Extend — amend the existing ADR instead of creating a new one
30
+ 3. Proceed with awareness — document the tension in ## Consequences
31
+ ```
32
+ - Never silently create a spec that contradicts an accepted ADR.
33
+ - If no conflicts: proceed silently.
34
+
35
+ **Step 3 — Answer the four SPEC questions**
36
+ - **WHAT**: Concrete deliverable
37
+ - **DONE-WHEN**: Specific checks that prove completion
38
+ - **CONSTRAINTS**: Performance, compatibility, compliance requirements
39
+ - **NON-GOALS**: What this explicitly does NOT include
40
+
41
+ **Step 4 — Write the spec**
42
+
43
+ For ADR type:
44
+ ```markdown
45
+ ---
46
+ tags: [adr, {project-slug}]
47
+ date: {YYYY-MM-DD}
48
+ status: proposed
49
+ source: agent
50
+ ---
51
+ # ADR: {title}
52
+
53
+ ## Decision
54
+ One sentence. What was decided.
55
+
56
+ ## Context
57
+ Why this decision was needed. What constraints applied.
58
+
59
+ ## Options Considered
60
+ | Option | Pros | Cons |
61
+ |--------|------|------|
62
+
63
+ ## Consequences
64
+ What this makes easier, harder, or impossible going forward.
65
+ ```
66
+
67
+ For SPEC type:
68
+ ```markdown
69
+ ---
70
+ tags: [spec, {project-slug}]
71
+ date: {YYYY-MM-DD}
72
+ status: draft
73
+ source: agent
74
+ ---
75
+ # Spec: {title}
76
+
77
+ ## What
78
+ {concrete deliverable}
79
+
80
+ ## Done When
81
+ - [ ] {specific verifiable check}
82
+
83
+ ## Constraints
84
+ {requirements}
85
+
86
+ ## Non-Goals
87
+ {what this explicitly does NOT include}
88
+
89
+ ## Design
90
+ {technical detail}
91
+ ```
92
+
93
+ For RISK type:
94
+ ```markdown
95
+ ---
96
+ tags: [risk, {project-slug}]
97
+ date: {YYYY-MM-DD}
98
+ severity: critical | high | medium | low
99
+ status: open
100
+ source: agent
101
+ ---
102
+ # Risk: {R-ID} — {title}
103
+
104
+ ## Description
105
+ What the risk is and what triggers it.
106
+
107
+ ## Impact
108
+ What happens if this materializes.
109
+
110
+ ## Mitigation
111
+ Specific steps — never "TBD".
112
+
113
+ ## Owner
114
+ Who is responsible.
115
+ ```
116
+
117
+ **Step 5 — Write to vault**
118
+ - Filename: `{YYYY-MM-DD}_{kebab-title}.md`
119
+ - Location: `{vault_path}/specs/`
120
+ - Vault indexing is automatic
121
+ - Report: `✓ Spec written to {vault_path}/specs/{filename}`