clavix 5.6.4 → 5.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli/commands/update.js +6 -0
- package/dist/cli/helpers/init/commands.d.ts +23 -0
- package/dist/cli/helpers/init/commands.js +39 -0
- package/dist/cli/helpers/init/config.d.ts +20 -0
- package/dist/cli/helpers/init/config.js +49 -0
- package/dist/cli/helpers/init/directories.d.ts +12 -0
- package/dist/cli/helpers/init/directories.js +17 -0
- package/dist/cli/helpers/init/documentation.d.ts +25 -0
- package/dist/cli/helpers/init/documentation.js +176 -0
- package/dist/cli/helpers/init/index.d.ts +20 -0
- package/dist/cli/helpers/init/index.js +20 -0
- package/dist/cli/helpers/init/integrations.d.ts +44 -0
- package/dist/cli/helpers/init/integrations.js +109 -0
- package/dist/cli/helpers/init/prompts.d.ts +31 -0
- package/dist/cli/helpers/init/prompts.js +97 -0
- package/dist/templates/agents/octo.md +1 -0
- package/dist/templates/agents/warp.md +1 -0
- package/dist/templates/slash-commands/_canonical/archive.md +34 -0
- package/dist/templates/slash-commands/_canonical/plan.md +15 -0
- package/dist/templates/slash-commands/_canonical/refine.md +43 -7
- package/dist/templates/slash-commands/_canonical/start.md +24 -0
- package/dist/templates/slash-commands/_canonical/summarize.md +4 -1
- package/dist/templates/slash-commands/_components/MANIFEST.md +2 -1
- package/dist/templates/slash-commands/_components/references/quality-dimensions.md +21 -0
- package/package.json +4 -3
- package/dist/core/adapters/amp-adapter.d.ts +0 -30
- package/dist/core/adapters/amp-adapter.js +0 -35
- package/dist/core/adapters/augment-adapter.d.ts +0 -22
- package/dist/core/adapters/augment-adapter.js +0 -37
- package/dist/core/adapters/cline-adapter.d.ts +0 -37
- package/dist/core/adapters/cline-adapter.js +0 -45
- package/dist/core/adapters/codebuddy-adapter.d.ts +0 -27
- package/dist/core/adapters/codebuddy-adapter.js +0 -43
- package/dist/core/adapters/codex-adapter.d.ts +0 -27
- package/dist/core/adapters/codex-adapter.js +0 -40
- package/dist/core/adapters/crush-adapter.d.ts +0 -35
- package/dist/core/adapters/crush-adapter.js +0 -42
- package/dist/core/adapters/cursor-adapter.d.ts +0 -28
- package/dist/core/adapters/cursor-adapter.js +0 -33
- package/dist/core/adapters/droid-adapter.d.ts +0 -36
- package/dist/core/adapters/droid-adapter.js +0 -51
- package/dist/core/adapters/kilocode-adapter.d.ts +0 -37
- package/dist/core/adapters/kilocode-adapter.js +0 -42
- package/dist/core/adapters/opencode-adapter.d.ts +0 -36
- package/dist/core/adapters/opencode-adapter.js +0 -50
- package/dist/core/adapters/roocode-adapter.d.ts +0 -43
- package/dist/core/adapters/roocode-adapter.js +0 -62
- package/dist/core/adapters/windsurf-adapter.d.ts +0 -37
- package/dist/core/adapters/windsurf-adapter.js +0 -42
- package/dist/index 2.js +0 -13
- package/dist/index.d 2.ts +0 -4
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, and 20 AI coding tools.
|
|
4
4
|
|
|
5
5
|
## Quick Links
|
|
6
6
|
|
|
@@ -36,6 +36,12 @@ export default class Update extends Command {
|
|
|
36
36
|
};
|
|
37
37
|
async run() {
|
|
38
38
|
const { flags } = await this.parse(Update);
|
|
39
|
+
// Validate flag combinations
|
|
40
|
+
if (flags['docs-only'] && flags['commands-only']) {
|
|
41
|
+
this.error(chalk.red('Cannot use --docs-only and --commands-only together.') +
|
|
42
|
+
'\n' +
|
|
43
|
+
chalk.yellow('Hint: Use one flag or neither (to update both).'));
|
|
44
|
+
}
|
|
39
45
|
const clavixDir = path.join(process.cwd(), '.clavix');
|
|
40
46
|
const configPath = path.join(clavixDir, 'config.json');
|
|
41
47
|
if (!fs.existsSync(clavixDir) || !fs.existsSync(configPath)) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slash command generation for Clavix initialization
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentAdapter, CommandTemplate } from '../../../types/agent.js';
|
|
5
|
+
/**
|
|
6
|
+
* Generate slash commands for an adapter
|
|
7
|
+
* Returns the generated templates
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateSlashCommands(adapter: AgentAdapter): Promise<CommandTemplate[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Collect and optionally remove legacy command files
|
|
12
|
+
* Returns paths of legacy files found
|
|
13
|
+
*/
|
|
14
|
+
export declare function collectLegacyFiles(adapter: AgentAdapter, templates: CommandTemplate[]): Promise<string[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Remove legacy command files
|
|
17
|
+
*/
|
|
18
|
+
export declare function removeLegacyFiles(files: string[]): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Get relative paths for legacy files (for display)
|
|
21
|
+
*/
|
|
22
|
+
export declare function getLegacyRelativePaths(files: string[]): string[];
|
|
23
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slash command generation for Clavix initialization
|
|
3
|
+
*/
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import { FileSystem } from '../../../utils/file-system.js';
|
|
6
|
+
import { loadCommandTemplates } from '../../../utils/template-loader.js';
|
|
7
|
+
import { collectLegacyCommandFiles } from '../../../utils/legacy-command-cleanup.js';
|
|
8
|
+
/**
|
|
9
|
+
* Generate slash commands for an adapter
|
|
10
|
+
* Returns the generated templates
|
|
11
|
+
*/
|
|
12
|
+
export async function generateSlashCommands(adapter) {
|
|
13
|
+
const templates = await loadCommandTemplates(adapter);
|
|
14
|
+
await adapter.generateCommands(templates);
|
|
15
|
+
return templates;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Collect and optionally remove legacy command files
|
|
19
|
+
* Returns paths of legacy files found
|
|
20
|
+
*/
|
|
21
|
+
export async function collectLegacyFiles(adapter, templates) {
|
|
22
|
+
const commandNames = templates.map((template) => template.name);
|
|
23
|
+
return collectLegacyCommandFiles(adapter, commandNames);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Remove legacy command files
|
|
27
|
+
*/
|
|
28
|
+
export async function removeLegacyFiles(files) {
|
|
29
|
+
for (const file of files) {
|
|
30
|
+
await FileSystem.remove(file);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get relative paths for legacy files (for display)
|
|
35
|
+
*/
|
|
36
|
+
export function getLegacyRelativePaths(files) {
|
|
37
|
+
return files.map((file) => path.relative(process.cwd(), file)).sort((a, b) => a.localeCompare(b));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration generation and management for Clavix initialization
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Load existing config if present
|
|
6
|
+
* Returns null if no config exists or parsing fails
|
|
7
|
+
*/
|
|
8
|
+
export declare function loadExistingConfig(): Promise<{
|
|
9
|
+
integrations: string[];
|
|
10
|
+
warnings?: string[];
|
|
11
|
+
} | null>;
|
|
12
|
+
/**
|
|
13
|
+
* Generate and save the Clavix config file
|
|
14
|
+
*/
|
|
15
|
+
export declare function generateConfig(integrations: string[]): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Check if Clavix is already initialized in the current directory
|
|
18
|
+
*/
|
|
19
|
+
export declare function isInitialized(): Promise<boolean>;
|
|
20
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration generation and management for Clavix initialization
|
|
3
|
+
*/
|
|
4
|
+
import { FileSystem } from '../../../utils/file-system.js';
|
|
5
|
+
import { DEFAULT_CONFIG } from '../../../types/config.js';
|
|
6
|
+
import { validateUserConfig } from '../../../utils/schemas.js';
|
|
7
|
+
/**
|
|
8
|
+
* Load existing config if present
|
|
9
|
+
* Returns null if no config exists or parsing fails
|
|
10
|
+
*/
|
|
11
|
+
export async function loadExistingConfig() {
|
|
12
|
+
if (!(await FileSystem.exists('.clavix/config.json'))) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const configContent = await FileSystem.readFile('.clavix/config.json');
|
|
17
|
+
const rawConfig = JSON.parse(configContent);
|
|
18
|
+
const validationResult = validateUserConfig(rawConfig);
|
|
19
|
+
if (validationResult.success && validationResult.data) {
|
|
20
|
+
return {
|
|
21
|
+
integrations: validationResult.data.integrations || validationResult.data.providers || [],
|
|
22
|
+
warnings: validationResult.warnings,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Generate and save the Clavix config file
|
|
33
|
+
*/
|
|
34
|
+
export async function generateConfig(integrations) {
|
|
35
|
+
const config = {
|
|
36
|
+
...DEFAULT_CONFIG,
|
|
37
|
+
integrations,
|
|
38
|
+
};
|
|
39
|
+
const configPath = '.clavix/config.json';
|
|
40
|
+
const configContent = JSON.stringify(config, null, 2);
|
|
41
|
+
await FileSystem.writeFileAtomic(configPath, configContent);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if Clavix is already initialized in the current directory
|
|
45
|
+
*/
|
|
46
|
+
export async function isInitialized() {
|
|
47
|
+
return FileSystem.exists('.clavix');
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Directory structure creation for Clavix initialization
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Standard Clavix directory structure
|
|
6
|
+
*/
|
|
7
|
+
export declare const CLAVIX_DIRECTORIES: readonly [".clavix", ".clavix/outputs", ".clavix/templates"];
|
|
8
|
+
/**
|
|
9
|
+
* Create the standard Clavix directory structure
|
|
10
|
+
*/
|
|
11
|
+
export declare function createDirectoryStructure(): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=directories.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Directory structure creation for Clavix initialization
|
|
3
|
+
*/
|
|
4
|
+
import { FileSystem } from '../../../utils/file-system.js';
|
|
5
|
+
/**
|
|
6
|
+
* Standard Clavix directory structure
|
|
7
|
+
*/
|
|
8
|
+
export const CLAVIX_DIRECTORIES = ['.clavix', '.clavix/outputs', '.clavix/templates'];
|
|
9
|
+
/**
|
|
10
|
+
* Create the standard Clavix directory structure
|
|
11
|
+
*/
|
|
12
|
+
export async function createDirectoryStructure() {
|
|
13
|
+
for (const dir of CLAVIX_DIRECTORIES) {
|
|
14
|
+
await FileSystem.ensureDir(dir);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=directories.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Documentation generation and injection for Clavix initialization
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentAdapter } from '../../../types/agent.js';
|
|
5
|
+
/**
|
|
6
|
+
* Extract the Clavix block content from a full document
|
|
7
|
+
*/
|
|
8
|
+
export declare function extractClavixBlock(content: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Inject documentation blocks for an adapter
|
|
11
|
+
*/
|
|
12
|
+
export declare function injectDocumentation(adapter: AgentAdapter): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Generate the INSTRUCTIONS.md file content
|
|
15
|
+
*/
|
|
16
|
+
export declare function getInstructionsContent(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Generate the INSTRUCTIONS.md file
|
|
19
|
+
*/
|
|
20
|
+
export declare function generateInstructions(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Generate the QUICKSTART.md file
|
|
23
|
+
*/
|
|
24
|
+
export declare function generateQuickstart(): Promise<void>;
|
|
25
|
+
//# sourceMappingURL=documentation.d.ts.map
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Documentation generation and injection for Clavix initialization
|
|
3
|
+
*/
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
import { FileSystem } from '../../../utils/file-system.js';
|
|
7
|
+
import { DocInjector } from '../../../core/doc-injector.js';
|
|
8
|
+
import { CLAVIX_BLOCK_START, CLAVIX_BLOCK_END } from '../../../constants.js';
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
/**
|
|
12
|
+
* Extract the Clavix block content from a full document
|
|
13
|
+
*/
|
|
14
|
+
export function extractClavixBlock(content) {
|
|
15
|
+
const regex = new RegExp(`${CLAVIX_BLOCK_START}([\\s\\S]*?)${CLAVIX_BLOCK_END}`);
|
|
16
|
+
const match = content.match(regex);
|
|
17
|
+
return match ? match[1].trim() : content;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Inject documentation blocks for an adapter
|
|
21
|
+
*/
|
|
22
|
+
export async function injectDocumentation(adapter) {
|
|
23
|
+
// Inject AGENTS.md
|
|
24
|
+
const agentsContent = DocInjector.getDefaultAgentsContent();
|
|
25
|
+
await DocInjector.injectBlock('AGENTS.md', extractClavixBlock(agentsContent));
|
|
26
|
+
// Inject CLAUDE.md if Claude Code selected
|
|
27
|
+
if (adapter.name === 'claude-code') {
|
|
28
|
+
const claudeContent = DocInjector.getDefaultClaudeContent();
|
|
29
|
+
await DocInjector.injectBlock('CLAUDE.md', extractClavixBlock(claudeContent));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Generate the INSTRUCTIONS.md file content
|
|
34
|
+
*/
|
|
35
|
+
export function getInstructionsContent() {
|
|
36
|
+
return `# Clavix Instructions
|
|
37
|
+
|
|
38
|
+
Welcome to Clavix! This directory contains your local Clavix configuration and data.
|
|
39
|
+
|
|
40
|
+
## Command Format
|
|
41
|
+
|
|
42
|
+
**Your command format depends on your AI tool:**
|
|
43
|
+
|
|
44
|
+
| Tool Type | Format | Example |
|
|
45
|
+
|-----------|--------|---------|
|
|
46
|
+
| **CLI tools** (Claude Code, Gemini, Qwen) | Colon (\`:\`) | \`/clavix:improve\` |
|
|
47
|
+
| **IDE extensions** (Cursor, Windsurf, Cline) | Hyphen (\`-\`) | \`/clavix-improve\` |
|
|
48
|
+
|
|
49
|
+
**Rule of thumb:** CLI tools use colon, IDE extensions use hyphen.
|
|
50
|
+
|
|
51
|
+
## Directory Structure
|
|
52
|
+
|
|
53
|
+
\`\`\`
|
|
54
|
+
.clavix/
|
|
55
|
+
├── config.json # Your Clavix configuration
|
|
56
|
+
├── INSTRUCTIONS.md # This file
|
|
57
|
+
├── instructions/ # Workflow instruction files for AI agents
|
|
58
|
+
├── outputs/
|
|
59
|
+
│ ├── <project-name>/ # Per-project outputs
|
|
60
|
+
│ │ ├── full-prd.md
|
|
61
|
+
│ │ ├── quick-prd.md
|
|
62
|
+
│ │ └── tasks.md
|
|
63
|
+
│ ├── prompts/ # Saved prompts for re-execution
|
|
64
|
+
│ └── archive/ # Archived completed projects
|
|
65
|
+
└── templates/ # Custom template overrides (optional)
|
|
66
|
+
\`\`\`
|
|
67
|
+
|
|
68
|
+
## Clavix Commands (v5)
|
|
69
|
+
|
|
70
|
+
### Setup Commands (CLI)
|
|
71
|
+
|
|
72
|
+
| Command | Purpose |
|
|
73
|
+
|---------|---------|
|
|
74
|
+
| \`clavix init\` | Initialize Clavix in a project |
|
|
75
|
+
| \`clavix update\` | Update templates after package update |
|
|
76
|
+
| \`clavix diagnose\` | Check installation health |
|
|
77
|
+
| \`clavix version\` | Show version |
|
|
78
|
+
|
|
79
|
+
### Workflow Commands (Slash Commands)
|
|
80
|
+
|
|
81
|
+
All workflows are executed via slash commands that AI agents read and follow:
|
|
82
|
+
|
|
83
|
+
| Slash Command | Purpose |
|
|
84
|
+
|---------------|---------|
|
|
85
|
+
| \`/clavix:improve\` | Optimize prompts (auto-selects depth) |
|
|
86
|
+
| \`/clavix:prd\` | Generate PRD through guided questions |
|
|
87
|
+
| \`/clavix:plan\` | Create task breakdown from PRD |
|
|
88
|
+
| \`/clavix:implement\` | Execute tasks or prompts (auto-detects source) |
|
|
89
|
+
| \`/clavix:start\` | Begin conversational session |
|
|
90
|
+
| \`/clavix:summarize\` | Extract requirements from conversation |
|
|
91
|
+
| \`/clavix:verify\` | Verify implementation |
|
|
92
|
+
| \`/clavix:archive\` | Archive completed projects |
|
|
93
|
+
|
|
94
|
+
**Note:** Running \`clavix init\` or \`clavix update\` will regenerate all slash commands from templates. Any manual edits to generated commands will be lost. If you need custom commands, create new command files instead of modifying generated ones.
|
|
95
|
+
|
|
96
|
+
**Command format varies by integration:**
|
|
97
|
+
- Claude Code, Gemini, Qwen: \`/clavix:improve\` (colon format)
|
|
98
|
+
- Cursor, Droid, Windsurf, etc.: \`/clavix-improve\` (hyphen format)
|
|
99
|
+
|
|
100
|
+
## Standard Workflow
|
|
101
|
+
|
|
102
|
+
**Clavix follows this progression:**
|
|
103
|
+
|
|
104
|
+
\`\`\`
|
|
105
|
+
PRD Creation → Task Planning → Implementation → Archive
|
|
106
|
+
\`\`\`
|
|
107
|
+
|
|
108
|
+
**Detailed steps:**
|
|
109
|
+
|
|
110
|
+
1. **Planning Phase**
|
|
111
|
+
- Run: \`/clavix:prd\` or \`/clavix:start\` → \`/clavix:summarize\`
|
|
112
|
+
- Output: \`.clavix/outputs/{project}/full-prd.md\` + \`quick-prd.md\`
|
|
113
|
+
|
|
114
|
+
2. **Task Preparation**
|
|
115
|
+
- Run: \`/clavix:plan\` transforms PRD into curated task list
|
|
116
|
+
- Output: \`.clavix/outputs/{project}/tasks.md\`
|
|
117
|
+
|
|
118
|
+
3. **Implementation Phase**
|
|
119
|
+
- Run: \`/clavix:implement\`
|
|
120
|
+
- Agent executes tasks systematically
|
|
121
|
+
- Agent edits tasks.md directly to mark progress (\`- [ ]\` → \`- [x]\`)
|
|
122
|
+
|
|
123
|
+
4. **Completion**
|
|
124
|
+
- Run: \`/clavix:archive\`
|
|
125
|
+
- Archives completed work
|
|
126
|
+
|
|
127
|
+
**Key principle:** Planning workflows create documents. Implementation workflows write code.
|
|
128
|
+
|
|
129
|
+
## Prompt Lifecycle
|
|
130
|
+
|
|
131
|
+
1. **Optimize prompt**: \`/clavix:improve\` - Analyzes and improves your prompt
|
|
132
|
+
2. **Review**: Agent lists saved prompts from \`.clavix/outputs/prompts/\`
|
|
133
|
+
3. **Execute**: \`/clavix:implement --latest\` - Implement when ready
|
|
134
|
+
4. **Cleanup**: Agent deletes old prompt files from \`.clavix/outputs/prompts/\`
|
|
135
|
+
|
|
136
|
+
## When to Use Which Mode
|
|
137
|
+
|
|
138
|
+
- **Improve mode** (\`/clavix:improve\`): Smart prompt optimization with auto-depth selection
|
|
139
|
+
- **PRD mode** (\`/clavix:prd\`): Strategic planning with architecture and business impact
|
|
140
|
+
- **Conversational mode** (\`/clavix:start\` → \`/clavix:summarize\`): Natural discussion → extract structured requirements
|
|
141
|
+
|
|
142
|
+
## Customization
|
|
143
|
+
|
|
144
|
+
Create custom templates in \`.clavix/templates/\` to override defaults.
|
|
145
|
+
|
|
146
|
+
To reconfigure integrations, run \`clavix init\` again.
|
|
147
|
+
|
|
148
|
+
## Need Help?
|
|
149
|
+
|
|
150
|
+
- **Documentation**: https://github.com/ClavixDev/Clavix
|
|
151
|
+
- **Issues**: https://github.com/ClavixDev/Clavix/issues
|
|
152
|
+
- **Version**: Run \`clavix version\` to check your installed version
|
|
153
|
+
- **Update managed blocks**: Run \`clavix update\` to refresh documentation
|
|
154
|
+
`;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Generate the INSTRUCTIONS.md file
|
|
158
|
+
*/
|
|
159
|
+
export async function generateInstructions() {
|
|
160
|
+
await FileSystem.writeFileAtomic('.clavix/INSTRUCTIONS.md', getInstructionsContent());
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Generate the QUICKSTART.md file
|
|
164
|
+
*/
|
|
165
|
+
export async function generateQuickstart() {
|
|
166
|
+
const quickstartPath = path.join(__dirname, '..', '..', '..', 'templates', 'instructions', 'QUICKSTART.md');
|
|
167
|
+
try {
|
|
168
|
+
const quickstartContent = await FileSystem.readFile(quickstartPath);
|
|
169
|
+
await FileSystem.writeFileAtomic('.clavix/QUICKSTART.md', quickstartContent);
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
// QUICKSTART.md template not found or write failed, skip silently
|
|
173
|
+
// This can happen in test environments or custom installations
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=documentation.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Init command modules
|
|
3
|
+
*
|
|
4
|
+
* This directory contains extracted modules from the init command,
|
|
5
|
+
* organized by responsibility:
|
|
6
|
+
*
|
|
7
|
+
* - config.ts: Configuration management
|
|
8
|
+
* - directories.ts: Directory structure creation
|
|
9
|
+
* - documentation.ts: Documentation generation
|
|
10
|
+
* - commands.ts: Slash command generation
|
|
11
|
+
* - integrations.ts: Integration handling
|
|
12
|
+
* - prompts.ts: User prompts
|
|
13
|
+
*/
|
|
14
|
+
export * from './config.js';
|
|
15
|
+
export * from './directories.js';
|
|
16
|
+
export * from './documentation.js';
|
|
17
|
+
export * from './commands.js';
|
|
18
|
+
export * from './integrations.js';
|
|
19
|
+
export * from './prompts.js';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Init command modules
|
|
3
|
+
*
|
|
4
|
+
* This directory contains extracted modules from the init command,
|
|
5
|
+
* organized by responsibility:
|
|
6
|
+
*
|
|
7
|
+
* - config.ts: Configuration management
|
|
8
|
+
* - directories.ts: Directory structure creation
|
|
9
|
+
* - documentation.ts: Documentation generation
|
|
10
|
+
* - commands.ts: Slash command generation
|
|
11
|
+
* - integrations.ts: Integration handling
|
|
12
|
+
* - prompts.ts: User prompts
|
|
13
|
+
*/
|
|
14
|
+
export * from './config.js';
|
|
15
|
+
export * from './directories.js';
|
|
16
|
+
export * from './documentation.js';
|
|
17
|
+
export * from './commands.js';
|
|
18
|
+
export * from './integrations.js';
|
|
19
|
+
export * from './prompts.js';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration handling for Clavix initialization
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentManager } from '../../../core/agent-manager.js';
|
|
5
|
+
/**
|
|
6
|
+
* Doc generator integrations (not regular adapters)
|
|
7
|
+
*/
|
|
8
|
+
export declare const DOC_GENERATOR_INTEGRATIONS: readonly ["agents-md", "octo-md", "warp-md", "copilot-instructions"];
|
|
9
|
+
/**
|
|
10
|
+
* Integrations that use colon separator (CLI tools)
|
|
11
|
+
*/
|
|
12
|
+
export declare const COLON_SEPARATOR_INTEGRATIONS: readonly ["claude-code", "gemini", "qwen", "crush", "llxprt", "augment"];
|
|
13
|
+
/**
|
|
14
|
+
* Check if an integration is a doc generator (not a regular adapter)
|
|
15
|
+
*/
|
|
16
|
+
export declare function isDocGeneratorIntegration(integrationName: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Generate content for a doc generator integration
|
|
19
|
+
*/
|
|
20
|
+
export declare function generateDocGeneratorContent(integrationName: string): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Clean up a doc generator integration
|
|
23
|
+
*/
|
|
24
|
+
export declare function cleanupDocGeneratorIntegration(integrationName: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Check if instructions folder generation is needed
|
|
27
|
+
*/
|
|
28
|
+
export declare function needsInstructionsGeneration(integrations: string[]): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Generate the instructions folder
|
|
31
|
+
*/
|
|
32
|
+
export declare function generateInstructionsFolder(): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Get display names for integrations
|
|
35
|
+
*/
|
|
36
|
+
export declare function getDisplayNames(agentManager: AgentManager, integrations: string[]): string[];
|
|
37
|
+
/**
|
|
38
|
+
* Determine the command separator based on selected integrations
|
|
39
|
+
*/
|
|
40
|
+
export declare function determineCommandSeparator(integrations: string[]): {
|
|
41
|
+
primary: string;
|
|
42
|
+
alternate?: string;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=integrations.d.ts.map
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration handling for Clavix initialization
|
|
3
|
+
*/
|
|
4
|
+
import { DocInjector } from '../../../core/doc-injector.js';
|
|
5
|
+
import { AgentsMdGenerator } from '../../../core/adapters/agents-md-generator.js';
|
|
6
|
+
import { OctoMdGenerator } from '../../../core/adapters/octo-md-generator.js';
|
|
7
|
+
import { WarpMdGenerator } from '../../../core/adapters/warp-md-generator.js';
|
|
8
|
+
import { CopilotInstructionsGenerator } from '../../../core/adapters/copilot-instructions-generator.js';
|
|
9
|
+
import { InstructionsGenerator } from '../../../core/adapters/instructions-generator.js';
|
|
10
|
+
/**
|
|
11
|
+
* Doc generator integrations (not regular adapters)
|
|
12
|
+
*/
|
|
13
|
+
export const DOC_GENERATOR_INTEGRATIONS = [
|
|
14
|
+
'agents-md',
|
|
15
|
+
'octo-md',
|
|
16
|
+
'warp-md',
|
|
17
|
+
'copilot-instructions',
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Integrations that use colon separator (CLI tools)
|
|
21
|
+
*/
|
|
22
|
+
export const COLON_SEPARATOR_INTEGRATIONS = [
|
|
23
|
+
'claude-code',
|
|
24
|
+
'gemini',
|
|
25
|
+
'qwen',
|
|
26
|
+
'crush',
|
|
27
|
+
'llxprt',
|
|
28
|
+
'augment',
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* Check if an integration is a doc generator (not a regular adapter)
|
|
32
|
+
*/
|
|
33
|
+
export function isDocGeneratorIntegration(integrationName) {
|
|
34
|
+
return DOC_GENERATOR_INTEGRATIONS.includes(integrationName);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Generate content for a doc generator integration
|
|
38
|
+
*/
|
|
39
|
+
export async function generateDocGeneratorContent(integrationName) {
|
|
40
|
+
switch (integrationName) {
|
|
41
|
+
case 'agents-md':
|
|
42
|
+
await AgentsMdGenerator.generate();
|
|
43
|
+
break;
|
|
44
|
+
case 'octo-md':
|
|
45
|
+
await OctoMdGenerator.generate();
|
|
46
|
+
break;
|
|
47
|
+
case 'warp-md':
|
|
48
|
+
await WarpMdGenerator.generate();
|
|
49
|
+
break;
|
|
50
|
+
case 'copilot-instructions':
|
|
51
|
+
await CopilotInstructionsGenerator.generate();
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Clean up a doc generator integration
|
|
57
|
+
*/
|
|
58
|
+
export async function cleanupDocGeneratorIntegration(integrationName) {
|
|
59
|
+
switch (integrationName) {
|
|
60
|
+
case 'agents-md':
|
|
61
|
+
await DocInjector.removeBlock('AGENTS.md');
|
|
62
|
+
break;
|
|
63
|
+
case 'octo-md':
|
|
64
|
+
await DocInjector.removeBlock('OCTO.md');
|
|
65
|
+
break;
|
|
66
|
+
case 'warp-md':
|
|
67
|
+
await DocInjector.removeBlock('WARP.md');
|
|
68
|
+
break;
|
|
69
|
+
case 'copilot-instructions':
|
|
70
|
+
await DocInjector.removeBlock('.github/copilot-instructions.md');
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Check if instructions folder generation is needed
|
|
76
|
+
*/
|
|
77
|
+
export function needsInstructionsGeneration(integrations) {
|
|
78
|
+
return InstructionsGenerator.needsGeneration(integrations);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Generate the instructions folder
|
|
82
|
+
*/
|
|
83
|
+
export async function generateInstructionsFolder() {
|
|
84
|
+
await InstructionsGenerator.generate();
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get display names for integrations
|
|
88
|
+
*/
|
|
89
|
+
export function getDisplayNames(agentManager, integrations) {
|
|
90
|
+
return integrations.map((name) => {
|
|
91
|
+
const adapter = agentManager.getAdapter(name);
|
|
92
|
+
return adapter?.displayName || name;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Determine the command separator based on selected integrations
|
|
97
|
+
*/
|
|
98
|
+
export function determineCommandSeparator(integrations) {
|
|
99
|
+
const usesColon = integrations.some((i) => COLON_SEPARATOR_INTEGRATIONS.includes(i));
|
|
100
|
+
const usesHyphen = integrations.some((i) => !COLON_SEPARATOR_INTEGRATIONS.includes(i));
|
|
101
|
+
if (usesColon && !usesHyphen) {
|
|
102
|
+
return { primary: ':' };
|
|
103
|
+
}
|
|
104
|
+
if (usesHyphen && !usesColon) {
|
|
105
|
+
return { primary: '-' };
|
|
106
|
+
}
|
|
107
|
+
return { primary: ':', alternate: '-' };
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=integrations.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inquirer prompts for Clavix initialization
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentAdapter } from '../../../types/agent.js';
|
|
5
|
+
export type InitAction = 'reconfigure' | 'update' | 'cancel';
|
|
6
|
+
export type CleanupAction = 'cleanup' | 'update' | 'skip';
|
|
7
|
+
/**
|
|
8
|
+
* Prompt for action when Clavix is already initialized
|
|
9
|
+
*/
|
|
10
|
+
export declare function promptExistingConfigAction(): Promise<InitAction>;
|
|
11
|
+
/**
|
|
12
|
+
* Prompt for what to do with deselected integrations
|
|
13
|
+
*/
|
|
14
|
+
export declare function promptDeselectedAction(): Promise<CleanupAction>;
|
|
15
|
+
/**
|
|
16
|
+
* Prompt for Codex CLI confirmation
|
|
17
|
+
*/
|
|
18
|
+
export declare function promptCodexConfirmation(codexPath: string): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Prompt for namespace usage (Gemini/Qwen)
|
|
21
|
+
*/
|
|
22
|
+
export declare function promptNamespaceUsage(adapterDisplayName: string, defaultPath: string): Promise<boolean>;
|
|
23
|
+
/**
|
|
24
|
+
* Prompt for continuing despite validation errors
|
|
25
|
+
*/
|
|
26
|
+
export declare function promptContinueAnyway(): Promise<boolean>;
|
|
27
|
+
/**
|
|
28
|
+
* Prompt for removing legacy command files
|
|
29
|
+
*/
|
|
30
|
+
export declare function promptRemoveLegacy(adapter: AgentAdapter): Promise<boolean>;
|
|
31
|
+
//# sourceMappingURL=prompts.d.ts.map
|