lightspec 0.1.1 → 0.2.2
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 +41 -65
- package/dist/cli/index.js +12 -24
- package/dist/commands/feedback.js +2 -2
- package/dist/core/config.d.ts +1 -0
- package/dist/core/config.js +1 -0
- package/dist/core/configurators/slash/amazon-q.js +6 -2
- package/dist/core/configurators/slash/antigravity.js +4 -2
- package/dist/core/configurators/slash/auggie.js +8 -1
- package/dist/core/configurators/slash/base.d.ts +14 -3
- package/dist/core/configurators/slash/base.js +160 -16
- package/dist/core/configurators/slash/claude.js +8 -1
- package/dist/core/configurators/slash/cline.js +4 -2
- package/dist/core/configurators/slash/codebuddy.js +8 -1
- package/dist/core/configurators/slash/codex.d.ts +0 -8
- package/dist/core/configurators/slash/codex.js +0 -103
- package/dist/core/configurators/slash/continue.js +8 -1
- package/dist/core/configurators/slash/costrict.js +4 -0
- package/dist/core/configurators/slash/crush.js +8 -1
- package/dist/core/configurators/slash/cursor.js +8 -1
- package/dist/core/configurators/slash/factory.js +8 -1
- package/dist/core/configurators/slash/gemini.js +4 -2
- package/dist/core/configurators/slash/github-copilot.js +6 -2
- package/dist/core/configurators/slash/iflow.js +8 -1
- package/dist/core/configurators/slash/kilocode.js +2 -1
- package/dist/core/configurators/slash/mistral-vibe.d.ts +6 -0
- package/dist/core/configurators/slash/mistral-vibe.js +6 -0
- package/dist/core/configurators/slash/opencode.js +4 -0
- package/dist/core/configurators/slash/qoder.js +8 -1
- package/dist/core/configurators/slash/qwen.js +4 -2
- package/dist/core/configurators/slash/registry.d.ts +2 -1
- package/dist/core/configurators/slash/registry.js +8 -0
- package/dist/core/configurators/slash/roocode.js +4 -2
- package/dist/core/configurators/slash/toml-base.d.ts +0 -6
- package/dist/core/configurators/slash/toml-base.js +0 -49
- package/dist/core/configurators/slash/windsurf.js +4 -2
- package/dist/core/init.d.ts +6 -0
- package/dist/core/init.js +49 -22
- package/dist/core/templates/agents-template.d.ts +1 -1
- package/dist/core/templates/agents-template.js +4 -7
- package/dist/core/templates/apply-template.d.ts +3 -0
- package/dist/core/templates/apply-template.js +21 -0
- package/dist/core/templates/archive-template.d.ts +3 -0
- package/dist/core/templates/archive-template.js +29 -0
- package/dist/core/templates/context-check-template.d.ts +3 -0
- package/dist/core/templates/context-check-template.js +128 -0
- package/dist/core/templates/index.d.ts +1 -0
- package/dist/core/templates/index.js +4 -6
- package/dist/core/templates/proposal-template.d.ts +3 -0
- package/dist/core/templates/proposal-template.js +30 -0
- package/dist/core/templates/skill-common-template.d.ts +2 -0
- package/dist/core/templates/skill-common-template.js +5 -0
- package/dist/core/templates/slash-command-templates.d.ts +3 -1
- package/dist/core/templates/slash-command-templates.js +17 -43
- package/dist/core/update.js +5 -5
- package/dist/telemetry/index.d.ts +2 -3
- package/dist/telemetry/index.js +2 -3
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.js +5 -0
- package/package.json +19 -22
|
@@ -2,7 +2,8 @@ import { SlashCommandConfigurator } from './base.js';
|
|
|
2
2
|
const FILE_PATHS = {
|
|
3
3
|
proposal: '.clinerules/workflows/lightspec-proposal.md',
|
|
4
4
|
apply: '.clinerules/workflows/lightspec-apply.md',
|
|
5
|
-
archive: '.clinerules/workflows/lightspec-archive.md'
|
|
5
|
+
archive: '.clinerules/workflows/lightspec-archive.md',
|
|
6
|
+
'context-check': '.cline/commands/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
export class ClineSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
8
9
|
toolId = 'cline';
|
|
@@ -14,7 +15,8 @@ export class ClineSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
|
14
15
|
const descriptions = {
|
|
15
16
|
proposal: 'Scaffold a new LightSpec change and validate strictly.',
|
|
16
17
|
apply: 'Implement an approved LightSpec change and keep tasks in sync.',
|
|
17
|
-
archive: 'Archive a deployed LightSpec change and update specs.'
|
|
18
|
+
archive: 'Archive a deployed LightSpec change and update specs.',
|
|
19
|
+
'context-check': 'Validate project context in agent instruction files and help populate missing information.'
|
|
18
20
|
};
|
|
19
21
|
const description = descriptions[id];
|
|
20
22
|
return `# LightSpec: ${id.charAt(0).toUpperCase() + id.slice(1)}\n\n${description}`;
|
|
@@ -2,7 +2,8 @@ import { SlashCommandConfigurator } from './base.js';
|
|
|
2
2
|
const FILE_PATHS = {
|
|
3
3
|
proposal: '.codebuddy/commands/lightspec/proposal.md',
|
|
4
4
|
apply: '.codebuddy/commands/lightspec/apply.md',
|
|
5
|
-
archive: '.codebuddy/commands/lightspec/archive.md'
|
|
5
|
+
archive: '.codebuddy/commands/lightspec/archive.md',
|
|
6
|
+
'context-check': '.codebuddy/commands/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
const FRONTMATTER = {
|
|
8
9
|
proposal: `---
|
|
@@ -19,6 +20,12 @@ argument-hint: "[change-id]"
|
|
|
19
20
|
name: LightSpec: Archive
|
|
20
21
|
description: "Archive a deployed LightSpec change and update specs."
|
|
21
22
|
argument-hint: "[change-id]"
|
|
23
|
+
---`,
|
|
24
|
+
'context-check': `---
|
|
25
|
+
name: LightSpec: Context Check
|
|
26
|
+
description: Validate project context in agent instruction files and help populate missing information.
|
|
27
|
+
category: LightSpec
|
|
28
|
+
tags: [lightspec, context, validation]
|
|
22
29
|
---`
|
|
23
30
|
};
|
|
24
31
|
export class CodeBuddySlashCommandConfigurator extends SlashCommandConfigurator {
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { SlashCommandConfigurator } from "./base.js";
|
|
2
|
-
import { SlashCommandId } from "../../templates/index.js";
|
|
3
2
|
export declare class CodexSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
4
3
|
readonly toolId = "codex";
|
|
5
4
|
readonly isAvailable = true;
|
|
6
|
-
protected getRelativePath(id: SlashCommandId): string;
|
|
7
|
-
protected getFrontmatter(id: SlashCommandId): string | undefined;
|
|
8
|
-
private getGlobalPromptsDir;
|
|
9
|
-
generateAll(projectPath: string, _lightspecDir: string): Promise<string[]>;
|
|
10
|
-
updateExisting(projectPath: string, _lightspecDir: string): Promise<string[]>;
|
|
11
|
-
private updateFullFile;
|
|
12
|
-
resolveAbsolutePath(_projectPath: string, id: SlashCommandId): string;
|
|
13
5
|
}
|
|
14
6
|
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -1,109 +1,6 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import os from "os";
|
|
3
1
|
import { SlashCommandConfigurator } from "./base.js";
|
|
4
|
-
import { TemplateManager } from "../../templates/index.js";
|
|
5
|
-
import { FileSystemUtils } from "../../../utils/file-system.js";
|
|
6
|
-
import { LIGHTSPEC_MARKERS } from "../../config.js";
|
|
7
|
-
// Use POSIX-style paths for consistent logging across platforms.
|
|
8
|
-
const FILE_PATHS = {
|
|
9
|
-
proposal: ".codex/prompts/lightspec-proposal.md",
|
|
10
|
-
apply: ".codex/prompts/lightspec-apply.md",
|
|
11
|
-
archive: ".codex/prompts/lightspec-archive.md",
|
|
12
|
-
};
|
|
13
2
|
export class CodexSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
14
3
|
toolId = "codex";
|
|
15
4
|
isAvailable = true;
|
|
16
|
-
getRelativePath(id) {
|
|
17
|
-
return FILE_PATHS[id];
|
|
18
|
-
}
|
|
19
|
-
getFrontmatter(id) {
|
|
20
|
-
// Codex supports YAML frontmatter with description and argument-hint fields,
|
|
21
|
-
// plus $ARGUMENTS to capture all arguments as a single string.
|
|
22
|
-
const frontmatter = {
|
|
23
|
-
proposal: `---
|
|
24
|
-
description: Scaffold a new LightSpec change and validate strictly.
|
|
25
|
-
argument-hint: request or feature description
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
$ARGUMENTS`,
|
|
29
|
-
apply: `---
|
|
30
|
-
description: Implement an approved LightSpec change and keep tasks in sync.
|
|
31
|
-
argument-hint: change-id
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
$ARGUMENTS`,
|
|
35
|
-
archive: `---
|
|
36
|
-
description: Archive a deployed LightSpec change and update specs.
|
|
37
|
-
argument-hint: change-id
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
$ARGUMENTS`,
|
|
41
|
-
};
|
|
42
|
-
return frontmatter[id];
|
|
43
|
-
}
|
|
44
|
-
getGlobalPromptsDir() {
|
|
45
|
-
const home = (process.env.CODEX_HOME && process.env.CODEX_HOME.trim())
|
|
46
|
-
? process.env.CODEX_HOME.trim()
|
|
47
|
-
: FileSystemUtils.joinPath(os.homedir(), ".codex");
|
|
48
|
-
return FileSystemUtils.joinPath(home, "prompts");
|
|
49
|
-
}
|
|
50
|
-
// Codex discovers prompts globally. Generate directly in the global directory
|
|
51
|
-
// and wrap shared body with markers.
|
|
52
|
-
async generateAll(projectPath, _lightspecDir) {
|
|
53
|
-
const createdOrUpdated = [];
|
|
54
|
-
for (const target of this.getTargets()) {
|
|
55
|
-
const body = TemplateManager.getSlashCommandBody(target.id).trim();
|
|
56
|
-
const promptsDir = this.getGlobalPromptsDir();
|
|
57
|
-
const filePath = FileSystemUtils.joinPath(promptsDir, path.basename(target.path));
|
|
58
|
-
await FileSystemUtils.createDirectory(path.dirname(filePath));
|
|
59
|
-
if (await FileSystemUtils.fileExists(filePath)) {
|
|
60
|
-
await this.updateFullFile(filePath, target.id, body);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
const frontmatter = this.getFrontmatter(target.id);
|
|
64
|
-
const sections = [];
|
|
65
|
-
if (frontmatter)
|
|
66
|
-
sections.push(frontmatter.trim());
|
|
67
|
-
sections.push(`${LIGHTSPEC_MARKERS.start}\n${body}\n${LIGHTSPEC_MARKERS.end}`);
|
|
68
|
-
await FileSystemUtils.writeFile(filePath, sections.join("\n") + "\n");
|
|
69
|
-
}
|
|
70
|
-
createdOrUpdated.push(target.path);
|
|
71
|
-
}
|
|
72
|
-
return createdOrUpdated;
|
|
73
|
-
}
|
|
74
|
-
async updateExisting(projectPath, _lightspecDir) {
|
|
75
|
-
const updated = [];
|
|
76
|
-
for (const target of this.getTargets()) {
|
|
77
|
-
const promptsDir = this.getGlobalPromptsDir();
|
|
78
|
-
const filePath = FileSystemUtils.joinPath(promptsDir, path.basename(target.path));
|
|
79
|
-
if (await FileSystemUtils.fileExists(filePath)) {
|
|
80
|
-
const body = TemplateManager.getSlashCommandBody(target.id).trim();
|
|
81
|
-
await this.updateFullFile(filePath, target.id, body);
|
|
82
|
-
updated.push(target.path);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return updated;
|
|
86
|
-
}
|
|
87
|
-
// Update both frontmatter and body in an existing file
|
|
88
|
-
async updateFullFile(filePath, id, body) {
|
|
89
|
-
const content = await FileSystemUtils.readFile(filePath);
|
|
90
|
-
const startIndex = content.indexOf(LIGHTSPEC_MARKERS.start);
|
|
91
|
-
if (startIndex === -1) {
|
|
92
|
-
throw new Error(`Missing LightSpec start marker in ${filePath}`);
|
|
93
|
-
}
|
|
94
|
-
// Replace everything before the start marker with the new frontmatter
|
|
95
|
-
const frontmatter = this.getFrontmatter(id);
|
|
96
|
-
const sections = [];
|
|
97
|
-
if (frontmatter)
|
|
98
|
-
sections.push(frontmatter.trim());
|
|
99
|
-
sections.push(`${LIGHTSPEC_MARKERS.start}\n${body}\n${LIGHTSPEC_MARKERS.end}`);
|
|
100
|
-
await FileSystemUtils.writeFile(filePath, sections.join("\n") + "\n");
|
|
101
|
-
}
|
|
102
|
-
// Resolve to the global prompts location for configuration detection
|
|
103
|
-
resolveAbsolutePath(_projectPath, id) {
|
|
104
|
-
const promptsDir = this.getGlobalPromptsDir();
|
|
105
|
-
const fileName = path.basename(FILE_PATHS[id]);
|
|
106
|
-
return FileSystemUtils.joinPath(promptsDir, fileName);
|
|
107
|
-
}
|
|
108
5
|
}
|
|
109
6
|
//# sourceMappingURL=codex.js.map
|
|
@@ -2,7 +2,8 @@ import { SlashCommandConfigurator } from './base.js';
|
|
|
2
2
|
const FILE_PATHS = {
|
|
3
3
|
proposal: '.continue/prompts/lightspec-proposal.prompt',
|
|
4
4
|
apply: '.continue/prompts/lightspec-apply.prompt',
|
|
5
|
-
archive: '.continue/prompts/lightspec-archive.prompt'
|
|
5
|
+
archive: '.continue/prompts/lightspec-archive.prompt',
|
|
6
|
+
'context-check': '.continue/commands/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
/*
|
|
8
9
|
* Continue .prompt format requires YAML frontmatter:
|
|
@@ -31,6 +32,12 @@ invokable: true
|
|
|
31
32
|
name: lightspec-archive
|
|
32
33
|
description: Archive a deployed LightSpec change and update specs.
|
|
33
34
|
invokable: true
|
|
35
|
+
---`,
|
|
36
|
+
'context-check': `---
|
|
37
|
+
name: LightSpec: Context Check
|
|
38
|
+
description: Validate project context in agent instruction files and help populate missing information.
|
|
39
|
+
category: LightSpec
|
|
40
|
+
tags: [lightspec, context, validation]
|
|
34
41
|
---`
|
|
35
42
|
};
|
|
36
43
|
export class ContinueSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
@@ -3,6 +3,7 @@ const FILE_PATHS = {
|
|
|
3
3
|
proposal: '.cospec/lightspec/commands/lightspec-proposal.md',
|
|
4
4
|
apply: '.cospec/lightspec/commands/lightspec-apply.md',
|
|
5
5
|
archive: '.cospec/lightspec/commands/lightspec-archive.md',
|
|
6
|
+
'context-check': '.cospec/lightspec/commands/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
const FRONTMATTER = {
|
|
8
9
|
proposal: `---
|
|
@@ -16,6 +17,9 @@ argument-hint: change-id
|
|
|
16
17
|
archive: `---
|
|
17
18
|
description: "Archive a deployed LightSpec change and update specs."
|
|
18
19
|
argument-hint: change-id
|
|
20
|
+
---`,
|
|
21
|
+
'context-check': `---
|
|
22
|
+
description: "Validate project context in agent instruction files and help populate missing information."
|
|
19
23
|
---`
|
|
20
24
|
};
|
|
21
25
|
export class CostrictSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
@@ -2,7 +2,8 @@ import { SlashCommandConfigurator } from './base.js';
|
|
|
2
2
|
const FILE_PATHS = {
|
|
3
3
|
proposal: '.crush/commands/lightspec/proposal.md',
|
|
4
4
|
apply: '.crush/commands/lightspec/apply.md',
|
|
5
|
-
archive: '.crush/commands/lightspec/archive.md'
|
|
5
|
+
archive: '.crush/commands/lightspec/archive.md',
|
|
6
|
+
'context-check': '.crush/commands/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
const FRONTMATTER = {
|
|
8
9
|
proposal: `---
|
|
@@ -22,6 +23,12 @@ name: LightSpec: Archive
|
|
|
22
23
|
description: Archive a deployed LightSpec change and update specs.
|
|
23
24
|
category: LightSpec
|
|
24
25
|
tags: [lightspec, archive]
|
|
26
|
+
---`,
|
|
27
|
+
'context-check': `---
|
|
28
|
+
name: LightSpec: Context Check
|
|
29
|
+
description: Validate project context in agent instruction files and help populate missing information.
|
|
30
|
+
category: LightSpec
|
|
31
|
+
tags: [lightspec, context, validation]
|
|
25
32
|
---`
|
|
26
33
|
};
|
|
27
34
|
export class CrushSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
@@ -2,7 +2,8 @@ import { SlashCommandConfigurator } from './base.js';
|
|
|
2
2
|
const FILE_PATHS = {
|
|
3
3
|
proposal: '.cursor/commands/lightspec-proposal.md',
|
|
4
4
|
apply: '.cursor/commands/lightspec-apply.md',
|
|
5
|
-
archive: '.cursor/commands/lightspec-archive.md'
|
|
5
|
+
archive: '.cursor/commands/lightspec-archive.md',
|
|
6
|
+
'context-check': '.cursor/commands/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
const FRONTMATTER = {
|
|
8
9
|
proposal: `---
|
|
@@ -22,6 +23,12 @@ name: /lightspec-archive
|
|
|
22
23
|
id: lightspec-archive
|
|
23
24
|
category: LightSpec
|
|
24
25
|
description: Archive a deployed LightSpec change and update specs.
|
|
26
|
+
---`,
|
|
27
|
+
'context-check': `---
|
|
28
|
+
name: /lightspec-context-check
|
|
29
|
+
id: lightspec-context-check
|
|
30
|
+
category: LightSpec
|
|
31
|
+
description: Validate project context in agent instruction files and help populate missing information.
|
|
25
32
|
---`
|
|
26
33
|
};
|
|
27
34
|
export class CursorSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
@@ -2,7 +2,8 @@ import { SlashCommandConfigurator } from './base.js';
|
|
|
2
2
|
const FILE_PATHS = {
|
|
3
3
|
proposal: '.factory/commands/lightspec-proposal.md',
|
|
4
4
|
apply: '.factory/commands/lightspec-apply.md',
|
|
5
|
-
archive: '.factory/commands/lightspec-archive.md'
|
|
5
|
+
archive: '.factory/commands/lightspec-archive.md',
|
|
6
|
+
'context-check': '.factory/commands/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
const FRONTMATTER = {
|
|
8
9
|
proposal: `---
|
|
@@ -16,6 +17,12 @@ argument-hint: change-id
|
|
|
16
17
|
archive: `---
|
|
17
18
|
description: Archive a deployed LightSpec change and update specs.
|
|
18
19
|
argument-hint: change-id
|
|
20
|
+
---`,
|
|
21
|
+
'context-check': `---
|
|
22
|
+
name: LightSpec: Context Check
|
|
23
|
+
description: Validate project context in agent instruction files and help populate missing information.
|
|
24
|
+
category: LightSpec
|
|
25
|
+
tags: [lightspec, context, validation]
|
|
19
26
|
---`
|
|
20
27
|
};
|
|
21
28
|
export class FactorySlashCommandConfigurator extends SlashCommandConfigurator {
|
|
@@ -2,12 +2,14 @@ import { TomlSlashCommandConfigurator } from './toml-base.js';
|
|
|
2
2
|
const FILE_PATHS = {
|
|
3
3
|
proposal: '.gemini/commands/lightspec/proposal.toml',
|
|
4
4
|
apply: '.gemini/commands/lightspec/apply.toml',
|
|
5
|
-
archive: '.gemini/commands/lightspec/archive.toml'
|
|
5
|
+
archive: '.gemini/commands/lightspec/archive.toml',
|
|
6
|
+
'context-check': '.gemini/commands/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
const DESCRIPTIONS = {
|
|
8
9
|
proposal: 'Scaffold a new LightSpec change and validate strictly.',
|
|
9
10
|
apply: 'Implement an approved LightSpec change and keep tasks in sync.',
|
|
10
|
-
archive: 'Archive a deployed LightSpec change and update specs.'
|
|
11
|
+
archive: 'Archive a deployed LightSpec change and update specs.',
|
|
12
|
+
'context-check': 'Validate project context in agent instruction files and help populate missing information.'
|
|
11
13
|
};
|
|
12
14
|
export class GeminiSlashCommandConfigurator extends TomlSlashCommandConfigurator {
|
|
13
15
|
toolId = 'gemini';
|
|
@@ -2,7 +2,8 @@ import { SlashCommandConfigurator } from './base.js';
|
|
|
2
2
|
const FILE_PATHS = {
|
|
3
3
|
proposal: '.github/prompts/lightspec-proposal.prompt.md',
|
|
4
4
|
apply: '.github/prompts/lightspec-apply.prompt.md',
|
|
5
|
-
archive: '.github/prompts/lightspec-archive.prompt.md'
|
|
5
|
+
archive: '.github/prompts/lightspec-archive.prompt.md',
|
|
6
|
+
'context-check': '.github/copilot/prompts/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
const FRONTMATTER = {
|
|
8
9
|
proposal: `---
|
|
@@ -19,7 +20,10 @@ $ARGUMENTS`,
|
|
|
19
20
|
description: Archive a deployed LightSpec change and update specs.
|
|
20
21
|
---
|
|
21
22
|
|
|
22
|
-
$ARGUMENTS
|
|
23
|
+
$ARGUMENTS`,
|
|
24
|
+
'context-check': `---
|
|
25
|
+
description: Validate project context in agent instruction files and help populate missing information.
|
|
26
|
+
---`
|
|
23
27
|
};
|
|
24
28
|
export class GitHubCopilotSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
25
29
|
toolId = 'github-copilot';
|
|
@@ -2,7 +2,8 @@ import { SlashCommandConfigurator } from './base.js';
|
|
|
2
2
|
const FILE_PATHS = {
|
|
3
3
|
proposal: '.iflow/commands/lightspec-proposal.md',
|
|
4
4
|
apply: '.iflow/commands/lightspec-apply.md',
|
|
5
|
-
archive: '.iflow/commands/lightspec-archive.md'
|
|
5
|
+
archive: '.iflow/commands/lightspec-archive.md',
|
|
6
|
+
'context-check': '.iflow/commands/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
const FRONTMATTER = {
|
|
8
9
|
proposal: `---
|
|
@@ -22,6 +23,12 @@ name: /lightspec-archive
|
|
|
22
23
|
id: lightspec-archive
|
|
23
24
|
category: LightSpec
|
|
24
25
|
description: Archive a deployed LightSpec change and update specs.
|
|
26
|
+
---`,
|
|
27
|
+
'context-check': `---
|
|
28
|
+
name: LightSpec: Context Check
|
|
29
|
+
description: Validate project context in agent instruction files and help populate missing information.
|
|
30
|
+
category: LightSpec
|
|
31
|
+
tags: [lightspec, context, validation]
|
|
25
32
|
---`
|
|
26
33
|
};
|
|
27
34
|
export class IflowSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
@@ -2,7 +2,8 @@ import { SlashCommandConfigurator } from "./base.js";
|
|
|
2
2
|
const FILE_PATHS = {
|
|
3
3
|
proposal: ".kilocode/workflows/lightspec-proposal.md",
|
|
4
4
|
apply: ".kilocode/workflows/lightspec-apply.md",
|
|
5
|
-
archive: ".kilocode/workflows/lightspec-archive.md"
|
|
5
|
+
archive: ".kilocode/workflows/lightspec-archive.md",
|
|
6
|
+
'context-check': '.kilocode/commands/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
export class KiloCodeSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
8
9
|
toolId = "kilocode";
|
|
@@ -5,6 +5,7 @@ const FILE_PATHS = {
|
|
|
5
5
|
proposal: ".opencode/command/lightspec-proposal.md",
|
|
6
6
|
apply: ".opencode/command/lightspec-apply.md",
|
|
7
7
|
archive: ".opencode/command/lightspec-archive.md",
|
|
8
|
+
'context-check': ".opencode/command/lightspec-context-check.md"
|
|
8
9
|
};
|
|
9
10
|
const FRONTMATTER = {
|
|
10
11
|
proposal: `---
|
|
@@ -30,6 +31,9 @@ description: Archive a deployed LightSpec change and update specs.
|
|
|
30
31
|
$ARGUMENTS
|
|
31
32
|
</ChangeId>
|
|
32
33
|
`,
|
|
34
|
+
'context-check': `---
|
|
35
|
+
description: Validate project context in agent instruction files and help populate missing information.
|
|
36
|
+
---`
|
|
33
37
|
};
|
|
34
38
|
export class OpenCodeSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
35
39
|
toolId = "opencode";
|
|
@@ -10,7 +10,8 @@ const FILE_PATHS = {
|
|
|
10
10
|
// Implement approved changes with task tracking
|
|
11
11
|
apply: '.qoder/commands/lightspec/apply.md',
|
|
12
12
|
// Archive completed changes and update specs
|
|
13
|
-
archive: '.qoder/commands/lightspec/archive.md'
|
|
13
|
+
archive: '.qoder/commands/lightspec/archive.md',
|
|
14
|
+
'context-check': '.qoder/prompts/lightspec-context-check.md'
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
17
|
* YAML frontmatter for Qoder slash commands
|
|
@@ -35,6 +36,12 @@ name: LightSpec: Archive
|
|
|
35
36
|
description: Archive a deployed LightSpec change and update specs.
|
|
36
37
|
category: LightSpec
|
|
37
38
|
tags: [lightspec, archive]
|
|
39
|
+
---`,
|
|
40
|
+
'context-check': `---
|
|
41
|
+
name: LightSpec: Context Check
|
|
42
|
+
description: Validate project context in agent instruction files and help populate missing information.
|
|
43
|
+
category: LightSpec
|
|
44
|
+
tags: [lightspec, context, validation]
|
|
38
45
|
---`
|
|
39
46
|
};
|
|
40
47
|
/**
|
|
@@ -13,12 +13,14 @@ import { TomlSlashCommandConfigurator } from './toml-base.js';
|
|
|
13
13
|
const FILE_PATHS = {
|
|
14
14
|
proposal: '.qwen/commands/lightspec-proposal.toml',
|
|
15
15
|
apply: '.qwen/commands/lightspec-apply.toml',
|
|
16
|
-
archive: '.qwen/commands/lightspec-archive.toml'
|
|
16
|
+
archive: '.qwen/commands/lightspec-archive.toml',
|
|
17
|
+
'context-check': '.qwen/prompts/lightspec-context-check.md'
|
|
17
18
|
};
|
|
18
19
|
const DESCRIPTIONS = {
|
|
19
20
|
proposal: 'Scaffold a new LightSpec change and validate strictly.',
|
|
20
21
|
apply: 'Implement an approved LightSpec change and keep tasks in sync.',
|
|
21
|
-
archive: 'Archive a deployed LightSpec change and update specs.'
|
|
22
|
+
archive: 'Archive a deployed LightSpec change and update specs.',
|
|
23
|
+
'context-check': 'Validate project context in agent instruction files and help populate missing information.'
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
24
26
|
* QwenSlashCommandConfigurator class provides integration with Qwen Code
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { SlashCommandConfigurator } from './base.js';
|
|
1
|
+
import { SlashCommandConfigurator, SkillInstallLocation } from './base.js';
|
|
2
2
|
export declare class SlashCommandRegistry {
|
|
3
3
|
private static configurators;
|
|
4
4
|
static register(configurator: SlashCommandConfigurator): void;
|
|
5
5
|
static get(toolId: string): SlashCommandConfigurator | undefined;
|
|
6
6
|
static getAll(): SlashCommandConfigurator[];
|
|
7
|
+
static setInstallLocation(location: SkillInstallLocation): void;
|
|
7
8
|
}
|
|
8
9
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -19,6 +19,7 @@ import { RooCodeSlashCommandConfigurator } from './roocode.js';
|
|
|
19
19
|
import { AntigravitySlashCommandConfigurator } from './antigravity.js';
|
|
20
20
|
import { IflowSlashCommandConfigurator } from './iflow.js';
|
|
21
21
|
import { ContinueSlashCommandConfigurator } from './continue.js';
|
|
22
|
+
import { MistralVibeSlashCommandConfigurator } from './mistral-vibe.js';
|
|
22
23
|
export class SlashCommandRegistry {
|
|
23
24
|
static configurators = new Map();
|
|
24
25
|
static {
|
|
@@ -43,6 +44,7 @@ export class SlashCommandRegistry {
|
|
|
43
44
|
const antigravity = new AntigravitySlashCommandConfigurator();
|
|
44
45
|
const iflow = new IflowSlashCommandConfigurator();
|
|
45
46
|
const continueTool = new ContinueSlashCommandConfigurator();
|
|
47
|
+
const mistralVibe = new MistralVibeSlashCommandConfigurator();
|
|
46
48
|
this.configurators.set(claude.toolId, claude);
|
|
47
49
|
this.configurators.set(codeBuddy.toolId, codeBuddy);
|
|
48
50
|
this.configurators.set(qoder.toolId, qoder);
|
|
@@ -64,6 +66,7 @@ export class SlashCommandRegistry {
|
|
|
64
66
|
this.configurators.set(antigravity.toolId, antigravity);
|
|
65
67
|
this.configurators.set(iflow.toolId, iflow);
|
|
66
68
|
this.configurators.set(continueTool.toolId, continueTool);
|
|
69
|
+
this.configurators.set(mistralVibe.toolId, mistralVibe);
|
|
67
70
|
}
|
|
68
71
|
static register(configurator) {
|
|
69
72
|
this.configurators.set(configurator.toolId, configurator);
|
|
@@ -74,5 +77,10 @@ export class SlashCommandRegistry {
|
|
|
74
77
|
static getAll() {
|
|
75
78
|
return Array.from(this.configurators.values());
|
|
76
79
|
}
|
|
80
|
+
static setInstallLocation(location) {
|
|
81
|
+
for (const configurator of this.configurators.values()) {
|
|
82
|
+
configurator.setInstallLocation(location);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
77
85
|
}
|
|
78
86
|
//# sourceMappingURL=registry.js.map
|
|
@@ -2,7 +2,8 @@ import { SlashCommandConfigurator } from './base.js';
|
|
|
2
2
|
const NEW_FILE_PATHS = {
|
|
3
3
|
proposal: '.roo/commands/lightspec-proposal.md',
|
|
4
4
|
apply: '.roo/commands/lightspec-apply.md',
|
|
5
|
-
archive: '.roo/commands/lightspec-archive.md'
|
|
5
|
+
archive: '.roo/commands/lightspec-archive.md',
|
|
6
|
+
'context-check': '.roocode/commands/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
export class RooCodeSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
8
9
|
toolId = 'roocode';
|
|
@@ -14,7 +15,8 @@ export class RooCodeSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
|
14
15
|
const descriptions = {
|
|
15
16
|
proposal: 'Scaffold a new LightSpec change and validate strictly.',
|
|
16
17
|
apply: 'Implement an approved LightSpec change and keep tasks in sync.',
|
|
17
|
-
archive: 'Archive a deployed LightSpec change and update specs.'
|
|
18
|
+
archive: 'Archive a deployed LightSpec change and update specs.',
|
|
19
|
+
'context-check': 'Validate project context in agent instruction files and help populate missing information.'
|
|
18
20
|
};
|
|
19
21
|
const description = descriptions[id];
|
|
20
22
|
return `# LightSpec: ${id.charAt(0).toUpperCase() + id.slice(1)}\n\n${description}`;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
-
import { SlashCommandId } from '../../templates/index.js';
|
|
3
2
|
export declare abstract class TomlSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
4
|
-
protected getFrontmatter(_id: SlashCommandId): string | undefined;
|
|
5
|
-
protected abstract getDescription(id: SlashCommandId): string;
|
|
6
|
-
generateAll(projectPath: string, _lightspecDir: string): Promise<string[]>;
|
|
7
|
-
private generateTOML;
|
|
8
|
-
protected updateBody(filePath: string, body: string): Promise<void>;
|
|
9
3
|
}
|
|
10
4
|
//# sourceMappingURL=toml-base.d.ts.map
|
|
@@ -1,53 +1,4 @@
|
|
|
1
|
-
import { FileSystemUtils } from '../../../utils/file-system.js';
|
|
2
1
|
import { SlashCommandConfigurator } from './base.js';
|
|
3
|
-
import { LIGHTSPEC_MARKERS } from '../../config.js';
|
|
4
2
|
export class TomlSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
5
|
-
getFrontmatter(_id) {
|
|
6
|
-
// TOML doesn't use separate frontmatter - it's all in one structure
|
|
7
|
-
return undefined;
|
|
8
|
-
}
|
|
9
|
-
// Override to generate TOML format with markers inside the prompt field
|
|
10
|
-
async generateAll(projectPath, _lightspecDir) {
|
|
11
|
-
const createdOrUpdated = [];
|
|
12
|
-
for (const target of this.getTargets()) {
|
|
13
|
-
const body = this.getBody(target.id);
|
|
14
|
-
const filePath = FileSystemUtils.joinPath(projectPath, target.path);
|
|
15
|
-
if (await FileSystemUtils.fileExists(filePath)) {
|
|
16
|
-
await this.updateBody(filePath, body);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
const tomlContent = this.generateTOML(target.id, body);
|
|
20
|
-
await FileSystemUtils.writeFile(filePath, tomlContent);
|
|
21
|
-
}
|
|
22
|
-
createdOrUpdated.push(target.path);
|
|
23
|
-
}
|
|
24
|
-
return createdOrUpdated;
|
|
25
|
-
}
|
|
26
|
-
generateTOML(id, body) {
|
|
27
|
-
const description = this.getDescription(id);
|
|
28
|
-
// TOML format with triple-quoted string for multi-line prompt
|
|
29
|
-
// Markers are inside the prompt value
|
|
30
|
-
return `description = "${description}"
|
|
31
|
-
|
|
32
|
-
prompt = """
|
|
33
|
-
${LIGHTSPEC_MARKERS.start}
|
|
34
|
-
${body}
|
|
35
|
-
${LIGHTSPEC_MARKERS.end}
|
|
36
|
-
"""
|
|
37
|
-
`;
|
|
38
|
-
}
|
|
39
|
-
// Override updateBody to handle TOML format
|
|
40
|
-
async updateBody(filePath, body) {
|
|
41
|
-
const content = await FileSystemUtils.readFile(filePath);
|
|
42
|
-
const startIndex = content.indexOf(LIGHTSPEC_MARKERS.start);
|
|
43
|
-
const endIndex = content.indexOf(LIGHTSPEC_MARKERS.end);
|
|
44
|
-
if (startIndex === -1 || endIndex === -1 || endIndex <= startIndex) {
|
|
45
|
-
throw new Error(`Missing LightSpec markers in ${filePath}`);
|
|
46
|
-
}
|
|
47
|
-
const before = content.slice(0, startIndex + LIGHTSPEC_MARKERS.start.length);
|
|
48
|
-
const after = content.slice(endIndex);
|
|
49
|
-
const updatedContent = `${before}\n${body}\n${after}`;
|
|
50
|
-
await FileSystemUtils.writeFile(filePath, updatedContent);
|
|
51
|
-
}
|
|
52
3
|
}
|
|
53
4
|
//# sourceMappingURL=toml-base.js.map
|
|
@@ -2,7 +2,8 @@ import { SlashCommandConfigurator } from './base.js';
|
|
|
2
2
|
const FILE_PATHS = {
|
|
3
3
|
proposal: '.windsurf/workflows/lightspec-proposal.md',
|
|
4
4
|
apply: '.windsurf/workflows/lightspec-apply.md',
|
|
5
|
-
archive: '.windsurf/workflows/lightspec-archive.md'
|
|
5
|
+
archive: '.windsurf/workflows/lightspec-archive.md',
|
|
6
|
+
'context-check': '.windsurf/workflows/lightspec-context-check.md'
|
|
6
7
|
};
|
|
7
8
|
export class WindsurfSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
8
9
|
toolId = 'windsurf';
|
|
@@ -14,7 +15,8 @@ export class WindsurfSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
|
14
15
|
const descriptions = {
|
|
15
16
|
proposal: 'Scaffold a new LightSpec change and validate strictly.',
|
|
16
17
|
apply: 'Implement an approved LightSpec change and keep tasks in sync.',
|
|
17
|
-
archive: 'Archive a deployed LightSpec change and update specs.'
|
|
18
|
+
archive: 'Archive a deployed LightSpec change and update specs.',
|
|
19
|
+
'context-check': 'Validate project context in agent instruction files and help populate missing information.'
|
|
18
20
|
};
|
|
19
21
|
const description = descriptions[id];
|
|
20
22
|
return `---\ndescription: ${description}\nauto_execution_mode: 3\n---`;
|
package/dist/core/init.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SkillInstallLocation } from './configurators/slash/base.js';
|
|
1
2
|
type ToolLabel = {
|
|
2
3
|
primary: string;
|
|
3
4
|
annotation?: string;
|
|
@@ -24,14 +25,19 @@ type ToolSelectionPrompt = (config: ToolWizardConfig) => Promise<string[]>;
|
|
|
24
25
|
type InitCommandOptions = {
|
|
25
26
|
prompt?: ToolSelectionPrompt;
|
|
26
27
|
tools?: string;
|
|
28
|
+
skillLocation?: SkillInstallLocation;
|
|
29
|
+
skillLocationPrompt?: () => Promise<SkillInstallLocation>;
|
|
27
30
|
};
|
|
28
31
|
export declare class InitCommand {
|
|
29
32
|
private readonly prompt;
|
|
30
33
|
private readonly toolsArg?;
|
|
34
|
+
private readonly skillLocationArg?;
|
|
35
|
+
private readonly skillLocationPrompt;
|
|
31
36
|
constructor(options?: InitCommandOptions);
|
|
32
37
|
execute(targetPath: string): Promise<void>;
|
|
33
38
|
private validate;
|
|
34
39
|
private getConfiguration;
|
|
40
|
+
private getSkillInstallLocation;
|
|
35
41
|
private getSelectedTools;
|
|
36
42
|
private resolveToolsArg;
|
|
37
43
|
private promptForAITools;
|