@esoteric-logic/praxis-harness 2.7.0 → 2.9.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 (85) hide show
  1. package/README.md +48 -48
  2. package/base/CLAUDE.md +34 -25
  3. package/base/configs/ci/lint-stack.yml +19 -109
  4. package/base/configs/registry.json +1 -5
  5. package/base/hooks/settings-hooks.json +0 -13
  6. package/base/hooks/vault-checkpoint.sh +0 -2
  7. package/base/rules/code-quality.md +56 -0
  8. package/base/rules/coding.md +15 -110
  9. package/base/skills/code-excellence.md +69 -0
  10. package/base/skills/engineering-judgment.md +71 -0
  11. package/base/skills/{architecture-patterns → px-architecture-patterns}/SKILL.md +1 -1
  12. package/base/skills/{code-gc → px-code-gc}/SKILL.md +3 -3
  13. package/base/skills/{communication-standards → px-communication-standards}/SKILL.md +1 -1
  14. package/base/skills/{context-probe → px-context-probe}/SKILL.md +1 -1
  15. package/base/skills/{context-reset → px-context-reset}/SKILL.md +1 -1
  16. package/base/skills/{context7-lookup → px-context7-lookup}/SKILL.md +1 -1
  17. package/base/skills/{debug → px-debug}/SKILL.md +1 -1
  18. package/base/skills/px-deepsource-coverage/SKILL.md +48 -0
  19. package/base/skills/px-deepsource-review/SKILL.md +50 -0
  20. package/base/skills/px-deepsource-setup/SKILL.md +56 -0
  21. package/base/skills/{deliberate → px-deliberate}/SKILL.md +1 -1
  22. package/base/skills/{discover → px-discover}/SKILL.md +1 -1
  23. package/base/skills/{discuss → px-discuss}/SKILL.md +1 -1
  24. package/base/skills/{execute → px-execute}/SKILL.md +1 -1
  25. package/base/skills/{fast → px-fast}/SKILL.md +1 -1
  26. package/base/skills/{kit → px-kit}/SKILL.md +1 -1
  27. package/base/skills/{managing-git-identities → px-managing-git-identities}/SKILL.md +1 -1
  28. package/base/skills/{next → px-next}/SKILL.md +1 -1
  29. package/base/skills/{plan → px-plan}/SKILL.md +1 -1
  30. package/base/skills/{plan-writer → px-plan-writer}/SKILL.md +1 -1
  31. package/base/skills/{pre-commit-lint → px-pre-commit-lint}/SKILL.md +2 -3
  32. package/base/skills/{quick → px-quick}/SKILL.md +1 -1
  33. package/base/skills/{repair → px-repair}/SKILL.md +1 -1
  34. package/base/skills/{research → px-research}/SKILL.md +1 -1
  35. package/base/skills/{review → px-review}/SKILL.md +1 -1
  36. package/base/skills/{risk → px-risk}/SKILL.md +1 -1
  37. package/base/skills/{scaffold-exist → px-scaffold-exist}/SKILL.md +1 -1
  38. package/base/skills/{scaffold-new → px-scaffold-new}/SKILL.md +1 -1
  39. package/base/skills/{scaffold-new → px-scaffold-new}/references/repo-CLAUDE-md-template.md +1 -1
  40. package/base/skills/{secret-scan → px-secret-scan}/SKILL.md +1 -1
  41. package/base/skills/{session-retro → px-session-retro}/SKILL.md +1 -1
  42. package/base/skills/{ship → px-ship}/SKILL.md +2 -2
  43. package/base/skills/{simplify → px-simplify}/SKILL.md +1 -1
  44. package/base/skills/{spec → px-spec}/SKILL.md +1 -1
  45. package/base/skills/{standup → px-standup}/SKILL.md +1 -1
  46. package/base/skills/{status-update → px-status-update}/SKILL.md +1 -1
  47. package/base/skills/{subagent → px-subagent}/SKILL.md +1 -1
  48. package/base/skills/{sync-memory → px-sync-memory}/SKILL.md +1 -1
  49. package/base/skills/{vault-gc → px-vault-gc}/SKILL.md +1 -1
  50. package/base/skills/{verify → px-verify}/SKILL.md +3 -3
  51. package/base/skills/{verify-app → px-verify-app}/SKILL.md +1 -1
  52. package/base/skills/self-verify.md +78 -0
  53. package/bin/praxis-preflight.sh +1 -1
  54. package/bin/praxis.js +3 -3
  55. package/kits/code-quality/KIT.md +55 -0
  56. package/kits/code-quality/configs/checks-registry.json +35 -0
  57. package/kits/code-quality/configs/thresholds.json +36 -0
  58. package/kits/code-quality/hooks/generate-baseline.sh +30 -0
  59. package/kits/code-quality/hooks/post-commit.sh +28 -0
  60. package/kits/code-quality/hooks/pre-push.sh +104 -0
  61. package/kits/code-quality/install.sh +68 -0
  62. package/kits/code-quality/manifest.json +27 -0
  63. package/kits/code-quality/skills/over-engineering.md +72 -0
  64. package/kits/code-quality/skills/performance-review.md +65 -0
  65. package/kits/code-quality/skills/self-review.md +55 -0
  66. package/kits/code-quality/skills/structural-review.md +57 -0
  67. package/kits/code-quality/teardown.sh +21 -0
  68. package/kits/security/commands/security-audit.md +1 -1
  69. package/kits/security/install.sh +1 -1
  70. package/kits/security/teardown.sh +1 -1
  71. package/package.json +1 -1
  72. package/scripts/install-tools.sh +2 -2
  73. package/scripts/test-harness.sh +11 -19
  74. package/base/configs/linters/.pre-commit-config.yaml +0 -63
  75. package/base/configs/linters/semgrep.yml +0 -65
  76. package/base/hooks/post-session-lint.sh +0 -44
  77. package/base/hooks/quality-check.sh +0 -202
  78. /package/base/skills/{blind-judge → px-blind-judge}/SKILL.md +0 -0
  79. /package/base/skills/{dep-hygiene → px-dep-hygiene}/SKILL.md +0 -0
  80. /package/base/skills/{scaffold-new → px-scaffold-new}/references/claude-progress-template.json +0 -0
  81. /package/base/skills/{scaffold-new → px-scaffold-new}/references/gitignore-template.txt +0 -0
  82. /package/base/skills/{scaffold-new → px-scaffold-new}/references/vault-index-template.md +0 -0
  83. /package/base/skills/{scaffold-new → px-scaffold-new}/references/vault-learnings-template.md +0 -0
  84. /package/base/skills/{scaffold-new → px-scaffold-new}/references/vault-status-template.md +0 -0
  85. /package/base/skills/{scaffold-new → px-scaffold-new}/references/vault-tasks-template.md +0 -0
