@lbruton/specflow 3.1.0 → 3.2.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 (44) hide show
  1. package/README.md +22 -16
  2. package/dist/core/__tests__/convention-detector.test.d.ts +2 -0
  3. package/dist/core/__tests__/convention-detector.test.d.ts.map +1 -0
  4. package/dist/core/__tests__/convention-detector.test.js +199 -0
  5. package/dist/core/__tests__/convention-detector.test.js.map +1 -0
  6. package/dist/core/__tests__/security-utils.test.js +2 -2
  7. package/dist/core/__tests__/security-utils.test.js.map +1 -1
  8. package/dist/core/__tests__/template-generator.test.d.ts +2 -0
  9. package/dist/core/__tests__/template-generator.test.d.ts.map +1 -0
  10. package/dist/core/__tests__/template-generator.test.js +167 -0
  11. package/dist/core/__tests__/template-generator.test.js.map +1 -0
  12. package/dist/core/convention-detector.d.ts +36 -0
  13. package/dist/core/convention-detector.d.ts.map +1 -0
  14. package/dist/core/convention-detector.js +298 -0
  15. package/dist/core/convention-detector.js.map +1 -0
  16. package/dist/core/security-utils.js +2 -2
  17. package/dist/core/security-utils.js.map +1 -1
  18. package/dist/core/template-generator.d.ts +21 -0
  19. package/dist/core/template-generator.d.ts.map +1 -0
  20. package/dist/core/template-generator.js +217 -0
  21. package/dist/core/template-generator.js.map +1 -0
  22. package/dist/markdown/templates/design-template.md +8 -6
  23. package/dist/markdown/templates/tasks-template.md +23 -20
  24. package/dist/prompts/index.d.ts.map +1 -1
  25. package/dist/prompts/index.js +4 -7
  26. package/dist/prompts/index.js.map +1 -1
  27. package/dist/tools/spec-status.d.ts.map +1 -1
  28. package/dist/tools/spec-status.js +35 -8
  29. package/dist/tools/spec-status.js.map +1 -1
  30. package/dist/tools/spec-workflow-guide.js +25 -15
  31. package/dist/tools/spec-workflow-guide.js.map +1 -1
  32. package/package.json +1 -1
  33. package/dist/prompts/audit.d.ts +0 -3
  34. package/dist/prompts/audit.d.ts.map +0 -1
  35. package/dist/prompts/audit.js +0 -267
  36. package/dist/prompts/audit.js.map +0 -1
  37. package/dist/prompts/prime.d.ts +0 -3
  38. package/dist/prompts/prime.d.ts.map +0 -1
  39. package/dist/prompts/prime.js +0 -290
  40. package/dist/prompts/prime.js.map +0 -1
  41. package/dist/prompts/wrap.d.ts +0 -3
  42. package/dist/prompts/wrap.d.ts.map +0 -1
  43. package/dist/prompts/wrap.js +0 -285
  44. package/dist/prompts/wrap.js.map +0 -1
@@ -1 +0,0 @@
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"}
@@ -1,290 +0,0 @@
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
@@ -1 +0,0 @@
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,EAA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,OAAO,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8FA6D+B;aACvF;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAqB;IAC3C,MAAM;IACN,OAAO;CACR,CAAC"}
@@ -1,3 +0,0 @@
1
- import { PromptDefinition } from './types.js';
2
- export declare const wrapPrompt: PromptDefinition;
3
- //# sourceMappingURL=wrap.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,285 +0,0 @@
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
@@ -1 +0,0 @@
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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