@pharaoh-so/mcp 0.3.8 → 0.3.9
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/package.json +1 -1
- package/skills/plan/SKILL.md +47 -48
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pharaoh-so/mcp",
|
|
3
3
|
"mcpName": "so.pharaoh/pharaoh",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.9",
|
|
5
5
|
"description": "MCP proxy for Pharaoh — maps codebases into queryable knowledge graphs for AI agents. Enables Claude Code in headless environments (VPS, SSH, CI) via device flow auth.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
package/skills/plan/SKILL.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan
|
|
3
3
|
prompt-name: plan-with-pharaoh
|
|
4
|
-
description:
|
|
5
|
-
version: 0.
|
|
4
|
+
description: Deep plan review with Pharaoh reconnaissance, wiring verification, and structured issue tracking. Use before implementing any feature, refactor, or significant code change. Enters plan mode (no code changes) and provides structured review with decision points.
|
|
5
|
+
version: 0.5.0
|
|
6
6
|
homepage: https://pharaoh.so
|
|
7
7
|
user-invocable: true
|
|
8
8
|
metadata: {"emoji": "☥", "tags": ["planning", "architecture", "blast-radius", "pharaoh", "review", "interactive"]}
|
|
@@ -10,18 +10,16 @@ metadata: {"emoji": "☥", "tags": ["planning", "architecture", "blast-radius",
|
|
|
10
10
|
|
|
11
11
|
# Plan Review
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
**You are now in plan mode. Do NOT make any code changes. Think, evaluate, and present decisions.**
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Document Review
|
|
16
|
+
|
|
17
|
+
If the user provides a document, PRD, prompt, or artifact alongside this command, that IS the plan to review. Apply all review sections to that document. Do not treat it as background context — it is the subject of evaluation.
|
|
16
18
|
|
|
17
19
|
## Project Overrides
|
|
18
20
|
|
|
19
21
|
If a `.claude/plan-review.md` file exists in this project, read it now and apply those rules on top of this baseline. Project rules take precedence where they conflict.
|
|
20
22
|
|
|
21
|
-
## Document Review
|
|
22
|
-
|
|
23
|
-
If the user provides a document, PRD, prompt, or artifact alongside this command, that IS the plan to review. Still run Step 1 (Reconnaissance) — always verify against the actual codebase. Then apply all review sections to that document. Do not treat it as background context — it is the subject of evaluation.
|
|
24
|
-
|
|
25
23
|
## Engineering Preferences (guide all recommendations)
|
|
26
24
|
|
|
27
25
|
- DRY: flag repetition aggressively
|
|
@@ -32,61 +30,64 @@ If the user provides a document, PRD, prompt, or artifact alongside this command
|
|
|
32
30
|
- Subtraction > addition; target zero or negative net LOC
|
|
33
31
|
- Every export must have a caller; unwired code doesn't exist
|
|
34
32
|
|
|
35
|
-
## Step 1: Reconnaissance (Required — do this BEFORE reviewing)
|
|
36
|
-
|
|
37
|
-
Do NOT review from memory or assumptions. Query the actual codebase first.
|
|
33
|
+
## Step 1: Pharaoh Reconnaissance (Required — do this BEFORE reviewing)
|
|
38
34
|
|
|
39
|
-
|
|
35
|
+
Do NOT review from memory or assumptions. Query the actual codebase first:
|
|
40
36
|
|
|
41
37
|
1. `get_codebase_map` — current modules, hot files, dependency graph
|
|
42
38
|
2. `search_functions` for keywords related to the plan — find existing code to reuse/extend
|
|
43
39
|
3. `get_module_context` on affected modules — entry points, patterns, conventions
|
|
44
40
|
4. `query_dependencies` between affected modules — coupling, circular deps
|
|
45
|
-
5. `get_blast_radius` on the primary target of the change
|
|
46
|
-
6. `check_reachability` on the primary target to verify it's reachable from entry points
|
|
47
41
|
|
|
48
|
-
|
|
42
|
+
Ground every recommendation in what actually exists. If you propose adding something, confirm it doesn't already exist. If you propose changing something, know its blast radius.
|
|
49
43
|
|
|
50
|
-
|
|
51
|
-
2. Read the entry points and module structure of affected areas
|
|
52
|
-
3. Check existing tests for the modules you'll touch
|
|
44
|
+
## Step 1b: Reconnaissance Dashboard
|
|
53
45
|
|
|
54
|
-
|
|
46
|
+
After running recon, present a visual summary before proceeding. This shows the user what Pharaoh found.
|
|
47
|
+
|
|
48
|
+
**Surface all ★ Pharaoh insight blocks verbatim** — they contain pre-formatted bar charts, risk meters, and flow diagrams. Do not summarize or paraphrase them.
|
|
55
49
|
|
|
56
|
-
|
|
50
|
+
Then compose a **Recon Summary** table:
|
|
57
51
|
|
|
58
|
-
|
|
52
|
+
| Signal | Value | Source |
|
|
53
|
+
|--------|-------|--------|
|
|
54
|
+
| Modules affected | N | get_codebase_map |
|
|
55
|
+
| Blast radius | LOW/MED/HIGH + caller count | get_blast_radius |
|
|
56
|
+
| Existing functions found | N matches | search_functions |
|
|
57
|
+
| Cross-module coupling | deps + circular? | query_dependencies |
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
>
|
|
62
|
-
> - **BIG CHANGE**: Full interactive review, all relevant sections, up to 4 top issues per section
|
|
63
|
-
> - **SMALL CHANGE**: One question per section, only sections 2-4
|
|
59
|
+
If any signal is surprising (high blast radius, circular deps, existing code that overlaps the plan), call it out before moving to Mode Selection.
|
|
64
60
|
|
|
65
|
-
|
|
61
|
+
## Step 2: Mode Selection
|
|
62
|
+
|
|
63
|
+
Ask the user which mode before starting the review:
|
|
64
|
+
|
|
65
|
+
**BIG CHANGE**: Full interactive review, all relevant sections, up to 4 top issues per section.
|
|
66
|
+
**SMALL CHANGE**: One question per section, only sections 2-4.
|
|
66
67
|
|
|
67
68
|
## Step 3: Review Sections
|
|
68
69
|
|
|
69
|
-
Adapt depth to change size. Skip sections that don't apply.
|
|
70
|
+
Adapt depth to change size. Skip sections that don't apply.
|
|
70
71
|
|
|
71
72
|
### Section 1 — Architecture (skip for small/single-file changes)
|
|
72
73
|
|
|
73
74
|
- Component boundaries and coupling concerns
|
|
74
75
|
- Dependency graph: does this change shrink or expand surface area?
|
|
75
76
|
- Data flow bottlenecks and single points of failure
|
|
76
|
-
- Does this need new code at all, or can
|
|
77
|
+
- Does this need new code at all, or can a human process / existing pattern solve it?
|
|
77
78
|
|
|
78
79
|
### Section 2 — Code Quality (always)
|
|
79
80
|
|
|
80
81
|
- Organization, module structure, DRY violations (be aggressive)
|
|
81
82
|
- Error handling gaps and missing edge cases (call out explicitly)
|
|
82
83
|
- Technical debt: shortcuts, hardcoded values, magic strings
|
|
83
|
-
- Over-engineered or under-engineered relative to preferences
|
|
84
|
+
- Over-engineered or under-engineered relative to my preferences
|
|
84
85
|
- Reuse: does code for this already exist somewhere?
|
|
85
86
|
|
|
86
87
|
### Section 3 — Wiring & Integration (always)
|
|
87
88
|
|
|
88
89
|
- Are all new exports called from a production entry point?
|
|
89
|
-
- Run `get_blast_radius` on new/changed functions — zero callers = not done
|
|
90
|
+
- Run `get_blast_radius` on any new/changed functions — zero callers = not done
|
|
90
91
|
- `check_reachability` on new exports — verify reachable from API handlers, crons, or event handlers
|
|
91
92
|
- Does the plan declare WHERE new code gets called from? If not, flag it
|
|
92
93
|
- Integration points: how does this connect to what already exists?
|
|
@@ -104,14 +105,14 @@ Adapt depth to change size. Skip sections that don't apply. **After each section
|
|
|
104
105
|
- Memory concerns, caching opportunities
|
|
105
106
|
- Slow or high-complexity code paths
|
|
106
107
|
|
|
107
|
-
### Section 6 — Security & Attack Surface (
|
|
108
|
+
### Section 6 — Security & Attack Surface (always for new endpoints/routes/APIs; skip for pure refactors)
|
|
108
109
|
|
|
109
|
-
- **Authentication model** — what authenticates requests? Where validated? What happens on failure?
|
|
110
|
-
- **Sensitive data in URLs** — tokens, session IDs, or tenant identifiers in URL paths
|
|
111
|
-
- **Authorization boundaries** — what prevents User A from accessing User B's data?
|
|
112
|
-
- **Input trust boundary** — user input
|
|
113
|
-
- **Error and response surface** —
|
|
114
|
-
- **New attack surface** — new public URLs, webhooks, API routes
|
|
110
|
+
- **Authentication model** — what authenticates requests in this plan? Where is it validated? What happens on auth failure (redirect, 401, silent pass-through)? Use `search_functions` to find existing auth middleware and confirm reuse.
|
|
111
|
+
- **Sensitive data in URLs** — does the design put tokens, session IDs, or tenant identifiers in URL paths or query params? These leak via Referer headers, browser history, logs, and link sharing.
|
|
112
|
+
- **Authorization boundaries** — what prevents User A from accessing User B's data? Is there an ownership check, or just an "is logged in" check? Use `get_blast_radius` on existing ownership-check functions to see where they're already enforced.
|
|
113
|
+
- **Input trust boundary** — does the plan accept user input that flows into shell commands, database queries, HTML rendering, or file paths? Each is an injection vector.
|
|
114
|
+
- **Error and response surface** — will error responses or API payloads expose internals (stack traces, DB schemas, internal IDs) to unauthenticated callers?
|
|
115
|
+
- **New attack surface** — does the plan introduce new public URLs, webhooks, API routes, or WebSocket endpoints? Each needs: rate limiting, authentication, and input validation. Use `get_module_context` on the receiving module to check what protections exist.
|
|
115
116
|
|
|
116
117
|
## For Each Issue Found
|
|
117
118
|
|
|
@@ -120,23 +121,21 @@ For every specific issue (bug, smell, design concern, risk, missing wiring):
|
|
|
120
121
|
1. **Describe concretely** — file, line/function reference, what's wrong
|
|
121
122
|
2. **Present 2-3 options** including "do nothing" where reasonable
|
|
122
123
|
3. **For each option** — implementation effort, risk, blast radius, maintenance burden
|
|
123
|
-
4. **Recommend one** mapped to
|
|
124
|
-
5. **Ask** whether
|
|
125
|
-
|
|
126
|
-
Number each issue (1, 2, 3...) and letter each option (A, B, C...). Recommended option listed first.
|
|
124
|
+
4. **Recommend one** mapped to my preferences above, and say why
|
|
125
|
+
5. **Ask** whether I agree or want a different direction
|
|
127
126
|
|
|
128
|
-
|
|
127
|
+
Number each issue (1, 2, 3...) and letter each option (A, B, C...). Recommended option is always listed first. Use AskUserQuestion with clear labels like "Issue 1 Option A", "Issue 1 Option B".
|
|
129
128
|
|
|
130
|
-
|
|
129
|
+
## Pharaoh Checkpoints (use throughout, not just at the end)
|
|
131
130
|
|
|
132
131
|
- **Before reviewing**: recon (Step 1 above)
|
|
133
|
-
- **During review**:
|
|
134
|
-
- **After decisions**:
|
|
135
|
-
- **Final sweep**:
|
|
132
|
+
- **During review**: `get_blast_radius` when evaluating impact of changes; `search_functions` before suggesting new code
|
|
133
|
+
- **After decisions**: `check_reachability` on all new exports; `get_unused_code` to catch disconnections
|
|
134
|
+
- **Final sweep**: `get_blast_radius` on ALL new exports — zero callers on non-entry-points = plan is incomplete
|
|
136
135
|
|
|
137
136
|
## Workflow Rules
|
|
138
137
|
|
|
139
|
-
-
|
|
138
|
+
- After each section, pause and ask for feedback before moving on
|
|
140
139
|
- Do not assume priorities on timeline or scale
|
|
141
140
|
- If you see a better approach to the entire plan, say so BEFORE section-by-section review
|
|
142
|
-
- Challenge the approach if you see a better one — your job is to find problems
|
|
141
|
+
- Challenge the approach if you see a better one — your job is to find problems I'll regret later
|