package/README.md CHANGED
@@ -10,7 +10,7 @@ Praxis gives Claude Code a three-layer operating system:
10
10
 
11
11
  **Universal base** — always loaded. Praxis structures work (discuss → plan → execute → verify → simplify → ship). Built-in quality enforcement (debugging, code review, simplification).
12
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`.
13
+ **AI-Kits** — activated on demand via `/px-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 `/px-kit:off`.
14
14
 
15
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
16
 
@@ -33,51 +33,51 @@ npx @esoteric-logic/praxis-harness@latest uninstall # remove Praxis-owned file
33
33
 
34
34
  ## After install
35
35
 
36
- Verify with `/help` — you should see Praxis commands (`/discuss`, `/execute`, `/verify`, `/plan`, `/ship`, `/kit:*`).
36
+ Verify with `/help` — you should see Praxis commands (`/px-discuss`, `/px-execute`, `/px-verify`, `/px-plan`, `/px-ship`, `/px-kit:*`).
37
37
 
38
38
  ## Workflow
39
39
 
40
40
  The standard Praxis workflow for feature development:
41
41
 
42
42
  ```
43
- /standup → orient (reads status.md, surfaces stale state)
44
- /discuss → frame the problem (conversational, scope guard)
45
- /discover → research options with confidence levels (before /spec)
46
- /plan → plan milestones (with dependency ordering + boundaries)
47
- /execute → implement one milestone at a time (file-group isolation)
48
- /verify → validate (test/lint/typecheck/build, self-review, UNIFY)
49
- /session-retro → capture learnings, update vault
43
+ /px-standup → orient (reads status.md, surfaces stale state)
44
+ /px-discuss → frame the problem (conversational, scope guard)
45
+ /px-discover → research options with confidence levels (before /px-spec)
46
+ /px-plan → plan milestones (with dependency ordering + boundaries)
47
+ /px-execute → implement one milestone at a time (file-group isolation)
48
+ /px-verify → validate (test/lint/typecheck/build, self-review, UNIFY)
49
+ /px-session-retro → capture learnings, update vault
50
50
  ```
51
51
 
52
- For pure bugfixes: `/debug` (test-first debugging, skips the full loop).
53
- For code review: `/review` (launches subagent review at any time).
54
- For technical research: `/discover` (structured options evaluation before decisions).
52
+ For pure bugfixes: `/px-debug` (test-first debugging, skips the full loop).
53
+ For code review: `/px-review` (launches subagent review at any time).
54
+ For technical research: `/px-discover` (structured options evaluation before decisions).
55
55
 
56
56
  ## Commands
57
57
 
58
58
  | Command | Purpose |
59
59
  |---------|---------|
