@lbruton/specflow 3.0.0 → 3.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/CHANGELOG.md CHANGED
@@ -5,6 +5,95 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ SpecFlow is a fork of [Pimzino/spec-workflow-mcp](https://github.com/Pimzino/spec-workflow-mcp). Upstream releases (≤ 2.2.3) are preserved below. SpecFlow releases begin at 3.0.0.
9
+
10
+ ## [3.1.0] - 2026-03-31
11
+
12
+ ### Added
13
+
14
+ - **`/wrap` prompt** (SWF-50) -- End-of-session orchestrator. Verifies PR merged, cleans worktrees, updates DocVault, captures retro lessons to mem0, writes session digest directly from in-context model. Replaces `/goodnight` and `/digest-session` with higher-fidelity single workflow.
15
+ - **`/prime` prompt** (SWF-52) -- Fast session quick-start (~15 seconds, no agents). Gathers git status, open issues/PRs, today's vault digest, and targeted mem0 search. `prime full` mode available for deep scans with code-oracle, Codacy, and indexing.
16
+ - **`/audit` prompt** (SWF-51) -- On-demand project health check. Scans code quality (CGC dead code, complexity), security posture (Codacy SRM), instruction file drift (CLAUDE.md vs Agents.md vs Gemini.md), issue landscape, and index health. Focused mode available via `focus` argument.
17
+
18
+ ### Changed
19
+
20
+ - **Session lifecycle redesign** -- split monolithic `/prime` into three focused skills: `/prime` (start fast), `/audit` (scan deep), `/wrap` (close clean). Each skill does one thing well at the right time.
21
+ - **Prompt count** -- 7 → 10 registered MCP prompts.
22
+
23
+ ### Deprecated
24
+
25
+ - **`/goodnight`** -- replaced by `/wrap` which adds worktree cleanup, issue closure, and log-implementation gates.
26
+ - **`/digest-session`** -- absorbed into `/wrap`. Session summaries now written directly by the in-context model instead of dispatching Haiku agents over JSONL transcripts.
27
+
28
+ ## [3.0.1] - 2026-03-29
29
+
30
+ ### Added
31
+
32
+ - **Project root filter** (SWF-41) -- `SPEC_WORKFLOW_PROJECT_ROOT` environment variable filters which directories get registered in the dashboard project list. Supports colon-separated paths for multiple roots. Unset means all paths register (backwards compatible).
33
+ - **mex credit in README** -- credited [theDakshJaitly/mex](https://github.com/theDakshJaitly/mex) for inspiring drift detection, pattern promotion, and staleness hook features.
34
+
35
+ ### Fixed
36
+
37
+ - **Dashboard launchd path** -- updated `com.spec-workflow.dashboard` plist to use renamed `specflow-marketplace` symlink path, fixing 404 on dashboard after rebrand.
38
+ - **Quick Start cd path** -- fixed stale `cd spec-workflow-mcp` in README install instructions.
39
+
40
+ ## [3.0.0] - 2026-03-29
41
+
42
+ ### Added
43
+
44
+ - **SpecFlow rebrand** (SWF-6, SWF-7) -- renamed from `spec-workflow-mcp` to `specflow` across GitHub repo, npm package (`@lbruton/specflow`), local paths, symlinks, and all documentation.
45
+ - **Logo and README** (SWF-10) -- Arrow Stack SVG mark with Plus Jakarta Sans wordmark. Complete README rewrite positioning SpecFlow as a spec-driven development framework with comparison table, architecture overview, and case study.
46
+ - **Interactive launch page** -- GitHub Pages hosted about page at `lbruton.github.io/specflow`.
47
+ - **Forge case study** -- documented a real build session: empty repo to production in 3 hours with 23 tasks across 30 parallel subagents.
48
+ - **Plugin manifest** (SWF-11) -- added `.claude-plugin/plugin.json` for Claude Code marketplace integration.
49
+ - **Collapsible annotation drawer** (SWF-9) -- comments panel in approval preview converted from fixed sidebar to collapsible drawer.
50
+
51
+ ### Changed
52
+
53
+ - **Package name** -- `spec-workflow-mcp` → `@lbruton/specflow`
54
+ - **GitHub repo** -- `lbruton/spec-workflow-mcp` → `lbruton/specflow`
55
+ - **Dashboard branding** -- all UI references updated from spec-workflow-mcp to SpecFlow
56
+ - **Context budget** -- bumped from 125k → 300k → 800k tokens for 1M context models
57
+
58
+ ### Fixed
59
+
60
+ - **Security vulnerabilities** -- patched 9 dependency vulnerabilities flagged by Codacy/Trivy
61
+ - **Steering guide references** -- replaced wiki-update references with vault-update/DocVault
62
+ - **Marketplace directory path** -- corrected symlink paths after rename
63
+
64
+ ### Removed
65
+
66
+ - **Hardcoded project links** (SWF-1, SWF-4) -- removed StakTrakr/HexTrackr-specific links and wiki references from dashboard, making it project-agnostic
67
+ - **Linear issue tracking references** -- replaced with vault-based issue tracking terminology
68
+
69
+ ## [2.2.4-lbruton.2] - 2026-03-09
70
+
71
+ ### Fixed
72
+
73
+ - **Project registry persistence** -- keep projects in registry when all MCP instances disconnect, preventing ghost state on reconnect
74
+ - **Rate limit raised to 600 req/min** -- local dashboard was hitting 120 req/min ceiling during normal use
75
+ - **Approval annotator text color** -- use explicit CSS variable instead of `inherit`, fixing invisible text in some themes
76
+ - **Phase approved status** -- both parsers now read snapshot metadata to correctly report approval state
77
+
78
+ ### Added
79
+
80
+ - **Phase 5.2 User QA Session** -- new post-implementation phase for manual QA before wiki/PR. Restructured Phase 5 into 5.1 (E2E), 5.2 (QA), 5.3 (Wiki + PR)
81
+ - **Artifacts folder in spec structure** -- specs now include `artifacts/` directory for prototypes, mockups, and design assets
82
+ - **Phase 3.9 Implementation Readiness Gate** -- mandatory gate between task planning and implementation with tri-modal concerns status
83
+ - **Implementation log audit** -- `spec-status` reports logged vs unlogged tasks, catching missing `log-implementation` calls
84
+ - **Phase 5 post-implementation flow** -- formalized E2E testing, wiki update, and PR creation as tracked phases
85
+ - **Spec reviewer and code quality reviewer templates** -- structured review prompt templates
86
+ - **Implementer prompt template** -- ready-to-paste prompt for dispatching implementation to subagents
87
+ - **GitHub PR links in dashboard** -- sidebar and header show PR links for the active spec
88
+ - **Tests artifact type** -- `log-implementation` accepts `tests` as an artifact category
89
+ - **SRPI execution mechanics** -- Structured Research-Plan-Implement pattern merged into Phase 4
90
+
91
+ ---
92
+
93
+ ## Upstream Releases (Pimzino/spec-workflow-mcp)
94
+
95
+ The following entries are from the upstream project before the fork diverged.
96
+
8
97
  ## [2.2.3] - 2026-02-08
9
98
 
10
99
  ### Added
package/README.md CHANGED
@@ -9,18 +9,18 @@
9
9
  <p align="center">
10
10
  <a href="https://github.com/lbruton/specflow"><img src="https://img.shields.io/badge/license-GPL--3.0-green" alt="License"></a>
11
11
  <img src="https://img.shields.io/badge/MCP_Server-Plugin-6366f1" alt="MCP Server Plugin">
12
- <img src="https://img.shields.io/badge/self--hosted-zero_cloud_deps-22c55e" alt="Self-hosted">
12
+ <img src="https://img.shields.io/badge/self--hosted-cloud_optional-22c55e" alt="Self-hosted, cloud optional">
13
13
  </p>
14
14
 
15
15
  <p align="center">
16
16
  <a href="https://lbruton.github.io/specflow/"><strong>View the full interactive about page</strong></a> &bull;
17
17
  <a href="docs/CASE-STUDY-FORGE.md">Case Study: Forge</a> &bull;
18
- <a href="FORK-CHANGELOG.md">Changelog</a>
18
+ <a href="CHANGELOG.md">Changelog</a>
19
19
  </p>
20
20
 
21
21
  ---
22
22
 
23
- AI agents forget everything between sessions. They lose decisions, repeat mistakes, and drift from reality. **SpecFlow** gives them a structured lifecycle, persistent cross-project memory, and semantic code intelligence -- all self-hosted.
23
+ AI agents forget everything between sessions. They lose decisions, repeat mistakes, and drift from reality. **SpecFlow** gives them a structured lifecycle, persistent cross-project memory, and semantic code intelligence -- self-hosted core with optional cloud integrations.
24
24
 
25
25
  Built on [Pimzino/spec-workflow-mcp](https://github.com/Pimzino/spec-workflow-mcp)'s core engine (sequential spec workflow, real-time dashboard, blocking approval gates). This fork layers extended lifecycle phases, multi-project orchestration, three-tier knowledge architecture, and semantic code search on top.
26
26
 
@@ -41,7 +41,7 @@ Not everything belongs in one file. Each tier has a purpose and a source of trut
41
41
  |------|--------|------|
42
42
  | **1** | DocVault | Ground truth. Human-curated Obsidian vault. Wins all conflicts. |
43
43
  | **2** | File Memory | Session context. Project-scoped markdown at `~/.claude/projects/*/memory/`. |
44
- | **3** | mem0 | Episodic recall. Semantic retrieval from session digests. Never authoritative. |
44
+ | **3** | mem0 | Episodic recall. Semantic retrieval from session digests. Never authoritative. Cloud API by default; self-hosted fork planned. |
45
45
 
46
46
  ## Continuous Learning Loop
47
47
 
@@ -53,9 +53,9 @@ Every session learns from the previous. This is the single biggest differentiato
53
53
  ├─ Read recent digests │ └─ Extract prescriptive lessons → mem0
54
54
  ├─ Pull mem0 memories └─ /digest-session
55
55
  ├─ Check issues + git ├─ Read JSONL transcripts
56
- └─ "Here's where you left off" ├─ Summarize via local Ollama
56
+ └─ "Here's where you left off" ├─ Summarize via configurable LLM (Ollama or cloud)
57
57
  ├─ Write to DocVault/Daily Digests/
58
- └─ Save key facts to mem0
58
+ └─ Save key facts to mem0 (cloud API)
59
59
 
60
60
  Tomorrow's /prime reads today's digest + retro lessons
61
61
  ```
@@ -100,7 +100,7 @@ Agents shouldn't grep blindly through your codebase. Four search tiers, cheapest
100
100
  | 3 | Grep / Glob | Literal: exact strings, filenames, identifiers |
101
101
  | 4 | Code Oracle Agent | Deep analysis: combines all sources + AI reasoning |
102
102
 
103
- Code Context is a [hardened fork](https://github.com/lbruton/claude-context) of Zilliz's MCP server -- self-hosted Milvus, 30s timeouts, pinned npm versions. No collection limits, full data sovereignty.
103
+ Code Context is a [hardened fork](https://github.com/lbruton/claude-context) of Zilliz's MCP server -- self-hosted Milvus, 30s timeouts, pinned npm versions. No collection limits, full data sovereignty. Embedding generation requires a cloud API (OpenAI or compatible) or a local model via Ollama.
104
104
 
105
105
  ## Comparison
106
106
 
@@ -113,7 +113,7 @@ Code Context is a [hardened fork](https://github.com/lbruton/claude-context) of
113
113
  | Multi-project | Per-repo | Per-repo | Per-repo | Per-repo | Per-repo | Per-repo | **One vault, all repos** |
114
114
  | Infrastructure | Code only | Code only | Code only | Code only | Code only | Code only | **Docker, DNS, VMs** |
115
115
  | Drift detection | None | None | None | None | 8 checkers | None | /vault-update gate |
116
- | Self-hosted | Files | Files | Files | Files | Files | Node.js | **Milvus, Neo4j, Ollama** |
116
+ | Self-hosted | Files | Files | Files | Files | Files | Node.js | **Milvus, Neo4j + cloud optional** |
117
117
  | Best for | Quick adoption | Enterprise teams | Solo context eng. | PRD pipelines | Per-repo memory | Structured workflow | **Multi-project governance** |
118
118
 
119
119
  ## Quick Start
@@ -122,7 +122,7 @@ Code Context is a [hardened fork](https://github.com/lbruton/claude-context) of
122
122
 
123
123
  ```bash
124
124
  git clone https://github.com/lbruton/specflow.git
125
- cd spec-workflow-mcp
125
+ cd specflow
126
126
  npm install && npm run build
127
127
 
128
128
  # Symlink into Claude Code plugins
@@ -173,12 +173,12 @@ npx @lbruton/specflow@latest --dashboard --port 5051
173
173
 
174
174
  ## Prerequisites
175
175
 
176
- The core spec workflow works out of the box with Node.js. Extended features use:
176
+ The core spec workflow works out of the box with Node.js. Extended features use additional services -- some self-hosted, some cloud-based. Local LLM support exists via Ollama but results vary significantly by model size and hardware (a capable GPU is recommended; smaller models may produce lower-quality output):
177
177
 
178
178
  | Component | Purpose | Link |
179
179
  |-----------|---------|------|
180
180
  | [Obsidian](https://obsidian.md) | DocVault knowledge base | [obsidian.md](https://obsidian.md) |
181
- | [mem0](https://github.com/mem0ai/mem0) | Cross-session episodic memory | [mem0.ai](https://mem0.ai) |
181
+ | [mem0](https://github.com/mem0ai/mem0) | Cross-session episodic memory (cloud API; self-hosted fork planned) | [mem0.ai](https://mem0.ai) |
182
182
  | [Milvus](https://milvus.io) | Self-hosted vector DB for Code Context | [milvus.io](https://milvus.io) |
183
183
  | [Claude Code](https://claude.ai/claude-code) | CLI agent that consumes MCP servers | [docs](https://docs.anthropic.com/en/docs/claude-code) |
184
184
 
@@ -203,7 +203,7 @@ src/
203
203
  - [x] Code Context -- semantic search (Milvus, self-hosted)
204
204
  - [x] Code Graph Context -- structural search (Neo4j, local)
205
205
  - [x] 60+ skills -- procedural knowledge routing
206
- - [x] Memory pipeline -- session digests via local Ollama
206
+ - [x] Memory pipeline -- session digests (configurable: local Ollama or cloud models like Haiku/Sonnet/Opus)
207
207
  - [ ] Rebrand Code Context -- merge into SpecFlow plugin
208
208
  - [ ] Self-host mem0 -- fork + local deployment
209
209
  - [ ] Self-host CGC -- fork + local Neo4j bundle
@@ -232,6 +232,8 @@ Core functionality docs from Pimzino's project:
232
232
 
233
233
  **[Pimzino/spec-workflow-mcp](https://github.com/Pimzino/spec-workflow-mcp)** is the foundation. Pimzino designed and built the core architecture: the MCP server, sequential spec workflow, real-time dashboard with blocking approval gates, approval storage, markdown parser, implementation logging, template engine, multi-language support, VSCode extension, Docker deployment, and security hardening. SpecFlow adds workflow extensions, knowledge architecture, and code intelligence on top of that substantial foundation.
234
234
 
235
+ **[theDakshJaitly/mex](https://github.com/theDakshJaitly/mex)** inspired several planned features: documentation drift detection with a scoring system, deterministic pattern files promoted from session learnings, and post-commit staleness hooks. mex's per-repo memory scaffold and GROW learning loop showed what disciplined context engineering looks like -- SpecFlow's multi-project approach builds on those ideas.
236
+
235
237
  **[Zilliz/claude-context](https://github.com/zilliztech/mcp-server-milvus)** provides the semantic code search engine that Code Context is forked from.
236
238
 
237
239
  ## License
@@ -48,6 +48,12 @@ export declare class ProjectRegistry {
48
48
  * so we assume processes are alive if path translation is enabled.
49
49
  */
50
50
  private isProcessAlive;
51
+ /**
52
+ * Check if a path is under one of the configured project roots.
53
+ * SPEC_WORKFLOW_PROJECT_ROOT accepts colon-separated paths.
54
+ * Returns true (allow) when no root is configured.
55
+ */
56
+ private isUnderProjectRoot;
51
57
  /**
52
58
  * Register a project in the global registry
53
59
  * Self-healing: If a project exists with dead PIDs, cleans them up and adds new PID
@@ -1 +1 @@
1
- {"version":3,"file":"project-registry.d.ts","sourceRoot":"","sources":["../../src/core/project-registry.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,eAAe,EAA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M,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBzE;;OAEG;IACG,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM7D;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAKvD;;OAEG;IACG,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAO3E;;OAEG;IACG,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAK7E;;;;OAIG;IACG,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC;IA6B7C;;OAEG;IACG,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAOhE;;OAEG;IACH,eAAe,IAAI,MAAM;CAG1B"}
@@ -147,14 +147,30 @@ export class ProjectRegistry {
147
147
  return false;
148
148
  }
149
149
  }
150
+ /**
151
+ * Check if a path is under one of the configured project roots.
152
+ * SPEC_WORKFLOW_PROJECT_ROOT accepts colon-separated paths.
153
+ * Returns true (allow) when no root is configured.
154
+ */
155
+ isUnderProjectRoot(absolutePath) {
156
+ const rootEnv = process.env.SPEC_WORKFLOW_PROJECT_ROOT;
157
+ if (!rootEnv)
158
+ return true;
159
+ const roots = rootEnv.split(':').map(r => resolve(r.trim())).filter(Boolean);
160
+ return roots.some(root => absolutePath.startsWith(root));
161
+ }
150
162
  /**
151
163
  * Register a project in the global registry
152
164
  * Self-healing: If a project exists with dead PIDs, cleans them up and adds new PID
153
165
  * Multi-instance: Allows unlimited MCP server instances per project
154
166
  */
155
167
  async registerProject(projectPath, pid, options = {}) {
156
- const registry = await this.readRegistry();
157
168
  const workspacePath = resolve(projectPath);
169
+ // Skip registration for paths outside configured project root(s)
170
+ if (!this.isUnderProjectRoot(workspacePath)) {
171
+ return generateProjectId(workspacePath);
172
+ }
173
+ const registry = await this.readRegistry();
158
174
  const workflowRootPath = resolve(options.workflowRootPath || projectPath);
159
175
  const projectId = generateProjectId(workspacePath);
160
176
  const projectName = options.projectName || generateProjectDisplayName(workspacePath, workflowRootPath);
@@ -1 +1 @@
1
- {"version":3,"file":"project-registry.js","sourceRoot":"","sources":["../../src/core/project-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAoBvE;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,YAAoB;IACpD,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACzE,2CAA2C;IAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,aAAqB,EAAE,gBAAwB;IACxF,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAE5C,IAAI,aAAa,KAAK,gBAAgB,EAAE,CAAC;QACvC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,GAAG,QAAQ,MAAM,aAAa,EAAE,CAAC;AAC1C,CAAC;AAED,MAAM,OAAO,eAAe;IAClB,YAAY,CAAS;IACrB,WAAW,CAAS;IACpB,mBAAmB,GAAY,KAAK,CAAC;IAE7C;QACE,IAAI,CAAC,WAAW,GAAG,YAAY,EAAE,CAAC;Q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CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YACnC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC,oCAAoC;QACxE,CAAC;QAED,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CAAC,WAAmB;QAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QAC3C,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;QAC1C,MAAM,SAAS,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;QAClD,OAAO,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ import { PromptDefinition } from './types.js';
2
+ export declare const auditPrompt: PromptDefinition;
3
+ //# sourceMappingURL=audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/prompts/audit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AA8Q9C,eAAO,MAAM,WAAW,EAAE,gBAGzB,CAAC"}
@@ -0,0 +1,267 @@
1
+ const prompt = {
2
+ name: 'audit',
3
+ title: 'Project Health Audit',
4
+ description: 'On-demand project health check covering code quality (CGC dead code, complexity), security posture (Codacy SRM), instruction file drift (CLAUDE.md vs Agents.md vs Gemini.md), issue landscape, and index health. Run when you want a thorough assessment — not needed every session.',
5
+ arguments: [
6
+ {
7
+ name: 'focus',
8
+ description: 'Focus the audit on a specific area: "code" (dead code, complexity), "security" (Codacy, SRM), "drift" (instruction file consistency), "issues" (stale/orphan issues), or "all" (default)',
9
+ required: false
10
+ }
11
+ ]
12
+ };
13
+ async function handler(args, context) {
14
+ const focus = args.focus || 'all';
15
+ const sections = {
16
+ code: focus === 'all' || focus === 'code',
17
+ security: focus === 'all' || focus === 'security',
18
+ drift: focus === 'all' || focus === 'drift',
19
+ issues: focus === 'all' || focus === 'issues',
20
+ };
21
+ const messages = [
22
+ {
23
+ role: 'user',
24
+ content: {
25
+ type: 'text',
26
+ text: `Run a project health audit. Focus: ${focus}.
27
+
28
+ **Context:**
29
+ - Project: ${context.projectPath}
30
+ ${context.dashboardUrl ? `- Dashboard: ${context.dashboardUrl}` : ''}
31
+
32
+ ---
33
+
34
+ ## Phase 0: Project Identity
35
+
36
+ \`\`\`bash
37
+ cat .claude/project.json 2>/dev/null
38
+ git remote get-url origin 2>/dev/null
39
+ \`\`\`
40
+
41
+ Extract: \`name\`, \`tag\`, \`issuePrefix\`, \`owner\`, \`repo\` (parse from git remote).
42
+
43
+ ---
44
+
45
+ ## Phase 1: Parallel Scans
46
+
47
+ Dispatch ALL applicable scans simultaneously. Use agents for heavy work, main context for fast MCP calls.
48
+
49
+ ${sections.code ? `### 1.1: Code Health (Agent: code-oracle, background)
50
+
51
+ Dispatch a \`code-oracle\` agent:
52
+ \`\`\`
53
+ Run a full code health audit:
54
+ - workingDir: ${context.projectPath}
55
+
56
+ Checks:
57
+ 1. Dead code detection via CGC (mcp__code-graph-context__find_dead_code)
58
+ 2. Top 10 most complex functions via CGC (mcp__code-graph-context__find_most_complex_functions)
59
+ 3. Convention violations in files changed in the last 14 days
60
+ 4. If CGC unavailable, fall back to grep-based analysis of unused exports
61
+
62
+ Output format: tables only, no prose. Max 20 findings per category.
63
+ \`\`\`
64
+ ` : '<!-- code scan skipped -->'}
65
+ ${sections.security ? `### 1.2: Security Posture (main context, parallel)
66
+
67
+ **Codacy SRM findings:**
68
+ \`\`\`
69
+ mcp__codacy__codacy_search_repository_srm_items(
70
+ provider="gh", organization="<owner>", repository="<repo>",
71
+ options={"statuses": ["OnTrack", "DueSoon", "Overdue"], "priorities": ["Critical", "High"]},
72
+ limit=25
73
+ )
74
+ \`\`\`
75
+
76
+ **Critical code quality issues:**
77
+ \`\`\`
78
+ mcp__codacy__codacy_list_repository_issues(
79
+ provider="gh", organization="<owner>", repository="<repo>",
80
+ options={"levels": ["Error"], "categories": ["security", "errorprone"]},
81
+ limit=25
82
+ )
83
+ \`\`\`
84
+
85
+ **DocVault security reviews — staleness check:**
86
+ \`\`\`bash
87
+ ls -t "/Volumes/DATA/GitHub/DocVault/Projects/<name>/Security Reviews/"*.md 2>/dev/null | head -1
88
+ \`\`\`
89
+ If the most recent review is older than 30 days, flag it as stale.
90
+
91
+ **GitHub security alerts:**
92
+ \`\`\`bash
93
+ gh api repos/<owner>/<repo>/vulnerability-alerts 2>/dev/null || echo "alerts-unavailable"
94
+ \`\`\`
95
+ ` : '<!-- security scan skipped -->'}
96
+ ${sections.drift ? `### 1.3: Instruction File Drift (main context, parallel)
97
+
98
+ Check consistency across agent instruction files. Read ALL three files that exist for this project:
99
+
100
+ \`\`\`bash
101
+ # Find instruction files
102
+ cat "${context.projectPath}/CLAUDE.md" 2>/dev/null | head -200
103
+ cat "${context.projectPath}/.codex/config.toml" 2>/dev/null || cat "${context.projectPath}/Agents.md" 2>/dev/null | head -200
104
+ cat "${context.projectPath}/Gemini.md" 2>/dev/null || cat "${context.projectPath}/.gemini/config.md" 2>/dev/null | head -200
105
+ \`\`\`
106
+
107
+ Also check the global instruction files:
108
+ \`\`\`bash
109
+ cat ~/.claude/CLAUDE.md 2>/dev/null | head -100
110
+ cat ~/.codex/config.toml 2>/dev/null | head -100
111
+ \`\`\`
112
+
113
+ **Extract factual claims** from each file:
114
+ - Tools/MCP servers referenced
115
+ - Services referenced (Linear, GitHub, Jira, etc.)
116
+ - Infrastructure references (IPs, ports, hostnames)
117
+ - Project names and repo paths
118
+ - Retired/deprecated items mentioned
119
+ - Workflow steps or mandatory gates
120
+
121
+ **Compare across files.** Report contradictions:
122
+ - Tool X mentioned in CLAUDE.md but not in Agents.md
123
+ - Service Y marked as "retired" in one file but still referenced in another
124
+ - Different IPs or ports for the same service
125
+ - Workflow steps that differ between agents
126
+
127
+ **Format findings as a table:**
128
+ | Claim | CLAUDE.md | Agents.md | Gemini.md | Issue |
129
+ |-------|-----------|-----------|-----------|-------|
130
+ | Linear usage | "retired 2026-03-13" | "track in INGEST project" | not mentioned | Stale reference in Agents.md |
131
+ ` : '<!-- drift check skipped -->'}
132
+ ${sections.issues ? `### 1.4: Issue Landscape (main context, parallel)
133
+
134
+ **Vault issues:**
135
+ \`\`\`bash
136
+ # All open issues
137
+ grep -rl "status: backlog\\|status: todo\\|status: in-progress" /Volumes/DATA/GitHub/DocVault/Projects/<name>/Issues/*.md 2>/dev/null
138
+ \`\`\`
139
+
140
+ For each open issue, read frontmatter to extract: id, title, status, priority, created date.
141
+
142
+ **GitHub issues:**
143
+ \`\`\`bash
144
+ gh issue list --repo <owner>/<repo> --state open --json number,title,labels,createdAt --limit 30 2>/dev/null
145
+ \`\`\`
146
+
147
+ **Cross-reference with recent work:**
148
+ \`\`\`bash
149
+ git log --oneline -30 --no-merges
150
+ \`\`\`
151
+
152
+ Identify:
153
+ - **Stale issues**: open for >30 days with no recent commits referencing them
154
+ - **Done but not closed**: issues whose work appears in git log but status is still open
155
+ - **Orphan GitHub issues**: GitHub issues with no corresponding vault issue (or vice versa)
156
+ ` : '<!-- issue scan skipped -->'}
157
+
158
+ ### 1.5: Index Health (always runs)
159
+
160
+ \`\`\`
161
+ mcp__claude-context__get_indexing_status(path="${context.projectPath}")
162
+ \`\`\`
163
+
164
+ If stale (>24h), trigger re-index:
165
+ \`\`\`
166
+ mcp__claude-context__index_codebase(path="${context.projectPath}")
167
+ \`\`\`
168
+
169
+ Check CGC:
170
+ \`\`\`
171
+ mcp__code-graph-context__get_repository_stats(repo_path="/workspace/<name>")
172
+ \`\`\`
173
+
174
+ If CGC function count seems low (<50 for medium+ projects), flag for re-index.
175
+
176
+ ---
177
+
178
+ ## Phase 2: Synthesis
179
+
180
+ Wait for all scans to complete. Combine results into a structured report.
181
+
182
+ ### Terminal Summary (display to user, <40 lines)
183
+
184
+ \`\`\`
185
+ # Audit — <ProjectName> (<date>)
186
+
187
+ ${sections.code ? `## Code Health
188
+ | Category | Count | Top Finding |
189
+ |----------|-------|-------------|
190
+ | Dead code | N | <most impactful unused symbol> |
191
+ | Complexity | N hotspots | <highest CCN function> |
192
+ | Conventions | N issues | <most common violation> |
193
+ ` : ''}
194
+ ${sections.security ? `## Security
195
+ **Codacy SRM:** N Critical, N High | N Overdue
196
+ <List Critical/Overdue items if any>
197
+ **Code Quality:** N Error-level issues
198
+ **Last Review:** <date> (<N days ago>)
199
+ <If >30 days: "⚠ Stale — schedule a new security review">
200
+ ` : ''}
201
+ ${sections.drift ? `## Instruction File Drift
202
+ <N contradictions found across CLAUDE.md / Agents.md / Gemini.md>
203
+ <List each contradiction as a one-liner>
204
+ <If clean: "All instruction files consistent.">
205
+ ` : ''}
206
+ ${sections.issues ? `## Issues
207
+ | Status | Count |
208
+ |--------|-------|
209
+ | In Progress | N |
210
+ | Backlog | N |
211
+ | Stale (>30d) | N |
212
+ | Done-not-closed | N |
213
+ ` : ''}
214
+ ## Index Health
215
+ | Tool | Status | Details |
216
+ |------|--------|---------|
217
+ | claude-context | Fresh/Stale | N files |
218
+ | CGC | Running/Down | N functions |
219
+
220
+ ## Recommended Actions
221
+ 1. <highest priority action>
222
+ 2. <next>
223
+ 3. <next>
224
+ \`\`\`
225
+
226
+ ### Full Report (write to DocVault)
227
+
228
+ Write the complete report to:
229
+ \`\`\`
230
+ /Volumes/DATA/GitHub/DocVault/Projects/<name>/audit/<YYYY-MM-DD>-<HHMMSS>.md
231
+ \`\`\`
232
+
233
+ Include YAML frontmatter:
234
+ \`\`\`yaml
235
+ ---
236
+ tags: [audit-report, <tag>]
237
+ project: <name>
238
+ date: <YYYY-MM-DD>
239
+ focus: ${focus}
240
+ ---
241
+ \`\`\`
242
+
243
+ The full report includes all raw findings (not just the summary). Commit to DocVault:
244
+ \`\`\`bash
245
+ cd /Volumes/DATA/GitHub/DocVault && mkdir -p "Projects/<name>/audit" && git add "Projects/<name>/audit/" && git commit -m "audit: <project> <date>" && git push origin main
246
+ \`\`\`
247
+
248
+ ---
249
+
250
+ ## Rules
251
+
252
+ - **Parallel by default.** All scans that can run simultaneously should.
253
+ - **Graceful degradation.** If CGC is down, Codacy fails, or a file is missing — note it and continue. Never block the audit on a single failing check.
254
+ - **Facts, not opinions.** Report what the tools find. Don't editorialize.
255
+ - **Actionable output.** Every finding should map to a concrete next step.
256
+ - **Don't fix during audit.** The audit reports; the user decides what to fix. Exception: if the user says "fix it" after seeing results, then proceed.
257
+ - **Instruction drift is advisory.** Report contradictions but don't auto-sync files — each agent reads slightly different formats.`
258
+ }
259
+ }
260
+ ];
261
+ return messages;
262
+ }
263
+ export const auditPrompt = {
264
+ prompt,
265
+ handler
266
+ };
267
+ //# sourceMappingURL=audit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/prompts/audit.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,GAAW;IACrB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EAAE,uRAAuR;IACpS,SAAS,EAAE;QACT;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,0LAA0L;YACvM,QAAQ,EAAE,KAAK;SAChB;KACF;CACF,CAAC;AAEF,KAAK,UAAU,OAAO,CAAC,IAAyB,EAAE,OAAoB;IACpE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC;IAElC,MAAM,QAAQ,GAAG;QACf,IAAI,EAAE,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,MAAM;QACzC,QAAQ,EAAE,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,UAAU;QACjD,KAAK,EAAE,KAAK,KAAK,KAAK,IAAI,KAAK,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C,CAAC,CAAC;;;;CAIlB,CAAC,CAAC,CAAC,EAAE;EACJ,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;;;;;;;CAOnB,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;SA0BG,KAAK;;;;;;;;;;;;;;;;;;oIAkBsH;aAC7H;SACF;KACF,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAqB;IAC3C,MAAM;IACN,OAAO;CACR,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,iBAAiB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC/G,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAuB1C;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAE1C;AAED;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAInE;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAK,EAC9B,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,eAAe,CAAC,CAa1B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,iBAAiB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC/G,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA6B1C;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAE1C;AAED;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAInE;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAK,EAC9B,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,eAAe,CAAC,CAa1B"}
@@ -6,6 +6,9 @@ import { specStatusPrompt } from './spec-status.js';
6
6
  import { injectSpecWorkflowGuidePrompt } from './inject-spec-workflow-guide.js';
7
7
  import { injectSteeringGuidePrompt } from './inject-steering-guide.js';
8
8
  import { refreshTasksPrompt } from './refresh-tasks.js';
9
+ import { wrapPrompt } from './wrap.js';
10
+ import { primePrompt } from './prime.js';
11
+ import { auditPrompt } from './audit.js';
9
12
  // Registry of all prompts
10
13
  const promptDefinitions = [
11
14
  createSpecPrompt,
@@ -14,7 +17,10 @@ const promptDefinitions = [
14
17
  specStatusPrompt,
15
18
  injectSpecWorkflowGuidePrompt,
16
19
  injectSteeringGuidePrompt,
17
- refreshTasksPrompt
20
+ refreshTasksPrompt,
21
+ wrapPrompt,
22
+ primePrompt,
23
+ auditPrompt
18
24
  ];
19
25
  /**
20
26
  * Get all registered prompts
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAIA,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,0BAA0B;AAC1B,MAAM,iBAAiB,GAAuB;IAC5C,gBAAgB;IAChB,uBAAuB;IACvB,mBAAmB;IACnB,gB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CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,uCAAuC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { PromptDefinition } from './types.js';
2
+ export declare const primePrompt: PromptDefinition;
3
+ //# sourceMappingURL=prime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prime.d.ts","sourceRoot":"","sources":["../../src/prompts/prime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAsS9C,eAAO,MAAM,WAAW,EAAE,gBAGzB,CAAC"}
@@ -0,0 +1,290 @@
1
+ const prompt = {
2
+ name: 'prime',
3
+ title: 'Session Quick-Start',
4
+ description: 'Fast session boot (~15 seconds). Gathers git status, open issues/PRs, active specs, today\'s digest, and a targeted mem0 search — all in main context, no agents dispatched. Use "prime full" for a deep scan including code health, security, and indexing.',
5
+ arguments: [
6
+ {
7
+ name: 'mode',
8
+ description: 'Execution mode: "quick" (default, 15 seconds) or "full" (deep scan with agents, 60-90 seconds)',
9
+ required: false
10
+ }
11
+ ]
12
+ };
13
+ async function handler(args, context) {
14
+ const mode = args.mode || 'quick';
15
+ if (mode === 'full') {
16
+ return buildFullPrimeMessages(context);
17
+ }
18
+ return buildQuickPrimeMessages(context);
19
+ }
20
+ function buildQuickPrimeMessages(context) {
21
+ return [
22
+ {
23
+ role: 'user',
24
+ content: {
25
+ type: 'text',
26
+ text: `Quick session start. Gather project status fast — no agents, no indexing. Target: 15 seconds.
27
+
28
+ **Context:**
29
+ - Project: ${context.projectPath}
30
+ ${context.dashboardUrl ? `- Dashboard: ${context.dashboardUrl}` : ''}
31
+
32
+ ---
33
+
34
+ ## Phase 0: Project Identity (instant)
35
+
36
+ \`\`\`bash
37
+ cat .claude/project.json 2>/dev/null
38
+ \`\`\`
39
+
40
+ Extract: \`name\`, \`tag\`, \`issuePrefix\`. If no project.json, infer from:
41
+ \`\`\`bash
42
+ basename "$(git remote get-url origin 2>/dev/null)" .git
43
+ \`\`\`
44
+
45
+ ---
46
+
47
+ ## Phase 1: Ground Truth (parallel, main context — no agents)
48
+
49
+ Run ALL of these in parallel using Bash:
50
+
51
+ \`\`\`bash
52
+ # Branch and working tree state
53
+ git branch --show-current && git status --short
54
+
55
+ # Recent commits (last 15)
56
+ git log --oneline -15 --no-merges
57
+
58
+ # Open worktrees
59
+ git worktree list
60
+
61
+ # Version lock (if exists)
62
+ cat devops/version.lock 2>/dev/null || echo "no-version-lock"
63
+ \`\`\`
64
+
65
+ \`\`\`bash
66
+ # Open PRs
67
+ gh pr list --state open --json number,title,headRefName,isDraft --jq '.[] | "PR #\\(.number): \\(.title) [\\(.headRefName)]\\(if .isDraft then " (draft)" else "" end)"' 2>/dev/null || echo "gh-unavailable"
68
+ \`\`\`
69
+
70
+ Also gather these (parallel with above):
71
+
72
+ **Vault Issues** — if \`issuePrefix\` exists, scan the vault issues folder:
73
+ \`\`\`bash
74
+ # List open issues (scan frontmatter for status != done)
75
+ grep -rl "status: backlog\\|status: todo\\|status: in-progress" /Volumes/DATA/GitHub/DocVault/Projects/<name>/Issues/*.md 2>/dev/null | head -20
76
+ \`\`\`
77
+ For each file found, extract just the title and status from frontmatter (read first 10 lines).
78
+
79
+ **Active Specs** — if \`.spec-workflow/specs/\` exists:
80
+ - Use the **spec-status** tool (no specName — returns all specs) or:
81
+ \`\`\`bash
82
+ ls .spec-workflow/specs/ 2>/dev/null
83
+ \`\`\`
84
+ For each spec, check if tasks.md has any \`[-]\` (in-progress) or \`[ ]\` (pending) markers.
85
+
86
+ **Today's Digest** — check if a session digest was written today or yesterday:
87
+ \`\`\`bash
88
+ # Find most recent digest for this project
89
+ ls -t "/Volumes/DATA/GitHub/DocVault/Daily Digests/<ProjectFolder>/"*.md 2>/dev/null | head -1
90
+ \`\`\`
91
+ If found and from today/yesterday, read it for context on where we left off.
92
+
93
+ ---
94
+
95
+ ## Phase 2: Context (1-2 mem0 searches)
96
+
97
+ Extract **keywords** from Phase 1 results:
98
+ - Significant nouns from commit messages (skip generic: fix, update, add, remove, chore)
99
+ - PR titles
100
+ - Issue titles
101
+ - Spec names
102
+
103
+ Build 1-2 targeted mem0 searches:
104
+
105
+ \`\`\`
106
+ mcp__mem0__search_memories(
107
+ query: "<top 5-8 distinctive keywords from Phase 1>",
108
+ filters: {"AND": [{"agent_id": "<project-tag>"}]},
109
+ limit: 5
110
+ )
111
+ \`\`\`
112
+
113
+ If the project tag yields <2 results, also try without the agent_id filter for cross-project context.
114
+
115
+ From the results, extract only what adds context BEYOND what git/issues show:
116
+ - Verbal decisions and rationale
117
+ - Planned next steps from last session
118
+ - Known blockers or dependencies
119
+ - Gotchas or warnings for areas being worked on
120
+
121
+ ---
122
+
123
+ ## Phase 3: Present
124
+
125
+ Display a concise terminal summary. **Must stay under 25 lines.**
126
+
127
+ \`\`\`
128
+ # <ProjectName> — <date>
129
+ Branch: \`<branch>\` | Version: \`<version>\` | Status: <clean/dirty>
130
+
131
+ ## Where We Left Off
132
+ <2-3 sentences from today's digest + mem0 context. If no digest: use mem0 alone. If neither: "No recent session history.">
133
+
134
+ ## Open Work
135
+ <Compact list: open PRs, active specs with task counts, in-progress issues — one line each, max 8 items>
136
+ <If nothing open: "No open work items.">
137
+
138
+ ## Suggested Next Steps
139
+ 1. <highest priority — based on in-progress items, open PRs, or recent commits>
140
+ 2. <next priority>
141
+ 3. <next priority>
142
+ \`\`\`
143
+
144
+ ---
145
+
146
+ ## Rules
147
+
148
+ - **No agents dispatched.** Everything runs in main context.
149
+ - **No indexing.** CGC and claude-context are not touched (that's /audit's job).
150
+ - **No Codacy queries.** Security scanning is /audit's job.
151
+ - **No DocVault archive.** Quick primes don't write reports to disk.
152
+ - **No session-digest processing.** That's /wrap's job at end of session.
153
+ - **Target 15 seconds.** If it's taking longer, you're doing too much.
154
+ - **Present, don't prescribe.** Show what's there, suggest next steps, then stop. The user decides what to work on.
155
+ - **After presenting the summary, the session is ready for work.** Do not prompt to run prime again.`
156
+ }
157
+ }
158
+ ];
159
+ }
160
+ function buildFullPrimeMessages(context) {
161
+ return [
162
+ {
163
+ role: 'user',
164
+ content: {
165
+ type: 'text',
166
+ text: `Full session start with deep scanning. This includes everything from quick prime PLUS code health, security, and indexing.
167
+
168
+ **Context:**
169
+ - Project: ${context.projectPath}
170
+ ${context.dashboardUrl ? `- Dashboard: ${context.dashboardUrl}` : ''}
171
+
172
+ ---
173
+
174
+ ## Step 1: Run Quick Prime First
175
+
176
+ Execute the full quick prime sequence (Phase 0-3 from the quick mode) to get the baseline status fast. Present the quick summary to the user immediately — don't wait for the deep scans.
177
+
178
+ ---
179
+
180
+ ## Step 2: Deep Scans (parallel agents, background)
181
+
182
+ After presenting the quick summary, dispatch these in parallel:
183
+
184
+ ### 2.1: Code Health (Agent: code-oracle, background)
185
+ Dispatch a \`code-oracle\` agent:
186
+ \`\`\`
187
+ Run a code health check:
188
+ - query: "dead code, complexity hotspots, convention violations"
189
+ - workingDir: ${context.projectPath}
190
+ - Focus on: dead code (CGC), top 5 complex functions (CGC), convention issues in files changed last 7 days
191
+ - Keep report compact — tables only, max 15 findings
192
+ \`\`\`
193
+
194
+ ### 2.2: Security Scan (main context, parallel with 2.1)
195
+ Query Codacy for open findings:
196
+ \`\`\`
197
+ mcp__codacy__codacy_search_repository_srm_items(
198
+ provider="gh", organization="<owner>", repository="<repo>",
199
+ options={"statuses": ["OnTrack", "DueSoon", "Overdue"], "priorities": ["Critical", "High"]},
200
+ limit=25
201
+ )
202
+ \`\`\`
203
+
204
+ Also query critical code quality issues:
205
+ \`\`\`
206
+ mcp__codacy__codacy_list_repository_issues(
207
+ provider="gh", organization="<owner>", repository="<repo>",
208
+ options={"levels": ["Error"], "categories": ["security", "errorprone"]},
209
+ limit=25
210
+ )
211
+ \`\`\`
212
+
213
+ ### 2.3: Index Health (main context, parallel)
214
+ \`\`\`
215
+ mcp__claude-context__get_indexing_status(path="${context.projectPath}")
216
+ \`\`\`
217
+
218
+ If stale (>24h), trigger a re-index:
219
+ \`\`\`
220
+ mcp__claude-context__index_codebase(path="${context.projectPath}")
221
+ \`\`\`
222
+
223
+ Check CGC if available:
224
+ \`\`\`
225
+ mcp__code-graph-context__get_repository_stats(repo_path="/workspace/<name>")
226
+ \`\`\`
227
+
228
+ ---
229
+
230
+ ## Step 3: Deep Report
231
+
232
+ When agents return, present an extended report BELOW the quick summary:
233
+
234
+ \`\`\`
235
+ ## Deep Scan Results
236
+
237
+ ### Code Health
238
+ <Dead code count, top complexity hotspots, convention issues — from code-oracle agent>
239
+
240
+ ### Security
241
+ **Codacy SRM:** N Critical, N High | N Overdue
242
+ <List any Critical or Overdue items>
243
+ **Code Quality:** N Error-level issues
244
+ <If clean: "No open security or critical findings.">
245
+
246
+ ### Index Health
247
+ | Tool | Status | Details |
248
+ |------|--------|---------|
249
+ | claude-context | Fresh/Stale/Indexing | N files |
250
+ | CGC | Running/Down | N functions, N relationships |
251
+ \`\`\`
252
+
253
+ ---
254
+
255
+ ## Step 4: Archive to DocVault
256
+
257
+ Write the full report (quick summary + deep results) to:
258
+ \`\`\`
259
+ /Volumes/DATA/GitHub/DocVault/Projects/<name>/prime/<YYYY-MM-DD>-<HHMMSS>.md
260
+ \`\`\`
261
+
262
+ Create the directory if needed (\`mkdir -p\`). Include YAML frontmatter:
263
+ \`\`\`yaml
264
+ ---
265
+ tags: [prime-report, <tag>]
266
+ project: <name>
267
+ date: <YYYY-MM-DD>
268
+ branch: <branch>
269
+ ---
270
+ \`\`\`
271
+
272
+ Commit to DocVault (direct to main).
273
+
274
+ ---
275
+
276
+ ## Rules
277
+
278
+ - **Quick summary first.** Don't make the user wait for agents — show quick results immediately.
279
+ - **Agents run in background.** Present deep results as they arrive.
280
+ - **Graceful degradation.** If CGC is down, Codacy fails, or agents timeout — note it and continue.
281
+ - **Full mode is opt-in.** Users run this when they want a thorough check, not every session.`
282
+ }
283
+ }
284
+ ];
285
+ }
286
+ export const primePrompt = {
287
+ prompt,
288
+ handler
289
+ };
290
+ //# sourceMappingURL=prime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prime.js","sourceRoot":"","sources":["../../src/prompts/prime.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,GAAW;IACrB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,8PAA8P;IAC3Q,SAAS,EAAE;QACT;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,gGAAgG;YAC7G,QAAQ,EAAE,KAAK;SAChB;KACF;CACF,CAAC;AAEF,KAAK,UAAU,OAAO,CAAC,IAAyB,EAAE,OAAoB;IACpE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC;IAElC,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,uBAAuB,CAAC,OAAoB;IACnD,OAAO;QACL;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE;;;aAGD,OAAO,CAAC,WAAW;EAC9B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAgB,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qGA6HiC;aAC9F;SACF;KACF,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,OAAoB;IAClD,OAAO;QACL;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE;;;aAGD,OAAO,CAAC,WAAW;EAC9B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAgB,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;;gBAmBpD,OAAO,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;iDA0Bc,OAAO,CAAC,WAAW;;;;;4CAKxB,OAAO,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8FA6D+B;aACvF;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAqB;IAC3C,MAAM;IACN,OAAO;CACR,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { PromptDefinition } from './types.js';
2
+ export declare const wrapPrompt: PromptDefinition;
3
+ //# sourceMappingURL=wrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../../src/prompts/wrap.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AA+R9C,eAAO,MAAM,UAAU,EAAE,gBAGxB,CAAC"}
@@ -0,0 +1,285 @@
1
+ const prompt = {
2
+ name: 'wrap',
3
+ title: 'Wrap Session',
4
+ description: 'End-of-session orchestrator. Verifies work is complete, cleans up worktrees, updates documentation, captures retrospective lessons to mem0, writes a session digest to DocVault, and closes out the session cleanly. Replaces /goodnight and /digest-session with a single, higher-fidelity workflow.',
5
+ arguments: [
6
+ {
7
+ name: 'skipCleanup',
8
+ description: 'Skip worktree cleanup and PR verification (use when wrapping a session that had no code changes)',
9
+ required: false
10
+ }
11
+ ]
12
+ };
13
+ async function handler(args, context) {
14
+ const { skipCleanup } = args;
15
+ const messages = [
16
+ {
17
+ role: 'user',
18
+ content: {
19
+ type: 'text',
20
+ text: `Wrap up this session. Follow each phase in order — do not skip phases unless explicitly noted.
21
+
22
+ **Context:**
23
+ - Project: ${context.projectPath}
24
+ ${context.dashboardUrl ? `- Dashboard: ${context.dashboardUrl}` : ''}
25
+ - Skip cleanup: ${skipCleanup ? 'yes' : 'no'}
26
+
27
+ ---
28
+
29
+ ## Phase 1: Status Check
30
+
31
+ Gather the current state before making any changes. Run ALL of these in parallel:
32
+
33
+ \`\`\`bash
34
+ # Git state
35
+ git status --short
36
+ git branch --show-current
37
+ git stash list
38
+
39
+ # Open worktrees
40
+ git worktree list
41
+
42
+ # Check for open PRs from this repo
43
+ gh pr list --state open --json number,title,headRefName,state,mergeStateStatus
44
+ \`\`\`
45
+
46
+ Also check spec-workflow state if the project uses it:
47
+ - If \`.spec-workflow/specs/\` exists, use the **spec-status** tool to check for in-progress tasks
48
+ - Look for any tasks marked \`[-]\` (in-progress) that need to be completed or reverted
49
+
50
+ **Report the status** before proceeding. If there are blockers (uncommitted files, unmerged PRs, in-progress tasks), present them and ask what to do.
51
+
52
+ ---
53
+
54
+ ## Phase 2: Cleanup Gate${skipCleanup ? ' (SKIPPED — skipCleanup=true)' : ''}
55
+
56
+ ${skipCleanup ? 'Skipping cleanup — no code changes this session. Proceed to Phase 3.' : `Work through each item. **Do not proceed to Phase 3 until all gates pass.**
57
+
58
+ ### 2.1: Uncommitted Changes
59
+ If \`git status\` shows dirty files:
60
+ - Present the list and ask: **commit, stash, or discard?**
61
+ - If commit: stage relevant files and commit with a descriptive message
62
+ - If stash: \`git stash push -m "wrap: uncommitted work from session"\`
63
+ - If discard: confirm with user before running \`git checkout -- .\`
64
+
65
+ ### 2.2: Implementation Logging
66
+ If spec-workflow is active and tasks were completed this session:
67
+ - Check that **log-implementation** was called for every task marked \`[x]\` during this session
68
+ - If any task was marked complete WITHOUT a log entry, run log-implementation NOW
69
+ - This is a **hard gate** — the most commonly skipped step in the workflow
70
+
71
+ ### 2.3: PR Status
72
+ For each open PR from this session:
73
+ - If **merged**: note it, proceed to worktree cleanup
74
+ - If **open, checks passing**: ask user — merge now or leave for review?
75
+ - If **open, checks failing**: flag it, ask user how to proceed
76
+ - If **draft**: leave it, note it in the session summary
77
+
78
+ ### 2.4: Version Bump
79
+ If the project has \`devops/version.lock\`:
80
+ - Check if runtime code was changed this session (check git log for non-chore commits)
81
+ - If runtime changes exist and no version bump commit is present, flag it:
82
+ "Runtime code changed but no version bump detected. Run /release patch before merging."
83
+
84
+ ### 2.5: Worktree Cleanup
85
+ For each worktree listed in \`git worktree list\`:
86
+ - If the branch was **merged**: remove the worktree (\`git worktree remove <path>\`) and delete the branch (\`git branch -d <branch>\`)
87
+ - If the branch is **unmerged with no uncommitted changes**: ask user — delete or keep?
88
+ - If the branch has **uncommitted changes**: flag it, do not auto-delete
89
+
90
+ After cleanup, verify main/dev branch is clean:
91
+ \`\`\`bash
92
+ git checkout <main-branch>
93
+ git pull origin <main-branch>
94
+ git status --short
95
+ \`\`\``}
96
+
97
+ ---
98
+
99
+ ## Phase 3: Documentation
100
+
101
+ ### 3.1: DocVault Updates
102
+ If code was changed this session, update relevant DocVault documentation:
103
+ - Identify which DocVault pages are affected by the changes (architecture, API, features, etc.)
104
+ - Read each affected page to check if it needs updates
105
+ - Update pages with current information
106
+ - Commit DocVault changes directly to main (DocVault uses direct commits, no PR needed)
107
+
108
+ The DocVault lives at \`/Volumes/DATA/GitHub/DocVault/\`. Use the project name to find the right subdirectory under \`Projects/\`.
109
+
110
+ ### 3.2: Issue Updates
111
+ If the session was driven by an issue (DocVault or GitHub):
112
+ - If work is **complete**: update the issue status to \`done\` and add a completion note with PR/commit references
113
+ - If work is **partially complete**: update the issue with progress notes and remaining work
114
+ - If work is **blocked**: update the issue with blocker details
115
+
116
+ ### 3.3: Spec Status
117
+ If spec-workflow specs were involved:
118
+ - Update spec phase status if all tasks are complete
119
+ - Check for pending approvals that should be resolved
120
+
121
+ ---
122
+
123
+ ## Phase 4: Knowledge Capture
124
+
125
+ This is the most important phase — it's what makes the next session productive. Run steps 4.1 and 4.2 sequentially (retro first, then digest), but 4.3 can run in parallel with 4.2.
126
+
127
+ ### 4.1: Retrospective (prescriptive lessons)
128
+
129
+ Scan the current conversation for high-signal lessons. Look for:
130
+ - **Mistakes** that cost time or caused rework
131
+ - **Wrong assumptions** that led you astray
132
+ - **Successful approaches** worth repeating
133
+ - **User preferences** expressed during the session
134
+ - **Codebase gotchas** discovered (tricky code, hidden dependencies, surprising behavior)
135
+ - **Process improvements** — things that should be done differently next time
136
+
137
+ For each lesson (target 3-8), save to mem0:
138
+
139
+ \`\`\`
140
+ mcp__mem0__add_memory(
141
+ text: "<single prescriptive sentence — action verb or 'When X, do Y' format>",
142
+ user_id: "lbruton",
143
+ agent_id: "<project-tag from project.json>",
144
+ metadata: {
145
+ "type": "retro-learning",
146
+ "category": "<error|pattern|preference|improvement|warning|win>",
147
+ "source": "retro",
148
+ "project": "<project-name>"
149
+ }
150
+ )
151
+ \`\`\`
152
+
153
+ **Categories:**
154
+ - **error**: Mistake that cost time — "Always check X before Y"
155
+ - **pattern**: Reusable approach — "When doing X, use Y"
156
+ - **preference**: User preference — "lbruton prefers X over Y"
157
+ - **improvement**: Process improvement — "Next time, do X first"
158
+ - **warning**: Gotcha or risk — "Watch out for X when touching Y"
159
+ - **win**: Successful approach — "X worked well for Y"
160
+
161
+ **Actor attribution rules (strict):**
162
+ - Things lbruton did → "lbruton prefers/uses/instructs..."
163
+ - Things Claude did → "Claude should..."
164
+ - Codebase facts → passive voice or component name
165
+
166
+ **Critical:** Always set BOTH \`user_id\` AND \`agent_id\`. Without \`agent_id\`, mem0 creates placeholder entity names.
167
+
168
+ ### 4.2: Session Digest (human-readable report for DocVault)
169
+
170
+ Write a session digest entry to the DocVault daily digest file. This is the human-readable record of what happened.
171
+
172
+ **Path:** \`/Volumes/DATA/GitHub/DocVault/Daily Digests/<ProjectFolder>/<YYYY-MM-DD>.md\`
173
+
174
+ Where \`<ProjectFolder>\` maps to the project name (e.g., StakTrakr, HexTrackr, Infrastructure, SpecFlow).
175
+
176
+ **If the file doesn't exist**, create it with this format:
177
+ \`\`\`markdown
178
+ ---
179
+ date: <YYYY-MM-DD>
180
+ project: <ProjectName>
181
+ tags: [daily-digest, <project-tag>]
182
+ ---
183
+
184
+ # Daily Digest — <ProjectName> (<YYYY-MM-DD>)
185
+
186
+ ## <HH:MM AM/PM>
187
+
188
+ <session summary>
189
+ \`\`\`
190
+
191
+ **If the file exists**, append a new \`## <HH:MM AM/PM>\` section.
192
+
193
+ **Session summary content** (200-300 words, flowing prose):
194
+ - What was the goal of this session?
195
+ - What was accomplished? (specific: commits, PRs, issues closed, features shipped)
196
+ - What problems were encountered and how were they resolved?
197
+ - What decisions were made and why?
198
+ - What's the current state? (branch, version, open work)
199
+ - What should happen next?
200
+
201
+ Include **concrete anchors**: commit hashes, issue IDs, version numbers, file paths. These make the digest searchable and verifiable.
202
+
203
+ Commit the digest to DocVault:
204
+ \`\`\`bash
205
+ cd /Volumes/DATA/GitHub/DocVault && git add "Daily Digests/" && git commit -m "digest: <project> session <date>" && git push origin main
206
+ \`\`\`
207
+
208
+ ### 4.3: Curated Session Summary (mem0 — machine-readable)
209
+
210
+ Write ONE concise mem0 entry summarizing this session. This is what the startup hook and /prime will retrieve next session.
211
+
212
+ \`\`\`
213
+ mcp__mem0__add_memory(
214
+ text: "[<ProjectName> | <branch> | <date>] <2-3 sentence summary of what was accomplished, key decisions, and current state. Include commit hashes, issue IDs, and version numbers as anchors.>",
215
+ user_id: "lbruton",
216
+ agent_id: "<project-tag>",
217
+ metadata: {
218
+ "category": "session-summary",
219
+ "type": "session-digest",
220
+ "source": "wrap",
221
+ "date": "<YYYY-MM-DD>",
222
+ "project": "<ProjectName>"
223
+ }
224
+ )
225
+ \`\`\`
226
+
227
+ **Quality bar for this entry:**
228
+ - Would this be useful if it showed up in 5 search results next session? If not, make it more specific.
229
+ - Does it contain at least one concrete anchor (commit, issue ID, version)?
230
+ - Does it say what CHANGED, not just what was "worked on"?
231
+ - Is it different enough from the retro lessons to avoid redundancy?
232
+
233
+ ---
234
+
235
+ ## Phase 5: Final Verification
236
+
237
+ Run these checks and present the results:
238
+
239
+ \`\`\`bash
240
+ # Confirm repo is clean
241
+ git status --short
242
+ git worktree list
243
+
244
+ # Confirm we're on the right branch
245
+ git branch --show-current
246
+ \`\`\`
247
+
248
+ ### Session Recap
249
+
250
+ Present a compact summary:
251
+
252
+ \`\`\`
253
+ ## Session Complete
254
+
255
+ **Shipped:** <list PRs merged, issues closed, versions bumped>
256
+ **Pending:** <list open PRs, unfinished work, blockers>
257
+ **Lessons:** <count> retro entries saved to mem0
258
+ **Digest:** Written to DocVault/Daily Digests/<path>
259
+ **Cleanup:** <worktrees removed, branches deleted>
260
+
261
+ Next session: <1-2 sentence suggestion for what to work on>
262
+ \`\`\`
263
+
264
+ ---
265
+
266
+ ## Rules
267
+
268
+ - **Sequential phases**: Do not skip ahead. Phase 2 must complete before Phase 3.
269
+ - **Ask, don't assume**: At every decision point (commit/stash/discard, merge/wait), ask the user.
270
+ - **No Haiku agents**: All summaries and digests are written by YOU (the current in-context model). Never dispatch a subagent for summarization — that's the old pipeline we're replacing.
271
+ - **Idempotent**: Running /wrap twice should be safe. Check if retro/digest already ran before duplicating.
272
+ - **mem0 writes require both user_id and agent_id**: Missing agent_id causes entity tracking issues.
273
+ - **DocVault commits go direct to main**: No PR needed for documentation updates.
274
+ - **Never auto-delete uncommitted work**: Always ask first.
275
+ - **The session isn't over until Phase 5 prints the recap.**`
276
+ }
277
+ }
278
+ ];
279
+ return messages;
280
+ }
281
+ export const wrapPrompt = {
282
+ prompt,
283
+ handler
284
+ };
285
+ //# sourceMappingURL=wrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrap.js","sourceRoot":"","sources":["../../src/prompts/wrap.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,GAAW;IACrB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,uSAAuS;IACpT,SAAS,EAAE;QACT;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,kGAAkG;YAC/G,QAAQ,EAAE,KAAK;SAChB;KACF;CACF,CAAC;AAEF,KAAK,UAAU,OAAO,CAAC,IAAyB,EAAE,OAAoB;IACpE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAE7B,MAAM,QAAQ,GAAoB;QAChC;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE;;;aAGD,OAAO,CAAC,WAAW;EAC9B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAgB,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE;kBAClD,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA6BlB,WAAW,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE;;EAE1E,WAAW,CAAC,CAAC,CAAC,sEAAsE,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuClF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6DAoLsD;aACtD;SACF;KACF,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAqB;IAC1C,MAAM;IACN,OAAO;CACR,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lbruton/specflow",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "MCP server for spec-driven development workflow with real-time web dashboard",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",