ultra-dex 1.8.0 → 2.2.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.
Files changed (41) hide show
  1. package/README.md +162 -143
  2. package/bin/ultra-dex.js +1005 -777
  3. package/lib/commands/agents.js +154 -0
  4. package/lib/commands/audit.js +135 -0
  5. package/lib/commands/banner.js +21 -0
  6. package/lib/commands/build.js +214 -0
  7. package/lib/commands/examples.js +34 -0
  8. package/lib/commands/fetch.js +186 -0
  9. package/lib/commands/generate.js +217 -0
  10. package/lib/commands/hooks.js +105 -0
  11. package/lib/commands/init.js +337 -0
  12. package/lib/commands/placeholders.js +11 -0
  13. package/lib/commands/review.js +287 -0
  14. package/lib/commands/serve.js +56 -0
  15. package/lib/commands/suggest.js +126 -0
  16. package/lib/commands/validate.js +140 -0
  17. package/lib/commands/workflows.js +185 -0
  18. package/lib/config/paths.js +9 -0
  19. package/lib/config/urls.js +16 -0
  20. package/lib/providers/base.js +82 -0
  21. package/lib/providers/claude.js +177 -0
  22. package/lib/providers/gemini.js +170 -0
  23. package/lib/providers/index.js +93 -0
  24. package/lib/providers/openai.js +163 -0
  25. package/lib/templates/context.js +26 -0
  26. package/lib/templates/embedded.js +141 -0
  27. package/lib/templates/prompts/generate-plan.js +147 -0
  28. package/lib/templates/prompts/review-code.js +57 -0
  29. package/lib/templates/prompts/section-prompts.js +275 -0
  30. package/lib/templates/prompts/system-prompt.md +58 -0
  31. package/lib/templates/quick-start.js +43 -0
  32. package/lib/utils/build-helpers.js +257 -0
  33. package/lib/utils/fallback.js +36 -0
  34. package/lib/utils/files.js +67 -0
  35. package/lib/utils/network.js +18 -0
  36. package/lib/utils/output.js +20 -0
  37. package/lib/utils/parser.js +155 -0
  38. package/lib/utils/prompt-builder.js +93 -0
  39. package/lib/utils/review-helpers.js +334 -0
  40. package/lib/utils/validation.js +34 -0
  41. package/package.json +17 -3
package/README.md CHANGED
@@ -1,219 +1,238 @@
1
1
  # Ultra-Dex CLI
2
2
 
3
- > Scaffold Ultra-Dex projects from the command line.
3
+ > Scaffold Ultra-Dex projects from the command line, now with **AI-powered plan generation**.
4
4
 
5
- ## First 10 Minutes
5
+ ## What's New in v2.1
6
6
 
7
7
  ```bash
8
- # 1. Create your project (2 min)
9
- npx ultra-dex init
8
+ # 🚀 Generate a complete 34-section plan with AI
9
+ npx ultra-dex generate "A task management SaaS for remote teams"
10
+
11
+ # 🔧 Start AI-assisted development
12
+ npx ultra-dex build --agent planner
10
13
 
11
- # 2. Open and review QUICK-START.md (3 min)
12
- cd your-project
13
- cat QUICK-START.md
14
+ # 🔍 Review code against plan
15
+ npx ultra-dex review
14
16
 
15
- # 3. Load Cursor rules for AI assistance (1 min)
16
- # Rules are bundled; choose "Include cursor-rules" when prompted.
17
- #
18
- # Optional offline bundle:
19
- # npx ultra-dex fetch --rules --docs --agents
17
+ # 📊 Quick alignment check
18
+ npx ultra-dex align
19
+ ```
20
20
 
21
- # 4. Start building with AI agents (4 min)
22
- # Use @Backend, @Frontend, @Database agents
23
- npx ultra-dex agents
21
+ ## First 10 Minutes
24
22
 
25
- # You're ready to code!
23
+ ```bash
24
+ # Option 1: AI-Generated Plan (Recommended)
25
+ export ANTHROPIC_API_KEY=your-key # or OPENAI_API_KEY or GOOGLE_AI_KEY
26
+ npx ultra-dex generate "Your SaaS idea here"
27
+
28
+ # Option 2: Manual Setup
29
+ npx ultra-dex init
26
30
  ```
27
31
 