60
- | `discuss` | Conversational problem framing, SPEC synthesis, scope guard |
61
- | `execute` | Implement one milestone with file-group isolation + boundary enforcement |
62
- | `verify` | Validate milestone (test/lint/build), self-review, UNIFY phase summary |
63
-
64
- | `plan` | Create a dated work plan with milestone dependencies + checkpoints |
65
- | `spec` | Create a structured spec or ADR with conflict detection |
66
- | `discover` | Structured technical discovery with confidence-rated options |
67
- | `standup` | Session-start orientation from vault state |
68
- | `risk` | Add a risk register entry to the vault |
69
- | `kit` | Activate/deactivate an AI-Kit |
70
- | `review` | Manual code review via subagent |
71
- | `simplify` | Post-implementation code simplification via subagent |
72
- | `debug` | Structured test-first debugging |
73
- | `ship` | Commit, push, and PR in one command with pre-flight checks |
74
- | `verify-app` | End-to-end verification with regression analysis |
75
- | `session-retro` | End-of-session retrospective with learnings extraction |
76
- | `status-update` | Manual vault status.md update |
77
- | `repair` | Structured 3-attempt fix-and-verify loop for failed milestones |
78
- | `sync-memory` | Bridge auto-memory insights to Obsidian vault |
79
- | `context-probe` | Assess context health and recommend action |
80
- | `context-reset` | Reload context from vault without clearing session |
60
+ | `px-discuss` | Conversational problem framing, SPEC synthesis, scope guard |
61
+ | `px-execute` | Implement one milestone with file-group isolation + boundary enforcement |
62
+ | `px-verify` | Validate milestone (test/lint/build), self-review, UNIFY phase summary |
63
+
64
+ | `px-plan` | Create a dated work plan with milestone dependencies + checkpoints |
65
+ | `px-spec` | Create a structured spec or ADR with conflict detection |
66
+ | `px-discover` | Structured technical discovery with confidence-rated options |
67
+ | `px-standup` | Session-start orientation from vault state |
68
+ | `px-risk` | Add a risk register entry to the vault |
69
+ | `px-kit` | Activate/deactivate an AI-Kit |
70
+ | `px-review` | Manual code review via subagent |
71
+ | `px-simplify` | Post-implementation code simplification via subagent |
72
+ | `px-debug` | Structured test-first debugging |
73
+ | `px-ship` | Commit, push, and PR in one command with pre-flight checks |
74
+ | `px-verify-app` | End-to-end verification with regression analysis |
75
+ | `px-session-retro` | End-of-session retrospective with learnings extraction |
76
+ | `px-status-update` | Manual vault status.md update |
77
+ | `px-repair` | Structured 3-attempt fix-and-verify loop for failed milestones |
78
+ | `px-sync-memory` | Bridge auto-memory insights to Obsidian vault |
79
+ | `px-context-probe` | Assess context health and recommend action |
80
+ | `px-context-reset` | Reload context from vault without clearing session |
81
81
 
82
82
  ## Rules
83
83
 
@@ -114,11 +114,11 @@ Key additions in this version:
114
114
 
115
115
  | Kit | Activate | What it does |
116
116
  |-----|----------|-------------|
117
- | web-designer | `/kit:web-designer` | Design system init → component build → accessibility audit → production lint |
118
- | infrastructure | `/kit:infrastructure` | Terraform plan → apply → drift detection → compliance check |
119
- | api | `/kit:api` | RESTful conventions → OpenAPI specs → contract testing |
120
- | security | `/kit:security` | Threat modeling → IAM review → OWASP audit |
121
- | data | `/kit:data` | Schema design → migration planning → query optimization |
117
+ | web-designer | `/px-kit:web-designer` | Design system init → component build → accessibility audit → production lint |
118
+ | infrastructure | `/px-kit:infrastructure` | Terraform plan → apply → drift detection → compliance check |
119
+ | api | `/px-kit:api` | RESTful conventions → OpenAPI specs → contract testing |
120
+ | security | `/px-kit:security` | Threat modeling → IAM review → OWASP audit |
121
+ | data | `/px-kit:data` | Schema design → migration planning → query optimization |
122
122
 
123
123
  More kits coming. See `docs/creating-a-kit.md` to build your own.
124
124
 
@@ -158,13 +158,13 @@ Praxis auto-documents your work in the vault with zero manual effort. Two indepe
158
158
 
159
159
  | Skill | Auto-writes to vault |
160
160
  |-------|---------------------|
