@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.
- package/LICENSE +21 -0
- package/README.md +192 -0
- package/base/CLAUDE.md +148 -0
- package/base/commands/context-reset.md +72 -0
- package/base/commands/debug.md +63 -0
- package/base/commands/discover.md +49 -0
- package/base/commands/gsd-discuss.md +53 -0
- package/base/commands/gsd-execute.md +60 -0
- package/base/commands/gsd-verify.md +78 -0
- package/base/commands/kit.md +62 -0
- package/base/commands/plan.md +91 -0
- package/base/commands/ralph.md +110 -0
- package/base/commands/review.md +81 -0
- package/base/commands/risk.md +53 -0
- package/base/commands/ship.md +74 -0
- package/base/commands/spec.md +121 -0
- package/base/commands/standup.md +57 -0
- package/base/rules/architecture.md +51 -0
- package/base/rules/azure.md +90 -0
- package/base/rules/code-quality.md +65 -0
- package/base/rules/coding.md +139 -0
- package/base/rules/communication.md +69 -0
- package/base/rules/context-management.md +136 -0
- package/base/rules/execution-loop.md +84 -0
- package/base/rules/git-workflow.md +51 -0
- package/base/rules/github-actions.md +48 -0
- package/base/rules/powershell.md +72 -0
- package/base/rules/profile.md +31 -0
- package/base/rules/security.md +40 -0
- package/base/rules/terraform.md +48 -0
- package/base/rules/vault.md +134 -0
- package/base/skills/code-gc/SKILL.md +205 -0
- package/base/skills/code-simplifier/SKILL.md +132 -0
- package/base/skills/prd-writer/SKILL.md +108 -0
- package/base/skills/prd-writer/references/prd-template.md +22 -0
- package/base/skills/pre-commit-lint/SKILL.md +71 -0
- package/base/skills/scaffold-exist/SKILL.md +85 -0
- package/base/skills/scaffold-new/SKILL.md +177 -0
- package/base/skills/scaffold-new/references/claude-progress-template.json +24 -0
- package/base/skills/scaffold-new/references/gitignore-template.txt +65 -0
- package/base/skills/scaffold-new/references/repo-CLAUDE-md-template.md +87 -0
- package/base/skills/scaffold-new/references/vault-index-template.md +31 -0
- package/base/skills/scaffold-new/references/vault-learnings-template.md +21 -0
- package/base/skills/scaffold-new/references/vault-status-template.md +21 -0
- package/base/skills/scaffold-new/references/vault-tasks-template.md +20 -0
- package/base/skills/session-retro/SKILL.md +146 -0
- package/base/skills/subagent-review/SKILL.md +126 -0
- package/base/skills/vault-gc/SKILL.md +93 -0
- package/base/skills/verify-app/SKILL.md +156 -0
- package/bin/praxis.js +385 -0
- package/kits/infrastructure/KIT.md +66 -0
- package/kits/infrastructure/commands/infra-apply.md +44 -0
- package/kits/infrastructure/commands/infra-compliance.md +65 -0
- package/kits/infrastructure/commands/infra-drift.md +45 -0
- package/kits/infrastructure/commands/infra-plan.md +45 -0
- package/kits/infrastructure/install.sh +43 -0
- package/kits/infrastructure/rules/infrastructure.md +82 -0
- package/kits/infrastructure/teardown.sh +14 -0
- package/kits/web-designer/KIT.md +76 -0
- package/kits/web-designer/commands/web-audit.md +67 -0
- package/kits/web-designer/commands/web-component.md +54 -0
- package/kits/web-designer/commands/web-init.md +42 -0
- package/kits/web-designer/commands/web-tokens-sync.md +49 -0
- package/kits/web-designer/install.sh +41 -0
- package/kits/web-designer/rules/web-design.md +79 -0
- package/kits/web-designer/teardown.sh +26 -0
- package/package.json +28 -0
- package/scripts/health-check.sh +160 -0
- package/scripts/lint-harness.sh +195 -0
- package/scripts/onboard-mcp.sh +326 -0
- package/scripts/update.sh +88 -0
- package/templates/_index.md +33 -0
- package/templates/adr.md +28 -0
- package/templates/claude-progress.json +24 -0
- package/templates/plan.md +46 -0
- package/templates/project-index.md +31 -0
- package/templates/session-note.md +21 -0
- package/templates/status.md +27 -0
- package/templates/tasks.md +27 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jeffrey Attoh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Praxis
|
|
2
|
+
|
|
3
|
+
> *"Philosophy must be practiced, not just studied."* — Musonius Rufus
|
|
4
|
+
|
|
5
|
+
A layered harness for [Claude Code](https://docs.anthropic.com/en/docs/claude-code). Universal workflow discipline + domain-specific AI-Kits + persistent vault integration.
|
|
6
|
+
|
|
7
|
+
## What it does
|
|
8
|
+
|
|
9
|
+
Praxis gives Claude Code a three-layer operating system:
|
|
10
|
+
|
|
11
|
+
**Universal base** — always loaded. [GSD](https://github.com/gsd-build/get-shit-done) structures work (spec → plan → execute → verify). [Superpowers](https://github.com/obra/superpowers) enforces quality (TDD, debugging, code review). [Ralph](https://github.com/snarktank/ralph) runs autonomous execution loops.
|
|
12
|
+
|
|
13
|
+
**AI-Kits** — activated on demand via `/kit:<name>`. Each kit bundles domain-specific rules, skills, MCP servers, and slash commands. Activate the web-designer kit and your components get design system enforcement, accessibility auditing, and production lint. Deactivate with `/kit:off`.
|
|
14
|
+
|
|
15
|
+
**Project config** — per-repo rules that fire automatically based on file paths. Terraform rules load when you touch `.tf` files. GitHub Actions rules load when you touch workflow YAML. No manual switching.
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx praxis-harness
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
One command. Copies rules, commands, skills, and kits directly into `~/.claude/`. Node.js 18+ must be installed first.
|
|
24
|
+
|
|
25
|
+
**Subsequent commands:**
|
|
26
|
+
```bash
|
|
27
|
+
npx praxis-harness update # re-copy from latest npm version
|
|
28
|
+
npx praxis-harness health # verify install integrity
|
|
29
|
+
npx praxis-harness uninstall # remove Praxis-owned files from ~/.claude/
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## After install
|
|
33
|
+
|
|
34
|
+
Open Claude Code and run:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
/plugin marketplace add obra/superpowers-marketplace
|
|
38
|
+
/plugin install superpowers@superpowers-marketplace
|
|
39
|
+
/plugin marketplace add snarktank/ralph
|
|
40
|
+
/plugin install ralph-skills@ralph-marketplace
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Verify with `/help` — you should see GSD, Superpowers, and Praxis commands.
|
|
44
|
+
|
|
45
|
+
## Workflow
|
|
46
|
+
|
|
47
|
+
The standard GSD workflow for feature development:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
/standup → orient (reads status.md, surfaces stale state)
|
|
51
|
+
/gsd:discuss → frame the problem (SPEC questions, scope guard)
|
|
52
|
+
/discover → research options with confidence levels (before /spec)
|
|
53
|
+
/gsd:plan-phase → plan milestones (with dependency ordering + boundaries)
|
|
54
|
+
/gsd:execute → implement one milestone at a time (file-group isolation)
|
|
55
|
+
/gsd:verify → validate (test/lint/typecheck/build, self-review, UNIFY)
|
|
56
|
+
/session-retro → capture learnings, update vault
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
For pure bugfixes: `/debug` (test-first debugging, skips GSD).
|
|
60
|
+
For code review: `/review` (launches subagent review at any time).
|
|
61
|
+
For technical research: `/discover` (structured options evaluation before decisions).
|
|
62
|
+
|
|
63
|
+
## Commands
|
|
64
|
+
|
|
65
|
+
| Command | Purpose |
|
|
66
|
+
|---------|---------|
|
|
67
|
+
| `gsd-discuss` | Frame the problem, SPEC questions, scope guard |
|
|
68
|
+
| `gsd-execute` | Implement one milestone with file-group isolation + boundary enforcement |
|
|
69
|
+
| `gsd-verify` | Validate milestone (test/lint/build), self-review, UNIFY phase summary |
|
|
70
|
+
| `ralph` | Autonomous multi-story execution from a PRD |
|
|
71
|
+
| `plan` | Create a dated work plan with milestone dependencies + checkpoints |
|
|
72
|
+
| `spec` | Create a structured spec or ADR with conflict detection |
|
|
73
|
+
| `discover` | Structured technical discovery with confidence-rated options |
|
|
74
|
+
| `standup` | Session-start orientation from vault state |
|
|
75
|
+
| `risk` | Add a risk register entry to the vault |
|
|
76
|
+
| `kit` | Activate/deactivate an AI-Kit |
|
|
77
|
+
| `review` | Manual code review via subagent |
|
|
78
|
+
| `debug` | Structured test-first debugging |
|
|
79
|
+
| `context-reset` | Reload context from vault without clearing session |
|
|
80
|
+
|
|
81
|
+
## Rules
|
|
82
|
+
|
|
83
|
+
15 rules across universal and scoped categories. Universal rules load every session. Scoped rules load only when matching file patterns are detected.
|
|
84
|
+
|
|
85
|
+
Key additions in this version:
|
|
86
|
+
- **context-management** — context brackets (FRESH/MODERATE/DEPLETED/CRITICAL) adapt behavior to session stage
|
|
87
|
+
- **vault** — multi-backend vault integration (obsidian, logseq, plain, custom)
|
|
88
|
+
|
|
89
|
+
## Ralph
|
|
90
|
+
|
|
91
|
+
Ralph is the autonomous execution mode for multi-story work. Use it when you have >5 independent stories that don't require human checkpoints.
|
|
92
|
+
|
|
93
|
+
1. Write a PRD using `/prd-writer` (structured story format with file groups and estimates)
|
|
94
|
+
2. Run `/ralph` to begin autonomous execution
|
|
95
|
+
3. Each story runs in a fresh context with its own verify cycle
|
|
96
|
+
4. Blocked stories are recorded and skipped — reported at run end
|
|
97
|
+
|
|
98
|
+
Ralph is not a replacement for GSD — it runs GSD internally per story. Use GSD for work that needs cross-story reasoning or architectural decisions.
|
|
99
|
+
|
|
100
|
+
## Architecture
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
┌────────────────────────────────────────┐
|
|
104
|
+
│ Project config │
|
|
105
|
+
│ .claude/rules/*.md (path-scoped) │
|
|
106
|
+
├────────────────────────────────────────┤
|
|
107
|
+
│ AI-Kit (/kit:web-designer) │
|
|
108
|
+
│ Skills chain + domain rules + MCPs │
|
|
109
|
+
├────────────────────────────────────────┤
|
|
110
|
+
│ Universal base (always loaded) │
|
|
111
|
+
│ GSD → Superpowers → Ralph │
|
|
112
|
+
├────────────────────────────────────────┤
|
|
113
|
+
│ Vault layer │
|
|
114
|
+
│ obsidian | logseq | plain | custom │
|
|
115
|
+
├────────────────────────────────────────┤
|
|
116
|
+
│ Claude Code │
|
|
117
|
+
│ ~/.claude/ + plugins + subagents │
|
|
118
|
+
└────────────────────────────────────────┘
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Workflow hierarchy:** GSD owns the outer loop (discuss → plan → execute → verify). Superpowers enforces quality inside execution (TDD, review, debug). Ralph runs autonomous multi-story iterations. Kits inject domain context into this workflow — they don't replace it.
|
|
122
|
+
|
|
123
|
+
## Available kits
|
|
124
|
+
|
|
125
|
+
| Kit | Activate | What it does |
|
|
126
|
+
|-----|----------|-------------|
|
|
127
|
+
| web-designer | `/kit:web-designer` | Design system init → component build → accessibility audit → production lint |
|
|
128
|
+
| infrastructure | `/kit:infrastructure` | Terraform plan → apply → drift detection → compliance check |
|
|
129
|
+
|
|
130
|
+
More kits coming. See `docs/creating-a-kit.md` to build your own.
|
|
131
|
+
|
|
132
|
+
## Vault integration
|
|
133
|
+
|
|
134
|
+
Praxis integrates with a persistent vault for project state, session learnings, and architecture decisions. Four backends are supported:
|
|
135
|
+
|
|
136
|
+
| Backend | Description | Search tool |
|
|
137
|
+
|---------|-------------|-------------|
|
|
138
|
+
| `obsidian` | Obsidian vault (default) | [Obsidian CLI](https://obsidian.md) |
|
|
139
|
+
| `logseq` | Logseq graph | ripgrep |
|
|
140
|
+
| `plain` | Plain markdown directory (`~/.praxis-vault`) | ripgrep |
|
|
141
|
+
| `custom` | Any directory you choose | ripgrep |
|
|
142
|
+
|
|
143
|
+
The backend and vault path are configured per machine during install:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"vault_path": "/Users/you/Documents/Obsidian",
|
|
148
|
+
"vault_backend": "obsidian",
|
|
149
|
+
"vault_name": "My Vault",
|
|
150
|
+
"repo_path": "/Users/you/repos/praxis"
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
- **obsidian**: requires [Obsidian CLI](https://obsidian.md) (enable in Obsidian Settings > General > Command line interface). Obsidian must be running for vault search.
|
|
155
|
+
- **logseq/plain/custom**: uses ripgrep for vault search — no extra dependencies
|
|
156
|
+
|
|
157
|
+
## Updating
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npx praxis-harness update
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Re-copies all files from the latest npm package version. Config file is preserved.
|
|
164
|
+
|
|
165
|
+
## Uninstalling
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npx praxis-harness uninstall
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Removes all Praxis-owned files from `~/.claude/`. Does not delete config, vault templates, or installed plugins.
|
|
172
|
+
|
|
173
|
+
## Development
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
git clone https://github.com/arcanesme/praxis.git
|
|
177
|
+
cd praxis
|
|
178
|
+
bash install.sh
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The git-clone + `install.sh` path uses symlinks instead of copies, so edits in the repo are immediately reflected.
|
|
182
|
+
|
|
183
|
+
## Requirements
|
|
184
|
+
|
|
185
|
+
- macOS or Linux
|
|
186
|
+
- Claude Code CLI
|
|
187
|
+
- Node.js 18+
|
|
188
|
+
- Obsidian, Logseq, or a plain markdown directory (optional, for vault integration)
|
|
189
|
+
|
|
190
|
+
## License
|
|
191
|
+
|
|
192
|
+
MIT
|
package/base/CLAUDE.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# ═══════════════════════════════════════════════════════════════
|
|
2
|
+
# GLOBAL CLAUDE.MD — Praxis Execution Engine
|
|
3
|
+
# Location: ~/.claude/CLAUDE.md | Applies to ALL projects, ALL sessions
|
|
4
|
+
# MAP: This file is ~100 lines. Detail lives in ~/.claude/rules/
|
|
5
|
+
# ═══════════════════════════════════════════════════════════════
|
|
6
|
+
|
|
7
|
+
## Identity
|
|
8
|
+
You are a senior engineering partner. Think before you build. Verify before you report. Repair before you proceed.
|
|
9
|
+
- No flattery. No filler. Be skeptical. Be concise.
|
|
10
|
+
- If intent is unclear, ask. Do not guess.
|
|
11
|
+
- Tell me when I am wrong. If a better approach exists, say so.
|
|
12
|
+
- Never say "looks good" about your own output.
|
|
13
|
+
- Every option presented MUST include a recommendation and why.
|
|
14
|
+
|
|
15
|
+
## Workflow Hierarchy
|
|
16
|
+
- **GSD** owns the outer loop: discuss → plan → execute → verify → simplify → ship.
|
|
17
|
+
Always start feature work with GSD.
|
|
18
|
+
- **Superpowers** enforces quality inside execution (TDD, review, debug).
|
|
19
|
+
Its skills auto-activate — never invoke them alongside GSD phases.
|
|
20
|
+
- **Ralph** runs autonomous multi-story iterations from the terminal.
|
|
21
|
+
- **Kits** inject domain context into this workflow — they don't replace it.
|
|
22
|
+
- Never invoke `/superpowers:write-plan` alongside `/gsd:plan-phase`.
|
|
23
|
+
- Pure bugfixes: skip GSD, use Superpowers debugging directly.
|
|
24
|
+
- After every implementation: run `/simplify` to clean up code before verify.
|
|
25
|
+
- Use `/verify-app` for end-to-end checks, `/ship` when ready to commit+push+PR.
|
|
26
|
+
|
|
27
|
+
## Plan Mode Protocol
|
|
28
|
+
For non-trivial tasks (3+ steps):
|
|
29
|
+
1. Start in Plan Mode — iterate on the plan until it's solid
|
|
30
|
+
2. Switch to auto-accept edits and let Claude one-shot the implementation
|
|
31
|
+
3. Run `/simplify` after implementation
|
|
32
|
+
4. Run `/verify-app` to confirm everything works
|
|
33
|
+
5. Run `/ship` to commit, push, and PR
|
|
34
|
+
|
|
35
|
+
## Error Learning
|
|
36
|
+
When a mistake is corrected: update project CLAUDE.md `## Error Learning` section
|
|
37
|
+
with a specific, actionable rule to prevent recurrence. Each correction becomes
|
|
38
|
+
permanent institutional memory. Don't wait for session-retro — fix the rule immediately.
|
|
39
|
+
|
|
40
|
+
## Non-Negotiables (fire every session)
|
|
41
|
+
|
|
42
|
+
**Before any non-trivial task:**
|
|
43
|
+
- WHAT / DONE-WHEN / CONSTRAINTS / NON-GOALS — answer all four before starting.
|
|
44
|
+
|
|
45
|
+
**Stop-and-Fix Rule:** Validation fails → fix now → re-validate → proceed.
|
|
46
|
+
If cannot fix in 3 attempts: STOP. Report What / So What / Now What.
|
|
47
|
+
|
|
48
|
+
**Before every commit:**
|
|
49
|
+
1. Secret scan: `rg "(sk-|ghp_|pplx-|AKIA|Bearer [A-Za-z0-9+/]{20,})" $(git diff --staged --name-only)`
|
|
50
|
+
2. Lint + typecheck — no commits with warnings or errors.
|
|
51
|
+
3. `git --no-pager config user.email` → must match expected identity. If mismatch: STOP.
|
|
52
|
+
|
|
53
|
+
**Before writing any templated file:** Scan for unreplaced `{placeholder}` patterns. Zero must remain.
|
|
54
|
+
|
|
55
|
+
## Vault Configuration
|
|
56
|
+
Vault path and backend are machine-specific. Read from `~/.claude/praxis.config.json`:
|
|
57
|
+
```json
|
|
58
|
+
{ "vault_path": "/path/to/vault", "vault_backend": "obsidian" }
|
|
59
|
+
```
|
|
60
|
+
Supported backends: `obsidian` (default), `logseq`, `plain`, `custom`.
|
|
61
|
+
If config file is missing: tell the user to run `praxis/install.sh`.
|
|
62
|
+
All `{vault_path}` references in rules and skills resolve from this config.
|
|
63
|
+
|
|
64
|
+
## Durable Memory
|
|
65
|
+
Context is volatile. Files are permanent. Act accordingly.
|
|
66
|
+
|
|
67
|
+
| Purpose | Location |
|
|
68
|
+
|---------|----------|
|
|
69
|
+
| Execution plans | `{vault_path}/plans/YYYY-MM-DD_[task-slug].md` |
|
|
70
|
+
| Project state (human) | `{vault_path}/status.md` |
|
|
71
|
+
| Project state (machine) | `{vault_path}/claude-progress.json` |
|
|
72
|
+
| Project metadata | `{vault_path}/_index.md` |
|
|
73
|
+
| Learnings | `{vault_path}/notes/learnings.md` |
|
|
74
|
+
|
|
75
|
+
## Vault Protocol
|
|
76
|
+
- ALWAYS run a vault search before reading vault files (see vault.md backend table).
|
|
77
|
+
- Obsidian indexes in real-time — no manual update command needed.
|
|
78
|
+
- Link format: obsidian → `[[wikilinks]]`; logseq/plain/custom → standard markdown links.
|
|
79
|
+
- Detect project from CWD matching `local_path` in `_index.md`.
|
|
80
|
+
|
|
81
|
+
## MCP Servers
|
|
82
|
+
Registered via `claude mcp add`. Persist globally across sessions.
|
|
83
|
+
|
|
84
|
+
| Server | Purpose | API Key |
|
|
85
|
+
|--------|---------|---------|
|
|
86
|
+
| context7 | Live library/API docs | None |
|
|
87
|
+
| perplexity | AI web search | `PERPLEXITY_API_KEY` |
|
|
88
|
+
| github | Repo operations, PRs, issues | `GITHUB_PERSONAL_ACCESS_TOKEN` |
|
|
89
|
+
|
|
90
|
+
Check: `claude mcp list` | Manage: `bash scripts/onboard-mcp.sh [server|all]`
|
|
91
|
+
Missing servers are non-blocking — features degrade gracefully.
|
|
92
|
+
|
|
93
|
+
## After Compaction — Bootstrap
|
|
94
|
+
1. Read project CLAUDE.md (always first)
|
|
95
|
+
2. Check `claude-progress.json` — if `.ralph_state.current_story` is set: read it NOW, it is authoritative
|
|
96
|
+
3. Active task? → read active plan current milestone only
|
|
97
|
+
No active task? → read `status.md`
|
|
98
|
+
4. Load rules only for what the current task touches:
|
|
99
|
+
- Terraform/Azure → `~/.claude/rules/terraform.md`
|
|
100
|
+
- GitHub Actions → `~/.claude/rules/github-actions.md`
|
|
101
|
+
- PowerShell scripts → `~/.claude/rules/powershell.md`
|
|
102
|
+
- Git operation → `~/.claude/rules/git-workflow.md`
|
|
103
|
+
- Security concern → `~/.claude/rules/security.md`
|
|
104
|
+
|
|
105
|
+
## Core Anti-Patterns (NEVER)
|
|
106
|
+
- Silently swallow errors or use empty catch blocks
|
|
107
|
+
- Claim "tests pass" without running them and showing output
|
|
108
|
+
- Keep plans, specs, or decisions only in conversation memory
|
|
109
|
+
- Proceed past a failed milestone
|
|
110
|
+
- Expand scope without asking
|
|
111
|
+
- Hardcode secrets or credentials
|
|
112
|
+
- Commit with wrong git identity
|
|
113
|
+
- Write a file with unreplaced {placeholders}
|
|
114
|
+
- Use vault search when Obsidian is not running (obsidian backend requires Obsidian open)
|
|
115
|
+
|
|
116
|
+
## AI-Kit Registry
|
|
117
|
+
Kits activate via `/kit:<n>` slash command. Kits are idempotent — double-activate is a no-op.
|
|
118
|
+
|
|
119
|
+
| Kit | Activate | Domain |
|
|
120
|
+
|-----|----------|--------|
|
|
121
|
+
| web-designer | `/kit:web-designer` | Design system → components → accessibility → production lint |
|
|
122
|
+
| infrastructure | `/kit:infrastructure` | Terraform → Azure → GitHub Actions → compliance |
|
|
123
|
+
|
|
124
|
+
Kit manifests live in `~/.claude/kits/<name>/KIT.md`.
|
|
125
|
+
|
|
126
|
+
## Rules Registry — Load on Demand Only
|
|
127
|
+
|
|
128
|
+
### Universal — always active
|
|
129
|
+
| File | Purpose |
|
|
130
|
+
|------|---------|
|
|
131
|
+
| `~/.claude/rules/profile.md` | Who the user is, active projects, identities |
|
|
132
|
+
| `~/.claude/rules/execution-loop.md` | SPEC/PLAN/VALIDATE loop enforcement |
|
|
133
|
+
| `~/.claude/rules/coding.md` | Context7 mandate, error handling, no hardcodes |
|
|
134
|
+
| `~/.claude/rules/code-quality.md` | Language-agnostic quality standards |
|
|
135
|
+
| `~/.claude/rules/git-workflow.md` | Commits, branches, identity verification |
|
|
136
|
+
| `~/.claude/rules/security.md` | Secrets, credentials, auth patterns |
|
|
137
|
+
| `~/.claude/rules/communication.md` | Client writing, no AI attribution |
|
|
138
|
+
| `~/.claude/rules/vault.md` | Second brain integration — obsidian, logseq, or plain markdown |
|
|
139
|
+
| `~/.claude/rules/architecture.md` | ADR format, What/So What/Now What, risk docs |
|
|
140
|
+
| `~/.claude/rules/context-management.md` | GSD/Ralph anti-rot, context reset protocol |
|
|
141
|
+
|
|
142
|
+
### Scoped — load only when paths match
|
|
143
|
+
| File | Loads when |
|
|
144
|
+
|------|------------|
|
|
145
|
+
| `~/.claude/rules/azure.md` | `**/*.tf`, `**/*.bicep`, `**/*.azcli` |
|
|
146
|
+
| `~/.claude/rules/terraform.md` | `**/*.tf`, `**/*.tfvars` |
|
|
147
|
+
| `~/.claude/rules/github-actions.md` | `.github/workflows/**` |
|
|
148
|
+
| `~/.claude/rules/powershell.md` | `**/*.ps1`, `**/*.psm1` |
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Checkpoint current session state to vault files before a context reset. Use when context degradation is detected (repeated corrections, loop behavior, instruction drift).
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
You are preparing a clean context reset for the current session.
|
|
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
|
+
- If no project detected: ask which project before continuing
|
|
11
|
+
|
|
12
|
+
**Step 2 — Read current state**
|
|
13
|
+
- Read the active plan file (from `status.md` → `current_plan:` field)
|
|
14
|
+
- Read `claude-progress.json` for machine state
|
|
15
|
+
- Identify: current milestone, last 3 decisions, any STOP conditions or blockers
|
|
16
|
+
|
|
17
|
+
**Step 3 — Write context checkpoint**
|
|
18
|
+
Write a standalone checkpoint file at `{vault_path}/plans/current-phase-summary.md`:
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
---
|
|
22
|
+
tags: [checkpoint, {project-slug}]
|
|
23
|
+
date: {YYYY-MM-DD}
|
|
24
|
+
source: agent
|
|
25
|
+
---
|
|
26
|
+
# Context Checkpoint — {YYYY-MM-DD HH:MM}
|
|
27
|
+
|
|
28
|
+
## Active Plan
|
|
29
|
+
{plan filename}
|
|
30
|
+
|
|
31
|
+
## Last Milestone Completed
|
|
32
|
+
{milestone name and status}
|
|
33
|
+
|
|
34
|
+
## Decisions (last 3)
|
|
35
|
+
1. {decision} — {rationale}
|
|
36
|
+
2. {decision} — {rationale}
|
|
37
|
+
3. {decision} — {rationale}
|
|
38
|
+
|
|
39
|
+
## Active STOP Conditions
|
|
40
|
+
{any blockers or stop conditions, or "None"}
|
|
41
|
+
|
|
42
|
+
## Next Step
|
|
43
|
+
{what should happen when the session resumes}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Step 4 — Update status.md**
|
|
47
|
+
Update `status.md` with current What / So What / Now What:
|
|
48
|
+
- **What**: what was accomplished before the reset
|
|
49
|
+
- **So What**: why the reset is happening (context degradation symptoms)
|
|
50
|
+
- **Now What**: resume from the checkpoint in the active plan
|
|
51
|
+
|
|
52
|
+
**Step 5 — Update claude-progress.json**
|
|
53
|
+
Write a session snapshot to `claude-progress.json`:
|
|
54
|
+
- Update `last_session` with current date and a note about the context reset
|
|
55
|
+
- If Ralph is active: preserve `ralph_state` exactly as-is
|
|
56
|
+
|
|
57
|
+
**Step 6 — Instruct the user**
|
|
58
|
+
Print:
|
|
59
|
+
```
|
|
60
|
+
Context checkpoint saved to:
|
|
61
|
+
Checkpoint: {vault_path}/plans/current-phase-summary.md
|
|
62
|
+
Status: {vault_path}/status.md
|
|
63
|
+
Progress: {vault_path}/claude-progress.json
|
|
64
|
+
|
|
65
|
+
Run /clear to reset context, then paste this bootstrap prompt:
|
|
66
|
+
|
|
67
|
+
Context reset. Bootstrap:
|
|
68
|
+
1. Read project CLAUDE.md
|
|
69
|
+
2. Read {vault_path}/plans/{current-plan}
|
|
70
|
+
3. Read {vault_path}/plans/current-phase-summary.md
|
|
71
|
+
4. Resume from milestone: {milestone-name}
|
|
72
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Structured test-first debugging. Reproduce the bug, write a failing test, isolate root cause, fix, verify. Use for pure bugfixes — skips GSD phases.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
You are running structured debugging.
|
|
6
|
+
|
|
7
|
+
**Step 1 — Gather bug report**
|
|
8
|
+
Ask for all of these (accept partial, fill gaps from code):
|
|
9
|
+
- **Observed behavior**: What actually happens?
|
|
10
|
+
- **Expected behavior**: What should happen instead?
|
|
11
|
+
- **Reproduction steps**: Exact sequence to trigger the bug.
|
|
12
|
+
- **Suspect files**: Where in the code does the user think the bug is?
|
|
13
|
+
- **When it last worked**: What changed since then? (check `git log` if unknown)
|
|
14
|
+
|
|
15
|
+
If the user provides an error message or stack trace: use that as the starting point.
|
|
16
|
+
|
|
17
|
+
**Step 2 — Write a failing test**
|
|
18
|
+
Before touching any implementation code:
|
|
19
|
+
1. Write a test that demonstrates the bug — it MUST fail.
|
|
20
|
+
2. Run the test. Confirm it fails with the expected error.
|
|
21
|
+
3. If the test passes: re-examine the bug report. The reproduction may be wrong,
|
|
22
|
+
or the bug may not be where the user thinks.
|
|
23
|
+
4. Show the failing test output.
|
|
24
|
+
|
|
25
|
+
**Step 3 — Isolate root cause**
|
|
26
|
+
- Read suspect files. Trace the code path from input to failure.
|
|
27
|
+
- Use `rg` to find related call sites, error handlers, recent changes.
|
|
28
|
+
- State the root cause in one sentence:
|
|
29
|
+
`Root cause: {what is wrong} in {file}:{line} because {why}.`
|
|
30
|
+
- If root cause is unclear after tracing: add diagnostic logging or breakpoints,
|
|
31
|
+
reproduce again, and narrow down.
|
|
32
|
+
|
|
33
|
+
**Step 4 — Fix the root cause**
|
|
34
|
+
- Fix the root cause, not the symptom. Keep the fix minimal.
|
|
35
|
+
- Do not refactor surrounding code as part of the fix.
|
|
36
|
+
- Do not add unrelated improvements.
|
|
37
|
+
- If the fix requires changing the test: explain why the original test was wrong.
|
|
38
|
+
|
|
39
|
+
**Step 5 — Verify**
|
|
40
|
+
1. Run the failing test from Step 2 — it MUST now pass.
|
|
41
|
+
2. Run the full test suite — no regressions.
|
|
42
|
+
3. Run the linter — clean.
|
|
43
|
+
4. Show all output.
|
|
44
|
+
|
|
45
|
+
**Step 6 — Write learnings**
|
|
46
|
+
- Read vault_path from `~/.claude/praxis.config.json`
|
|
47
|
+
- If this bug represents a pattern (not a one-off typo):
|
|
48
|
+
write a `[LEARN:bugfix]` entry to `{vault_path}/notes/learnings.md`:
|
|
49
|
+
```markdown
|
|
50
|
+
## [LEARN:bugfix] {Short title}
|
|
51
|
+
- **What**: {what went wrong}
|
|
52
|
+
- **So What**: {why it matters, how it could recur}
|
|
53
|
+
- **Now What**: {what to do to prevent recurrence}
|
|
54
|
+
- **Date**: {YYYY-MM-DD}
|
|
55
|
+
```
|
|
56
|
+
- Vault indexing is automatic.
|
|
57
|
+
|
|
58
|
+
**Rules:**
|
|
59
|
+
- Never fix without first reproducing.
|
|
60
|
+
- Never say "fixed" without showing the test passing.
|
|
61
|
+
- Skips GSD phases — for pure bugfixes only.
|
|
62
|
+
- If the "bug" is actually a feature gap: redirect to `/gsd:discuss`.
|
|
63
|
+
- If the fix touches >5 files: it is not a bugfix. Use GSD.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Structured technical discovery — evaluate options, make recommendations with confidence levels. Use before /spec when you need to research before deciding.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
You are running a structured technical discovery.
|
|
6
|
+
|
|
7
|
+
**Step 1 — Frame the question**
|
|
8
|
+
- Read vault_path from `~/.claude/praxis.config.json`
|
|
9
|
+
- What decision needs to be made? (one sentence)
|
|
10
|
+
- What are the constraints? (compliance, performance, compatibility, cost)
|
|
11
|
+
- What is already known? (run `obsidian search query="{topic}" limit=5`)
|
|
12
|
+
|
|
13
|
+
**Step 2 — Research options**
|
|
14
|
+
- Identify 2-4 viable options. For each:
|
|
15
|
+
- Name and one-sentence description
|
|
16
|
+
- Pros (concrete, measurable)
|
|
17
|
+
- Cons (concrete, measurable)
|
|
18
|
+
- Confidence: HIGH / MEDIUM / LOW (how certain are you this works?)
|
|
19
|
+
- Use Context7 for library/API evaluation. Use subagents for codebase exploration.
|
|
20
|
+
- Never recommend an option you haven't verified against constraints.
|
|
21
|
+
|
|
22
|
+
**Step 3 — Recommend**
|
|
23
|
+
- State the recommended option with rationale
|
|
24
|
+
- If confidence is LOW on all options: say so. Recommend a spike or prototype.
|
|
25
|
+
- Format:
|
|
26
|
+
```
|
|
27
|
+
Recommendation: {option}
|
|
28
|
+
Confidence: {HIGH/MEDIUM/LOW}
|
|
29
|
+
Rationale: {why this over alternatives}
|
|
30
|
+
Risk: {what could go wrong}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Step 4 — Write to vault**
|
|
34
|
+
- Write `{vault_path}/research/{YYYY-MM-DD}_{kebab-topic}.md` with frontmatter:
|
|
35
|
+
```yaml
|
|
36
|
+
---
|
|
37
|
+
tags: [research, {project-slug}]
|
|
38
|
+
date: {YYYY-MM-DD}
|
|
39
|
+
status: complete
|
|
40
|
+
source: agent
|
|
41
|
+
---
|
|
42
|
+
```
|
|
43
|
+
- Include all options evaluated, recommendation, and confidence
|
|
44
|
+
- Report: "Discovery written. Run `/spec` to formalize as ADR, or `/gsd:discuss` to proceed."
|
|
45
|
+
|
|
46
|
+
**Rules:**
|
|
47
|
+
- Discovery is research, not implementation. Zero code output.
|
|
48
|
+
- If the question is already answered by an existing spec: point to it instead.
|
|
49
|
+
- Fills the gap between `/gsd:discuss` (problem framing) and `/spec` (formal decision).
|
|
@@ -0,0 +1,53 @@
|
|
|
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.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Implementation phase — loads scoped context and works one milestone at a time. Use after plan is approved.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
You are executing the GSD implementation phase.
|
|
6
|
+
|
|
7
|
+
**Step 1 — Load implementation context**
|
|
8
|
+
- Read vault_path from `~/.claude/praxis.config.json`
|
|
9
|
+
- Read `{vault_path}/status.md` → get `current_plan:`
|
|
10
|
+
- Read the active plan file — focus on the CURRENT milestone only (not full plan)
|
|
11
|
+
- If no active plan: STOP. Tell user to run `/gsd:discuss` first.
|
|
12
|
+
|
|
13
|
+
**Step 2 — Load scoped rules**
|
|
14
|
+
Load ONLY rules relevant to files being touched in this milestone:
|
|
15
|
+
- Terraform/Azure files → `~/.claude/rules/terraform.md`, `~/.claude/rules/azure.md`
|
|
16
|
+
- GitHub Actions → `~/.claude/rules/github-actions.md`
|
|
17
|
+
- PowerShell → `~/.claude/rules/powershell.md`
|
|
18
|
+
- Git operations → `~/.claude/rules/git-workflow.md`
|
|
19
|
+
- Security-sensitive changes → `~/.claude/rules/security.md`
|
|
20
|
+
|
|
21
|
+
Do NOT load all rules. Context is scarce — spend it on implementation, not instructions.
|
|
22
|
+
|
|
23
|
+
**Step 2b — Declare file group and load boundaries**
|
|
24
|
+
Before implementing the current milestone, declare the file group:
|
|
25
|
+
- Format: `Milestone: {name} | Files: {list, max 5} | Off-limits: everything else`
|
|
26
|
+
- Write the file-group declaration to the plan file under the milestone entry.
|
|
27
|
+
- File groups can include globs (e.g., `src/components/*.tsx`).
|
|
28
|
+
- Read `## Boundaries` from the active plan. Boundary items are absolute off-limits —
|
|
29
|
+
they override file-group declarations. If a milestone file group includes a
|
|
30
|
+
boundary-protected file: STOP. Surface the conflict before proceeding.
|
|
31
|
+
- If current milestone has `checkpoint: decision` or `checkpoint: human-verify`:
|
|
32
|
+
present the decision/output to user before proceeding. Do not auto-advance.
|
|
33
|
+
|
|
34
|
+
**Step 3 — Implement current milestone**
|
|
35
|
+
- One milestone at a time. Keep diffs scoped.
|
|
36
|
+
- Do not expand scope without explicit user approval.
|
|
37
|
+
- Use extended thinking for tasks touching >3 files or requiring architectural decisions.
|
|
38
|
+
- Before writing to or editing any file: check if it is in the declared file group.
|
|
39
|
+
- If a required change is discovered in an off-limits file: STOP.
|
|
40
|
+
Surface as a new milestone candidate. Do not expand current milestone.
|
|
41
|
+
- Milestone diff must touch ONLY declared files. Undeclared file change = scope violation.
|
|
42
|
+
|
|
43
|
+
**Step 4 — Milestone completion**
|
|
44
|
+
When the milestone is complete:
|
|
45
|
+
1. Write a brief summary to the active plan file under the milestone entry
|
|
46
|
+
2. Confirm actual diff matches declared file group
|
|
47
|
+
3. Output ONE recommendation — no menu, no alternatives:
|
|
48
|
+
`Next: /gsd:verify` followed by one sentence explaining why
|
|
49
|
+
Example: "Next: /gsd:verify — 3 files changed in declared group, tests and lint needed"
|
|
50
|
+
|
|
51
|
+
**Step 5 — Ralph handoff trigger**
|
|
52
|
+
If remaining milestones >5 and all are independent (no cross-milestone reasoning):
|
|
53
|
+
- After `/gsd:verify` passes (not during Step 4), append:
|
|
54
|
+
"Also consider: /ralph — {n} independent milestones remaining"
|
|
55
|
+
- Never surface Ralph before verify completes.
|
|
56
|
+
|
|
57
|
+
**Rules:**
|
|
58
|
+
- Never skip a milestone or reorder without approval.
|
|
59
|
+
- If blocked: document the blocker in the plan file, suggest alternatives or escalate.
|
|
60
|
+
- One feature per session. Do not mix unrelated tasks.
|