clavix 5.3.0 → 5.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/dist/cli/commands/update.js +1 -1
- package/dist/core/adapters/base-adapter.js +11 -0
- package/dist/templates/agents/warp.md +2 -2
- package/dist/templates/instructions/README.md +5 -3
- package/dist/templates/slash-commands/_canonical/archive.md +28 -0
- package/dist/templates/slash-commands/_canonical/implement.md +29 -0
- package/dist/templates/slash-commands/_canonical/improve.md +27 -39
- package/dist/templates/slash-commands/_canonical/verify.md +28 -0
- package/dist/types/config.d.ts +0 -1
- package/dist/types/config.js +0 -1
- package/dist/utils/agent-error-messages.d.ts +0 -5
- package/dist/utils/agent-error-messages.js +1 -15
- package/dist/utils/legacy-command-cleanup.d.ts +6 -4
- package/dist/utils/legacy-command-cleanup.js +6 -4
- package/dist/utils/toml-templates.d.ts +1 -1
- package/dist/utils/toml-templates.js +3 -3
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -55,7 +55,7 @@ export default class Update extends Command {
|
|
|
55
55
|
const updateDocs = flags['docs-only'] || (!flags['docs-only'] && !flags['commands-only']);
|
|
56
56
|
const updateCommands = flags['commands-only'] || (!flags['docs-only'] && !flags['commands-only']);
|
|
57
57
|
let updatedCount = 0;
|
|
58
|
-
// Update for each
|
|
58
|
+
// Update for each integration
|
|
59
59
|
for (const integrationName of integrations) {
|
|
60
60
|
// Handle AGENTS.md separately
|
|
61
61
|
if (integrationName === 'agents-md') {
|
|
@@ -85,6 +85,17 @@ export class BaseAdapter {
|
|
|
85
85
|
console.warn(`Failed to remove ${filePath}: ${error}`);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
+
// Also remove clavix/ subdirectory if it exists (legacy cleanup)
|
|
89
|
+
const clavixSubdir = path.join(commandPath, 'clavix');
|
|
90
|
+
if (await FileSystem.exists(clavixSubdir)) {
|
|
91
|
+
try {
|
|
92
|
+
await FileSystem.remove(clavixSubdir);
|
|
93
|
+
removed++;
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
console.warn(`Failed to remove ${clavixSubdir}: ${error}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
88
99
|
return removed;
|
|
89
100
|
}
|
|
90
101
|
/**
|
|
@@ -20,8 +20,8 @@ Clavix helps Warp developers turn rough ideas into quality, AI-ready prompts and
|
|
|
20
20
|
- ❌ DO NOT implement features during these workflows
|
|
21
21
|
|
|
22
22
|
**IMPLEMENTATION workflows** (CODE ALLOWED):
|
|
23
|
-
- Only after user runs
|
|
24
|
-
- Your role: Write code,
|
|
23
|
+
- Only after user runs `/clavix:implement`
|
|
24
|
+
- Your role: Write code, implement tasks, build features
|
|
25
25
|
- ✅ DO implement code during these workflows
|
|
26
26
|
|
|
27
27
|
See `.clavix/instructions/core/clavix-mode.md` for complete mode documentation.
|
|
@@ -270,9 +270,11 @@ npm run validate:consistency
|
|
|
270
270
|
- `implement.md` - Task and prompt execution workflow
|
|
271
271
|
|
|
272
272
|
### Agent Protocols
|
|
273
|
-
- `_components/agent-protocols/
|
|
273
|
+
- `_components/agent-protocols/AGENT_MANUAL.md` - Universal agent protocols
|
|
274
|
+
- `_components/agent-protocols/cli-reference.md` - CLI command reference
|
|
274
275
|
- `_components/agent-protocols/state-awareness.md` - Workflow state tracking
|
|
275
|
-
- `_components/agent-protocols/
|
|
276
|
+
- `_components/agent-protocols/supportive-companion.md` - Conversational guidance
|
|
277
|
+
- `_components/agent-protocols/task-blocking.md` - Blocked task handling
|
|
276
278
|
|
|
277
279
|
### Validation
|
|
278
280
|
- `scripts/validate-consistency.ts` - TypeScript ↔ Template validator
|
|
@@ -280,6 +282,6 @@ npm run validate:consistency
|
|
|
280
282
|
|
|
281
283
|
---
|
|
282
284
|
|
|
283
|
-
**Last updated:** v5.
|
|
285
|
+
**Last updated:** v5.4.0
|
|
284
286
|
|
|
285
287
|
**Validation:** Run `npm run validate:consistency` before committing changes.
|
|
@@ -21,6 +21,34 @@ When you run `/clavix:archive`, I:
|
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
24
|
+
## State Assertion (REQUIRED)
|
|
25
|
+
|
|
26
|
+
Before ANY action, output this confirmation:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
**CLAVIX MODE: Archival**
|
|
30
|
+
Mode: management
|
|
31
|
+
Purpose: Organizing completed projects
|
|
32
|
+
Implementation: BLOCKED (file operations only)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Self-Correction Protocol
|
|
38
|
+
|
|
39
|
+
If you catch yourself doing any of these, STOP and correct:
|
|
40
|
+
|
|
41
|
+
1. **Deleting Without Confirmation** - Must get explicit user confirmation for deletes
|
|
42
|
+
2. **Archiving Incomplete Projects** - Should warn if tasks.md has unchecked items
|
|
43
|
+
3. **Wrong Directory Operations** - Operating on wrong project directory
|
|
44
|
+
4. **Skipping Safety Checks** - Not verifying project exists before operations
|
|
45
|
+
5. **Silent Failures** - Not reporting when operations fail
|
|
46
|
+
6. **Capability Hallucination** - Claiming Clavix can do things it cannot
|
|
47
|
+
|
|
48
|
+
**DETECT → STOP → CORRECT → RESUME**
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
24
52
|
## CLAVIX MODE: Archival
|
|
25
53
|
|
|
26
54
|
**I'm in archival mode. Organizing your completed work.**
|
|
@@ -44,6 +44,35 @@ Override auto-detection when needed:
|
|
|
44
44
|
|
|
45
45
|
---
|
|
46
46
|
|
|
47
|
+
## State Assertion (REQUIRED)
|
|
48
|
+
|
|
49
|
+
Before ANY action, output this confirmation:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
**CLAVIX MODE: Implementation**
|
|
53
|
+
Mode: implementation
|
|
54
|
+
Purpose: Executing tasks or prompts with code generation
|
|
55
|
+
Source: [tasks.md | prompts/ | user request]
|
|
56
|
+
Implementation: AUTHORIZED
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Self-Correction Protocol
|
|
62
|
+
|
|
63
|
+
If you catch yourself doing any of these, STOP and correct:
|
|
64
|
+
|
|
65
|
+
1. **Skipping Auto-Detection** - Not checking for tasks.md and prompts/ before asking
|
|
66
|
+
2. **Implementing Without Reading** - Starting code before reading the full task/prompt
|
|
67
|
+
3. **Skipping Verification** - Not running tests after implementation
|
|
68
|
+
4. **Batch Task Completion** - Marking multiple tasks done without implementing each
|
|
69
|
+
5. **Ignoring Blocked Tasks** - Not reporting when a task cannot be completed
|
|
70
|
+
6. **Capability Hallucination** - Claiming Clavix can do things it cannot
|
|
71
|
+
|
|
72
|
+
**DETECT → STOP → CORRECT → RESUME**
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
47
76
|
## CLAVIX MODE: Implementation
|
|
48
77
|
|
|
49
78
|
**I'm in implementation mode. Building your tasks!**
|
|
@@ -1,61 +1,49 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: "Clavix:
|
|
3
|
-
description: Analyze and
|
|
2
|
+
name: "Clavix: Improve Your Prompt"
|
|
3
|
+
description: Analyze and improve prompts with auto-detected depth
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Clavix:
|
|
6
|
+
# Clavix: Improve Your Prompt
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Important: This is Planning Mode
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
This is a prompt improvement workflow. Your job is to ANALYZE and IMPROVE the prompt, then STOP.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
**What this mode does:**
|
|
13
|
+
- Analyze the user's prompt for quality
|
|
14
|
+
- Apply improvement patterns
|
|
15
|
+
- Generate an optimized version
|
|
16
|
+
- Save to `.clavix/outputs/prompts/`
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
**What this mode does NOT do:**
|
|
19
|
+
- Write application code
|
|
20
|
+
- Implement features described in the prompt
|
|
21
|
+
- Modify files outside `.clavix/`
|
|
22
|
+
- Explore the codebase
|
|
16
23
|
|
|
17
|
-
|
|
18
|
-
- Reading project files to "understand context" before showing analysis
|
|
19
|
-
- Writing any code files (functions, classes, components)
|
|
20
|
-
- Creating components, features, or API endpoints
|
|
21
|
-
- Running build/test commands on the user's project
|
|
22
|
-
- Making git commits
|
|
23
|
-
- ANY action that modifies files outside `.clavix/`
|
|
24
|
-
- Exploring the codebase before outputting your analysis
|
|
25
|
-
|
|
26
|
-
## The ONLY Actions Allowed
|
|
27
|
-
1. Read the user's prompt text (the `{{ARGS}}` provided)
|
|
28
|
-
2. Analyze it using the workflow below
|
|
29
|
-
3. Output the analysis (intent, quality, optimized prompt)
|
|
30
|
-
4. Save to `.clavix/outputs/prompts/`
|
|
31
|
-
5. STOP and wait for `/clavix:implement`
|
|
32
|
-
|
|
33
|
-
## IF USER WANTS TO IMPLEMENT:
|
|
34
|
-
Tell them: **"Run `/clavix:implement --latest` to implement this prompt."**
|
|
35
|
-
|
|
36
|
-
**DO NOT IMPLEMENT YOURSELF. YOUR JOB ENDS AFTER SHOWING THE OPTIMIZED PROMPT.**
|
|
24
|
+
**After improving the prompt:** Tell the user to run `/clavix:implement --latest` when ready to build.
|
|
37
25
|
|
|
38
26
|
---
|
|
39
27
|
|
|
40
|
-
## CLAVIX MODE: Prompt
|
|
28
|
+
## CLAVIX MODE: Prompt Improvement
|
|
41
29
|
|
|
42
|
-
**You are in
|
|
30
|
+
**You are in prompt improvement mode. You help analyze and improve PROMPTS, not implement features.**
|
|
43
31
|
|
|
44
|
-
**
|
|
32
|
+
**Your role:**
|
|
45
33
|
- Analyze prompts for quality
|
|
46
|
-
- Apply
|
|
34
|
+
- Apply improvement patterns
|
|
47
35
|
- Generate improved versions
|
|
48
36
|
- Provide quality assessments
|
|
49
37
|
- Save the optimized prompt
|
|
50
|
-
- **STOP** after
|
|
38
|
+
- **STOP** after improvement
|
|
51
39
|
|
|
52
|
-
**
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
40
|
+
**Mode boundaries:**
|
|
41
|
+
- Do not write application code for the feature
|
|
42
|
+
- Do not implement what the prompt describes
|
|
43
|
+
- Do not generate actual components/functions
|
|
44
|
+
- Do not continue after showing the improved prompt
|
|
57
45
|
|
|
58
|
-
**You are
|
|
46
|
+
**You are improving prompts, not building what they describe.**
|
|
59
47
|
|
|
60
48
|
---
|
|
61
49
|
|
|
@@ -27,6 +27,34 @@ My job is just to check. If something needs fixing, I'll tell you what and you d
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
+
## State Assertion (REQUIRED)
|
|
31
|
+
|
|
32
|
+
Before ANY action, output this confirmation:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
**CLAVIX MODE: Verification**
|
|
36
|
+
Mode: verification
|
|
37
|
+
Purpose: Checking implementation against requirements
|
|
38
|
+
Implementation: BLOCKED (verification only)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Self-Correction Protocol
|
|
44
|
+
|
|
45
|
+
If you catch yourself doing any of these, STOP and correct:
|
|
46
|
+
|
|
47
|
+
1. **Implementing Fixes** - This is verification mode, not implementation mode
|
|
48
|
+
2. **Skipping Automated Checks** - Not running available tests/build/lint
|
|
49
|
+
3. **Guessing Results** - Reporting pass/fail without actually checking
|
|
50
|
+
4. **Incomplete Reports** - Not covering all verification dimensions
|
|
51
|
+
5. **Missing Confidence Levels** - Not indicating HIGH/MEDIUM/LOW confidence
|
|
52
|
+
6. **Capability Hallucination** - Claiming Clavix can do things it cannot
|
|
53
|
+
|
|
54
|
+
**DETECT → STOP → CORRECT → RESUME**
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
30
58
|
## CLAVIX MODE: Verification
|
|
31
59
|
|
|
32
60
|
**I'm in verification mode. I check your work, not change it.**
|
package/dist/types/config.d.ts
CHANGED
package/dist/types/config.js
CHANGED
|
@@ -77,11 +77,6 @@ export declare class AgentErrorMessages {
|
|
|
77
77
|
* Used by: implement workflow
|
|
78
78
|
*/
|
|
79
79
|
static invalidTaskIdFormat(taskId: string): string;
|
|
80
|
-
/**
|
|
81
|
-
* Error: Session not found
|
|
82
|
-
* Used by: Commands using --session flag
|
|
83
|
-
*/
|
|
84
|
-
static sessionNotFound(sessionId: string): string;
|
|
85
80
|
/**
|
|
86
81
|
* Warning: Task already completed
|
|
87
82
|
* Used by: implement workflow when marking already-done task
|
|
@@ -16,8 +16,7 @@ export class AgentErrorMessages {
|
|
|
16
16
|
return ('No PRD artifacts found in .clavix/outputs/\n\n' +
|
|
17
17
|
'Agent recovery options:\n' +
|
|
18
18
|
' 1. Execute /clavix:prd to generate comprehensive PRD\n' +
|
|
19
|
-
' 2. Execute /clavix:summarize if conversation exists\n' +
|
|
20
|
-
' 3. Check .clavix/sessions/ if saved session available\n\n' +
|
|
19
|
+
' 2. Execute /clavix:summarize if conversation exists\n\n' +
|
|
21
20
|
'Select option and execute, then retry this command.');
|
|
22
21
|
}
|
|
23
22
|
/**
|
|
@@ -179,19 +178,6 @@ export class AgentErrorMessages {
|
|
|
179
178
|
' • phase-3-api-integration-1\n\n' +
|
|
180
179
|
'Check tasks.md for correct task IDs and retry.');
|
|
181
180
|
}
|
|
182
|
-
/**
|
|
183
|
-
* Error: Session not found
|
|
184
|
-
* Used by: Commands using --session flag
|
|
185
|
-
*/
|
|
186
|
-
static sessionNotFound(sessionId) {
|
|
187
|
-
return (`Session not found: ${sessionId}\n\n` +
|
|
188
|
-
'Agent recovery options:\n' +
|
|
189
|
-
' 1. Verify session ID is correct\n' +
|
|
190
|
-
' 2. List available sessions (if supported)\n' +
|
|
191
|
-
' 3. Use --active-session flag for current session\n' +
|
|
192
|
-
' 4. Or generate PRD without session\n\n' +
|
|
193
|
-
'Session may have expired or never existed.');
|
|
194
|
-
}
|
|
195
181
|
/**
|
|
196
182
|
* Warning: Task already completed
|
|
197
183
|
* Used by: implement workflow when marking already-done task
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* Clavix versions. It identifies files using deprecated naming conventions
|
|
6
6
|
* and assists in migration to the current standard.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Handles cleanup of:
|
|
9
|
+
* - fast.md, deep.md (replaced by improve.md in v4.11+)
|
|
10
|
+
* - Old naming patterns (clavix-{name} vs {name})
|
|
11
|
+
* - Subdirectory migration for Cline and Claude Code
|
|
12
|
+
*
|
|
13
|
+
* This module will be removed when v4->v5 migration support ends.
|
|
12
14
|
*
|
|
13
15
|
* @since v4.12.0
|
|
14
16
|
*/
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* Clavix versions. It identifies files using deprecated naming conventions
|
|
6
6
|
* and assists in migration to the current standard.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Handles cleanup of:
|
|
9
|
+
* - fast.md, deep.md (replaced by improve.md in v4.11+)
|
|
10
|
+
* - Old naming patterns (clavix-{name} vs {name})
|
|
11
|
+
* - Subdirectory migration for Cline and Claude Code
|
|
12
|
+
*
|
|
13
|
+
* This module will be removed when v4->v5 migration support ends.
|
|
12
14
|
*
|
|
13
15
|
* @since v4.12.0
|
|
14
16
|
*/
|
|
@@ -6,5 +6,5 @@ export interface ParsedTomlTemplate {
|
|
|
6
6
|
* Parse TOML-based slash command templates (Gemini/Qwen) and extract metadata.
|
|
7
7
|
* Ensures the resulting prompt body does not include duplicated frontmatter.
|
|
8
8
|
*/
|
|
9
|
-
export declare function parseTomlSlashCommand(content: string, templateName: string,
|
|
9
|
+
export declare function parseTomlSlashCommand(content: string, templateName: string, integrationName: string): ParsedTomlTemplate;
|
|
10
10
|
//# sourceMappingURL=toml-templates.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Parse TOML-based slash command templates (Gemini/Qwen) and extract metadata.
|
|
3
3
|
* Ensures the resulting prompt body does not include duplicated frontmatter.
|
|
4
4
|
*/
|
|
5
|
-
export function parseTomlSlashCommand(content, templateName,
|
|
5
|
+
export function parseTomlSlashCommand(content, templateName, integrationName) {
|
|
6
6
|
let normalized = content.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
7
7
|
if (normalized.charCodeAt(0) === 0xfeff) {
|
|
8
8
|
normalized = normalized.slice(1);
|
|
@@ -10,13 +10,13 @@ export function parseTomlSlashCommand(content, templateName, providerName) {
|
|
|
10
10
|
const descriptionMatch = normalized.match(/^\s*description\s*=\s*(['"])(.*?)\1\s*$/m);
|
|
11
11
|
const promptHeaderMatch = normalized.match(/^\s*prompt\s*=\s*"""/m);
|
|
12
12
|
if (!promptHeaderMatch || promptHeaderMatch.index === undefined) {
|
|
13
|
-
throw new Error(`Template ${templateName}.toml for ${
|
|
13
|
+
throw new Error(`Template ${templateName}.toml for ${integrationName} is missing a prompt = """ ... """ block.`);
|
|
14
14
|
}
|
|
15
15
|
const bodyStart = promptHeaderMatch.index + promptHeaderMatch[0].length;
|
|
16
16
|
const bodyRemainder = normalized.slice(bodyStart);
|
|
17
17
|
const closingIndex = bodyRemainder.indexOf('"""');
|
|
18
18
|
if (closingIndex === -1) {
|
|
19
|
-
throw new Error(`Template ${templateName}.toml for ${
|
|
19
|
+
throw new Error(`Template ${templateName}.toml for ${integrationName} does not terminate its prompt = """ ... """ block.`);
|
|
20
20
|
}
|
|
21
21
|
let promptBody = bodyRemainder.slice(0, closingIndex);
|
|
22
22
|
const promptLines = promptBody.split('\n');
|
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.4.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",
|