@esoteric-logic/praxis-harness 1.2.1 → 2.0.1

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 (58) hide show
  1. package/README.md +14 -34
  2. package/base/CLAUDE.md +23 -25
  3. package/base/hooks/auto-format.sh +40 -0
  4. package/base/hooks/identity-check.sh +55 -0
  5. package/base/hooks/secret-scan.sh +1 -1
  6. package/base/hooks/settings-hooks.json +61 -0
  7. package/base/hooks/vault-checkpoint.sh +1 -9
  8. package/base/rules/context-management.md +3 -50
  9. package/base/rules/execution-loop.md +41 -61
  10. package/base/rules/git-workflow.md +7 -7
  11. package/base/rules/profile.md +10 -7
  12. package/base/rules/vault.md +13 -4
  13. package/base/{rules/architecture.md → skills/architecture-patterns/SKILL.md} +12 -14
  14. package/base/skills/code-gc/SKILL.md +0 -1
  15. package/base/{rules/communication.md → skills/communication-standards/SKILL.md} +13 -12
  16. package/base/{commands/context-reset.md → skills/context-reset/SKILL.md} +2 -1
  17. package/base/skills/context7-lookup/SKILL.md +53 -0
  18. package/base/{commands/debug.md → skills/debug/SKILL.md} +6 -4
  19. package/base/{commands/discover.md → skills/discover/SKILL.md} +4 -2
  20. package/base/skills/discuss/SKILL.md +96 -0
  21. package/base/{commands/gsd-execute.md → skills/execute/SKILL.md} +9 -12
  22. package/base/skills/fast/SKILL.md +28 -0
  23. package/base/{commands/kit.md → skills/kit/SKILL.md} +4 -3
  24. package/base/skills/managing-git-identities/SKILL.md +98 -0
  25. package/base/skills/next/SKILL.md +33 -0
  26. package/base/{commands/plan.md → skills/plan/SKILL.md} +40 -10
  27. package/base/skills/plan-writer/SKILL.md +72 -0
  28. package/base/skills/pre-commit-lint/SKILL.md +7 -5
  29. package/base/skills/quick/SKILL.md +42 -0
  30. package/base/{commands/review.md → skills/review/SKILL.md} +34 -10
  31. package/base/{commands/risk.md → skills/risk/SKILL.md} +2 -0
  32. package/base/skills/scaffold-exist/SKILL.md +9 -8
  33. package/base/skills/scaffold-new/SKILL.md +1 -2
  34. package/base/skills/scaffold-new/references/claude-progress-template.json +0 -10
  35. package/base/skills/scaffold-new/references/repo-CLAUDE-md-template.md +0 -1
  36. package/base/skills/secret-scan/SKILL.md +59 -0
  37. package/base/skills/session-retro/SKILL.md +3 -20
  38. package/base/{commands/ship.md → skills/ship/SKILL.md} +4 -2
  39. package/base/skills/{code-simplifier → simplify}/SKILL.md +6 -7
  40. package/base/{commands/spec.md → skills/spec/SKILL.md} +15 -7
  41. package/base/{commands/standup.md → skills/standup/SKILL.md} +2 -10
  42. package/base/skills/status-update/SKILL.md +50 -0
  43. package/base/skills/vault-gc/SKILL.md +0 -1
  44. package/base/{commands/gsd-verify.md → skills/verify/SKILL.md} +9 -6
  45. package/base/skills/verify-app/SKILL.md +5 -6
  46. package/kits/infrastructure/KIT.md +2 -15
  47. package/kits/web-designer/KIT.md +4 -17
  48. package/package.json +2 -3
  49. package/scripts/lint-harness.sh +7 -3
  50. package/templates/claude-progress.json +0 -10
  51. package/base/commands/gsd-discuss.md +0 -53
  52. package/base/commands/ralph.md +0 -110
  53. package/base/commands/simplify.md +0 -15
  54. package/base/rules/code-quality.md +0 -65
  55. package/base/rules/security.md +0 -40
  56. package/base/skills/prd-writer/SKILL.md +0 -108
  57. package/base/skills/prd-writer/references/prd-template.md +0 -22
  58. package/base/skills/subagent-review/SKILL.md +0 -126
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: status-update
3
+ disable-model-invocation: true
4
+ description: >
5
+ Atomic update to vault status.md. Ensures consistent format, enforces
6
+ the 100-line limit, and archives resolved items. Called at milestone
7
+ boundaries, session end, and phase transitions.
8
+ ---
9
+
10
+ # status-update Skill
11
+
12
+ ## Required Fields (top of status.md, always present)
13
+
14
+ ```yaml
15
+ current_plan: {path or "none"}
16
+ last_updated: {YYYY-MM-DD}
17
+ last_session: {ISO timestamp}
18
+ loop_position: DISCUSS | PLAN | EXECUTE | VERIFY | IDLE
19
+ ```
20
+
21
+ ## Steps
22
+
23
+ 1. Read vault_path from `~/.claude/praxis.config.json`
24
+ 2. Read current `{vault_path}/status.md`
25
+ 3. Update the required fields at the top
26
+ 4. Add or update the What / So What / Now What section:
27
+ - **What**: Facts only — what was done, what exists now
28
+ - **So What**: Why it matters — blockers, risks, progress
29
+ - **Now What**: Next actions, ordered by priority
30
+ 5. Check line count — if >100 lines, archive resolved sections:
31
+ - Move completed What/So What/Now What blocks to `{vault_path}/notes/{date}_status-archive.md`
32
+ - Keep only active/unresolved items in status.md
33
+ 6. Write the updated file
34
+
35
+ ## When to Call
36
+
37
+ | Trigger | What to Update |
38
+ |---------|---------------|
39
+ | Milestone complete | Add accomplishment to What, advance Now What |
40
+ | Phase transition | Update `loop_position` |
41
+ | Session end | Update `last_session`, write current state |
42
+ | Blocker hit | Add blocker to So What, propose resolution in Now What |
43
+ | Plan created/changed | Update `current_plan` |
44
+
45
+ ## Constraints
46
+
47
+ - status.md must stay under 100 lines — archive aggressively
48
+ - Never delete content — always archive to notes/
49
+ - A status.md older than 14 days is stale — vault-gc flags these
50
+ - Use `[[wikilinks]]` for all internal vault references
@@ -4,7 +4,6 @@ disable-model-invocation: true
4
4
  description: Audit vault health and detect entropy. Invoke manually with /vault-gc
