@esoteric-logic/praxis-harness 2.13.0 → 2.15.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 (46) hide show
  1. package/base/CLAUDE.md +7 -1
  2. package/base/configs/registry.json +4 -2
  3. package/base/hooks/context7-remind.sh +81 -0
  4. package/base/hooks/settings-hooks.json +9 -0
  5. package/base/rules/coding.md +7 -0
  6. package/base/skills/px-prompt/SKILL.md +373 -0
  7. package/base/skills/px-research/SKILL.md +13 -0
  8. package/bin/praxis.js +7 -0
  9. package/bin/prompt-blocks.js +145 -0
  10. package/bin/prompt-compile.js +313 -0
  11. package/kits/web-designer/rules/web-design.md +13 -2
  12. package/lib/assemblers.js +249 -0
  13. package/lib/loader.js +148 -0
  14. package/package.json +10 -3
  15. package/prompts/blocks/behaviors/flag-confidence.md +13 -0
  16. package/prompts/blocks/behaviors/handle-uncertainty.md +13 -0
  17. package/prompts/blocks/behaviors/no-flattery.md +15 -0
  18. package/prompts/blocks/behaviors/recommend-with-reasons.md +13 -0
  19. package/prompts/blocks/behaviors/verify-before-reporting.md +13 -0
  20. package/prompts/blocks/context/mcp-servers.md +12 -0
  21. package/prompts/blocks/context/official-docs-first.md +16 -0
  22. package/prompts/blocks/context/praxis-workflow.md +20 -0
  23. package/prompts/blocks/context/vault-integration.md +13 -0
  24. package/prompts/blocks/domains/cloud-infrastructure.md +13 -0
  25. package/prompts/blocks/domains/govcon.md +13 -0
  26. package/prompts/blocks/domains/web-development.md +13 -0
  27. package/prompts/blocks/formats/concise-responses.md +13 -0
  28. package/prompts/blocks/formats/what-so-what-now-what.md +16 -0
  29. package/prompts/blocks/identity/research-partner.md +10 -0
  30. package/prompts/blocks/identity/senior-engineer.md +15 -0
  31. package/prompts/blocks/identity/solutions-architect.md +13 -0
  32. package/prompts/profiles/_base.yaml +15 -0
  33. package/prompts/profiles/federal-cloud.yaml +18 -0
  34. package/prompts/profiles/praxis.yaml +13 -0
  35. package/prompts/projects/_template/prompt-config.yaml +34 -0
  36. package/prompts/projects/maximus/prompt-config.yaml +13 -0
  37. package/prompts/projects/maximus/references/maturity-questions.md +634 -0
  38. package/prompts/projects/maximus/references/phase-maturity-matrix.md +188 -0
  39. package/prompts/projects/maximus/references/proposal-writing-standards.md +367 -0
  40. package/prompts/projects/maximus/space-instructions.md +67 -0
  41. package/prompts/projects/maximus/system-prompt.md +641 -0
  42. package/prompts/projects/praxis/CLAUDE.md +84 -0
  43. package/prompts/projects/praxis/project-instructions.md +24 -0
  44. package/prompts/projects/praxis/prompt-config.yaml +40 -0
  45. package/prompts/projects/praxis/space-instructions.md +28 -0
  46. package/scripts/lint-harness.sh +42 -0
package/base/CLAUDE.md CHANGED
@@ -101,8 +101,14 @@ Registered via `claude mcp add`. Persist globally across sessions.
101
101
  Check: `claude mcp list` | Manage: `bash scripts/onboard-mcp.sh [server|all]`
102
102
  Missing servers are non-blocking — features degrade gracefully.
103
103
 
104
+ **CLI companions** — invoked via npx, not MCP:
105
+
106
+ | Tool | Purpose | Invoke | Degrades without |
107
+ |------|---------|--------|-----------------|
108
+ | opensrc | Fetch library source for deep inspection | `npx opensrc <package>` | No source-level investigation; Context7 docs only |
109
+
104
110
  ## After Compaction — Bootstrap