161
- | `/execute` | `status.md` loop position, `decision-log.md` scope events |
162
- | `/verify` | `claude-progress.json` milestones[] |
163
- | `/review` | `specs/review-{date}-{slug}.md` (full findings breakdown) |
164
- | `/simplify` | `notes/{date}_simplify-findings.md` |
165
- | `/debug` | `notes/{date}_debug-trace.md` |
166
- | `/verify-app` | `specs/verify-app-{date}-{slug}.md` |
167
- | `/ship` | `claude-progress.json` features[] |
161
+ | `/px-execute` | `status.md` loop position, `decision-log.md` scope events |
162
+ | `/px-verify` | `claude-progress.json` milestones[] |
163
+ | `/px-review` | `specs/review-{date}-{slug}.md` (full findings breakdown) |
164
+ | `/px-simplify` | `notes/{date}_simplify-findings.md` |
165
+ | `/px-debug` | `notes/{date}_debug-trace.md` |
166
+ | `/px-verify-app` | `specs/verify-app-{date}-{slug}.md` |
167
+ | `/px-ship` | `claude-progress.json` features[] |
168
168
 
169
169
  **On context compaction** (automatic fallback):
170
170
  - `plans/{date}-compact-checkpoint.md` — git state, active plan, loop position
@@ -184,14 +184,14 @@ Re-copies all hooks, skills, rules, and kits from the latest npm package version
184
184
 
185
185
  ### Updating existing projects
186
186
 
187
- After a harness update that adds new vault files (like `decision-log.md`), run `/scaffold-exist` in a Claude Code session to audit your vault and add any missing files. This is non-destructive — it never overwrites existing content.
187
+ After a harness update that adds new vault files (like `decision-log.md`), run `/px-scaffold-exist` in a Claude Code session to audit your vault and add any missing files. This is non-destructive — it never overwrites existing content.
188
188
 
189
189
  ```
190
190
  Step 1: npx @esoteric-logic/praxis-harness@latest update → deploys new hooks, skills, rules
191
- Step 2: /scaffold-exist → audits vault, adds missing files
191
+ Step 2: /px-scaffold-exist → audits vault, adds missing files
192
192
  ```
193
193
 
194
- New projects get everything automatically via `/scaffold-new`.
194
+ New projects get everything automatically via `/px-scaffold-new`.
195
195
 
196
196
  ## Uninstalling
197
197
 
package/base/CLAUDE.md CHANGED
@@ -14,20 +14,20 @@ You are a senior engineering partner. Think before you build. Verify before you
14
14
 
15
15
  ## Workflow Hierarchy
16
16
  - **Praxis** owns the outer loop: discuss → plan → execute → verify → simplify → ship.
17
- Always start feature work with `/discuss` or `/next`.
17
+ Always start feature work with `/px-discuss` or `/px-next`.
18
18
  - **Kits** inject domain context into this workflow — they don't replace it.
19
- - Pure bugfixes: skip the full loop, use `/debug` directly.
20
- - Trivial changes (typos, config): use `/fast` to skip planning.
21
- - After every implementation: run `/simplify` to clean up code before verify.
22
- - Use `/verify-app` for end-to-end checks, `/ship` when ready to commit+push+PR.
19
+ - Pure bugfixes: skip the full loop, use `/px-debug` directly.
20
+ - Trivial changes (typos, config): use `/px-fast` to skip planning.
21
+ - After every implementation: run `/px-simplify` to clean up code before verify.
22
+ - Use `/px-verify-app` for end-to-end checks, `/px-ship` when ready to commit+push+PR.
23
23
 
24
24
  ## Plan Mode Protocol
25
25
  For non-trivial tasks (3+ steps):
26
26
  1. Start in Plan Mode — iterate on the plan until it's solid
27
27
  2. Switch to auto-accept edits and let Claude one-shot the implementation
28
- 3. Run `/simplify` after implementation
29
- 4. Run `/verify-app` to confirm everything works
30
- 5. Run `/ship` to commit, push, and PR
28
+ 3. Run `/px-simplify` after implementation
29
+ 4. Run `/px-verify-app` to confirm everything works
30
+ 5. Run `/px-ship` to commit, push, and PR
31
31
 
32
32
  ## Error Learning
33
33
  When a mistake is corrected: update project CLAUDE.md `## Error Learning` section
@@ -85,7 +85,7 @@ Registered via `claude mcp add`. Persist globally across sessions.
85
85
 
86
86
  | Server | Purpose | Install | Degrades without |
87
87
  |--------|---------|---------|-----------------|
88
- | perplexity | AI web search | `bash scripts/onboard-mcp.sh perplexity` | No web research in `/discover` |
88
+ | perplexity | AI web search | `bash scripts/onboard-mcp.sh perplexity` | No web research in `/px-discover` |
89
89
  | filesystem | Direct vault file access | `claude mcp add filesystem` | Uses shell for vault reads |
90
90
  | sequential-thinking | Multi-step reasoning | `claude mcp add sequential-thinking` | Standard reasoning only |
91
91
 
@@ -101,8 +101,8 @@ Missing servers are non-blocking — features degrade gracefully.
101
101
  - GitHub Actions → `~/.claude/rules/github-actions.md`
102
102
  - PowerShell scripts → `~/.claude/rules/powershell.md`
103
103
  - Git operation → `~/.claude/rules/git-workflow.md`
