clavix 5.3.1 → 5.5.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 +1 -3
- package/dist/cli/commands/update.js +1 -1
- package/dist/core/adapters/base-adapter.d.ts +0 -5
- package/dist/core/adapters/base-adapter.js +3 -10
- package/dist/core/adapters/claude-code-adapter.js +2 -1
- package/dist/core/adapters/universal-adapter.d.ts +1 -0
- package/dist/core/adapters/universal-adapter.js +9 -0
- package/dist/core/agent-manager.d.ts +5 -0
- package/dist/core/agent-manager.js +20 -30
- package/dist/core/doc-injector.js +2 -1
- 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/template-loader.js +3 -2
- 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
package/README.md
CHANGED
|
@@ -12,9 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
| Version | Highlights | Details |
|
|
14
14
|
| --- | --- | --- |
|
|
15
|
-
| **v5.
|
|
15
|
+
| **v5.5.0** (Latest) | Architecture cleanup, consolidated adapters, documentation overhaul | [Changelog](CHANGELOG.md) |
|
|
16
16
|
| **v5.0.0** | Agentic-first architecture - lean template delivery | [Changelog](CHANGELOG.md#500---2025-01-27) |
|
|
17
|
-
| **v4.12.0** | Final v4 release with full CLI commands | [Changelog](docs/archive/v4-changelog.md) |
|
|
18
17
|
|
|
19
18
|
**Requirements:** Node.js >= 18.0.0
|
|
20
19
|
|
|
@@ -129,7 +128,6 @@ Clavix v5 has 4 CLI commands (for setup and diagnostics, not workflows):
|
|
|
129
128
|
- Integrations: [docs/integrations.md](docs/integrations.md)
|
|
130
129
|
- How it works: [docs/how-it-works.md](docs/how-it-works.md)
|
|
131
130
|
- Philosophy: [docs/philosophy.md](docs/philosophy.md)
|
|
132
|
-
- v4 Architecture (archived): [docs/archive/v4-architecture.md](docs/archive/v4-architecture.md)
|
|
133
131
|
|
|
134
132
|
## Requirements
|
|
135
133
|
|
|
@@ -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') {
|
|
@@ -50,10 +50,5 @@ export declare abstract class BaseAdapter implements AgentAdapter {
|
|
|
50
50
|
* Override if integration needs doc injection (like Claude Code)
|
|
51
51
|
*/
|
|
52
52
|
injectDocumentation(_blocks: ManagedBlock[]): Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Escape special regex characters
|
|
55
|
-
* @deprecated Use escapeRegex from utils/string-utils.js directly
|
|
56
|
-
*/
|
|
57
|
-
protected escapeRegex(str: string): string;
|
|
58
53
|
}
|
|
59
54
|
//# sourceMappingURL=base-adapter.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
2
|
import { FileSystem } from '../../utils/file-system.js';
|
|
3
3
|
import { IntegrationError } from '../../types/errors.js';
|
|
4
|
-
import {
|
|
4
|
+
import { logger } from '../../utils/logger.js';
|
|
5
5
|
/**
|
|
6
6
|
* Base adapter class with shared logic for all integrations
|
|
7
7
|
* Ensures consistency and reduces code duplication
|
|
@@ -82,7 +82,7 @@ export class BaseAdapter {
|
|
|
82
82
|
}
|
|
83
83
|
catch (error) {
|
|
84
84
|
// Log warning but continue with other files
|
|
85
|
-
|
|
85
|
+
logger.warn(`Failed to remove ${filePath}: ${error}`);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
// Also remove clavix/ subdirectory if it exists (legacy cleanup)
|
|
@@ -93,7 +93,7 @@ export class BaseAdapter {
|
|
|
93
93
|
removed++;
|
|
94
94
|
}
|
|
95
95
|
catch (error) {
|
|
96
|
-
|
|
96
|
+
logger.warn(`Failed to remove ${clavixSubdir}: ${error}`);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
return removed;
|
|
@@ -145,12 +145,5 @@ export class BaseAdapter {
|
|
|
145
145
|
// Default: no documentation injection
|
|
146
146
|
// Override in subclasses if needed
|
|
147
147
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Escape special regex characters
|
|
150
|
-
* @deprecated Use escapeRegex from utils/string-utils.js directly
|
|
151
|
-
*/
|
|
152
|
-
escapeRegex(str) {
|
|
153
|
-
return escapeRegex(str);
|
|
154
|
-
}
|
|
155
148
|
}
|
|
156
149
|
//# sourceMappingURL=base-adapter.js.map
|
|
@@ -2,6 +2,7 @@ import * as path from 'path';
|
|
|
2
2
|
import { BaseAdapter } from './base-adapter.js';
|
|
3
3
|
import { FileSystem } from '../../utils/file-system.js';
|
|
4
4
|
import { IntegrationError } from '../../types/errors.js';
|
|
5
|
+
import { escapeRegex } from '../../utils/string-utils.js';
|
|
5
6
|
/**
|
|
6
7
|
* Claude Code agent adapter
|
|
7
8
|
*/
|
|
@@ -65,7 +66,7 @@ export class ClaudeCodeAdapter extends BaseAdapter {
|
|
|
65
66
|
const dir = path.dirname(fullPath);
|
|
66
67
|
await FileSystem.ensureDir(dir);
|
|
67
68
|
}
|
|
68
|
-
const blockRegex = new RegExp(`${
|
|
69
|
+
const blockRegex = new RegExp(`${escapeRegex(startMarker)}[\\s\\S]*?${escapeRegex(endMarker)}`, 'g');
|
|
69
70
|
const wrappedContent = `${startMarker}\n${content}\n${endMarker}`;
|
|
70
71
|
if (blockRegex.test(fileContent)) {
|
|
71
72
|
// Replace existing block
|
|
@@ -15,6 +15,7 @@ import { AdapterConfig } from '../../types/adapter-config.js';
|
|
|
15
15
|
import { IntegrationFeatures } from '../../types/agent.js';
|
|
16
16
|
export declare class UniversalAdapter extends BaseAdapter {
|
|
17
17
|
private config;
|
|
18
|
+
readonly features: IntegrationFeatures;
|
|
18
19
|
constructor(config: AdapterConfig);
|
|
19
20
|
get name(): string;
|
|
20
21
|
get displayName(): string;
|
|
@@ -14,9 +14,18 @@ import { BaseAdapter } from './base-adapter.js';
|
|
|
14
14
|
import * as path from 'path';
|
|
15
15
|
export class UniversalAdapter extends BaseAdapter {
|
|
16
16
|
config;
|
|
17
|
+
features;
|
|
17
18
|
constructor(config) {
|
|
18
19
|
super();
|
|
19
20
|
this.config = config;
|
|
21
|
+
// Set features from config for interface compatibility
|
|
22
|
+
this.features = {
|
|
23
|
+
supportsSubdirectories: config.features.supportsSubdirectories,
|
|
24
|
+
supportsFrontmatter: config.features.supportsFrontmatter,
|
|
25
|
+
commandFormat: {
|
|
26
|
+
separator: config.features.commandSeparator,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
20
29
|
}
|
|
21
30
|
get name() {
|
|
22
31
|
return this.config.name;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { AgentAdapter, ValidationResult } from '../types/agent.js';
|
|
2
2
|
/**
|
|
3
3
|
* Agent Manager - handles agent detection and registration
|
|
4
|
+
*
|
|
5
|
+
* Uses factory pattern with ADAPTER_CONFIGS for simple adapters,
|
|
6
|
+
* while keeping dedicated classes for special adapters (TOML, doc injection).
|
|
7
|
+
*
|
|
8
|
+
* @since v5.5.0 - Refactored to use config-driven factory pattern
|
|
4
9
|
*/
|
|
5
10
|
export declare class AgentManager {
|
|
6
11
|
private adapters;
|
|
@@ -1,43 +1,33 @@
|
|
|
1
1
|
import { ClaudeCodeAdapter } from './adapters/claude-code-adapter.js';
|
|
2
|
-
import { CursorAdapter } from './adapters/cursor-adapter.js';
|
|
3
|
-
import { DroidAdapter } from './adapters/droid-adapter.js';
|
|
4
|
-
import { OpenCodeAdapter } from './adapters/opencode-adapter.js';
|
|
5
|
-
import { AmpAdapter } from './adapters/amp-adapter.js';
|
|
6
|
-
import { CrushAdapter } from './adapters/crush-adapter.js';
|
|
7
|
-
import { WindsurfAdapter } from './adapters/windsurf-adapter.js';
|
|
8
|
-
import { KilocodeAdapter } from './adapters/kilocode-adapter.js';
|
|
9
|
-
import { ClineAdapter } from './adapters/cline-adapter.js';
|
|
10
|
-
import { RoocodeAdapter } from './adapters/roocode-adapter.js';
|
|
11
|
-
import { IntegrationError } from '../types/errors.js';
|
|
12
|
-
import { CodeBuddyAdapter } from './adapters/codebuddy-adapter.js';
|
|
13
2
|
import { GeminiAdapter } from './adapters/gemini-adapter.js';
|
|
14
3
|
import { QwenAdapter } from './adapters/qwen-adapter.js';
|
|
15
|
-
import { CodexAdapter } from './adapters/codex-adapter.js';
|
|
16
|
-
import { AugmentAdapter } from './adapters/augment-adapter.js';
|
|
17
4
|
import { LlxprtAdapter } from './adapters/llxprt-adapter.js';
|
|
5
|
+
import { UniversalAdapter } from './adapters/universal-adapter.js';
|
|
6
|
+
import { getSimpleAdapters } from './adapter-registry.js';
|
|
7
|
+
import { IntegrationError } from '../types/errors.js';
|
|
18
8
|
/**
|
|
19
9
|
* Agent Manager - handles agent detection and registration
|
|
10
|
+
*
|
|
11
|
+
* Uses factory pattern with ADAPTER_CONFIGS for simple adapters,
|
|
12
|
+
* while keeping dedicated classes for special adapters (TOML, doc injection).
|
|
13
|
+
*
|
|
14
|
+
* @since v5.5.0 - Refactored to use config-driven factory pattern
|
|
20
15
|
*/
|
|
21
16
|
export class AgentManager {
|
|
22
17
|
adapters = new Map();
|
|
23
18
|
constructor() {
|
|
24
|
-
// Register
|
|
25
|
-
this.registerAdapter(new ClaudeCodeAdapter());
|
|
26
|
-
this.registerAdapter(new
|
|
27
|
-
this.registerAdapter(new
|
|
28
|
-
this.registerAdapter(new
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.registerAdapter(new AugmentAdapter());
|
|
37
|
-
this.registerAdapter(new CodeBuddyAdapter());
|
|
38
|
-
this.registerAdapter(new GeminiAdapter());
|
|
39
|
-
this.registerAdapter(new QwenAdapter());
|
|
40
|
-
this.registerAdapter(new CodexAdapter());
|
|
19
|
+
// Register special adapters (require custom logic)
|
|
20
|
+
this.registerAdapter(new ClaudeCodeAdapter()); // Doc injection
|
|
21
|
+
this.registerAdapter(new GeminiAdapter()); // TOML format
|
|
22
|
+
this.registerAdapter(new QwenAdapter()); // TOML format
|
|
23
|
+
this.registerAdapter(new LlxprtAdapter()); // TOML format
|
|
24
|
+
// Register simple adapters from config (using UniversalAdapter factory)
|
|
25
|
+
for (const config of getSimpleAdapters()) {
|
|
26
|
+
// Skip adapters that have special handlers registered above
|
|
27
|
+
if (this.adapters.has(config.name))
|
|
28
|
+
continue;
|
|
29
|
+
this.registerAdapter(new UniversalAdapter(config));
|
|
30
|
+
}
|
|
41
31
|
}
|
|
42
32
|
/**
|
|
43
33
|
* Register a new agent adapter
|
|
@@ -2,6 +2,7 @@ import * as path from 'path';
|
|
|
2
2
|
import { FileSystem } from '../utils/file-system.js';
|
|
3
3
|
import { DataError } from '../types/errors.js';
|
|
4
4
|
import { escapeRegex } from '../utils/string-utils.js';
|
|
5
|
+
import { logger } from '../utils/logger.js';
|
|
5
6
|
/**
|
|
6
7
|
* DocInjector - manages injection and updating of managed blocks in documentation files
|
|
7
8
|
*/
|
|
@@ -124,7 +125,7 @@ export class DocInjector {
|
|
|
124
125
|
const openBrackets = (content.match(/\[/g) || []).length;
|
|
125
126
|
const closeBrackets = (content.match(/\]/g) || []).length;
|
|
126
127
|
if (openBrackets !== closeBrackets) {
|
|
127
|
-
|
|
128
|
+
logger.warn('Unbalanced brackets in markdown');
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
/**
|
|
@@ -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
|
*/
|
|
@@ -4,6 +4,7 @@ import { dirname } from 'path';
|
|
|
4
4
|
import { FileSystem } from './file-system.js';
|
|
5
5
|
import { TemplateAssembler } from '../core/template-assembler.js';
|
|
6
6
|
import { CommandTransformer } from '../core/command-transformer.js';
|
|
7
|
+
import { DataError } from '../types/errors.js';
|
|
7
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
9
|
const __dirname = dirname(__filename);
|
|
9
10
|
// v4.0: Singleton assembler instance for caching
|
|
@@ -39,8 +40,8 @@ export async function loadCommandTemplates(adapter) {
|
|
|
39
40
|
content = result.content;
|
|
40
41
|
}
|
|
41
42
|
catch (error) {
|
|
42
|
-
//
|
|
43
|
-
|
|
43
|
+
// Template assembly failures are critical - throw typed error
|
|
44
|
+
throw new DataError(`Template assembly failed for ${file}: ${error}`, `Check that all {{INCLUDE:}} references exist in templates directory`);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
// v4.8.1: Transform command references based on adapter format
|
|
@@ -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.5.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",
|