28
32
  ## Installation
29
33
 
30
34
  ```bash
31
35
  # Run directly with npx (no installation needed)
32
- npx ultra-dex init
36
+ npx ultra-dex generate "Your idea"
33
37
 
34
38
  # Or install globally
35
39
  npm install -g ultra-dex
36
- ultra-dex init
40
+ ultra-dex generate "Your idea"
37
41
  ```
38
42
 
39
- ## Usage
43
+ ## AI Commands (v2.0+)
40
44
 
41
- ### Initialize a new project
45
+ ### `generate` - AI Plan Generation
46
+
47
+ Generate a complete implementation plan using AI:
42
48
 
43
49
  ```bash
44
- npx ultra-dex init
50
+ # Basic usage
51
+ npx ultra-dex generate "A booking platform for dog groomers"
52
+
53
+ # With options
54
+ npx ultra-dex generate "idea" --provider openai --output ./my-project
55
+
56
+ # Preview without calling AI
57
+ npx ultra-dex generate "idea" --dry-run
45
58
  ```
46
59
 
47
- This will:
48
- 1. Ask you about your SaaS idea
49
- 2. Gather tech stack preferences
50
- 3. Create starter files:
51
- - `QUICK-START.md` - Pre-filled with your answers
52
- - `CONTEXT.md` - Project context for AI agents
53
- - `IMPLEMENTATION-PLAN.md` - Links to full resources
60
+ **Options:**
61
+ | Option | Description | Default |
62
+ |--------|-------------|---------|
63
+ | `-p, --provider` | AI provider (claude, openai, gemini) | claude |
64
+ | `-m, --model` | Specific model to use | provider default |
65
+ | `-o, --output` | Output directory | current |
66
+ | `-k, --key` | API key | env variable |
67
+ | `--dry-run` | Show structure only | false |
68
+
69
+ ### `build` - AI-Assisted Development
54
70
 
55
- ### List examples
71
+ Start development with AI agents:
56
72
 
57
73
  ```bash
58
- npx ultra-dex examples
74
+ # Interactive agent selection
75
+ npx ultra-dex build
76
+
77
+ # Specific agent
78
+ npx ultra-dex build --agent backend --task "Create user API endpoints"
79
+
80
+ # Copy to clipboard for external AI
81
+ npx ultra-dex build --agent planner --copy
59
82
  ```
60
83
 
61
- Shows links to fully filled Ultra-Dex examples:
62
- - TaskFlow (Task Management)
63
- - InvoiceFlow (Invoicing)
64
- - HabitStack (Habit Tracking)
84
+ **Available Agents:**
85
+ | Agent | Role |
86
+ |-------|------|
87
+ | `planner` | Break down features into atomic tasks |
88
+ | `cto` | Architecture decisions |
89
+ | `backend` | API endpoints and business logic |
90
+ | `frontend` | UI components and pages |
91
+ | `database` | Schema design and migrations |
92
+ | `auth` | Authentication and authorization |
93
+ | `security` | Security audit |
94
+ | `testing` | Write and run tests |
95
+ | `reviewer` | Code review |
96
+ | `devops` | Deployment and CI/CD |
65
97
 
66
- ### Audit your project
98
+ ### `review` - Code Review
99
+
100
+ Check code alignment with plan:
67
101
 
68
102
  ```bash
69
- npx ultra-dex audit
103
+ npx ultra-dex review
104
+ npx ultra-dex review --dir ./src
70
105
  ```
71
106
 
72
- Checks your project for completeness:
73
- - Required files (QUICK-START.md, CONTEXT.md, etc.)
74
- - Key sections (idea, problem, MVP, tech stack)
75
- - Implementation details (database, API, auth)
107
+ ### `align` - Quick Score
76
108
 
77
- Outputs a score and grade (A-F) with suggestions.
109
+ Get alignment score instantly:
78
110
 
79
- ### List AI agents
111
+ ```bash
112
+ npx ultra-dex align
113
+ npx ultra-dex align --json # Machine-readable output
114
+ ```
80
115
 
116
+ **Environment Variables:**
81
117
  ```bash
82
- npx ultra-dex agents
118
+ ANTHROPIC_API_KEY=sk-ant-... # Claude (recommended)
119
+ OPENAI_API_KEY=sk-... # OpenAI
120
+ GOOGLE_AI_KEY=... # Gemini
83
121
  ```