104
- - Client-facing writing → auto-loaded by `communication-standards` skill
105
- - Architecture/specs → auto-loaded by `architecture-patterns` skill
104
+ - Client-facing writing → auto-loaded by `px-communication-standards` skill
105
+ - Architecture/specs → auto-loaded by `px-architecture-patterns` skill
106
106
  5. Quality re-anchor: read most recent `compact-checkpoint.md` → check the Quality State section.
107
107
  - If lint findings existed before compaction: re-run `golangci-lint run`, confirm status.
108
108
  - If tests were failing before compaction: re-run test command, confirm status.
@@ -120,32 +120,41 @@ Missing servers are non-blocking — features degrade gracefully.
120
120
  - Use vault search when Obsidian is not running (obsidian backend requires Obsidian open)
121
121
 
122
122
  ## AI-Kit Registry
123
- Kits activate via `/kit:<n>` slash command. Kits are idempotent — double-activate is a no-op.
123
+ Kits activate via `/px-kit:<n>` slash command. Kits are idempotent — double-activate is a no-op.
124
124
 
125
125
  | Kit | Activate | Domain |
126
126
  |-----|----------|--------|
127
- | web-designer | `/kit:web-designer` | Design system → components → accessibility → production lint |
128
- | infrastructure | `/kit:infrastructure` | Terraform → Azure → GitHub Actions → compliance |
129
- | api | `/kit:api` | RESTful conventions → OpenAPI specs → contract testing |
130
- | security | `/kit:security` | Threat modeling → IAM review → OWASP audit |
131
- | data | `/kit:data` | Schema design migration planningquery optimization |
127
+ | web-designer | `/px-kit:web-designer` | Design system → components → accessibility → production lint |
128
+ | infrastructure | `/px-kit:infrastructure` | Terraform → Azure → GitHub Actions → compliance |
129
+ | api | `/px-kit:api` | RESTful conventions → OpenAPI specs → contract testing |
130
+ | security | `/px-kit:security` | Threat modeling → IAM review → OWASP audit |
131
+ | code-quality | `/px-kit:code-quality` | SAST + secrets + SCA + IaC gate AI review (over-engineering, smells, structure) |
132
+ | data | `/px-kit:data` | Schema design → migration planning → query optimization |
132
133
 
133
134
  Kit manifests live in `~/.claude/kits/<name>/KIT.md`.
134
135
 
135
136
  ## Rules Registry — Load on Demand Only
136
137
 
137
- ### Universal — always active (8 rules)
138
+ ### Universal — always active (9 rules)
138
139
  | File | Purpose |
139
140
  |------|---------|
140
141
  | `~/.claude/rules/profile.md` | Who the user is, identities, working style |
141
142
  | `~/.claude/rules/execution-loop.md` | SPEC/PLAN/VALIDATE loop enforcement |
142
- | `~/.claude/rules/coding.md` | Code quality, security, complexity thresholds, Context7 mandate |
143
+ | `~/.claude/rules/coding.md` | Context7 mandate, tool preferences, quality architecture reference |
144
+ | `~/.claude/rules/code-quality.md` | Layer 2: Active constraints — hard limits during generation |
143
145
  | `~/.claude/rules/git-workflow.md` | Commits, branches, identity verification, pre-commit checks |
144
146
  | `~/.claude/rules/vault.md` | Second brain integration — vault backend, file purposes |
145
147
  | `~/.claude/rules/context-management.md` | Context anti-rot, phase scoping, context reset protocol |
146
148
  | `~/.claude/rules/memory-boundary.md` | Auto-memory boundary, MEMORY.md cap, dream integration |
147
149
  | `~/.claude/rules/security-posture.md` | Sandbox model, credential protection, protected paths |
148
150
 
151
+ ### Skills — loaded at session start
152
+ | File | Purpose |
153
+ |------|---------|
154
+ | `~/.claude/skills/code-excellence.md` | Layer 1: Principles — shapes reasoning about code |
155
+ | `~/.claude/skills/engineering-judgment.md` | Layer 1: Meta-reasoning — principal engineer decision framework |
156
+ | `~/.claude/skills/self-verify.md` | Layer 3: Self-verification protocol — proves correctness before commit |
157
+
149
158
  ### Scoped — load only when paths match
150
159
  | File | Loads when |
151
160
  |------|------------|
@@ -159,17 +168,17 @@ Kit manifests live in `~/.claude/kits/<name>/KIT.md`.
159
168
  ### Auto-invocable skills (replace former universal rules)
160
169
  | Skill | Triggers when |
161
170
  |-------|--------------|
162
- | `communication-standards` | Writing client-facing docs, proposals, status reports, commits, PRs |
163
- | `architecture-patterns` | Writing ADRs, specs, system design, risk docs, blocker reports |
171
+ | `px-communication-standards` | Writing client-facing docs, proposals, status reports, commits, PRs |
172
+ | `px-architecture-patterns` | Writing ADRs, specs, system design, risk docs, blocker reports |
164
173
 
