clavix 3.5.0 → 3.6.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.
Files changed (43) hide show
  1. package/README.md +4 -4
  2. package/dist/cli/commands/init.js +7 -0
  3. package/dist/cli/commands/update.js +8 -0
  4. package/dist/core/adapters/instructions-generator.d.ts +42 -0
  5. package/dist/core/adapters/instructions-generator.js +123 -0
  6. package/dist/templates/agents/agents.md +162 -67
  7. package/dist/templates/agents/copilot-instructions.md +131 -87
  8. package/dist/templates/agents/octo.md +146 -289
  9. package/dist/templates/agents/warp.md +29 -0
  10. package/dist/templates/instructions/README.md +311 -0
  11. package/dist/templates/instructions/core/clavix-mode.md +275 -0
  12. package/dist/templates/instructions/core/file-operations.md +330 -0
  13. package/dist/templates/instructions/core/verification.md +377 -0
  14. package/dist/templates/instructions/troubleshooting/jumped-to-implementation.md +234 -0
  15. package/dist/templates/instructions/troubleshooting/mode-confusion.md +402 -0
  16. package/dist/templates/instructions/troubleshooting/skipped-file-creation.md +385 -0
  17. package/dist/templates/instructions 2/README.md +311 -0
  18. package/dist/templates/instructions 2/core/clavix-mode.md +275 -0
  19. package/dist/templates/instructions 2/core/file-operations.md +330 -0
  20. package/dist/templates/instructions 2/core/verification.md +377 -0
  21. package/dist/templates/instructions 2/troubleshooting/jumped-to-implementation.md +234 -0
  22. package/dist/templates/instructions 2/troubleshooting/mode-confusion.md +402 -0
  23. package/dist/templates/instructions 2/troubleshooting/skipped-file-creation.md +385 -0
  24. package/dist/templates/slash-commands/_canonical/deep.md +23 -0
  25. package/dist/templates/slash-commands/_canonical/fast.md +23 -0
  26. package/dist/templates/slash-commands/_canonical/prd.md +23 -0
  27. package/dist/templates/slash-commands/_canonical/start.md +64 -3
  28. package/dist/templates/slash-commands/_canonical/summarize.md +223 -24
  29. package/dist/templates/slash-commands 2/_canonical/archive.md +410 -0
  30. package/dist/templates/slash-commands 2/_canonical/deep.md +512 -0
  31. package/dist/templates/slash-commands 2/_canonical/execute.md +80 -0
  32. package/dist/templates/slash-commands 2/_canonical/fast.md +370 -0
  33. package/dist/templates/slash-commands 2/_canonical/implement.md +364 -0
  34. package/dist/templates/slash-commands 2/_canonical/plan.md +329 -0
  35. package/dist/templates/slash-commands 2/_canonical/prd.md +320 -0
  36. package/dist/templates/slash-commands 2/_canonical/prompts.md +97 -0
  37. package/dist/templates/slash-commands 2/_canonical/start.md +204 -0
  38. package/dist/templates/slash-commands 2/_canonical/summarize.md +395 -0
  39. package/dist/utils/file-system.d.ts +8 -0
  40. package/dist/utils/file-system.js +7 -0
  41. package/package.json +1 -1
  42. package/dist/utils/provider-selector.d.ts +0 -8
  43. package/dist/utils/provider-selector.js +0 -60
package/README.md CHANGED
@@ -12,10 +12,10 @@
12
12
 
13
13
  | Version | Highlights | Details |
14
14
  | --- | --- | --- |
