clavix 5.2.1 → 5.3.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 +3 -4
- package/dist/cli/commands/diagnose.js +1 -1
- package/dist/cli/commands/init.d.ts +4 -0
- package/dist/cli/commands/init.js +130 -24
- package/dist/cli/commands/update.js +1 -1
- package/dist/constants.d.ts +18 -0
- package/dist/constants.js +24 -0
- package/dist/core/adapter-registry.d.ts +39 -0
- package/dist/core/adapter-registry.js +208 -0
- package/dist/core/adapters/base-adapter.d.ts +1 -0
- package/dist/core/adapters/base-adapter.js +3 -1
- package/dist/core/adapters/universal-adapter.d.ts +49 -0
- package/dist/core/adapters/universal-adapter.js +88 -0
- package/dist/core/command-transformer.d.ts +11 -12
- package/dist/core/command-transformer.js +11 -12
- package/dist/core/doc-injector.d.ts +0 -4
- package/dist/core/doc-injector.js +5 -10
- package/dist/core/template-assembler.d.ts +1 -1
- package/dist/core/template-assembler.js +1 -1
- package/dist/templates/agents/agents.md +1 -2
- package/dist/templates/agents/copilot-instructions.md +1 -2
- package/dist/templates/agents/octo.md +1 -1
- package/dist/templates/agents/warp.md +2 -2
- package/dist/templates/instructions/core/file-operations.md +15 -11
- package/dist/templates/slash-commands/_canonical/plan.md +1 -2
- package/dist/templates/slash-commands/_components/MANIFEST.md +81 -0
- package/dist/templates/slash-commands/_components/agent-protocols/AGENT_MANUAL.md +1 -1
- package/dist/templates/slash-commands/_components/agent-protocols/cli-reference.md +15 -17
- package/dist/types/adapter-config.d.ts +73 -0
- package/dist/types/adapter-config.js +24 -0
- package/dist/types/config.js +3 -2
- package/dist/utils/error-utils.d.ts +4 -0
- package/dist/utils/error-utils.js +6 -0
- package/dist/utils/file-system.js +7 -12
- package/dist/utils/legacy-command-cleanup.d.ts +14 -0
- package/dist/utils/legacy-command-cleanup.js +14 -0
- package/dist/utils/logger.d.ts +32 -0
- package/dist/utils/logger.js +56 -0
- package/dist/utils/string-utils.d.ts +10 -0
- package/dist/utils/string-utils.js +12 -0
- package/dist/utils/version.d.ts +20 -0
- package/dist/utils/version.js +43 -0
- package/oclif.manifest.json +130 -0
- package/package.json +1 -1
- package/dist/cli/commands/config.d.ts +0 -28
- package/dist/cli/commands/config.js +0 -447
- package/dist/templates/slash-commands/_components/agent-protocols/decision-rules.md +0 -232
- package/dist/templates/slash-commands/_components/agent-protocols/error-handling.md +0 -177
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UniversalAdapter - Config-driven adapter implementation
|
|
3
|
+
*
|
|
4
|
+
* This adapter can handle any simple adapter by accepting configuration
|
|
5
|
+
* at construction time. It provides the same interface as dedicated
|
|
6
|
+
* adapter classes but derives all behavior from AdapterConfig.
|
|
7
|
+
*
|
|
8
|
+
* For adapters requiring custom logic (TOML formatting, doc injection),
|
|
9
|
+
* dedicated adapter classes should be used instead.
|
|
10
|
+
*
|
|
11
|
+
* @since v5.3.0
|
|
12
|
+
*/
|
|
13
|
+
import { BaseAdapter } from './base-adapter.js';
|
|
14
|
+
import * as path from 'path';
|
|
15
|
+
export class UniversalAdapter extends BaseAdapter {
|
|
16
|
+
config;
|
|
17
|
+
constructor(config) {
|
|
18
|
+
super();
|
|
19
|
+
this.config = config;
|
|
20
|
+
}
|
|
21
|
+
get name() {
|
|
22
|
+
return this.config.name;
|
|
23
|
+
}
|
|
24
|
+
get displayName() {
|
|
25
|
+
return this.config.displayName;
|
|
26
|
+
}
|
|
27
|
+
get directory() {
|
|
28
|
+
return this.config.directory;
|
|
29
|
+
}
|
|
30
|
+
get fileExtension() {
|
|
31
|
+
return this.config.fileExtension;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get integration features for command transformation
|
|
35
|
+
*/
|
|
36
|
+
getIntegrationFeatures() {
|
|
37
|
+
return {
|
|
38
|
+
commandFormat: {
|
|
39
|
+
separator: this.config.features.commandSeparator,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Generate the target filename based on config pattern
|
|
45
|
+
*/
|
|
46
|
+
getTargetFilename(commandName) {
|
|
47
|
+
const pattern = this.config.filenamePattern;
|
|
48
|
+
const filename = pattern.replace('{name}', commandName);
|
|
49
|
+
return `${filename}${this.config.fileExtension}`;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get full command path
|
|
53
|
+
*/
|
|
54
|
+
getCommandPath() {
|
|
55
|
+
return path.join(process.cwd(), this.config.directory);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Check if this adapter's project environment is detected
|
|
59
|
+
* Required by BaseAdapter abstract class
|
|
60
|
+
*/
|
|
61
|
+
async detectProject() {
|
|
62
|
+
const { detection } = this.config;
|
|
63
|
+
const fs = await import('fs-extra');
|
|
64
|
+
switch (detection.type) {
|
|
65
|
+
case 'directory':
|
|
66
|
+
return fs.pathExists(detection.path);
|
|
67
|
+
case 'file':
|
|
68
|
+
return fs.pathExists(detection.path);
|
|
69
|
+
case 'config':
|
|
70
|
+
return fs.pathExists(detection.path);
|
|
71
|
+
default:
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Check if this adapter supports subdirectories
|
|
77
|
+
*/
|
|
78
|
+
supportsSubdirectories() {
|
|
79
|
+
return this.config.features.supportsSubdirectories;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Check if this adapter supports frontmatter
|
|
83
|
+
*/
|
|
84
|
+
supportsFrontmatter() {
|
|
85
|
+
return this.config.features.supportsFrontmatter;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=universal-adapter.js.map
|
|
@@ -3,11 +3,10 @@ import { IntegrationFeatures } from '../types/agent.js';
|
|
|
3
3
|
* CommandTransformer - Transforms slash command references in template content
|
|
4
4
|
*
|
|
5
5
|
* Handles conversion between command formats:
|
|
6
|
-
* - Colon format: /clavix:
|
|
7
|
-
* - Hyphen format: /clavix-
|
|
6
|
+
* - Colon format: /clavix:improve (Claude Code style - uses subdirectories)
|
|
7
|
+
* - Hyphen format: /clavix-improve (Cursor, Droid style - flat files)
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* slash commands that start with /clavix:
|
|
9
|
+
* Only transforms slash commands that start with /clavix:
|
|
11
10
|
*
|
|
12
11
|
* @since v4.8.1
|
|
13
12
|
*/
|
|
@@ -29,26 +28,26 @@ export declare class CommandTransformer {
|
|
|
29
28
|
*
|
|
30
29
|
* @example
|
|
31
30
|
* // For Cursor/Droid (hyphen format):
|
|
32
|
-
* transform('/clavix:
|
|
33
|
-
* // Returns: '/clavix-
|
|
31
|
+
* transform('/clavix:improve', { commandFormat: { separator: '-' } })
|
|
32
|
+
* // Returns: '/clavix-improve'
|
|
34
33
|
*
|
|
35
34
|
* @example
|
|
36
35
|
* // For Claude Code (colon format, default):
|
|
37
|
-
* transform('/clavix:
|
|
38
|
-
* // Returns: '/clavix:
|
|
36
|
+
* transform('/clavix:improve', { commandFormat: { separator: ':' } })
|
|
37
|
+
* // Returns: '/clavix:improve' (unchanged)
|
|
39
38
|
*/
|
|
40
39
|
static transform(content: string, features?: IntegrationFeatures): string;
|
|
41
40
|
/**
|
|
42
41
|
* Get the formatted command name for a specific adapter
|
|
43
42
|
* Useful for generating documentation or references
|
|
44
43
|
*
|
|
45
|
-
* @param commandName - Base command name (e.g., '
|
|
44
|
+
* @param commandName - Base command name (e.g., 'improve', 'prd', 'implement')
|
|
46
45
|
* @param features - Adapter's integration features
|
|
47
|
-
* @returns Formatted slash command (e.g., '/clavix:
|
|
46
|
+
* @returns Formatted slash command (e.g., '/clavix:improve' or '/clavix-improve')
|
|
48
47
|
*
|
|
49
48
|
* @example
|
|
50
|
-
* formatCommand('
|
|
51
|
-
* // Returns: '/clavix-
|
|
49
|
+
* formatCommand('improve', { commandFormat: { separator: '-' } })
|
|
50
|
+
* // Returns: '/clavix-improve'
|
|
52
51
|
*/
|
|
53
52
|
static formatCommand(commandName: string, features?: IntegrationFeatures): string;
|
|
54
53
|
}
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
* CommandTransformer - Transforms slash command references in template content
|
|
3
3
|
*
|
|
4
4
|
* Handles conversion between command formats:
|
|
5
|
-
* - Colon format: /clavix:
|
|
6
|
-
* - Hyphen format: /clavix-
|
|
5
|
+
* - Colon format: /clavix:improve (Claude Code style - uses subdirectories)
|
|
6
|
+
* - Hyphen format: /clavix-improve (Cursor, Droid style - flat files)
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* slash commands that start with /clavix:
|
|
8
|
+
* Only transforms slash commands that start with /clavix:
|
|
10
9
|
*
|
|
11
10
|
* @since v4.8.1
|
|
12
11
|
*/
|
|
@@ -28,13 +27,13 @@ export class CommandTransformer {
|
|
|
28
27
|
*
|
|
29
28
|
* @example
|
|
30
29
|
* // For Cursor/Droid (hyphen format):
|
|
31
|
-
* transform('/clavix:
|
|
32
|
-
* // Returns: '/clavix-
|
|
30
|
+
* transform('/clavix:improve', { commandFormat: { separator: '-' } })
|
|
31
|
+
* // Returns: '/clavix-improve'
|
|
33
32
|
*
|
|
34
33
|
* @example
|
|
35
34
|
* // For Claude Code (colon format, default):
|
|
36
|
-
* transform('/clavix:
|
|
37
|
-
* // Returns: '/clavix:
|
|
35
|
+
* transform('/clavix:improve', { commandFormat: { separator: ':' } })
|
|
36
|
+
* // Returns: '/clavix:improve' (unchanged)
|
|
38
37
|
*/
|
|
39
38
|
static transform(content, features) {
|
|
40
39
|
const separator = features?.commandFormat?.separator ?? this.DEFAULT_SEPARATOR;
|
|
@@ -49,13 +48,13 @@ export class CommandTransformer {
|
|
|
49
48
|
* Get the formatted command name for a specific adapter
|
|
50
49
|
* Useful for generating documentation or references
|
|
51
50
|
*
|
|
52
|
-
* @param commandName - Base command name (e.g., '
|
|
51
|
+
* @param commandName - Base command name (e.g., 'improve', 'prd', 'implement')
|
|
53
52
|
* @param features - Adapter's integration features
|
|
54
|
-
* @returns Formatted slash command (e.g., '/clavix:
|
|
53
|
+
* @returns Formatted slash command (e.g., '/clavix:improve' or '/clavix-improve')
|
|
55
54
|
*
|
|
56
55
|
* @example
|
|
57
|
-
* formatCommand('
|
|
58
|
-
* // Returns: '/clavix-
|
|
56
|
+
* formatCommand('improve', { commandFormat: { separator: '-' } })
|
|
57
|
+
* // Returns: '/clavix-improve'
|
|
59
58
|
*/
|
|
60
59
|
static formatCommand(commandName, features) {
|
|
61
60
|
const separator = features?.commandFormat?.separator ?? this.DEFAULT_SEPARATOR;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
2
|
import { FileSystem } from '../utils/file-system.js';
|
|
3
3
|
import { DataError } from '../types/errors.js';
|
|
4
|
+
import { escapeRegex } from '../utils/string-utils.js';
|
|
4
5
|
/**
|
|
5
6
|
* DocInjector - manages injection and updating of managed blocks in documentation files
|
|
6
7
|
*/
|
|
@@ -28,7 +29,7 @@ export class DocInjector {
|
|
|
28
29
|
throw new DataError(`File not found: ${filePath}`, 'Set createIfMissing: true to create the file automatically');
|
|
29
30
|
}
|
|
30
31
|
// Build the managed block
|
|
31
|
-
const blockRegex = new RegExp(`${
|
|
32
|
+
const blockRegex = new RegExp(`${escapeRegex(opts.startMarker)}[\\s\\S]*?${escapeRegex(opts.endMarker)}`, 'g');
|
|
32
33
|
const wrappedContent = this.wrapContent(opts.content, opts.startMarker, opts.endMarker);
|
|
33
34
|
if (blockRegex.test(fileContent)) {
|
|
34
35
|
// Replace existing block
|
|
@@ -70,7 +71,7 @@ export class DocInjector {
|
|
|
70
71
|
return false;
|
|
71
72
|
}
|
|
72
73
|
const content = await FileSystem.readFile(filePath);
|
|
73
|
-
const blockRegex = new RegExp(`${
|
|
74
|
+
const blockRegex = new RegExp(`${escapeRegex(start)}[\\s\\S]*?${escapeRegex(end)}`, 'g');
|
|
74
75
|
return blockRegex.test(content);
|
|
75
76
|
}
|
|
76
77
|
/**
|
|
@@ -83,7 +84,7 @@ export class DocInjector {
|
|
|
83
84
|
return null;
|
|
84
85
|
}
|
|
85
86
|
const content = await FileSystem.readFile(filePath);
|
|
86
|
-
const blockRegex = new RegExp(`${
|
|
87
|
+
const blockRegex = new RegExp(`${escapeRegex(start)}([\\s\\S]*?)${escapeRegex(end)}`, 'g');
|
|
87
88
|
const match = blockRegex.exec(content);
|
|
88
89
|
return match ? match[1].trim() : null;
|
|
89
90
|
}
|
|
@@ -97,7 +98,7 @@ export class DocInjector {
|
|
|
97
98
|
return;
|
|
98
99
|
}
|
|
99
100
|
const content = await FileSystem.readFile(filePath);
|
|
100
|
-
const blockRegex = new RegExp(`${
|
|
101
|
+
const blockRegex = new RegExp(`${escapeRegex(start)}[\\s\\S]*?${escapeRegex(end)}\\n?`, 'g');
|
|
101
102
|
if (blockRegex.test(content)) {
|
|
102
103
|
await FileSystem.backup(filePath);
|
|
103
104
|
const updated = content.replace(blockRegex, '');
|
|
@@ -110,12 +111,6 @@ export class DocInjector {
|
|
|
110
111
|
static wrapContent(content, startMarker, endMarker) {
|
|
111
112
|
return `${startMarker}\n${content}\n${endMarker}`;
|
|
112
113
|
}
|
|
113
|
-
/**
|
|
114
|
-
* Escape special regex characters
|
|
115
|
-
*/
|
|
116
|
-
static escapeRegex(str) {
|
|
117
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
118
|
-
}
|
|
119
114
|
/**
|
|
120
115
|
* Basic markdown validation
|
|
121
116
|
*/
|
|
@@ -25,7 +25,7 @@ export interface AssemblyResult {
|
|
|
25
25
|
* Usage:
|
|
26
26
|
* ```typescript
|
|
27
27
|
* const assembler = new TemplateAssembler('/path/to/templates');
|
|
28
|
-
* const result = await assembler.assembleTemplate('
|
|
28
|
+
* const result = await assembler.assembleTemplate('improve.md');
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
31
|
* Include marker formats:
|
|
@@ -9,7 +9,7 @@ import * as path from 'path';
|
|
|
9
9
|
* Usage:
|
|
10
10
|
* ```typescript
|
|
11
11
|
* const assembler = new TemplateAssembler('/path/to/templates');
|
|
12
|
-
* const result = await assembler.assembleTemplate('
|
|
12
|
+
* const result = await assembler.assembleTemplate('improve.md');
|
|
13
13
|
* ```
|
|
14
14
|
*
|
|
15
15
|
* Include marker formats:
|
|
@@ -73,7 +73,7 @@ For complete step-by-step workflows, see `.clavix/instructions/`:
|
|
|
73
73
|
|---------|---------|
|
|
74
74
|
| `clavix init` | Initialize Clavix in a project |
|
|
75
75
|
| `clavix update` | Update templates after package update |
|
|
76
|
-
| `clavix
|
|
76
|
+
| `clavix diagnose` | Check installation health |
|
|
77
77
|
| `clavix version` | Show version |
|
|
78
78
|
|
|
79
79
|
### Workflow Commands (Slash Commands)
|
|
@@ -185,7 +185,6 @@ PRD Creation → Task Planning → Implementation → Archive
|
|
|
185
185
|
|
|
186
186
|
**Artifacts stored under `.clavix/`:**
|
|
187
187
|
- `.clavix/outputs/<project>/` - PRDs, tasks, prompts
|
|
188
|
-
- `.clavix/sessions/` - Captured conversations
|
|
189
188
|
- `.clavix/templates/` - Custom overrides
|
|
190
189
|
|
|
191
190
|
---
|
|
@@ -60,7 +60,7 @@ For complete step-by-step workflows, see `.clavix/instructions/`:
|
|
|
60
60
|
|---------|---------|
|
|
61
61
|
| `clavix init` | Initialize Clavix in a project |
|
|
62
62
|
| `clavix update` | Update templates after package update |
|
|
63
|
-
| `clavix
|
|
63
|
+
| `clavix diagnose` | Check installation health |
|
|
64
64
|
| `clavix version` | Show version |
|
|
65
65
|
|
|
66
66
|
### Workflow Commands (Slash Commands)
|
|
@@ -178,7 +178,6 @@ with `/clavix:summarize`. Alternatively, if you have a rough idea, try:
|
|
|
178
178
|
|
|
179
179
|
**Artifacts stored under `.clavix/`:**
|
|
180
180
|
- `.clavix/outputs/<project>/` - PRDs, tasks, prompts
|
|
181
|
-
- `.clavix/sessions/` - Captured conversations
|
|
182
181
|
- `.clavix/config.json` - Project configuration
|
|
183
182
|
|
|
184
183
|
---
|
|
@@ -123,7 +123,7 @@ Autofix handles edge cases gracefully - let it work.
|
|
|
123
123
|
|---------|---------|
|
|
124
124
|
| `clavix init` | Initialize Clavix in a project |
|
|
125
125
|
| `clavix update` | Update templates after package update |
|
|
126
|
-
| `clavix
|
|
126
|
+
| `clavix diagnose` | Check installation health |
|
|
127
127
|
| `clavix version` | Show version |
|
|
128
128
|
|
|
129
129
|
### Workflow Commands (Slash Commands)
|
|
@@ -51,7 +51,7 @@ For complete step-by-step workflows, see `.clavix/instructions/`:
|
|
|
51
51
|
|---------|---------|
|
|
52
52
|
| `clavix init` | Initialize Clavix in a project |
|
|
53
53
|
| `clavix update` | Update templates after package update |
|
|
54
|
-
| `clavix
|
|
54
|
+
| `clavix diagnose` | Check installation health |
|
|
55
55
|
| `clavix version` | Show version |
|
|
56
56
|
|
|
57
57
|
### Slash Commands (Workflows)
|
|
@@ -72,7 +72,7 @@ For complete step-by-step workflows, see `.clavix/instructions/`:
|
|
|
72
72
|
|
|
73
73
|
### Outputs
|
|
74
74
|
- Project artifacts live under `.clavix/outputs/<project>/`
|
|
75
|
-
-
|
|
75
|
+
- Saved prompts in `.clavix/outputs/prompts/`
|
|
76
76
|
- Update generated docs/commands any time with `clavix update`
|
|
77
77
|
|
|
78
78
|
---
|
|
@@ -150,24 +150,28 @@ List created files:
|
|
|
150
150
|
|
|
151
151
|
---
|
|
152
152
|
|
|
153
|
-
### Timestamped
|
|
153
|
+
### Timestamped Prompts
|
|
154
154
|
|
|
155
155
|
```markdown
|
|
156
|
-
**Step 1: Generate
|
|
157
|
-
Create timestamp: `
|
|
156
|
+
**Step 1: Generate prompt timestamp**
|
|
157
|
+
Create timestamp: `YYYYMMDD-HHMMSS` format (e.g., `20251124-143022`)
|
|
158
158
|
|
|
159
|
-
**Step 2: Create
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
**Step 2: Create prompt file**
|
|
160
|
+
Use the Write tool to create `.clavix/outputs/prompts/std-[timestamp]-[random].md`
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
id: std-[timestamp]-[random]
|
|
164
|
+
depthUsed: standard|comprehensive
|
|
165
|
+
timestamp: [ISO-8601]
|
|
166
|
+
executed: false
|
|
167
|
+
---
|
|
163
168
|
|
|
164
|
-
|
|
165
|
-
Use the Write tool to create `.clavix/sessions/[timestamp]/conversation.md`
|
|
169
|
+
# Improved Prompt
|
|
166
170
|
|
|
167
171
|
[Content here]
|
|
168
172
|
|
|
169
|
-
**Step
|
|
170
|
-
Confirm: `.clavix/
|
|
173
|
+
**Step 3: Verify**
|
|
174
|
+
Confirm: `.clavix/outputs/prompts/std-[timestamp]-[random].md` ✓
|
|
171
175
|
```
|
|
172
176
|
|
|
173
177
|
---
|
|
@@ -283,7 +283,7 @@ The generated `tasks.md` will look like:
|
|
|
283
283
|
- Tasks are automatically optimized for clarity, structure, and actionability
|
|
284
284
|
- Each task is concise and actionable
|
|
285
285
|
- Tasks can reference specific PRD sections
|
|
286
|
-
- Supports mini-PRD outputs from `/clavix:summarize`
|
|
286
|
+
- Supports mini-PRD outputs from `/clavix:summarize`
|
|
287
287
|
- You can manually edit tasks.md before implementing
|
|
288
288
|
- Use `--overwrite` flag to regenerate if needed
|
|
289
289
|
|
|
@@ -320,7 +320,6 @@ The generated `tasks.md` will look like:
|
|
|
320
320
|
- Suggest recovery options:
|
|
321
321
|
- "Generate PRD with `/clavix:prd` for comprehensive planning"
|
|
322
322
|
- "Extract mini-PRD from conversation with `/clavix:summarize`"
|
|
323
|
-
- "Or use `clavix plan --session <id>` if you have a saved session"
|
|
324
323
|
3. Do NOT proceed with plan generation without PRD
|
|
325
324
|
|
|
326
325
|
### Issue: Generated tasks are too granular (100+ tasks)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Component Manifest
|
|
2
|
+
|
|
3
|
+
This document lists all reusable components in the Clavix template system and their usage across slash commands.
|
|
4
|
+
|
|
5
|
+
## Component Categories
|
|
6
|
+
|
|
7
|
+
### Agent Protocols
|
|
8
|
+
Core protocols that all AI agents must follow. Shared across most commands.
|
|
9
|
+
|
|
10
|
+
| Component | Purpose | Used By |
|
|
11
|
+
|-----------|---------|---------|
|
|
12
|
+
| `AGENT_MANUAL.md` | Universal protocols (transparency, mode identification, communication patterns) | All 8 commands |
|
|
13
|
+
| `cli-reference.md` | CLI command reference including removed commands table | improve, prd, plan, implement, verify, archive |
|
|
14
|
+
| `state-awareness.md` | Workflow state detection (mid-PRD, mid-implementation, etc.) | prd, plan, implement, summarize |
|
|
15
|
+
| `supportive-companion.md` | Conversational guidance for start mode | start |
|
|
16
|
+
| `task-blocking.md` | Task execution protocols for implement mode | implement |
|
|
17
|
+
|
|
18
|
+
### References
|
|
19
|
+
Static reference documentation for AI agents.
|
|
20
|
+
|
|
21
|
+
| Component | Purpose | Used By |
|
|
22
|
+
|-----------|---------|---------|
|
|
23
|
+
| `quality-dimensions.md` | Explanation of quality scoring dimensions (clarity, efficiency, etc.) | improve, prd, summarize |
|
|
24
|
+
|
|
25
|
+
### Sections
|
|
26
|
+
Reusable content sections for specific workflows.
|
|
27
|
+
|
|
28
|
+
| Component | Purpose | Used By |
|
|
29
|
+
|-----------|---------|---------|
|
|
30
|
+
| `conversation-examples.md` | Example conversation patterns for exploration | start |
|
|
31
|
+
| `escalation-factors.md` | When to recommend PRD mode over improve | improve |
|
|
32
|
+
| `improvement-explanations.md` | How to explain quality improvements | improve, summarize |
|
|
33
|
+
| `pattern-impact.md` | What patterns had the biggest impact | improve |
|
|
34
|
+
| `prd-examples.md` | PRD generation examples | prd |
|
|
35
|
+
|
|
36
|
+
### Troubleshooting
|
|
37
|
+
Recovery patterns for common agent issues.
|
|
38
|
+
|
|
39
|
+
| Component | Purpose | Used By |
|
|
40
|
+
|-----------|---------|---------|
|
|
41
|
+
| `vibecoder-recovery.md` | Recovery patterns for "vibe coders" who skip instructions | All 8 commands |
|
|
42
|
+
|
|
43
|
+
## Usage Matrix
|
|
44
|
+
|
|
45
|
+
| Command | Components Used |
|
|
46
|
+
|---------|----------------|
|
|
47
|
+
| `/clavix:improve` | AGENT_MANUAL, cli-reference, improvement-explanations, quality-dimensions, escalation-factors, pattern-impact |
|
|
48
|
+
| `/clavix:prd` | AGENT_MANUAL, prd-examples, quality-dimensions, state-awareness, cli-reference |
|
|
49
|
+
| `/clavix:plan` | AGENT_MANUAL, state-awareness, cli-reference, vibecoder-recovery |
|
|
50
|
+
| `/clavix:implement` | AGENT_MANUAL, state-awareness, task-blocking, cli-reference, vibecoder-recovery |
|
|
51
|
+
| `/clavix:start` | AGENT_MANUAL, supportive-companion, conversation-examples, vibecoder-recovery |
|
|
52
|
+
| `/clavix:summarize` | AGENT_MANUAL, improvement-explanations, quality-dimensions, state-awareness, vibecoder-recovery |
|
|
53
|
+
| `/clavix:verify` | AGENT_MANUAL, cli-reference, vibecoder-recovery |
|
|
54
|
+
| `/clavix:archive` | AGENT_MANUAL, cli-reference, vibecoder-recovery |
|
|
55
|
+
|
|
56
|
+
## Include Syntax
|
|
57
|
+
|
|
58
|
+
Components are included using the `{{INCLUDE:path}}` directive:
|
|
59
|
+
|
|
60
|
+
```markdown
|
|
61
|
+
{{INCLUDE:agent-protocols/AGENT_MANUAL.md}}
|
|
62
|
+
{{INCLUDE:sections/escalation-factors.md}}
|
|
63
|
+
{{INCLUDE:references/quality-dimensions.md}}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Guidelines for New Components
|
|
67
|
+
|
|
68
|
+
1. **Single responsibility**: Each component should have one clear purpose
|
|
69
|
+
2. **Reusability**: Create components when content is used by 2+ commands
|
|
70
|
+
3. **No orphans**: Delete components when no longer referenced
|
|
71
|
+
4. **Update manifest**: Add new components to this manifest
|
|
72
|
+
|
|
73
|
+
## Maintenance
|
|
74
|
+
|
|
75
|
+
When adding/removing components:
|
|
76
|
+
1. Update this manifest
|
|
77
|
+
2. Run `npm run build` to verify template assembly
|
|
78
|
+
3. Check that removed components aren't referenced anywhere:
|
|
79
|
+
```bash
|
|
80
|
+
grep -r "INCLUDE:.*component-name" src/templates/
|
|
81
|
+
```
|
|
@@ -10,7 +10,7 @@ Clavix v5 follows an **agentic-first architecture**. This means:
|
|
|
10
10
|
|
|
11
11
|
1. **You execute workflows directly** using your native tools (Write, Read, Edit, Bash)
|
|
12
12
|
2. **Slash commands are templates** that you read and follow - not CLI commands
|
|
13
|
-
3. **CLI commands are ONLY for setup** (`clavix init`, `clavix update`, `clavix
|
|
13
|
+
3. **CLI commands are ONLY for setup** (`clavix init`, `clavix update`, `clavix diagnose`)
|
|
14
14
|
4. **You save outputs to `.clavix/outputs/`** using your Write tool
|
|
15
15
|
|
|
16
16
|
**DO NOT:**
|
|
@@ -26,13 +26,10 @@ These are commands the **user** runs in their terminal to set up Clavix:
|
|
|
26
26
|
- `--docs-only` - Update only documentation
|
|
27
27
|
- `--commands-only` - Update only slash commands
|
|
28
28
|
|
|
29
|
-
#### `clavix
|
|
30
|
-
**What it does:**
|
|
31
|
-
**
|
|
32
|
-
|
|
33
|
-
#### `clavix config set <key> <value>`
|
|
34
|
-
**What it does:** Updates a configuration value
|
|
35
|
-
**Example:** `clavix config set preferences.verboseLogging true`
|
|
29
|
+
#### `clavix diagnose`
|
|
30
|
+
**What it does:** Runs diagnostic checks on Clavix installation
|
|
31
|
+
**When user runs it:** To troubleshoot issues
|
|
32
|
+
**Reports:** Version, config status, template integrity, integration health
|
|
36
33
|
|
|
37
34
|
#### `clavix version`
|
|
38
35
|
**What it does:** Shows current Clavix version
|
|
@@ -104,15 +101,16 @@ originalPrompt: "the user's original prompt"
|
|
|
104
101
|
|
|
105
102
|
---
|
|
106
103
|
|
|
107
|
-
###
|
|
104
|
+
### Removed Commands (v4 Legacy)
|
|
105
|
+
|
|
106
|
+
**IMPORTANT:** These commands were removed in v5. Do NOT try to run them:
|
|
108
107
|
|
|
109
|
-
|
|
108
|
+
| Removed Command | How Agents Handle This Now |
|
|
109
|
+
|-----------------|---------------------------|
|
|
110
|
+
| `clavix fast/deep` | Use `/clavix:improve` - saves to `.clavix/outputs/prompts/` |
|
|
111
|
+
| `clavix execute` | Use `/clavix:implement` - reads latest prompt automatically |
|
|
112
|
+
| `clavix task-complete` | Agent uses Edit tool on tasks.md directly |
|
|
113
|
+
| `clavix prompts list` | Agent uses Glob/Bash to list `.clavix/outputs/prompts/*.md` |
|
|
114
|
+
| `clavix config` | User can run `clavix init` to reconfigure |
|
|
110
115
|
|
|
111
|
-
|
|
112
|
-
|-------------|---------------|
|
|
113
|
-
| `clavix fast/deep "prompt"` | Agent analyzes and saves to `.clavix/outputs/prompts/<id>.md` |
|
|
114
|
-
| `clavix execute --latest` | Agent lists prompts dir, finds newest, reads it |
|
|
115
|
-
| `clavix implement` | Agent follows `/clavix:implement` template |
|
|
116
|
-
| `clavix task-complete <id>` | Agent uses Edit tool on tasks.md |
|
|
117
|
-
| `clavix archive <name>` | Agent moves directory with Bash tool |
|
|
118
|
-
| `clavix prompts list` | Agent lists `.clavix/outputs/prompts/*.md` files |
|
|
116
|
+
**If user asks you to run these commands:** Explain they were removed in v5 and the equivalent workflow.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration schema for config-driven adapters
|
|
3
|
+
* Enables creating adapters from configuration rather than individual classes
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* File extension types supported by adapters
|
|
7
|
+
*/
|
|
8
|
+
export type AdapterFileExtension = '.md' | '.toml';
|
|
9
|
+
/**
|
|
10
|
+
* Command separator types
|
|
11
|
+
*/
|
|
12
|
+
export type CommandSeparator = ':' | '-';
|
|
13
|
+
/**
|
|
14
|
+
* Filename pattern for generated command files
|
|
15
|
+
* - '{name}' - Just the command name (e.g., 'improve.md')
|
|
16
|
+
* - 'clavix-{name}' - Prefixed (e.g., 'clavix-improve.md')
|
|
17
|
+
* - 'clavix/{name}' - In subdirectory (e.g., 'clavix/improve.md')
|
|
18
|
+
*/
|
|
19
|
+
export type FilenamePattern = '{name}' | 'clavix-{name}' | 'clavix/{name}';
|
|
20
|
+
/**
|
|
21
|
+
* Detection method for project environment
|
|
22
|
+
*/
|
|
23
|
+
export interface DetectionConfig {
|
|
24
|
+
type: 'directory' | 'file' | 'config';
|
|
25
|
+
path: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Feature flags for adapter capabilities
|
|
29
|
+
*/
|
|
30
|
+
export interface AdapterFeatures {
|
|
31
|
+
/** Whether the adapter supports subdirectories in command path */
|
|
32
|
+
supportsSubdirectories: boolean;
|
|
33
|
+
/** Whether the adapter supports frontmatter in command files */
|
|
34
|
+
supportsFrontmatter: boolean;
|
|
35
|
+
/** Whether the adapter supports doc injection (CLAUDE.md, etc.) */
|
|
36
|
+
supportsDocInjection: boolean;
|
|
37
|
+
/** Command separator character */
|
|
38
|
+
commandSeparator: CommandSeparator;
|
|
39
|
+
/** Argument placeholder for TOML adapters */
|
|
40
|
+
argumentPlaceholder?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Full adapter configuration
|
|
44
|
+
*/
|
|
45
|
+
export interface AdapterConfig {
|
|
46
|
+
/** Internal adapter name (e.g., 'cursor') */
|
|
47
|
+
name: string;
|
|
48
|
+
/** Display name for UI (e.g., 'Cursor') */
|
|
49
|
+
displayName: string;
|
|
50
|
+
/** Command directory path (e.g., '.cursor/commands') */
|
|
51
|
+
directory: string;
|
|
52
|
+
/** File extension for command files */
|
|
53
|
+
fileExtension: AdapterFileExtension;
|
|
54
|
+
/** Pattern for generating filenames */
|
|
55
|
+
filenamePattern: FilenamePattern;
|
|
56
|
+
/** Feature flags */
|
|
57
|
+
features: AdapterFeatures;
|
|
58
|
+
/** Project detection configuration */
|
|
59
|
+
detection: DetectionConfig;
|
|
60
|
+
/** Whether this adapter requires special handling (TOML format, doc injection) */
|
|
61
|
+
specialAdapter?: 'toml' | 'doc-injection';
|
|
62
|
+
/** For TOML adapters: root directory (e.g., '.gemini') */
|
|
63
|
+
rootDir?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Default adapter features for markdown-based adapters
|
|
67
|
+
*/
|
|
68
|
+
export declare const DEFAULT_MD_FEATURES: AdapterFeatures;
|
|
69
|
+
/**
|
|
70
|
+
* Default adapter features for TOML-based adapters
|
|
71
|
+
*/
|
|
72
|
+
export declare const DEFAULT_TOML_FEATURES: AdapterFeatures;
|
|
73
|
+
//# sourceMappingURL=adapter-config.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration schema for config-driven adapters
|
|
3
|
+
* Enables creating adapters from configuration rather than individual classes
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Default adapter features for markdown-based adapters
|
|
7
|
+
*/
|
|
8
|
+
export const DEFAULT_MD_FEATURES = {
|
|
9
|
+
supportsSubdirectories: false,
|
|
10
|
+
supportsFrontmatter: false,
|
|
11
|
+
supportsDocInjection: false,
|
|
12
|
+
commandSeparator: '-',
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Default adapter features for TOML-based adapters
|
|
16
|
+
*/
|
|
17
|
+
export const DEFAULT_TOML_FEATURES = {
|
|
18
|
+
supportsSubdirectories: true,
|
|
19
|
+
supportsFrontmatter: false,
|
|
20
|
+
supportsDocInjection: false,
|
|
21
|
+
commandSeparator: ':',
|
|
22
|
+
argumentPlaceholder: '{{args}}',
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=adapter-config.js.map
|
package/dist/types/config.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Configuration types for Clavix
|
|
3
3
|
*/
|
|
4
|
+
import { CLAVIX_VERSION } from '../utils/version.js';
|
|
4
5
|
export const DEFAULT_CONFIG = {
|
|
5
|
-
version:
|
|
6
|
+
version: CLAVIX_VERSION,
|
|
6
7
|
integrations: [],
|
|
7
8
|
templates: {
|
|
8
9
|
prdQuestions: 'default',
|
|
@@ -41,7 +42,7 @@ export function migrateConfig(legacy) {
|
|
|
41
42
|
integrations = [];
|
|
42
43
|
}
|
|
43
44
|
return {
|
|
44
|
-
version:
|
|
45
|
+
version: CLAVIX_VERSION,
|
|
45
46
|
integrations,
|
|
46
47
|
templates: legacy.templates,
|
|
47
48
|
outputs: legacy.outputs,
|