@3lineas/grooveskills 1.1.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +110 -83
- package/dist/chunk-FN4OEDVV.js +949 -0
- package/dist/chunk-FN4OEDVV.js.map +1 -0
- package/dist/cli.js +4 -3
- package/dist/cli.js.map +1 -1
- package/dist/main.d.ts +3 -0
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/skills/clean-architecture-ddd/SKILL.md +103 -0
- package/skills/error-handling-logging/SKILL.md +105 -0
- package/skills/error-handling-logging/templates/app-error.template.md +44 -0
- package/skills/error-handling-logging/templates/logger.template.md +41 -0
- package/skills/groove-harness/SKILL.md +14 -14
- package/skills/odd-ai/SKILL.md +64 -0
- package/skills/odd-ai/references/odd-protocol-examples.md +57 -0
- package/skills/python-clean/SKILL.md +113 -0
- package/skills/python-clean/references/python-tooling-and-types.md +78 -0
- package/skills/rust-clean/SKILL.md +119 -0
- package/skills/rust-clean/references/rust-error-and-clippy.md +92 -0
- package/skills/testing-vitest/SKILL.md +109 -0
- package/skills/typescript-clean/SKILL.md +111 -0
- package/skills/typescript-clean/references/js-ts-antipatterns.md +91 -0
- package/skills/ux-writing/SKILL.md +103 -0
- package/skills/ux-writing/references/copy-patterns-es-en.md +54 -0
- package/skills/valibot-validation/SKILL.md +102 -0
- package/dist/chunk-5Q6O3BRA.js +0 -737
- package/dist/chunk-5Q6O3BRA.js.map +0 -1
|
@@ -0,0 +1,949 @@
|
|
|
1
|
+
// src/domains/detector/project-detector.ts
|
|
2
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
3
|
+
import { join as join2 } from "path";
|
|
4
|
+
|
|
5
|
+
// src/domains/detector/detect-agents.ts
|
|
6
|
+
import { readdirSync } from "fs";
|
|
7
|
+
function detectAgents(targetPath) {
|
|
8
|
+
const detected = [];
|
|
9
|
+
try {
|
|
10
|
+
const entries = new Set(readdirSync(targetPath));
|
|
11
|
+
if (entries.has(".agents")) {
|
|
12
|
+
detected.push("antigravity");
|
|
13
|
+
}
|
|
14
|
+
if (entries.has(".claude")) {
|
|
15
|
+
detected.push("claude");
|
|
16
|
+
}
|
|
17
|
+
if (entries.has(".cursor")) {
|
|
18
|
+
detected.push("cursor");
|
|
19
|
+
}
|
|
20
|
+
if (entries.has(".gemini")) {
|
|
21
|
+
detected.push("gemini");
|
|
22
|
+
}
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
return detected;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/domains/detector/detect-dependencies.ts
|
|
29
|
+
import { readFileSync, existsSync } from "fs";
|
|
30
|
+
import { join } from "path";
|
|
31
|
+
function detectDependencies(targetPath) {
|
|
32
|
+
const detected = /* @__PURE__ */ new Set();
|
|
33
|
+
let hasManifest = false;
|
|
34
|
+
const packageJsonPath = join(targetPath, "package.json");
|
|
35
|
+
if (existsSync(packageJsonPath)) {
|
|
36
|
+
hasManifest = true;
|
|
37
|
+
try {
|
|
38
|
+
const raw = readFileSync(packageJsonPath, "utf-8");
|
|
39
|
+
const parsed = JSON.parse(raw);
|
|
40
|
+
for (const dep of Object.keys(parsed.dependencies ?? {})) {
|
|
41
|
+
detected.add(dep);
|
|
42
|
+
}
|
|
43
|
+
for (const dep of Object.keys(parsed.devDependencies ?? {})) {
|
|
44
|
+
detected.add(dep);
|
|
45
|
+
}
|
|
46
|
+
} catch {
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const cargoPath = join(targetPath, "Cargo.toml");
|
|
50
|
+
if (existsSync(cargoPath)) {
|
|
51
|
+
hasManifest = true;
|
|
52
|
+
detected.add("rust");
|
|
53
|
+
}
|
|
54
|
+
const pyprojectPath = join(targetPath, "pyproject.toml");
|
|
55
|
+
const requirementsPath = join(targetPath, "requirements.txt");
|
|
56
|
+
if (existsSync(pyprojectPath) || existsSync(requirementsPath)) {
|
|
57
|
+
hasManifest = true;
|
|
58
|
+
detected.add("python");
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
dependencies: Array.from(detected),
|
|
62
|
+
exists: hasManifest
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// src/domains/registry/skill-catalog.ts
|
|
67
|
+
var SKILL_CATALOG = [
|
|
68
|
+
{
|
|
69
|
+
id: "groove-harness",
|
|
70
|
+
name: "GrooveSkills Harness",
|
|
71
|
+
description: "Lightweight project harness, context memory, and ODD 3-lane task execution (Answer, Task, Spec) for AI coding agents",
|
|
72
|
+
dependencies: [],
|
|
73
|
+
directoryName: "groove-harness"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "odd-ai",
|
|
77
|
+
name: "Organic & Outcome-Driven Development (ODD)",
|
|
78
|
+
description: "7-step ODD protocol for AI agents: authorize, explore, classify, outcome hypotheses, and verifiable evidence receipts",
|
|
79
|
+
dependencies: [],
|
|
80
|
+
directoryName: "odd-ai"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: "best-practices",
|
|
84
|
+
name: "Universal Best Practices",
|
|
85
|
+
description: "Multi-language clean code standards, early returns, no barrel files, strict typing, <200 lines",
|
|
86
|
+
dependencies: [],
|
|
87
|
+
directoryName: "best-practices"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "ux-writing",
|
|
91
|
+
name: "UX Writing & Microcopy Standards",
|
|
92
|
+
description: "Persuasive, empathetic, professional bilingual microcopy (ES/EN) for error messages, forms, CTAs, toasts, and empty states",
|
|
93
|
+
dependencies: [],
|
|
94
|
+
directoryName: "ux-writing"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "typescript-clean",
|
|
98
|
+
name: "TypeScript Clean Code (TS 5.5+)",
|
|
99
|
+
description: "Advanced strict TypeScript, discriminated unions, satisfies, const generics, unknown over any, and zero unsafe casts",
|
|
100
|
+
dependencies: ["typescript"],
|
|
101
|
+
directoryName: "typescript-clean"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "rust-clean",
|
|
105
|
+
name: "Rust Clean Code (Rust 2024)",
|
|
106
|
+
description: "Idiomatic Rust clean code: let-else guard clauses, no unwrap in production, thiserror typed errors, Newtypes, zero barrel files, <200 lines",
|
|
107
|
+
dependencies: ["rust"],
|
|
108
|
+
directoryName: "rust-clean"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "python-clean",
|
|
112
|
+
name: "Python Clean Code (Python 3.12+)",
|
|
113
|
+
description: "Modern Python standards: guard clauses (no nested ifs), strict typing (zero Any), uv, Ruff, Pyright, Pydantic v2 boundaries, <200 lines",
|
|
114
|
+
dependencies: ["python"],
|
|
115
|
+
directoryName: "python-clean"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: "error-handling-logging",
|
|
119
|
+
name: "Error Handling & Structured Logging",
|
|
120
|
+
description: "Deterministic error management with AppError, Result/ActionResponse contracts, and structured context logging",
|
|
121
|
+
dependencies: [],
|
|
122
|
+
directoryName: "error-handling-logging"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: "valibot-validation",
|
|
126
|
+
name: "Valibot Schema Validation",
|
|
127
|
+
description: "Boundary schema validation with Valibot (* as v from 'valibot'), strict type inference, and friendly error messages",
|
|
128
|
+
dependencies: ["valibot"],
|
|
129
|
+
directoryName: "valibot-validation"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: "clean-architecture-ddd",
|
|
133
|
+
name: "Clean Architecture & DDD",
|
|
134
|
+
description: "Domain-driven design, isolated single-purpose Actions, pure functions, immutability, zero barrel files, <200 lines per file",
|
|
135
|
+
dependencies: [],
|
|
136
|
+
directoryName: "clean-architecture-ddd"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: "testing-vitest",
|
|
140
|
+
name: "Vitest Testing Standards",
|
|
141
|
+
description: "Clean unit and integration testing with Vitest: AAA pattern, behavioral testing over mocks, and boundary edge cases",
|
|
142
|
+
dependencies: ["vitest"],
|
|
143
|
+
directoryName: "testing-vitest"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: "hono",
|
|
147
|
+
name: "Hono Architecture (Valibot)",
|
|
148
|
+
description: "Enterprise Hono API standard with Valibot validation, isolated Actions layer, and RPC bindings",
|
|
149
|
+
dependencies: ["hono", "@hono/valibot-validator", "@hono/standard-validator"],
|
|
150
|
+
directoryName: "hono"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: "react-core",
|
|
154
|
+
name: "React Core Fundamentals",
|
|
155
|
+
description: "Opinionated React fundamentals: function components, JSX, immutable state, core hooks, lists, and controlled inputs",
|
|
156
|
+
dependencies: ["react", "react-dom"],
|
|
157
|
+
directoryName: "react-core"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: "react-advanced",
|
|
161
|
+
name: "React 19 Advanced & Compiler Architecture",
|
|
162
|
+
description: "Modern React 19 platform features: React Compiler auto-memoization, concurrent rendering, use(), Actions, virtualization, and RSC boundaries",
|
|
163
|
+
dependencies: ["react", "react-dom"],
|
|
164
|
+
directoryName: "react-advanced"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: "react-create-page",
|
|
168
|
+
name: "React Page & View Architecture",
|
|
169
|
+
description: "Clean architecture for React pages: declarative page coordinators, domain hooks, isolated API actions, Valibot + Formisch forms, and atomic co-location",
|
|
170
|
+
dependencies: ["react", "react-dom"],
|
|
171
|
+
directoryName: "react-create-page"
|
|
172
|
+
}
|
|
173
|
+
];
|
|
174
|
+
|
|
175
|
+
// src/domains/detector/project-detector.ts
|
|
176
|
+
function readConfiguredLanguage(targetPath) {
|
|
177
|
+
const configPath = join2(targetPath, ".grooveskills", "config.json");
|
|
178
|
+
if (!existsSync2(configPath)) {
|
|
179
|
+
return void 0;
|
|
180
|
+
}
|
|
181
|
+
try {
|
|
182
|
+
const raw = readFileSync2(configPath, "utf-8");
|
|
183
|
+
const parsed = JSON.parse(raw);
|
|
184
|
+
return typeof parsed.language === "string" ? parsed.language : void 0;
|
|
185
|
+
} catch {
|
|
186
|
+
return void 0;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function detectProjectContext(targetPath) {
|
|
190
|
+
const detectedAgents = detectAgents(targetPath);
|
|
191
|
+
const { dependencies, exists } = detectDependencies(targetPath);
|
|
192
|
+
const suggestedSkillIds = [
|
|
193
|
+
"odd-ai",
|
|
194
|
+
"best-practices",
|
|
195
|
+
"ux-writing",
|
|
196
|
+
"error-handling-logging",
|
|
197
|
+
"clean-architecture-ddd"
|
|
198
|
+
];
|
|
199
|
+
for (const skill of SKILL_CATALOG) {
|
|
200
|
+
if (skill.dependencies.length === 0) {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
const hasMatch = skill.dependencies.some((dep) => dependencies.includes(dep));
|
|
204
|
+
if (hasMatch && !suggestedSkillIds.includes(skill.id)) {
|
|
205
|
+
suggestedSkillIds.push(skill.id);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const harnessExists = existsSync2(join2(targetPath, ".grooveskills", "memory", "context.md"));
|
|
209
|
+
const configuredLanguage = readConfiguredLanguage(targetPath);
|
|
210
|
+
return {
|
|
211
|
+
targetPath,
|
|
212
|
+
detectedDependencies: dependencies,
|
|
213
|
+
suggestedSkillIds,
|
|
214
|
+
detectedAgents,
|
|
215
|
+
packageJsonExists: exists,
|
|
216
|
+
harnessExists,
|
|
217
|
+
configuredLanguage
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// src/domains/ui/ui-orchestrator.ts
|
|
222
|
+
import * as p5 from "@clack/prompts";
|
|
223
|
+
import pc2 from "picocolors";
|
|
224
|
+
|
|
225
|
+
// src/domains/ui/banners.ts
|
|
226
|
+
import pc from "picocolors";
|
|
227
|
+
function renderBanner() {
|
|
228
|
+
const title = pc.bold(pc.white(" GROOVE SKILLS "));
|
|
229
|
+
const badge = pc.bgMagenta(pc.black(title));
|
|
230
|
+
const subtitle = pc.dim("Multi-Agent AI Skills & Architectural Standards");
|
|
231
|
+
return `${badge} ${subtitle}
|
|
232
|
+
`;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// src/domains/ui/prompt-skills.ts
|
|
236
|
+
import * as p from "@clack/prompts";
|
|
237
|
+
async function promptSkills(suggestedSkillIds) {
|
|
238
|
+
const options = SKILL_CATALOG.map((skill) => {
|
|
239
|
+
const isSuggested = suggestedSkillIds.includes(skill.id);
|
|
240
|
+
return {
|
|
241
|
+
value: skill.id,
|
|
242
|
+
label: skill.name,
|
|
243
|
+
hint: isSuggested ? "Suggested based on your project stack" : skill.description
|
|
244
|
+
};
|
|
245
|
+
});
|
|
246
|
+
const selected = await p.multiselect({
|
|
247
|
+
message: "Which skills would you like to install in this project?",
|
|
248
|
+
options,
|
|
249
|
+
initialValues: suggestedSkillIds,
|
|
250
|
+
required: true
|
|
251
|
+
});
|
|
252
|
+
return selected;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// src/domains/ui/prompt-agents.ts
|
|
256
|
+
import * as p2 from "@clack/prompts";
|
|
257
|
+
async function promptAgents(detectedAgents) {
|
|
258
|
+
const options = [
|
|
259
|
+
{ value: "antigravity", label: "Antigravity", hint: ".agents/skills (Google Agentic IDE)" },
|
|
260
|
+
{ value: "claude", label: "Claude Code", hint: ".claude/skills (Anthropic Claude Code)" },
|
|
261
|
+
{ value: "cursor", label: "Cursor", hint: ".cursor/rules/*.mdc (Cursor IDE Rules)" },
|
|
262
|
+
{ value: "gemini", label: "Gemini Code Assist", hint: ".gemini/skills (Google Gemini)" }
|
|
263
|
+
];
|
|
264
|
+
const initialValues = detectedAgents.length > 0 ? detectedAgents : ["antigravity"];
|
|
265
|
+
const selected = await p2.multiselect({
|
|
266
|
+
message: "Which AI agents should be configured?",
|
|
267
|
+
options,
|
|
268
|
+
initialValues,
|
|
269
|
+
required: true
|
|
270
|
+
});
|
|
271
|
+
return selected;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// src/domains/ui/prompt-language.ts
|
|
275
|
+
import * as p3 from "@clack/prompts";
|
|
276
|
+
async function promptLanguage(defaultLanguage = "es") {
|
|
277
|
+
const options = [
|
|
278
|
+
{ value: "es", label: "Espa\xF1ol (Spanish)", hint: "Recomendado para proyectos en espa\xF1ol" },
|
|
279
|
+
{ value: "en", label: "English", hint: "Standard international English" },
|
|
280
|
+
{ value: "pt", label: "Portugu\xEAs (Portuguese)", hint: "Portugu\xEAs para o Brasil e Portugal" },
|
|
281
|
+
{ value: "it", label: "Italiano (Italian)", hint: "Comunicazione in lingua italiana" },
|
|
282
|
+
{ value: "fr", label: "Fran\xE7ais (French)", hint: "Communication en langue fran\xE7aise" }
|
|
283
|
+
];
|
|
284
|
+
const selected = await p3.select({
|
|
285
|
+
message: "Which language should AI agents use for user-facing copy and communication?",
|
|
286
|
+
options,
|
|
287
|
+
initialValue: defaultLanguage
|
|
288
|
+
});
|
|
289
|
+
return selected;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// src/domains/ui/prompt-confirm-overwrite.ts
|
|
293
|
+
import * as p4 from "@clack/prompts";
|
|
294
|
+
async function promptConfirmOverwrite() {
|
|
295
|
+
return await p4.confirm({
|
|
296
|
+
message: "Some skills already exist in this project. Would you like to overwrite them with the latest version?",
|
|
297
|
+
initialValue: true
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// src/domains/installer/verify-skill-exists.ts
|
|
302
|
+
import { lstatSync } from "fs";
|
|
303
|
+
import { join as join3 } from "path";
|
|
304
|
+
var AGENT_DESTINATION_MAP = {
|
|
305
|
+
antigravity: (dir) => join3(".agents", "skills", dir),
|
|
306
|
+
claude: (dir) => join3(".claude", "skills", dir),
|
|
307
|
+
cursor: (dir) => join3(".cursor", "rules", `${dir}.mdc`),
|
|
308
|
+
gemini: (dir) => join3(".gemini", "skills", dir)
|
|
309
|
+
};
|
|
310
|
+
function verifySkillExists(targetPath, skillDirectoryName, agents) {
|
|
311
|
+
for (const agent of agents) {
|
|
312
|
+
const relativePathResolver = AGENT_DESTINATION_MAP[agent];
|
|
313
|
+
const destination = join3(targetPath, relativePathResolver(skillDirectoryName));
|
|
314
|
+
try {
|
|
315
|
+
lstatSync(destination);
|
|
316
|
+
return true;
|
|
317
|
+
} catch {
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// src/domains/installer/install-orchestrator.ts
|
|
324
|
+
import { join as join10 } from "path";
|
|
325
|
+
|
|
326
|
+
// src/domains/adapters/skill-reference-builder.ts
|
|
327
|
+
import { existsSync as existsSync3, lstatSync as lstatSync2, mkdirSync, readFileSync as readFileSync3, rmSync, unlinkSync, writeFileSync } from "fs";
|
|
328
|
+
import { join as join5 } from "path";
|
|
329
|
+
|
|
330
|
+
// src/domains/project-store/project-paths.ts
|
|
331
|
+
import { join as join4 } from "path";
|
|
332
|
+
function getProjectStoreDir(targetPath) {
|
|
333
|
+
return join4(targetPath, ".grooveskills");
|
|
334
|
+
}
|
|
335
|
+
function getProjectSkillsDir(targetPath) {
|
|
336
|
+
return join4(getProjectStoreDir(targetPath), "skills");
|
|
337
|
+
}
|
|
338
|
+
function getProjectMemoryDir(targetPath) {
|
|
339
|
+
return join4(getProjectStoreDir(targetPath), "memory");
|
|
340
|
+
}
|
|
341
|
+
function getProjectTasksDir(targetPath) {
|
|
342
|
+
return join4(getProjectMemoryDir(targetPath), "tasks");
|
|
343
|
+
}
|
|
344
|
+
function getProjectConfigPath(targetPath) {
|
|
345
|
+
return join4(getProjectStoreDir(targetPath), "config.json");
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// src/domains/adapters/skill-reference-builder.ts
|
|
349
|
+
function removeExistingPathSafely(path) {
|
|
350
|
+
const fileExists = existsSync3(path);
|
|
351
|
+
if (!fileExists) {
|
|
352
|
+
try {
|
|
353
|
+
const lstat = lstatSync2(path);
|
|
354
|
+
if (lstat.isSymbolicLink()) {
|
|
355
|
+
unlinkSync(path);
|
|
356
|
+
}
|
|
357
|
+
} catch {
|
|
358
|
+
}
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
try {
|
|
362
|
+
const lstat = lstatSync2(path);
|
|
363
|
+
if (lstat.isSymbolicLink()) {
|
|
364
|
+
unlinkSync(path);
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
if (lstat.isDirectory()) {
|
|
368
|
+
rmSync(path, { recursive: true, force: true });
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
unlinkSync(path);
|
|
372
|
+
} catch {
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function extractSkillDescription(canonicalSkillMdPath, fallback) {
|
|
376
|
+
if (!existsSync3(canonicalSkillMdPath)) {
|
|
377
|
+
return fallback;
|
|
378
|
+
}
|
|
379
|
+
try {
|
|
380
|
+
const content = readFileSync3(canonicalSkillMdPath, "utf-8");
|
|
381
|
+
const match = content.match(/^description:\s*(.+)$/m);
|
|
382
|
+
const hasMatchedDesc = Boolean(match && match[1]);
|
|
383
|
+
if (hasMatchedDesc && match?.[1]) {
|
|
384
|
+
return match[1].trim();
|
|
385
|
+
}
|
|
386
|
+
} catch {
|
|
387
|
+
}
|
|
388
|
+
return fallback;
|
|
389
|
+
}
|
|
390
|
+
function writeAgentSkillReference(targetPath, agentRelativeSkillsDir, skill) {
|
|
391
|
+
const agentSkillFolder = join5(targetPath, agentRelativeSkillsDir, skill.directoryName);
|
|
392
|
+
removeExistingPathSafely(agentSkillFolder);
|
|
393
|
+
mkdirSync(agentSkillFolder, { recursive: true });
|
|
394
|
+
const canonicalSkillMd = join5(getProjectSkillsDir(targetPath), skill.directoryName, "SKILL.md");
|
|
395
|
+
const description = extractSkillDescription(canonicalSkillMd, skill.description);
|
|
396
|
+
const referenceContent = `---
|
|
397
|
+
name: ${skill.id}
|
|
398
|
+
description: ${description}
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
# ${skill.name} \u2014 Skill Reference
|
|
402
|
+
|
|
403
|
+
Canonical skill specification stored in \`.grooveskills/\`.
|
|
404
|
+
|
|
405
|
+
- **Specification**: [\`.grooveskills/skills/${skill.directoryName}/SKILL.md\`](../../../.grooveskills/skills/${skill.directoryName}/SKILL.md)
|
|
406
|
+
- **References & Templates**: \`.grooveskills/skills/${skill.directoryName}/\`
|
|
407
|
+
|
|
408
|
+
> **Instruction**: Read \`.grooveskills/skills/${skill.directoryName}/SKILL.md\` before executing tasks matching this skill.
|
|
409
|
+
`;
|
|
410
|
+
const targetFile = join5(agentSkillFolder, "SKILL.md");
|
|
411
|
+
writeFileSync(targetFile, referenceContent, "utf-8");
|
|
412
|
+
return targetFile;
|
|
413
|
+
}
|
|
414
|
+
function writeCursorRuleReference(targetPath, cursorRelativeRulesDir, skill) {
|
|
415
|
+
const rulesDir = join5(targetPath, cursorRelativeRulesDir);
|
|
416
|
+
if (!existsSync3(rulesDir)) {
|
|
417
|
+
mkdirSync(rulesDir, { recursive: true });
|
|
418
|
+
}
|
|
419
|
+
const targetFile = join5(rulesDir, `${skill.id}.mdc`);
|
|
420
|
+
removeExistingPathSafely(targetFile);
|
|
421
|
+
const canonicalSkillMd = join5(getProjectSkillsDir(targetPath), skill.directoryName, "SKILL.md");
|
|
422
|
+
const description = extractSkillDescription(canonicalSkillMd, skill.description);
|
|
423
|
+
const referenceContent = `---
|
|
424
|
+
description: ${description}
|
|
425
|
+
globs: ["**/*"]
|
|
426
|
+
alwaysApply: false
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
# ${skill.name} \u2014 Rule Reference
|
|
430
|
+
|
|
431
|
+
Canonical rule specification stored in \`.grooveskills/\`.
|
|
432
|
+
|
|
433
|
+
- **Specification**: \`.grooveskills/skills/${skill.directoryName}/SKILL.md\`
|
|
434
|
+
- **References & Templates**: \`.grooveskills/skills/${skill.directoryName}/\`
|
|
435
|
+
|
|
436
|
+
> **Instruction**: Read \`.grooveskills/skills/${skill.directoryName}/SKILL.md\` before executing tasks matching this rule.
|
|
437
|
+
`;
|
|
438
|
+
writeFileSync(targetFile, referenceContent, "utf-8");
|
|
439
|
+
return targetFile;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// src/domains/adapters/antigravity.adapter.ts
|
|
443
|
+
var AntigravityAdapter = class {
|
|
444
|
+
id = "antigravity";
|
|
445
|
+
name = "Antigravity";
|
|
446
|
+
targetRelativeDir = ".agents/skills";
|
|
447
|
+
async installSkill(targetPath, skill, _skillSourceDir) {
|
|
448
|
+
const file = writeAgentSkillReference(targetPath, this.targetRelativeDir, skill);
|
|
449
|
+
return [file];
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
// src/domains/adapters/claude.adapter.ts
|
|
454
|
+
var ClaudeAdapter = class {
|
|
455
|
+
id = "claude";
|
|
456
|
+
name = "Claude Code";
|
|
457
|
+
targetRelativeDir = ".claude/skills";
|
|
458
|
+
async installSkill(targetPath, skill, _skillSourceDir) {
|
|
459
|
+
const file = writeAgentSkillReference(targetPath, this.targetRelativeDir, skill);
|
|
460
|
+
return [file];
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
// src/domains/adapters/cursor.adapter.ts
|
|
465
|
+
var CursorAdapter = class {
|
|
466
|
+
id = "cursor";
|
|
467
|
+
name = "Cursor";
|
|
468
|
+
targetRelativeDir = ".cursor/rules";
|
|
469
|
+
async installSkill(targetPath, skill, _skillSourceDir) {
|
|
470
|
+
const file = writeCursorRuleReference(targetPath, this.targetRelativeDir, skill);
|
|
471
|
+
return [file];
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
// src/domains/adapters/gemini.adapter.ts
|
|
476
|
+
var GeminiAdapter = class {
|
|
477
|
+
id = "gemini";
|
|
478
|
+
name = "Gemini Code Assist";
|
|
479
|
+
targetRelativeDir = ".gemini/skills";
|
|
480
|
+
async installSkill(targetPath, skill, _skillSourceDir) {
|
|
481
|
+
const file = writeAgentSkillReference(targetPath, this.targetRelativeDir, skill);
|
|
482
|
+
return [file];
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
// src/domains/project-store/sync-project-store.ts
|
|
487
|
+
import { cpSync, existsSync as existsSync5, mkdirSync as mkdirSync2, rmSync as rmSync2 } from "fs";
|
|
488
|
+
import { join as join7 } from "path";
|
|
489
|
+
|
|
490
|
+
// src/domains/installer/resolve-skills-source.ts
|
|
491
|
+
import { fileURLToPath } from "url";
|
|
492
|
+
import { dirname, resolve, join as join6 } from "path";
|
|
493
|
+
import { existsSync as existsSync4 } from "fs";
|
|
494
|
+
function resolveSkillsSourceRoot() {
|
|
495
|
+
const currentFilePath = fileURLToPath(import.meta.url);
|
|
496
|
+
const currentDir = dirname(currentFilePath);
|
|
497
|
+
const candidateFromDist = resolve(currentDir, "../skills");
|
|
498
|
+
if (existsSync4(candidateFromDist)) {
|
|
499
|
+
return candidateFromDist;
|
|
500
|
+
}
|
|
501
|
+
const candidateFromSrc = resolve(currentDir, "../../../skills");
|
|
502
|
+
if (existsSync4(candidateFromSrc)) {
|
|
503
|
+
return candidateFromSrc;
|
|
504
|
+
}
|
|
505
|
+
let searchDir = currentDir;
|
|
506
|
+
for (let i = 0; i < 5; i++) {
|
|
507
|
+
const candidate = join6(searchDir, "skills");
|
|
508
|
+
if (existsSync4(candidate)) {
|
|
509
|
+
return candidate;
|
|
510
|
+
}
|
|
511
|
+
const parent = dirname(searchDir);
|
|
512
|
+
if (parent === searchDir) {
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
searchDir = parent;
|
|
516
|
+
}
|
|
517
|
+
throw new Error(
|
|
518
|
+
`GrooveSkills internal error: Unable to locate bundled skills directory from ${currentDir}`
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// src/domains/project-store/sync-project-store.ts
|
|
523
|
+
function syncProjectStore(targetPath, selectedSkillIds, _selectedAgents) {
|
|
524
|
+
const bundledSkillsDir = resolveSkillsSourceRoot();
|
|
525
|
+
const projectSkillsDir = getProjectSkillsDir(targetPath);
|
|
526
|
+
if (!existsSync5(projectSkillsDir)) {
|
|
527
|
+
mkdirSync2(projectSkillsDir, { recursive: true });
|
|
528
|
+
}
|
|
529
|
+
const legacyCursorRules = join7(targetPath, ".grooveskills", "cursor-rules");
|
|
530
|
+
if (existsSync5(legacyCursorRules)) {
|
|
531
|
+
try {
|
|
532
|
+
rmSync2(legacyCursorRules, { recursive: true, force: true });
|
|
533
|
+
} catch {
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
for (const skillId of selectedSkillIds) {
|
|
537
|
+
const skill = SKILL_CATALOG.find((item) => item.id === skillId);
|
|
538
|
+
if (!skill) {
|
|
539
|
+
continue;
|
|
540
|
+
}
|
|
541
|
+
const sourceSkillDir = join7(bundledSkillsDir, skill.directoryName);
|
|
542
|
+
const destSkillDir = join7(projectSkillsDir, skill.directoryName);
|
|
543
|
+
if (existsSync5(sourceSkillDir)) {
|
|
544
|
+
cpSync(sourceSkillDir, destSkillDir, { recursive: true });
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// src/domains/harness/install-harness.ts
|
|
550
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
551
|
+
import { join as join9 } from "path";
|
|
552
|
+
|
|
553
|
+
// src/domains/harness/harness-languages.ts
|
|
554
|
+
var SUPPORTED_LANGUAGES = {
|
|
555
|
+
es: {
|
|
556
|
+
code: "es",
|
|
557
|
+
name: "Spanish",
|
|
558
|
+
nativeName: "Espa\xF1ol",
|
|
559
|
+
instruction: "Todos los mensajes, validaciones, errores, CTAs y comunicaciones con el usuario deben redactarse estrictamente en Espa\xF1ol. El tono debe ser emp\xE1tico, amable, persuasivo y profesional."
|
|
560
|
+
},
|
|
561
|
+
en: {
|
|
562
|
+
code: "en",
|
|
563
|
+
name: "English",
|
|
564
|
+
nativeName: "English",
|
|
565
|
+
instruction: "All user-facing messages, form validations, errors, CTAs, and notifications must be written strictly in English. Tone must be empathetic, friendly, persuasive, and professional."
|
|
566
|
+
},
|
|
567
|
+
pt: {
|
|
568
|
+
code: "pt",
|
|
569
|
+
name: "Portuguese",
|
|
570
|
+
nativeName: "Portugu\xEAs",
|
|
571
|
+
instruction: "Todas as mensagens, valida\xE7\xF5es, erros, CTAs e comunica\xE7\xF5es voltadas para o usu\xE1rio devem ser redigidas estritamente em Portugu\xEAs. O tom deve ser emp\xE1tico, amig\xE1vel, persuasivo e profissional."
|
|
572
|
+
},
|
|
573
|
+
it: {
|
|
574
|
+
code: "it",
|
|
575
|
+
name: "Italian",
|
|
576
|
+
nativeName: "Italiano",
|
|
577
|
+
instruction: "Tutti i messaggi, le convalide, gli errori, i pulsanti/CTA e le comunicazioni rivolte all'utente devono essere scritti rigorosamente in Italiano. Il tono deve essere empatico, cordiale, persuasivo e professionale."
|
|
578
|
+
},
|
|
579
|
+
fr: {
|
|
580
|
+
code: "fr",
|
|
581
|
+
name: "French",
|
|
582
|
+
nativeName: "Fran\xE7ais",
|
|
583
|
+
instruction: "Tous les messages, validations, erreurs, boutons d'appel \xE0 l'action (CTA) et notifications destin\xE9s \xE0 l'utilisateur doivent \xEAtre r\xE9dig\xE9s strictement en Fran\xE7ais. Le ton doit \xEAtre empathique, courtois, persuasif et professionnel."
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
// src/domains/harness/harness-templates.ts
|
|
588
|
+
function buildContextTemplate(detectedDependencies, language = "es") {
|
|
589
|
+
const depsFormatted = detectedDependencies.length > 0 ? detectedDependencies.map((d) => `- \`${d}\``).join("\n") : "- (No external dependencies detected)";
|
|
590
|
+
const langConfig = SUPPORTED_LANGUAGES[language];
|
|
591
|
+
return `# Project Context & Architecture
|
|
592
|
+
|
|
593
|
+
This file provides AI agents with instant architectural orientation for this project.
|
|
594
|
+
|
|
595
|
+
## 1. Stack & Dependencies
|
|
596
|
+
${depsFormatted}
|
|
597
|
+
|
|
598
|
+
## 2. Directory Structure Conventions
|
|
599
|
+
- Follow single-responsibility per file (<200 lines).
|
|
600
|
+
- Maintain direct imports with path aliases; avoid barrel files.
|
|
601
|
+
- Keep domain boundaries explicit and clean.
|
|
602
|
+
|
|
603
|
+
## 3. Communication & User Copy Language
|
|
604
|
+
- **Configured Language**: ${langConfig.nativeName} (\`${language}\`).
|
|
605
|
+
- **Policy**: ${langConfig.instruction}
|
|
606
|
+
|
|
607
|
+
## 4. Essential Commands
|
|
608
|
+
- Build: Refer to \`package.json\` scripts.
|
|
609
|
+
- Typecheck: Refer to TypeScript configuration.
|
|
610
|
+
- Tests: Refer to test runner configuration.
|
|
611
|
+
`;
|
|
612
|
+
}
|
|
613
|
+
function buildDecisionsTemplate(language = "es") {
|
|
614
|
+
const now = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
615
|
+
const langConfig = SUPPORTED_LANGUAGES[language];
|
|
616
|
+
return `# Architecture Decision Records (ADR)
|
|
617
|
+
|
|
618
|
+
An append-only log of significant technical and architectural choices.
|
|
619
|
+
|
|
620
|
+
| Date | Title | Decision | Reason & Consequences |
|
|
621
|
+
| :--- | :--- | :--- | :--- |
|
|
622
|
+
| ${now} | Adopt GrooveSkills Harness | Initialized \`.grooveskills/\` control plane with ODD | Clean, encapsulated agent memory, 3-lane ODD flow, and ${langConfig.nativeName} copy standard |
|
|
623
|
+
`;
|
|
624
|
+
}
|
|
625
|
+
function buildTaskTemplate() {
|
|
626
|
+
return `---
|
|
627
|
+
status: in-progress
|
|
628
|
+
createdAt: \${CURRENT_DATE}
|
|
629
|
+
---
|
|
630
|
+
|
|
631
|
+
# Feature / Task Title
|
|
632
|
+
|
|
633
|
+
## Outcome Hypothesis
|
|
634
|
+
Describe the expected behavioral outcome:
|
|
635
|
+
By [Output / Technical Change], [Outcome / Verifiable Behavior] will occur, proven by [Evidence / Test / Build Command].
|
|
636
|
+
|
|
637
|
+
## Scope
|
|
638
|
+
- In scope:
|
|
639
|
+
- Out of scope:
|
|
640
|
+
|
|
641
|
+
## Checklist
|
|
642
|
+
- [ ] Task 1: (Define expected observed proof)
|
|
643
|
+
- [ ] Task 2: (Define expected observed proof)
|
|
644
|
+
|
|
645
|
+
## Evidence
|
|
646
|
+
- Observed test/typecheck/build commands or runtime outputs proving completion.
|
|
647
|
+
|
|
648
|
+
## Next
|
|
649
|
+
- Next concrete step if interrupted.
|
|
650
|
+
`;
|
|
651
|
+
}
|
|
652
|
+
function buildAgentHarnessBlock(language = "es") {
|
|
653
|
+
const langConfig = SUPPORTED_LANGUAGES[language];
|
|
654
|
+
return `<!-- grooveskills:harness:start -->
|
|
655
|
+
# GrooveSkills Harness \u2014 Agent Rules & Memory
|
|
656
|
+
|
|
657
|
+
This project uses the **GrooveSkills Harness** located in \`.grooveskills/\`.
|
|
658
|
+
|
|
659
|
+
## 1. Three-Lane ODD Protocol
|
|
660
|
+
- **Authorize & Explore**: Follow the 7-step ODD protocol (Authorize, Explore, Resolve, Classify, Track & Hypothesize, Execute, Verify).
|
|
661
|
+
- **Lane 1 (Answer)**: Explanations, audits, or questions. Read-only; write zero code.
|
|
662
|
+
- **Lane 2 (Task)**: Direct implementation. Declare Outcome Hypothesis and checklist in \`.grooveskills/memory/tasks/<slug>.md\`. Only check off tasks with observed evidence under \`Evidence\`.
|
|
663
|
+
- **Lane 3 (Spec)**: Ambiguous or high-impact architecture. Clarify and validate the spec in \`.grooveskills/memory/tasks/<slug>.md\` before writing code.
|
|
664
|
+
|
|
665
|
+
## 2. User Communication Language (${langConfig.nativeName})
|
|
666
|
+
- **Language**: \`${language}\` (${langConfig.nativeName}).
|
|
667
|
+
- **Requirement**: ${langConfig.instruction}
|
|
668
|
+
|
|
669
|
+
## 3. Memory Locations
|
|
670
|
+
- Architecture context: \`.grooveskills/memory/context.md\`
|
|
671
|
+
- Technical decisions (ADR): \`.grooveskills/memory/decisions.md\`
|
|
672
|
+
- Active tasks & evidence: \`.grooveskills/memory/tasks/\`
|
|
673
|
+
<!-- grooveskills:harness:end -->`;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// src/domains/harness/upsert-agent-instructions.ts
|
|
677
|
+
import { existsSync as existsSync6, readFileSync as readFileSync4, writeFileSync as writeFileSync2 } from "fs";
|
|
678
|
+
import { join as join8 } from "path";
|
|
679
|
+
var START_MARKER = "<!-- grooveskills:harness:start -->";
|
|
680
|
+
var END_MARKER = "<!-- grooveskills:harness:end -->";
|
|
681
|
+
function applyHarnessBlock(filePath, language = "es") {
|
|
682
|
+
const block = buildAgentHarnessBlock(language);
|
|
683
|
+
if (!existsSync6(filePath)) {
|
|
684
|
+
writeFileSync2(filePath, `${block}
|
|
685
|
+
`, "utf-8");
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
const existingContent = readFileSync4(filePath, "utf-8");
|
|
689
|
+
if (existingContent.includes(START_MARKER) && existingContent.includes(END_MARKER)) {
|
|
690
|
+
const regex = new RegExp(`${START_MARKER}[\\s\\S]*?${END_MARKER}`, "g");
|
|
691
|
+
const updated = existingContent.replace(regex, block);
|
|
692
|
+
writeFileSync2(filePath, updated, "utf-8");
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
const separator = existingContent.endsWith("\n") ? "\n" : "\n\n";
|
|
696
|
+
writeFileSync2(filePath, `${existingContent}${separator}${block}
|
|
697
|
+
`, "utf-8");
|
|
698
|
+
}
|
|
699
|
+
function upsertAgentInstructions(targetPath, selectedAgents, language = "es") {
|
|
700
|
+
const updatedFiles = [];
|
|
701
|
+
const agentsMdPath = join8(targetPath, "AGENTS.md");
|
|
702
|
+
applyHarnessBlock(agentsMdPath, language);
|
|
703
|
+
updatedFiles.push(agentsMdPath);
|
|
704
|
+
if (selectedAgents.includes("claude")) {
|
|
705
|
+
const claudeMdPath = join8(targetPath, "CLAUDE.md");
|
|
706
|
+
applyHarnessBlock(claudeMdPath, language);
|
|
707
|
+
updatedFiles.push(claudeMdPath);
|
|
708
|
+
}
|
|
709
|
+
return updatedFiles;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
// src/domains/harness/install-harness.ts
|
|
713
|
+
function installHarness(options) {
|
|
714
|
+
const memoryDir = getProjectMemoryDir(options.targetPath);
|
|
715
|
+
const tasksDir = getProjectTasksDir(options.targetPath);
|
|
716
|
+
const language = options.language ?? "es";
|
|
717
|
+
if (!existsSync7(tasksDir)) {
|
|
718
|
+
mkdirSync3(tasksDir, { recursive: true });
|
|
719
|
+
}
|
|
720
|
+
const createdFiles = [];
|
|
721
|
+
const contextPath = join9(memoryDir, "context.md");
|
|
722
|
+
if (!existsSync7(contextPath)) {
|
|
723
|
+
writeFileSync3(contextPath, buildContextTemplate(options.detectedDependencies, language), "utf-8");
|
|
724
|
+
createdFiles.push(contextPath);
|
|
725
|
+
}
|
|
726
|
+
const decisionsPath = join9(memoryDir, "decisions.md");
|
|
727
|
+
if (!existsSync7(decisionsPath)) {
|
|
728
|
+
writeFileSync3(decisionsPath, buildDecisionsTemplate(language), "utf-8");
|
|
729
|
+
createdFiles.push(decisionsPath);
|
|
730
|
+
}
|
|
731
|
+
const templateTaskPath = join9(tasksDir, "_template.md");
|
|
732
|
+
if (!existsSync7(templateTaskPath)) {
|
|
733
|
+
writeFileSync3(templateTaskPath, buildTaskTemplate(), "utf-8");
|
|
734
|
+
createdFiles.push(templateTaskPath);
|
|
735
|
+
}
|
|
736
|
+
const instructions = upsertAgentInstructions(options.targetPath, options.selectedAgents, language);
|
|
737
|
+
createdFiles.push(...instructions);
|
|
738
|
+
return createdFiles;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
// src/domains/harness/write-project-config.ts
|
|
742
|
+
import { existsSync as existsSync8, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
|
|
743
|
+
function readExistingConfig(configPath) {
|
|
744
|
+
const fallback = {
|
|
745
|
+
skills: [],
|
|
746
|
+
agents: [],
|
|
747
|
+
harness: false
|
|
748
|
+
};
|
|
749
|
+
if (!existsSync8(configPath)) {
|
|
750
|
+
return fallback;
|
|
751
|
+
}
|
|
752
|
+
try {
|
|
753
|
+
const raw = readFileSync5(configPath, "utf-8");
|
|
754
|
+
const parsed = JSON.parse(raw);
|
|
755
|
+
return {
|
|
756
|
+
skills: Array.isArray(parsed.skills) ? parsed.skills : [],
|
|
757
|
+
agents: Array.isArray(parsed.agents) ? parsed.agents : [],
|
|
758
|
+
harness: typeof parsed.harness === "boolean" ? parsed.harness : false,
|
|
759
|
+
language: typeof parsed.language === "string" ? parsed.language : void 0
|
|
760
|
+
};
|
|
761
|
+
} catch {
|
|
762
|
+
return fallback;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
function writeProjectConfig(targetPath, newSkills, newAgents, harnessEnabled, language) {
|
|
766
|
+
const configPath = getProjectConfigPath(targetPath);
|
|
767
|
+
const existing = readExistingConfig(configPath);
|
|
768
|
+
const mergedSkills = Array.from(/* @__PURE__ */ new Set([...existing.skills, ...newSkills]));
|
|
769
|
+
const mergedAgents = Array.from(/* @__PURE__ */ new Set([...existing.agents, ...newAgents]));
|
|
770
|
+
const resolvedLanguage = language ?? existing.language ?? "es";
|
|
771
|
+
const isHarnessActive = existing.harness || harnessEnabled;
|
|
772
|
+
const config = {
|
|
773
|
+
version: 1,
|
|
774
|
+
harness: isHarnessActive,
|
|
775
|
+
...isHarnessActive ? { language: resolvedLanguage } : {},
|
|
776
|
+
agents: mergedAgents,
|
|
777
|
+
skills: mergedSkills,
|
|
778
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
779
|
+
};
|
|
780
|
+
writeFileSync4(configPath, `${JSON.stringify(config, null, 2)}
|
|
781
|
+
`, "utf-8");
|
|
782
|
+
return configPath;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
// src/domains/installer/install-orchestrator.ts
|
|
786
|
+
var ADAPTER_REGISTRY = {
|
|
787
|
+
antigravity: new AntigravityAdapter(),
|
|
788
|
+
claude: new ClaudeAdapter(),
|
|
789
|
+
cursor: new CursorAdapter(),
|
|
790
|
+
gemini: new GeminiAdapter()
|
|
791
|
+
};
|
|
792
|
+
async function installSkills(options) {
|
|
793
|
+
const skillsToInstall = [...options.selectedSkillIds];
|
|
794
|
+
if (!skillsToInstall.includes("groove-harness")) {
|
|
795
|
+
skillsToInstall.push("groove-harness");
|
|
796
|
+
}
|
|
797
|
+
if (!skillsToInstall.includes("odd-ai")) {
|
|
798
|
+
skillsToInstall.push("odd-ai");
|
|
799
|
+
}
|
|
800
|
+
syncProjectStore(options.targetPath, skillsToInstall, options.selectedAgents);
|
|
801
|
+
const projectSkillsDir = getProjectSkillsDir(options.targetPath);
|
|
802
|
+
const createdFiles = [];
|
|
803
|
+
for (const skillId of skillsToInstall) {
|
|
804
|
+
const skill = SKILL_CATALOG.find((item) => item.id === skillId);
|
|
805
|
+
if (!skill) {
|
|
806
|
+
continue;
|
|
807
|
+
}
|
|
808
|
+
const skillSourceDir = join10(projectSkillsDir, skill.directoryName);
|
|
809
|
+
for (const agentId of options.selectedAgents) {
|
|
810
|
+
const adapter = ADAPTER_REGISTRY[agentId];
|
|
811
|
+
if (!adapter) {
|
|
812
|
+
continue;
|
|
813
|
+
}
|
|
814
|
+
const files = await adapter.installSkill(options.targetPath, skill, skillSourceDir);
|
|
815
|
+
createdFiles.push(...files);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
const harnessFiles = installHarness({
|
|
819
|
+
targetPath: options.targetPath,
|
|
820
|
+
selectedAgents: options.selectedAgents,
|
|
821
|
+
selectedSkillIds: skillsToInstall,
|
|
822
|
+
detectedDependencies: options.detectedDependencies || [],
|
|
823
|
+
language: options.language
|
|
824
|
+
});
|
|
825
|
+
createdFiles.push(...harnessFiles);
|
|
826
|
+
const configPath = writeProjectConfig(
|
|
827
|
+
options.targetPath,
|
|
828
|
+
skillsToInstall,
|
|
829
|
+
options.selectedAgents,
|
|
830
|
+
true,
|
|
831
|
+
options.language
|
|
832
|
+
);
|
|
833
|
+
createdFiles.push(configPath);
|
|
834
|
+
return {
|
|
835
|
+
installedSkills: skillsToInstall,
|
|
836
|
+
configuredAgents: options.selectedAgents,
|
|
837
|
+
createdFiles,
|
|
838
|
+
harnessInitialized: true,
|
|
839
|
+
language: options.language
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
// src/domains/ui/ui-orchestrator.ts
|
|
844
|
+
async function resolveLanguageSelection(harnessExists, configuredLanguage) {
|
|
845
|
+
if (harnessExists) {
|
|
846
|
+
return configuredLanguage ?? "es";
|
|
847
|
+
}
|
|
848
|
+
const langChoice = await promptLanguage(configuredLanguage ?? "es");
|
|
849
|
+
if (p5.isCancel(langChoice)) {
|
|
850
|
+
p5.cancel("Installation cancelled. Have a wonderful day!");
|
|
851
|
+
process.exit(0);
|
|
852
|
+
}
|
|
853
|
+
return langChoice;
|
|
854
|
+
}
|
|
855
|
+
async function resolveOverwriteConfirmation(targetPath, selectedSkills, selectedAgents) {
|
|
856
|
+
const anyExists = selectedSkills.some((skillId) => {
|
|
857
|
+
const meta = SKILL_CATALOG.find((s) => s.id === skillId);
|
|
858
|
+
return meta ? verifySkillExists(targetPath, meta.directoryName, selectedAgents) : false;
|
|
859
|
+
});
|
|
860
|
+
if (!anyExists) {
|
|
861
|
+
return true;
|
|
862
|
+
}
|
|
863
|
+
const confirm2 = await promptConfirmOverwrite();
|
|
864
|
+
if (p5.isCancel(confirm2) || !confirm2) {
|
|
865
|
+
p5.cancel("Installation stopped to protect existing skills.");
|
|
866
|
+
process.exit(0);
|
|
867
|
+
}
|
|
868
|
+
return Boolean(confirm2);
|
|
869
|
+
}
|
|
870
|
+
async function runInteractiveUi(context) {
|
|
871
|
+
console.log(renderBanner());
|
|
872
|
+
p5.intro(pc2.magenta("Welcome to GrooveSkills! Let's tailor your AI agents with clean architectural standards."));
|
|
873
|
+
if (context.detectedDependencies.length > 0) {
|
|
874
|
+
const harnessInfo = context.harnessExists ? pc2.green(`Active (.grooveskills/memory, lang: ${context.configuredLanguage ?? "es"})`) : pc2.cyan("Will be initialized");
|
|
875
|
+
p5.note(
|
|
876
|
+
`Detected dependencies: ${context.detectedDependencies.map((d) => pc2.bold(d)).join(", ")}
|
|
877
|
+
Active AI folders: ${context.detectedAgents.map((a) => pc2.green(a)).join(", ") || "None (will be created)"}
|
|
878
|
+
GrooveSkills Harness: ${harnessInfo}`,
|
|
879
|
+
"Project Environment"
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
const selectedSkills = await promptSkills(context.suggestedSkillIds);
|
|
883
|
+
if (p5.isCancel(selectedSkills)) {
|
|
884
|
+
p5.cancel("Installation cancelled. Have a wonderful day!");
|
|
885
|
+
process.exit(0);
|
|
886
|
+
}
|
|
887
|
+
const selectedAgents = await promptAgents(context.detectedAgents);
|
|
888
|
+
if (p5.isCancel(selectedAgents)) {
|
|
889
|
+
p5.cancel("Installation cancelled. Have a wonderful day!");
|
|
890
|
+
process.exit(0);
|
|
891
|
+
}
|
|
892
|
+
const selectedLanguage = await resolveLanguageSelection(
|
|
893
|
+
context.harnessExists,
|
|
894
|
+
context.configuredLanguage
|
|
895
|
+
);
|
|
896
|
+
const forceOverwrite = await resolveOverwriteConfirmation(
|
|
897
|
+
context.targetPath,
|
|
898
|
+
selectedSkills,
|
|
899
|
+
selectedAgents
|
|
900
|
+
);
|
|
901
|
+
const s = p5.spinner();
|
|
902
|
+
s.start("Installing and adapting skills across your configured AI agents...");
|
|
903
|
+
const result = await installSkills({
|
|
904
|
+
targetPath: context.targetPath,
|
|
905
|
+
selectedSkillIds: selectedSkills,
|
|
906
|
+
selectedAgents,
|
|
907
|
+
forceOverwrite,
|
|
908
|
+
enableHarness: true,
|
|
909
|
+
detectedDependencies: context.detectedDependencies,
|
|
910
|
+
language: selectedLanguage
|
|
911
|
+
});
|
|
912
|
+
s.stop(pc2.green("All skills and harness have been successfully configured!"));
|
|
913
|
+
const harnessStatus = result.harnessInitialized ? pc2.green(`Initialized in .grooveskills/ (Language: ${selectedLanguage})`) : pc2.cyan(`Preserved in .grooveskills/ (Language: ${selectedLanguage})`);
|
|
914
|
+
p5.note(
|
|
915
|
+
`Configured skills: ${result.installedSkills.map((s2) => pc2.bold(s2)).join(", ")}
|
|
916
|
+
Target agents: ${result.configuredAgents.map((a) => pc2.cyan(a)).join(", ")}
|
|
917
|
+
GrooveSkills Harness: ${harnessStatus}`,
|
|
918
|
+
"Installation Summary"
|
|
919
|
+
);
|
|
920
|
+
p5.outro(pc2.green("Your AI programming pair is now empowered with your team's architectural habits! \u{1F680}"));
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
// src/main.ts
|
|
924
|
+
async function runGrooveSkills(options = {}) {
|
|
925
|
+
const targetPath = process.cwd();
|
|
926
|
+
const context = detectProjectContext(targetPath);
|
|
927
|
+
const hasSkills = options.skills && options.skills.length > 0;
|
|
928
|
+
const hasAgents = options.agents && options.agents.length > 0;
|
|
929
|
+
const isDirectHarness = Boolean(options.harness) && hasAgents;
|
|
930
|
+
if (hasSkills && hasAgents || isDirectHarness) {
|
|
931
|
+
const language = options.language ?? context.configuredLanguage ?? "es";
|
|
932
|
+
await installSkills({
|
|
933
|
+
targetPath,
|
|
934
|
+
selectedSkillIds: options.skills || [],
|
|
935
|
+
selectedAgents: options.agents || [],
|
|
936
|
+
forceOverwrite: Boolean(options.yes),
|
|
937
|
+
enableHarness: true,
|
|
938
|
+
detectedDependencies: context.detectedDependencies,
|
|
939
|
+
language
|
|
940
|
+
});
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
await runInteractiveUi(context);
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
export {
|
|
947
|
+
runGrooveSkills
|
|
948
|
+
};
|
|
949
|
+
//# sourceMappingURL=chunk-FN4OEDVV.js.map
|