clavix 5.1.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 +22 -5
- package/dist/cli/commands/diagnose.d.ts +15 -0
- package/dist/cli/commands/diagnose.js +295 -0
- 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/agents-md-generator.d.ts +0 -10
- package/dist/core/adapters/agents-md-generator.js +7 -41
- package/dist/core/adapters/base-adapter.d.ts +1 -0
- package/dist/core/adapters/base-adapter.js +3 -1
- package/dist/core/adapters/copilot-instructions-generator.d.ts +0 -10
- package/dist/core/adapters/copilot-instructions-generator.js +7 -41
- package/dist/core/adapters/gemini-adapter.d.ts +2 -18
- package/dist/core/adapters/gemini-adapter.js +7 -48
- package/dist/core/adapters/llxprt-adapter.d.ts +2 -18
- package/dist/core/adapters/llxprt-adapter.js +7 -48
- package/dist/core/adapters/octo-md-generator.d.ts +0 -10
- package/dist/core/adapters/octo-md-generator.js +7 -41
- package/dist/core/adapters/qwen-adapter.d.ts +2 -18
- package/dist/core/adapters/qwen-adapter.js +7 -46
- package/dist/core/adapters/toml-formatting-adapter.d.ts +50 -0
- package/dist/core/adapters/toml-formatting-adapter.js +74 -0
- package/dist/core/adapters/universal-adapter.d.ts +49 -0
- package/dist/core/adapters/universal-adapter.js +88 -0
- package/dist/core/adapters/warp-md-generator.d.ts +3 -4
- package/dist/core/adapters/warp-md-generator.js +10 -30
- 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 +9 -15
- package/dist/core/template-assembler.d.ts +1 -1
- package/dist/core/template-assembler.js +1 -1
- package/dist/templates/agents/agents.md +9 -4
- package/dist/templates/agents/copilot-instructions.md +7 -4
- package/dist/templates/agents/octo.md +7 -3
- package/dist/templates/agents/warp.md +8 -4
- 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.d.ts +0 -80
- 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 +2 -2
- package/dist/cli/commands/config.d.ts +0 -30
- package/dist/cli/commands/config.js +0 -456
- 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
|
@@ -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
|
*/
|
|
@@ -198,13 +193,12 @@ Enter conversational mode for iterative prompt development. Discuss your require
|
|
|
198
193
|
#### /clavix:summarize
|
|
199
194
|
Analyze the current conversation and extract key requirements into a structured prompt and mini-PRD.
|
|
200
195
|
|
|
201
|
-
###
|
|
196
|
+
### Agentic Utilities
|
|
202
197
|
|
|
203
|
-
|
|
204
|
-
Verify implementation against checklist. Run automated checks and generate pass/fail reports.
|
|
198
|
+
These utilities provide structured workflows for common tasks. Invoke them using the slash commands below:
|
|
205
199
|
|
|
206
|
-
|
|
207
|
-
Archive completed
|
|
200
|
+
- **Verify** (\`/clavix:verify\`): Check implementation against PRD requirements. Runs automated validation and generates pass/fail reports.
|
|
201
|
+
- **Archive** (\`/clavix:archive\`): Archive completed work. Moves finished PRDs and outputs to archive for future reference.
|
|
208
202
|
|
|
209
203
|
**When to use which mode:**
|
|
210
204
|
- **Improve mode** (\`/clavix:improve\`): Smart prompt optimization with auto-depth selection
|
|
@@ -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)
|
|
@@ -87,8 +87,14 @@ All workflows are executed via slash commands that AI agents read and follow:
|
|
|
87
87
|
| `/clavix:implement` | Execute tasks or prompts (auto-detects source) |
|
|
88
88
|
| `/clavix:start` | Begin conversational session |
|
|
89
89
|
| `/clavix:summarize` | Extract requirements from conversation |
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
|
|
91
|
+
### Agentic Utilities (Project Management)
|
|
92
|
+
These utilities provide structured workflows for project completion:
|
|
93
|
+
|
|
94
|
+
| Utility | Purpose |
|
|
95
|
+
|---------|---------|
|
|
96
|
+
| `/clavix:verify` | Check implementation against PRD requirements, run validation |
|
|
97
|
+
| `/clavix:archive` | Archive completed work to `.clavix/archive/` for reference |
|
|
92
98
|
|
|
93
99
|
**Quick start:**
|
|
94
100
|
```bash
|
|
@@ -179,7 +185,6 @@ PRD Creation → Task Planning → Implementation → Archive
|
|
|
179
185
|
|
|
180
186
|
**Artifacts stored under `.clavix/`:**
|
|
181
187
|
- `.clavix/outputs/<project>/` - PRDs, tasks, prompts
|
|
182
|
-
- `.clavix/sessions/` - Captured conversations
|
|
183
188
|
- `.clavix/templates/` - Custom overrides
|
|
184
189
|
|
|
185
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)
|
|
@@ -74,8 +74,12 @@ All workflows are executed via slash commands:
|
|
|
74
74
|
| `/clavix:implement` | Execute tasks or prompts (auto-detects source) |
|
|
75
75
|
| `/clavix:start` | Begin conversational session |
|
|
76
76
|
| `/clavix:summarize` | Extract requirements from conversation |
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
|
|
78
|
+
### Agentic Utilities (Project Management)
|
|
79
|
+
| Utility | Purpose |
|
|
80
|
+
|---------|---------|
|
|
81
|
+
| `/clavix:verify` | Check implementation against PRD requirements |
|
|
82
|
+
| `/clavix:archive` | Archive completed work to `.clavix/archive/` |
|
|
79
83
|
|
|
80
84
|
---
|
|
81
85
|
|
|
@@ -174,7 +178,6 @@ with `/clavix:summarize`. Alternatively, if you have a rough idea, try:
|
|
|
174
178
|
|
|
175
179
|
**Artifacts stored under `.clavix/`:**
|
|
176
180
|
- `.clavix/outputs/<project>/` - PRDs, tasks, prompts
|
|
177
|
-
- `.clavix/sessions/` - Captured conversations
|
|
178
181
|
- `.clavix/config.json` - Project configuration
|
|
179
182
|
|
|
180
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)
|
|
@@ -135,8 +135,12 @@ Autofix handles edge cases gracefully - let it work.
|
|
|
135
135
|
| `/clavix:implement` | Execute tasks or prompts (auto-detects source) |
|
|
136
136
|
| `/clavix:start` | Begin conversational session |
|
|
137
137
|
| `/clavix:summarize` | Extract requirements from conversation |
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
|
|
139
|
+
### Agentic Utilities (Project Management)
|
|
140
|
+
| Utility | Purpose |
|
|
141
|
+
|---------|---------|
|
|
142
|
+
| `/clavix:verify` | Check implementation against PRD requirements |
|
|
143
|
+
| `/clavix:archive` | Archive completed work to `.clavix/archive/` |
|
|
140
144
|
|
|
141
145
|
---
|
|
142
146
|
|
|
@@ -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)
|
|
@@ -63,12 +63,16 @@ For complete step-by-step workflows, see `.clavix/instructions/`:
|
|
|
63
63
|
| `/clavix:implement` | Execute tasks or prompts (auto-detects source) |
|
|
64
64
|
| `/clavix:start` | Begin conversational session |
|
|
65
65
|
| `/clavix:summarize` | Extract requirements from conversation |
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
|
|
67
|
+
### Agentic Utilities (Project Management)
|
|
68
|
+
| Utility | Purpose |
|
|
69
|
+
|---------|---------|
|
|
70
|
+
| `/clavix:verify` | Check implementation against PRD requirements |
|
|
71
|
+
| `/clavix:archive` | Archive completed work to `.clavix/archive/` |
|
|
68
72
|
|
|
69
73
|
### Outputs
|
|
70
74
|
- Project artifacts live under `.clavix/outputs/<project>/`
|
|
71
|
-
-
|
|
75
|
+
- Saved prompts in `.clavix/outputs/prompts/`
|
|
72
76
|
- Update generated docs/commands any time with `clavix update`
|
|
73
77
|
|
|
74
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.d.ts
CHANGED
|
@@ -7,88 +7,8 @@ export interface ClavixConfig {
|
|
|
7
7
|
templates: TemplateConfig;
|
|
8
8
|
outputs: OutputConfig;
|
|
9
9
|
preferences: PreferencesConfig;
|
|
10
|
-
intelligence?: IntelligenceConfig;
|
|
11
10
|
experimental?: Record<string, unknown>;
|
|
12
11
|
}
|
|
13
|
-
/**
|
|
14
|
-
* v4.4 Intelligence Configuration
|
|
15
|
-
* Configure pattern behavior, enable/disable patterns, adjust priorities
|
|
16
|
-
* v4.11: Removed defaultMode (fast/deep replaced by improve with auto-detection)
|
|
17
|
-
* v4.12: Added escalation thresholds configuration
|
|
18
|
-
*/
|
|
19
|
-
export interface IntelligenceConfig {
|
|
20
|
-
/** Pattern-specific settings */
|
|
21
|
-
patterns?: PatternSettingsConfig;
|
|
22
|
-
/** Enable verbose pattern logging */
|
|
23
|
-
verbosePatternLogs?: boolean;
|
|
24
|
-
/** v4.12: Escalation threshold configuration */
|
|
25
|
-
escalation?: EscalationThresholdsConfig;
|
|
26
|
-
/** v4.12: Quality assessment weight overrides */
|
|
27
|
-
qualityWeights?: QualityWeightsConfig;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* v4.12: Configurable escalation thresholds
|
|
31
|
-
* These control when comprehensive analysis is recommended vs standard
|
|
32
|
-
*/
|
|
33
|
-
export interface EscalationThresholdsConfig {
|
|
34
|
-
/**
|
|
35
|
-
* Quality score threshold for comprehensive mode (default: 75)
|
|
36
|
-
* Prompts >= this score get comprehensive analysis
|
|
37
|
-
*/
|
|
38
|
-
comprehensiveAbove?: number;
|
|
39
|
-
/**
|
|
40
|
-
* Quality score threshold for standard mode floor (default: 60)
|
|
41
|
-
* Prompts between standardFloor and comprehensiveAbove get standard optimization
|
|
42
|
-
*/
|
|
43
|
-
standardFloor?: number;
|
|
44
|
-
/**
|
|
45
|
-
* Intent confidence threshold for auto-proceed (default: 50)
|
|
46
|
-
* Below this, ask user to confirm intent
|
|
47
|
-
*/
|
|
48
|
-
intentConfidenceMin?: number;
|
|
49
|
-
/**
|
|
50
|
-
* Escalation score threshold for strong recommendation (default: 75)
|
|
51
|
-
* Above this, strongly recommend comprehensive mode
|
|
52
|
-
*/
|
|
53
|
-
strongRecommendAbove?: number;
|
|
54
|
-
/**
|
|
55
|
-
* Escalation score threshold for suggestion (default: 45)
|
|
56
|
-
* Above this, suggest comprehensive mode as option
|
|
57
|
-
*/
|
|
58
|
-
suggestAbove?: number;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* v4.12: Quality dimension weight overrides by intent
|
|
62
|
-
* Allows customizing how quality scores are weighted per intent type
|
|
63
|
-
*/
|
|
64
|
-
export interface QualityWeightsConfig {
|
|
65
|
-
/** Override weights for specific intents */
|
|
66
|
-
byIntent?: Record<string, QualityDimensionWeights>;
|
|
67
|
-
/** Default weights for all intents (overrides built-in defaults) */
|
|
68
|
-
defaults?: QualityDimensionWeights;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Weight distribution across quality dimensions (must sum to 100)
|
|
72
|
-
*/
|
|
73
|
-
export interface QualityDimensionWeights {
|
|
74
|
-
clarity?: number;
|
|
75
|
-
efficiency?: number;
|
|
76
|
-
structure?: number;
|
|
77
|
-
completeness?: number;
|
|
78
|
-
actionability?: number;
|
|
79
|
-
specificity?: number;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Pattern-specific settings
|
|
83
|
-
*/
|
|
84
|
-
export interface PatternSettingsConfig {
|
|
85
|
-
/** Disabled pattern IDs (won't run even if applicable) */
|
|
86
|
-
disabled?: string[];
|
|
87
|
-
/** Priority overrides (pattern-id → new priority 1-10) */
|
|
88
|
-
priorityOverrides?: Record<string, number>;
|
|
89
|
-
/** Custom pattern parameters (pattern-id → settings) */
|
|
90
|
-
customSettings?: Record<string, Record<string, unknown>>;
|
|
91
|
-
}
|
|
92
12
|
/**
|
|
93
13
|
* Legacy config format (pre-v3.5.0)
|
|
94
14
|
* Supports migration from:
|
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,
|
|
@@ -32,6 +32,10 @@ interface NodeJSError extends Error {
|
|
|
32
32
|
* Type guard to check if error is a NodeJS error with code property
|
|
33
33
|
*/
|
|
34
34
|
export declare function isNodeError(error: unknown): error is NodeJSError;
|
|
35
|
+
/**
|
|
36
|
+
* Check if error is a permission error (EACCES or EPERM)
|
|
37
|
+
*/
|
|
38
|
+
export declare function isPermissionError(error: unknown): boolean;
|
|
35
39
|
export declare function handleCliError(error: unknown, defaultHandler: (err: unknown) => Promise<void>, exitFn?: (code: number) => void): Promise<void>;
|
|
36
40
|
export {};
|
|
37
41
|
//# sourceMappingURL=error-utils.d.ts.map
|
|
@@ -63,6 +63,12 @@ export function toError(error) {
|
|
|
63
63
|
export function isNodeError(error) {
|
|
64
64
|
return isError(error) && 'code' in error && typeof error.code === 'string';
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Check if error is a permission error (EACCES or EPERM)
|
|
68
|
+
*/
|
|
69
|
+
export function isPermissionError(error) {
|
|
70
|
+
return isNodeError(error) && (error.code === 'EACCES' || error.code === 'EPERM');
|
|
71
|
+
}
|
|
66
72
|
export async function handleCliError(error, defaultHandler, exitFn = process.exit) {
|
|
67
73
|
// Type guard for OCLIF errors
|
|
68
74
|
const isOclifError = (err) => {
|