165
174
  ## Judgment & Research Commands
166
175
 
167
176
  | Command | Purpose |
168
177
  |---------|---------|
169
- | `/duel` | Parallel Alpha/Beta implementation → blind scoring → synthesis |
170
- | `/deliberate` | Multi-perspective decision analysis with scored option matrix |
171
- | `/freshness` | Full dependency audit — CVEs, outdated packages, maintenance status |
172
- | `/research <pkg>` | Live docs (Context7) + CVE/version/maintenance check (Perplexity Sonar) |
178
+ | `/px-duel` | Parallel Alpha/Beta implementation → blind scoring → synthesis |
179
+ | `/px-deliberate` | Multi-perspective decision analysis with scored option matrix |
180
+ | `/px-freshness` | Full dependency audit — CVEs, outdated packages, maintenance status |
181
+ | `/px-research <pkg>` | Live docs (Context7) + CVE/version/maintenance check (Perplexity Sonar) |
173
182
 
174
183
  MCP server templates: `base/configs/mcp-servers.json` — declarative config for context7, github, perplexity-sonar.
175
184
  Dependency registry: `base/configs/registry.json` — single source of truth for all tools, auth, hooks.
@@ -1,7 +1,7 @@
1
- # Polyglot Lint Stack — 3-Layer CI Template
1
+ # Lint Stack — CI Template
2
2
  # Copy to: .github/workflows/lint-stack.yml
3
- # Conditional: each tool runs only if its language files exist in the repo.
4
- # Pin actions to SHA update hashes when upgrading versions.
3
+ # DeepSource handles comprehensive analysis via GitHub app integration.
4
+ # This workflow provides basic file hygiene checks only.
5
5
 
6
6
  name: Lint Stack
7
7
  on:
@@ -10,117 +10,27 @@ on:
10
10
 
11
11
  permissions:
12
12
  contents: read
13
- pull-requests: write
14
13
 
15
14
  jobs:
16
- # ─────────────────────────────────────────────
17
- # LAYER 1: Fast Feedback (~10s per tool)
18
- # ─────────────────────────────────────────────
19
- lint:
20
- name: L1 — Lint + Format
15
+ hygiene:
16
+ name: File Hygiene
21
17
  runs-on: ubuntu-latest
22
18
  steps:
23
19
  - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24
20
 
25
- # Python Ruff
26
- - name: Ruff check
27
- if: hashFiles('**/*.py') != ''
28
- uses: astral-sh/ruff-action@9700c1666704e06e2cf8f9046755e3dfc6297e40 # v3.2.1
29
- with:
30
- args: "check"
31
- - name: Ruff format check
32
- if: hashFiles('**/*.py') != ''
33
- uses: astral-sh/ruff-action@9700c1666704e06e2cf8f9046755e3dfc6297e40 # v3.2.1
34
- with:
35
- args: "format --check"
36
-
37
- # JS/TS — Biome
38
- - name: Setup Biome
39
- if: hashFiles('**/*.js', '**/*.ts', '**/*.jsx', '**/*.tsx') != ''
40
- uses: biomejs/setup-biome@1cbe33ead22c7a2fded3b52fa2893611c815c3d2 # v2.5.0
41
- - name: Biome CI
42
- if: hashFiles('**/*.js', '**/*.ts', '**/*.jsx', '**/*.tsx') != ''
43
- run: biome ci .
44
-
45
- # Go — golangci-lint
46
- - name: golangci-lint
47
- if: hashFiles('go.mod') != ''
48
- uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
49
- with:
50
- version: v2.1
51
-
52
- # Rust — Clippy
53
- - name: Setup Rust toolchain
54
- if: hashFiles('Cargo.toml') != ''
55
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # stable
56
- with:
57
- toolchain: stable
58
- components: clippy, rustfmt
59
- - name: Clippy
60
- if: hashFiles('Cargo.toml') != ''
61
- run: cargo clippy --all-targets --all-features -- -D warnings
62
- - name: rustfmt check
63
- if: hashFiles('Cargo.toml') != ''
64
- run: cargo fmt --all -- --check
65
-
66
- # Shell — ShellCheck
67
- - name: ShellCheck
68
- if: hashFiles('**/*.sh') != ''
21
+ - name: Check for merge conflict markers
69
22
  run: |