105
- 1. Read project CLAUDE.md (always first)
111
+ 1. Read project CLAUDE.md (always first). If `AGENTS.md` exists in project root, read it too — it contains opensrc source manifests.
106
112
  2. Active task? → read active plan current milestone only
107
113
  No active task? → read `status.md`
108
114
  4. Load rules only for what the current task touches:
@@ -35,7 +35,8 @@
35
35
  {"name": "markdownlint", "feature": "lint-markdown", "install": "npm install -g markdownlint-cli"},
36
36
  {"name": "golangci-lint", "feature": "lint-go", "install": "brew install golangci-lint"},
37
37
  {"name": "rustfmt", "feature": "format-rust", "install": "rustup component add rustfmt"},
38
- {"name": "clippy", "feature": "lint-rust", "install": "rustup component add clippy"}
38
+ {"name": "clippy", "feature": "lint-rust", "install": "rustup component add clippy"},
39
+ {"name": "opensrc", "feature": "source-inspection", "install": "npx opensrc@latest --help"}
39
40
  ]
40
41
  },
41
42
  "env_vars": {
@@ -106,7 +107,8 @@
106
107
  ],
107
108
  "optional": [
108
109
  {"path": "base/hooks/recursion-guard.sh", "event": "PreToolUse", "matcher": "", "feature": "recursion-detection"},
109
- {"path": "base/hooks/dep-audit.sh", "event": "PostToolUse", "matcher": "Write|Edit|MultiEdit", "feature": "dep-audit"}
110
+ {"path": "base/hooks/dep-audit.sh", "event": "PostToolUse", "matcher": "Write|Edit|MultiEdit", "feature": "dep-audit"},
111
+ {"path": "base/hooks/context7-remind.sh", "event": "PostToolUse", "matcher": "Write|Edit|MultiEdit", "feature": "context7-enforcement"}
110
112
  ]
111
113
  },
112
114
  "claude_settings": {
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env bash
2
+ # context7-remind.sh — PostToolUse hook
3
+ # Scans written/edited files for external import statements.
4
+ # Reminds Claude to verify via Context7 if new imports are detected.
5
+ # PostToolUse hooks always exit 0 — this is a reminder, not a gate.
6
+ set -euo pipefail
7
+
8
+ trap 'exit 0' ERR
9
+
10
+ INPUT=$(cat)
11
+ FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path // empty' 2>/dev/null)
12
+
13
+ if [[ -z "$FILE_PATH" || ! -f "$FILE_PATH" ]]; then
14
+ exit 0
15
+ fi
16
+
17
+ # Only scan code files where imports are meaningful
18
+ case "$FILE_PATH" in
19
+ *.ts|*.tsx|*.js|*.jsx|*.mjs|*.cjs) LANG="js" ;;
20
+ *.py) LANG="py" ;;
21
+ *.go) LANG="go" ;;
22
+ *.rs) LANG="rs" ;;
23
+ *.java) LANG="java" ;;
24
+ *.cs) LANG="cs" ;;
25
+ *) exit 0 ;;
26
+ esac
27
+
28
+ # Build import pattern per language
29
+ case "$LANG" in
30
+ js) PATTERN="^import .+ from ['\"]|require\(['\"]" ;;
31
+ py) PATTERN="^import |^from .+ import " ;;
32
+ go) PATTERN="^import |^\t\"" ;;
33
+ rs) PATTERN="^use [a-z]" ;;
34
+ java) PATTERN="^import " ;;
35
+ cs) PATTERN="^using " ;;
36
+ esac
37
+
38
+ # Extract external imports (skip relative/internal)
39
+ IMPORTS=$(grep -E "$PATTERN" "$FILE_PATH" 2>/dev/null || true)
40
+
41
+ if [[ -z "$IMPORTS" ]]; then
42
+ exit 0
43
+ fi
44
+
45
+ # Filter out internal/relative imports
46
+ EXTERNAL=""
47
+ while IFS= read -r line; do
48
+ case "$LANG" in
49
+ js)
50
+ # Skip relative imports (./ ../)
51
+ if echo "$line" | grep -qE "from ['\"]\."; then continue; fi
52
+ ;;
53
+ py)
54
+ # Skip relative imports (from . import, from .. import)
55
+ if echo "$line" | grep -qE "^from \."; then continue; fi
56
+ ;;
57
+ go)
58
+ # Skip stdlib (no dots in path) — external modules have dots (github.com, etc.)
59
+ if ! echo "$line" | grep -qE '\"[a-z]+\.[a-z]'; then continue; fi
60
+ ;;
61
+ rs)
62
+ # Skip std/crate/self/super
63
+ if echo "$line" | grep -qE "^use (std|crate|self|super)::"; then continue; fi
64
+ ;;
65
+ java|cs)
66
+ # Skip java.*/javax.*/System.*
67
+ if echo "$line" | grep -qE "^(import|using) (java\.|javax\.|System\.)"; then continue; fi
68
+ ;;
69
+ esac
70
+ EXTERNAL="${EXTERNAL}${line}\n"
71
+ done <<< "$IMPORTS"
72
+
73
+ if [[ -z "$EXTERNAL" ]]; then
74
+ exit 0
75
+ fi
76
+
77
+ # Count unique external packages
78
+ PKG_COUNT=$(echo -e "$EXTERNAL" | grep -c '.' 2>/dev/null || echo "0")
79
+
80
+ echo "CONTEXT7-REMIND: $FILE_PATH contains $PKG_COUNT external import(s). Verify each was looked up via Context7 (resolve-library-id → get-library-docs) this session. If not: do it now before proceeding." >&2
81
+ exit 0
@@ -47,6 +47,15 @@
47
47
  "command": "bash ~/.claude/hooks/dep-audit.sh"
