@pharaoh-so/mcp 0.2.5 → 0.2.7

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/dist/helpers.js CHANGED
@@ -40,7 +40,7 @@ export function parseArgs(argv = process.argv.slice(2)) {
40
40
  return { server, logout };
41
41
  }
42
42
  export function printUsage() {
43
- printLines("Usage: pharaoh-mcp [options]", "", "Options:", " --server <url> Pharaoh server URL (default: https://mcp.pharaoh.so)", " --logout Clear stored credentials and exit", " --install-skills Install Pharaoh skills to OpenClaw (~/.openclaw/skills/)", " --help, -h Show this help", "", "Add to Claude Code:", " claude mcp add pharaoh -- npx @pharaoh-so/mcp", "");
43
+ printLines("Usage: pharaoh-mcp [options]", "", "Options:", " --server <url> Pharaoh server URL (default: https://mcp.pharaoh.so)", " --logout Clear stored credentials and exit", " --install-skills Force reinstall Pharaoh skills (Claude Code + OpenClaw)", " --help, -h Show this help", "", "Add to Claude Code:", " claude mcp add pharaoh -- npx @pharaoh-so/mcp", "");
44
44
  }
45
45
  /**
46
46
  * Validate that a server-supplied SSE URL shares the same origin as the configured server.
package/dist/inspect.js CHANGED
@@ -14,6 +14,17 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
14
14
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
15
15
  const INSPECT_MSG = "This is Pharaoh's inspection server for directory listings. " +
16
16
  "Connect to https://mcp.pharaoh.so for actual usage.";
17
+ /** Read version from package.json (single source of truth). */
18
+ function getPackageVersion() {
19
+ try {
20
+ const pkgPath = join(import.meta.dirname, "..", "package.json");
21
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
22
+ return pkg.version ?? "0.0.0";
23
+ }
24
+ catch {
25
+ return "0.0.0";
26
+ }
27
+ }
17
28
  export async function runInspect() {
18
29
  // Load pre-generated schemas (shipped in the npm package)
19
30
  const schemasPath = join(import.meta.dirname, "..", "inspect-tools.json");
@@ -25,7 +36,7 @@ export async function runInspect() {
25
36
  process.stderr.write("Pharaoh: inspect-tools.json not found — rebuild the package.\n");
26
37
  process.exit(1);
27
38
  }
28
- const server = new McpServer({ name: "pharaoh", version: "0.1.0" }, {
39
+ const server = new McpServer({ name: "pharaoh", version: getPackageVersion() }, {
29
40
  instructions: "Pharaoh turns codebases into knowledge graphs that AI agents can think with. " +
30
41
  "Connect at https://mcp.pharaoh.so for full functionality.",
31
42
  });
@@ -69,17 +69,18 @@ function installClaudeCodePlugin(home = homedir()) {
69
69
  return -1;
70
70
  }
71
71
  // Copy skills/
72
+ let skillCount = 0;
72
73
  if (existsSync(BUNDLED_SKILLS_DIR)) {
73
74
  cpSync(BUNDLED_SKILLS_DIR, join(pluginDir, "skills"), { recursive: true, force: true });
75
+ const entries = readdirSync(BUNDLED_SKILLS_DIR, { withFileTypes: true });
76
+ skillCount = entries.filter((e) => e.isDirectory()).length;
74
77
  }
75
78
  // Copy .mcp.json
76
79
  const mcpSrc = join(PKG_ROOT, ".mcp.json");
77
80
  if (existsSync(mcpSrc)) {
78
81
  cpSync(mcpSrc, join(pluginDir, ".mcp.json"), { force: true });
79
82
  }
80
- // Count installed skills
81
- const entries = readdirSync(BUNDLED_SKILLS_DIR, { withFileTypes: true });
82
- return entries.filter((e) => e.isDirectory()).length;
83
+ return skillCount;
83
84
  }
84
85
  /**
85
86
  * Register Pharaoh in Claude Code's installed_plugins.json (v2 format).
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.2.5",
4
+ "version": "0.2.7",
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",
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: pharaoh-orchestrate
3
+ description: "Execute implementation plans by dispatching one subagent per task with two-stage review (spec compliance then code quality). Sequential task execution with quality gates. Controller stays in session, constructs focused context for each agent, never shares session history. Handles DONE/DONE_WITH_CONCERNS/NEEDS_CONTEXT/BLOCKED status protocol."
4
+ version: 0.2.5
5
+ homepage: https://pharaoh.so
6
+ user-invocable: true
7
+ metadata: {"emoji": "☥", "tags": ["subagents", "orchestration", "plan-execution", "quality-gates", "spec-review", "code-review"]}
8
+ ---
9
+
10
+ # Orchestrate Plan Execution
11
+
12
+ Execute a plan by dispatching a fresh subagent per task, with two-stage review after each: spec compliance first, then code quality. The controller (you) coordinates — subagents implement and review.
13
+
14
+ ## When to Use
15
+
16
+ - You have a written implementation plan with 2+ tasks
17
+ - Tasks are mostly independent (different files/modules)
18
+ - You want quality gates between tasks (not just fire-and-forget)
19
+ - You're staying in this session (not dispatching to parallel worktrees)
20
+
21
+ ## When NOT to Use
22
+
23
+ - Tasks are tightly coupled (use manual execution)
24
+ - You want parallel execution across sessions (use `pharaoh:execute` instead)
25
+ - You don't have a plan yet (use `pharaoh:plan` first)
26
+ - You just need parallel dispatch without review gates (use `pharaoh:parallel`)
27
+
28
+ ## Workflow
29
+
30
+ ### Phase 0 — Setup
31
+
32
+ 1. Read the plan file once. Extract all tasks with full text.
33
+ 2. Note cross-task context: shared types, import paths, architectural constraints.
34
+ 3. Create a task list tracking each task's status.
35
+
36
+ ### Phase 1 — Per-Task Loop
37
+
38
+ For each task:
39
+
40
+ #### 1a. Dispatch Implementer
41
+
42
+ Launch a subagent with:
43
+ - **Full task text** (paste it, don't make the agent read the file)
44
+ - **Scene-setting context** (where this fits, what's already built, dependencies)
45
+ - **Constraints** (what NOT to change, scope boundaries)
46
+ - **Working directory**
47
+
48
+ The implementer should:
49
+ 1. Ask questions before starting (don't guess)
50
+ 2. Implement exactly what the task specifies
51
+ 3. Write tests
52
+ 4. Commit
53
+ 5. Self-review
54
+ 6. Report with status: **DONE** / **DONE_WITH_CONCERNS** / **NEEDS_CONTEXT** / **BLOCKED**
55
+
56
+ #### 1b. Handle Status
57
+
58
+ - **DONE** → proceed to spec review
59
+ - **DONE_WITH_CONCERNS** → read concerns. If correctness/scope issues, address before review. If observations, note and proceed.
60
+ - **NEEDS_CONTEXT** → provide missing information, re-dispatch
61
+ - **BLOCKED** → assess: provide more context, use a more capable model, break task smaller, or escalate to user
62
+
63
+ Never ignore an escalation. Never force retry without changes.
64
+
65
+ #### 1c. Spec Compliance Review
66
+
67
+ Dispatch a reviewer subagent with:
68
+ - Full task requirements (original spec text)
69
+ - Implementer's report of what they built
70
+
71
+ The spec reviewer must:
72
+ - Read actual code, not trust the report
73
+ - Check: missing requirements, extra/unneeded work, misinterpretations
74
+ - Verdict: **pass** or **issues found** (with file:line references)
75
+
76
+ If issues found → implementer fixes → spec reviewer re-reviews → repeat until pass.
77
+
78
+ #### 1d. Code Quality Review
79
+
80
+ Only after spec compliance passes. Dispatch a quality reviewer with:
81
+ - What was implemented
82
+ - Git SHAs (base and head)
83
+ - Task requirements
84
+
85
+ The quality reviewer checks:
86
+ - Single responsibility per file
87
+ - Clean interfaces and decomposition
88
+ - Test quality (assertions that verify behavior, not just coverage)
89
+ - Following existing codebase patterns
90
+
91
+ If issues found → implementer fixes → quality reviewer re-reviews → repeat until pass.
92
+
93
+ #### 1e. Mark Complete
94
+
95
+ Mark the task done. Move to next task.
96
+
97
+ ### Phase 2 — Final Review
98
+
99
+ After all tasks complete, dispatch one final code reviewer across the entire implementation. Check for:
100
+ - Cross-task integration issues
101
+ - Consistency between tasks
102
+ - Overall architecture coherence
103
+
104
+ ### Phase 3 — Finish
105
+
106
+ Use `pharaoh:finish` to decide: merge, PR, or cleanup.
107
+
108
+ ## Model Selection
109
+
110
+ Match model capability to task complexity:
111
+
112
+ | Task type | Model tier |
113
+ |-----------|-----------|
114
+ | Isolated function, clear spec, 1-2 files | Fast/cheap |
115
+ | Multi-file integration, pattern matching | Standard |
116
+ | Architecture, design, review | Most capable |
117
+
118
+ ## Prompt Quality
119
+
120
+ | Bad | Good |
121
+ |-----|------|
122
+ | "Implement the auth feature" | Full task text + context + constraints |
123
+ | Sharing session history | Constructing focused context per agent |
124
+ | "Fix it" | Specific report of what's wrong + file references |
125
+ | Skipping spec review | Always spec review before quality review |
126
+
127
+ ## Iron Rules
128
+
129
+ - **One task at a time** — no parallel implementation (conflicts)
130
+ - **Never skip reviews** — spec compliance AND code quality, in that order
131
+ - **Spec before quality** — wrong order wastes review cycles
132
+ - **Construct context, don't inherit** — each agent gets exactly what it needs
133
+ - **Never trust reports** — reviewers read code, not claims
134
+ - **Fix before proceeding** — no moving to next task with open issues
135
+ - **Escalation is success** — BLOCKED/NEEDS_CONTEXT means the system is working
136
+
137
+ ## Output
138
+
139
+ After all tasks complete:
140
+ - Summary of what was built (per task)
141
+ - Review findings that were caught and fixed
142
+ - Any concerns flagged by implementers
143
+ - Final reviewer assessment
144
+ - Ready for `pharaoh:finish`