clavix 6.0.0 → 6.1.1
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 +30 -19
- package/dist/cli/commands/init.js +0 -12
- package/dist/cli/helpers/init/integrations.d.ts +1 -1
- package/dist/cli/helpers/init/integrations.js +1 -13
- package/dist/config/integrations.json +6 -5
- package/dist/core/adapters/copilot-prompts-adapter.d.ts +64 -0
- package/dist/core/adapters/copilot-prompts-adapter.js +118 -0
- package/dist/core/agent-manager.js +2 -0
- package/dist/templates/agents/agents 2.md +200 -0
- package/dist/templates/agents/octo 2.md +237 -0
- package/dist/templates/slash-commands/_canonical/archive.md +1 -1
- package/dist/templates/slash-commands/_canonical/implement.md +1 -1
- package/dist/templates/slash-commands/_canonical/improve.md +1 -1
- package/dist/templates/slash-commands/_canonical/plan.md +1 -1
- package/dist/templates/slash-commands/_canonical/prd.md +1 -1
- package/dist/templates/slash-commands/_canonical/refine.md +1 -1
- package/dist/templates/slash-commands/_canonical/review.md +1 -1
- package/dist/templates/slash-commands/_canonical/start.md +1 -1
- package/dist/templates/slash-commands/_canonical/summarize.md +1 -1
- package/dist/templates/slash-commands/_canonical/verify.md +1 -1
- package/dist/templates/slash-commands/_components/agent-protocols/AGENT_MANUAL.md +1 -1
- package/dist/types/agent.d.ts +1 -1
- package/dist/utils/integration-selector.js +1 -1
- package/dist/utils/schemas.d.ts +20 -20
- package/dist/utils/schemas.js +2 -2
- package/package.json +1 -1
- package/dist/core/adapters/copilot-instructions-generator.d.ts +0 -16
- package/dist/core/adapters/copilot-instructions-generator.js +0 -38
- package/dist/templates/agents/copilot-instructions.md +0 -189
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Clavix
|
|
2
2
|
|
|
3
|
-
> Agentic-first prompt workflows. Markdown templates that teach AI agents how to optimize prompts, create PRDs, and manage implementation. Works with Claude Code, Cursor, Windsurf, and
|
|
3
|
+
> Agentic-first prompt workflows. Markdown templates that teach AI agents how to optimize prompts, create PRDs, and manage implementation. Works with Claude Code, Cursor, Windsurf, GitHub Copilot, and many AI coding tools.
|
|
4
4
|
|
|
5
5
|
## Quick Links
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
| Tool Type | Format | Example |
|
|
20
20
|
|-----------|--------|---------|
|
|
21
21
|
| **CLI tools** (Claude Code, Gemini, Qwen) | Colon (`:`) | `/clavix:improve` |
|
|
22
|
-
| **
|
|
22
|
+
| **IDEs & extensions** (Cursor, Windsurf, Cline, GitHub Copilot) | Hyphen (`-`) | `/clavix-improve` |
|
|
23
23
|
|
|
24
24
|
**Rule of thumb:** CLI tools use colon, IDE extensions use hyphen.
|
|
25
25
|
|
|
@@ -32,13 +32,19 @@ npm install -g clavix
|
|
|
32
32
|
clavix init
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
During `clavix init`, pick your AI tools (Cursor, Claude Code, GitHub Copilot, etc.). Clavix installs slash command templates into those integrations.
|
|
36
|
+
|
|
35
37
|
### 2. Use Slash Commands
|
|
36
38
|
|
|
37
|
-
```
|
|
39
|
+
```text
|
|
40
|
+
# CLI-style tools (Claude Code, Gemini, Qwen)
|
|
38
41
|
/clavix:improve "Create a secure login page with JWT"
|
|
42
|
+
|
|
43
|
+
# IDE-style tools (Cursor, Windsurf, GitHub Copilot, etc.)
|
|
44
|
+
/clavix-improve "Create a secure login page with JWT"
|
|
39
45
|
```
|
|
40
46
|
|
|
41
|
-
The AI agent reads the template and optimizes your prompt.
|
|
47
|
+
The AI agent reads the Clavix template and optimizes your prompt.
|
|
42
48
|
|
|
43
49
|
### 3. Choose Your Workflow
|
|
44
50
|
|
|
@@ -79,7 +85,7 @@ Have a conversation to explore requirements, then extract and plan.
|
|
|
79
85
|
```
|
|
80
86
|
Refine existing PRDs or prompts based on feedback.
|
|
81
87
|
|
|
82
|
-
### All
|
|
88
|
+
### All 10 Slash Commands
|
|
83
89
|
|
|
84
90
|
| Command | Purpose |
|
|
85
91
|
|---------|---------|
|
|
@@ -91,21 +97,24 @@ Refine existing PRDs or prompts based on feedback.
|
|
|
91
97
|
| `/clavix:summarize` | Extract requirements from conversation |
|
|
92
98
|
| `/clavix:refine` | Refine existing PRD or prompt |
|
|
93
99
|
| `/clavix:verify` | Verify implementation against requirements |
|
|
100
|
+
| `/clavix:review` | Review teammate PRs using criteria presets |
|
|
94
101
|
| `/clavix:archive` | Archive completed projects |
|
|
95
102
|
|
|
96
|
-
|
|
103
|
+
`/clavix:review` is for reviewing teammates' PRs (criteria-driven, severity levels, saved reports), while `/clavix:verify` checks your implementation against your own PRD.
|
|
104
|
+
|
|
105
|
+
For a full walkthrough, see [Getting Started](docs/getting-started.md).
|
|
97
106
|
|
|
98
107
|
## How It Works
|
|
99
108
|
|
|
100
109
|
Clavix is **agentic-first**:
|
|
101
110
|
|
|
102
|
-
1. **You run `clavix init`**
|
|
103
|
-
2. **You invoke a slash command**
|
|
104
|
-
3. **AI agent reads the template**
|
|
105
|
-
4. **
|
|
106
|
-
5. **
|
|
111
|
+
1. **You run `clavix init`** – Select integrations (Cursor, Claude Code, GitHub Copilot, etc.). Clavix installs markdown templates into each tool (e.g. `.cursor/commands/`, `.github/prompts/clavix-*.prompt.md`).
|
|
112
|
+
2. **You invoke a slash command** – Like `/clavix:improve`, `/clavix:plan`, or `/clavix:review` in your AI tool.
|
|
113
|
+
3. **The AI agent reads the template** – Structured markdown instructions with frontmatter.
|
|
114
|
+
4. **The agent follows the instructions** – Using its native tools (edit files, run tests, summarize, review PRs, etc.).
|
|
115
|
+
5. **Outputs are saved locally** – Under `.clavix/outputs/` (including `.clavix/outputs/reviews/` for PR review reports).
|
|
107
116
|
|
|
108
|
-
**No TypeScript executes during slash commands.** The markdown templates ARE the product.
|
|
117
|
+
**No TypeScript executes during slash commands.** The markdown templates ARE the product; Clavix only installs and updates them.
|
|
109
118
|
|
|
110
119
|
See [Architecture](docs/architecture.md) for details.
|
|
111
120
|
|
|
@@ -113,9 +122,11 @@ See [Architecture](docs/architecture.md) for details.
|
|
|
113
122
|
|
|
114
123
|
| Category | Tools |
|
|
115
124
|
|----------|-------|
|
|
116
|
-
|
|
|
125
|
+
| IDEs & extensions | Cursor, Windsurf, Kilocode, Roocode, Cline, GitHub Copilot (VS Code) |
|
|
117
126
|
| CLI agents | Claude Code, Gemini CLI, Qwen Code, Droid CLI, CodeBuddy, OpenCode, LLXPRT, Amp, Crush CLI, Codex CLI, Augment CLI, Vibe CLI |
|
|
118
|
-
| Universal | AGENTS.md,
|
|
127
|
+
| Universal formats | AGENTS.md, OCTO.md, WARP.md |
|
|
128
|
+
|
|
129
|
+
In GitHub Copilot Chat, Clavix commands appear as `/clavix-improve`, `/clavix-prd`, `/clavix-review`, etc.
|
|
119
130
|
|
|
120
131
|
Full list: [docs/integrations.md](docs/integrations.md)
|
|
121
132
|
|
|
@@ -123,12 +134,12 @@ Full list: [docs/integrations.md](docs/integrations.md)
|
|
|
123
134
|
|
|
124
135
|
| Command | Purpose |
|
|
125
136
|
|---------|---------|
|
|
126
|
-
| `clavix init` | Initialize Clavix in a project |
|
|
127
|
-
| `clavix update` | Regenerate templates |
|
|
128
|
-
| `clavix diagnose` | Check installation |
|
|
137
|
+
| `clavix init` | Initialize or reconfigure Clavix integrations in a project |
|
|
138
|
+
| `clavix update` | Regenerate templates for selected integrations |
|
|
139
|
+
| `clavix diagnose` | Check installation and integration health |
|
|
129
140
|
| `clavix version` | Show version |
|
|
130
141
|
|
|
131
|
-
All workflows (`/clavix:improve`, etc.) are **slash commands** that AI
|
|
142
|
+
All workflows (`/clavix:improve`, `/clavix:plan`, `/clavix:review`, etc.) are **slash commands** that your AI tools execute using Clavix templates.
|
|
132
143
|
|
|
133
144
|
## Documentation
|
|
134
145
|
|
|
@@ -142,7 +153,7 @@ All workflows (`/clavix:improve`, etc.) are **slash commands** that AI agents ex
|
|
|
142
153
|
|
|
143
154
|
- **Node.js >= 18.0.0**
|
|
144
155
|
- npm or yarn
|
|
145
|
-
- An AI coding tool (Claude Code, Cursor, etc.)
|
|
156
|
+
- An AI coding tool (Claude Code, Cursor, GitHub Copilot, etc.)
|
|
146
157
|
|
|
147
158
|
## License
|
|
148
159
|
|
|
@@ -10,7 +10,6 @@ import { DocInjector } from '../../core/doc-injector.js';
|
|
|
10
10
|
import { AgentsMdGenerator } from '../../core/adapters/agents-md-generator.js';
|
|
11
11
|
import { OctoMdGenerator } from '../../core/adapters/octo-md-generator.js';
|
|
12
12
|
import { WarpMdGenerator } from '../../core/adapters/warp-md-generator.js';
|
|
13
|
-
import { CopilotInstructionsGenerator } from '../../core/adapters/copilot-instructions-generator.js';
|
|
14
13
|
import { InstructionsGenerator } from '../../core/adapters/instructions-generator.js';
|
|
15
14
|
import { FileSystem } from '../../utils/file-system.js';
|
|
16
15
|
import { DEFAULT_CONFIG } from '../../types/config.js';
|
|
@@ -278,12 +277,6 @@ export default class Init extends Command {
|
|
|
278
277
|
await AgentsMdGenerator.generate();
|
|
279
278
|
continue;
|
|
280
279
|
}
|
|
281
|
-
// Handle copilot-instructions separately (it's not an adapter)
|
|
282
|
-
if (integrationName === 'copilot-instructions') {
|
|
283
|
-
this.log(chalk.gray(' ✓ Generating .github/copilot-instructions.md...'));
|
|
284
|
-
await CopilotInstructionsGenerator.generate();
|
|
285
|
-
continue;
|
|
286
|
-
}
|
|
287
280
|
// Handle octo-md separately (it's not an adapter)
|
|
288
281
|
if (integrationName === 'octo-md') {
|
|
289
282
|
this.log(chalk.gray(' ✓ Generating OCTO.md...'));
|
|
@@ -433,11 +426,6 @@ export default class Init extends Command {
|
|
|
433
426
|
await AgentsMdGenerator.generate();
|
|
434
427
|
continue;
|
|
435
428
|
}
|
|
436
|
-
if (integrationName === 'copilot-instructions') {
|
|
437
|
-
this.log(chalk.gray(' ✓ Regenerating .github/copilot-instructions.md...'));
|
|
438
|
-
await CopilotInstructionsGenerator.generate();
|
|
439
|
-
continue;
|
|
440
|
-
}
|
|
441
429
|
if (integrationName === 'octo-md') {
|
|
442
430
|
this.log(chalk.gray(' ✓ Regenerating OCTO.md...'));
|
|
443
431
|
await OctoMdGenerator.generate();
|
|
@@ -5,7 +5,7 @@ import type { AgentManager } from '../../../core/agent-manager.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* Doc generator integrations (not regular adapters)
|
|
7
7
|
*/
|
|
8
|
-
export declare const DOC_GENERATOR_INTEGRATIONS: readonly ["agents-md", "octo-md", "warp-md"
|
|
8
|
+
export declare const DOC_GENERATOR_INTEGRATIONS: readonly ["agents-md", "octo-md", "warp-md"];
|
|
9
9
|
/**
|
|
10
10
|
* Integrations that use colon separator (CLI tools)
|
|
11
11
|
*/
|
|
@@ -5,17 +5,11 @@ import { DocInjector } from '../../../core/doc-injector.js';
|
|
|
5
5
|
import { AgentsMdGenerator } from '../../../core/adapters/agents-md-generator.js';
|
|
6
6
|
import { OctoMdGenerator } from '../../../core/adapters/octo-md-generator.js';
|
|
7
7
|
import { WarpMdGenerator } from '../../../core/adapters/warp-md-generator.js';
|
|
8
|
-
import { CopilotInstructionsGenerator } from '../../../core/adapters/copilot-instructions-generator.js';
|
|
9
8
|
import { InstructionsGenerator } from '../../../core/adapters/instructions-generator.js';
|
|
10
9
|
/**
|
|
11
10
|
* Doc generator integrations (not regular adapters)
|
|
12
11
|
*/
|
|
13
|
-
export const DOC_GENERATOR_INTEGRATIONS = [
|
|
14
|
-
'agents-md',
|
|
15
|
-
'octo-md',
|
|
16
|
-
'warp-md',
|
|
17
|
-
'copilot-instructions',
|
|
18
|
-
];
|
|
12
|
+
export const DOC_GENERATOR_INTEGRATIONS = ['agents-md', 'octo-md', 'warp-md'];
|
|
19
13
|
/**
|
|
20
14
|
* Integrations that use colon separator (CLI tools)
|
|
21
15
|
*/
|
|
@@ -47,9 +41,6 @@ export async function generateDocGeneratorContent(integrationName) {
|
|
|
47
41
|
case 'warp-md':
|
|
48
42
|
await WarpMdGenerator.generate();
|
|
49
43
|
break;
|
|
50
|
-
case 'copilot-instructions':
|
|
51
|
-
await CopilotInstructionsGenerator.generate();
|
|
52
|
-
break;
|
|
53
44
|
}
|
|
54
45
|
}
|
|
55
46
|
/**
|
|
@@ -66,9 +57,6 @@ export async function cleanupDocGeneratorIntegration(integrationName) {
|
|
|
66
57
|
case 'warp-md':
|
|
67
58
|
await DocInjector.removeBlock('WARP.md');
|
|
68
59
|
break;
|
|
69
|
-
case 'copilot-instructions':
|
|
70
|
-
await DocInjector.removeBlock('.github/copilot-instructions.md');
|
|
71
|
-
break;
|
|
72
60
|
}
|
|
73
61
|
}
|
|
74
62
|
/**
|
|
@@ -194,14 +194,15 @@
|
|
|
194
194
|
"type": "universal"
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
|
-
"name": "copilot
|
|
197
|
+
"name": "copilot",
|
|
198
198
|
"displayName": "GitHub Copilot",
|
|
199
|
-
"directory": ".github",
|
|
200
|
-
"filenamePattern": "
|
|
201
|
-
"extension": ".md",
|
|
199
|
+
"directory": ".github/prompts",
|
|
200
|
+
"filenamePattern": "clavix-{name}",
|
|
201
|
+
"extension": ".prompt.md",
|
|
202
202
|
"separator": "-",
|
|
203
203
|
"detection": ".github",
|
|
204
|
-
"
|
|
204
|
+
"specialAdapter": "prompt-files",
|
|
205
|
+
"type": "standard"
|
|
205
206
|
},
|
|
206
207
|
{
|
|
207
208
|
"name": "octo-md",
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BaseAdapter } from './base-adapter.js';
|
|
2
|
+
import { CommandTemplate } from '../../types/agent.js';
|
|
3
|
+
import { ClavixConfig } from '../../types/config.js';
|
|
4
|
+
/**
|
|
5
|
+
* GitHub Copilot Prompts Adapter
|
|
6
|
+
*
|
|
7
|
+
* Generates custom slash commands as .prompt.md files in .github/prompts/
|
|
8
|
+
* These appear as /clavix-improve, /clavix-prd, etc. in VS Code with GitHub Copilot
|
|
9
|
+
*
|
|
10
|
+
* Format reference: https://code.visualstudio.com/docs/copilot/copilot-customization
|
|
11
|
+
*
|
|
12
|
+
* @since v6.1.0
|
|
13
|
+
*/
|
|
14
|
+
export declare class CopilotPromptsAdapter extends BaseAdapter {
|
|
15
|
+
readonly name = "copilot";
|
|
16
|
+
readonly displayName = "GitHub Copilot";
|
|
17
|
+
readonly directory = ".github/prompts";
|
|
18
|
+
readonly fileExtension = ".prompt.md";
|
|
19
|
+
readonly features: {
|
|
20
|
+
supportsSubdirectories: boolean;
|
|
21
|
+
commandFormat: {
|
|
22
|
+
separator: "-";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
protected readonly userConfig?: ClavixConfig;
|
|
26
|
+
constructor(userConfig?: ClavixConfig);
|
|
27
|
+
/**
|
|
28
|
+
* Detect if GitHub Copilot is likely in use
|
|
29
|
+
* Check for .github directory (common for GitHub projects)
|
|
30
|
+
*/
|
|
31
|
+
detectProject(): Promise<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Get command path for Copilot prompts
|
|
34
|
+
*/
|
|
35
|
+
getCommandPath(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get target filename for a command
|
|
38
|
+
* Format: clavix-{name}.prompt.md
|
|
39
|
+
*/
|
|
40
|
+
getTargetFilename(name: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Determine if a file is a Clavix-generated prompt
|
|
43
|
+
*/
|
|
44
|
+
protected isClavixGeneratedCommand(filename: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Format command content with Copilot prompt file frontmatter
|
|
47
|
+
*
|
|
48
|
+
* Copilot prompt files support YAML frontmatter with:
|
|
49
|
+
* - name: The slash command name (shown after /)
|
|
50
|
+
* - description: Short description shown in command picker
|
|
51
|
+
* - agent: Which agent to use (ask, edit, agent)
|
|
52
|
+
* - tools: List of available tools
|
|
53
|
+
*/
|
|
54
|
+
protected formatCommand(template: CommandTemplate): string;
|
|
55
|
+
/**
|
|
56
|
+
* Generate YAML frontmatter for Copilot prompt file
|
|
57
|
+
*/
|
|
58
|
+
private generateFrontmatter;
|
|
59
|
+
/**
|
|
60
|
+
* Generate commands with Copilot-specific formatting
|
|
61
|
+
*/
|
|
62
|
+
generateCommands(templates: CommandTemplate[]): Promise<void>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=copilot-prompts-adapter.d.ts.map
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import { BaseAdapter } from './base-adapter.js';
|
|
3
|
+
import { FileSystem } from '../../utils/file-system.js';
|
|
4
|
+
import { IntegrationError } from '../../types/errors.js';
|
|
5
|
+
/**
|
|
6
|
+
* GitHub Copilot Prompts Adapter
|
|
7
|
+
*
|
|
8
|
+
* Generates custom slash commands as .prompt.md files in .github/prompts/
|
|
9
|
+
* These appear as /clavix-improve, /clavix-prd, etc. in VS Code with GitHub Copilot
|
|
10
|
+
*
|
|
11
|
+
* Format reference: https://code.visualstudio.com/docs/copilot/copilot-customization
|
|
12
|
+
*
|
|
13
|
+
* @since v6.1.0
|
|
14
|
+
*/
|
|
15
|
+
export class CopilotPromptsAdapter extends BaseAdapter {
|
|
16
|
+
name = 'copilot';
|
|
17
|
+
displayName = 'GitHub Copilot';
|
|
18
|
+
directory = '.github/prompts';
|
|
19
|
+
fileExtension = '.prompt.md';
|
|
20
|
+
features = {
|
|
21
|
+
supportsSubdirectories: false,
|
|
22
|
+
commandFormat: { separator: '-' },
|
|
23
|
+
};
|
|
24
|
+
userConfig;
|
|
25
|
+
constructor(userConfig) {
|
|
26
|
+
super();
|
|
27
|
+
this.userConfig = userConfig;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Detect if GitHub Copilot is likely in use
|
|
31
|
+
* Check for .github directory (common for GitHub projects)
|
|
32
|
+
*/
|
|
33
|
+
async detectProject() {
|
|
34
|
+
return await FileSystem.exists('.github');
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get command path for Copilot prompts
|
|
38
|
+
*/
|
|
39
|
+
getCommandPath() {
|
|
40
|
+
return this.directory;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get target filename for a command
|
|
44
|
+
* Format: clavix-{name}.prompt.md
|
|
45
|
+
*/
|
|
46
|
+
getTargetFilename(name) {
|
|
47
|
+
return `clavix-${name}${this.fileExtension}`;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Determine if a file is a Clavix-generated prompt
|
|
51
|
+
*/
|
|
52
|
+
isClavixGeneratedCommand(filename) {
|
|
53
|
+
return filename.startsWith('clavix-') && filename.endsWith('.prompt.md');
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Format command content with Copilot prompt file frontmatter
|
|
57
|
+
*
|
|
58
|
+
* Copilot prompt files support YAML frontmatter with:
|
|
59
|
+
* - name: The slash command name (shown after /)
|
|
60
|
+
* - description: Short description shown in command picker
|
|
61
|
+
* - agent: Which agent to use (ask, edit, agent)
|
|
62
|
+
* - tools: List of available tools
|
|
63
|
+
*/
|
|
64
|
+
formatCommand(template) {
|
|
65
|
+
const frontmatter = this.generateFrontmatter(template);
|
|
66
|
+
return `${frontmatter}\n${template.content}`;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Generate YAML frontmatter for Copilot prompt file
|
|
70
|
+
*/
|
|
71
|
+
generateFrontmatter(template) {
|
|
72
|
+
// Extract description from template frontmatter if present
|
|
73
|
+
const descMatch = template.content.match(/^---\s*\n[\s\S]*?description:\s*(.+)\n[\s\S]*?---/);
|
|
74
|
+
const description = descMatch ? descMatch[1].trim() : template.description;
|
|
75
|
+
// Map Clavix commands to appropriate Copilot agents
|
|
76
|
+
const agentMapping = {
|
|
77
|
+
improve: 'ask',
|
|
78
|
+
prd: 'ask',
|
|
79
|
+
start: 'ask',
|
|
80
|
+
summarize: 'ask',
|
|
81
|
+
refine: 'ask',
|
|
82
|
+
plan: 'ask',
|
|
83
|
+
review: 'ask',
|
|
84
|
+
verify: 'ask',
|
|
85
|
+
implement: 'agent',
|
|
86
|
+
archive: 'agent',
|
|
87
|
+
};
|
|
88
|
+
const agent = agentMapping[template.name] || 'ask';
|
|
89
|
+
// For implementation commands, include tools
|
|
90
|
+
const toolsLine = agent === 'agent' ? '\ntools:\n - editFiles\n - runCommands\n - codebase' : '';
|
|
91
|
+
return `---
|
|
92
|
+
name: clavix-${template.name}
|
|
93
|
+
description: "${description.replace(/"/g, '\\"')}"
|
|
94
|
+
agent: ${agent}${toolsLine}
|
|
95
|
+
---`;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Generate commands with Copilot-specific formatting
|
|
99
|
+
*/
|
|
100
|
+
async generateCommands(templates) {
|
|
101
|
+
const commandPath = this.getCommandPath();
|
|
102
|
+
try {
|
|
103
|
+
// Ensure directory exists
|
|
104
|
+
await FileSystem.ensureDir(commandPath);
|
|
105
|
+
// Generate each command file
|
|
106
|
+
for (const template of templates) {
|
|
107
|
+
const content = this.formatCommand(template);
|
|
108
|
+
const filename = this.getTargetFilename(template.name);
|
|
109
|
+
const filePath = path.join(commandPath, filename);
|
|
110
|
+
await FileSystem.writeFileAtomic(filePath, content);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
throw new IntegrationError(`Failed to generate ${this.displayName} commands: ${error}`, `Ensure ${commandPath} is writable`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=copilot-prompts-adapter.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ClaudeCodeAdapter } from './adapters/claude-code-adapter.js';
|
|
2
|
+
import { CopilotPromptsAdapter } from './adapters/copilot-prompts-adapter.js';
|
|
2
3
|
import { GeminiAdapter } from './adapters/gemini-adapter.js';
|
|
3
4
|
import { QwenAdapter } from './adapters/qwen-adapter.js';
|
|
4
5
|
import { LlxprtAdapter } from './adapters/llxprt-adapter.js';
|
|
@@ -21,6 +22,7 @@ export class AgentManager {
|
|
|
21
22
|
this.userConfig = userConfig;
|
|
22
23
|
// Register special adapters (require custom logic)
|
|
23
24
|
this.registerAdapter(new ClaudeCodeAdapter(userConfig)); // Doc injection
|
|
25
|
+
this.registerAdapter(new CopilotPromptsAdapter(userConfig)); // Prompt files
|
|
24
26
|
this.registerAdapter(new GeminiAdapter(userConfig)); // TOML format
|
|
25
27
|
this.registerAdapter(new QwenAdapter(userConfig)); // TOML format
|
|
26
28
|
this.registerAdapter(new LlxprtAdapter(userConfig)); // TOML format
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# Clavix Instructions for Generic Agents
|
|
2
|
+
|
|
3
|
+
This guide is for agents that can only read documentation (no slash-command support). If your platform supports custom slash commands, use those instead.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ⛔ CLAVIX MODE ENFORCEMENT
|
|
8
|
+
|
|
9
|
+
**CRITICAL: Know which mode you're in and STOP at the right point.**
|
|
10
|
+
|
|
11
|
+
**OPTIMIZATION workflows** (NO CODE ALLOWED):
|
|
12
|
+
- Improve mode - Prompt optimization only (auto-selects depth)
|
|
13
|
+
- Your role: Analyze, optimize, show improved prompt, **STOP**
|
|
14
|
+
- ❌ DO NOT implement the prompt's requirements
|
|
15
|
+
- ✅ After showing optimized prompt, tell user: "Run `/clavix:implement --latest` to implement"
|
|
16
|
+
|
|
17
|
+
**PLANNING workflows** (NO CODE ALLOWED):
|
|
18
|
+
- Conversational mode, requirement extraction, PRD generation
|
|
19
|
+
- Your role: Ask questions, create PRDs/prompts, extract requirements
|
|
20
|
+
- ❌ DO NOT implement features during these workflows
|
|
21
|
+
|
|
22
|
+
**IMPLEMENTATION workflows** (CODE ALLOWED):
|
|
23
|
+
- Only after user runs execute/implement commands
|
|
24
|
+
- Your role: Write code, execute tasks, implement features
|
|
25
|
+
- ✅ DO implement code during these workflows
|
|
26
|
+
|
|
27
|
+
**If unsure, ASK:** "Should I implement this now, or continue with planning?"
|
|
28
|
+
|
|
29
|
+
See `.clavix/instructions/core/clavix-mode.md` for complete mode documentation.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 📁 Detailed Workflow Instructions
|
|
34
|
+
|
|
35
|
+
For complete step-by-step workflows, see `.clavix/instructions/`:
|
|
36
|
+
|
|
37
|
+
| Workflow | Instruction File | Purpose |
|
|
38
|
+
|----------|-----------------|---------|
|
|
39
|
+
| **Conversational Mode** | `workflows/start.md` | Natural requirements gathering through discussion |
|
|
40
|
+
| **Extract Requirements** | `workflows/summarize.md` | Analyze conversation → mini-PRD + optimized prompts |
|
|
41
|
+
| **Prompt Optimization** | `workflows/improve.md` | Intent detection + quality assessment + auto-depth selection |
|
|
42
|
+
| **PRD Generation** | `workflows/prd.md` | Socratic questions → full PRD + quick PRD |
|
|
43
|
+
| **Mode Boundaries** | `core/clavix-mode.md` | Planning vs implementation distinction |
|
|
44
|
+
| **File Operations** | `core/file-operations.md` | File creation patterns |
|
|
45
|
+
| **Verification** | `core/verification.md` | Post-implementation verification |
|
|
46
|
+
|
|
47
|
+
**Troubleshooting:**
|
|
48
|
+
- `troubleshooting/jumped-to-implementation.md` - If you started coding during planning
|
|
49
|
+
- `troubleshooting/skipped-file-creation.md` - If files weren't created
|
|
50
|
+
- `troubleshooting/mode-confusion.md` - When unclear about planning vs implementation
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 🔍 Workflow Detection Keywords
|
|
55
|
+
|
|
56
|
+
| Keywords in User Request | Recommended Workflow | File Reference |
|
|
57
|
+
|---------------------------|---------------------|----------------|
|
|
58
|
+
| "improve this prompt", "make it better", "optimize" | Improve mode → Auto-depth optimization | `workflows/improve.md` |
|
|
59
|
+
| "analyze thoroughly", "edge cases", "alternatives" | Improve mode (--comprehensive) | `workflows/improve.md` |
|
|
60
|
+
| "create a PRD", "product requirements" | PRD mode → Socratic questioning | `workflows/prd.md` |
|
|
61
|
+
| "let's discuss", "not sure what I want" | Conversational mode → Start gathering | `workflows/start.md` |
|
|
62
|
+
| "summarize our conversation" | Extract mode → Analyze thread | `workflows/summarize.md` |
|
|
63
|
+
| "refine", "update PRD", "change requirements", "modify prompt" | Refine mode → Update existing content | `workflows/refine.md` |
|
|
64
|
+
| "verify", "check my implementation" | Verify mode → Implementation verification | `core/verification.md` |
|
|
65
|
+
|
|
66
|
+
**When detected:** Reference the corresponding `.clavix/instructions/workflows/{workflow}.md` file.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 📋 Clavix Commands (v5)
|
|
71
|
+
|
|
72
|
+
### Setup Commands (CLI)
|
|
73
|
+
| Command | Purpose |
|
|
74
|
+
|---------|---------|
|
|
75
|
+
| `clavix init` | Initialize Clavix in a project |
|
|
76
|
+
| `clavix update` | Update templates after package update |
|
|
77
|
+
| `clavix diagnose` | Check installation health |
|
|
78
|
+
| `clavix version` | Show version |
|
|
79
|
+
|
|
80
|
+
### Workflow Commands (Slash Commands)
|
|
81
|
+
All workflows are executed via slash commands that AI agents read and follow:
|
|
82
|
+
|
|
83
|
+
> **Command Format:** Commands shown with colon (`:`) format. Some tools use hyphen (`-`): Claude Code uses `/clavix:improve`, Cursor uses `/clavix-improve`. Your tool autocompletes the correct format.
|
|
84
|
+
|
|
85
|
+
| Slash Command | Purpose |
|
|
86
|
+
|---------------|---------|
|
|
87
|
+
| `/clavix:improve` | Optimize prompts (auto-selects depth) |
|
|
88
|
+
| `/clavix:prd` | Generate PRD through guided questions |
|
|
89
|
+
| `/clavix:plan` | Create task breakdown from PRD |
|
|
90
|
+
| `/clavix:implement` | Execute tasks or prompts (auto-detects source) |
|
|
91
|
+
| `/clavix:start` | Begin conversational session |
|
|
92
|
+
| `/clavix:summarize` | Extract requirements from conversation |
|
|
93
|
+
| `/clavix:refine` | Refine existing PRD or saved prompt |
|
|
94
|
+
|
|
95
|
+
### Agentic Utilities (Project Management)
|
|
96
|
+
These utilities provide structured workflows for project completion:
|
|
97
|
+
|
|
98
|
+
| Utility | Purpose |
|
|
99
|
+
|---------|---------|
|
|
100
|
+
| `/clavix:verify` | Check implementation against PRD requirements, run validation |
|
|
101
|
+
| `/clavix:archive` | Archive completed work to `.clavix/archive/` for reference |
|
|
102
|
+
|
|
103
|
+
**Quick start:**
|
|
104
|
+
```bash
|
|
105
|
+
npm install -g clavix
|
|
106
|
+
clavix init
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**How it works:** Slash commands are markdown templates. When invoked, the agent reads the template and follows its instructions using native tools (Read, Write, Edit, Bash).
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 🔄 Standard Workflow
|
|
114
|
+
|
|
115
|
+
**Clavix follows this progression:**
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
PRD Creation → Task Planning → Implementation → Archive
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Detailed steps:**
|
|
122
|
+
|
|
123
|
+
1. **Planning Phase**
|
|
124
|
+
- Run: `/clavix:prd` or `/clavix:start` → `/clavix:summarize`
|
|
125
|
+
- Output: `.clavix/outputs/{project}/full-prd.md` + `quick-prd.md`
|
|
126
|
+
- Mode: PLANNING
|
|
127
|
+
|
|
128
|
+
2. **Task Preparation**
|
|
129
|
+
- Run: `/clavix:plan` transforms PRD into curated task list
|
|
130
|
+
- Output: `.clavix/outputs/{project}/tasks.md`
|
|
131
|
+
- Mode: PLANNING (Pre-Implementation)
|
|
132
|
+
|
|
133
|
+
3. **Implementation Phase**
|
|
134
|
+
- Run: `/clavix:implement`
|
|
135
|
+
- Agent executes tasks systematically
|
|
136
|
+
- Mode: IMPLEMENTATION
|
|
137
|
+
- Agent edits tasks.md directly to mark progress (`- [ ]` → `- [x]`)
|
|
138
|
+
|
|
139
|
+
4. **Completion**
|
|
140
|
+
- Run: `/clavix:archive`
|
|
141
|
+
- Archives completed work
|
|
142
|
+
- Mode: Management
|
|
143
|
+
|
|
144
|
+
**Key principle:** Planning workflows create documents. Implementation workflows write code.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 💡 Best Practices for Generic Agents
|
|
149
|
+
|
|
150
|
+
1. **Always reference instruction files** - Don't recreate workflow steps inline, point to `.clavix/instructions/workflows/`
|
|
151
|
+
|
|
152
|
+
2. **Respect mode boundaries** - Planning mode = no code, Implementation mode = write code
|
|
153
|
+
|
|
154
|
+
3. **Use checkpoints** - Follow the CHECKPOINT pattern from instruction files to track progress
|
|
155
|
+
|
|
156
|
+
4. **Create files explicitly** - Use Write tool for every file, verify with ls, never skip file creation
|
|
157
|
+
|
|
158
|
+
5. **Ask when unclear** - If mode is ambiguous, ask: "Should I implement or continue planning?"
|
|
159
|
+
|
|
160
|
+
6. **Track complexity** - Use conversational mode for complex requirements (15+ exchanges, 5+ features, 3+ topics)
|
|
161
|
+
|
|
162
|
+
7. **Label improvements** - When optimizing prompts, mark changes with [ADDED], [CLARIFIED], [STRUCTURED], [EXPANDED], [SCOPED]
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## ⚠️ Common Mistakes
|
|
167
|
+
|
|
168
|
+
### ❌ Jumping to implementation during planning
|
|
169
|
+
**Wrong:** User discusses feature → agent generates code immediately
|
|
170
|
+
|
|
171
|
+
**Right:** User discusses feature → agent asks questions → creates PRD/prompt → asks if ready to implement
|
|
172
|
+
|
|
173
|
+
### ❌ Skipping file creation
|
|
174
|
+
**Wrong:** Display content in chat, don't write files
|
|
175
|
+
|
|
176
|
+
**Right:** Create directory → Write files → Verify existence → Display paths
|
|
177
|
+
|
|
178
|
+
### ❌ Recreating workflow instructions inline
|
|
179
|
+
**Wrong:** Copy entire fast mode workflow into response
|
|
180
|
+
|
|
181
|
+
**Right:** Reference `.clavix/instructions/workflows/improve.md` and follow its steps
|
|
182
|
+
|
|
183
|
+
### ❌ Not using instruction files
|
|
184
|
+
**Wrong:** Make up workflow steps or guess at process
|
|
185
|
+
|
|
186
|
+
**Right:** Read corresponding `.clavix/instructions/workflows/*.md` file and follow exactly
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
**Artifacts stored under `.clavix/`:**
|
|
191
|
+
- `.clavix/outputs/<project>/` - PRDs, tasks, prompts
|
|
192
|
+
- `.clavix/templates/` - Custom overrides
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
**For complete workflows:** Always reference `.clavix/instructions/workflows/{workflow}.md`
|
|
197
|
+
|
|
198
|
+
**For troubleshooting:** Check `.clavix/instructions/troubleshooting/`
|
|
199
|
+
|
|
200
|
+
**For mode clarification:** See `.clavix/instructions/core/clavix-mode.md`
|