@alecsibilia/luca 13.0.0-alpha.1

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 (128) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +47 -0
  3. package/bin/luca.js +3 -0
  4. package/dist/chunks/branch.mjs +47 -0
  5. package/dist/chunks/bun-runtime.mjs +46 -0
  6. package/dist/chunks/checks.mjs +53 -0
  7. package/dist/chunks/claim-verify.mjs +465 -0
  8. package/dist/chunks/classify.mjs +105 -0
  9. package/dist/chunks/confidence.mjs +199 -0
  10. package/dist/chunks/doctor.mjs +158 -0
  11. package/dist/chunks/hook.mjs +696 -0
  12. package/dist/chunks/init.mjs +715 -0
  13. package/dist/chunks/muninndb-health.mjs +66 -0
  14. package/dist/chunks/phase.mjs +38 -0
  15. package/dist/chunks/pr-review.mjs +122 -0
  16. package/dist/chunks/preferences.mjs +61 -0
  17. package/dist/chunks/repair.mjs +111 -0
  18. package/dist/chunks/repo.mjs +58 -0
  19. package/dist/chunks/retro.mjs +86 -0
  20. package/dist/chunks/roadmap.mjs +58 -0
  21. package/dist/chunks/rules.mjs +527 -0
  22. package/dist/chunks/stale-mcp-server.mjs +90 -0
  23. package/dist/chunks/state.mjs +57 -0
  24. package/dist/chunks/stray-local-install.mjs +200 -0
  25. package/dist/chunks/telemetry.mjs +165 -0
  26. package/dist/chunks/todo.mjs +151 -0
  27. package/dist/chunks/vault-init.mjs +300 -0
  28. package/dist/chunks/verification.mjs +95 -0
  29. package/dist/chunks/version.mjs +70 -0
  30. package/dist/chunks/workflow.mjs +47 -0
  31. package/dist/claude/.claude/agents/architect.md +410 -0
  32. package/dist/claude/.claude/agents/build.md +111 -0
  33. package/dist/claude/.claude/agents/discuss.md +93 -0
  34. package/dist/claude/.claude/agents/discussion.md +149 -0
  35. package/dist/claude/.claude/agents/execute.md +416 -0
  36. package/dist/claude/.claude/agents/executor.md +161 -0
  37. package/dist/claude/.claude/agents/fast.md +84 -0
  38. package/dist/claude/.claude/agents/finalize.md +484 -0
  39. package/dist/claude/.claude/agents/learner.md +160 -0
  40. package/dist/claude/.claude/agents/plan-reviewer.md +129 -0
  41. package/dist/claude/.claude/agents/plan.md +96 -0
  42. package/dist/claude/.claude/agents/research.md +327 -0
  43. package/dist/claude/.claude/agents/researcher.md +78 -0
  44. package/dist/claude/.claude/agents/review.md +283 -0
  45. package/dist/claude/.claude/agents/reviewer.md +163 -0
  46. package/dist/claude/.claude/agents/shadow-scanner.md +257 -0
  47. package/dist/claude/.claude/agents/triage.md +230 -0
  48. package/dist/claude/.claude/agents/verifier.md +131 -0
  49. package/dist/claude/.claude/commands/bug-diagnose.md +12 -0
  50. package/dist/claude/.claude/commands/gh-issue-triage.md +14 -0
  51. package/dist/claude/.claude/commands/gh-pr-address.md +235 -0
  52. package/dist/claude/.claude/commands/gh-prepare.md +12 -0
  53. package/dist/claude/.claude/commands/grill-me.md +12 -0
  54. package/dist/claude/.claude/commands/lu-review.md +51 -0
  55. package/dist/claude/.claude/commands/lu.md +75 -0
  56. package/dist/claude/.claude/commands/luca-init.md +14 -0
  57. package/dist/claude/.claude/commands/luca-telemetry-report.md +12 -0
  58. package/dist/claude/.claude/commands/memory-audit.md +12 -0
  59. package/dist/claude/.claude/commands/milestone-new.md +122 -0
  60. package/dist/claude/.claude/commands/phase-discuss.md +45 -0
  61. package/dist/claude/.claude/commands/phase-execute.md +39 -0
  62. package/dist/claude/.claude/commands/phase-plan.md +53 -0
  63. package/dist/claude/.claude/commands/repo-cleanup.md +80 -0
  64. package/dist/claude/.claude/commands/todo-add.md +28 -0
  65. package/dist/claude/.claude/commands/todo-check.md +36 -0
  66. package/dist/claude/.claude/hooks/context-refresher.ts +285 -0
  67. package/dist/claude/.claude/hooks/continuation-messages.ts +215 -0
  68. package/dist/claude/.claude/hooks/pipeline-guard.ts +182 -0
  69. package/dist/claude/.claude/settings.json +41 -0
  70. package/dist/claude/skills/arch-audit/SKILL.md +161 -0
  71. package/dist/claude/skills/autopilot/SKILL.md +1299 -0
  72. package/dist/claude/skills/bug-diagnose/SKILL.md +102 -0
  73. package/dist/claude/skills/choose/SKILL.md +124 -0
  74. package/dist/claude/skills/gh-issue-triage/SKILL.md +97 -0
  75. package/dist/claude/skills/gh-pr-address/SKILL.md +235 -0
  76. package/dist/claude/skills/gh-prepare/SKILL.md +209 -0
  77. package/dist/claude/skills/grill-me/SKILL.md +46 -0
  78. package/dist/claude/skills/lu/SKILL.md +112 -0
  79. package/dist/claude/skills/lu-review/SKILL.md +51 -0
  80. package/dist/claude/skills/luca-init/SKILL.md +91 -0
  81. package/dist/claude/skills/luca-telemetry-report/SKILL.md +145 -0
  82. package/dist/claude/skills/luca-write-surface/SKILL.md +213 -0
  83. package/dist/claude/skills/memory-audit/SKILL.md +217 -0
  84. package/dist/claude/skills/milestone-audit/SKILL.md +545 -0
  85. package/dist/claude/skills/milestone-complete/SKILL.md +168 -0
  86. package/dist/claude/skills/milestone-gaps/SKILL.md +60 -0
  87. package/dist/claude/skills/milestone-new/SKILL.md +125 -0
  88. package/dist/claude/skills/note/SKILL.md +162 -0
  89. package/dist/claude/skills/phase-add/SKILL.md +91 -0
  90. package/dist/claude/skills/phase-assumptions/SKILL.md +92 -0
  91. package/dist/claude/skills/phase-discuss/SKILL.md +165 -0
  92. package/dist/claude/skills/phase-execute/SKILL.md +1786 -0
  93. package/dist/claude/skills/phase-insert/SKILL.md +100 -0
  94. package/dist/claude/skills/phase-plan/SKILL.md +461 -0
  95. package/dist/claude/skills/phase-remove/SKILL.md +113 -0
  96. package/dist/claude/skills/phase-research/SKILL.md +80 -0
  97. package/dist/claude/skills/post-init-tour/SKILL.md +58 -0
  98. package/dist/claude/skills/progress/SKILL.md +271 -0
  99. package/dist/claude/skills/project-new/SKILL.md +609 -0
  100. package/dist/claude/skills/quick/SKILL.md +256 -0
  101. package/dist/claude/skills/rename-audit/SKILL.md +52 -0
  102. package/dist/claude/skills/repo-audit/SKILL.md +88 -0
  103. package/dist/claude/skills/repo-cleanup/SKILL.md +80 -0
  104. package/dist/claude/skills/seed-memory/SKILL.md +235 -0
  105. package/dist/claude/skills/session-pause/SKILL.md +126 -0
  106. package/dist/claude/skills/session-plan/SKILL.md +112 -0
  107. package/dist/claude/skills/session-resume/SKILL.md +75 -0
  108. package/dist/claude/skills/todo-add/SKILL.md +85 -0
  109. package/dist/claude/skills/todo-check/SKILL.md +77 -0
  110. package/dist/claude/skills/workflow-save/SKILL.md +277 -0
  111. package/dist/index.d.mts +33 -0
  112. package/dist/index.d.ts +33 -0
  113. package/dist/index.mjs +69 -0
  114. package/dist/shared/luca.B3Mimc0P.mjs +52 -0
  115. package/dist/shared/luca.B3saVjJm.mjs +163 -0
  116. package/dist/shared/luca.BYdjkfnz.mjs +217 -0
  117. package/dist/shared/luca.BmhNkYe2.mjs +56 -0
  118. package/dist/shared/luca.C4gMUoBd.mjs +358 -0
  119. package/dist/shared/luca.CQ3g1xrD.mjs +19 -0
  120. package/dist/shared/luca.CRmaAfXR.mjs +713 -0
  121. package/dist/shared/luca.CrXzXueR.mjs +57 -0
  122. package/dist/shared/luca.DTomPq7I.mjs +91 -0
  123. package/dist/shared/luca.DjDTeDCi.mjs +1904 -0
  124. package/dist/shared/luca.HZxBTBgD.mjs +201 -0
  125. package/dist/shared/luca.TSMg1t7I.mjs +10 -0
  126. package/dist/shared/luca.dM-MKlNE.mjs +25 -0
  127. package/dist/shared/luca.naWEcQ4B.mjs +7 -0
  128. package/package.json +76 -0
