clavix 2.2.0 → 2.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 CHANGED
@@ -19,8 +19,8 @@ Clavix is built on CLEAR (Concise, Logical, Explicit, Adaptive, Reflective), an
19
19
  | Category | Providers |
20
20
  | --- | --- |
21
21
  | IDE & editor extensions | Cursor · Windsurf · Kilocode · Roocode · Cline |
22
- | CLI agents | Claude Code · Droid CLI · CodeBuddy CLI · OpenCode · Gemini CLI · Qwen Code · Amp · Crush CLI · Codex CLI |
23
- | Universal adapters | AGENTS.md · OCTO.md · WARP.md |
22
+ | CLI agents | Claude Code · Droid CLI · CodeBuddy CLI · OpenCode · Gemini CLI · Qwen Code · Amp · Crush CLI · Codex CLI · Augment CLI |
23
+ | Universal adapters | AGENTS.md · GitHub Copilot · OCTO.md · WARP.md |
24
24
 
25
25
  Provider paths and argument placeholders are listed in [docs/providers.md](docs/providers.md).
26
26
 
@@ -46,6 +46,7 @@ const doc_injector_1 = require("../../core/doc-injector");
46
46
  const agents_md_generator_1 = require("../../core/adapters/agents-md-generator");
47
47
  const octo_md_generator_1 = require("../../core/adapters/octo-md-generator");
48
48
  const warp_md_generator_1 = require("../../core/adapters/warp-md-generator");
49
+ const copilot_instructions_generator_1 = require("../../core/adapters/copilot-instructions-generator");
49
50
  const file_system_1 = require("../../utils/file-system");
50
51
  const config_1 = require("../../types/config");
51
52
  const gemini_adapter_1 = require("../../core/adapters/gemini-adapter");
@@ -98,10 +99,6 @@ class Init extends core_1.Command {
98
99
  name: 'CodeBuddy (.codebuddy/commands/)',
99
100
  value: 'codebuddy',
100
101
  },
