@fission-ai/openspec 0.23.0 → 1.0.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 +111 -382
- package/dist/cli/index.js +120 -6
- package/dist/commands/workflow/index.d.ts +17 -0
- package/dist/commands/workflow/index.js +12 -0
- package/dist/commands/workflow/instructions.d.ts +29 -0
- package/dist/commands/workflow/instructions.js +381 -0
- package/dist/commands/workflow/new-change.d.ts +11 -0
- package/dist/commands/workflow/new-change.js +44 -0
- package/dist/commands/workflow/schemas.d.ts +10 -0
- package/dist/commands/workflow/schemas.js +34 -0
- package/dist/commands/workflow/shared.d.ts +52 -0
- package/dist/commands/workflow/shared.js +111 -0
- package/dist/commands/workflow/status.d.ts +14 -0
- package/dist/commands/workflow/status.js +58 -0
- package/dist/commands/workflow/templates.d.ts +16 -0
- package/dist/commands/workflow/templates.js +68 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +5 -1
- package/dist/core/artifact-graph/instruction-loader.js +8 -19
- package/dist/core/command-generation/adapters/amazon-q.d.ts +13 -0
- package/dist/core/command-generation/adapters/amazon-q.js +26 -0
- package/dist/core/command-generation/adapters/antigravity.d.ts +13 -0
- package/dist/core/command-generation/adapters/antigravity.js +26 -0
- package/dist/core/command-generation/adapters/auggie.d.ts +13 -0
- package/dist/core/command-generation/adapters/auggie.js +27 -0
- package/dist/core/command-generation/adapters/claude.d.ts +13 -0
- package/dist/core/command-generation/adapters/claude.js +50 -0
- package/dist/core/command-generation/adapters/cline.d.ts +14 -0
- package/dist/core/command-generation/adapters/cline.js +27 -0
- package/dist/core/command-generation/adapters/codebuddy.d.ts +13 -0
- package/dist/core/command-generation/adapters/codebuddy.js +28 -0
- package/dist/core/command-generation/adapters/codex.d.ts +13 -0
- package/dist/core/command-generation/adapters/codex.js +27 -0
- package/dist/core/command-generation/adapters/continue.d.ts +13 -0
- package/dist/core/command-generation/adapters/continue.js +28 -0
- package/dist/core/command-generation/adapters/costrict.d.ts +13 -0
- package/dist/core/command-generation/adapters/costrict.js +27 -0
- package/dist/core/command-generation/adapters/crush.d.ts +13 -0
- package/dist/core/command-generation/adapters/crush.js +30 -0
- package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
- package/dist/core/command-generation/adapters/cursor.js +44 -0
- package/dist/core/command-generation/adapters/factory.d.ts +13 -0
- package/dist/core/command-generation/adapters/factory.js +27 -0
- package/dist/core/command-generation/adapters/gemini.d.ts +13 -0
- package/dist/core/command-generation/adapters/gemini.js +26 -0
- package/dist/core/command-generation/adapters/github-copilot.d.ts +13 -0
- package/dist/core/command-generation/adapters/github-copilot.js +26 -0
- package/dist/core/command-generation/adapters/iflow.d.ts +13 -0
- package/dist/core/command-generation/adapters/iflow.js +29 -0
- package/dist/core/command-generation/adapters/index.d.ts +27 -0
- package/dist/core/command-generation/adapters/index.js +27 -0
- package/dist/core/command-generation/adapters/kilocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/kilocode.js +23 -0
- package/dist/core/command-generation/adapters/opencode.d.ts +13 -0
- package/dist/core/command-generation/adapters/opencode.js +26 -0
- package/dist/core/command-generation/adapters/qoder.d.ts +13 -0
- package/dist/core/command-generation/adapters/qoder.js +30 -0
- package/dist/core/command-generation/adapters/qwen.d.ts +13 -0
- package/dist/core/command-generation/adapters/qwen.js +26 -0
- package/dist/core/command-generation/adapters/roocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/roocode.js +27 -0
- package/dist/core/command-generation/adapters/windsurf.d.ts +14 -0
- package/dist/core/command-generation/adapters/windsurf.js +51 -0
- package/dist/core/command-generation/generator.d.ts +21 -0
- package/dist/core/command-generation/generator.js +27 -0
- package/dist/core/command-generation/index.d.ts +22 -0
- package/dist/core/command-generation/index.js +24 -0
- package/dist/core/command-generation/registry.d.ts +36 -0
- package/dist/core/command-generation/registry.js +88 -0
- package/dist/core/command-generation/types.d.ts +55 -0
- package/dist/core/command-generation/types.js +8 -0
- package/dist/core/config.d.ts +1 -0
- package/dist/core/config.js +21 -21
- package/dist/core/init.d.ts +16 -36
- package/dist/core/init.js +323 -534
- package/dist/core/legacy-cleanup.d.ts +162 -0
- package/dist/core/legacy-cleanup.js +501 -0
- package/dist/core/shared/index.d.ts +8 -0
- package/dist/core/shared/index.js +8 -0
- package/dist/core/shared/skill-generation.d.ts +41 -0
- package/dist/core/shared/skill-generation.js +76 -0
- package/dist/core/shared/tool-detection.d.ts +66 -0
- package/dist/core/shared/tool-detection.js +140 -0
- package/dist/core/templates/index.d.ts +7 -16
- package/dist/core/templates/index.js +8 -36
- package/dist/core/templates/skill-templates.d.ts +13 -0
- package/dist/core/templates/skill-templates.js +627 -21
- package/dist/core/update.d.ts +38 -0
- package/dist/core/update.js +280 -62
- package/dist/prompts/searchable-multi-select.d.ts +27 -0
- package/dist/prompts/searchable-multi-select.js +149 -0
- package/dist/ui/ascii-patterns.d.ts +16 -0
- package/dist/ui/ascii-patterns.js +133 -0
- package/dist/ui/welcome-screen.d.ts +10 -0
- package/dist/ui/welcome-screen.js +146 -0
- package/dist/utils/file-system.d.ts +11 -0
- package/dist/utils/file-system.js +65 -2
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -0
- package/package.json +1 -1
- package/dist/commands/artifact-workflow.d.ts +0 -17
- package/dist/commands/artifact-workflow.js +0 -915
- package/dist/core/configurators/agents.d.ts +0 -8
- package/dist/core/configurators/agents.js +0 -15
- package/dist/core/configurators/base.d.ts +0 -7
- package/dist/core/configurators/base.js +0 -2
- package/dist/core/configurators/claude.d.ts +0 -8
- package/dist/core/configurators/claude.js +0 -15
- package/dist/core/configurators/cline.d.ts +0 -8
- package/dist/core/configurators/cline.js +0 -15
- package/dist/core/configurators/codebuddy.d.ts +0 -8
- package/dist/core/configurators/codebuddy.js +0 -15
- package/dist/core/configurators/costrict.d.ts +0 -8
- package/dist/core/configurators/costrict.js +0 -15
- package/dist/core/configurators/iflow.d.ts +0 -8
- package/dist/core/configurators/iflow.js +0 -15
- package/dist/core/configurators/qoder.d.ts +0 -30
- package/dist/core/configurators/qoder.js +0 -42
- package/dist/core/configurators/qwen.d.ts +0 -24
- package/dist/core/configurators/qwen.js +0 -37
- package/dist/core/configurators/registry.d.ts +0 -9
- package/dist/core/configurators/registry.js +0 -43
- package/dist/core/configurators/slash/amazon-q.d.ts +0 -9
- package/dist/core/configurators/slash/amazon-q.js +0 -46
- package/dist/core/configurators/slash/antigravity.d.ts +0 -9
- package/dist/core/configurators/slash/antigravity.js +0 -23
- package/dist/core/configurators/slash/auggie.d.ts +0 -9
- package/dist/core/configurators/slash/auggie.js +0 -31
- package/dist/core/configurators/slash/base.d.ts +0 -19
- package/dist/core/configurators/slash/base.js +0 -69
- package/dist/core/configurators/slash/claude.d.ts +0 -9
- package/dist/core/configurators/slash/claude.js +0 -37
- package/dist/core/configurators/slash/cline.d.ts +0 -9
- package/dist/core/configurators/slash/cline.js +0 -23
- package/dist/core/configurators/slash/codebuddy.d.ts +0 -9
- package/dist/core/configurators/slash/codebuddy.js +0 -34
- package/dist/core/configurators/slash/codex.d.ts +0 -14
- package/dist/core/configurators/slash/codex.js +0 -109
- package/dist/core/configurators/slash/continue.d.ts +0 -9
- package/dist/core/configurators/slash/continue.js +0 -46
- package/dist/core/configurators/slash/costrict.d.ts +0 -9
- package/dist/core/configurators/slash/costrict.js +0 -31
- package/dist/core/configurators/slash/crush.d.ts +0 -9
- package/dist/core/configurators/slash/crush.js +0 -37
- package/dist/core/configurators/slash/cursor.d.ts +0 -9
- package/dist/core/configurators/slash/cursor.js +0 -37
- package/dist/core/configurators/slash/factory.d.ts +0 -10
- package/dist/core/configurators/slash/factory.js +0 -35
- package/dist/core/configurators/slash/gemini.d.ts +0 -9
- package/dist/core/configurators/slash/gemini.js +0 -22
- package/dist/core/configurators/slash/github-copilot.d.ts +0 -9
- package/dist/core/configurators/slash/github-copilot.js +0 -34
- package/dist/core/configurators/slash/iflow.d.ts +0 -9
- package/dist/core/configurators/slash/iflow.js +0 -37
- package/dist/core/configurators/slash/kilocode.d.ts +0 -9
- package/dist/core/configurators/slash/kilocode.js +0 -17
- package/dist/core/configurators/slash/opencode.d.ts +0 -12
- package/dist/core/configurators/slash/opencode.js +0 -72
- package/dist/core/configurators/slash/qoder.d.ts +0 -35
- package/dist/core/configurators/slash/qoder.js +0 -76
- package/dist/core/configurators/slash/qwen.d.ts +0 -32
- package/dist/core/configurators/slash/qwen.js +0 -49
- package/dist/core/configurators/slash/registry.d.ts +0 -8
- package/dist/core/configurators/slash/registry.js +0 -78
- package/dist/core/configurators/slash/roocode.d.ts +0 -9
- package/dist/core/configurators/slash/roocode.js +0 -23
- package/dist/core/configurators/slash/toml-base.d.ts +0 -10
- package/dist/core/configurators/slash/toml-base.js +0 -53
- package/dist/core/configurators/slash/windsurf.d.ts +0 -9
- package/dist/core/configurators/slash/windsurf.js +0 -23
- package/dist/core/templates/agents-root-stub.d.ts +0 -2
- package/dist/core/templates/agents-root-stub.js +0 -17
- package/dist/core/templates/agents-template.d.ts +0 -2
- package/dist/core/templates/agents-template.js +0 -458
- package/dist/core/templates/claude-template.d.ts +0 -2
- package/dist/core/templates/claude-template.js +0 -2
- package/dist/core/templates/cline-template.d.ts +0 -2
- package/dist/core/templates/cline-template.js +0 -2
- package/dist/core/templates/costrict-template.d.ts +0 -2
- package/dist/core/templates/costrict-template.js +0 -2
- package/dist/core/templates/project-template.d.ts +0 -8
- package/dist/core/templates/project-template.js +0 -32
- package/dist/core/templates/slash-command-templates.d.ts +0 -4
- package/dist/core/templates/slash-command-templates.js +0 -49
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Generation Utilities
|
|
3
|
+
*
|
|
4
|
+
* Shared utilities for generating skill and command files.
|
|
5
|
+
*/
|
|
6
|
+
import { getOpsxExploreCommandTemplate, type SkillTemplate } from '../templates/skill-templates.js';
|
|
7
|
+
import type { CommandContent } from '../command-generation/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Skill template with directory name mapping.
|
|
10
|
+
*/
|
|
11
|
+
export interface SkillTemplateEntry {
|
|
12
|
+
template: SkillTemplate;
|
|
13
|
+
dirName: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Command template with ID mapping.
|
|
17
|
+
*/
|
|
18
|
+
export interface CommandTemplateEntry {
|
|
19
|
+
template: ReturnType<typeof getOpsxExploreCommandTemplate>;
|
|
20
|
+
id: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Gets all skill templates with their directory names.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getSkillTemplates(): SkillTemplateEntry[];
|
|
26
|
+
/**
|
|
27
|
+
* Gets all command templates with their IDs.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getCommandTemplates(): CommandTemplateEntry[];
|
|
30
|
+
/**
|
|
31
|
+
* Converts command templates to CommandContent array.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getCommandContents(): CommandContent[];
|
|
34
|
+
/**
|
|
35
|
+
* Generates skill file content with YAML frontmatter.
|
|
36
|
+
*
|
|
37
|
+
* @param template - The skill template
|
|
38
|
+
* @param generatedByVersion - The OpenSpec version to embed in the file
|
|
39
|
+
*/
|
|
40
|
+
export declare function generateSkillContent(template: SkillTemplate, generatedByVersion: string): string;
|
|
41
|
+
//# sourceMappingURL=skill-generation.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Generation Utilities
|
|
3
|
+
*
|
|
4
|
+
* Shared utilities for generating skill and command files.
|
|
5
|
+
*/
|
|
6
|
+
import { getExploreSkillTemplate, getNewChangeSkillTemplate, getContinueChangeSkillTemplate, getApplyChangeSkillTemplate, getFfChangeSkillTemplate, getSyncSpecsSkillTemplate, getArchiveChangeSkillTemplate, getBulkArchiveChangeSkillTemplate, getVerifyChangeSkillTemplate, getOnboardSkillTemplate, getOpsxExploreCommandTemplate, getOpsxNewCommandTemplate, getOpsxContinueCommandTemplate, getOpsxApplyCommandTemplate, getOpsxFfCommandTemplate, getOpsxSyncCommandTemplate, getOpsxArchiveCommandTemplate, getOpsxBulkArchiveCommandTemplate, getOpsxVerifyCommandTemplate, getOpsxOnboardCommandTemplate, } from '../templates/skill-templates.js';
|
|
7
|
+
/**
|
|
8
|
+
* Gets all skill templates with their directory names.
|
|
9
|
+
*/
|
|
10
|
+
export function getSkillTemplates() {
|
|
11
|
+
return [
|
|
12
|
+
{ template: getExploreSkillTemplate(), dirName: 'openspec-explore' },
|
|
13
|
+
{ template: getNewChangeSkillTemplate(), dirName: 'openspec-new-change' },
|
|
14
|
+
{ template: getContinueChangeSkillTemplate(), dirName: 'openspec-continue-change' },
|
|
15
|
+
{ template: getApplyChangeSkillTemplate(), dirName: 'openspec-apply-change' },
|
|
16
|
+
{ template: getFfChangeSkillTemplate(), dirName: 'openspec-ff-change' },
|
|
17
|
+
{ template: getSyncSpecsSkillTemplate(), dirName: 'openspec-sync-specs' },
|
|
18
|
+
{ template: getArchiveChangeSkillTemplate(), dirName: 'openspec-archive-change' },
|
|
19
|
+
{ template: getBulkArchiveChangeSkillTemplate(), dirName: 'openspec-bulk-archive-change' },
|
|
20
|
+
{ template: getVerifyChangeSkillTemplate(), dirName: 'openspec-verify-change' },
|
|
21
|
+
{ template: getOnboardSkillTemplate(), dirName: 'openspec-onboard' },
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Gets all command templates with their IDs.
|
|
26
|
+
*/
|
|
27
|
+
export function getCommandTemplates() {
|
|
28
|
+
return [
|
|
29
|
+
{ template: getOpsxExploreCommandTemplate(), id: 'explore' },
|
|
30
|
+
{ template: getOpsxNewCommandTemplate(), id: 'new' },
|
|
31
|
+
{ template: getOpsxContinueCommandTemplate(), id: 'continue' },
|
|
32
|
+
{ template: getOpsxApplyCommandTemplate(), id: 'apply' },
|
|
33
|
+
{ template: getOpsxFfCommandTemplate(), id: 'ff' },
|
|
34
|
+
{ template: getOpsxSyncCommandTemplate(), id: 'sync' },
|
|
35
|
+
{ template: getOpsxArchiveCommandTemplate(), id: 'archive' },
|
|
36
|
+
{ template: getOpsxBulkArchiveCommandTemplate(), id: 'bulk-archive' },
|
|
37
|
+
{ template: getOpsxVerifyCommandTemplate(), id: 'verify' },
|
|
38
|
+
{ template: getOpsxOnboardCommandTemplate(), id: 'onboard' },
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Converts command templates to CommandContent array.
|
|
43
|
+
*/
|
|
44
|
+
export function getCommandContents() {
|
|
45
|
+
const commandTemplates = getCommandTemplates();
|
|
46
|
+
return commandTemplates.map(({ template, id }) => ({
|
|
47
|
+
id,
|
|
48
|
+
name: template.name,
|
|
49
|
+
description: template.description,
|
|
50
|
+
category: template.category,
|
|
51
|
+
tags: template.tags,
|
|
52
|
+
body: template.content,
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Generates skill file content with YAML frontmatter.
|
|
57
|
+
*
|
|
58
|
+
* @param template - The skill template
|
|
59
|
+
* @param generatedByVersion - The OpenSpec version to embed in the file
|
|
60
|
+
*/
|
|
61
|
+
export function generateSkillContent(template, generatedByVersion) {
|
|
62
|
+
return `---
|
|
63
|
+
name: ${template.name}
|
|
64
|
+
description: ${template.description}
|
|
65
|
+
license: ${template.license || 'MIT'}
|
|
66
|
+
compatibility: ${template.compatibility || 'Requires openspec CLI.'}
|
|
67
|
+
metadata:
|
|
68
|
+
author: ${template.metadata?.author || 'openspec'}
|
|
69
|
+
version: "${template.metadata?.version || '1.0'}"
|
|
70
|
+
generatedBy: "${generatedByVersion}"
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
${template.instructions}
|
|
74
|
+
`;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=skill-generation.js.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Detection Utilities
|
|
3
|
+
*
|
|
4
|
+
* Shared utilities for detecting tool configurations and version status.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Names of skill directories created by openspec init.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SKILL_NAMES: readonly ["openspec-explore", "openspec-new-change", "openspec-continue-change", "openspec-apply-change", "openspec-ff-change", "openspec-sync-specs", "openspec-archive-change", "openspec-bulk-archive-change", "openspec-verify-change"];
|
|
10
|
+
export type SkillName = (typeof SKILL_NAMES)[number];
|
|
11
|
+
/**
|
|
12
|
+
* Status of skill configuration for a tool.
|
|
13
|
+
*/
|
|
14
|
+
export interface ToolSkillStatus {
|
|
15
|
+
/** Whether the tool has any skills configured */
|
|
16
|
+
configured: boolean;
|
|
17
|
+
/** Whether all 9 skills are configured */
|
|
18
|
+
fullyConfigured: boolean;
|
|
19
|
+
/** Number of skills currently configured (0-9) */
|
|
20
|
+
skillCount: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Version information for a tool's skills.
|
|
24
|
+
*/
|
|
25
|
+
export interface ToolVersionStatus {
|
|
26
|
+
/** The tool ID */
|
|
27
|
+
toolId: string;
|
|
28
|
+
/** The tool's display name */
|
|
29
|
+
toolName: string;
|
|
30
|
+
/** Whether the tool has any skills configured */
|
|
31
|
+
configured: boolean;
|
|
32
|
+
/** The generatedBy version found in the skill files, or null if not found */
|
|
33
|
+
generatedByVersion: string | null;
|
|
34
|
+
/** Whether the tool needs updating (version mismatch or missing) */
|
|
35
|
+
needsUpdate: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Gets the list of tools with skillsDir configured.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getToolsWithSkillsDir(): string[];
|
|
41
|
+
/**
|
|
42
|
+
* Checks which skill files exist for a tool.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getToolSkillStatus(projectRoot: string, toolId: string): ToolSkillStatus;
|
|
45
|
+
/**
|
|
46
|
+
* Gets the skill status for all tools with skillsDir configured.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getToolStates(projectRoot: string): Map<string, ToolSkillStatus>;
|
|
49
|
+
/**
|
|
50
|
+
* Extracts the generatedBy version from a skill file's YAML frontmatter.
|
|
51
|
+
* Returns null if the field is not found or the file doesn't exist.
|
|
52
|
+
*/
|
|
53
|
+
export declare function extractGeneratedByVersion(skillFilePath: string): string | null;
|
|
54
|
+
/**
|
|
55
|
+
* Gets version status for a tool by reading the first available skill file.
|
|
56
|
+
*/
|
|
57
|
+
export declare function getToolVersionStatus(projectRoot: string, toolId: string, currentVersion: string): ToolVersionStatus;
|
|
58
|
+
/**
|
|
59
|
+
* Gets all configured tools in the project.
|
|
60
|
+
*/
|
|
61
|
+
export declare function getConfiguredTools(projectRoot: string): string[];
|
|
62
|
+
/**
|
|
63
|
+
* Gets version status for all configured tools.
|
|
64
|
+
*/
|
|
65
|
+
export declare function getAllToolVersionStatus(projectRoot: string, currentVersion: string): ToolVersionStatus[];
|
|
66
|
+
//# sourceMappingURL=tool-detection.d.ts.map
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Detection Utilities
|
|
3
|
+
*
|
|
4
|
+
* Shared utilities for detecting tool configurations and version status.
|
|
5
|
+
*/
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import * as fs from 'fs';
|
|
8
|
+
import { AI_TOOLS } from '../config.js';
|
|
9
|
+
/**
|
|
10
|
+
* Names of skill directories created by openspec init.
|
|
11
|
+
*/
|
|
12
|
+
export const SKILL_NAMES = [
|
|
13
|
+
'openspec-explore',
|
|
14
|
+
'openspec-new-change',
|
|
15
|
+
'openspec-continue-change',
|
|
16
|
+
'openspec-apply-change',
|
|
17
|
+
'openspec-ff-change',
|
|
18
|
+
'openspec-sync-specs',
|
|
19
|
+
'openspec-archive-change',
|
|
20
|
+
'openspec-bulk-archive-change',
|
|
21
|
+
'openspec-verify-change',
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* Gets the list of tools with skillsDir configured.
|
|
25
|
+
*/
|
|
26
|
+
export function getToolsWithSkillsDir() {
|
|
27
|
+
return AI_TOOLS.filter((t) => t.skillsDir).map((t) => t.value);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Checks which skill files exist for a tool.
|
|
31
|
+
*/
|
|
32
|
+
export function getToolSkillStatus(projectRoot, toolId) {
|
|
33
|
+
const tool = AI_TOOLS.find((t) => t.value === toolId);
|
|
34
|
+
if (!tool?.skillsDir) {
|
|
35
|
+
return { configured: false, fullyConfigured: false, skillCount: 0 };
|
|
36
|
+
}
|
|
37
|
+
const skillsDir = path.join(projectRoot, tool.skillsDir, 'skills');
|
|
38
|
+
let skillCount = 0;
|
|
39
|
+
for (const skillName of SKILL_NAMES) {
|
|
40
|
+
const skillFile = path.join(skillsDir, skillName, 'SKILL.md');
|
|
41
|
+
if (fs.existsSync(skillFile)) {
|
|
42
|
+
skillCount++;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
configured: skillCount > 0,
|
|
47
|
+
fullyConfigured: skillCount === SKILL_NAMES.length,
|
|
48
|
+
skillCount,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Gets the skill status for all tools with skillsDir configured.
|
|
53
|
+
*/
|
|
54
|
+
export function getToolStates(projectRoot) {
|
|
55
|
+
const states = new Map();
|
|
56
|
+
const toolIds = AI_TOOLS.filter((t) => t.skillsDir).map((t) => t.value);
|
|
57
|
+
for (const toolId of toolIds) {
|
|
58
|
+
states.set(toolId, getToolSkillStatus(projectRoot, toolId));
|
|
59
|
+
}
|
|
60
|
+
return states;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Extracts the generatedBy version from a skill file's YAML frontmatter.
|
|
64
|
+
* Returns null if the field is not found or the file doesn't exist.
|
|
65
|
+
*/
|
|
66
|
+
export function extractGeneratedByVersion(skillFilePath) {
|
|
67
|
+
try {
|
|
68
|
+
if (!fs.existsSync(skillFilePath)) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
const content = fs.readFileSync(skillFilePath, 'utf-8');
|
|
72
|
+
// Look for generatedBy in the YAML frontmatter
|
|
73
|
+
// The file format is:
|
|
74
|
+
// ---
|
|
75
|
+
// ...
|
|
76
|
+
// metadata:
|
|
77
|
+
// author: openspec
|
|
78
|
+
// version: "1.0"
|
|
79
|
+
// generatedBy: "0.23.0"
|
|
80
|
+
// ---
|
|
81
|
+
const generatedByMatch = content.match(/^\s*generatedBy:\s*["']?([^"'\n]+)["']?\s*$/m);
|
|
82
|
+
if (generatedByMatch && generatedByMatch[1]) {
|
|
83
|
+
return generatedByMatch[1].trim();
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Gets version status for a tool by reading the first available skill file.
|
|
93
|
+
*/
|
|
94
|
+
export function getToolVersionStatus(projectRoot, toolId, currentVersion) {
|
|
95
|
+
const tool = AI_TOOLS.find((t) => t.value === toolId);
|
|
96
|
+
if (!tool?.skillsDir) {
|
|
97
|
+
return {
|
|
98
|
+
toolId,
|
|
99
|
+
toolName: toolId,
|
|
100
|
+
configured: false,
|
|
101
|
+
generatedByVersion: null,
|
|
102
|
+
needsUpdate: false,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const skillsDir = path.join(projectRoot, tool.skillsDir, 'skills');
|
|
106
|
+
let generatedByVersion = null;
|
|
107
|
+
// Find the first skill file that exists and read its version
|
|
108
|
+
for (const skillName of SKILL_NAMES) {
|
|
109
|
+
const skillFile = path.join(skillsDir, skillName, 'SKILL.md');
|
|
110
|
+
if (fs.existsSync(skillFile)) {
|
|
111
|
+
generatedByVersion = extractGeneratedByVersion(skillFile);
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const configured = getToolSkillStatus(projectRoot, toolId).configured;
|
|
116
|
+
const needsUpdate = configured && (generatedByVersion === null || generatedByVersion !== currentVersion);
|
|
117
|
+
return {
|
|
118
|
+
toolId,
|
|
119
|
+
toolName: tool.name,
|
|
120
|
+
configured,
|
|
121
|
+
generatedByVersion,
|
|
122
|
+
needsUpdate,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Gets all configured tools in the project.
|
|
127
|
+
*/
|
|
128
|
+
export function getConfiguredTools(projectRoot) {
|
|
129
|
+
return AI_TOOLS
|
|
130
|
+
.filter((t) => t.skillsDir && getToolSkillStatus(projectRoot, t.value).configured)
|
|
131
|
+
.map((t) => t.value);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Gets version status for all configured tools.
|
|
135
|
+
*/
|
|
136
|
+
export function getAllToolVersionStatus(projectRoot, currentVersion) {
|
|
137
|
+
const configuredTools = getConfiguredTools(projectRoot);
|
|
138
|
+
return configuredTools.map((toolId) => getToolVersionStatus(projectRoot, toolId, currentVersion));
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=tool-detection.js.map
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
static getTemplates(context?: ProjectContext): Template[];
|
|
9
|
-
static getClaudeTemplate(): string;
|
|
10
|
-
static getClineTemplate(): string;
|
|
11
|
-
static getCostrictTemplate(): string;
|
|
12
|
-
static getAgentsStandardTemplate(): string;
|
|
13
|
-
static getSlashCommandBody(id: SlashCommandId): string;
|
|
14
|
-
}
|
|
15
|
-
export { ProjectContext } from './project-template.js';
|
|
16
|
-
export type { SlashCommandId } from './slash-command-templates.js';
|
|
1
|
+
/**
|
|
2
|
+
* Template exports for OpenSpec.
|
|
3
|
+
*
|
|
4
|
+
* The old config file templates (AGENTS.md, project.md, claude-template, etc.)
|
|
5
|
+
* have been removed. The skill-based workflow uses skill-templates.ts directly.
|
|
6
|
+
*/
|
|
7
|
+
export { getExploreSkillTemplate, getNewChangeSkillTemplate, getContinueChangeSkillTemplate, getApplyChangeSkillTemplate, getFfChangeSkillTemplate, getSyncSpecsSkillTemplate, getArchiveChangeSkillTemplate, getBulkArchiveChangeSkillTemplate, getVerifyChangeSkillTemplate, getOpsxExploreCommandTemplate, getOpsxNewCommandTemplate, getOpsxContinueCommandTemplate, getOpsxApplyCommandTemplate, getOpsxFfCommandTemplate, getOpsxSyncCommandTemplate, getOpsxArchiveCommandTemplate, getOpsxBulkArchiveCommandTemplate, getOpsxVerifyCommandTemplate, } from './skill-templates.js';
|
|
17
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,37 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
static getTemplates(context = {}) {
|
|
10
|
-
return [
|
|
11
|
-
{
|
|
12
|
-
path: 'AGENTS.md',
|
|
13
|
-
content: agentsTemplate
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
path: 'project.md',
|
|
17
|
-
content: projectTemplate(context)
|
|
18
|
-
}
|
|
19
|
-
];
|
|
20
|
-
}
|
|
21
|
-
static getClaudeTemplate() {
|
|
22
|
-
return claudeTemplate;
|
|
23
|
-
}
|
|
24
|
-
static getClineTemplate() {
|
|
25
|
-
return clineTemplate;
|
|
26
|
-
}
|
|
27
|
-
static getCostrictTemplate() {
|
|
28
|
-
return costrictTemplate;
|
|
29
|
-
}
|
|
30
|
-
static getAgentsStandardTemplate() {
|
|
31
|
-
return agentsRootStubTemplate;
|
|
32
|
-
}
|
|
33
|
-
static getSlashCommandBody(id) {
|
|
34
|
-
return getSlashCommandBody(id);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Template exports for OpenSpec.
|
|
3
|
+
*
|
|
4
|
+
* The old config file templates (AGENTS.md, project.md, claude-template, etc.)
|
|
5
|
+
* have been removed. The skill-based workflow uses skill-templates.ts directly.
|
|
6
|
+
*/
|
|
7
|
+
// Re-export skill templates for convenience
|
|
8
|
+
export { getExploreSkillTemplate, getNewChangeSkillTemplate, getContinueChangeSkillTemplate, getApplyChangeSkillTemplate, getFfChangeSkillTemplate, getSyncSpecsSkillTemplate, getArchiveChangeSkillTemplate, getBulkArchiveChangeSkillTemplate, getVerifyChangeSkillTemplate, getOpsxExploreCommandTemplate, getOpsxNewCommandTemplate, getOpsxContinueCommandTemplate, getOpsxApplyCommandTemplate, getOpsxFfCommandTemplate, getOpsxSyncCommandTemplate, getOpsxArchiveCommandTemplate, getOpsxBulkArchiveCommandTemplate, getOpsxVerifyCommandTemplate, } from './skill-templates.js';
|
|
37
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -11,6 +11,9 @@ export interface SkillTemplate {
|
|
|
11
11
|
name: string;
|
|
12
12
|
description: string;
|
|
13
13
|
instructions: string;
|
|
14
|
+
license?: string;
|
|
15
|
+
compatibility?: string;
|
|
16
|
+
metadata?: Record<string, string>;
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* Template for openspec-explore skill
|
|
@@ -42,6 +45,11 @@ export declare function getFfChangeSkillTemplate(): SkillTemplate;
|
|
|
42
45
|
* For syncing delta specs from a change to main specs (agent-driven)
|
|
43
46
|
*/
|
|
44
47
|
export declare function getSyncSpecsSkillTemplate(): SkillTemplate;
|
|
48
|
+
/**
|
|
49
|
+
* Template for openspec-onboard skill
|
|
50
|
+
* Guided onboarding through the complete OpenSpec workflow
|
|
51
|
+
*/
|
|
52
|
+
export declare function getOnboardSkillTemplate(): SkillTemplate;
|
|
45
53
|
export interface CommandTemplate {
|
|
46
54
|
name: string;
|
|
47
55
|
description: string;
|
|
@@ -93,6 +101,11 @@ export declare function getVerifyChangeSkillTemplate(): SkillTemplate;
|
|
|
93
101
|
* Template for /opsx:archive slash command
|
|
94
102
|
*/
|
|
95
103
|
export declare function getOpsxArchiveCommandTemplate(): CommandTemplate;
|
|
104
|
+
/**
|
|
105
|
+
* Template for /opsx:onboard slash command
|
|
106
|
+
* Guided onboarding through the complete OpenSpec workflow
|
|
107
|
+
*/
|
|
108
|
+
export declare function getOpsxOnboardCommandTemplate(): CommandTemplate;
|
|
96
109
|
/**
|
|
97
110
|
* Template for /opsx:bulk-archive slash command
|
|
98
111
|
*/
|