@@ -0,0 +1,235 @@
1
+ ---
2
+ name: seed-memory
3
+ description: Seed MuninnDB with project knowledge from existing BRAIN.md, MEMORY.md, WORKING.md, and procedure files. Run once per project to populate MuninnDB with existing knowledge. Idempotent -- safe to run multiple times.
4
+ ---
5
+
6
+ <main>
7
+ # Seed Memory
8
+
9
+ Migrate file-based project knowledge into MuninnDB as structured, queryable entities. This skill reads existing planning files and stores their content as engrams with proper entity naming, hierarchy, and deduplication.
10
+
11
+ ## When to Use
12
+
13
+ - First time adopting MuninnDB on an existing project
14
+ - After significant manual edits to BRAIN.md, MEMORY.md, or procedures
15
+ - To refresh MuninnDB after a reset or data loss
16
+ - Safe to re-run -- idempotent via entity existence checks
17
+
18
+ ## Vault
19
+
20
+ Always use vault `"default"` for all MuninnDB operations.
21
+
22
+ ## Entity Naming Conventions
23
+
24
+ All entities use type-prefixed names for consistent recall and traversal:
25
+
26
+ | Source | Concept Prefix | Examples |
27
+ |--------|---------------|----------|
28
+ | BRAIN.md sections | `brain:` | `brain:project-identity`, `brain:stack`, `brain:conventions` |
29
+ | MEMORY.md patterns | `pattern:` | `pattern:bun-runtime-requirement` |
30
+ | MEMORY.md decisions | `decision:` | `decision:no-classes-architecture` |
31
+ | MEMORY.md pitfalls | `pitfall:` | `pitfall:generated-files-direct-edit` |
32
+ | MEMORY.md preferences | `preference:` | `preference:lodash-over-builtin` |
33
+ | WORKING.md sections | `session:` | `session:findings`, `session:progress` |
34
+ | Procedure files | `procedure:` | `procedure:deploy-checklist` |
35
+
36
+ ---
37
+
38
+ ## Procedure
39
+
40
+ ### Step 1: Detect existing files
41
+
42
+ Check for the following files and directories in the project root. Report which exist and which are missing:
43
+
44
+ ```
45
+ .luca/BRAIN.md
46
+ .luca/MEMORY.md
47
+ .luca/WORKING.md
48
+ .luca/procedures/
49
+ ```
50
+
51
+ Read each file that exists. If none exist, report "No planning files found -- nothing to seed" and stop.
52
+
53
+ ### Step 2: Seed BRAIN.md
54
+
55
+ If `.luca/BRAIN.md` exists:
56
+
57
+ 1. Read the file content
58
+ 2. Parse the major sections (look for ## headings: Project Identity, Stack, Architecture, Conventions, Preferences, etc.)
59
+ 3. **Check for existing entity** using `mcp__muninn__muninn_find_by_entity`:
60
+ - vault: "default"
61
+ - entity_name: "brain:project-identity"
62
+ 4. **If entity exists**: Use `mcp__muninn__muninn_evolve` to update the root engram with the latest content
63
+ 5. **If entity does not exist**: Use `mcp__muninn__muninn_remember_tree` to store as a hierarchical tree:
64
+ - vault: "default"
65
+ - Root concept: "brain:project-identity"
66
+ - Root content: The full BRAIN.md content or a summary of the project identity
67
+ - Children: One child per major section, each with:
68
+ - concept: `brain:<section-slug>` (e.g., "brain:stack", "brain:conventions", "brain:architecture")
69
+ - content: The section content as natural language
70
+
71
+ **Example tree structure:**
72
+
73
+ ```json
74
+ {
75
+ "vault": "default",
76
+ "root": {
77
+ "concept": "brain:project-identity",
78
+ "content": "Luca Framework -- agentic development tooling monorepo. Builds agents, skills, rules, hooks for AI-assisted development.",
79
+ "type": "project_identity",
80
+ "summary": "Project identity and conventions for luca-framework",
81
+ "entities": [{"name": "luca-framework", "type": "project"}]
82
+ },
83
+ "children": [
84
+ {
85
+ "concept": "brain:stack",
86
+ "content": "TypeScript, Bun runtime, Zod schemas, functional patterns. No classes.",
87
+ "type": "project_stack",
88
+ "summary": "Technology stack for luca-framework"
89
+ },
90
+ {
91
+ "concept": "brain:conventions",
92
+ "content": "Kebab-case files, barrel-only index.ts, schema-first parsing...",
93
+ "type": "project_conventions",
94
+ "summary": "Code conventions for luca-framework"
95
+ }
96
+ ]
97
+ }
98
+ ```
99
+
100
+ ### Step 3: Seed MEMORY.md
101
+
102
+ If `.luca/MEMORY.md` exists:
103
+
104
+ 1. Read the file content
105
+ 2. Parse each entry by identifying sections and sub-sections. Look for patterns like:
106
+ - **Patterns** section entries (## or ### headings under a Patterns section)
107
+ - **Decisions** section entries
108
+ - **Pitfalls** section entries
109
+ - **Preferences** section entries
110
+ - Any other categorized knowledge sections
111
+ 3. For each entry found:
112
+ - **Check for existing entity** using `mcp__muninn__muninn_find_by_entity`:
113
+ - entity_name: The concept name (e.g., "pattern:bun-runtime-requirement")
114
+ - **If entity exists**: Use `mcp__muninn__muninn_evolve` to update with latest content
115
+ - **If entity does not exist**: Add to the batch for creation
116
+ 4. Store all new entries using `mcp__muninn__muninn_remember_batch`:
117
+ - vault: "default"
118
+ - Each memory includes:
119
+ - concept: `<type>:<slug>` (e.g., "pattern:bun-runtime-requirement", "pitfall:generated-files-direct-edit")
120
+ - content: The full entry text as natural language
121
+ - type: One of "pattern", "decision", "pitfall", "preference"
122
+ - summary: A one-line summary of the entry
123
+ - entities: Include `{"name": "luca-framework", "type": "project"}` and any other relevant entities
124
+
125
+ **Concept naming rules:**
126
+
127
+ - Slugify the entry title: lowercase, replace spaces with hyphens, remove special characters
128
+ - Prefix with the section type: `pattern:`, `decision:`, `pitfall:`, `preference:`
129
+ - Example: "Bun Runtime Requirement" under Pitfalls becomes `pitfall:bun-runtime-requirement`
130
+ - Example: "Generated Files -- Never Edit Directly" under Patterns becomes `pattern:generated-files-never-edit-directly`
131
+
132
+ ### Step 4: Seed WORKING.md
133
+
134
+ If `.luca/WORKING.md` exists and is not empty:
135
+
136
+ 1. Read the file content
137
+ 2. Parse the major sections (Findings, Progress, Blockers, Decisions, etc.)
138
+ 3. For each non-empty section:
139
+ - **Check for existing entity** using `mcp__muninn__muninn_find_by_entity`:
140
+ - entity_name: `session:<section-slug>`
141
+ - **If entity exists**: Use `mcp__muninn__muninn_evolve` to update
142
+ - **If entity does not exist**: Use `mcp__muninn__muninn_remember` to store:
143
+ - vault: "default"
144
+ - concept: `session:<section-slug>` (e.g., "session:findings", "session:progress")
145
+ - content: The section content
146
+ - type: "session_context"
147
+ - summary: One-line description of the section
148
+ - entities: Include session ID if available, project name
149
+
150
+ **Note:** WORKING.md content is session-scoped and may be stale. Include a note in the content about when it was seeded.
151
+
152
+ ### Step 5: Seed Procedures
153
+
154
+ If `.luca/procedures/` directory exists:
155
+
156
+ 1. List all `.md` files in the directory
157
+ 2. For each procedure file:
158
+ - Read the file content
159
+ - Extract the procedure name from the filename (strip .md, use as slug)
160
+ - **Check for existing entity** using `mcp__muninn__muninn_find_by_entity`:
161
+ - entity_name: `procedure:<procedure-slug>`
162
+ - **If entity exists**: Use `mcp__muninn__muninn_evolve` to update the root
163
+ - **If entity does not exist**: Use `mcp__muninn__muninn_remember_tree`:
164
+ - vault: "default"
165
+ - Root concept: `procedure:<procedure-slug>`
166
+ - Root content: Procedure overview or full content
167
+ - Children: One child per major step or section (if the procedure has clear steps)
168
+ - type: "procedure"
169
+ - summary: One-line description of the procedure
170
+
171
+ ### Step 6: Verify seeding
172
+
173
+ After all seeding is complete:
174
+
175
+ 1. Use `mcp__muninn__muninn_recall` to verify key entities were stored:
176
+ - `muninn_recall(vault="default", context="brain project identity")`
177
+ - `muninn_recall(vault="default", context="patterns and pitfalls")`
178
+ - `muninn_recall(vault="default", context="procedures")` (if procedures were seeded)
179
+
180
+ 2. Report a summary:
181
+
182
+ ```
183
+ Seed Memory Complete
184
+ ====================
185
+ Files processed:
186
+ - BRAIN.md: {created|updated|skipped}
187
+ - MEMORY.md: {N} entries ({created} new, {updated} updated)
188
+ - WORKING.md: {created|updated|skipped|empty}
189
+ - Procedures: {N} files processed
190
+
191
+ Entities created: {total_new}
192
+ Entities updated: {total_updated}
193
+ Entities skipped: {total_skipped}
194
+
195
+ Verification:
196
+ - Brain recall: {pass|fail}
197
+ - Memory recall: {pass|fail}
198
+ - Procedure recall: {pass|fail|n/a}
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Idempotency Guarantee
204
+
205
+ This skill is safe to run multiple times because:
206
+
207
+ 1. **Before creating any entity**, it checks `mcp__muninn__muninn_find_by_entity` for an existing entity with the same name
208
+ 2. **If found**: Uses `mcp__muninn__muninn_evolve` to update the content (preserves entity ID, updates content)
209
+ 3. **If not found**: Creates the entity fresh
210
+ 4. **Entity names are deterministic**: Derived from file names and section headings, so the same input always produces the same entity names
211
+
212
+ This means running the skill twice on the same files will update existing entities rather than creating duplicates.
213
+
214
+ ---
215
+
216
+ ## Error Handling
217
+
218
+ - **MuninnDB unavailable**: Report the error clearly and stop. Do not fall back to file writes.
219
+ - **File read failure**: Skip the file, report which file failed, continue with others.
220
+ - **Batch too large**: If MEMORY.md has more than 50 entries, split into multiple `muninn_remember_batch` calls (max 50 per batch).
221
+ - **Malformed content**: If a file cannot be parsed into sections, store the entire file as a single entity with concept `<type>:raw-content`.
222
+
223
+ ---
224
+
225
+ ## MuninnDB Tools Reference
226
+
227
+ | Tool | Purpose | When to Use |
228
+ |------|---------|-------------|
229
+ | `mcp__muninn__muninn_remember_tree` | Store hierarchical content | BRAIN.md, Procedures |
230
+ | `mcp__muninn__muninn_remember_batch` | Store multiple flat entries | MEMORY.md entries |
231
+ | `mcp__muninn__muninn_remember` | Store single entry | WORKING.md sections |
232
+ | `mcp__muninn__muninn_find_by_entity` | Check if entity exists | Idempotency check before every create |
233
+ | `mcp__muninn__muninn_evolve` | Update existing entity | When entity already exists |
234
+ | `mcp__muninn__muninn_recall` | Verify stored content | Final verification step |
235
+ </main>
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: session-pause
3
+ description: Create a context handoff snapshot when pausing work mid-phase for later resumption.
4
+ ---
5
+
6
+ <main>
7
+ # Luca Pause Work
8
+
9
+ Create `.continue-here.md` handoff file to preserve complete work state across sessions.
10
+
11
+ Enables seamless resumption in fresh session with full context restoration.
12
+
13
+ ## Process
14
+
15
+ ### Step 1: Detect Current Phase
16
+
17
+ Read current phase from the canonical workflow state:
18
+
19
+ ```bash
20
+ STATE_JSON=$(luca state read 2>/dev/null || echo '{"initialized":false}')
21
+ PHASE=$(echo "$STATE_JSON" | jq -r '.currentPhase // empty')
22
+ PHASE_SLUG=$(echo "$STATE_JSON" | jq -r '.currentPhaseSlug // empty')
23
+ ```
24
+
25
+ ### Step 2: Gather Context
26
+
27
+ Collect complete state for handoff:
28
+
29
+ 1. **Current position**: Which phase, which plan, which task
30
+ 2. **Work completed**: What got done this session
31
+ 3. **Work remaining**: What's left in current plan/phase
32
+ 4. **Decisions made**: Key decisions and rationale
33
+ 5. **Blockers/issues**: Anything stuck
34
+ 6. **Mental context**: The approach, next steps, "vibe"
35
+ 7. **Files modified**: What's changed but not committed
36
+
37
+ Ask user for clarifications if needed.
38
+
39
+ ### Step 3: Write Handoff
40
+
41
+ Write to `.luca/phases/XX-name/.continue-here.md`:
42
+
43
+ ```markdown
44
+ ---
45
+ phase: XX-name
46
+ task: 3
47
+ total_tasks: 7
48
+ status: in_progress
49
+ last_updated: [timestamp]
50
+ ---
51
+
52
+ <current_state>
53
+ [Where exactly are we? Immediate context]
54
+ </current_state>
55
+
56
+ <completed_work>
57
+
58
+ - Task 1: [name] - Done
59
+ - Task 2: [name] - Done
60
+ - Task 3: [name] - In progress, [what's done]
61
+ </completed_work>
62
+
63
+ <remaining_work>
64
+
65
+ - Task 3: [what's left]
66
+ - Task 4: Not started
67
+ - Task 5: Not started
68
+ </remaining_work>
69
+
70
+ <decisions_made>
71
+
72
+ - Decided to use [X] because [reason]
73
+ - Chose [approach] over [alternative] because [reason]
74
+ </decisions_made>
75
+
76
+ <blockers>
77
+ - [Blocker 1]: [status/workaround]
78
+ </blockers>
79
+
80
+ <context>
81
+ [Mental state, what were you thinking, the plan]
82
+ </context>
83
+
84
+ <next_action>
85
+ Start with: [specific first action when resuming]
86
+ </next_action>
87
+ ```
88
+
89
+ ### Step 4: Commit
90
+
91
+ ```bash
92
+ git add .
93
+ bun run commit --message="[phase-name] paused at task [X]/[Y]" --type=chore --scope=wip --no-push --skip-checks
94
+ ```
95
+
96
+ ### Step 5: Confirm
97
+
98
+ ```
99
+ ✓ Handoff created: .luca/phases/[XX-name]/.continue-here.md
100
+
101
+ Current state:
102
+ - Phase: [XX-name]
103
+ - Task: [X] of [Y]
104
+ - Status: [in_progress/blocked]
105
+ - Committed as WIP
106
+
107
+ To resume: /session-resume
108
+ ```
109
+
110
+ ## Success Criteria
111
+
112
+ - [ ] .continue-here.md created in correct phase directory
113
+ - [ ] All sections filled with specific content
114
+ - [ ] Committed as WIP
115
+ - [ ] User knows location and how to resume
116
+
117
+ ## Next Steps
118
+
119
+ This skill creates a handoff for resuming later. No immediate action needed.
120
+
121
+ **When returning:**
122
+ - `/session-resume` — Restore context and continue
123
+
124
+ **Common follow-ups:**
125
+ - `/help` — Review commands before stepping away
126
+ </main>
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: session-plan
3
+ description: Plan the next coding session using WSJF prioritization of pending todos and roadmap items.
4
+ ---
5
+
6
+ <main>
7
+ # Luca Session Planner
8
+
9
+ Plan the next AI coding session (or week) by analyzing pending todos, scoring them with WSJF, and scheduling an optimal session plan.
10
+
11
+ **Arguments:** `[sessions]` (optional - defaults to 1 for single session, use >1 for weekly planning)
12
+
13
+ ## Process
14
+
15
+ ### Step 0: Cognitive Pre-Flight
16
+
17
+ 1. **Load context from MuninnDB:**
18
+ - Recall project identity: `mcp__muninn__muninn_recall_tree(vault: "default", id: "brain:project-identity")`
19
+ - Recall session context: `mcp__muninn__muninn_recall(vault: "default", context: "current session context")`
20
+ - Recall planning patterns: `mcp__muninn__muninn_recall(vault: "default", context: "planning patterns, estimates, and workflow decisions")`
21
+
22
+ 2. **Initialize session in MuninnDB:**
23
+ - Store session info: `mcp__muninn__muninn_remember(vault: "default", concept: "session:info", content: "workflow=session-plan, started=[timestamp]")`
24
+ - Note any recalled calibration data for effort estimates
25
+
26
+ ### Step 1: Parse Pending Todos
27
+
28
+ 1. **Read backlog:**
29
+ - Read pending todos via `luca todo list --status pending --format json`
30
+ - Each entry returns title, area, source, body, priority
31
+ - The backlog is MuninnDB-backed; `luca todo` is the canonical surface
32
+
33
+ 2. **Check for dependencies:**
34
+ - Scan body content for references to other todos
35
+ - Mark items as dependency_free=true if no unresolved prerequisites
36
+
37
+ 3. **Display backlog summary:**
38
+ - Show count of pending todos by area
39
+ - Note any items with dependencies
40
+
41
+ ### Step 2: Invoke PM Agent (lu-pm-planner)
42
+
43
+ 1. **Prepare context for PM agent:**
44
+ - Package TodoMetadata[] as structured input
45
+ - Include `.luca/roadmap.md` for priority context
46
+ - Include dependency graph
47
+ - Include any calibration entries for effort estimates (via MuninnDB: `mcp__muninn__muninn_recall(vault: "default", context: "effort estimates and calibration data")`)
48
+
49
+ 2. **Spawn lu-pm-planner sub-agent:**
50
+ - Agent infers WSJF inputs (BV, TC, RR) for each todo from context
51
+ - Agent maps complexity to effort points
52
+ - Agent computes WSJF scores and ranks items
53
+ - Agent applies Big Rock First + WSJF tail scheduling
54
+ - Agent assigns quality zones
55
+ - Agent returns ResultEnvelope containing SessionPlan
56
+
57
+ 3. **Receive and validate result:**
58
+ - Parse ResultEnvelope from agent output
59
+ - Validate SessionPlan schema
60
+ - Extract any issues or warnings
61
+
62
+ ### Step 3: Technical Review (Optional)
63
+
64
+ If `config.workflow.planner_review` is enabled (default: skip for now):
65
+
66
+ 1. **Pass session plan to code-architect:**
67
+ - Review dependency ordering correctness
68
+ - Validate effort estimates against historical data
69
+ - Check for hidden blockers or missing prerequisites
70
+ - Suggest reordering if technically warranted
71
+
72
+ 2. **Incorporate review feedback:**
73
+ - Append review comments to session plan rationale
74
+ - Flag any items the reviewer flagged as risky
75
+
76
+ ### Step 4: Present Session Plan
77
+
78
+ Display the session plan to the user:
79
+
80
+ 1. **Big Rock callout:**
81
+
82
+ ```
83
+ Big Rock: "{title}" (WSJF {score}, {complexity})
84
+ Scheduled in Peak Zone (0-30% context)
85
+ ```
86
+
87
+ 2. **Ordered task list with zones:**
88
+
89
+ ```
90
+ | # | Task | WSJF | Zone | Effort |
91
+ |---|------|------|------|--------|
92
+ | 1 | Big Rock task | 4.2 | peak | 5 |
93
+ | 2 | Next task | 3.5 | good | 3 |
94
+ | ... |
95
+ ```
96
+
97
+ 3. **Mermaid gantt chart** (from session plan)
98
+
99
+ 4. **Rationale summary** (from PM agent)
100
+
101
+ 5. **Deferred items** (not scheduled this session)
102
+
103
+ ### Step 5: Weekly Planning (if sessions > 1)
104
+
105
+ If `{ARGUMENTS}` specifies more than 1 session:
106
+
107
+ 1. Run `distributeWeekly(scored_items, sessions_count)` for multi-session planning
108
+ 2. Display per-session breakdown with allocation percentages
109
+ 3. Show weekly allocation: 60% needle movers, 25% quick wins, 10% maintenance, 5% reserve
110
+ 4. Display deferred items that didn't fit in the weekly plan
111
+
112
+ </main>
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: session-resume
3
+ description: Resume work from a previous session with full cognitive context restoration.
4
+ ---
5
+
6
+ <main>
7
+ # Luca Resume Work
8
+
9
+ Restore complete project context and resume work seamlessly from previous session.
10
+
11
+ ## Process
12
+
13
+ Follow the resume-project workflow which handles:
14
+
15
+ 1. **Project existence verification**
16
+ - Check for `.luca/` directory
17
+ - Error if project not initialized
18
+
19
+ 2. **State loading via the `luca` CLI**
20
+
21
+ ```bash
22
+ # Read the comprehensive state from .luca/state.json
23
+ STATE_JSON=$(luca state read 2>/dev/null || echo '{"initialized":false}')
24
+
25
+ # Extract complexity and phase info from the state JSON
26
+ COMPLEXITY=$(echo "$STATE_JSON" | jq -r '.complexity // "MODERATE"')
27
+ PHASE=$(echo "$STATE_JSON" | jq -r '.currentPhase // empty')
28
+ PIPELINE_STEP=$(echo "$STATE_JSON" | jq -r '.pipelineStep // "triage"')
29
+ ```
30
+
31
+ If state not initialized, reconstruct from artifacts (research.md, context.md, plan.md, audits/ under the active phase directory).
32
+
33
+ 3. **Incomplete work detection**
34
+ - For the active phase under `.luca/phases/<currentPhaseSlug>/`: check for `plan.md` without matching `execute/summary.md` (mid-phase abandonment) and for partially-filled `audits/` (mid-review abandonment).
35
+
36
+ 4. **Visual status presentation**
37
+ - Show progress bar
38
+ - Summarize recent work
39
+ - Display current position
40
+
41
+ 5. **Context-aware option offering**
42
+ - Check the active phase's `context.md` before suggesting plan vs discuss
43
+ - Offer appropriate next actions
44
+
45
+ 6. **Routing to appropriate next command**
46
+ - Execute phase if plans exist
47
+ - Plan phase if not planned
48
+ - Discuss phase if no context
49
+
50
+ 7. **Session continuity updates**
51
+ - Session continuity is auto-tracked by the state machine in `.luca/state.json` (no separate snapshot step needed).
52
+
53
+ ## Success Criteria
54
+
55
+ - [ ] Project context fully restored
56
+ - [ ] Checkpoint file processed (if exists)
57
+ - [ ] Incomplete work detected
58
+ - [ ] Clear next steps presented
59
+ - [ ] User knows what to do next
60
+
61
+ ## Next Steps
62
+
63
+ | Condition | Action | Command |
64
+ |-----------|--------|---------|
65
+ | Resumed successfully | Continue work | `/phase-execute {phase}` |
66
+ | Need to check status | Review progress | `/progress` |
67
+ | Context unclear | Check what's next | `/progress` |
68
+
69
+ **Primary:** `/progress` — See current state and smart routing
70
+
71
+ **Also available:**
72
+
73
+ - `/phase-execute {phase}` — Continue execution directly
74
+ - `/help` — Review available commands
75
+ </main>
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: todo-add
3
+ description: Capture an idea or task as a todo for later without acting on it now.
4
+ ---
5
+
6
+ <main>
7
+ # Luca Add Todo
8
+
9
+ Capture idea or task as todo from current conversation.
10
+
11
+ **Arguments:** `[description]` (optional - infers from conversation if not provided)
12
+
13
+ ## Process
14
+
15
+ 1. **Extract context:**
16
+ - If description provided: use it
17
+ - If not: infer from recent conversation context
18
+
19
+ 2. **Infer area:**
20
+ - Check file paths mentioned in conversation
21
+ - Categorize: api, ui, auth, data, etc.
22
+
23
+ 3. **Check for duplicates:**
24
+ - Search existing pending todos for similar content
25
+ - Warn if duplicate found
26
+
27
+ 4. **Persist the todo via the canonical CLI surface:**
28
+
29
+ \`\`\`bash
30
+ luca todo add --title "<title>" --area "<area>" --priority "<low|medium|high|critical>" --source "<origin>" --body "<source context>"
31
+ \`\`\`
32
+
33
+ Backlog state lives in MuninnDB (`todo:*` engrams under the repo vault) — there is no `.luca/todos/` directory in the LUCA_DIR_CONTRACT.
34
+
35
+ 5. **Confirm:**
36
+
37
+ ```
38
+ ✓ Todo captured: {title}
39
+
40
+ Area: {area}
41
+ Backlog: MuninnDB todo:<id> (see `luca todo list`)
42
+
43
+ /todo-check to review pending
44
+ ```
45
+
46
+ ## Todo File Format
47
+
48
+ ```markdown
49
+ ---
50
+ title: {title}
51
+ area: {api/ui/auth/data/etc}
52
+ created: {timestamp}
53
+ source: conversation
54
+ ---
55
+
56
+ ## Context
57
+
58
+ {What the user was discussing when this came up}
59
+
60
+ ## Task
61
+
62
+ {Specific thing to do}
63
+
64
+ ## Notes
65
+
66
+ {Any additional context}
67
+ ```
68
+
69
+ ## Success Criteria
70
+
71
+ - [ ] Todo content extracted (from args or conversation)
72
+ - [ ] Area inferred from context
73
+ - [ ] Duplicate check performed
74
+ - [ ] Todo engram persisted to MuninnDB backlog (`todo:*` in repo vault)
75
+ - [ ] Todo persisted to MuninnDB backlog via `luca todo add` (read back via `luca todo list` to confirm)
76
+ - [ ] User knows how to review todos
77
+
78
+ ## Next Steps
79
+
80
+ **Primary:** Continue current work — todo captured for later
81
+
82
+ **Also available:**
83
+ - `/todo-check` — Review all pending todos
84
+ - `/progress` — Check project status
85
+ </main>