5
5
  only. Two modes — full audit (manual) and lightweight staleness check (called
6
6
  inline by session-retro). Never auto-deletes. Side-effect skill — never auto-triggers.
7
- allowed-tools: Bash, Read, Write
8
7
  ---
9
8
 
10
9
  # vault-gc Skill
@@ -1,8 +1,10 @@
1
1
  ---
2
+ name: verify
3
+ disable-model-invocation: true
2
4
  description: Validation phase — runs test/lint/typecheck/build and reports PASS or FAIL. Use after each milestone completion.
3
5
  ---
4
6
 
5
- You are running the GSD verification phase for the current milestone.
7
+ You are running the verification phase for the current milestone.
6
8
 
7
9
  **Step 1 — Run validation sequence**
8
10
  Execute in order, showing actual output (never assertions):
@@ -21,13 +23,14 @@ If no commands are defined: warn and ask user for the correct commands.
21
23
 
22
24
  **Step 3 — On PASS**
23
25
  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."
26
+ 2. Commit immediately verification passed, no permission needed.
27
+ Use conventional commit format. See git-workflow.md.
28
+ 3. Check if more milestones remain:
29
+ - Yes → "Milestone committed. Run `/execute` for the next milestone."
30
+ - No → "All milestones committed. Running self-review."
28
31
  4. After ALL milestones: trigger Self-Review Protocol
29
32
  - Launch a subagent to review the full diff as a critical code reviewer
30
- - Subagent receives ONLY: the diff, the SPEC, relevant rules files
33
+ - Subagent receives ONLY: the diff, the SPEC (from plan file `## SPEC` section), relevant rules files
31
34
  - Address all Critical and Major findings before reporting done
32
35
 
33
36
  **Step 3b — UNIFY (mandatory after all milestones verified)**
@@ -5,7 +5,6 @@ description: End-to-end application verification. Launches a subagent to run the
5
5
  test suite, check build, verify runtime behavior, and confirm acceptance criteria.
