clavix 2.0.0 → 2.1.2

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
@@ -1,620 +1,59 @@
1
1
  # Clavix
2
+ > AI prompt improvement & PRD generation CLI (CLEAR Framework)
2
3
 
3
- > AI prompt improvement and PRD generation CLI tool for developers
4
- >
5
- > **Built on the CLEAR Framework** - Academically-validated prompt engineering methodology
6
-
7
- Clavix helps developers create better prompts and structured Product Requirements Documents (PRDs) for AI-assisted development tools like Claude Code. Using the CLEAR Framework (Concise, Logical, Explicit, Adaptive, Reflective) and Socratic questioning, Clavix ensures your requirements are clear, complete, and actionable.
8
-
9
- ## Installation
10
-
11
- ```bash
12
- npm install -g clavix
13
- ```
14
-
15
- Or run without global install (no global state):
16
-
17
- ```bash
18
- npx clavix@latest --help
19
- npx clavix@latest init
20
- ```
21
-
22
- **Troubleshooting:**
23
- - If you encounter permission errors, use `sudo npm install -g clavix` (macOS/Linux)
24
- - On Windows, run your terminal as Administrator
25
- - Verify installation with `clavix version`
26
-
27
- ## Supported Providers
28
-
29
- Clavix integrates seamlessly with multiple AI development tools:
30
-
31
- ### IDE & IDE Extensions
32
- | Tool | Slash Commands | Directory | Status |
33
- |------|----------------|-----------|--------|
34
- | **Claude Code** | ✅ | `.claude/commands/clavix/` | Fully Supported |
35
- | **Cursor** | ✅ | `.cursor/commands/` | Fully Supported |
36
- | **Windsurf** | ✅ | `.windsurf/workflows/` | Fully Supported |
37
- | **Kilocode** | ✅ | `.kilocode/workflows/` (flat, no subdirectories) | Fully Supported |
38
- | **Roocode** | ✅ | `.roo/commands/` | Fully Supported |
39
- | **Cline** | ✅ | `.cline/workflows/` (flat, no subdirectories) | Fully Supported |
40
-
41
- ### CLI Tools
42
- | Tool | Slash Commands | Directory | Status |
43
- |------|----------------|-----------|--------|
44
- | **Droid CLI** | ✅ | `.factory/commands/` (YAML frontmatter) | Fully Supported |
45
- | **CodeBuddy CLI** | ✅ | `.codebuddy/commands/` (YAML frontmatter, shell-style args) | Fully Supported |
46
- | **OpenCode** | ✅ | `.opencode/command/` | Fully Supported |
47
- | **Gemini CLI** | ✅ | `.gemini/commands/` (TOML custom commands) | Fully Supported |
48
- | **Qwen Code CLI** | ✅ | `.qwen/commands/` (TOML custom commands) | Fully Supported |
49
- | **Amp** | ✅ | `.agents/commands/` (no frontmatter) | Fully Supported |
50
- | **Crush CLI** | ✅ | `.crush/commands/clavix/` | Fully Supported |
51
- | **Codex CLI** | ✅ | `~/.codex/prompts` (global YAML frontmatter) | Fully Supported |
52
-
53
- ### Universal Adapters
54
- | Tool | Slash Commands | Directory | Status |
55
- |------|----------------|-----------|--------|
56
- | **Universal (agents.md)** | ⚡ No slash commands | `AGENTS.md` | Fully Supported |
57
- | **Octofriend** | ⚡ No slash commands | `OCTO.md` | Fully Supported |
58
-
59
- **Key Features:**
60
- - **Multi-Select Support** - Choose multiple tools during `clavix init`
61
- - **Provider-Specific Formatting** - Commands generated in each tool's native format (e.g., Crush CLI uses `$PROMPT`, Droid & CodeBuddy add YAML `description`/`argument-hint`, Gemini/Qwen emit TOML with `{{args}}`, Codex expands `$ARGUMENTS`, Amp omits frontmatter)
62
- - **Universal Fallback** - `agents.md` works with any tool
63
- - **Managed Documentation** - Auto-inject and update instructions
64
-
65
- #### Argument placeholder reference
66
-
67
- | Provider | Placeholder |
68
- |----------|-------------|
69
- | Droid CLI | `$ARGUMENTS`
70
- | CodeBuddy CLI | `$1` (additional args: `$2`, `$3`, ...)
71
- | OpenCode | `$ARGUMENTS`
72
- | Gemini CLI | `{{args}}`
73
- | Qwen Code CLI | `{{args}}`
74
- | Amp | *(no inline placeholder; raw prompt)*
75
- | Crush CLI | `$PROMPT`
76
- | Codex CLI | `$ARGUMENTS`
4
+ ## Table of contents
5
+ - [Why Clavix?](#why-clavix)
6
+ - [Why CLEAR?](#why-clear)
7
+ - [Providers](#providers)
8
+ - [Quickstart](#quickstart)
9
+ - [Full documentation](#full-documentation)
77
10
 
78
11
  ## Why Clavix?
79
-
80
- AI-assisted development tools produce better code when given better prompts. However, developers often struggle to write comprehensive, structured prompts that clearly communicate requirements, constraints, and success criteria. Clavix solves this by:
81
-
82
- - **Analyzing prompts** to identify gaps, ambiguities, and missing details
83
- - **Generating structured PRDs** through guided Socratic questioning
84
- - **Integrating seamlessly** with your AI development workflow
85
- - **Working offline** - no API calls, fully local operation
12
+ Better prompts lead to better code. Clavix analyzes gaps, generates PRDs, and integrates with your AI tooling so you can move from idea to implementation quickly. Learn more in [docs/why-clavix.md](docs/why-clavix.md).
86
13
 
87
14
  ## Why CLEAR?
15
+ Clavix is built on CLEAR (Concise, Logical, Explicit, Adaptive, Reflective), an academically validated prompt engineering methodology. Read the full overview in [docs/clear-framework.md](docs/clear-framework.md).
88
16
 
89
- **CLEAR Framework** is an academically-validated methodology for prompt engineering developed by **Dr. Leo Lo**, Dean of Libraries at the University of New Mexico, and published in the *Journal of Academic Librarianship* (July 2023).
90
-
91
- **The five CLEAR components:**
92
- - **[C] Concise** - Eliminate verbosity, remove pleasantries, focus on essentials
93
- - **[L] Logical** - Ensure coherent sequencing (context → requirements → constraints → output)
94
- - **[E] Explicit** - Specify persona, output format, tone, and success criteria
95
- - **[A] Adaptive** - Provide alternative approaches, flexibility, and customization
96
- - **[R] Reflective** - Enable validation, edge case analysis, and quality checks
97
-
98
- **Benefits:** Research-backed methodology, proven effectiveness, modern approach to AI interaction, educational feedback on prompt improvements.
99
-
100
- **Academic Citation:**
101
- Lo, L. S. (2023). "The CLEAR Path: A Framework for Enhancing Information Literacy through Prompt Engineering." *Journal of Academic Librarianship*, 49(4). [Framework Guide](https://guides.library.tamucc.edu/prompt-engineering/clear)
102
-
103
- ## Features
104
-
105
- ### 🎯 CLEAR Framework Prompt Engineering
106
-
107
- - **Fast Mode** - CLEAR-guided quick improvements (C, L, E components) with smart triage
108
- - **Deep Mode** - Full CLEAR framework analysis (C, L, E, A, R) with comprehensive validation
109
- - **CLEAR Assessment** - Score each component (0-100), overall rating, educational feedback with labeled improvements
110
-
111
- ### 📋 CLEAR-Validated PRD Generation
112
-
113
- - **Vibecoding-Optimized** - 5 focused questions instead of lengthy requirement gathering
114
- - **Smart Tech Detection** - Auto-detects stack from project files (package.json, requirements.txt, etc.)
115
- - **CLEAR Validation** - Generated PRDs are analyzed for AI consumption quality (C, L, E components)
116
- - **Dual Output Format** - Comprehensive team PRD (`full-prd.md`) + CLEAR-optimized AI-ready version (`quick-prd.md`)
117
- - **Handlebars Templates** - Fully customizable PRD formats with template override support
118
-
119
- ### 🚀 PRD-to-Implementation Workflow
120
-
121
- - **Task Planning** - Auto-generate implementation task breakdown from PRD with CLEAR-optimized atomic tasks
122
- - **Session Resume** - Stateful task tracking via markdown checkboxes, resume from last incomplete task
123
- - **Git Auto-Commit** - Optional automatic commits (per-task, per-5-tasks, per-phase) with descriptive messages
124
- - **AI-Assisted Execution** - Seamless handoff from strategic planning (PRD) to tactical implementation
17
+ ## Providers
125
18
 
126
- ### 💬 CLEAR-Optimized Conversational Mode
19
+ | Category | Providers |
20
+ | --- | --- |
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 |
127
24
 
128
- - **Session Management** - Track conversations with UUID-based sessions, metadata, tags, and status tracking
129
- - **Message History** - Complete conversation logs with user/assistant role tracking
130
- - **CLEAR Extraction** - Extract and optimize prompts using CLEAR framework, display both raw and CLEAR-enhanced versions
131
- - **Search & Filter** - Find sessions by project, agent, status, tags, keywords, or date range
132
-
133
- ### 🤖 Multi-Provider AI Agent Integration
134
-
135
- Clavix works with all major AI development tools (see [Supported Providers](#supported-providers) above).
136
-
137
- **Available Slash Commands:**
138
- - `/clavix:fast` - Quick CLEAR improvements
139
- - `/clavix:deep` - Full CLEAR analysis
140
- - `/clavix:prd` - Generate PRD
141
- - `/clavix:plan` - Generate task breakdown
142
- - `/clavix:implement` - Execute tasks
143
- - `/clavix:archive` - Archive completed projects
144
- - `/clavix:start` - Start conversational mode
145
- - `/clavix:summarize` - Extract optimized prompts
146
-
147
- **Integration Features:**
148
- - Provider-specific command formatting (e.g., Crush CLI uses `$PROMPT`; Droid CLI adds YAML `description`/`argument-hint`; Amp omits frontmatter)
149
- - Interactive multi-select during `clavix init`
150
- - Automatic documentation injection with managed blocks
151
- - Extensible plugin-based architecture for adding new providers
152
-
153
- ### ⚙️ Configuration & Management
154
-
155
- - **Project Configuration** - Customize templates, output paths, agent selection, and preferences via `.clavix/config.json`
156
- - **Interactive CLI** - View current config, change settings, edit preferences, or reset to defaults
157
- - **Template System** - Override built-in templates with custom versions in `.clavix/templates/`
158
- - **Atomic File Operations** - Safe writes and updates prevent data corruption
159
-
160
- ### 📚 Documentation Management
161
-
162
- - **Managed Blocks** - Auto-inject instructions with `<!-- CLAVIX:START -->` `<!-- CLAVIX:END -->` markers
163
- - **Update Command** - Keep slash commands and documentation synchronized across updates
164
- - **Safe Updates** - Preserve manual content while refreshing managed sections
165
- - **Migration Support** - Automatic cleanup of old command structures
166
-
167
- ### 🔧 CLI Commands
168
-
169
- - `clavix init` - Initialize Clavix in your project with multi-provider selection (checkbox UI)
170
- - `clavix fast <prompt>` - CLEAR-guided quick improvements (C, L, E components)
171
- - `--clear-only` - Show only CLEAR scores without improved prompt
172
- - `--framework-info` - Display CLEAR framework information
173
- - `clavix deep <prompt>` - Full CLEAR framework analysis (C, L, E, A, R)
174
- - `--clear-only` - Show only CLEAR scores without improved prompt
175
- - `--framework-info` - Display CLEAR framework information
176
- - `clavix prd` - Generate CLEAR-validated PRD through Socratic questions
177
- - `clavix plan` - Generate implementation task breakdown from PRD
178
- - `clavix implement` - Execute tasks from the implementation plan with AI assistance
179
- - `clavix archive` - Archive completed PRD projects (`--list`, `--restore <project>`)
180
- - `clavix start` - Begin conversational session for iterative development
181
- - `clavix summarize [session-id]` - Extract and CLEAR-optimize prompts from conversation
182
- - `clavix list` - List sessions and outputs with filtering options
183
- - `clavix show [session-id]` - View detailed session/output information
184
- - `clavix config` - Manage configuration (get/set/edit/reset)
185
- - `clavix update` - Update managed blocks and slash commands
186
- - `clavix version` - Display version information
187
-
188
- ## Quick Start
189
-
190
- ### 1. Initialize in Your Project
25
+ Provider paths and argument placeholders are listed in [docs/providers.md](docs/providers.md).
191
26
 
27
+ ## Quickstart
192
28
  ```bash
193
- cd your-project
194
- clavix init
195
- ```
196
-
197
- You'll be prompted to select which AI tools to support:
198
- ```
199
- ? Which AI tools are you using? (Space to select, Enter to confirm)
200
- ◉ Claude Code (.claude/commands/clavix/)
201
- ◉ Cursor (.cursor/commands/)
202
- ◯ Droid CLI (.factory/commands/)
203
- ◯ CodeBuddy CLI (.codebuddy/commands/)
204
- ◉ OpenCode (.opencode/command/)
205
- ◯ Gemini CLI (.gemini/commands/)
206
- ◯ Qwen Code CLI (.qwen/commands/)
207
- ◯ Amp (.agents/commands/)
208
- ◉ agents.md (Universal)
209
- ◯ Octofriend (OCTO.md - Universal)
210
- ◯ Codex CLI (~/.codex/prompts)
211
- ```
212
-
213
- This will:
214
- - Create `.clavix/` directory with configuration
215
- - Generate slash commands for all selected providers
216
- - Create universal `AGENTS.md` for tools without slash commands
217
- - Inject managed blocks into documentation files
218
-
219
- ### 2. Improve a Prompt with CLEAR Framework
220
-
221
- **Fast mode** (C, L, E components):
222
- ```bash
223
- clavix fast "Create a login page"
224
- ```
225
-
226
- **Deep mode** (full CLEAR - C, L, E, A, R):
227
- ```bash
228
- clavix deep "Create a login page"
29
+ npm install -g clavix
30
+ # or without a global install
31
+ npx clavix@latest init
229
32
  ```
230
33
 
231
- **Framework info:**
232
- ```bash
233
- clavix fast --framework-info
234
- ```
235
-
236
- Output:
237
- - **CLEAR Assessment** - Component scores (Conciseness, Logic, Explicitness + Adaptive & Reflective in deep mode)
238
- - **CLEAR-Optimized Prompt** - Improved version applying all CLEAR principles
239
- - **CLEAR Changes Made** - Educational feedback labeled with [C], [L], [E], [A], [R] components
240
- - **Smart Triage** - CLEAR-aware recommendations for when to use deep mode
241
- - **Adaptive Variations** - Alternative phrasings and structures (deep mode)
242
- - **Reflection Checklist** - Validation steps and edge cases (deep mode)
243
-
244
- ### 3. Use Slash Commands (All Providers)
245
-
246
- After initialization, use these CLEAR-enhanced commands in your AI tool:
247
-
248
- - `/clavix:fast [prompt]` - CLEAR-guided quick improvements (C, L, E)
249
- - `/clavix:deep [prompt]` - Full CLEAR framework analysis (C, L, E, A, R)
250
- - `/clavix:prd` - Generate CLEAR-validated PRD
251
- - `/clavix:plan` - Generate task breakdown from PRD
252
- - `/clavix:implement` - Execute tasks with AI assistance
253
- - `/clavix:start` - Start conversational mode
254
- - `/clavix:summarize` - Extract and CLEAR-optimize from conversation
255
-
256
- ## Commands
257
-
258
- ### `clavix init`
259
-
260
- Initialize Clavix in the current project.
261
-
34
+ Common commands:
262
35
  ```bash
263
36
  clavix init
264
- ```
265
-
266
- Interactive prompts guide you through:
267
- - Agent selection (Claude Code, more coming soon)
268
- - Directory structure creation
269
- - Slash command generation
270
- - Documentation injection
271
-
272
- ### `clavix fast <prompt>`
273
-
274
- Quick prompt improvements with smart triage.
275
-
276
- ```bash
277
- clavix fast "Build an API for user management"
278
- ```
279
-
280
- **Features:**
281
- - Fast analysis of gaps, ambiguities, strengths
282
- - Smart triage: recommends deep mode for complex prompts
283
- - "Already good" assessment for quality prompts
284
- - Changes made summary (educational)
285
- - Single structured improved prompt
286
-
287
- **Smart triage checks:**
288
- - Prompts < 20 characters
289
- - Missing 3+ critical elements
290
- - Vague scope words without context
291
-
292
- ### `clavix deep <prompt>`
293
-
294
- Comprehensive prompt analysis.
295
-
296
- ```bash
37
+ clavix fast "Create a login page"
297
38
  clavix deep "Build an API for user management"
298
- ```
299
-
300
- **Everything from fast mode PLUS:**
301
- - Alternative phrasings of requirements
302
- - Edge cases in requirements
303
- - Good/bad implementation examples
304
- - Multiple prompt structuring approaches
305
- - "What could go wrong" analysis
306
- - More thorough clarifying questions
307
-
308
- **Output:**
309
- - Structured prompt with sections:
310
- - Objective
311
- - Requirements
312
- - Technical Constraints
313
- - Expected Output
314
- - Success Criteria
315
- - Plus all deep mode analysis sections
316
-
317
- ### `clavix prd`
318
-
319
- Generate a comprehensive PRD through 5 focused questions (optimized for vibecoding).
320
-
321
- ```bash
322
39
  clavix prd
323
40
  ```
324
41
 
325
- Features:
326
- - **5 streamlined questions** - Fast workflow without losing quality
327
- - **Smart tech detection** - Auto-detects stack from package.json, requirements.txt, etc.
328
- - **CLEAR validated** - Automatic quality analysis for AI consumption
329
-
330
- Creates two files:
331
- - `full-prd.md` - Comprehensive document for team alignment
332
- - `quick-prd.md` - Condensed version for AI consumption
333
-
334
- ### `clavix plan`
335
-
336
- Generate implementation task breakdown from PRD.
337
-
338
- ```bash
339
- clavix plan
340
- ```
341
-
342
- **Features:**
343
- - Analyzes PRD and generates `tasks.md` with CLEAR-optimized tasks
344
- - Organizes tasks into logical phases/sections
345
- - Creates markdown checkbox format for progress tracking
346
- - Each task is atomic and independently implementable
347
- - Tasks reference specific PRD sections for context
348
-
349
- **Options:**
350
- ```bash
351
- clavix plan --project my-app # Specify PRD project
352
- clavix plan --prd-path .clavix/outputs/my-project # Direct path
353
- clavix plan --overwrite # Regenerate existing tasks.md
354
- ```
355
-
356
- **Output format:**
357
- ```markdown
358
- ## Phase 1: Authentication
359
- - [ ] Implement user registration endpoint
360
- - [ ] Add password hashing with bcrypt
361
- - [ ] Create JWT token generation
362
-
363
- ## Phase 2: Authorization
364
- - [ ] Implement role-based access control
365
- - [ ] Add middleware for protected routes
366
- ```
367
-
368
- ### `clavix implement`
369
-
370
- Execute tasks from the implementation plan with AI assistance.
371
-
372
- ```bash
373
- clavix implement
374
- ```
375
-
376
- **Workflow:**
377
- 1. Reads `tasks.md` and finds first incomplete task
378
- 2. Shows current progress (completed/total)
379
- 3. Prompts for git auto-commit preferences
380
- 4. Creates configuration for AI agent
381
- 5. AI agent implements tasks sequentially
382
- 6. Marks completed tasks: `[ ]` → `[x]`
383
- 7. Creates commits based on strategy
384
- 8. Resumes from last checkpoint in new sessions
385
-
386
- **Git Auto-Commit Strategies:**
387
- - **Per phase** - Commit when all tasks in a phase complete
388
- - **Per 5 tasks** - Commit after every 5 tasks
389
- - **Per task** - Commit after each individual task
390
- - **None** - Manual git management
391
-
392
- **Options:**
393
- ```bash
394
- clavix implement --project my-app # Specify PRD project
395
- clavix implement --no-git # Skip git setup
396
- clavix implement --commit-strategy per-task # Set commit strategy
397
- ```
398
-
399
- **Example commit message:**
400
- ```
401
- clavix: Implement user authentication
402
-
403
- Completed tasks:
404
- - Implement user registration endpoint
405
- - Add password hashing with bcrypt
406
- - Create JWT token generation
407
-
408
- Project: my-app
409
- Generated by Clavix /clavix:implement
410
- ```
411
-
412
- ### `clavix archive`
413
-
414
- Archive completed PRD projects to keep your workspace organized.
415
-
416
- ```bash
417
- # Interactive mode - select projects to archive
418
- clavix archive
419
-
420
- # Archive specific project
421
- clavix archive my-project
422
-
423
- # List archived projects
424
- clavix archive --list
425
-
426
- # Restore archived project
427
- clavix archive --restore my-project
428
-
429
- # Force archive (skip incomplete task verification)
430
- clavix archive my-project --force
431
- ```
42
+ ## Full documentation
43
+ - Overview & navigation: [docs/index.md](docs/index.md)
44
+ - Command reference: [docs/commands/](docs/commands/README.md)
45
+ - Providers: [docs/providers.md](docs/providers.md)
46
+ - CLEAR Framework: [docs/clear-framework.md](docs/clear-framework.md)
47
+ - Guides: [docs/guides/](docs/guides/workflows.md)
432
48
 
433
- **How it works:**
434
- - Archives projects from `.clavix/outputs/` to `.clavix/outputs/archive/`
435
- - Validates all tasks are completed before archiving (unless `--force` used)
436
- - Preserves all PRD files, task files, and implementation plans
437
- - List view shows completion status, task counts, and archive dates
438
- - Supports multiple PRD naming conventions: `PRD.md`, `full-prd.md`, `FULL_PRD.md`, `QUICK_PRD.md`
439
-
440
- **Slash Command:**
441
- ```
442
- /clavix:archive
443
- ```
444
- Available in: Claude Code, Cursor, Droid, OpenCode, Amp, Crush, Windsurf, Kilocode, Cline, Roocode
445
-
446
- ### `clavix start`
447
-
448
- Enter conversational mode for iterative requirement gathering.
449
-
450
- ```bash
451
- clavix start
452
- ```
453
-
454
- Start a natural conversation to develop requirements. Use `/clavix:summarize` later to extract structured output.
455
-
456
- ### `clavix summarize [session-id]`
457
-
458
- Analyze a conversation and extract requirements.
459
-
460
- ```bash
461
- # Summarize current session
462
- clavix summarize
463
-
464
- # Summarize specific session
465
- clavix summarize abc-123-def
466
- ```
467
-
468
- Generates:
469
- - `mini-prd.md` - Concise requirements
470
- - `optimized-prompt.md` - AI-ready prompt
471
-
472
- ### `clavix list`
473
-
474
- List all sessions and outputs.
475
-
476
- ```bash
477
- # List everything
478
- clavix list
479
-
480
- # List only sessions
481
- clavix list --sessions
482
-
483
- # Filter by project
484
- clavix list --project auth
485
- ```
486
-
487
- ### `clavix show [session-id]`
488
-
489
- Show detailed session information.
490
-
491
- ```bash
492
- # Show most recent session
493
- clavix show
494
-
495
- # Show specific session with full history
496
- clavix show abc-123-def --full
497
-
498
- # Show output directory
499
- clavix show --output project-name
500
- ```
501
-
502
- ### `clavix config`
503
-
504
- Manage configuration.
505
-
506
- ```bash
507
- # Interactive menu
508
- clavix config
509
-
510
- # Get/set values
511
- clavix config get agent
512
- clavix config set preferences.verboseLogging true
513
- ```
514
-
515
- ### `clavix update`
516
-
517
- Update managed blocks and slash commands.
518
-
519
- ```bash
520
- # Update everything
521
- clavix update
522
-
523
- # Update specific components
524
- clavix update --docs-only
525
- clavix update --commands-only
526
- ```
527
-
528
- ### `clavix version`
529
-
530
- Display the current version of Clavix.
531
-
532
- ```bash
533
- clavix version
534
- ```
535
-
536
- ### `clavix --help`
537
-
538
- Display help information for all commands.
539
-
540
- ```bash
541
- clavix --help
542
- clavix fast --help
543
- clavix deep --help
544
- ```
545
-
546
- ## Project Structure
547
-
548
- After initialization, your project will have:
549
-
550
- ```
551
- your-project/
552
- ├── .clavix/
553
- │ ├── config.json # Clavix configuration
554
- │ ├── INSTRUCTIONS.md # Usage guide
555
- │ ├── sessions/ # Conversational mode sessions
556
- │ ├── outputs/ # Generated PRDs and prompts
557
- │ │ └── project-name/
558
- │ │ ├── PRD.md # Full PRD
559
- │ │ ├── PRD-quick.md # Quick PRD
560
- │ │ ├── tasks.md # Implementation tasks
561
- │ │ └── .clavix-implement-config.json # Implementation config
562
- │ └── templates/ # Custom templates (optional)
563
- ├── AGENTS.md # Updated with Clavix block
564
- ├── CLAUDE.md # Updated with Clavix block (if Claude Code)
565
- └── .claude/commands/ # Generated slash commands (if Claude Code)
566
- ├── clavix/
567
- │ ├── fast.md
568
- │ ├── deep.md
569
- │ ├── prd.md
570
- │ ├── plan.md
571
- │ ├── implement.md
572
- │ ├── start.md
573
- │ └── summarize.md
574
- ```
575
-
576
- ## Configuration
577
-
578
- Clavix stores configuration in `.clavix/config.json`:
579
-
580
- ```json5
581
- {
582
- version: "1.0.0",
583
- agent: "claude-code",
584
- templates: {
585
- prdQuestions: "default",
586
- fullPrd: "default",
587
- quickPrd: "default"
588
- },
589
- outputs: {
590
- path: ".clavix/outputs",
591
- format: "markdown"
592
- },
593
- preferences: {
594
- autoOpenOutputs: false,
595
- verboseLogging: false,
596
- preserveSessions: true
597
- }
598
- }
599
- ```
600
-
601
- ## Customization
602
-
603
- ### Custom Templates
604
-
605
- Override default templates by adding files to `.clavix/templates/`:
606
-
607
- - `prd-questions.md` - Custom PRD questions
608
- - `full-prd-template.hbs` - Full PRD format
609
- - `quick-prd-template.hbs` - Quick PRD format
610
-
611
- Templates use Handlebars syntax.
612
-
613
- ## Examples
614
-
615
- ### Example 1: Minimal to Comprehensive
49
+ ## Development
50
+ - Requires Node.js 18
51
+ - Run tests: `npm test`
52
+ - Lint: `npm run lint`
53
+ - Build: `npm run build`
616
54
 
617
- **Original:**
55
+ ## License
56
+ MIT
618
57
  ```
619
58
  Create a login page
620
59
  ```
@@ -227,7 +227,7 @@ class Implement extends core_1.Command {
227
227
  }
228
228
  // Check if tasks.md exists
229
229
  const hasTasks = await fs.pathExists(tasksPath);
230
- let stats = null;
230
+ let stats;
231
231
  if (hasTasks) {
232
232
  try {
233
233
  const phases = await manager.readTasksFile(tasksPath);
@@ -45,6 +45,7 @@ const agent_manager_1 = require("../../core/agent-manager");
45
45
  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
+ const warp_md_generator_1 = require("../../core/adapters/warp-md-generator");
48
49
  const file_system_1 = require("../../utils/file-system");
49
50
  const config_1 = require("../../types/config");
50
51
  const gemini_adapter_1 = require("../../core/adapters/gemini-adapter");
@@ -80,32 +81,6 @@ class Init extends core_1.Command {
80
81
  name: 'selectedProviders',
81
82
  message: 'Which AI tools are you using?',
82
83
  choices: [
83
- // IDE & IDE Extensions
84
- {
85
- name: 'Claude Code (.claude/commands/clavix/)',
86
- value: 'claude-code',
87
- },
88
- {
89
- name: 'Cline (.clinerules/workflows/)',
90
- value: 'cline',
91
- },
92
- {
93
- name: 'Cursor (.cursor/commands/)',
94
- value: 'cursor',
95
- },
96
- {
97
- name: 'Kilocode (.kilocode/workflows/)',
98
- value: 'kilocode',
99
- },
100
- {
101
- name: 'Roocode (.roo/commands/)',
102
- value: 'roocode',
103
- },
104
- {
105
- name: 'Windsurf (.windsurf/workflows/)',
106
- value: 'windsurf',
107
- },
108
- new inquirer_1.default.Separator(),
109
84
  // CLI Tools
110
85
  {
111
86
  name: 'Amp (.agents/commands/)',
@@ -131,6 +106,10 @@ class Init extends core_1.Command {
131
106
  name: 'Crush CLI (.crush/commands/clavix/)',
132
107
  value: 'crush',
133
108
  },
109
+ {
110
+ name: 'Claude Code (.claude/commands/clavix/)',
111
+ value: 'claude-code',
112
+ },
134
113
  {
135
114
  name: 'Droid CLI (.factory/commands/)',
136
115
  value: 'droid',
@@ -148,11 +127,37 @@ class Init extends core_1.Command {
148
127
  value: 'qwen',
149
128
  },
150
129
  new inquirer_1.default.Separator(),
130
+ // IDE & IDE Extensions
131
+ {
132
+ name: 'Cursor (.cursor/commands/)',
133
+ value: 'cursor',
134
+ },
135
+ {
136
+ name: 'Windsurf (.windsurf/workflows/)',
137
+ value: 'windsurf',
138
+ },
139
+ {
140
+ name: 'Kilocode (.kilocode/workflows/)',
141
+ value: 'kilocode',
142
+ },
143
+ {
144
+ name: 'Roocode (.roo/commands/)',
145
+ value: 'roocode',
146
+ },
147
+ {
148
+ name: 'Cline (.clinerules/workflows/)',
149
+ value: 'cline',
150
+ },
151
+ new inquirer_1.default.Separator(),
151
152
  // Universal Adapters
152
153
  {
153
154
  name: 'agents.md (Universal - for tools without slash commands)',
154
155
  value: 'agents-md',
155
156
  },
157
+ {
158
+ name: 'Warp (WARP.md - optimized for Warp)',
159
+ value: 'warp-md',
160
+ },
156
161
  {
157
162
  name: 'Octofriend (OCTO.md - optimized for Octofriend)',
158
163
  value: 'octo-md',
@@ -194,6 +199,11 @@ class Init extends core_1.Command {
194
199
  await octo_md_generator_1.OctoMdGenerator.generate();
195
200
  continue;
196
201
  }
202
+ if (providerName === 'warp-md') {
203
+ console.log(chalk_1.default.gray(' ✓ Generating WARP.md...'));
204
+ await warp_md_generator_1.WarpMdGenerator.generate();
205
+ continue;
206
+ }
197
207
  let adapter = agentManager.requireAdapter(providerName);
198
208
  console.log(chalk_1.default.gray(` ✓ Generating ${adapter.displayName} commands...`));
199
209
  if (adapter.name === 'codex') {
@@ -16,5 +16,6 @@ export default class Update extends Command {
16
16
  private hasUpToDateBlock;
17
17
  private updateAgentsMd;
18
18
  private updateOctoMd;
19
+ private updateWarpMd;
19
20
  }
20
21
  //# sourceMappingURL=update.d.ts.map
@@ -46,6 +46,7 @@ const doc_injector_1 = require("../../core/doc-injector");
46
46
  const agent_manager_1 = require("../../core/agent-manager");
47
47
  const agents_md_generator_1 = require("../../core/adapters/agents-md-generator");
48
48
  const octo_md_generator_1 = require("../../core/adapters/octo-md-generator");
49
+ const warp_md_generator_1 = require("../../core/adapters/warp-md-generator");
49
50
  const legacy_command_cleanup_1 = require("../../utils/legacy-command-cleanup");
50
51
  class Update extends core_1.Command {
51
52
  async run() {
@@ -69,23 +70,24 @@ class Update extends core_1.Command {
69
70
  let updatedCount = 0;
70
71
  // Update for each provider
71
72
  for (const providerName of providers) {
72
- // Handle agents-md separately (not an adapter)
73
+ // Handle AGENTS.md separately
73
74
  if (providerName === 'agents-md') {
74
75
  if (updateDocs) {
75
- const agentsPath = path.join(process.cwd(), 'AGENTS.md');
76
- if (fs.existsSync(agentsPath)) {
77
- updatedCount += await this.updateAgentsMd(flags.force);
78
- }
76
+ updatedCount += await this.updateAgentsMd(flags.force);
79
77
  }
80
78
  continue;
81
79
  }
82
- // Handle octo-md separately (not an adapter)
80
+ // Handle Warp separately
81
+ if (providerName === 'warp-md') {
82
+ if (updateDocs) {
83
+ updatedCount += await this.updateWarpMd(flags.force);
84
+ }
85
+ continue;
86
+ }
87
+ // Handle Octofriend separately
83
88
  if (providerName === 'octo-md') {
84
89
  if (updateDocs) {
85
- const octoPath = path.join(process.cwd(), 'OCTO.md');
86
- if (fs.existsSync(octoPath)) {
87
- updatedCount += await this.updateOctoMd(flags.force);
88
- }
90
+ updatedCount += await this.updateOctoMd(flags.force);
89
91
  }
90
92
  continue;
91
93
  }
@@ -328,6 +330,19 @@ Analyze the current conversation and extract key requirements into a structured
328
330
  return 0;
329
331
  }
330
332
  }
333
+ async updateWarpMd(_force) {
334
+ this.log(chalk_1.default.cyan('📝 Updating WARP.md...'));
335
+ try {
336
+ await warp_md_generator_1.WarpMdGenerator.generate();
337
+ this.log(chalk_1.default.gray(' ✓ Updated WARP.md'));
338
+ return 1;
339
+ }
340
+ catch (error) {
341
+ const { getErrorMessage } = await Promise.resolve().then(() => __importStar(require('../../utils/error-utils.js')));
342
+ this.log(chalk_1.default.yellow(` ⚠ Failed to update WARP.md: ${getErrorMessage(error)}`));
343
+ return 0;
344
+ }
345
+ }
331
346
  }
332
347
  Update.description = 'Update managed blocks and slash commands';
333
348
  Update.examples = [
@@ -337,7 +352,7 @@ Update.examples = [
337
352
  ];
338
353
  Update.flags = {
339
354
  'docs-only': core_1.Flags.boolean({
340
- description: 'Update only documentation blocks (AGENTS.md, CLAUDE.md)',
355
+ description: 'Update only documentation blocks (AGENTS.md, CLAUDE.md, OCTO.md, WARP.md)',
341
356
  default: false,
342
357
  }),
343
358
  'commands-only': core_1.Flags.boolean({
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generator for Warp WARP.md file
3
+ * Provides workflow instructions optimized for Warp users
4
+ */
5
+ export declare class WarpMdGenerator {
6
+ static readonly TARGET_FILE = "WARP.md";
7
+ static readonly START_MARKER = "<!-- CLAVIX:START -->";
8
+ static readonly END_MARKER = "<!-- CLAVIX:END -->";
9
+ /**
10
+ * Generate or update WARP.md with Clavix workflows
11
+ */
12
+ static generate(): Promise<void>;
13
+ private static injectManagedBlock;
14
+ private static escapeRegex;
15
+ static hasClavixBlock(): Promise<boolean>;
16
+ }
17
+ //# sourceMappingURL=warp-md-generator.d.ts.map
@@ -0,0 +1,88 @@
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.WarpMdGenerator = void 0;
37
+ const file_system_1 = require("../../utils/file-system");
38
+ const path = __importStar(require("path"));
39
+ /**
40
+ * Generator for Warp WARP.md file
41
+ * Provides workflow instructions optimized for Warp users
42
+ */
43
+ class WarpMdGenerator {
44
+ /**
45
+ * Generate or update WARP.md with Clavix workflows
46
+ */
47
+ static async generate() {
48
+ const templatePath = path.join(__dirname, '../../templates/agents/warp.md');
49
+ if (!(await file_system_1.FileSystem.exists(templatePath))) {
50
+ throw new Error(`WARP.md template not found at ${templatePath}`);
51
+ }
52
+ const template = await file_system_1.FileSystem.readFile(templatePath);
53
+ await this.injectManagedBlock(this.TARGET_FILE, template);
54
+ }
55
+ static async injectManagedBlock(filePath, content) {
56
+ let fileContent = '';
57
+ if (await file_system_1.FileSystem.exists(filePath)) {
58
+ fileContent = await file_system_1.FileSystem.readFile(filePath);
59
+ }
60
+ const blockRegex = new RegExp(`${this.escapeRegex(this.START_MARKER)}[\\s\\S]*?${this.escapeRegex(this.END_MARKER)}`, 'g');
61
+ const wrappedContent = `${this.START_MARKER}\n${content}\n${this.END_MARKER}`;
62
+ if (blockRegex.test(fileContent)) {
63
+ fileContent = fileContent.replace(blockRegex, wrappedContent);
64
+ }
65
+ else {
66
+ if (fileContent && !fileContent.endsWith('\n\n')) {
67
+ fileContent += '\n\n';
68
+ }
69
+ fileContent += wrappedContent + '\n';
70
+ }
71
+ await file_system_1.FileSystem.writeFileAtomic(filePath, fileContent);
72
+ }
73
+ static escapeRegex(str) {
74
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
75
+ }
76
+ static async hasClavixBlock() {
77
+ if (!(await file_system_1.FileSystem.exists(this.TARGET_FILE))) {
78
+ return false;
79
+ }
80
+ const content = await file_system_1.FileSystem.readFile(this.TARGET_FILE);
81
+ return content.includes(this.START_MARKER);
82
+ }
83
+ }
84
+ exports.WarpMdGenerator = WarpMdGenerator;
85
+ WarpMdGenerator.TARGET_FILE = 'WARP.md';
86
+ WarpMdGenerator.START_MARKER = '<!-- CLAVIX:START -->';
87
+ WarpMdGenerator.END_MARKER = '<!-- CLAVIX:END -->';
88
+ //# sourceMappingURL=warp-md-generator.js.map
@@ -127,13 +127,6 @@ class TaskManager {
127
127
  if (phases.length === 0 && sections.requirements) {
128
128
  phases.push(...this.generateTasksFromRequirements(sections.requirements, sections));
129
129
  }
130
- // Ensure all tasks follow CLEAR principles
131
- phases.forEach((phase) => {
132
- phase.tasks = phase.tasks.map((task) => ({
133
- ...task,
134
- description: this.optimizeTaskDescription(task.description),
135
- }));
136
- });
137
130
  const technicalSection = this.getSectionByAliases(sections, [
138
131
  'technicalrequirements',
139
132
  'technicalconstraints',
@@ -151,6 +144,13 @@ class TaskManager {
151
144
  if (phases.length === 0) {
152
145
  phases.push(this.generateDefaultPhases(prdContent));
153
146
  }
147
+ // Ensure all tasks follow CLEAR principles (applied AFTER all tasks are added)
148
+ phases.forEach((phase) => {
149
+ phase.tasks = phase.tasks.map((task) => ({
150
+ ...task,
151
+ description: this.optimizeTaskDescription(task.description),
152
+ }));
153
+ });
154
154
  return phases;
155
155
  }
156
156
  getSectionByAliases(sections, aliases) {
@@ -454,15 +454,15 @@ class TaskManager {
454
454
  * Optimize task description using CLEAR principles
455
455
  */
456
456
  optimizeTaskDescription(description) {
457
- // Ensure conciseness: limit to reasonable length
458
- if (description.length > 150) {
459
- description = description.substring(0, 147) + '...';
460
- }
461
- // Ensure starts with action verb
457
+ // Ensure starts with action verb first
462
458
  const actionVerbs = /^(Create|Add|Implement|Build|Generate|Read|Write|Parse|Analyze|Display|Update|Handle|Process|Execute|Mark|Track|Ensure|Validate|Configure|Set up|Fix|Refactor|Test)/i;
463
459
  if (!actionVerbs.test(description)) {
464
460
  description = `Implement ${description}`;
465
461
  }
462
+ // Ensure conciseness: limit to reasonable length (after adding action verb)
463
+ if (description.length > 150) {
464
+ description = description.substring(0, 147) + '...';
465
+ }
466
466
  return description;
467
467
  }
468
468
  /**
@@ -1,12 +1,39 @@
1
- # Clavix Workflows
1
+ # Clavix Workflows (Universal)
2
2
 
3
- Quick workflow instructions for AI tools.
3
+ Use these instructions when your agent can only read documentation (no slash-command support).
4
4
 
5
- ## Fast Mode
6
- Use for quick prompt improvements.
5
+ ## Quick start
6
+ - Install globally: `npm install -g clavix`
7
+ - Or run ad hoc: `npx clavix@latest init`
8
+ - Verify installation: `clavix version`
7
9
 
8
- ## Deep Mode
9
- Use for comprehensive analysis.
10
+ ## Command reference
10
11
 
11
- ## PRD Mode
12
- Use for strategic planning.
12
+ | Command | Purpose |
13
+ | --- | --- |
14
+ | `clavix init` | Interactive setup. Select providers and generate documentation/command files. |
15
+ | `clavix fast "<prompt>"` | CLEAR (C/L/E) analysis with improved prompt output. |
16
+ | `clavix deep "<prompt>"` | Full CLEAR (C/L/E/A/R) analysis, alternative variations, validation checklists. |
17
+ | `clavix prd` | Guided Socratic questions that generate `full-prd.md` and `quick-prd.md`. |
18
+ | `clavix plan` | Transform PRDs or sessions into phase-based `tasks.md`. |
19
+ | `clavix implement` | Walk through tasks, track progress, optionally set git auto-commit strategy. |
20
+ | `clavix start` | Begin conversational capture session for requirements gathering. |
21
+ | `clavix summarize [session-id]` | Extract mini PRD and optimized prompts from saved sessions. |
22
+ | `clavix list` | List sessions and/or output projects (`--sessions`, `--outputs`, filters). |
23
+ | `clavix show [session-id]` | Inspect session details or use `--output <project>` to view outputs. |
24
+ | `clavix archive [project]` | Archive completed projects or restore them (`--restore`). |
25
+ | `clavix config [get|set|edit|reset]` | Manage `.clavix/config.json` preferences. |
26
+ | `clavix update` | Refresh managed docs and slash commands (supports `--docs-only`, `--commands-only`). |
27
+ | `clavix version` | Print installed version. |
28
+
29
+ ## Typical workflows
30
+ - **Improve prompts quickly:** run `clavix fast` or `clavix deep` depending on complexity.
31
+ - **Create strategy:** run `clavix prd` then `clavix plan` for an implementation checklist.
32
+ - **Execute tasks:** use `clavix implement`, commit work, repeat until tasks complete.
33
+ - **Capture conversations:** record with `clavix start`, extract with `clavix summarize`.
34
+ - **Stay organized:** inspect with `clavix list/show`, archive with `clavix archive`, refresh docs via `clavix update`.
35
+
36
+ Artifacts are stored under `.clavix/`:
37
+ - `.clavix/outputs/<project>/` for PRDs, tasks, prompts
38
+ - `.clavix/sessions/` for captured conversations
39
+ - `.clavix/templates/` for custom overrides
@@ -215,6 +215,25 @@ Detect user intent from keywords and trigger appropriate workflow. Use Octofrien
215
215
 
216
216
  ---
217
217
 
218
+ ### CLI reference cheat sheet
219
+
220
+ | Command | Use it for |
221
+ | --- | --- |
222
+ | `clavix init` | Rebuild `.clavix` structure and regenerate provider assets. |
223
+ | `clavix fast` / `clavix deep` | CLEAR-based prompt improvement (quick vs. comprehensive). |
224
+ | `clavix prd` | Guided questions to create PRDs. |
225
+ | `clavix plan` | Convert PRD artifacts into task lists. |
226
+ | `clavix implement` | Step through tasks with optional git automation. |
227
+ | `clavix start` | Capture conversational requirements. |
228
+ | `clavix summarize` | Extract mini PRDs and prompts from sessions. |
229
+ | `clavix list` | List sessions or outputs (use `--sessions`, `--outputs`, `--archived`). |
230
+ | `clavix show` | Inspect sessions or output directories. |
231
+ | `clavix archive` | Archive or restore project outputs. |
232
+ | `clavix config` | View/update `.clavix/config.json`. |
233
+ | `clavix update` | Refresh documentation and slash commands. |
234
+ | `clavix version` | Display installed CLI version. |
235
+
236
+
218
237
  ## 📝 Workflow Selection Guide
219
238
 
220
239
  **User mentions PRD, requirements doc, strategic planning:**
@@ -0,0 +1,31 @@
1
+ ## Clavix Integration for Warp
2
+
3
+ Clavix helps Warp developers turn rough ideas into CLEAR, AI-ready prompts and Product Requirements Documents without leaving the terminal.
4
+
5
+ ### Quick start
6
+ - Install globally: `npm install -g clavix`
7
+ - Or run ad hoc: `npx clavix@latest init`
8
+ - Verify setup: `clavix version`
9
+
10
+ ### Common commands
11
+ - `clavix init` – interactive provider setup (regenerates docs & commands)
12
+ - `clavix fast "<prompt>"` – quick CLEAR (C/L/E) analysis and improved prompt
13
+ - `clavix deep "<prompt>"` – full CLEAR (C/L/E/A/R) analysis with alternatives & checklists
14
+ - `clavix prd` – answer focused questions to create full/quick PRDs
15
+ - `clavix plan` – transform PRDs or sessions into task lists
16
+ - `clavix implement` – progress through tasks with optional git auto-commit
17
+ - `clavix start` – capture requirement conversations in Warp
18
+ - `clavix summarize [session-id]` – extract mini PRDs and optimized prompts
19
+ - `clavix list` – list sessions/outputs (`--sessions`, `--outputs`, `--archived`)
20
+ - `clavix show [session-id]` – inspect sessions or use `--output <project>`
21
+ - `clavix archive [project]` – archive projects (or `--restore` to bring them back)
22
+ - `clavix config get|set|edit|reset` – manage `.clavix/config.json`
23
+ - `clavix update` – refresh documentation/commands (`--docs-only`, `--commands-only`)
24
+ - `clavix version` – print installed CLI version
25
+
26
+ ### Outputs
27
+ - Project artifacts live under `.clavix/outputs/<project>/`
28
+ - Sessions are stored in `.clavix/sessions/`
29
+ - Update generated docs/commands any time with `clavix update`
30
+
31
+ For full documentation, open `docs/index.md` in your project or visit the repository README.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavix",
3
- "version": "2.0.0",
3
+ "version": "2.1.2",
4
4
  "description": "AI prompt improvement and PRD generation CLI tool for developers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",