70
- sudo apt-get install -y shellcheck
71
- find . -name '*.sh' -not -path './node_modules/*' -not -path './vendor/*' | xargs shellcheck -s bash
72
-
73
- # ─────────────────────────────────────────────
74
- # LAYER 2: Quality Gates (~2min)
75
- # ─────────────────────────────────────────────
76
- security-scan:
77
- name: L2 — Semgrep
78
- runs-on: ubuntu-latest
79
- needs: lint
80
- steps:
81
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
82
- - uses: semgrep/semgrep-action@713efdd345ae26c72e79b5b32927be8e0e6bab83 # v1
83
- with:
84
- config: >-
85
- p/default
86
- p/secrets
87
- p/owasp-top-ten
88
- env:
89
- SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
23
+ if git grep -rn '<<<<<<< \|>>>>>>> ' -- ':!*.yml' ':!*.yaml'; then
24
+ echo "::error::Merge conflict markers found"
25
+ exit 1
26
+ fi
90
27
 
91
- # Uncomment to add SonarQube quality gate (requires self-hosted server)
92
- # sonarqube:
93
- # name: L2 SonarQube
94
- # runs-on: ubuntu-latest
95
- # needs: lint
96
- # steps:
97
- # - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
98
- # with:
99
- # fetch-depth: 0
100
- # - uses: SonarSource/sonarqube-scan-action@0e1a25e90571a34e2ec5c72ee40ba45cc73a1e6e # v4
101
- # env:
102
- # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
103
- # SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
104
- # - uses: SonarSource/sonarqube-quality-gate-action@dc2f7b0dd95544cd550de3066f25f47e3fc20894 # v1.1.0
105
- # timeout-minutes: 5
106
- # env:
107
- # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
108
-
109
- # ─────────────────────────────────────────────
110
- # LAYER 3: AI Review (~2min, optional)
111
- # ─────────────────────────────────────────────
112
- # Uncomment to enable AI-powered PR review.
113
- # Requires OPENAI_API_KEY secret or self-hosted Ollama.
114
- #
115
- # ai-review:
116
- # name: L3 — AI Review
117
- # runs-on: ubuntu-latest
118
- # needs: [security-scan]
119
- # steps:
120
- # - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
121
- # - uses: Codium-ai/pr-agent@main
122
- # env:
123
- # OPENAI_KEY: ${{ secrets.OPENAI_API_KEY }}
124
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125
- # with:
126
- # command: review
28
+ - name: Check for large files
29
+ run: |
30
+ find . -type f -size +500k \
31
+ -not -path './.git/*' \
32
+ -not -path './node_modules/*' \
33
+ -not -path './vendor/*' \
34
+ -not -path './.terraform/*' | head -20 | while read -r f; do
35
+ echo "::warning file=$f::File exceeds 500KB"
36
+ done
@@ -26,16 +26,13 @@
26
26
  {"name": "gh", "minVersion": "2.0.0", "install": "brew install gh"}
27
27
  ],
28
28
  "optional": [
29
- {"name": "trufflehog", "feature": "secret-scanning", "install": "brew install trufflehog"},
30
- {"name": "gitleaks", "feature": "secret-scanning", "install": "brew install gitleaks"},
29
+ {"name": "deepsource", "feature": "code-analysis", "install": "curl -fsSL https://cli.deepsource.com/install | sh"},
31
30
  {"name": "osv-scanner", "feature": "dep-audit", "install": "go install github.com/google/osv-scanner/cmd/osv-scanner@latest"},
32
31
  {"name": "pip-audit", "feature": "dep-audit-python", "install": "pip install pip-audit"},
33
32
  {"name": "docker", "feature": "docker-sandbox", "install": "brew install --cask docker"},
34
33
  {"name": "biome", "feature": "lint-js", "install": "npm install -g @biomejs/biome"},
35
34
  {"name": "ruff", "feature": "lint-python", "install": "pip install ruff"},
36
- {"name": "semgrep", "feature": "security-scan", "install": "pip install semgrep"},
37
35
  {"name": "markdownlint", "feature": "lint-markdown", "install": "npm install -g markdownlint-cli"},
38
- {"name": "pre-commit", "feature": "pre-commit-hooks", "install": "pip install pre-commit"},
39
36
  {"name": "golangci-lint", "feature": "lint-go", "install": "brew install golangci-lint"},
40
37
  {"name": "rustfmt", "feature": "format-rust", "install": "rustup component add rustfmt"},
41
38
  {"name": "clippy", "feature": "lint-rust", "install": "rustup component add clippy"}
@@ -104,7 +101,6 @@
104
101
  {"path": "base/hooks/file-guard.sh", "event": "PreToolUse", "matcher": "Write|Edit|MultiEdit"},
105
102
  {"path": "base/hooks/identity-check.sh", "event": "PreToolUse", "matcher": "Bash"},
106
103
  {"path": "base/hooks/credential-guard.sh", "event": "PreToolUse", "matcher": "Bash"},
107
- {"path": "base/hooks/quality-check.sh", "event": "PostToolUse", "matcher": "Write|Edit|MultiEdit"},
108
104
  {"path": "base/hooks/session-data-collect.sh", "event": "Stop", "matcher": ""}
109
105
  ],
