ai-factory 1.0.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 +342 -0
- package/bin/ai-factory.js +3 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +73 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/update.d.ts +2 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +52 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +18 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/wizard/detector.d.ts +10 -0
- package/dist/cli/wizard/detector.d.ts.map +1 -0
- package/dist/cli/wizard/detector.js +232 -0
- package/dist/cli/wizard/detector.js.map +1 -0
- package/dist/cli/wizard/prompts.d.ts +10 -0
- package/dist/cli/wizard/prompts.d.ts.map +1 -0
- package/dist/cli/wizard/prompts.js +94 -0
- package/dist/cli/wizard/prompts.js.map +1 -0
- package/dist/core/config.d.ts +18 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +36 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/installer.d.ts +12 -0
- package/dist/core/installer.d.ts.map +1 -0
- package/dist/core/installer.js +61 -0
- package/dist/core/installer.js.map +1 -0
- package/dist/core/mcp.d.ts +8 -0
- package/dist/core/mcp.d.ts.map +1 -0
- package/dist/core/mcp.js +60 -0
- package/dist/core/mcp.js.map +1 -0
- package/dist/utils/fs.d.ts +12 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +67 -0
- package/dist/utils/fs.js.map +1 -0
- package/mcp/templates/filesystem.json +4 -0
- package/mcp/templates/github.json +7 -0
- package/mcp/templates/postgres.json +7 -0
- package/package.json +49 -0
- package/skills/_templates/nextjs/nextjs-patterns/SKILL.md +146 -0
- package/skills/_templates/node-api/api-patterns/SKILL.md +245 -0
- package/skills/_templates/php/php-patterns/SKILL.md +491 -0
- package/skills/_templates/python/python-patterns/SKILL.md +236 -0
- package/skills/_templates/react/react-patterns/SKILL.md +181 -0
- package/skills/ai-factory/SKILL.md +330 -0
- package/skills/architecture/SKILL.md +364 -0
- package/skills/best-practices/SKILL.md +253 -0
- package/skills/commit/SKILL.md +96 -0
- package/skills/deploy/SKILL.md +138 -0
- package/skills/feature/SKILL.md +187 -0
- package/skills/fix/SKILL.md +221 -0
- package/skills/implement/SKILL.md +432 -0
- package/skills/review/SKILL.md +111 -0
- package/skills/security-checklist/SKILL.md +510 -0
- package/skills/security-checklist/scripts/audit.sh +108 -0
- package/skills/skill-generator/SKILL.md +235 -0
- package/skills/skill-generator/references/BEST-PRACTICES.md +272 -0
- package/skills/skill-generator/references/EXAMPLES.md +232 -0
- package/skills/skill-generator/references/SPECIFICATION.md +115 -0
- package/skills/skill-generator/scripts/search-skills.py +98 -0
- package/skills/skill-generator/scripts/validate.sh +171 -0
- package/skills/skill-generator/templates/basic.md +45 -0
- package/skills/skill-generator/templates/dynamic-context.md +89 -0
- package/skills/skill-generator/templates/research.md +60 -0
- package/skills/skill-generator/templates/task.md +67 -0
- package/skills/skill-generator/templates/visual.md +94 -0
- package/skills/task/SKILL.md +294 -0
package/README.md
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
# AI Factory
|
|
2
|
+
|
|
3
|
+
> **Stop configuring. Start building.**
|
|
4
|
+
|
|
5
|
+
You want to build with AI, but setting up the right context, prompts, and workflows takes time. AI Factory handles all of that so you can focus on what matters — shipping quality code.
|
|
6
|
+
|
|
7
|
+
**One command. Full AI-powered development environment.**
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ai-factory init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Why AI Factory?
|
|
16
|
+
|
|
17
|
+
- **Zero configuration** — detects your stack, installs relevant skills, configures integrations
|
|
18
|
+
- **Best practices built-in** — logging, commits, code review, all following industry standards
|
|
19
|
+
- **Spec-driven development** — AI follows plans, not random exploration. Predictable, resumable, reviewable
|
|
20
|
+
- **Community skills** — leverage [skills.sh](https://skills.sh) ecosystem or generate custom skills
|
|
21
|
+
- **Works with your stack** — Next.js, Laravel, Django, Express, and more
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## What is AI Factory?
|
|
26
|
+
|
|
27
|
+
AI Factory is a CLI tool and skill system that:
|
|
28
|
+
|
|
29
|
+
1. **Analyzes your project** - detects tech stack from package.json, composer.json, requirements.txt, etc.
|
|
30
|
+
2. **Installs relevant skills** - downloads from [skills.sh](https://skills.sh) or generates custom ones
|
|
31
|
+
3. **Configures MCP servers** - GitHub, Postgres, Filesystem based on your needs
|
|
32
|
+
4. **Provides spec-driven workflow** - structured feature development with plans, tasks, and commits
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install -g ai-factory
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# In your project directory
|
|
44
|
+
ai-factory init
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
This will:
|
|
48
|
+
- Detect your project stack
|
|
49
|
+
- Ask which base skills to install
|
|
50
|
+
- Configure MCP servers (optional)
|
|
51
|
+
- Set up `.claude/skills/` directory
|
|
52
|
+
|
|
53
|
+
Then open Claude Code and start working:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
/ai-factory
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Development Workflow
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
63
|
+
│ AI FACTORY WORKFLOW │
|
|
64
|
+
└─────────────────────────────────────────────────────────────────────────┘
|
|
65
|
+
|
|
66
|
+
┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐
|
|
67
|
+
│ │ │ claude │ │ │
|
|
68
|
+
│ ai-factory │ ───▶ │ (or any AI │ ───▶ │ /ai-factory │
|
|
69
|
+
│ init │ │ agent) │ │ (setup context) │
|
|
70
|
+
│ │ │ │ │ │
|
|
71
|
+
└──────────────┘ └──────────────┘ └────────────┬─────────────┘
|
|
72
|
+
│
|
|
73
|
+
┌────────────────────────────────┼────────────────┐
|
|
74
|
+
│ │ │
|
|
75
|
+
▼ ▼ ▼
|
|
76
|
+
┌──────────────────┐ ┌─────────────────┐ ┌──────────────┐
|
|
77
|
+
│ │ │ │ │ │
|
|
78
|
+
│ /ai-factory.task │ │/ai-factory. │ │/ai-factory. │
|
|
79
|
+
│ │ │ feature │ │ fix │
|
|
80
|
+
│ Small tasks │ │ │ │ │
|
|
81
|
+
│ No git branch │ │ Full features │ │ Bug fixes │
|
|
82
|
+
│ Quick work │ │ Git branch │ │ No plans │
|
|
83
|
+
│ │ │ Full plan │ │ With logging │
|
|
84
|
+
└────────┬─────────┘ └────────┬────────┘ └──────────────┘
|
|
85
|
+
│ │ ▲
|
|
86
|
+
│ │ │
|
|
87
|
+
└───────────────┬───────────────┘ │
|
|
88
|
+
│ │
|
|
89
|
+
▼ │
|
|
90
|
+
┌─────────────────────┐ │
|
|
91
|
+
│ │ │
|
|
92
|
+
│ /ai-factory.implement│ │
|
|
93
|
+
│ │ ──── error? ───────────┘
|
|
94
|
+
│ Execute tasks │
|
|
95
|
+
│ Commit checkpoints │
|
|
96
|
+
│ │
|
|
97
|
+
└──────────┬──────────┘
|
|
98
|
+
│
|
|
99
|
+
▼
|
|
100
|
+
┌─────────────────────┐
|
|
101
|
+
│ │
|
|
102
|
+
│ /ai-factory.commit │
|
|
103
|
+
│ │
|
|
104
|
+
└──────────┬──────────┘
|
|
105
|
+
│
|
|
106
|
+
┌───────────────┴───────────────┐
|
|
107
|
+
│ │
|
|
108
|
+
▼ ▼
|
|
109
|
+
More work? Done!
|
|
110
|
+
Loop back ↑
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### When to Use What?
|
|
115
|
+
|
|
116
|
+
| Command | Use Case | Creates Branch? | Creates Plan? |
|
|
117
|
+
|---------|----------|-----------------|---------------|
|
|
118
|
+
| `/ai-factory.task` | Small tasks, quick fixes, experiments | No | `.ai-factory/PLAN.md` |
|
|
119
|
+
| `/ai-factory.feature` | Full features, stories, epics | Yes | `.ai-factory/<branch>.md` |
|
|
120
|
+
| `/ai-factory.fix` | Bug fixes, errors, hotfixes | No | No (direct fix) |
|
|
121
|
+
|
|
122
|
+
### Why Spec-Driven?
|
|
123
|
+
|
|
124
|
+
- **Predictable results** - AI follows a plan, not random exploration
|
|
125
|
+
- **Resumable sessions** - progress saved in plan files, continue anytime
|
|
126
|
+
- **Commit discipline** - structured commits at logical checkpoints
|
|
127
|
+
- **No scope creep** - AI does exactly what's in the plan, nothing more
|
|
128
|
+
|
|
129
|
+
## Core Skills
|
|
130
|
+
|
|
131
|
+
### `/ai-factory`
|
|
132
|
+
Analyzes your project and sets up context:
|
|
133
|
+
- Scans project files to detect stack
|
|
134
|
+
- Searches [skills.sh](https://skills.sh) for relevant skills
|
|
135
|
+
- Generates custom skills via `/ai-factory.skill-generator`
|
|
136
|
+
- Configures MCP servers
|
|
137
|
+
|
|
138
|
+
When called with a description:
|
|
139
|
+
```
|
|
140
|
+
/ai-factory e-commerce platform with Stripe and Next.js
|
|
141
|
+
```
|
|
142
|
+
- Creates `.ai-factory/DESCRIPTION.md` with enhanced project specification
|
|
143
|
+
- Transforms your idea into a structured, professional description
|
|
144
|
+
|
|
145
|
+
**Does NOT implement your project** - only sets up context.
|
|
146
|
+
|
|
147
|
+
### `/ai-factory.feature <description>`
|
|
148
|
+
Starts a new feature:
|
|
149
|
+
```
|
|
150
|
+
/ai-factory.feature Add user authentication with OAuth
|
|
151
|
+
```
|
|
152
|
+
- Creates git branch (`feature/user-authentication`)
|
|
153
|
+
- Asks about testing and logging preferences
|
|
154
|
+
- Creates plan file (`feature-user-authentication.md`)
|
|
155
|
+
- Invokes `/ai-factory.task` to create implementation plan
|
|
156
|
+
|
|
157
|
+
### `/ai-factory.task <description>`
|
|
158
|
+
Creates implementation plan:
|
|
159
|
+
```
|
|
160
|
+
/ai-factory.task Add product search API
|
|
161
|
+
```
|
|
162
|
+
- Analyzes requirements
|
|
163
|
+
- Explores codebase for patterns
|
|
164
|
+
- Creates tasks with dependencies
|
|
165
|
+
- Saves plan to `.ai-factory/PLAN.md` (or branch-named file)
|
|
166
|
+
- For 5+ tasks, includes commit checkpoints
|
|
167
|
+
|
|
168
|
+
### `/ai-factory.implement`
|
|
169
|
+
Executes the plan:
|
|
170
|
+
```
|
|
171
|
+
/ai-factory.implement # Continue from where you left off
|
|
172
|
+
/ai-factory.implement 5 # Start from task #5
|
|
173
|
+
/ai-factory.implement status # Check progress
|
|
174
|
+
```
|
|
175
|
+
- Finds plan file (.ai-factory/PLAN.md or branch-based)
|
|
176
|
+
- Executes tasks one by one
|
|
177
|
+
- Prompts for commits at checkpoints
|
|
178
|
+
- Offers to delete .ai-factory/PLAN.md when done
|
|
179
|
+
|
|
180
|
+
### `/ai-factory.fix <bug description>`
|
|
181
|
+
Quick bug fix without plans:
|
|
182
|
+
```
|
|
183
|
+
/ai-factory.fix TypeError: Cannot read property 'name' of undefined
|
|
184
|
+
```
|
|
185
|
+
- Investigates codebase to find root cause
|
|
186
|
+
- Applies fix WITH logging (`[FIX]` prefix for easy filtering)
|
|
187
|
+
- Suggests test coverage for the bug
|
|
188
|
+
- NO plans, NO reports - just fix and move on
|
|
189
|
+
|
|
190
|
+
### `/ai-factory.commit`
|
|
191
|
+
Creates conventional commits:
|
|
192
|
+
- Analyzes staged changes
|
|
193
|
+
- Generates meaningful commit message
|
|
194
|
+
- Follows conventional commits format
|
|
195
|
+
|
|
196
|
+
### `/ai-factory.skill-generator`
|
|
197
|
+
Generates new skills:
|
|
198
|
+
```
|
|
199
|
+
/ai-factory.skill-generator api-patterns
|
|
200
|
+
```
|
|
201
|
+
- Creates SKILL.md with proper frontmatter
|
|
202
|
+
- Follows [Agent Skills](https://agentskills.io) specification
|
|
203
|
+
- Can include references, scripts, templates
|
|
204
|
+
|
|
205
|
+
## Plan Files
|
|
206
|
+
|
|
207
|
+
AI Factory uses markdown files to track implementation plans:
|
|
208
|
+
|
|
209
|
+
| Source | Plan File | After Completion |
|
|
210
|
+
|--------|-----------|------------------|
|
|
211
|
+
| `/ai-factory.task` (direct) | `.ai-factory/PLAN.md` | Offer to delete |
|
|
212
|
+
| `/ai-factory.feature` | `.ai-factory/<branch-name>.md` | Keep (user decides) |
|
|
213
|
+
|
|
214
|
+
**Example plan file:**
|
|
215
|
+
|
|
216
|
+
```markdown
|
|
217
|
+
# Implementation Plan: User Authentication
|
|
218
|
+
|
|
219
|
+
Branch: feature/user-authentication
|
|
220
|
+
Created: 2024-01-15
|
|
221
|
+
|
|
222
|
+
## Settings
|
|
223
|
+
- Testing: no
|
|
224
|
+
- Logging: verbose
|
|
225
|
+
|
|
226
|
+
## Commit Plan
|
|
227
|
+
- **Commit 1** (tasks 1-3): "feat: add user model and types"
|
|
228
|
+
- **Commit 2** (tasks 4-6): "feat: implement auth service"
|
|
229
|
+
|
|
230
|
+
## Tasks
|
|
231
|
+
|
|
232
|
+
### Phase 1: Setup
|
|
233
|
+
- [ ] Task 1: Create User model
|
|
234
|
+
- [ ] Task 2: Add auth types
|
|
235
|
+
|
|
236
|
+
### Phase 2: Implementation
|
|
237
|
+
- [x] Task 3: Implement registration
|
|
238
|
+
- [ ] Task 4: Implement login
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## MCP Configuration
|
|
242
|
+
|
|
243
|
+
AI Factory can configure these MCP servers:
|
|
244
|
+
|
|
245
|
+
| MCP Server | Use Case | Env Variable |
|
|
246
|
+
|------------|----------|--------------|
|
|
247
|
+
| GitHub | PRs, issues, repo operations | `GITHUB_TOKEN` |
|
|
248
|
+
| Postgres | Database queries | `DATABASE_URL` |
|
|
249
|
+
| Filesystem | Advanced file operations | - |
|
|
250
|
+
|
|
251
|
+
Configuration saved to `.claude/settings.local.json` (gitignored).
|
|
252
|
+
|
|
253
|
+
## Skill Acquisition Strategy
|
|
254
|
+
|
|
255
|
+
AI Factory follows this strategy for skills:
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
For each recommended skill:
|
|
259
|
+
1. Search skills.sh: npx skills search <name>
|
|
260
|
+
2. If found → Install: npx skills install <name>
|
|
261
|
+
3. If not found → Generate: /ai-factory.skill-generator <name>
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Never reinvent existing skills** - always check skills.sh first.
|
|
265
|
+
|
|
266
|
+
## CLI Commands
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
# Initialize project
|
|
270
|
+
ai-factory init
|
|
271
|
+
|
|
272
|
+
# Update skills to latest version
|
|
273
|
+
ai-factory update
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Project Structure
|
|
277
|
+
|
|
278
|
+
After initialization:
|
|
279
|
+
|
|
280
|
+
```
|
|
281
|
+
your-project/
|
|
282
|
+
├── .claude/
|
|
283
|
+
│ ├── skills/
|
|
284
|
+
│ │ ├── ai-factory/
|
|
285
|
+
│ │ ├── feature/
|
|
286
|
+
│ │ ├── task/
|
|
287
|
+
│ │ ├── implement/
|
|
288
|
+
│ │ ├── commit/
|
|
289
|
+
│ │ ├── review/
|
|
290
|
+
│ │ └── skill-generator/
|
|
291
|
+
│ └── settings.local.json # MCP config (gitignored)
|
|
292
|
+
├── .ai-factory/ # AI Factory working directory
|
|
293
|
+
│ ├── DESCRIPTION.md # Project specification
|
|
294
|
+
│ ├── PLAN.md # Current plan (from /task)
|
|
295
|
+
│ └── feature-*.md # Feature plans (from /feature)
|
|
296
|
+
└── .ai-factory.json # AI Factory config
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## Best Practices
|
|
300
|
+
|
|
301
|
+
### Logging
|
|
302
|
+
All implementations include verbose, configurable logging:
|
|
303
|
+
- Use log levels (DEBUG, INFO, WARN, ERROR)
|
|
304
|
+
- Control via `LOG_LEVEL` environment variable
|
|
305
|
+
- Implement rotation for file-based logs
|
|
306
|
+
|
|
307
|
+
### Commits
|
|
308
|
+
- Commit checkpoints every 3-5 tasks for large features
|
|
309
|
+
- Follow conventional commits format
|
|
310
|
+
- Meaningful messages, not just "update code"
|
|
311
|
+
|
|
312
|
+
### Testing
|
|
313
|
+
- Always asked before creating plan
|
|
314
|
+
- If "no tests" - no test tasks created
|
|
315
|
+
- Never sneaks in test code
|
|
316
|
+
|
|
317
|
+
## Configuration
|
|
318
|
+
|
|
319
|
+
`.ai-factory.json`:
|
|
320
|
+
```json
|
|
321
|
+
{
|
|
322
|
+
"version": "1.0.0",
|
|
323
|
+
"agent": "claude",
|
|
324
|
+
"skillsDir": ".claude/skills",
|
|
325
|
+
"installedSkills": ["ai-factory", "feature", "task", "implement", "commit"],
|
|
326
|
+
"mcp": {
|
|
327
|
+
"github": true,
|
|
328
|
+
"postgres": false,
|
|
329
|
+
"filesystem": false
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## Links
|
|
335
|
+
|
|
336
|
+
- [skills.sh](https://skills.sh) - Skill marketplace
|
|
337
|
+
- [Agent Skills Spec](https://agentskills.io) - Skill specification
|
|
338
|
+
- [Claude Code](https://claude.ai/code) - AI coding assistant
|
|
339
|
+
|
|
340
|
+
## License
|
|
341
|
+
|
|
342
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAOA,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAgFjD"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { runWizard } from '../wizard/prompts.js';
|
|
4
|
+
import { installSkills } from '../../core/installer.js';
|
|
5
|
+
import { createDefaultConfig, saveConfig, configExists } from '../../core/config.js';
|
|
6
|
+
import { configureMcp, getMcpInstructions } from '../../core/mcp.js';
|
|
7
|
+
export async function initCommand() {
|
|
8
|
+
const projectDir = process.cwd();
|
|
9
|
+
console.log(chalk.bold.blue('\n🏭 AI Factory - Project Setup\n'));
|
|
10
|
+
if (await configExists(projectDir)) {
|
|
11
|
+
console.log(chalk.yellow('Warning: .ai-factory.json already exists.'));
|
|
12
|
+
console.log('Use "ai-factory update" to update existing skills.\n');
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
const answers = await runWizard(projectDir);
|
|
16
|
+
console.log(chalk.dim('\nInstalling skills...\n'));
|
|
17
|
+
const installedSkills = await installSkills({
|
|
18
|
+
projectDir,
|
|
19
|
+
skillsDir: answers.skillsDir,
|
|
20
|
+
skills: answers.selectedSkills,
|
|
21
|
+
stack: null, // Stack-specific skills generated by /ai-factory in Claude
|
|
22
|
+
});
|
|
23
|
+
const config = createDefaultConfig();
|
|
24
|
+
config.agent = answers.agent;
|
|
25
|
+
config.skillsDir = answers.skillsDir;
|
|
26
|
+
config.installedSkills = installedSkills;
|
|
27
|
+
config.mcp = {
|
|
28
|
+
github: answers.mcpGithub,
|
|
29
|
+
filesystem: answers.mcpFilesystem,
|
|
30
|
+
postgres: answers.mcpPostgres,
|
|
31
|
+
};
|
|
32
|
+
await saveConfig(projectDir, config);
|
|
33
|
+
console.log(chalk.green('✓ Configuration saved to .ai-factory.json'));
|
|
34
|
+
let configuredMcp = [];
|
|
35
|
+
if (answers.mcpGithub || answers.mcpFilesystem || answers.mcpPostgres) {
|
|
36
|
+
configuredMcp = await configureMcp(projectDir, {
|
|
37
|
+
github: answers.mcpGithub,
|
|
38
|
+
filesystem: answers.mcpFilesystem,
|
|
39
|
+
postgres: answers.mcpPostgres,
|
|
40
|
+
});
|
|
41
|
+
if (configuredMcp.length > 0) {
|
|
42
|
+
console.log(chalk.green(`✓ MCP servers configured: ${configuredMcp.join(', ')}`));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
console.log(chalk.bold.green('\n✅ Setup complete!\n'));
|
|
46
|
+
console.log(chalk.bold('Installed skills:'));
|
|
47
|
+
for (const skill of installedSkills) {
|
|
48
|
+
console.log(chalk.dim(` - ${skill}`));
|
|
49
|
+
}
|
|
50
|
+
console.log('');
|
|
51
|
+
console.log(chalk.dim(`Skills directory: ${path.join(projectDir, answers.skillsDir)}`));
|
|
52
|
+
if (configuredMcp.length > 0) {
|
|
53
|
+
console.log(chalk.bold('\nMCP Configuration:'));
|
|
54
|
+
const instructions = getMcpInstructions(configuredMcp);
|
|
55
|
+
for (const instruction of instructions) {
|
|
56
|
+
console.log(chalk.dim(` ${instruction}`));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
console.log(chalk.bold('\nNext steps:'));
|
|
60
|
+
console.log(chalk.dim(' 1. Open Claude Code in this directory'));
|
|
61
|
+
console.log(chalk.dim(' 2. Run /ai-factory to analyze project and generate stack-specific skills'));
|
|
62
|
+
console.log(chalk.dim(' 3. Use /ai-factory.feature to start new features, /ai-factory.commit to commit'));
|
|
63
|
+
console.log('');
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
if (error.message?.includes('User force closed')) {
|
|
67
|
+
console.log(chalk.yellow('\nSetup cancelled.'));
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,a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AC;YAC7B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;YAChD,MAAM,YAAY,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC;YACvD,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;gBACvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,WAAW,EAAE,CAAC,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC,CAAC;QAClE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,4EAA4E,CAAC,CAAC,CAAC;QACrG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kFAAkF,CAAC,CAAC,CAAC;QAC3G,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAElB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;YAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC;YAChD,OAAO;QACT,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAIA,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CA8DnD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { loadConfig, saveConfig, getCurrentVersion } from '../../core/config.js';
|
|
3
|
+
import { updateSkills, getAvailableSkills } from '../../core/installer.js';
|
|
4
|
+
export async function updateCommand() {
|
|
5
|
+
const projectDir = process.cwd();
|
|
6
|
+
console.log(chalk.bold.blue('\n🏭 AI Factory - Update Skills\n'));
|
|
7
|
+
const config = await loadConfig(projectDir);
|
|
8
|
+
if (!config) {
|
|
9
|
+
console.log(chalk.red('Error: No .ai-factory.json found.'));
|
|
10
|
+
console.log(chalk.dim('Run "ai-factory init" to set up your project first.'));
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
const currentVersion = getCurrentVersion();
|
|
14
|
+
console.log(chalk.dim(`Config version: ${config.version}`));
|
|
15
|
+
console.log(chalk.dim(`Package version: ${currentVersion}\n`));
|
|
16
|
+
// Check for new skills
|
|
17
|
+
const availableSkills = await getAvailableSkills();
|
|
18
|
+
const previousBaseSkills = config.installedSkills.filter(s => !s.includes('/'));
|
|
19
|
+
const newSkills = availableSkills.filter(s => !previousBaseSkills.includes(s));
|
|
20
|
+
if (newSkills.length > 0) {
|
|
21
|
+
console.log(chalk.cyan(`📦 New skills available: ${newSkills.join(', ')}\n`));
|
|
22
|
+
}
|
|
23
|
+
console.log(chalk.dim('Updating skills...\n'));
|
|
24
|
+
try {
|
|
25
|
+
const updatedSkills = await updateSkills(config, projectDir);
|
|
26
|
+
config.version = currentVersion;
|
|
27
|
+
config.installedSkills = updatedSkills;
|
|
28
|
+
await saveConfig(projectDir, config);
|
|
29
|
+
console.log(chalk.green('✓ Skills updated successfully'));
|
|
30
|
+
console.log(chalk.green('✓ Configuration updated'));
|
|
31
|
+
// Separate base skills and custom skills for display
|
|
32
|
+
const baseSkills = updatedSkills.filter(s => !s.includes('/'));
|
|
33
|
+
const customSkills = updatedSkills.filter(s => s.includes('/'));
|
|
34
|
+
console.log(chalk.bold('\nBase skills:'));
|
|
35
|
+
for (const skill of baseSkills) {
|
|
36
|
+
const isNew = newSkills.includes(skill);
|
|
37
|
+
console.log(chalk.dim(` - ${skill}`) + (isNew ? chalk.green(' (new)') : ''));
|
|
38
|
+
}
|
|
39
|
+
if (customSkills.length > 0) {
|
|
40
|
+
console.log(chalk.bold('\nCustom skills (preserved):'));
|
|
41
|
+
for (const skill of customSkills) {
|
|
42
|
+
console.log(chalk.dim(` - ${skill}`));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
console.log('');
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.log(chalk.red(`Error updating skills: ${error.message}`));
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE3E,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAEjC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC;IAElE,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC;IAE5C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC,CAAC;QAC9E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAE3C,OAAO,CAAC,GAAG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.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { initCommand } from './commands/init.js';
|
|
3
|
+
import { updateCommand } from './commands/update.js';
|
|
4
|
+
const program = new Command();
|
|
5
|
+
program
|
|
6
|
+
.name('ai-factory')
|
|
7
|
+
.description('CLI tool for automating Claude Code context setup')
|
|
8
|
+
.version('1.0.0');
|
|
9
|
+
program
|
|
10
|
+
.command('init')
|
|
11
|
+
.description('Initialize ai-factory in current project')
|
|
12
|
+
.action(initCommand);
|
|
13
|
+
program
|
|
14
|
+
.command('update')
|
|
15
|
+
.description('Update installed skills to latest version')
|
|
16
|
+
.action(updateCommand);
|
|
17
|
+
program.parse();
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,YAAY,CAAC;KAClB,WAAW,CAAC,mDAAmD,CAAC;KAChE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,0CAA0C,CAAC;KACvD,MAAM,CAAC,WAAW,CAAC,CAAC;AAEvB,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,2CAA2C,CAAC;KACxD,MAAM,CAAC,aAAa,CAAC,CAAC;AAEzB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface DetectedStack {
|
|
2
|
+
name: string;
|
|
3
|
+
confidence: 'high' | 'medium' | 'low';
|
|
4
|
+
frameworks: string[];
|
|
5
|
+
languages: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare function detectStack(projectDir: string): Promise<DetectedStack | null>;
|
|
8
|
+
export declare function getRecommendedSkills(stack: DetectedStack | null): string[];
|
|
9
|
+
export declare function getRecommendedTemplate(stack: DetectedStack | null): string | null;
|
|
10
|
+
//# sourceMappingURL=detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/cli/wizard/detector.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAYD,wBAAsB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA6CnF;AA2KD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,MAAM,EAAE,CAyB1E;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAmBjF"}
|