clavix 5.5.1 → 5.6.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/dist/cli/commands/init.d.ts +1 -0
- package/dist/cli/commands/init.js +24 -4
- package/dist/cli/commands/update.js +3 -6
- package/dist/constants.d.ts +0 -11
- package/dist/constants.js +0 -16
- package/dist/core/adapter-registry.d.ts +5 -0
- package/dist/core/adapter-registry.js +5 -0
- package/dist/core/adapters/agents-md-generator.js +2 -1
- package/dist/core/adapters/copilot-instructions-generator.js +2 -1
- package/dist/core/adapters/instructions-generator.js +3 -2
- package/dist/core/adapters/octo-md-generator.js +2 -1
- package/dist/core/adapters/warp-md-generator.js +2 -1
- package/dist/core/doc-injector.js +16 -7
- package/dist/core/template-assembler.d.ts +2 -0
- package/dist/core/template-assembler.js +26 -5
- package/dist/templates/agents/agents.md +4 -0
- package/dist/templates/instructions/QUICKSTART.md +65 -0
- package/dist/templates/slash-commands/_canonical/improve.md +4 -4
- package/dist/templates/slash-commands/_canonical/prd.md +10 -4
- package/dist/templates/slash-commands/_canonical/refine.md +612 -0
- package/dist/templates/slash-commands/_components/MANIFEST.md +15 -1
- package/dist/templates/slash-commands/_components/agent-protocols/self-correction-protocol.md +21 -0
- package/dist/templates/slash-commands/_components/agent-protocols/state-assertion.md +12 -0
- package/dist/templates/slash-commands/_components/sections/prd-examples.md +22 -0
- package/dist/utils/agent-error-messages.d.ts +25 -0
- package/dist/utils/agent-error-messages.js +69 -1
- package/dist/utils/integration-selector.d.ts +12 -0
- package/dist/utils/integration-selector.js +19 -2
- package/dist/utils/toml-templates.js +3 -2
- package/dist/utils/version.d.ts +0 -5
- package/dist/utils/version.js +0 -14
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -82,5 +82,30 @@ export declare class AgentErrorMessages {
|
|
|
82
82
|
* Used by: implement workflow when marking already-done task
|
|
83
83
|
*/
|
|
84
84
|
static taskAlreadyCompleted(taskId: string): string;
|
|
85
|
+
/**
|
|
86
|
+
* Error: Template not found
|
|
87
|
+
* Used by: template-loader.ts, commands generating slash commands
|
|
88
|
+
*/
|
|
89
|
+
static templateNotFound(templateName: string, searchPath?: string): string;
|
|
90
|
+
/**
|
|
91
|
+
* Error: Adapter/integration not found
|
|
92
|
+
* Used by: agent-manager.ts, init.ts
|
|
93
|
+
*/
|
|
94
|
+
static adapterNotFound(adapterName: string, availableAdapters?: string[]): string;
|
|
95
|
+
/**
|
|
96
|
+
* Error: Configuration loading failed
|
|
97
|
+
* Used by: init.ts, update.ts when .clavix/config.json is invalid
|
|
98
|
+
*/
|
|
99
|
+
static configLoadFailed(configPath: string, reason?: string): string;
|
|
100
|
+
/**
|
|
101
|
+
* Error: Update command failed
|
|
102
|
+
* Used by: update.ts when template regeneration fails
|
|
103
|
+
*/
|
|
104
|
+
static updateFailed(reason: string): string;
|
|
105
|
+
/**
|
|
106
|
+
* Error: Diagnostic check failed
|
|
107
|
+
* Used by: diagnose.ts when health check identifies issues
|
|
108
|
+
*/
|
|
109
|
+
static diagnosticFailed(issues: string[]): string;
|
|
85
110
|
}
|
|
86
111
|
//# sourceMappingURL=agent-error-messages.d.ts.map
|
|
@@ -17,7 +17,7 @@ export class AgentErrorMessages {
|
|
|
17
17
|
'Agent recovery options:\n' +
|
|
18
18
|
' 1. Execute /clavix:prd to generate comprehensive PRD\n' +
|
|
19
19
|
' 2. Execute /clavix:summarize if conversation exists\n\n' +
|
|
20
|
-
'Select option and
|
|
20
|
+
'Select option and run, then retry this command.');
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Error: No tasks.md found for specified project
|
|
@@ -191,5 +191,73 @@ export class AgentErrorMessages {
|
|
|
191
191
|
' 3. Check if this was intended\n\n' +
|
|
192
192
|
'No action needed unless forced.');
|
|
193
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* Error: Template not found
|
|
196
|
+
* Used by: template-loader.ts, commands generating slash commands
|
|
197
|
+
*/
|
|
198
|
+
static templateNotFound(templateName, searchPath) {
|
|
199
|
+
const pathInfo = searchPath ? `\nSearch path: ${searchPath}` : '';
|
|
200
|
+
return (`Template not found: ${templateName}${pathInfo}\n\n` +
|
|
201
|
+
'Agent recovery options:\n' +
|
|
202
|
+
" 1. Run 'clavix update' to regenerate templates\n" +
|
|
203
|
+
' 2. Check if Clavix is installed correctly\n' +
|
|
204
|
+
' 3. Verify template name is spelled correctly\n\n' +
|
|
205
|
+
'After recovery, retry the command.');
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Error: Adapter/integration not found
|
|
209
|
+
* Used by: agent-manager.ts, init.ts
|
|
210
|
+
*/
|
|
211
|
+
static adapterNotFound(adapterName, availableAdapters) {
|
|
212
|
+
const adapterList = availableAdapters
|
|
213
|
+
? '\n\nAvailable adapters:\n' + availableAdapters.map((a) => ` • ${a}`).join('\n')
|
|
214
|
+
: '';
|
|
215
|
+
return (`Adapter not found: ${adapterName}${adapterList}\n\n` +
|
|
216
|
+
'Agent recovery options:\n' +
|
|
217
|
+
' 1. Check adapter name is spelled correctly\n' +
|
|
218
|
+
" 2. Run 'clavix diagnose' to see available integrations\n" +
|
|
219
|
+
' 3. Adapter may have been removed or renamed\n\n' +
|
|
220
|
+
'Use a valid adapter name and retry.');
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Error: Configuration loading failed
|
|
224
|
+
* Used by: init.ts, update.ts when .clavix/config.json is invalid
|
|
225
|
+
*/
|
|
226
|
+
static configLoadFailed(configPath, reason) {
|
|
227
|
+
const reasonInfo = reason ? `\nReason: ${reason}` : '';
|
|
228
|
+
return (`Failed to load configuration: ${configPath}${reasonInfo}\n\n` +
|
|
229
|
+
'Agent recovery options:\n' +
|
|
230
|
+
" 1. Run 'clavix init' to regenerate configuration\n" +
|
|
231
|
+
' 2. Check .clavix/config.json syntax is valid JSON\n' +
|
|
232
|
+
' 3. Remove .clavix/ and reinitialize\n\n' +
|
|
233
|
+
'After fixing configuration, retry the command.');
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Error: Update command failed
|
|
237
|
+
* Used by: update.ts when template regeneration fails
|
|
238
|
+
*/
|
|
239
|
+
static updateFailed(reason) {
|
|
240
|
+
return (`Update failed: ${reason}\n\n` +
|
|
241
|
+
'Agent recovery options:\n' +
|
|
242
|
+
' 1. Check Clavix is installed correctly: clavix --version\n' +
|
|
243
|
+
' 2. Verify write permissions in project directory\n' +
|
|
244
|
+
" 3. Try removing .clavix/ and running 'clavix init'\n\n" +
|
|
245
|
+
'Fix the underlying issue and retry.');
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Error: Diagnostic check failed
|
|
249
|
+
* Used by: diagnose.ts when health check identifies issues
|
|
250
|
+
*/
|
|
251
|
+
static diagnosticFailed(issues) {
|
|
252
|
+
const issueList = issues.map((issue) => ` • ${issue}`).join('\n');
|
|
253
|
+
return ('Diagnostic check identified issues:\n\n' +
|
|
254
|
+
issueList +
|
|
255
|
+
'\n\n' +
|
|
256
|
+
'Agent recovery options:\n' +
|
|
257
|
+
" 1. Run 'clavix update' to fix template issues\n" +
|
|
258
|
+
" 2. Run 'clavix init' to reinitialize configuration\n" +
|
|
259
|
+
' 3. Check file permissions in project directory\n\n' +
|
|
260
|
+
'Address issues above and rerun diagnose.');
|
|
261
|
+
}
|
|
194
262
|
}
|
|
195
263
|
//# sourceMappingURL=agent-error-messages.js.map
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { AgentManager } from '../core/agent-manager.js';
|
|
2
|
+
/**
|
|
3
|
+
* AGENTS.md is always enabled by default.
|
|
4
|
+
* It provides universal agent guidance that all AI tools can read.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MANDATORY_INTEGRATION = "agents-md";
|
|
2
7
|
/**
|
|
3
8
|
* Interactive integration selection utility
|
|
4
9
|
* Displays multi-select checkbox for all available integrations
|
|
5
10
|
* Used by both init and config commands
|
|
11
|
+
*
|
|
12
|
+
* Note: AGENTS.md is always enabled and not shown in selection
|
|
6
13
|
*/
|
|
7
14
|
export declare function selectIntegrations(agentManager: AgentManager, preSelected?: string[]): Promise<string[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Ensures AGENTS.md is always included in the final integration list.
|
|
17
|
+
* Call this after selectIntegrations() to enforce mandatory integrations.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ensureMandatoryIntegrations(integrations: string[]): string[];
|
|
8
20
|
//# sourceMappingURL=integration-selector.d.ts.map
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
2
|
+
/**
|
|
3
|
+
* AGENTS.md is always enabled by default.
|
|
4
|
+
* It provides universal agent guidance that all AI tools can read.
|
|
5
|
+
*/
|
|
6
|
+
export const MANDATORY_INTEGRATION = 'agents-md';
|
|
2
7
|
/**
|
|
3
8
|
* Interactive integration selection utility
|
|
4
9
|
* Displays multi-select checkbox for all available integrations
|
|
5
10
|
* Used by both init and config commands
|
|
11
|
+
*
|
|
12
|
+
* Note: AGENTS.md is always enabled and not shown in selection
|
|
6
13
|
*/
|
|
7
14
|
export async function selectIntegrations(agentManager, preSelected = []) {
|
|
8
15
|
const { selectedIntegrations } = await inquirer.prompt([
|
|
@@ -31,8 +38,8 @@ export async function selectIntegrations(agentManager, preSelected = []) {
|
|
|
31
38
|
{ name: 'Roocode (.roo/clavix/)', value: 'roocode' },
|
|
32
39
|
{ name: 'Windsurf (.windsurf/rules/)', value: 'windsurf' },
|
|
33
40
|
new inquirer.Separator(),
|
|
34
|
-
new inquirer.Separator('=== Universal Adapters ==='),
|
|
35
|
-
|
|
41
|
+
new inquirer.Separator('=== Optional Universal Adapters ==='),
|
|
42
|
+
// Note: AGENTS.md is always enabled (not shown here)
|
|
36
43
|
{ name: 'GitHub Copilot (.github/copilot-instructions.md)', value: 'copilot-instructions' },
|
|
37
44
|
{ name: 'OCTO.md (Universal)', value: 'octo-md' },
|
|
38
45
|
{ name: 'WARP.md (Universal)', value: 'warp-md' },
|
|
@@ -57,4 +64,14 @@ export async function selectIntegrations(agentManager, preSelected = []) {
|
|
|
57
64
|
]);
|
|
58
65
|
return selectedIntegrations;
|
|
59
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Ensures AGENTS.md is always included in the final integration list.
|
|
69
|
+
* Call this after selectIntegrations() to enforce mandatory integrations.
|
|
70
|
+
*/
|
|
71
|
+
export function ensureMandatoryIntegrations(integrations) {
|
|
72
|
+
if (!integrations.includes(MANDATORY_INTEGRATION)) {
|
|
73
|
+
return [MANDATORY_INTEGRATION, ...integrations];
|
|
74
|
+
}
|
|
75
|
+
return integrations;
|
|
76
|
+
}
|
|
60
77
|
//# sourceMappingURL=integration-selector.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataError } from '../types/errors.js';
|
|
1
2
|
/**
|
|
2
3
|
* Parse TOML-based slash command templates (Gemini/Qwen) and extract metadata.
|
|
3
4
|
* Ensures the resulting prompt body does not include duplicated frontmatter.
|
|
@@ -10,13 +11,13 @@ export function parseTomlSlashCommand(content, templateName, integrationName) {
|
|
|
10
11
|
const descriptionMatch = normalized.match(/^\s*description\s*=\s*(['"])(.*?)\1\s*$/m);
|
|
11
12
|
const promptHeaderMatch = normalized.match(/^\s*prompt\s*=\s*"""/m);
|
|
12
13
|
if (!promptHeaderMatch || promptHeaderMatch.index === undefined) {
|
|
13
|
-
throw new
|
|
14
|
+
throw new DataError(`Template ${templateName}.toml for ${integrationName} is missing a prompt = """ ... """ block.`, 'Check the template file format. TOML templates require prompt = """...""" syntax.');
|
|
14
15
|
}
|
|
15
16
|
const bodyStart = promptHeaderMatch.index + promptHeaderMatch[0].length;
|
|
16
17
|
const bodyRemainder = normalized.slice(bodyStart);
|
|
17
18
|
const closingIndex = bodyRemainder.indexOf('"""');
|
|
18
19
|
if (closingIndex === -1) {
|
|
19
|
-
throw new
|
|
20
|
+
throw new DataError(`Template ${templateName}.toml for ${integrationName} does not terminate its prompt = """ ... """ block.`, 'Add closing """ to the prompt block.');
|
|
20
21
|
}
|
|
21
22
|
let promptBody = bodyRemainder.slice(0, closingIndex);
|
|
22
23
|
const promptLines = promptBody.split('\n');
|
package/dist/utils/version.d.ts
CHANGED
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
* Version utility for Clavix
|
|
3
3
|
* Centralizes version reading from package.json
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
6
|
-
* Get the current Clavix version from package.json
|
|
7
|
-
* Returns '0.0.0' if package.json cannot be read
|
|
8
|
-
*/
|
|
9
|
-
export declare function getVersion(): Promise<string>;
|
|
10
5
|
/**
|
|
11
6
|
* Get version synchronously (for use in type definitions)
|
|
12
7
|
* Falls back to hardcoded version if file cannot be read
|
package/dist/utils/version.js
CHANGED
|
@@ -7,20 +7,6 @@ import path from 'path';
|
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
9
|
const __dirname = path.dirname(__filename);
|
|
10
|
-
/**
|
|
11
|
-
* Get the current Clavix version from package.json
|
|
12
|
-
* Returns '0.0.0' if package.json cannot be read
|
|
13
|
-
*/
|
|
14
|
-
export async function getVersion() {
|
|
15
|
-
try {
|
|
16
|
-
const packageJsonPath = path.join(__dirname, '../../package.json');
|
|
17
|
-
const packageJson = await fs.readJson(packageJsonPath);
|
|
18
|
-
return packageJson.version || '0.0.0';
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
return '0.0.0';
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
10
|
/**
|
|
25
11
|
* Get version synchronously (for use in type definitions)
|
|
26
12
|
* Falls back to hardcoded version if file cannot be read
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavix",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"description": "Agentic-first prompt workflows. Markdown templates that teach AI agents how to optimize prompts, create PRDs, and manage implementation.\n\nSLASH COMMANDS (in your AI assistant):\n /clavix:improve Optimize prompts with auto-depth\n /clavix:prd Generate PRD through questions\n /clavix:plan Create task breakdown from PRD\n /clavix:implement Execute tasks with progress tracking\n /clavix:start Begin conversational session\n /clavix:summarize Extract requirements from conversation\n\nWorks with Claude Code, Cursor, Windsurf, and 19+ other AI coding tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|