@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,77 @@
1
+ ---
2
+ name: todo-check
3
+ description: List pending todos and select one to work on next.
4
+ ---
5
+
6
+ <main>
7
+ # Luca Check Todos
8
+
9
+ List pending todos and select one to work on.
10
+
11
+ **Arguments:** `[area]` (optional - filter by area like 'api', 'ui', etc.)
12
+
13
+ ## Process
14
+
15
+ 1. **List pending todos:**
16
+
17
+ ```bash
18
+ luca todo list --status pending
19
+ ```
20
+
21
+ Backlog state is MuninnDB-backed; `luca todo list` is the canonical read surface — there is no `.luca/todos/` directory in the LUCA_DIR_CONTRACT.
22
+
23
+ 2. **Filter by area (if provided):**
24
+ - Inspect each todo's area metadata (returned by `luca todo list`)
25
+ - Filter to matching area
26
+
27
+ 3. **Present list:**
28
+
29
+ ```
30
+ ## Pending Todos
31
+
32
+ | # | Title | Area | Age |
33
+ |---|-------|------|-----|
34
+ | 1 | Fix modal z-index | ui | 3 days |
35
+ | 2 | Add auth refresh | api | 1 day |
36
+ | 3 | Update docs | docs | 5 hours |
37
+
38
+ Select a number to view details, or:
39
+ - /todo-add — capture new idea
40
+ - /progress — return to main workflow
41
+ ```
42
+
43
+ 4. **Handle selection:**
44
+ - Load full todo content
45
+ - Present context and task details
46
+ - Offer options:
47
+ - "Work on now" - move to done/, start work
48
+ - "Add to phase" - suggest adding to current phase
49
+ - "Brainstorm" - discuss approach
50
+ - "Back" - return to list
51
+
52
+ 5. **If "Work on now":**
53
+ - Update the todo status via `luca todo update --id <id> --status in-progress` (and later to `done` when complete)
54
+ - Route to appropriate action
55
+
56
+ ## Success Criteria
57
+
58
+ - [ ] Pending todos listed with title, area, age
59
+ - [ ] Area filter works (if provided)
60
+ - [ ] Selected todo shows full context
61
+ - [ ] Options appropriate to todo content
62
+ - [ ] Completed todos moved to done/
63
+
64
+ ## Next Steps
65
+
66
+ | Condition | Action | Command |
67
+ |-----------|--------|---------|
68
+ | Selected a todo to work on | Work on it | `/lu {selected todo}` |
69
+ | No todos ready | Continue planned work | `/progress` |
70
+ | Want to add more | Capture new todo | `/todo-add` |
71
+
72
+ **Primary:** `/lu {selected}` — Work on the selected todo
73
+
74
+ **Also available:**
75
+ - `/progress` — Return to planned work
76
+ - `/todo-add` — Capture additional todos
77
+ </main>
@@ -0,0 +1,277 @@
1
+ ---
2
+ name: workflow-save
3
+ description: Save Luca workflow run data to MuninnDB for persistent cross-session memory. Use this skill after phase execution completes, when a session pauses or ends, after verification runs, or when the user asks to save, snapshot, or persist workflow state. Also trigger when the user mentions muninn, workflow memory, run history, session tracking, or wants to record what happened during a workflow run.
4
+ ---
5
+
6
+ <main>
7
+ # Workflow Save
8
+
9
+ Persist Luca workflow run data as atomic memories in MuninnDB. Each piece of data becomes its own memory with inline enrichment (type, summary, entities), linked to related memories via shared entities. This creates a queryable history of everything Luca does across sessions.
10
+
11
+ ## Why This Matters
12
+
13
+ MuninnDB is Luca's canonical memory system, providing semantic search, entity graphs, contradiction detection, and temporal decay — the foundation for Luca to genuinely learn from its own execution history. Every workflow run produces valuable signal; this skill captures it before it's lost.
14
+
15
+ ## Vault
16
+
17
+ Always use vault `"default"` for all MuninnDB operations.
18
+
19
+ ## Two Modes
20
+
21
+ ### Automatic (post-phase / post-session)
22
+
23
+ Called as the final step of `/phase-execute` and `/session-pause`. Captures only what changed since the last save — new commits, latest harness results, phase outcome, session summary.
24
+
25
+ ### Manual (`/workflow-save`)
26
+
27
+ Invoked directly by the user. Takes a full snapshot of current state — everything automatic mode captures, plus current scorecard, metrics, and any in-progress session context from MuninnDB.
28
+
29
+ ---
30
+
31
+ ## Memory Taxonomy
32
+
33
+ Each memory is atomic — one concept per memory. Always include inline enrichment fields (`type`, `summary`, `entities`) when calling `muninn_remember` or `muninn_remember_batch`.
34
+
35
+ ### Session Memories
36
+
37
+ | Type | When | What to Capture |
38
+ |------|------|-----------------|
39
+ | `session_start` | Session begins | session_id, branch, base_branch, complexity, oversight level, github_issue, timestamp |
40
+ | `session_end` | Session pauses/ends | session_id, duration, phases completed count, total commits, reason for pause, blockers if any |
41
+
42
+ ### Execution Memories
43
+
44
+ | Type | When | What to Capture |
45
+ |------|------|-----------------|
46
+ | `phase_execution` | Phase completes | phase number, phase name/goal, plans executed count, waves count, overall status (success/partial/failed), duration |
47
+ | `plan_execution` | Plan completes | plan file path, tasks completed, artifacts created/modified/deleted, deviations noted |
48
+ | `commit` | Git commit made | short hash, full message, files changed count, insertions/deletions, phase context |
49
+
50
+ ### Verification Memories
51
+
52
+ | Type | When | What to Capture |
53
+ |------|------|-----------------|
54
+ | `harness_result` | Harness runs | per-check status (test/typecheck/lint/build), error count, warning count, duration |
55
+ | `verification` | Verifier completes | goal achievement assessment, UAT results, gaps found, gap fix iterations needed |
56
+
57
+ ### Convergence Memories
58
+
59
+ | Type | When | What to Capture |
60
+ |------|------|-----------------|
61
+ | `convergence` | Iteration completes | error_count, error_count_delta, fingerprint_overlap, convergence_status (improved/stalled/regressed), iteration number |
62
+ | `stall_event` | Stall detected | stale_count, halt decision (continue/halt), debate result if debate agent participated, reason |
63
+
64
+ ### Agent Performance Memories
65
+
66
+ | Type | When | What to Capture |
67
+ |------|------|-----------------|
68
+ | `agent_invocation` | Agent completes | agent_name, status (success/partial/failed/timeout), duration_ms, context_tier, isolation_mode, model_used |
69
+ | `scorecard_snapshot` | Manual save | full scorecard: per-agent invocation_count, success_count, failure_count, avg_duration_ms |
70
+
71
+ ### Learning Memories
72
+
73
+ | Type | When | What to Capture |
74
+ |------|------|-----------------|
75
+ | `pattern` | Learning extracted | validated approach, confidence level, source phase, tags |
76
+ | `decision` | Decision recorded | choice made, rationale, alternatives considered, confidence |
77
+ | `pitfall` | Issue discovered | problem description, root cause, fix applied, severity |
78
+
79
+ ### Error Memories
80
+
81
+ | Type | When | What to Capture |
82
+ |------|------|-----------------|
83
+ | `error` | Significant error | error message (normalized), file, line, classification (transient/persistent), iterations_seen |
84
+ | `routing_decision` | Router classifies | complexity assigned, model selected, reasoning, override if any |
85
+
86
+ ---
87
+
88
+ ## Entity Taxonomy
89
+
90
+ Entities create the relational graph between memories. Use these types consistently so recall and traversal work across sessions.
91
+
92
+ | Entity Type | Name Format | Examples |
93
+ |-------------|-------------|---------|
94
+ | `session` | session UUID | `sess-a1b2c3d4` |
95
+ | `milestone` | version string | `v3.0.0`, `v3.1.0` |
96
+ | `phase` | `phase-{NN}` | `phase-06`, `phase-03` |
97
+ | `plan` | plan filename | `PLAN-06-01.md` |
98
+ | `branch` | full branch name | `53--v3-data-integrity` |
99
+ | `agent` | agent name | `lu-executor`, `lu-verifier` |
100
+ | `commit` | short hash | `a0acf99c` |
101
+ | `project` | project name | `luca-framework` |
102
+ | `error` | fingerprint hash | `err-5f3a` |
103
+
104
+ ---
105
+
106
+ ## Data Sources
107
+
108
+ Read from these locations to build memories.
109
+
110
+ ### State (current position)
111
+
112
+ ```bash
113
+ luca state read
114
+ ```
115
+
116
+ ### Execution artifacts (under the active phase)
117
+
118
+ - `.luca/phases/<slug>/execute/progress.jsonl` — append-only per-wave progress
119
+ - `.luca/phases/<slug>/execute/summary.md` — durable execute-step summary
120
+ - `.luca/phases/<slug>/verify.json` — verification result
121
+ - `.luca/telemetry/<runId>.jsonl` — per-run event log
122
+
123
+ ### Session context
124
+
125
+ - MuninnDB session memories — current session findings (via `muninn_recall`)
126
+ - MuninnDB long-term memories — existing learnings (via `muninn_recall`)
127
+ - `.continue-here.md` — session continuation context (if pausing)
128
+
129
+ ### Git history
130
+
131
+ ```bash
132
+ git log --oneline -20 --format="%h %s"
133
+ git diff --stat HEAD~1
134
+ git branch --show-current
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Procedure
140
+
141
+ ### Step 1: Assess scope
142
+
143
+ Determine what needs saving based on trigger mode:
144
+
145
+ - **Automatic post-phase**: Focus on the just-completed phase — its execution result, harness output, commits made during the phase, convergence data, agent invocations.
146
+ - **Automatic post-session**: Focus on session summary — total phases completed, duration, all commits this session, session-end context from MuninnDB session memories.
147
+ - **Manual snapshot**: Capture everything — full state, all recent execution data, scorecard, metrics, in-progress context.
148
+
149
+ ### Step 2: Read data sources
150
+
151
+ Read the relevant files from the data sources listed above. Skip files that don't exist or are empty — not every run produces every artifact.
152
+
153
+ ### Step 3: Build atomic memories
154
+
155
+ For each data point, construct a memory object with:
156
+
157
+ ```json
158
+ {
159
+ "concept": "phase-06 execution result",
160
+ "content": "Phase 06 (model routing redesign) completed successfully. 3 plans executed across 2 waves. All tasks completed with no deviations. Duration: ~45 minutes. Commits: a0acf99c, 506bbba6.",
161
+ "type": "phase_execution",
162
+ "summary": "Phase 06 model routing redesign completed successfully",
163
+ "entities": [
164
+ {"name": "phase-06", "type": "phase"},
165
+ {"name": "v3.0.0", "type": "milestone"},
166
+ {"name": "sess-abc123", "type": "session"},
167
+ {"name": "53--v3-data-integrity", "type": "branch"}
168
+ ]
169
+ }
170
+ ```
171
+
172
+ Guidelines for good memories:
173
+
174
+ - **One concept per memory** — don't combine phase results with harness results
175
+ - **Include concrete data** — hashes, counts, durations, statuses. Not vague summaries.
176
+ - **Name entities consistently** — always `phase-06` not `Phase 6` or `phase 6`
177
+ - **Write content as natural language** — it needs to be semantically searchable
178
+
179
+ ### Step 4: Store in batch
180
+
181
+ Use `muninn_remember_batch` to store all memories in a single call (max 50 per batch). If more than 50 memories, split into multiple batches.
182
+
183
+ Capture the returned IDs — you'll need them for linking.
184
+
185
+ ### Step 5: Link related memories
186
+
187
+ After storing, create links between related memories using `muninn_link`:
188
+
189
+ **Relation types:**
190
+
191
+ | Relation | Meaning | Example |
192
+ |----------|---------|---------|
193
+ | `is_part_of` | Memory belongs to a larger context | commit is_part_of phase, phase is_part_of milestone |
194
+ | `verified_by` | Result was checked by verification | phase_execution verified_by harness_result |
195
+ | `produced` | Action produced an artifact | plan_execution produced commit |
196
+ | `triggered` | Event caused another event | convergence stall triggered stall_event |
197
+ | `followed_by` | Temporal sequence | session_start followed_by session_end |
198
+ | `learned_from` | Learning derived from execution | phase_execution learned_from pattern/decision/pitfall |
199
+ | `relates_to` | General association | error relates_to agent_invocation |
200
+
201
+ **Linking priorities** (most valuable links first):
202
+
203
+ 1. Phase executions to their verification results
204
+ 2. Commits to the phase that produced them
205
+ 3. Learnings to the phase they came from
206
+ 4. Stall events to the convergence data that triggered them
207
+ 5. Session start to session end
208
+
209
+ ### Step 6: Confirm
210
+
211
+ Report to the user what was saved:
212
+
213
+ - Number of memories stored
214
+ - Key entities created/referenced
215
+ - Links established
216
+ - Any data sources that were missing or empty
217
+
218
+ ---
219
+
220
+ ## Example: Post-Phase Automatic Save
221
+
222
+ After Phase 06 completes, the skill produces these memories:
223
+
224
+ 1. **phase_execution**: "Phase 06 (model routing redesign) completed successfully. 3 plans, 2 waves, ~45min."
225
+ 2. **harness_result**: "Phase 06 harness: test passed, typecheck passed, lint passed, build passed. 0 errors, 0 warnings."
226
+ 3. **commit**: "a0acf99c — docs(05-01,05-02): verify Phase 5 agentic reliability todos"
227
+ 4. **commit**: "506bbba6 — fix(03-01): add eventType/timestamp indexes to observer_events"
228
+ 5. **convergence**: "Phase 06 converged in 1 iteration. Error count: 0, delta: 0, status: improved."
229
+ 6. **agent_invocation**: "lu-executor: 3 invocations, 3 success, avg 42s, model: sonnet"
230
+ 7. **agent_invocation**: "lu-verifier: 1 invocation, 1 success, 18s, model: sonnet"
231
+
232
+ Then links:
233
+
234
+ - memories 1-7 all linked to phase-06 entity via is_part_of
235
+ - memory 2 linked to memory 1 via verified_by
236
+ - memories 3-4 linked to memory 1 via produced
237
+ - memories 6-7 linked to session entity via is_part_of
238
+
239
+ ## Example: Session Pause Save
240
+
241
+ At session pause, the skill produces:
242
+
243
+ 1. **session_end**: "Session sess-abc123 ended after 2h15m. Completed phases 05, 06. 4 commits. Paused: context window approaching limit."
244
+ 2. **scorecard_snapshot**: "Agent scorecard at session end: lu-executor 6/6 success avg 40s, lu-verifier 2/2 success avg 20s, lu-cognition 1/1 success avg 8s."
245
+
246
+ Links:
247
+
248
+ - session_end to session_start via followed_by
249
+ - scorecard_snapshot to session entity via is_part_of
250
+
251
+ ---
252
+
253
+ ## Recalling Saved Data
254
+
255
+ The skill doesn't handle recall directly — use MuninnDB's recall tools whenever you need history:
256
+
257
+ ```
258
+ muninn_recall(vault="default", context="phase 06 execution results")
259
+ muninn_recall(vault="default", context="verification failures this milestone")
260
+ muninn_recall(vault="default", context="what happened in last session")
261
+ muninn_find_by_entity(vault="default", entity_name="phase-06")
262
+ muninn_entity_timeline(vault="default", entity_name="v3.0.0")
263
+ ```
264
+
265
+ Use `mode="deep"` on recall for thorough graph traversal when you need connected context.
266
+
267
+ ---
268
+
269
+ ## Edge Cases
270
+
271
+ - **No checkpoints exist**: Skip convergence memories. This is normal for TRIVIAL/SIMPLE tasks.
272
+ - **No harness result**: Skip verification memories. Harness may not have run yet.
273
+ - **Empty session context**: Skip learning memories. Session may not have produced learnings yet.
274
+ - **Multiple sessions same day**: Each session gets its own session_start/session_end pair. The session_id disambiguates.
275
+ - **Partial phase completion**: Still save what completed. Mark phase_execution status as `partial` and note what remains.
276
+ - **MuninnDB unavailable**: Log a warning and continue. Workflow should never block on memory persistence.
277
+ </main>
@@ -0,0 +1,33 @@
1
+ /**
2
+ * CLI entry point for the Luca framework.
3
+ *
4
+ * Defines the main `luca` command and its sub-commands (lifecycle commands
5
+ * plus the v13 write-surface noun groups). Separated from index.ts to keep
6
+ * the barrel pure (re-exports only).
7
+ */
8
+ declare const runMain: () => Promise<void>;
9
+ declare const runInit: () => Promise<void>;
10
+
11
+ interface ProjectContext {
12
+ /** Whether package.json exists */
13
+ hasPackageJson: boolean;
14
+ /** Whether .git directory exists */
15
+ hasGit: boolean;
16
+ /** Whether Luca is already installed (.luca/ directory exists) */
17
+ hasLuca: boolean;
18
+ /** Detected stack from dependencies */
19
+ detectedStack: 'react-ts' | 'react' | 'node-ts' | 'node' | 'unknown';
20
+ /** Whether TypeScript is configured */
21
+ hasTypeScript: boolean;
22
+ /** Project name from package.json */
23
+ projectName: string | null;
24
+ /** Project description from package.json */
25
+ projectDescription?: string | null;
26
+ /** Whether the project has existing source code (src/, app/, or lib/) */
27
+ hasExistingSource?: boolean;
28
+ }
29
+
30
+ declare const LUCA_VERSION: string;
31
+
32
+ export { LUCA_VERSION, runInit, runMain };
33
+ export type { ProjectContext };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * CLI entry point for the Luca framework.
3
+ *
4
+ * Defines the main `luca` command and its sub-commands (lifecycle commands
5
+ * plus the v13 write-surface noun groups). Separated from index.ts to keep
6
+ * the barrel pure (re-exports only).
7
+ */
8
+ declare const runMain: () => Promise<void>;
9
+ declare const runInit: () => Promise<void>;
10
+
11
+ interface ProjectContext {
12
+ /** Whether package.json exists */
13
+ hasPackageJson: boolean;
14
+ /** Whether .git directory exists */
15
+ hasGit: boolean;
16
+ /** Whether Luca is already installed (.luca/ directory exists) */
17
+ hasLuca: boolean;
18
+ /** Detected stack from dependencies */
19
+ detectedStack: 'react-ts' | 'react' | 'node-ts' | 'node' | 'unknown';
20
+ /** Whether TypeScript is configured */
21
+ hasTypeScript: boolean;
22
+ /** Project name from package.json */
23
+ projectName: string | null;
24
+ /** Project description from package.json */
25
+ projectDescription?: string | null;
26
+ /** Whether the project has existing source code (src/, app/, or lib/) */
27
+ hasExistingSource?: boolean;
28
+ }
29
+
30
+ declare const LUCA_VERSION: string;
31
+
32
+ export { LUCA_VERSION, runInit, runMain };
33
+ export type { ProjectContext };
package/dist/index.mjs ADDED
@@ -0,0 +1,69 @@
1
+ import { defineCommand, runMain as runMain$1 } from 'citty';
2
+ import 'pathe';
3
+
4
+ async function resolveVersion() {
5
+ return "13.0.0-alpha.1";
6
+ }
7
+ const LUCA_VERSION = await resolveVersion();
8
+
9
+ const main = defineCommand({
10
+ meta: {
11
+ name: "luca",
12
+ version: LUCA_VERSION,
13
+ description: "Luca CLI \u2014 spec-driven agentic development workflow + write surface"
14
+ },
15
+ subCommands: {
16
+ init: () => import('./chunks/init.mjs').then((m) => m.initCommand),
17
+ "vault:init": () => import('./chunks/vault-init.mjs').then((m) => m.vaultInitCommand),
18
+ retro: () => import('./chunks/retro.mjs').then((m) => m.retroCommand),
19
+ "claim-verify": () => import('./chunks/claim-verify.mjs').then(
20
+ (m) => m.claimVerifyCommand
21
+ ),
22
+ telemetry: () => import('./chunks/telemetry.mjs').then((m) => m.telemetryCommand),
23
+ rules: () => import('./chunks/rules.mjs').then((m) => m.rulesCommand),
24
+ classify: () => import('./chunks/classify.mjs').then((m) => m.classifyCommand),
25
+ doctor: () => import('./chunks/doctor.mjs').then((m) => m.default),
26
+ hook: () => import('./chunks/hook.mjs').then((m) => m.hookCommand),
27
+ repair: () => import('./chunks/repair.mjs').then((m) => m.repairCommand),
28
+ version: () => import('./chunks/version.mjs').then((m) => m.versionCommand),
29
+ // v13 write-surface noun-group commands (structured/operational
30
+ // mutations). The 9 freeform artifact writes are NOT here — they
31
+ // use the native Write tool (v13 plan, Phase C).
32
+ state: () => import('./chunks/state.mjs').then(
33
+ (m) => m.stateCommand
34
+ ),
35
+ phase: () => import('./chunks/phase.mjs').then(
36
+ (m) => m.phaseCommand
37
+ ),
38
+ roadmap: () => import('./chunks/roadmap.mjs').then(
39
+ (m) => m.roadmapCommand
40
+ ),
41
+ preferences: () => import('./chunks/preferences.mjs').then(
42
+ (m) => m.preferencesCommand
43
+ ),
44
+ todo: () => import('./chunks/todo.mjs').then((m) => m.todoCommand),
45
+ "pr-review": () => import('./chunks/pr-review.mjs').then(
46
+ (m) => m.prReviewCommand
47
+ ),
48
+ repo: () => import('./chunks/repo.mjs').then((m) => m.repoCommand),
49
+ checks: () => import('./chunks/checks.mjs').then(
50
+ (m) => m.checksCommand
51
+ ),
52
+ branch: () => import('./chunks/branch.mjs').then(
53
+ (m) => m.branchCommand
54
+ ),
55
+ workflow: () => import('./chunks/workflow.mjs').then(
56
+ (m) => m.workflowCommand
57
+ ),
58
+ confidence: () => import('./chunks/confidence.mjs').then(
59
+ (m) => m.confidenceCommand
60
+ ),
61
+ verification: () => import('./chunks/verification.mjs').then(
62
+ (m) => m.verificationCommand
63
+ )
64
+ }
65
+ });
66
+ const runMain = () => runMain$1(main);
67
+ const runInit = () => import('./chunks/init.mjs').then((m) => m.runInit());
68
+
69
+ export { LUCA_VERSION, runInit, runMain };
@@ -0,0 +1,52 @@
1
+ const STEP_ARTIFACTS = {
2
+ idle: [],
3
+ triage: [],
4
+ research: ["research"],
5
+ discuss: ["context"],
6
+ architect: [],
7
+ plan: ["plan"],
8
+ "plan-review": ["plan-review"],
9
+ execute: ["execute/summary", "execute/wave"],
10
+ checks: [],
11
+ verify: ["verify"],
12
+ review: ["audits/*"],
13
+ learn: ["learn"],
14
+ milestone: [],
15
+ complete: []
16
+ };
17
+ const WRITE_COMMAND_PHASES = {
18
+ // Read-only — allowed in every phase
19
+ "state read": [],
20
+ "phase current": [],
21
+ "branch-guard": [],
22
+ "preferences read": [],
23
+ "roadmap read": [],
24
+ "pr-review filter-stale": [],
25
+ "pr-review detect-convergence": [],
26
+ "pr-review regression-check": [],
27
+ // Todo delegation — phase-agnostic (emit muninn instructions)
28
+ "todo add": [],
29
+ "todo list": [],
30
+ "todo update": [],
31
+ // Operational mutations — phase-agnostic
32
+ "repo cleanup-apply": [],
33
+ "state advance": [],
34
+ "workflow reset": [],
35
+ "preferences write": [],
36
+ "confidence log": [],
37
+ // Phase-restricted structured mutations
38
+ "roadmap create": ["idle", "triage"],
39
+ "checks run": ["execute", "checks"],
40
+ // Phase-restricted freeform artifact writes
41
+ "phase write-research": ["research"],
42
+ "phase write-context": ["discuss"],
43
+ "phase write-plan": ["plan"],
44
+ "phase write-plan-review": ["plan-review"],
45
+ "phase write-summary": ["execute"],
46
+ "phase write-wave": ["execute"],
47
+ "phase write-verify": ["verify"],
48
+ "phase write-audit": ["review"],
49
+ "phase write-learn": ["learn"]
50
+ };
51
+
52
+ export { STEP_ARTIFACTS as S, WRITE_COMMAND_PHASES as W };