6
6
  Use after implementation to catch integration issues that unit tests miss.
7
7
  Side-effect skill — never auto-triggers.
8
- allowed-tools: Bash, Read
9
8
  ---
10
9
 
11
10
  # verify-app Skill
@@ -14,16 +13,17 @@ allowed-tools: Bash, Read
14
13
  Read vault_path from `~/.claude/praxis.config.json`.
15
14
  Detect current project by matching CWD to `local_path` in vault `_index.md`.
16
15
 
17
- ## DONE-WHEN
16
+ ## Acceptance
18
17
  - [ ] Full test suite passes (not just changed tests)
19
18
  - [ ] Build succeeds with zero warnings
20
19
  - [ ] Lint passes with zero warnings
21
20
  - [ ] Typecheck passes (if applicable)
22
- - [ ] Acceptance criteria verified (from active plan done-when)
21
+ - [ ] Acceptance criteria verified (from active plan)
23
22
  - [ ] No regressions detected in related functionality
24
23
  - [ ] Verification report written
25
24
 
26
- ## NON-GOALS
25
+ ## Boundaries
26
+ Out of scope:
27
27
  - Does not fix issues — reports them for the user to address
28
28
  - Does not modify code
29
29
  - Does not deploy or publish
@@ -148,8 +148,7 @@ Format each concern as:
148
148
  | Caller | When |
149
149
  |--------|------|
150
150
  | Manual `/verify-app` | After any implementation |
151
- | `/gsd:verify` | Can replace or complement Step 1 |
152
- | Ralph iteration | After story completion |
151
+ | `/verify` | Can replace or complement Step 1 |
153
152
 
154
153
  ## Removal Condition
155
154
  Remove when CI/CD pipeline covers all verification steps and results are
@@ -43,23 +43,10 @@ environments.
43
43
 
44
44
  ## Workflow Integration
45
45
 
46
- This kit operates WITHIN the universal base workflow:
47
- - **GSD** structures the work (discuss → plan → execute → verify)
48
- - **Superpowers** enforces TDD and code review during execution
46
+ This kit operates WITHIN the Praxis workflow:
47
+ - **Praxis** structures the work (discuss → plan → execute → verify → simplify → ship)
49
48
  - **This kit** adds infrastructure-specific rules and commands
50
49
 
51
- ## Ralph Integration
52
-
53
- To persist this kit across Ralph iterations, add to project `CLAUDE.md`:
54
-
55
- ```markdown
56
- ## Active kit
57
- On session start, activate: /kit:infrastructure
58
- ```
59
-
60
- Each Ralph iteration reads project CLAUDE.md and activates the kit automatically.
61
- The `/kit` command is idempotent — double-activation is a no-op.
62
-
63
50
  ## Prerequisites
64
51
 
65
52
  Run `install.sh` in this directory to check for required CLI tools.
@@ -41,27 +41,14 @@ accessibility audit and final lint.
41
41
 
42
42
  ## Workflow Integration
43
43
 
44
- This kit operates WITHIN the universal base workflow:
45
- - **GSD** structures the work (discuss → plan → execute → verify)
46
- - **Superpowers** enforces TDD and code review during execution
44
+ This kit operates WITHIN the Praxis workflow:
45
+ - **Praxis** structures the work (discuss → plan → execute → verify → simplify → ship)
47
46
  - **This kit** adds domain-specific design rules and skill chain
48
47
 
49
- The skills chain is a SEQUENCE, not a replacement for GSD phases.
50
- Use GSD to plan which phase to work on, then execute within that phase
48
+ The skills chain is a SEQUENCE, not a replacement for Praxis phases.
49
+ Use `/plan` to plan which phase to work on, then execute within that phase
51
50
  using the kit's skills.
52
51
 
53
- ## Ralph Integration
54
-
55
- To persist this kit across Ralph iterations, add to project `CLAUDE.md`:
56
-
57
- ```markdown
58
- ## Active kit
59
- On session start, activate: /kit:web-designer
60
- ```
61
-
62
- Each Ralph iteration reads project CLAUDE.md and activates the kit automatically.
63
- The `/kit` command is idempotent — double-activation is a no-op.
64
-
65
52
  ## Prerequisites