101
- {
102
- name: 'Copilot CLI (.github/agents/)',
103
- value: 'copilot',
104
- },
105
102
  {
106
103
  name: 'Crush CLI (.crush/commands/clavix/)',
107
104
  value: 'crush',
@@ -154,6 +151,10 @@ class Init extends core_1.Command {
154
151
  name: 'agents.md (Universal - for tools without slash commands)',
155
152
  value: 'agents-md',
156
153
  },
154
+ {
155
+ name: 'GitHub Copilot (.github/copilot-instructions.md)',
156
+ value: 'copilot-instructions',
157
+ },
157
158
  {
158
159
  name: 'Warp (WARP.md - optimized for Warp)',
159
160
  value: 'warp-md',
@@ -193,6 +194,12 @@ class Init extends core_1.Command {
193
194
  await agents_md_generator_1.AgentsMdGenerator.generate();
194
195
  continue;
195
196
  }
197
+ // Handle copilot-instructions separately (it's not an adapter)
198
+ if (providerName === 'copilot-instructions') {
199
+ console.log(chalk_1.default.gray(' ✓ Generating .github/copilot-instructions.md...'));
200
+ await copilot_instructions_generator_1.CopilotInstructionsGenerator.generate();
201
+ continue;
202
+ }
196
203
  // Handle octo-md separately (it's not an adapter)
197
204
  if (providerName === 'octo-md') {
198
205
  console.log(chalk_1.default.gray(' ✓ Generating OCTO.md...'));
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Generator for GitHub Copilot instructions file
3
+ * Provides workflow instructions via .github/copilot-instructions.md
4
+ */
5
+ export declare class CopilotInstructionsGenerator {
6
+ static readonly TARGET_FILE = ".github/copilot-instructions.md";
7
+ static readonly START_MARKER = "<!-- CLAVIX:START -->";
8
+ static readonly END_MARKER = "<!-- CLAVIX:END -->";
9
+ /**
10
+ * Generate or update .github/copilot-instructions.md with Clavix workflows
11
+ */
12
+ static generate(): Promise<void>;
13
+ /**
14
+ * Inject or update managed block in .github/copilot-instructions.md
15
+ */
16
+ private static injectManagedBlock;
17
+ /**
18
+ * Escape special regex characters
19
+ */
20
+ private static escapeRegex;
21
+ /**
22
+ * Check if .github/copilot-instructions.md has Clavix block
23
+ */
24
+ static hasClavixBlock(): Promise<boolean>;
25
+ }
26
+ //# sourceMappingURL=copilot-instructions-generator.d.ts.map
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.CopilotInstructionsGenerator = void 0;
37
+ const file_system_1 = require("../../utils/file-system");
38
+ const path = __importStar(require("path"));
39
+ /**
40
+ * Generator for GitHub Copilot instructions file
41
+ * Provides workflow instructions via .github/copilot-instructions.md
42
+ */
43
+ class CopilotInstructionsGenerator {
44
+ /**
45
+ * Generate or update .github/copilot-instructions.md with Clavix workflows
46
+ */
47
+ static async generate() {
48
+ const templatePath = path.join(__dirname, '../../templates/agents/copilot-instructions.md');
49
+ // Check if template exists
50
+ if (!(await file_system_1.FileSystem.exists(templatePath))) {
51
+ throw new Error(`Copilot instructions template not found at ${templatePath}`);
52
+ }
53
+ const template = await file_system_1.FileSystem.readFile(templatePath);
54
+ // Ensure .github directory exists
55
+ await file_system_1.FileSystem.ensureDir('.github');
56
+ // Inject into .github/copilot-instructions.md using managed blocks
57
+ await this.injectManagedBlock(this.TARGET_FILE, template);
58
+ }
59
+ /**
60
+ * Inject or update managed block in .github/copilot-instructions.md
61
+ */
62
+ static async injectManagedBlock(filePath, content) {
63
+ let fileContent = '';
64
+ // Read existing file or start with empty content
65
+ if (await file_system_1.FileSystem.exists(filePath)) {
66
+ fileContent = await file_system_1.FileSystem.readFile(filePath);
67
+ }
68
+ const blockRegex = new RegExp(`${this.escapeRegex(this.START_MARKER)}[\\s\\S]*?${this.escapeRegex(this.END_MARKER)}`, 'g');
69
+ const wrappedContent = `${this.START_MARKER}\n${content}\n${this.END_MARKER}`;
70
+ if (blockRegex.test(fileContent)) {
71
+ // Replace existing block
72
+ fileContent = fileContent.replace(blockRegex, wrappedContent);
73
+ }
74
+ else {
75
+ // Append new block
76
+ if (fileContent && !fileContent.endsWith('\n\n')) {
77
+ fileContent += '\n\n';
78
+ }
79
+ fileContent += wrappedContent + '\n';
80
+ }
81
+ await file_system_1.FileSystem.writeFileAtomic(filePath, fileContent);
82
+ }
83
+ /**
84
+ * Escape special regex characters
85
+ */
86
+ static escapeRegex(str) {
87
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
88
+ }
89
+ /**
90
+ * Check if .github/copilot-instructions.md has Clavix block
91
+ */
92
+ static async hasClavixBlock() {
93
+ if (!(await file_system_1.FileSystem.exists(this.TARGET_FILE))) {
94
+ return false;
95
+ }
96
+ const content = await file_system_1.FileSystem.readFile(this.TARGET_FILE);
97
+ return content.includes(this.START_MARKER);
98
+ }
99
+ }
100
+ exports.CopilotInstructionsGenerator = CopilotInstructionsGenerator;
101
+ CopilotInstructionsGenerator.TARGET_FILE = '.github/copilot-instructions.md';
102
+ CopilotInstructionsGenerator.START_MARKER = '<!-- CLAVIX:START -->';
103
+ CopilotInstructionsGenerator.END_MARKER = '<!-- CLAVIX:END -->';
104
+ //# sourceMappingURL=copilot-instructions-generator.js.map
@@ -17,7 +17,6 @@ const gemini_adapter_1 = require("./adapters/gemini-adapter");
17
17
  const qwen_adapter_1 = require("./adapters/qwen-adapter");
18
18
  const codex_adapter_1 = require("./adapters/codex-adapter");
19
19
  const augment_adapter_1 = require("./adapters/augment-adapter");
20
- const copilot_adapter_1 = require("./adapters/copilot-adapter");
21
20
  /**
22
21
  * Agent Manager - handles agent detection and registration
23
22
  */
@@ -40,7 +39,6 @@ class AgentManager {
40
39
  this.registerAdapter(new gemini_adapter_1.GeminiAdapter());
41
40
  this.registerAdapter(new qwen_adapter_1.QwenAdapter());
42
41
  this.registerAdapter(new codex_adapter_1.CodexAdapter());
43
- this.registerAdapter(new copilot_adapter_1.CopilotAdapter());
44
42
  }
45
43
  /**
46
44
  * Register a new agent adapter
@@ -0,0 +1,90 @@
1
+ # Clavix Workflows for GitHub Copilot
2
+
3
+ These instructions enhance GitHub Copilot's understanding of the Clavix prompt engineering framework and workflow commands available in this project.
4
+
5
+ ## About Clavix
6
+
7
+ Clavix is a CLEAR Framework-validated prompt engineering toolkit that helps improve prompts, generate PRDs, and manage implementation workflows. The CLEAR Framework (Concise, Logical, Explicit, Adaptive, Reflective) is an academically-validated approach developed by Dr. Leo Lo at the University of New Mexico.
8
+
9
+ ## Available Commands
10
+
11
+ When working with this project, you can use the following Clavix commands:
12
+
13
+ ### Prompt Improvement
14
+ - `clavix fast "<prompt>"` - Quick CLEAR analysis (C/L/E components) with improved prompt output
15
+ - `clavix deep "<prompt>"` - Comprehensive CLEAR analysis (all 5 components: C/L/E/A/R) with alternatives and validation
16
+
17
+ ### Strategic Planning
18
+ - `clavix prd` - Interactive PRD generation through Socratic questioning
19
+ - `clavix plan` - Transform PRDs into phase-based implementation tasks
20
+ - `clavix implement` - Execute tasks with progress tracking
21
+
22
+ ### Conversational Workflows
23
+ - `clavix start` - Begin conversational session for requirements gathering
24
+ - `clavix summarize [session-id]` - Extract mini-PRD and optimized prompts from sessions
25
+
26
+ ### Project Management
27
+ - `clavix list` - List sessions and output projects
28
+ - `clavix show [session-id]` - Inspect session or project details
29
+ - `clavix archive [project]` - Archive or restore completed projects
30
+ - `clavix update` - Refresh Clavix documentation and commands
31
+
32
+ ## Workflow Patterns
33
+
34
+ ### Quick Prompt Improvement
35
+ 1. User provides a rough prompt
36
+ 2. Run `clavix fast "<prompt>"` for quick CLEAR-validated improvements
37
+ 3. Use the optimized prompt for better results
38
+
39
+ ### Comprehensive Prompt Analysis
40
+ 1. User has a complex requirement
41
+ 2. Run `clavix deep "<prompt>"` for full CLEAR analysis
42
+ 3. Review alternative variations and validation checklists
43
+ 4. Select the best approach
44
+
45
+ ### Strategic Project Planning
46
+ 1. Run `clavix prd` to generate a comprehensive PRD through guided questions
47
+ 2. Run `clavix plan` to break down the PRD into implementation tasks
48
+ 3. Run `clavix implement` to execute tasks systematically
49
+ 4. Archive completed work with `clavix archive`
50
+
51
+ ### Conversational Requirements Gathering
52
+ 1. Run `clavix start` to begin capturing a conversation
53
+ 2. Discuss requirements naturally with the user
54
+ 3. Run `clavix summarize` to extract structured requirements and prompts
55
+
56
+ ## CLEAR Framework Components
57
+
58
+ When analyzing or improving prompts, apply these CLEAR Framework principles:
59
+
60
+ - **[C] Concise**: Remove verbosity, pleasantries, unnecessary qualifiers
61
+ - **[L] Logical**: Ensure coherent sequencing (context → requirements → constraints → output)
62
+ - **[E] Explicit**: Add clear specifications for persona, format, tone, success criteria
63
+ - **[A] Adaptive**: Provide alternative phrasings and flexible structures
64
+ - **[R] Reflective**: Include validation checklists and quality criteria
65
+
66
+ ## Output Locations
67
+
68
+ Clavix stores artifacts in the `.clavix/` directory:
69
+ - `.clavix/outputs/<project>/` - PRDs, tasks, and optimized prompts
70
+ - `.clavix/sessions/` - Captured conversational sessions
71
+ - `.clavix/templates/` - Custom template overrides
72
+ - `.clavix/config.json` - Project configuration
73
+
74
+ ## Best Practices
75
+
76
+ 1. **Start with the right mode**: Use fast mode for simple prompts, deep mode for complex requirements, and PRD mode for strategic planning
77
+ 2. **Leverage CLEAR Framework**: Always consider the 5 CLEAR components when crafting prompts
78
+ 3. **Document requirements**: Use PRD workflow for significant features to ensure clear requirements
79
+ 4. **Track progress**: Use implement command to maintain structured task execution
80
+ 5. **Archive completed work**: Keep project organized by archiving finished projects
81
+
82
+ ## Integration with GitHub Copilot
83
+
84
+ When users ask for help with prompts or requirements:
85
+ 1. Suggest running the appropriate Clavix command
86
+ 2. Explain the expected output and benefits
87
+ 3. Help interpret Clavix-generated outputs
88
+ 4. Apply CLEAR Framework principles in your responses
89
+
90
+ This integration makes GitHub Copilot aware of Clavix workflows and can suggest using Clavix commands when appropriate.
@@ -37,5 +37,5 @@ export interface ManagedBlock {
37
37
  content: string;
38
38
  targetFile: string;
39
39
  }
40
- export type AgentType = 'agents-md' | 'amp' | 'augment' | 'claude-code' | 'cline' | 'codex' | 'codebuddy' | 'copilot' | 'crush' | 'cursor' | 'custom' | 'droid' | 'gemini' | 'kilocode' | 'octo-md' | 'opencode' | 'qwen' | 'roocode' | 'windsurf';
40
+ export type AgentType = 'agents-md' | 'amp' | 'augment' | 'claude-code' | 'cline' | 'codex' | 'codebuddy' | 'copilot-instructions' | 'crush' | 'cursor' | 'custom' | 'droid' | 'gemini' | 'kilocode' | 'octo-md' | 'opencode' | 'qwen' | 'roocode' | 'windsurf';
41
41
  //# sourceMappingURL=agent.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavix",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Transform vague ideas into production-ready prompts. CLI tool using the CLEAR framework to analyze, improve, and generate PRDs for AI coding assistants (Claude Code, Cursor, Windsurf, and more)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,24 +0,0 @@
1
- import { BaseAdapter } from './base-adapter';
2
- import { CommandTemplate } from '../../types/agent';
3
- /**
4
- * GitHub Copilot CLI adapter (custom agents)
5
- * Generates agent profiles under .github/agents
6
- */
7
- export declare class CopilotAdapter extends BaseAdapter {
8
- readonly name = "copilot";
9
- readonly displayName = "Copilot CLI";
10
- readonly directory = ".github/agents";
11
- readonly fileExtension = ".agent.md";
12
- readonly features: {
13
- supportsSubdirectories: boolean;
14
- supportsFrontmatter: boolean;
15
- frontmatterFields: string[];
16
- };
17
- detectProject(): Promise<boolean>;
18
- getCommandPath(): string;
19
- getTargetFilename(name: string): string;
20
- protected formatCommand(template: CommandTemplate): string;
21
- private toTitle;
22
- private getHomeDir;
23
- }
24
- //# sourceMappingURL=copilot-adapter.d.ts.map
@@ -1,88 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.CopilotAdapter = void 0;
37
- const os = __importStar(require("os"));
38
- const path = __importStar(require("path"));
39
- const base_adapter_1 = require("./base-adapter");
40
- const file_system_1 = require("../../utils/file-system");
41
- /**
42
- * GitHub Copilot CLI adapter (custom agents)
43
- * Generates agent profiles under .github/agents
44
- */
45
- class CopilotAdapter extends base_adapter_1.BaseAdapter {
46
- constructor() {
47
- super(...arguments);
48
- this.name = 'copilot';
49
- this.displayName = 'Copilot CLI';
50
- this.directory = '.github/agents';
51
- this.fileExtension = '.agent.md';
52
- this.features = {
53
- supportsSubdirectories: false,
54
- supportsFrontmatter: true,
55
- frontmatterFields: ['name', 'description', 'tools', 'target'],
56
- };
57
- }
58
- async detectProject() {
59
- if (await file_system_1.FileSystem.exists('.github/agents')) {
60
- return true;
61
- }
62
- const homeAgentsDir = path.join(this.getHomeDir(), '.copilot', 'agents');
63
- return file_system_1.FileSystem.exists(homeAgentsDir);
64
- }
65
- getCommandPath() {
66
- return this.directory;
67
- }
68
- getTargetFilename(name) {
69
- return `clavix-${name}${this.fileExtension}`;
70
- }
71
- formatCommand(template) {
72
- const displayName = `Clavix: ${this.toTitle(template.name)}`;
73
- const frontmatter = `---\nname: ${displayName}\ndescription: ${template.description}\n---\n\n`;
74
- return frontmatter + template.content;
75
- }
76
- toTitle(value) {
77
- return value
78
- .split(/[-_\s]+/)
79
- .filter(Boolean)
80
- .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
81
- .join(' ');
82
- }
83
- getHomeDir() {
84
- return process.env.CLAVIX_HOME_OVERRIDE || os.homedir();
85
- }
86
- }
87
- exports.CopilotAdapter = CopilotAdapter;
88
- //# sourceMappingURL=copilot-adapter.js.map