110
106
  "optional": [
@@ -39,15 +39,6 @@
39
39
  }
40
40
  ],
41
41
  "PostToolUse": [
42
- {
43
- "matcher": "Write|Edit|MultiEdit",
44
- "hooks": [
45
- {
46
- "type": "command",
47
- "command": "bash ~/.claude/hooks/quality-check.sh"
48
- }
49
- ]
50
- },
51
42
  {
52
43
  "matcher": "Write|Edit|MultiEdit",
53
44
  "hooks": [
@@ -62,10 +53,6 @@
62
53
  {
63
54
  "matcher": "",
64
55
  "hooks": [
65
- {
66
- "type": "command",
67
- "command": "bash ~/.claude/hooks/post-session-lint.sh"
68
- },
69
56
  {
70
57
  "type": "prompt",
71
58
  "prompt": "Run the project test suite. Read CLAUDE.md ## Commands for the test command. If no test command defined, respond {ok:true}. Run tests. If all pass: respond {ok:true}. If tests fail: respond {ok:false, reason:'Tests failing: <summary>'}. Do not fix — only report."
@@ -23,8 +23,6 @@ CHECKPOINT_FILE="$PLANS_DIR/$DATE-compact-checkpoint.md"
23
23
 
24
24
  BRANCH=$(git --no-pager rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown")
25
25
  LAST_COMMIT=$(git --no-pager log --oneline -1 2>/dev/null || echo "no commits")
26
- PROJECT_DIR=$(basename "$PWD")
27
-
28
26
  STATUS_FILE="$VAULT_PATH/status.md"
29
27
  PROGRESS_FILE="$VAULT_PATH/claude-progress.json"
30
28
 
@@ -0,0 +1,56 @@
1
+ # Code Quality — Active Constraints
2
+
3
+ These rules are active during code generation. They are not reviewed after writing —
4
+ they shape what gets written in the first place.
5
+
6
+ ## Before writing any function
7
+ State in a single-line comment what this function does.
8
+ If you cannot write the comment in one sentence, split the function first.
9
+ The function name must be derivable from that comment.
10
+
11
+ ## Hard limits — never violate without explicit documented exception
12
+ - No function exceeds 30 lines of logic (blank lines and comments excluded)
13
+ - No block nesting deeper than 3 levels
14
+ - No function with more than 4 parameters — use an options/config object beyond 4
15
+ - No class with more than 5 public methods — split the class first
16
+ - No file with more than 300 lines — split the module first
17
+ - No `TODO` or `FIXME` committed — resolve inline or create a tracked issue with link in comment
18
+
19
+ ## Before introducing any abstraction (interface, base class, factory, wrapper)
20
+ Identify exactly 2 or more existing concrete use cases that require it.
21
+ They must exist in the current codebase, not in anticipated future requirements.
22
+ If only 1 use case exists, inline the logic and do not create the abstraction.
23
+
24
+ ## Before adding any new dependency
25
+ - Verify the standard library does not provide equivalent functionality
26
+ - Verify the package has had a commit within the last 6 months
27
+ - Pin to exact version in package manifest
28
+ - Add a comment above the import explaining why this dependency was chosen over alternatives
29
+
30
+ ## On every new public function or method
31
+ Write the JSDoc/docstring before writing the implementation.
32
+ The docstring must include: what it does, what each parameter is, what it returns, what it throws.
33
+ If you cannot write the docstring, you do not yet understand what you are building.
34
+
35
+ ## On error handling — no exceptions
36
+ - Every async function has explicit error handling (try/catch or .catch() or Result type)
37
+ - Every function that receives external input validates type, range, and format before use
38
+ - Every thrown error has a message that identifies: what failed, why it failed, what the caller should do
39
+ - Errors are never caught and silently ignored — log at minimum, re-throw if unhandled
40
+
41
+ ## On tests
42
+ - New public functions require tests before the PR is considered complete
43
+ - Tests assert behavior (outputs and side effects), not implementation (which internal functions were called)
44
+ - Each test covers exactly one scenario — no multi-scenario tests
45
+ - Test files mirror source file structure — `src/auth/login.ts` → `tests/auth/login.test.ts`
46
+
47
+ ## On comments
48
+ Write comments that explain WHY, not WHAT.
49
+ Delete any comment that restates what the code already says.
50
+ Write comments that capture: non-obvious decisions, external constraints, known limitations.
51
+
52
+ ## On naming
53
+ - No single-letter variables except loop indices (`i`, `j`, `k`) in tight loops of ≤5 lines
54
+ - No abbreviations unless they are universally understood domain terms (`id`, `url`, `api`)
55
+ - No generic names: `data`, `info`, `temp`, `result`, `obj`, `val`, `res`, `thing`, `stuff`
56
+ - Rename before committing. Names do not get "cleaned up later."