84
122
 
85
- Shows available AI agent prompts:
86
- - CTO, Backend, Frontend, Database
87
- - Auth, DevOps, Reviewer, Debugger, Planner
123
+ ### `init`
88
124
 
89
- ### Get agent prompt
125
+ Interactive project setup:
90
126
 
91
127
  ```bash
92
- npx ultra-dex agent backend
128
+ npx ultra-dex init
93
129
  ```
94
130
 
95
- Prints the full agent prompt. Copy and paste into your AI tool (Cursor, Claude, ChatGPT).
96
-
97
- ### Set up git hooks
131
+ Generate a runnable scaffold:
98
132
 
99
133
  ```bash
100
- npx ultra-dex hooks
134
+ npx ultra-dex init --live --stack next15-prisma-clerk
101
135
  ```
102
136
 
103
- Installs a pre-commit hook that:
104
- - Validates project structure before each commit
105
- - Blocks commits if required files are missing
106
- - Can be bypassed with `git commit --no-verify`
137
+ Presets: `next15-prisma-clerk`, `remix-supabase`, `sveltekit-drizzle`.
107
138
 
108
- Remove with: `npx ultra-dex hooks --remove`
139
+ ### `audit`
109
140
 
110
- ### Fetch assets for offline use
141
+ Check project completeness:
111
142
 
112
143
  ```bash
113
- npx ultra-dex fetch
144
+ npx ultra-dex audit
114
145
  ```
115
146
 
116
- Downloads all Ultra-Dex assets locally for offline development:
117
- - Cursor rules (12 .mdc files)
118
- - Agent prompts (16 agents)
119
- - Documentation and guides
147
+ ### `agents`
120
148
 
121
- Options:
122
- - `--dir <path>` - Target directory (default: `.ultra-dex`)
123
- - `--agents` - Fetch only agent prompts
124
- - `--rules` - Fetch only cursor rules
125
- - `--docs` - Fetch only documentation
149
+ List and use AI agent prompts:
126
150
 
127
- After fetching, copy to your project:
128
151
  ```bash
129
- cp -r .ultra-dex/cursor-rules .cursor/rules
130
- cp -r .ultra-dex/agents .agents
152
+ npx ultra-dex agents # List all agents
153
+ npx ultra-dex agent backend # Show specific agent
154
+ npx ultra-dex pack backend # Package context + agent
131
155
  ```
132
156
 
133
- ### Serve context (MCP-compatible)
157
+ ### `fetch`
158
+
159
+ Download assets for offline use:
134
160
 
135
161
  ```bash
136
- npx ultra-dex serve --port 3001
162
+ npx ultra-dex fetch
163
+ npx ultra-dex fetch --agents --rules
137
164
  ```
138
165
 
139
- Endpoints:
140
- - `GET /` health check
141
- - `GET /context` returns CONTEXT.md, IMPLEMENTATION-PLAN.md, QUICK-START.md
166
+ ### `sync`
142
167
 
143
- ## Commands
168
+ Auto-update CONTEXT.md with a codebase snapshot:
169
+
170
+ ```bash
171
+ npx ultra-dex sync
172
+ ```
173
+
174
+ ### Other Commands
144
175
 
145
176
  | Command | Description |
146
177
  |---------|-------------|