66
53
 
67
54
  Run `install.sh` in this directory to install all required npm skills and MCP servers.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esoteric-logic/praxis-harness",
3
- "version": "1.2.1",
3
+ "version": "2.0.1",
4
4
  "description": "Layered Claude Code harness — workflow discipline, AI-Kits, persistent vault integration",
5
5
  "bin": {
6
6
  "praxis-harness": "./bin/praxis.js"
@@ -24,8 +24,7 @@
24
24
  "ai-harness",
25
25
  "vault",
26
26
  "obsidian",
27
- "workflow",
28
- "gsd"
27
+ "workflow"
29
28
  ],
30
29
  "author": "arcanesme",
31
30
  "license": "MIT",
@@ -46,7 +46,7 @@ fi
46
46
 
47
47
  # ─── 2. Skill frontmatter ───
48
48
  echo ""
49
- echo "Skills (name:, disable-model-invocation:, description:):"
49
+ echo "Skills (name:, description:):"
50
50
  if [[ -d "$REPO_PATH/base/skills" ]]; then
51
51
  for skill_dir in "$REPO_PATH"/base/skills/*/; do
52
52
  [[ -d "$skill_dir" ]] || continue
@@ -60,10 +60,14 @@ if [[ -d "$REPO_PATH/base/skills" ]]; then
60
60
  header=$(head -10 "$skill_file")
61
61
  missing=""
62
62
  echo "$header" | grep -q "^name:" || missing="$missing name:"
63
- echo "$header" | grep -q "^disable-model-invocation:" || missing="$missing disable-model-invocation:"
64
63
  echo "$header" | grep -q "^description:" || missing="$missing description:"
65
64
  if [[ -z "$missing" ]]; then
66
- ok "skills/$skill_name"
65
+ # Note auto-invocable skills (no disable-model-invocation)
66
+ if echo "$header" | grep -q "^disable-model-invocation:"; then
67
+ ok "skills/$skill_name"
68
+ else
69
+ ok "skills/$skill_name (auto-invocable)"
70
+ fi
67
71
  else
68
72
  error "skills/$skill_name SKILL.md missing:$missing"
69
73
  fi
@@ -9,16 +9,6 @@
9
9
  "stack": ["item-1", "item-2"],
10
10
  "milestones": [],
11
11
  "features": [],
12
- "ralph_state": {
13
- "mode": "idle",
14
- "prd_path": null,
15
- "current_story": null,
16
- "completed_stories": [],
17
- "blocked_stories": [],
18
- "learnings": [],
19
- "last_iteration": null,
20
- "session_count": 0
21
- },
22
12
  "last_session": null,
23
13
  "sessions": []
24
14
  }
@@ -1,53 +0,0 @@
1
- ---
2
- description: Entry point for all feature work. Frames the problem, gathers SPEC questions, and recommends next phase. Use before /gsd:plan-phase.
3
- ---
4
-
5
- You are starting the GSD discuss phase — framing the problem before planning.
6
-
7
- **Step 1 — Load minimal context**
8
- - Read vault_path from `~/.claude/praxis.config.json`
9
- - Detect project from CWD matching `local_path` in vault `_index.md`
10
- - If no project detected: ask which project before continuing
11
-
12
- **Step 2 — Read ONLY these files (nothing else)**
13
- 1. `{vault_path}/status.md` — current state and blockers
14
- 2. Active plan (if `current_plan:` is set in status.md) — skim objectives only
15
- 3. `~/.claude/rules/profile.md` — user context
16
-
17
- Do NOT load rules, kit context, or session history at this phase.
18
-
19
- **Step 3 — Search for related work**
20
- Run: `obsidian search query="{topic}" limit=5`
21
- Check if specs, prior plans, or research already exist for this topic.
22
-
23
- **Step 4 — SPEC questions**
24
- Ask the user to answer all four:
25
- - **WHAT**: Concrete deliverable (not vague goals)
26
- - **DONE-WHEN**: Specific checks that prove completion
27
- - **CONSTRAINTS**: Performance, compatibility, style requirements
28
- - **NON-GOALS**: What this task explicitly does NOT include
29
-
30
- If answers are ambiguous: ask 2–3 follow-up questions. Do not proceed with vague scope.
31
-
32
- **Step 5 — Problem framing**
33
- Output a 1-paragraph problem framing that includes:
34
- - What exists today (from status.md / vault search)
35
- - What gap or need the user described
36
- - Recommendation: proceed to `/gsd:plan-phase` or write a `/spec` first
37
-
38
- **Step 5b — Scope guard**
39
- - Problem framing (Step 5 output) must not exceed 200 words. If the problem
40
- requires more to frame: it is too large. Split into sub-problems and run
41
- `/gsd:discuss` on each separately.
42
- - After framing: explicitly list what is NOT being decided in this discuss phase.
43
- - Never output implementation code, pseudocode, or file-level changes during discuss.
44
- This phase produces a problem statement, not a solution.
45
- - If the framing implies >5 milestones or >3 file groups: flag as scope explosion
46
- risk and recommend splitting before `/gsd:plan-phase`.
47
-
48
- **Step 6 — Handoff**
49
- End with: "Run `/gsd:plan-phase` to continue, or `/spec` if this needs a design spec first."
50
-
51
- **Rules:**
52
- - Problem framing is a paragraph, not a design doc.
53
- - If scope exceeds 5 milestones: recommend splitting into multiple GSD passes.
@@ -1,110 +0,0 @@
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.
@@ -1,15 +0,0 @@
1
- ---
2
- description: Post-implementation code cleanup. Launches a subagent to find and
3
- simplify over-abstraction, dead paths, verbosity, and missed idioms in the
4
- recent diff. Run after implementation, before /verify-app or /ship.
5
- ---
6
-
7
- Invoke the code-simplifier skill on the current project's recent changes.
8
-
9
- Accept an optional scope argument:
10
- - No argument → `git diff HEAD~1` (default)
11
- - `staged` → staged changes only
12
- - `HEAD~N` or SHA → specific range
13
-
14
- The code-simplifier skill handles all phases: scope detection, subagent launch,
15
- finding presentation, user-approved edits, and optional [LEARN:simplify] capture.
@@ -1,65 +0,0 @@
1
- # Code Quality — Rules
2
- # Scope: All projects, all sessions
3
- # Complements `coding.md` with structural quality thresholds.
4
-
5
- ## Invariants — BLOCK on violation
6
-
7
- ### No deep nesting
8
- - Conditionals nested >3 levels deep must be refactored (extract function, early return, guard clause).
9
- - Applies to if/else, try/catch, loops, and match/switch statements.
10
-
11
- ### Cyclomatic complexity
12
- - Functions with cyclomatic complexity >15: BLOCK. Refactor before commit.
13
- - Measure by counting decision points (if, else if, for, while, case, &&, ||, catch).
14
-
15
- ### Public function documentation
16
- - All public functions and methods must have doc comments.
17
- - Doc comments describe intent and constraints, not implementation.
18
- - Internal/private helpers: doc comments optional, but name must be self-describing.
19
-
20
- ### No commented-out code
21
- - No commented-out code blocks in committed files.
22
- - Dead code belongs in git history, not in source files.
23
- - `// TODO:` and `// FIXME:` are annotations, not commented-out code — these are allowed.
24
-
25
- ---
26
-
27
- ## Conventions — WARN on violation
28
-
29
- ### Complexity awareness
30
- - Cyclomatic complexity >10: WARN. Consider splitting the function.
31
- - Functions longer than 50 lines: review for single-responsibility violation.
32
-
33
- ### No magic numbers
34
- - No magic numbers without a named constant and a comment explaining the value.
35
- - Exception: 0, 1, -1, and values obvious from immediate context (e.g., `array.length - 1`).
36
-
37
- ### Single responsibility
38
- - Each function does one thing. If the description requires "and", split it.
39
- - Each file has one primary concern. Utility grab-bags indicate missing abstractions.
40
-
41
- ### No hardcoded environment values
42
- - No hardcoded URLs, ports, hostnames, or credentials specific to an environment.
43
- - Use environment variables, config files, or parameter injection.
44
- - Cross-ref: `coding.md` — No hardcoded values invariant.
45
-
46
- ---
47
-
48
- ## Verification Commands
49
-
50
- ```bash
51
- # Find deeply nested blocks (rough heuristic — look for 4+ indent levels)
52
- rg '^\s{16,}(if|for|while|try)' --type-add 'code:*.{ts,js,py,go,rs}' -t code
53
-
54
- # Find commented-out code blocks (multi-line)
55
- rg '^\s*//\s*(const|let|var|function|class|import|return|if|for)' --type-add 'code:*.{ts,js}' -t code
56
- rg '^\s*#\s*(def |class |import |return |if |for )' -t py
57
-
58
- # Find magic numbers in staged files
59
- git diff --staged | grep -E '[^0-9][2-9][0-9]{2,}[^0-9]' | grep -v 'const\|#\|//'
60
- ```
61
-
62
- ---
63
-
64
- ## Removal Condition
65
- Permanent. Structural quality thresholds apply regardless of project or language.
@@ -1,40 +0,0 @@
1
- # Security — Rules
2
- # Scope: All projects, all sessions
3
-
4
- ## Invariants (BLOCK on violation)
5
-
6
- ### Secrets
7
- - NEVER hardcode secrets — no API keys, tokens, passwords, connection strings in code.
8
- Use environment variables or a secrets manager.
9
- - If a secret is found in code: flag immediately, do not proceed until remediated.
10
- - Pre-commit scan (always): `rg "(sk-|ghp_|pplx-|AKIA|Bearer [A-Za-z0-9+/]{20,})" $(git diff --staged --name-only)`
11
- - Secrets in logs: never log request bodies, headers, or responses that may contain credentials. Redact before logging.
12
-
13
- ### Input Validation
14
- - Validate all inputs at boundaries — APIs, user input, file uploads, environment variables.
15
- - Never trust external data without validation.
16
- - Validate response shape, not just status code — 200 with error body is a silent failure.
17
-
18
- ### Permissions
19
- - Least privilege — request only permissions and scopes needed.
20
- - No wildcard IAM policies. No `chmod 777`.
21
- - GitHub Actions: pin action versions to commit SHA, not tags.
22
-
23
- ## Conventions (WARN on violation)
24
-
25
- ### Dependencies
26
- - Audit new dependencies before adding: `npm audit`, `pip audit`, or equivalent.
27
- - Check for known CVEs before adding any package.
28
- - Pin to exact versions. No floating ranges in production.
29
-
30
- ## Verification Commands
31
- ```bash
32
- # Secret scan staged files
33
- rg "(sk-|ghp_|pplx-|AKIA|Bearer [A-Za-z0-9+/]{20,})" $(git diff --staged --name-only)
34
-
35
- # Secret scan entire repo (audit mode)
36
- rg "(sk-|ghp_|pplx-|AKIA|Bearer [A-Za-z0-9+/]{20,})" --glob "!*.lock" .
37
-
38
- # Check for .env files accidentally staged
39
- git diff --staged --name-only | grep -E "\.env$|\.env\."
40
- ```
@@ -1,108 +0,0 @@
1
- ---
2
- name: prd-writer
3
- disable-model-invocation: true
4
- description: Structured PRD authoring for Ralph. Gathers context, builds stories,
5
- validates against Ralph constraints, writes PRD to vault. Invoke manually with
6
- /prd-writer only. Side-effect skill — never auto-triggers.
7
- allowed-tools: Bash, Read, Write, Edit
8
- ---
9
-
10
- # prd-writer Skill
11
-
12
- ## Vault Path Resolution
13
- Read vault_path from `~/.claude/praxis.config.json`. If missing: tell user to run `install.sh`.
14
-
15
- ## DONE-WHEN
16
- - [ ] PRD written to vault with all stories populated
17
- - [ ] Every story has: role, capability, outcome, done-when, file group, dependencies, estimate
18
- - [ ] No story marked L (must be split before writing)
19
- - [ ] Total stories ≤15
20
- - [ ] ralph_state.prd_path set in claude-progress.json
21
- - [ ] status.md updated with PRD reference
22
- - [ ] Vault indexed (automatic)
23
-
24
- ## NON-GOALS
25
- - Does not execute stories — that is Ralph's job
26
- - Does not create plans — use `/plan` for that
27
- - Does not write specs or ADRs — use `/spec` for that
28
-
29
- ---
30
-
31
- ## Phase 1 — Gather Context
32
-
33
- 1. Read `{vault_path}/status.md` — current state and active work
34
- 2. Read `{vault_path}/_index.md` — project goals and metadata
35
- 3. Ask the user:
36
- - What is the PRD objective? (one sentence)
37
- - What area of the codebase does this cover?
38
- - Any known constraints or dependencies?
39
-
40
- ## Phase 2 — Build Stories
41
-
42
- For each story, collect:
43
- - **Title**: short identifier (e.g., `add-auth-middleware`)
44
- - **As a**: role
45
- - **I want**: capability
46
- - **So that**: outcome
47
- - **Done when**: list of verifiable checks
48
- - **File group**: list of files (max 3 groups per story)
49
- - **Dependencies**: story-ids that must complete first, or "none"
50
- - **Estimate**: S / M / L
51
-
52
- Present stories in a table for user review before proceeding.
53
-
54
- ## Phase 3 — Validate Against Ralph Constraints
55
-
56
- For each story, check:
57
- - Completable in ~10k output tokens
58
- - Touches ≤3 file groups
59
- - Requires ≤1 architectural decision
60
- - No cross-story reasoning required
61
- - Estimate is S or M (never L)
62
-
63
- Violations:
64
- - L estimate → STOP. Story must be split before PRD is written.
65
- - >3 file groups → STOP. Reduce scope or split.
66
- - Cross-story dependency chains → WARN. Ralph executes stories independently.
67
- - >15 stories total → suggest splitting into multiple PRDs.
68
-
69
- ## Phase 4 — Write PRD
70
-
71
- Use `references/prd-template.md` as the canonical format.
72
-
73
- 1. Fill all fields. No placeholders may remain.
74
- 2. Scan the output for unreplaced `{placeholder}` patterns. Zero must survive.
75
- 3. Write to: `{vault_path}/plans/{YYYY-MM-DD}_{kebab-title}-prd.md`
76
-
77
- ## Phase 5 — Wire State
78
-
79
- 1. Update `{vault_path}/status.md`:
80
- - Set `current_plan:` to the PRD path
81
- - Update `## Now What` with "PRD ready for Ralph execution"
82
- 2. Update `{vault_path}/claude-progress.json`:
83
- - Set `ralph_state.prd_path` to the PRD file path
84
- - Set `ralph_state.mode` to "idle"
85
- - Set `ralph_state.completed_stories` to `[]`
86
- - Set `ralph_state.blocked_stories` to `[]`
87
- 3. Report:
88
- ```
89
- ✓ PRD written: {path}
90
- ✓ Stories: {n} (S: {n}, M: {n})
91
- ✓ ralph_state: prd_path set, mode idle
92
- ✓ status.md: updated
93
-
94
- Next: run /ralph to begin autonomous execution.
95
- ```
96
-
97
- ## Error Handling
98
-
99
- | Condition | Action |
100
- |-----------|--------|
101
- | All stories marked L | Warn: "No stories are Ralph-suitable. Split or use GSD." |
102
- | >15 stories | Suggest splitting into 2+ PRDs |
103
- | Missing file groups | STOP. Every story needs a file group for Ralph |
104
- | User declines story edits | Write PRD as-is with warnings noted |
105
- | vault_path missing | Tell user to run install.sh |
106
-
107
- ## Removal Condition
108
- Remove when PRD authoring is fully automated from issue trackers or when Ralph accepts unstructured input.
@@ -1,22 +0,0 @@
1
- ---
2
- title: {PRD title}
3
- date: YYYY-MM-DD
4
- status: active
5
- stories_total: {n}
6
- ---
7
- # PRD: {title}
8
-
9
- ## Context
10
- Why this work exists. 1-3 sentences.
11
-
12
- ## Stories
13
-
14
- ### Story: {story-id}
15
- **As a**: {role}
16
- **I want**: {capability}
17
- **So that**: {outcome}
18
- **Done when**:
19
- - [ ] {verifiable check}
20
- **File group**: {list of files, max 3 groups}
21
- **Dependencies**: {story-ids that must complete first, or "none"}
22
- **Estimate**: S / M / L