@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,201 @@
1
+ import { existsSync, readFileSync, mkdirSync, appendFileSync } from 'node:fs';
2
+ import { join, dirname } from 'node:path';
3
+ import { e as lucaRootPaths, q as LedgerEntrySchema, r as ConfidenceEntrySchema } from './luca.CRmaAfXR.mjs';
4
+ import { p as phasePathFor } from './luca.TSMg1t7I.mjs';
5
+
6
+ function appendLedger(opts) {
7
+ const entry = {
8
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
9
+ runId: opts.runId,
10
+ event: opts.event,
11
+ data: opts.data ?? {}
12
+ };
13
+ const p = join(opts.cwd, lucaRootPaths.ledger);
14
+ mkdirSync(dirname(p), { recursive: true });
15
+ appendFileSync(p, `${JSON.stringify(entry)}
16
+ `, "utf-8");
17
+ }
18
+ function readLedger(opts) {
19
+ const p = join(opts.cwd, lucaRootPaths.ledger);
20
+ if (!existsSync(p)) return [];
21
+ try {
22
+ const content = readFileSync(p, "utf-8");
23
+ if (!content.trim()) return [];
24
+ const entries = [];
25
+ let lineNumber = 0;
26
+ for (const line of content.split("\n")) {
27
+ lineNumber += 1;
28
+ if (!line.trim()) continue;
29
+ let parsedJson;
30
+ try {
31
+ parsedJson = JSON.parse(line);
32
+ } catch {
33
+ console.warn(
34
+ `readLedger: skipping malformed JSON at ${p}:${lineNumber}`
35
+ );
36
+ continue;
37
+ }
38
+ const parsed = LedgerEntrySchema.safeParse(parsedJson);
39
+ if (parsed.success) {
40
+ entries.push(parsed.data);
41
+ } else {
42
+ console.warn(
43
+ `readLedger: skipping schema-invalid entry at ${p}:${lineNumber}`
44
+ );
45
+ }
46
+ }
47
+ return entries;
48
+ } catch {
49
+ return [];
50
+ }
51
+ }
52
+ function readLedgerForRun(opts) {
53
+ return readLedger({ cwd: opts.cwd }).filter((e) => e.runId === opts.runId);
54
+ }
55
+ function listRuns(opts) {
56
+ const entries = readLedger({ cwd: opts.cwd });
57
+ const byRun = /* @__PURE__ */ new Map();
58
+ for (const e of entries) {
59
+ const id = e.runId || "unknown";
60
+ const existing = byRun.get(id);
61
+ if (!existing) {
62
+ byRun.set(id, { first: e.timestamp, last: e.timestamp, count: 1 });
63
+ } else {
64
+ existing.last = e.timestamp;
65
+ existing.count += 1;
66
+ }
67
+ }
68
+ return Array.from(byRun.entries()).map(([runId, v]) => ({
69
+ runId,
70
+ firstEvent: v.first,
71
+ lastEvent: v.last,
72
+ eventCount: v.count
73
+ }));
74
+ }
75
+
76
+ function appendConfidenceEntry(opts) {
77
+ const full = {
78
+ ...opts.entry,
79
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
80
+ };
81
+ const p = join(opts.cwd, phasePathFor(opts.slug, "confidence"));
82
+ mkdirSync(dirname(p), { recursive: true });
83
+ appendFileSync(p, `${JSON.stringify(full)}
84
+ `, "utf-8");
85
+ return full;
86
+ }
87
+ function readConfidenceJournal(opts) {
88
+ const p = join(opts.cwd, phasePathFor(opts.slug, "confidence"));
89
+ if (!existsSync(p)) return [];
90
+ const content = readFileSync(p, "utf-8");
91
+ if (!content.trim()) return [];
92
+ const entries = [];
93
+ const invalidLines = [];
94
+ for (const [index, line] of content.split("\n").entries()) {
95
+ if (!line.trim()) continue;
96
+ try {
97
+ const parsed = ConfidenceEntrySchema.safeParse(JSON.parse(line));
98
+ if (parsed.success) {
99
+ entries.push(parsed.data);
100
+ } else {
101
+ invalidLines.push(index + 1);
102
+ }
103
+ } catch {
104
+ invalidLines.push(index + 1);
105
+ }
106
+ }
107
+ if (invalidLines.length > 0) {
108
+ const plural = invalidLines.length === 1;
109
+ console.warn(
110
+ `[confidence-journal] skipped ${invalidLines.length} invalid entr${plural ? "y" : "ies"} in ${p} at line${plural ? "" : "s"} ${invalidLines.join(", ")}.`
111
+ );
112
+ }
113
+ return entries;
114
+ }
115
+ function getConfidenceSummary(entries) {
116
+ const categories = {};
117
+ let high = 0;
118
+ let medium = 0;
119
+ let low = 0;
120
+ for (const entry of entries) {
121
+ if (entry.confidence === "high") high++;
122
+ else if (entry.confidence === "medium") medium++;
123
+ else low++;
124
+ categories[entry.category] = (categories[entry.category] ?? 0) + 1;
125
+ }
126
+ return { total: entries.length, high, medium, low, categories };
127
+ }
128
+ const CONFIDENCE_EMOJI = {
129
+ high: "\u{1F7E2}",
130
+ medium: "\u{1F7E1}",
131
+ low: "\u{1F534}"
132
+ };
133
+ function renderConfidenceJournalMarkdown(entries) {
134
+ if (entries.length === 0) {
135
+ return "# Confidence Journal\n\nNo entries recorded yet.\n";
136
+ }
137
+ const summary = getConfidenceSummary(entries);
138
+ const lines = [
139
+ "# Confidence Journal",
140
+ "",
141
+ "## Summary",
142
+ "",
143
+ "| Confidence | Count |",
144
+ "|------------|-------|",
145
+ `| \u{1F7E2} High | ${summary.high} |`,
146
+ `| \u{1F7E1} Medium | ${summary.medium} |`,
147
+ `| \u{1F534} Low | ${summary.low} |`,
148
+ ""
149
+ ];
150
+ const catParts = Object.entries(summary.categories).sort(([, a], [, b]) => b - a).map(([cat, count]) => `${cat} (${count})`);
151
+ if (catParts.length > 0) {
152
+ lines.push(`**Categories**: ${catParts.join(", ")}`, "");
153
+ }
154
+ if (summary.low > 0) {
155
+ lines.push(
156
+ `\u26A0\uFE0F **${summary.low} low-confidence decision${summary.low > 1 ? "s" : ""} require${summary.low === 1 ? "s" : ""} human review** \u2014 see entries marked \u{1F534} below.`,
157
+ ""
158
+ );
159
+ }
160
+ lines.push("---", "");
161
+ const byPhase = /* @__PURE__ */ new Map();
162
+ for (const entry of entries) {
163
+ const key = entry.phase || "Unspecified Phase";
164
+ const list = byPhase.get(key);
165
+ if (list) list.push(entry);
166
+ else byPhase.set(key, [entry]);
167
+ }
168
+ for (const [phase, phaseEntries] of byPhase) {
169
+ lines.push(`## ${phase}`, "");
170
+ for (const entry of phaseEntries) {
171
+ lines.push(
172
+ `### ${CONFIDENCE_EMOJI[entry.confidence]} Wave ${entry.wave}, ${entry.task}`,
173
+ "",
174
+ `- **Confidence**: ${entry.confidence}`,
175
+ `- **Category**: ${entry.category}`,
176
+ `- **Decision**: ${entry.decision}`
177
+ );
178
+ if (entry.alternatives.length > 0) {
179
+ lines.push(
180
+ `- **Alternatives**: ${entry.alternatives.join("; ")}`
181
+ );
182
+ }
183
+ lines.push(
184
+ `- **Reasoning**: ${entry.reasoning}`,
185
+ `- **Risk**: ${entry.risk}`
186
+ );
187
+ if (entry.files.length > 0) {
188
+ lines.push(
189
+ `- **Files**: ${entry.files.map((f) => `\`${f}\``).join(", ")}`
190
+ );
191
+ }
192
+ if (entry.reviewHint) {
193
+ lines.push(`- **Review hint**: ${entry.reviewHint}`);
194
+ }
195
+ lines.push("");
196
+ }
197
+ }
198
+ return lines.join("\n");
199
+ }
200
+
201
+ export { readLedgerForRun as a, renderConfidenceJournalMarkdown as b, appendConfidenceEntry as c, appendLedger as d, getConfidenceSummary as g, listRuns as l, readConfidenceJournal as r };
@@ -0,0 +1,10 @@
1
+ import { x as PhaseSlugSchema, L as LUCA_DIR_ROOT, y as PHASE_FILE_PATHS } from './luca.CRmaAfXR.mjs';
2
+
3
+ function phasePathFor(slug, file) {
4
+ PhaseSlugSchema.parse(slug);
5
+ const base = `${LUCA_DIR_ROOT}/phases/${slug}`;
6
+ if (!file) return base;
7
+ return `${base}/${PHASE_FILE_PATHS[file]}`;
8
+ }
9
+
10
+ export { phasePathFor as p };
@@ -0,0 +1,25 @@
1
+ import { consola } from 'consola';
2
+
3
+ const log = consola.withTag("luca");
4
+ const logger = {
5
+ /** Starting a process */
6
+ start: (message) => log.start(message),
7
+ /** Success message */
8
+ success: (message) => log.success(message),
9
+ /** Informational message */
10
+ info: (message) => log.info(message),
11
+ /** Warning - not fatal but noteworthy */
12
+ warn: (message) => log.warn(message),
13
+ /** Error - operation failed */
14
+ error: (message) => log.error(message),
15
+ /** Debug - only in verbose mode */
16
+ debug: (message) => log.debug(message),
17
+ /** Boxed summary output */
18
+ box: (content) => consola.box(content),
19
+ /** Styled step indicator */
20
+ step: (number, total, message) => {
21
+ log.info(`[${number}/${total}] ${message}`);
22
+ }
23
+ };
24
+
25
+ export { logger as l };
@@ -0,0 +1,7 @@
1
+ function generateRunId() {
2
+ const ts = Date.now().toString(36);
3
+ const rand = Math.random().toString(36).slice(2, 10);
4
+ return `run_${ts}_${rand}`;
5
+ }
6
+
7
+ export { generateRunId as g };
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@alecsibilia/luca",
3
+ "description": "Luca — spec-driven agentic development workflow for Claude Code (umbrella; bundles luca-cli, luca-core, luca-tools)",
4
+ "version": "13.0.0-alpha.1",
5
+ "license": "Apache-2.0",
6
+ "author": "Alec Sibilia <sibilia.alec@gmail.com>",
7
+ "homepage": "https://github.com/asibilia/luca-framework#readme",
8
+ "bugs": {
9
+ "url": "https://github.com/asibilia/luca-framework/issues"
10
+ },
11
+ "engines": {
12
+ "bun": ">=1.0.0"
13
+ },
14
+ "bin": {
15
+ "luca": "./bin/luca.js"
16
+ },
17
+ "dependencies": {
18
+ "@clack/prompts": "^1.0.0",
19
+ "citty": "^0.2.0",
20
+ "consola": "^3.4.0",
21
+ "pathe": "^2.0.3",
22
+ "semver": "^7.6.0",
23
+ "shell-quote": "^1.8.3",
24
+ "update-notifier": "^7.3.1",
25
+ "zod": "^4.3.6"
26
+ },
27
+ "devDependencies": {
28
+ "@alecsibilia/luca-cli": "0.1.0",
29
+ "@alecsibilia/luca-core": "0.1.0",
30
+ "@alecsibilia/luca-tools": "0.1.0",
31
+ "@types/bun": "latest",
32
+ "@types/semver": "^7.5.8",
33
+ "@types/shell-quote": "^1.7.5",
34
+ "@types/update-notifier": "^6.0.8",
35
+ "typescript": "^5.0.0",
36
+ "unbuild": "^3.5.0"
37
+ },
38
+ "exports": {
39
+ ".": {
40
+ "types": "./dist/index.d.mts",
41
+ "import": "./dist/index.mjs"
42
+ }
43
+ },
44
+ "files": [
45
+ "bin",
46
+ "dist",
47
+ "README.md",
48
+ "LICENSE"
49
+ ],
50
+ "keywords": [
51
+ "agent",
52
+ "ai",
53
+ "cli",
54
+ "claude-code",
55
+ "luca",
56
+ "muninndb",
57
+ "workflow",
58
+ "spec-driven"
59
+ ],
60
+ "module": "./dist/index.mjs",
61
+ "publishConfig": {
62
+ "access": "public"
63
+ },
64
+ "repository": {
65
+ "type": "git",
66
+ "url": "https://github.com/asibilia/luca-framework.git",
67
+ "directory": "packages/luca"
68
+ },
69
+ "scripts": {
70
+ "build": "unbuild",
71
+ "prepublishOnly": "bun run build",
72
+ "typecheck": "bunx --bun tsc --noEmit"
73
+ },
74
+ "type": "module",
75
+ "types": "./dist/index.d.mts"
76
+ }