147
- | `ultra-dex init` | Initialize a new project |
148
- | `ultra-dex init --preview` | Preview files without creating them |
149
- | `ultra-dex audit` | Audit project for completeness |
150
- | `ultra-dex examples` | List available examples |
151
- | `ultra-dex agents` | List available AI agents |
152
- | `ultra-dex agent <name>` | Show specific agent prompt |
153
- | `ultra-dex pack <agent>` | Package context + agent for any AI |
154
- | `ultra-dex hooks` | Set up git pre-commit hooks |
155
- | `ultra-dex fetch` | Download assets for offline use |
156
- | `ultra-dex serve` | Serve context over HTTP |
157
- | `ultra-dex validate` | Validate project structure |
158
- | `ultra-dex workflow <feature>` | Show workflow for a feature |
159
- | `ultra-dex suggest` | Get AI agent suggestions |
160
- | `ultra-dex --help` | Show help |
161
- | `ultra-dex --version` | Show version |
162
-
163
- ## Options
164
-
165
- ### init
166
-
167
- | Option | Description |
168
- |--------|-------------|
169
- | `-n, --name <name>` | Project name (skips prompt) |
170
- | `-d, --dir <directory>` | Output directory (default: current) |
171
-
172
- ### audit
173
-
174
- | Option | Description |
175
- |--------|-------------|
176
- | `-d, --dir <directory>` | Directory to audit (default: current) |
177
-
178
- ## Example
178
+ | `init` | Initialize a new project |
179
+ | `init --preview` | Preview files without creating them |
180
+ | `init --live` | Generate a runnable scaffold |
181
+ | `audit` | Audit project for completeness |
182
+ | `examples` | List available examples |
183
+ | `agents` | List AI agents |
184
+ | `agent <name>` | Show specific agent prompt |
185
+ | `pack <agent>` | Package context + agent |
186
+ | `hooks` | Set up git pre-commit hooks |
187
+ | `fetch` | Download assets for offline |
188
+ | `serve` | Serve context over HTTP |
189
+ | `sync` | Auto-sync CONTEXT.md |
190
+ | `validate` | Validate project structure |
191
+ | `workflow <feature>` | Show workflow for a feature |
192
+ | `suggest` | Get AI agent suggestions |
193
+ | `--help` | Show help |
194
+ | `--version` | Show version |
195
+
196
+ ## Example: AI Generation
179
197
 
180
198
  ```bash
181
- $ npx ultra-dex init
182
-
183
- ╔═══════════════════════════════════════════════════════════╗
184
- ║ ULTRA-DEX ║
185
- ║ From Idea to Production-Ready SaaS ║
186
- ╚═══════════════════════════════════════════════════════════╝
187
-
188
- Welcome to Ultra-Dex! Let's plan your SaaS.
189
-
190
- ? What's your project name? my-saas
191
- ? What are you building? A booking platform for dog groomers
192
- ? Who is it for? Independent dog grooming businesses
193
- ? Problem #1 you're solving: Manual booking via phone is time-consuming
194
- ? Problem #2 you're solving: No-shows cost money
195
- ? Problem #3 you're solving: No online presence
196
- ? Most important MVP feature: Online booking calendar
197
- ? Frontend framework: Next.js
198
- ? Database: PostgreSQL
199
- ? Authentication: NextAuth
200
- ? Payments: Stripe
201
- ? Hosting: Vercel
202
-
203
- Project created successfully!
204
-
205
- Files created:
206
- my-saas/
207
- ├── QUICK-START.md
208
- ├── CONTEXT.md
209
- ├── IMPLEMENTATION-PLAN.md
210
- ├── .cursor/rules/ (11 AI rule files)
211
- └── .agents/ (9 AI agent prompts)
199
+ $ npx ultra-dex generate "A booking platform for dog groomers"
200
+
201
+ 🚀 Ultra-Dex AI Plan Generator
202
+
203
+ AI modules loaded
204
+
205
+ 📝 Idea: "A booking platform for dog groomers"
206
+
207
+ ✓ Using Claude (Anthropic) (claude-sonnet-4-20250514)
208
+
209
+ 📊 Estimated Generation:
210
+ Input tokens: ~2,650
211
+ Output tokens: ~40,000
212
+ Estimated cost: ~$0.45
213
+
214
+ ? Proceed with generation? Yes
215
+
216
+ Generating 34-section implementation plan...
217
+
218
+ Generation complete!
219
+
220
+ ✅ All 34 sections generated
221
+ Tokens used: 42,350 tokens (2,650 in / 39,700 out)
222
+ Actual cost: $0.52
223
+
224
+ 📦 Project: GroomBook
225
+
226
+ Created ./IMPLEMENTATION-PLAN.md
227
+ Created ./QUICK-START.md
228
+ Created ./CONTEXT.md
229
+
230
+ 🎉 Generation complete!
212
231
 
213
232
  Next steps:
214
- 1. cd my-saas
215
- 2. Open QUICK-START.md and complete it
216
- 3. Start building! 🚀
233
+ 1. Review IMPLEMENTATION-PLAN.md
234
+ 2. Customize sections as needed
235
+ 3. Start building with: npx ultra-dex init
217
236
  ```
218
237
 
219
238
  ## Links