15
- | **v3.4.0** (Latest) | Provider categorization fixes | [Changelog](CHANGELOG.md#340---2025-11-24) |
16
- | **v3.3.1** | JSON5/JSON config bug fix | [Changelog](CHANGELOG.md#331---2025-11-23) |
17
- | **v3.3.0** | Provider management & interactive config | [Changelog](CHANGELOG.md#330---2025-11-23) |
18
- | **v3.1.0** | Clavix Intelligence™ brand evolution | [Changelog](CHANGELOG.md#310---2025-11-23) |
15
+ | **v3.6.1** (Latest) | Documentation hierarchy & verbosity reduction | [Changelog](CHANGELOG.md#361---2025-11-24) |
16
+ | **v3.6.0** | Enhanced generic connector instructions | [Changelog](CHANGELOG.md#360---2025-11-24) |
17
+ | **v3.5.0** | "Providers" "Integrations" terminology | [Changelog](CHANGELOG.md#350---2025-01-24) |
18
+ | **v3.4.0** | Provider categorization fixes | [Changelog](CHANGELOG.md#340---2025-11-24) |
19
19
 
20
20
  **Requirements:** Node.js ≥ 16.0.0 (ESM support required)
21
21
 
@@ -8,6 +8,7 @@ import { AgentsMdGenerator } from '../../core/adapters/agents-md-generator.js';
8
8
  import { OctoMdGenerator } from '../../core/adapters/octo-md-generator.js';
9
9
  import { WarpMdGenerator } from '../../core/adapters/warp-md-generator.js';
10
10
  import { CopilotInstructionsGenerator } from '../../core/adapters/copilot-instructions-generator.js';
11
+ import { InstructionsGenerator } from '../../core/adapters/instructions-generator.js';
11
12
  import { FileSystem } from '../../utils/file-system.js';
12
13
  import { DEFAULT_CONFIG } from '../../types/config.js';
13
14
  import { GeminiAdapter } from '../../core/adapters/gemini-adapter.js';
@@ -216,6 +217,12 @@ export default class Init extends Command {
216
217
  await this.injectDocumentation(adapter);
217
218
  }
218
219
  }
220
+ // Generate .clavix/instructions/ folder for generic integrations
221
+ if (InstructionsGenerator.needsGeneration(selectedIntegrations)) {
222
+ console.log(chalk.gray('\n📁 Generating .clavix/instructions/ reference folder...'));
223
+ await InstructionsGenerator.generate();
224
+ console.log(chalk.gray(' ✓ Created detailed workflow guides for generic integrations'));
225
+ }
219
226
  // Success message
220
227
  console.log(chalk.bold.green('\n✅ Clavix initialized successfully!\n'));
221
228
  console.log(chalk.gray('Next steps:'));
@@ -10,6 +10,7 @@ import { AgentManager } from '../../core/agent-manager.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 { InstructionsGenerator } from '../../core/adapters/instructions-generator.js';
13
14
  import { collectLegacyCommandFiles } from '../../utils/legacy-command-cleanup.js';
14
15
  const __filename = fileURLToPath(import.meta.url);
15
16
  const __dirname = dirname(__filename);
@@ -91,6 +92,13 @@ export default class Update extends Command {
91
92
  updatedCount += await this.updateCommands(adapter, flags.force);
92
93
  }
93
94
  }
95
+ // Update .clavix/instructions/ folder for generic integrations
96
+ if (updateDocs && InstructionsGenerator.needsGeneration(integrations)) {
97
+ this.log(chalk.gray('\n📁 Updating .clavix/instructions/ reference folder...'));
98
+ await InstructionsGenerator.generate();
99
+ this.log(chalk.gray(' ✓ Updated detailed workflow guides'));
100
+ updatedCount++;
101
+ }
94
102
  this.log('');
95
103
  if (updatedCount > 0) {
96
104
  this.log(chalk.green(`✅ Successfully updated ${updatedCount} file(s)`));
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Generator for .clavix/instructions/ reference folder
3
+ * Provides detailed workflow guides for generic integrations
4
+ */
5
+ export declare class InstructionsGenerator {
6
+ static readonly TARGET_DIR = ".clavix/instructions";
7
+ /**
8
+ * Generic integrations that need the instructions folder
9
+ */
10
+ static readonly GENERIC_INTEGRATIONS: string[];
11
+ /**
12
+ * Generate .clavix/instructions/ folder with all reference files
13
+ */
14
+ static generate(): Promise<void>;
15
+ /**
16
+ * Copy static instruction files (core/, troubleshooting/, README.md)
17
+ * Excludes workflows/ directory - that comes from canonical templates
18
+ */
19
+ private static copyStaticInstructions;
20
+ /**
21
+ * Copy ALL canonical templates to .clavix/instructions/workflows/
22
+ * This ensures generic integrations have access to complete workflow set
23
+ */
24
+ private static copyCanonicalWorkflows;
25
+ /**
26
+ * Recursively copy directory contents
27
+ */
28
+ private static copyDirectory;
29
+ /**
30
+ * Check if instructions folder exists
31
+ */
32
+ static exists(): Promise<boolean>;
33
+ /**
34
+ * Check if any generic integration is selected
35
+ */
36
+ static needsGeneration(selectedIntegrations: string[]): boolean;
37
+ /**
38
+ * Remove instructions folder
39
+ */
40
+ static remove(): Promise<void>;
41
+ }
42
+ //# sourceMappingURL=instructions-generator.d.ts.map
@@ -0,0 +1,123 @@
1
+ import { FileSystem } from '../../utils/file-system.js';
2
+ import * as path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { dirname } from 'path';
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+ /**
8
+ * Generator for .clavix/instructions/ reference folder
9
+ * Provides detailed workflow guides for generic integrations
10
+ */
11
+ export class InstructionsGenerator {
12
+ static TARGET_DIR = '.clavix/instructions';
13
+ /**
14
+ * Generic integrations that need the instructions folder
15
+ */
16
+ static GENERIC_INTEGRATIONS = [
17
+ 'octo-md',
18
+ 'warp-md',
19
+ 'agents-md',
20
+ 'copilot-instructions'
21
+ ];
22
+ /**
23
+ * Generate .clavix/instructions/ folder with all reference files
24
+ */
25
+ static async generate() {
26
+ const staticInstructionsPath = path.join(__dirname, '../../templates/instructions');
27
+ // Check if static template exists
28
+ if (!(await FileSystem.exists(staticInstructionsPath))) {
29
+ throw new Error(`.clavix/instructions static files not found at ${staticInstructionsPath}`);
30
+ }
31
+ // Create target directory
32
+ await FileSystem.ensureDir(this.TARGET_DIR);
33
+ // Step 1: Copy static instruction files (core/, troubleshooting/, README.md)
34
+ // Note: This skips workflows/ directory if it exists
35
+ await this.copyStaticInstructions(staticInstructionsPath, this.TARGET_DIR);
36
+ // Step 2: Copy ALL canonical workflows → .clavix/instructions/workflows/
37
+ await this.copyCanonicalWorkflows();
38
+ }
39
+ /**
40
+ * Copy static instruction files (core/, troubleshooting/, README.md)
41
+ * Excludes workflows/ directory - that comes from canonical templates
42
+ */
43
+ static async copyStaticInstructions(src, dest) {
44
+ const entries = await FileSystem.readdir(src, { withFileTypes: true });
45
+ for (const entry of entries) {
46
+ // Skip workflows/ directory - it will be populated from canonical
47
+ if (entry.isDirectory() && entry.name === 'workflows') {
48
+ continue;
49
+ }
50
+ const srcPath = path.join(src, entry.name);
51
+ const destPath = path.join(dest, entry.name);
52
+ if (entry.isDirectory()) {
53
+ await FileSystem.ensureDir(destPath);
54
+ await this.copyDirectory(srcPath, destPath);
55
+ }
56
+ else {
57
+ const content = await FileSystem.readFile(srcPath);
58
+ await FileSystem.writeFileAtomic(destPath, content);
59
+ }
60
+ }
61
+ }
62
+ /**
63
+ * Copy ALL canonical templates to .clavix/instructions/workflows/
64
+ * This ensures generic integrations have access to complete workflow set
65
+ */
66
+ static async copyCanonicalWorkflows() {
67
+ const canonicalPath = path.join(__dirname, '../../templates/slash-commands/_canonical');
68
+ const workflowsTarget = path.join(this.TARGET_DIR, 'workflows');
69
+ if (!(await FileSystem.exists(canonicalPath))) {
70
+ throw new Error(`Canonical templates not found at ${canonicalPath}`);
71
+ }
72
+ // Create workflows directory
73
+ await FileSystem.ensureDir(workflowsTarget);
74
+ // Copy all .md files from canonical
75
+ const entries = await FileSystem.readdir(canonicalPath, { withFileTypes: true });
76
+ const mdFiles = entries.filter(f => f.isFile() && f.name.endsWith('.md'));
77
+ for (const file of mdFiles) {
78
+ const srcPath = path.join(canonicalPath, file.name);
79
+ const destPath = path.join(workflowsTarget, file.name);
80
+ const content = await FileSystem.readFile(srcPath);
81
+ await FileSystem.writeFileAtomic(destPath, content);
82
+ }
83
+ }
84
+ /**
85
+ * Recursively copy directory contents
86
+ */
87
+ static async copyDirectory(src, dest) {
88
+ const entries = await FileSystem.readdir(src, { withFileTypes: true });
89
+ for (const entry of entries) {
90
+ const srcPath = path.join(src, entry.name);
91
+ const destPath = path.join(dest, entry.name);
92
+ if (entry.isDirectory()) {
93
+ await FileSystem.ensureDir(destPath);
94
+ await this.copyDirectory(srcPath, destPath);
95
+ }
96
+ else {
97
+ const content = await FileSystem.readFile(srcPath);
98
+ await FileSystem.writeFileAtomic(destPath, content);
99
+ }
100
+ }
101
+ }
102
+ /**
103
+ * Check if instructions folder exists
104
+ */
105
+ static async exists() {
106
+ return await FileSystem.exists(this.TARGET_DIR);
107
+ }
108
+ /**
109
+ * Check if any generic integration is selected
110
+ */
111
+ static needsGeneration(selectedIntegrations) {
112
+ return selectedIntegrations.some(integration => this.GENERIC_INTEGRATIONS.includes(integration));
113
+ }
114
+ /**
115
+ * Remove instructions folder
116
+ */
117
+ static async remove() {
118
+ if (await this.exists()) {
119
+ await FileSystem.remove(this.TARGET_DIR);
120
+ }
121
+ }
122
+ }
123
+ //# sourceMappingURL=instructions-generator.js.map
@@ -1,72 +1,167 @@
1
- # Clavix Workflows
1
+ # Clavix Instructions for Generic Agents
2
2
 
3
- Use these instructions when your agent can only read documentation (no slash-command support).
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
4
 
5
- ## Quick start
6
- - Install globally: `npm install -g clavix`
7
- - Or run ad hoc: `npx clavix@latest init`
8
- - Verify installation: `clavix version`
5
+ ---
9
6
 
10
- ## Command reference
7
+ ## CLAVIX PLANNING MODE
8
+
9
+ **You are in Clavix prompt/PRD development mode. You help create planning documents, NOT implement features.**
10
+
11
+ **PLANNING workflows** (requirements & documentation):
12
+ - Conversational mode, requirement extraction, fast/deep optimization, PRD generation
13
+ - Your role: Ask questions, create PRDs/prompts, extract requirements
14
+ - DO NOT implement features during these workflows
15
+
16
+ **IMPLEMENTATION workflows** (code execution):
17
+ - Only when user explicitly says: "Now implement this" or "Build the feature"
18
+ - Your role: Write code, execute tasks, implement features
19
+
20
+ **If unsure, ASK:** "Should I implement this now, or continue with planning?"
21
+
22
+ See `.clavix/instructions/core/clavix-mode.md` for complete mode documentation.
23
+
24
+ ---
25
+
26
+ ## 📁 Detailed Workflow Instructions
27
+
28
+ For complete step-by-step workflows, see `.clavix/instructions/`:
29
+
30
+ | Workflow | Instruction File | Purpose |
31
+ |----------|-----------------|---------|
32
+ | **Conversational Mode** | `workflows/start.md` | Natural requirements gathering through discussion |
33
+ | **Extract Requirements** | `workflows/summarize.md` | Analyze conversation → mini-PRD + optimized prompts |
34
+ | **Quick Optimization** | `workflows/fast.md` | Intent detection + quality assessment + smart triage |
35
+ | **Deep Analysis** | `workflows/deep.md` | Comprehensive with alternatives, validation, edge cases |
36
+ | **PRD Generation** | `workflows/prd.md` | Socratic questions → full PRD + quick PRD |
37
+ | **Mode Boundaries** | `core/clavix-mode.md` | Planning vs implementation distinction |
38
+ | **File Operations** | `core/file-operations.md` | File creation patterns |
39
+
40
+ **Troubleshooting:**
41
+ - `troubleshooting/jumped-to-implementation.md` - If you started coding during planning
42
+ - `troubleshooting/skipped-file-creation.md` - If files weren't created
43
+ - `troubleshooting/mode-confusion.md` - When unclear about planning vs implementation
44
+
45
+ ---
46
+
47
+ ## 🔍 Workflow Detection Keywords
48
+
49
+ | Keywords in User Request | Recommended Workflow | File Reference |
50
+ |---------------------------|---------------------|----------------|
51
+ | "improve this prompt", "make it better", "optimize" | Fast mode → Quick optimization | `workflows/fast.md` |
52
+ | "analyze thoroughly", "edge cases", "alternatives" | Deep mode → Comprehensive analysis | `workflows/deep.md` |
53
+ | "create a PRD", "product requirements" | PRD mode → Socratic questioning | `workflows/prd.md` |
54
+ | "let's discuss", "not sure what I want" | Conversational mode → Start gathering | `workflows/start.md` |
55
+ | "summarize our conversation" | Extract mode → Analyze thread | `workflows/summarize.md` |
56
+
57
+ ---
58
+
59
+ ## 📋 CLI Quick Reference
11
60
 
12
61
  | Command | Purpose |
13
- | --- | --- |
14
- | `clavix init` | Interactive setup. Select integrations and generate documentation/command files. |
15
- | `clavix fast "<prompt>"` | Quick prompt optimization with quality assessment (Clarity, Efficiency, Structure, Completeness, Actionability). CLI auto-saves to `.clavix/outputs/prompts/fast/`. When using slash commands, agent must save manually per template instructions. |
16
- | `clavix deep "<prompt>"` | Comprehensive analysis with alternatives, edge cases, and validation checklists. CLI auto-saves to `.clavix/outputs/prompts/deep/`. When using slash commands, agent must save manually per template instructions. |
17
- | `clavix execute [--latest]` | Execute saved prompts from fast/deep optimization. Interactive selection or `--latest` for most recent. |
18
- | `clavix prompts list` | View all saved prompts with status (NEW, EXECUTED, OLD, STALE) and storage statistics. |
19
- | `clavix prompts clear` | Manage prompt cleanup. Supports `--executed`, `--stale`, `--fast`, `--deep`, `--all` flags. |
20
- | `clavix prd` | Guided Socratic questions that generate `full-prd.md` and `quick-prd.md`. |
21
- | `clavix plan` | Transform PRDs or sessions into phase-based `tasks.md`. |
22
- | `clavix implement [--commit-strategy=<type>]` | Start task execution. Git strategies: per-task, per-5-tasks, per-phase, none (default: none). |
23
- | `clavix task-complete <taskId>` | Mark task as completed with validation and optional git commit. Auto-displays next task. |
24
- | `clavix start` | Begin conversational capture session for requirements gathering. |
25
- | `clavix summarize [session-id]` | Extract mini PRD and optimized prompts from saved sessions. |
26
- | `clavix list` | List sessions and/or output projects (`--sessions`, `--outputs`, filters). |
27
- | `clavix show [session-id]` | Inspect session details or use `--output <project>` to view outputs. |
28
- | `clavix archive [project]` | Archive completed projects or restore them (`--restore`). |
29
- | `clavix config [get|set|edit|reset]` | Manage `.clavix/config.json` preferences. |
30
- | `clavix update` | Refresh managed docs and slash commands (supports `--docs-only`, `--commands-only`). |
31
- | `clavix version` | Print installed version. |
32
-
33
- ## Typical workflows
34
- - **Improve prompts quickly:** run `clavix fast` or `clavix deep` depending on complexity.
35
- - **Create strategy:** run `clavix prd` then `clavix plan` for an implementation checklist.
36
- - **Execute tasks:** use `clavix implement [--commit-strategy=<type>]`, commit work, repeat until tasks complete.
37
- - **Capture conversations:** record with `clavix start`, extract with `clavix summarize`.
38
- - **Stay organized:** inspect with `clavix list/show`, archive with `clavix archive`, refresh docs via `clavix update`.
39
-
40
- ## Implementation with Git Strategy (Agent Workflow)
41
-
42
- When implementing tasks with `clavix implement`:
43
-
44
- 1. **Check task count**: Read `tasks.md` and count phases
45
- 2. **Ask user for git preferences** (optional, only if >3 phases):
46
- ```
47
- "I notice this implementation has [X] phases with [Y] tasks.
48
-
49
- Git auto-commit preferences?
50
- - per-task: Commit after each task (detailed history)
51
- - per-5-tasks: Commit every 5 tasks (balanced)
52
- - per-phase: Commit when phase completes (milestones)
53
- - none: Manual git workflow (default)
54
-
55
- I'll use 'none' if you don't specify."
56
- ```
57
-
58
- 3. **Run implement with strategy**:
59
- ```bash
60
- # With git strategy (if user specified):
61
- clavix implement --commit-strategy=per-phase
62
-
63
- # Or without (defaults to 'none' - manual commits):
64
- clavix implement
65
- ```
66
-
67
- 4. **Default behavior**: If no `--commit-strategy` flag provided, defaults to `none` (manual commits)
68
-
69
- Artifacts are stored under `.clavix/`:
70
- - `.clavix/outputs/<project>/` for PRDs, tasks, prompts
71
- - `.clavix/sessions/` for captured conversations
72
- - `.clavix/templates/` for custom overrides
62
+ |---------|---------|
63
+ | `clavix init` | Interactive setup with integration selection |
64
+ | `clavix fast "<prompt>"` | Quick optimization (CLI auto-saves; agent must save manually per template instructions) |
65
+ | `clavix deep "<prompt>"` | Deep analysis (CLI auto-saves; agent must save manually per template instructions) |
66
+ | `clavix execute [--latest]` | Execute saved prompts (interactive or --latest) |
67
+ | `clavix prompts list` | View saved prompts with status (NEW, EXECUTED, OLD, STALE) |
68
+ | `clavix prompts clear` | Manage cleanup (--executed, --stale, --fast, --deep, --all, --force) |
69
+ | `clavix prd` | Guided PRD generation `full-prd.md` + `quick-prd.md` |
70
+ | `clavix plan` | Transform PRD phase-based `tasks.md` |
71
+ | `clavix implement [--commit-strategy=<type>]` | Execute tasks (git strategies: per-task, per-5-tasks, per-phase, none) |
72
+ | `clavix start` | Begin conversational session |
73
+ | `clavix summarize [session-id]` | Extract PRD from session |
74
+ | `clavix list` | List sessions and outputs |
75
+ | `clavix archive [project]` | Archive/restore completed projects |
76
+ | `clavix update` | Refresh documentation |
77
+
78
+ **Quick start:**
79
+ ```bash
80
+ npm install -g clavix
81
+ clavix init
82
+ clavix version
83
+ ```
84
+
85
+ ---
86
+
87
+ ## 🔄 Standard Workflow
88
+
89
+ **Clavix follows this progression:**
90
+
91
+ ```
92
+ PRD Creation → Task Planning → Implementation → Archive
93
+ ```
94
+
95
+ **Detailed steps:**
96
+
97
+ 1. **Planning Phase**
98
+ - Run: User uses conversational mode or direct PRD generation
99
+ - Output: `.clavix/outputs/{project}/full-prd.md` + `quick-prd.md`
100
+ - Mode: PLANNING
101
+
102
+ 2. **Task Preparation**
103
+ - Run: `clavix plan` transforms PRD into curated task list
104
+ - Output: `.clavix/outputs/{project}/tasks.md`
105
+ - Mode: PLANNING (Pre-Implementation)
106
+
107
+ 3. **Implementation Phase**
108
+ - Run: `clavix implement [--commit-strategy=<type>]`
109
+ - Agent executes tasks systematically
110
+ - Mode: IMPLEMENTATION
111
+ - Uses `clavix task-complete <taskId>` to mark progress
112
+
113
+ 4. **Completion**
114
+ - Run: `clavix archive [project]`
115
+ - Archives completed work
116
+ - Mode: Management
117
+
118
+ **Key principle:** Planning workflows create documents. Implementation workflows write code.
119
+
120
+ ---
121
+
122
+ ## 💡 Best Practices for Generic Agents
123
+
124
+ 1. **Always reference instruction files** - Don't recreate workflow steps inline, point to `.clavix/instructions/workflows/`
125
+
126
+ 2. **Respect mode boundaries** - Planning mode = no code, Implementation mode = write code
127
+
128
+ 3. **Use checkpoints** - Follow the CHECKPOINT pattern from instruction files to track progress
129
+
130
+ 4. **Create files explicitly** - Use Write tool for every file, verify with ls, never skip file creation
131
+
132
+ 5. **Ask when unclear** - If mode is ambiguous, ask: "Should I implement or continue planning?"
133
+
134
+ 6. **Track complexity** - Use conversational mode for complex requirements (15+ exchanges, 5+ features, 3+ topics)
135
+
136
+ 7. **Label improvements** - When optimizing prompts, mark changes with [ADDED], [CLARIFIED], [STRUCTURED], [EXPANDED], [SCOPED]
137
+
138
+ ---
139
+
140
+ ## ⚠️ Common Mistakes
141
+
142
+ ### ❌ Jumping to implementation during planning
143
+ **Wrong:** User discusses feature → agent generates code immediately
144
+
145
+ **Right:** User discusses feature → agent asks questions → creates PRD/prompt → asks if ready to implement
146
+
147
+ ### ❌ Skipping file creation
148
+ **Wrong:** Display content in chat, don't write files
149
+
150
+ **Right:** Create directory → Write files → Verify existence → Display paths
151
+
152
+ ### ❌ Recreating workflow instructions inline
153
+ **Wrong:** Copy entire fast mode workflow into response
154
+
155
+ **Right:** Reference `.clavix/instructions/workflows/fast.md` and follow its steps
156
+
157
+ ### ❌ Not using instruction files
158
+ **Wrong:** Make up workflow steps or guess at process
159
+
160
+ **Right:** Read corresponding `.clavix/instructions/workflows/*.md` file and follow exactly
161
+
162
+ ---
163
+
164
+ **Artifacts stored under `.clavix/`:**
165
+ - `.clavix/outputs/<project>/` - PRDs, tasks, prompts
166
+ - `.clavix/sessions/` - Captured conversations
167
+ - `.clavix/templates/` - Custom overrides