48
48
  }
49
49
  ]
50
+ },
51
+ {
52
+ "matcher": "Write|Edit|MultiEdit",
53
+ "hooks": [
54
+ {
55
+ "type": "command",
56
+ "command": "bash ~/.claude/hooks/context7-remind.sh"
57
+ }
58
+ ]
50
59
  }
51
60
  ],
52
61
  "Stop": [
@@ -29,6 +29,13 @@ Language-specific patterns matched:
29
29
  Every new external import requires a Context7 verification before the gate clears.
30
30
  Internal packages (same repo, same module) are excluded.
31
31
 
32
+ ### Source-level investigation (opensrc)
33
+ - When Context7 docs are insufficient to understand library behavior (bugs, edge cases,
34
+ undocumented internals), run `npx opensrc <package>` to fetch source into `opensrc/<pkg>/`.
35
+ - Before fetching: check `opensrc/sources.json` for already-fetched packages.
36
+ - After fetching: read `AGENTS.md` in project root for the source manifest.
37
+ - This is an escalation path, not a default — Context7 docs are the first stop.
38
+
32
39
  ### Tool preferences
33
40
  - Use Read/Edit/Write tools instead of cat/sed/echo.
34
41
  - Use `rg` (ripgrep) for searching code, not grep.
@@ -0,0 +1,373 @@
1
+ ---
2
+ name: px-prompt
3
+ disable-model-invocation: true
4
+ description: "Unified prompt engine. Creates, generates, condenses, and syncs system prompts for Claude Projects, Perplexity Spaces, and Claude Code. Auto-detects what to do based on project state."
5
+ ---
6
+
7
+ # px-prompt Skill
8
+
9
+ ## Overview
10
+ Single entry point for the prompt engine. Detects what needs to happen based on project state and user intent.
11
+
12
+ ## Invocation
13
+ - `/px-prompt <project-name>` — create, generate, or regenerate a project's prompts
14
+ - `/px-prompt --sync` — recompile all projects, report diffs and budgets
15
+ - `/px-prompt --list` — list all projects and their status
16
+
17
+ ---
18
+
19
+ ## Routing Logic
20
+
21
+ When invoked with a project name, detect the right action:
22
+
23
+ ```
24
+ /px-prompt <project-name>
25
+
26
+ ├─ Project doesn't exist?
27
+ │ → ACTION: CREATE (Step 1)
28
+
29
+ ├─ Project exists, mode: standalone, system-prompt.md missing?
30
+ │ → ACTION: GENERATE FROM SCRATCH (Step 2)
31
+
32
+ ├─ Project exists, mode: standalone, system-prompt.md exists, platform outputs missing?
33
+ │ → ACTION: CONDENSE (Step 3)
34
+
35
+ ├─ Project exists, mode: standalone, all files present?
36
+ │ → ACTION: VALIDATE + offer to regenerate (Step 4)
37
+
38
+ ├─ Project exists, mode: compiled?
39
+ │ → ACTION: COMPILE (Step 4)
40
+
41
+ └─ --sync flag?
42
+ → ACTION: SYNC ALL (Step 5)
43
+ ```
44
+
45
+ ---
46
+
47
+ ## Step 1 — CREATE: New project scaffold
48
+
49
+ **Triggered when:** project folder doesn't exist.
50
+
51
+ ### 1a. Core intake (always ask)
52
+
53
+ 1. **Description** — "Describe this project in one sentence."
54
+
55
+ 2. **Role** — "Who is the AI in this project?"
56
+ - Show available identity blocks: `node bin/prompt-blocks.js --category identity`
57
+ - User can pick one OR describe a custom role
58
+
59
+ 3. **Target platforms** — "Which platforms will you deploy to?"
60
+ - Multi-select: Claude Projects, Perplexity Spaces, Claude Code
61
+ - Default: Claude Projects + Perplexity Spaces
62
+
63
+ 4. **Complexity** — Based on the description, recommend a mode:
64
+ - Simple/standard project → **compiled** (block-based, continue to 1b)
65
+ - Complex multi-role agent → **standalone** with AI generation (continue to 1c)
66
+ - User already has a prompt → **standalone** paste-in (scaffold folder, skip to Step 3)
67
+
68
+ ### 1b. Compiled project setup
69
+
70
+ 5. **Domain expertise** — Show available domain blocks:
71
+ ```bash
72
+ node bin/prompt-blocks.js --category domains
73
+ ```
74
+ User picks from list or describes custom domains.
75
+ For custom domains: create a new block file at `prompts/blocks/domains/<id>.md`.
76
+
77
+ 6. **Research domains** (if Perplexity selected) — "What topics should Perplexity prioritize?"
78
+ Suggest based on selected domains. User accepts or customizes.
79
+
80
+ 7. **Knowledge files** — "Reference documents to upload alongside? (compliance matrices, standards, playbooks)"
81
+
82
+ 8. **Claude Code extras** (only if Claude Code selected) — tech stack, commands, git identity
83
+
84
+ 9. **Build project folder:**
85
+ ```bash
86
+ mkdir -p prompts/projects/<project-name>/references
87
+ ```
88
+
89
+ Write `prompt-config.yaml`:
90
+ ```yaml
91
+ project: <project-name>
92
+ description: <from intake>
93
+ mode: compiled
94
+ version: "1.0"
95
+ platforms: [claude-project, perplexity-space]
96
+ profile: null
97
+ blocks:
98
+ identity: [<matched-block>]
99
+ domains: [<selected-blocks>]
100
+ behaviors: []
101
+ formats: []
102
+ context: [<auto-selected by platform>]
103
+ research_domains: [<from intake>]
104
+ knowledge_files: [<from intake>]
105
+ ```
106
+
107
+ **Auto-add context blocks by platform:**
108
+ - Perplexity → `official-docs-first`, `flag-confidence`
109
+ - Claude Code → `vault-integration`, `mcp-servers`, `praxis-workflow`
110
+
111
+ 10. **Compile:** `node bin/prompt-compile.js <project-name>`
112
+
113
+ 11. → Go to **Step 4** (results + deployment)
114
+
115
+ ### 1c. Standalone project with AI generation
116
+
117
+ → Go to **Step 2** (generate from scratch)
118
+
119
+ ---
120
+
121
+ ## Step 2 — GENERATE: AI-powered system prompt creation
122
+
123
+ **Triggered when:** standalone project exists but `system-prompt.md` is empty/missing, OR user explicitly requests generation.
124
+
125
+ ### 2a. Intake (if not already gathered in Step 1)
126
+
127
+ 1. **Description** — 2-3 sentences about the project
128
+ 2. **Role** — primary AI responsibility
129
+ 3. **Domains** — expertise areas (free-form, not limited to existing blocks)
130
+ 4. **Key behaviors** — rules beyond defaults
131
+ 5. **Target audience** — who reads the output
132
+ 6. **Knowledge files** — reference documents
133
+ 7. **Target platforms** — deployment targets
134
+
135
+ ### 2b. Domain research via Perplexity
136
+
137
+ **Mandatory before generating.** For each domain, run Perplexity queries:
138
+
139
+ **Query 1 — Best practices:**
140
+ ```
141
+ perplexity_ask: "What are the current best practices for [domain]
142
+ AI assistants in 2025-2026? Key terminology, active standards,
143
+ common workflows, expert expectations."
144
+ ```
145
+
146
+ **Query 2 — Standards:**
147
+ ```
148
+ perplexity_search: "[domain] key frameworks standards certifications 2025"
149
+ ```
150
+
151
+ **Query 3 — Use cases:**
152
+ ```
153
+ perplexity_ask: "What are the most common tasks [target audience]
154
+ asks AI assistants to help with in [domain]? Top 10 use cases."
155
+ ```
156
+
157
+ If Perplexity unavailable: state "Domain research could not be completed — prompt uses training data only. Review for currency." and proceed.
158
+
159
+ ### 2c. Generate system-prompt.md
160
+
161
+ Using intake + Perplexity research, generate following the 5-layer skeleton:
162
+
163
+ ```markdown
164
+ ---
165
+ version: "1.0"
166
+ date: [today]
167
+ platform: claude-project
168
+ generated_by: px-prompt
169
+ ---
170
+
171
+ ## Role
172
+ [One-sentence role from intake, using current terminology from research]
173
+
174
+ ## Behavioral Constraints
175
+ [_base defaults: no-flattery, verify-before-reporting, recommend-with-reasons, handle-uncertainty]
176
+ [Custom behaviors from intake]
177
+ [Domain-specific constraints from research]
178
+
179
+ ## Domain Expertise
180
+ [Structured areas from research — current framework names, standard versions]
181
+
182
+ ## Output Format
183
+ [Format rules for target audience]
184
+ [What/So What/Now What for analytical outputs]
185
+
186
+ ## Common Tasks
187
+ [Top 5-10 use cases from Perplexity research]
188
+
189
+ ## Knowledge Interaction Rules
190
+ [How to use reference files, when to cite, quote-before-answer]
191
+
192
+ ## Accuracy Standards
193
+ - Flag confidence levels when synthesizing across sources
194
+ - Distinguish verified facts from analytical inferences
195
+ - If sources disagree, cite both and explain the discrepancy
196
+ - Never fabricate version numbers, citations, or references
197
+ - When information may be outdated, note this explicitly
198
+
199
+ ## When Uncertain
200
+ State uncertainty explicitly. Ask one clarifying question rather than guessing.
201
+ ```
202
+
203
+ **Generation rules:**
204
+ - Use terminology from Perplexity research, not training-data assumptions
205
+ - Positive framing: "Do X" over "Don't do Y"
206
+ - No few-shot examples (breaks Perplexity)
207
+ - Under 5,000 characters
208
+ - Include Accuracy Standards + When Uncertain (mandatory)
209
+
210
+ Write to `prompts/projects/<project-name>/system-prompt.md`.
211
+
212
+ ### 2d. Auto-condense
213
+
214
+ → Go to **Step 3** (condense to platform outputs)
215
+
216
+ ---
217
+
218
+ ## Step 3 — CONDENSE: Generate platform outputs from system-prompt.md
219
+
220
+ **Triggered when:** standalone project has `system-prompt.md` but missing `space-instructions.md` or `CLAUDE.md`.
221
+
222
+ Read the full `system-prompt.md` as source.
223
+
224
+ ### 3a. Generate Perplexity Space instructions
225
+
226
+ **Target:** `space-instructions.md` | **Budget:** under 4,000 chars
227
+
228
+ **Include:** identity, domain expertise, research domains, source priority, answer format, key frameworks (by name only)
229
+ **Exclude:** internal templates, scoring matrices, reference file content, deployment details, full tables
230
+
231
+ **Output format:**
232
+ ```markdown
233
+ ## Purpose
234
+ ## Domain Expertise
235
+ ## Research Domains
236
+ ## Source Priority
237
+ ## How to Answer
238
+ ## Accuracy Standards
239
+ ```
240
+
241
+ **Perplexity guardrails:**
242
+ - No few-shot examples
243
+ - No URLs in instructions
244
+ - Replace absolute language with conditional ("if available", "when sources confirm")
245
+ - Search-friendly domain terms
246
+
247
+ ### 3b. Generate Claude Code CLAUDE.md (if Claude Code is a target platform)
248
+
249
+ **Target:** `CLAUDE.md` | **Budget:** under 250 lines
250
+
251
+ **Include:** identity, behaviors, domain expertise, frameworks (one-line each), operating modes, quality controls
252
+ **Exclude:** full scoring matrices, templates, reference file content, corporate data tables
253
+
254
+ **Output format:**
255
+ ```markdown
256
+ # [Project Name]
257
+ ## Identity
258
+ ## Behaviors
259
+ ## Domain Expertise
260
+ ## Frameworks
261
+ ## Operating Modes
262
+ ## Quality Controls
263
+ ## References
264
+ ```
265
+
266
+ **Claude Code guardrails:**
267
+ - Positive framing: "Do X" over "Don't do Y"
268
+ - No "CRITICAL: YOU MUST" language (Claude 4.6 overtriggers)
269
+ - Self-check block for quality-critical outputs
270
+ - Reference knowledge files by filename only
271
+
272
+ ### 3c. Validate budgets
273
+
274
+ After generating, check:
275
+ - `space-instructions.md` under 4,000 chars
276
+ - `CLAUDE.md` under 250 lines
277
+
278
+ If over budget: flag and suggest sections to trim.
279
+
280
+ → Go to **Step 4** (results)
281
+
282
+ ---
283
+
284
+ ## Step 4 — RESULTS: Validate + show deployment instructions
285
+
286
+ **Triggered when:** project has outputs to display (compiled or standalone).
287
+
288
+ ### 4a. Run validator
289
+ ```bash
290
+ node bin/prompt-compile.js <project-name>
291
+ ```
292
+
293
+ ### 4b. Show results table
294
+
295
+ ```
296
+ | Output | Chars | Budget | Status |
297
+ |----------------------|--------|--------|--------|
298
+ | system-prompt.md | X | — | Source |
299
+ | project-instructions | X | 2,500 | OK |
300
+ | space-instructions | X | 4,000 | OK |
301
+ | CLAUDE.md | X lines| 250 ln | OK |
302
+ | references/ | N files| — | Upload |
303
+ ```
304
+
305
+ ### 4c. Deployment instructions
306
+
307
+ **Claude Projects (claude.ai):**
308
+ 1. Open project at claude.ai/projects → "Set project instructions"
309
+ 2. Standalone: paste `system-prompt.md` | Compiled: paste `project-instructions.md`
310
+ 3. If `references/` exists: upload each `.md` file as project knowledge
311
+ 4. Save
312
+
313
+ **Perplexity Spaces:**
314
+ 1. Open Space → Settings → Answer Instructions
315
+ 2. Paste `space-instructions.md`
316
+ 3. Save
317
+
318
+ **Claude Code:**
319
+ 1. Copy `CLAUDE.md` to project repo root
320
+
321
+ ### 4d. Offer next actions
322
+ - "Edit the prompt? I'll regenerate platform outputs after."
323
+ - "Want to regenerate? Run `/px-prompt <project-name>` again."
324
+
325
+ ---
326
+
327
+ ## Step 5 — SYNC: Recompile all projects
328
+
329
+ **Triggered when:** `/px-prompt --sync`
330
+
331
+ ```bash
332
+ node bin/prompt-compile.js --all --diff
333
+ ```
334
+
335
+ Show summary table:
336
+ ```
337
+ | Project | CLAUDE.md | Project Instr. | Space Instr. | Changes |
338
+ |---------|-----------|----------------|--------------|---------|
339
+ | praxis | 3,534 | 1,316 ✓ | 1,529 ✓ | none |
340
+ | maximus | — | — | 3,977 ✓ | standalone |
341
+ ```
342
+
343
+ For standalone projects, report validation status instead of compilation status.
344
+
345
+ Print deployment reminders for any project with changes.
346
+
347
+ ---
348
+
349
+ ## Rules
350
+
351
+ ### Always
352
+ - `_base` behaviors (no-flattery, verify, recommend, handle-uncertainty) are included in every project — non-negotiable
353
+ - Accuracy Standards section is mandatory in all Perplexity outputs
354
+ - When Uncertain section is mandatory in all Claude Project outputs
355
+ - Never ask for repo URL, vault path, or git email unless Claude Code is a target platform
356
+
357
+ ### Platform-specific
358
+ - **Perplexity**: no few-shot examples, no URLs, conditional language, search-friendly terms
359
+ - **Claude Code**: positive framing, no "CRITICAL YOU MUST", self-check blocks
360
+ - **Claude Projects**: 5-layer skeleton (Role, Constraints, Format, Knowledge Rules, Failure Handling)
361
+
362
+ ### Generation
363
+ - ALWAYS run Perplexity research before generating system prompts (Step 2)
364
+ - Use current terminology from research, not training-data assumptions
365
+ - Generated prompts are starting points — tell user to review and refine
366
+ - If Perplexity unavailable: proceed with training data, flag for review
367
+
368
+ ### Block matching (compiled mode)
369
+ - Role → identity block: "architect" → `solutions-architect`, "engineer" → `senior-engineer`, "researcher" → `research-partner`
370
+ - Domain keywords → domain blocks: "cloud/azure/aws" → `cloud-infrastructure`, "federal/govcon" → `govcon`, "web/react" → `web-development`
371
+ - If no match: create custom block on the fly
372
+ - Auto-add `official-docs-first` + `flag-confidence` for Perplexity targets
373
+ - Auto-add `vault-integration` + `mcp-servers` + `praxis-workflow` for Claude Code targets
@@ -62,6 +62,16 @@ Use `perplexity_search` (model: `sonar` for speed):
62
62
  - Query: `"[package] last commit release 2025 2026 archived"`
63
63
  - Extract: last commit date, last release date, repository status, contributor count
64
64
 
65
+ ## Step 5.5 — Source Fetch (optional, on `--deep` flag or when investigating internals)
66
+
67
+ If the research is for understanding implementation behavior (not just API surface):
68
+ 1. Check `opensrc/sources.json` — skip if package already fetched
69
+ 2. Run `npx opensrc <package>` to fetch source into `opensrc/<pkg>/`
70
+ 3. Read `AGENTS.md` for the source manifest
71
+ 4. Note key implementation details in the report under a new "### Implementation Notes" section
72
+
73
+ Skip this step for standard dependency evaluation (version/CVE/maintenance checks).
74
+
65
75
  ## Step 6 — Produce Report
66
76
 
67
77
  Output in this exact format:
@@ -81,6 +91,9 @@ Output in this exact format:
81
91
  ### API Notes (from live docs)
82
92
  [Relevant API surface, configuration, or usage patterns from Context7/Sonar docs]
83
93
 
94
+ ### Implementation Notes (when source was fetched)
95
+ [Key internals, edge cases, or undocumented behavior discovered from source]
96
+
84
97
  ### Sources
85
98
  - [Citation URL 1]
86
99
  - [Citation URL 2]
package/bin/praxis.js CHANGED
@@ -141,6 +141,13 @@ async function install() {
141
141
  ok('kits installed');
142
142
  }
143
143
 
144
+ // Copy prompts/ → ~/.claude/prompts/
145
+ const promptsDir = path.join(PKG_DIR, 'prompts');
146
+ if (fs.existsSync(promptsDir)) {
147
+ copyDir(promptsDir, path.join(CLAUDE_DIR, 'prompts'));
148
+ ok('prompt library installed');
149
+ }
150
+
144
151
  // Orphan cleanup: deleted rules and legacy files
145
152
  const orphans = [
146
153
  'obsidian.md', 'security.md',