feature-architect-agent 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 +704 -0
- package/bin/feature-architect.js +2 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +63 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +125 -0
- package/dist/commands/plan.d.ts +6 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +147 -0
- package/dist/commands/verify.d.ts +2 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +101 -0
- package/dist/config/api.config.d.ts +49 -0
- package/dist/config/api.config.d.ts.map +1 -0
- package/dist/config/api.config.js +78 -0
- package/dist/llm/Claude.d.ts +8 -0
- package/dist/llm/Claude.d.ts.map +1 -0
- package/dist/llm/Claude.js +44 -0
- package/dist/llm/OpenAI.d.ts +8 -0
- package/dist/llm/OpenAI.d.ts.map +1 -0
- package/dist/llm/OpenAI.js +43 -0
- package/dist/llm/factory.d.ts +9 -0
- package/dist/llm/factory.d.ts.map +1 -0
- package/dist/llm/factory.js +36 -0
- package/dist/llm/types.d.ts +8 -0
- package/dist/llm/types.d.ts.map +1 -0
- package/dist/llm/types.js +2 -0
- package/dist/services/Analyzer.d.ts +18 -0
- package/dist/services/Analyzer.d.ts.map +1 -0
- package/dist/services/Analyzer.js +235 -0
- package/dist/services/ContextManager.d.ts +16 -0
- package/dist/services/ContextManager.d.ts.map +1 -0
- package/dist/services/ContextManager.js +82 -0
- package/dist/services/Planner.d.ts +16 -0
- package/dist/services/Planner.d.ts.map +1 -0
- package/dist/services/Planner.js +181 -0
- package/dist/services/Scanner.d.ts +17 -0
- package/dist/services/Scanner.d.ts.map +1 -0
- package/dist/services/Scanner.js +75 -0
- package/dist/types/index.d.ts +90 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/utils/logger.d.ts +22 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +56 -0
- package/package.json +48 -0
- package/src/config/api.config.ts +79 -0
package/README.md
ADDED
|
@@ -0,0 +1,704 @@
|
|
|
1
|
+
# Feature Planning Architect Agent
|
|
2
|
+
|
|
3
|
+
> **CLI-based AI agent for systematic feature planning and architecture design**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🎯 What Is It?
|
|
8
|
+
|
|
9
|
+
A command-line tool that helps developers plan new features systematically. Instead of jumping straight to coding, the agent:
|
|
10
|
+
|
|
11
|
+
1. **Analyzes your entire codebase** (one-time setup)
|
|
12
|
+
2. **Understands your architecture patterns**
|
|
13
|
+
3. **Plans new features** with complete technical specs
|
|
14
|
+
4. **Generates flow diagrams** and visual documentation
|
|
15
|
+
5. **Creates implementation context** for any AI tool to use
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 💡 Why Use It?
|
|
20
|
+
|
|
21
|
+
### The Problem
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
❌ Developer gets feature request
|
|
25
|
+
❌ Starts coding immediately
|
|
26
|
+
❌ Misses edge cases
|
|
27
|
+
❌ No database planning
|
|
28
|
+
❌ API design on the fly
|
|
29
|
+
❌ Frontend/backend mismatch
|
|
30
|
+
❌ Rework required
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### The Solution
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
✅ Developer gets feature request
|
|
37
|
+
✅ Runs: plan-feature "user profile editing"
|
|
38
|
+
✅ Agent analyzes codebase context
|
|
39
|
+
✅ Generates complete feature plan:
|
|
40
|
+
- Use cases covered
|
|
41
|
+
- Database schema
|
|
42
|
+
- API endpoints
|
|
43
|
+
- Frontend components
|
|
44
|
+
- Flow diagrams
|
|
45
|
+
✅ Developer has clear blueprint
|
|
46
|
+
✅ Implementation is smooth
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 🚀 Quick Start
|
|
52
|
+
|
|
53
|
+
### For Team Members (Published Package)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Install globally from your team's private registry
|
|
57
|
+
npm install -g @your-org/feature-architect
|
|
58
|
+
|
|
59
|
+
# Verify installation
|
|
60
|
+
feature-architect verify
|
|
61
|
+
|
|
62
|
+
# That's it! The built-in team API key handles everything.
|
|
63
|
+
# No individual API key setup needed!
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### For Developers (Local Development)
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# 1. Navigate to the agent directory
|
|
70
|
+
cd HACKATHON_FEATURE_ARCHITECT_AGENT
|
|
71
|
+
|
|
72
|
+
# 2. Install dependencies
|
|
73
|
+
npm install
|
|
74
|
+
|
|
75
|
+
# 3. Build the package
|
|
76
|
+
npm run build
|
|
77
|
+
|
|
78
|
+
# 4. Link globally (makes command available everywhere)
|
|
79
|
+
npm link
|
|
80
|
+
|
|
81
|
+
# Now you can use `feature-architect` from ANY directory!
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Verify Installation
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
feature-architect verify
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Checks for:
|
|
91
|
+
- Context file existence
|
|
92
|
+
- API key configuration (built-in or user-provided)
|
|
93
|
+
- Output directory
|
|
94
|
+
|
|
95
|
+
### API Key Configuration
|
|
96
|
+
|
|
97
|
+
**Team members using the published package:**
|
|
98
|
+
- No setup needed! The built-in team API key is included.
|
|
99
|
+
- Works out of the box after installation.
|
|
100
|
+
|
|
101
|
+
**Optional: Use your own API key:**
|
|
102
|
+
|
|
103
|
+
You can override the built-in key with your own:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Claude (Anthropic)
|
|
107
|
+
export ANTHROPIC_API_KEY=sk-ant-xxx
|
|
108
|
+
|
|
109
|
+
# OpenAI (GPT-4, etc.)
|
|
110
|
+
export OPENAI_API_KEY=sk-xxx
|
|
111
|
+
|
|
112
|
+
# Gemini (Google)
|
|
113
|
+
export GOOGLE_API_KEY=xxx
|
|
114
|
+
|
|
115
|
+
# Generic fallback
|
|
116
|
+
export AI_API_KEY=xxx
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**For persistent configuration**, add to your `~/.bashrc` or `~/.zshrc`:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
echo 'export ANTHROPIC_API_KEY=sk-ant-xxx' >> ~/.bashrc
|
|
123
|
+
source ~/.bashrc
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### One-Time Setup (Per Project)
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Navigate to your project
|
|
130
|
+
cd your-project
|
|
131
|
+
|
|
132
|
+
# Analyze your codebase (do this once)
|
|
133
|
+
feature-architect init
|
|
134
|
+
|
|
135
|
+
# This will:
|
|
136
|
+
# 1. Scan your codebase
|
|
137
|
+
# 2. Extract patterns (API routes, DB schemas, components)
|
|
138
|
+
# 3. Build context index
|
|
139
|
+
# 4. Store in .feature-architect/context.json
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Plan Your First Feature
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Plan a new feature
|
|
146
|
+
feature-architect plan "Add user profile with photo upload"
|
|
147
|
+
|
|
148
|
+
# Output: Complete feature plan saved to
|
|
149
|
+
# docs/features/user-profile-photo-upload.md
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 📦 For Team Admins: Publishing the Package
|
|
155
|
+
|
|
156
|
+
This section is for team admins who want to publish the package with built-in team API keys.
|
|
157
|
+
|
|
158
|
+
### Overview
|
|
159
|
+
|
|
160
|
+
The package includes a built-in API key so team members don't need to set up their own keys. This makes onboarding seamless - just install and use!
|
|
161
|
+
|
|
162
|
+
### Security First
|
|
163
|
+
|
|
164
|
+
⚠️ **Only publish to PRIVATE registries!**
|
|
165
|
+
- GitHub Packages (recommended)
|
|
166
|
+
- npm Private Packages
|
|
167
|
+
- Verdaccio (self-hosted)
|
|
168
|
+
- Azure Artifacts
|
|
169
|
+
- GitLab Package Registry
|
|
170
|
+
|
|
171
|
+
**DO NOT publish to public npm** with real API keys!
|
|
172
|
+
|
|
173
|
+
### Quick Publish Steps
|
|
174
|
+
|
|
175
|
+
1. **Configure the team API key** in `src/config/api.config.ts`:
|
|
176
|
+
```typescript
|
|
177
|
+
export const API_CONFIG = {
|
|
178
|
+
openai: {
|
|
179
|
+
apiKey: 'sk-your-actual-team-openai-key-here',
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
2. **Update package name** in `package.json`:
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"name": "@your-org/feature-architect"
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
3. **Build and publish**:
|
|
192
|
+
```bash
|
|
193
|
+
npm run build
|
|
194
|
+
npm publish
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Detailed Publishing Guide
|
|
198
|
+
|
|
199
|
+
See [PUBLISHING_GUIDE.md](./PUBLISHING_GUIDE.md) for:
|
|
200
|
+
- Setting up private registries (GitHub, npm, Verdaccio)
|
|
201
|
+
- Creating team API keys with usage limits
|
|
202
|
+
- Cost estimation and budget monitoring
|
|
203
|
+
- Security best practices
|
|
204
|
+
- Troubleshooting
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 📋 What It Generates
|
|
209
|
+
|
|
210
|
+
### Example Output
|
|
211
|
+
|
|
212
|
+
```markdown
|
|
213
|
+
# Feature Plan: User Profile with Photo Upload
|
|
214
|
+
|
|
215
|
+
## Overview
|
|
216
|
+
Allow users to create and manage their profiles including photo upload.
|
|
217
|
+
|
|
218
|
+
## Use Cases
|
|
219
|
+
| ID | Description | Priority |
|
|
220
|
+
|----|-------------|----------|
|
|
221
|
+
| UC1 | User can view their profile | Must Have |
|
|
222
|
+
| UC2 | User can edit profile fields | Must Have |
|
|
223
|
+
| UC3 | User can upload profile photo | Must Have |
|
|
224
|
+
| UC4 | User can delete profile photo | Should Have |
|
|
225
|
+
|
|
226
|
+
## Database Design
|
|
227
|
+
|
|
228
|
+
### New Tables
|
|
229
|
+
```sql
|
|
230
|
+
CREATE TABLE user_profiles (
|
|
231
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
232
|
+
user_id UUID NOT NULL REFERENCES users(id),
|
|
233
|
+
bio TEXT,
|
|
234
|
+
location VARCHAR(100),
|
|
235
|
+
website VARCHAR(255),
|
|
236
|
+
created_at TIMESTAMP DEFAULT NOW(),
|
|
237
|
+
updated_at TIMESTAMP DEFAULT NOW(),
|
|
238
|
+
UNIQUE(user_id)
|
|
239
|
+
);
|
|
240
|
+
|
|
241
|
+
CREATE TABLE profile_photos (
|
|
242
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
243
|
+
user_id UUID NOT NULL REFERENCES users(id),
|
|
244
|
+
storage_key VARCHAR(255) NOT NULL,
|
|
245
|
+
mime_type VARCHAR(50),
|
|
246
|
+
file_size_bytes INTEGER,
|
|
247
|
+
width INTEGER,
|
|
248
|
+
height INTEGER,
|
|
249
|
+
uploaded_at TIMESTAMP DEFAULT NOW(),
|
|
250
|
+
is_active BOOLEAN DEFAULT TRUE,
|
|
251
|
+
UNIQUE(user_id, is_active) WHERE is_active = TRUE
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
CREATE INDEX idx_profile_photos_user ON profile_photos(user_id, is_active);
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Modified Tables
|
|
258
|
+
```sql
|
|
259
|
+
-- Add to users table
|
|
260
|
+
ALTER TABLE users ADD COLUMN has_profile BOOLEAN DEFAULT FALSE;
|
|
261
|
+
ALTER TABLE users ADD COLUMN profile_photo_url VARCHAR(255);
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Backend API
|
|
265
|
+
|
|
266
|
+
### New Endpoints
|
|
267
|
+
| Method | Endpoint | Description | Auth |
|
|
268
|
+
|--------|----------|-------------|------|
|
|
269
|
+
| GET | `/api/v1/users/:id/profile` | Get user profile | Required |
|
|
270
|
+
| PUT | `/api/v1/users/:id/profile` | Update profile | Own/Admin |
|
|
271
|
+
| POST | `/api/v1/users/:id/photo` | Upload photo | Own |
|
|
272
|
+
| DELETE | `/api/v1/users/:id/photo` | Delete photo | Own |
|
|
273
|
+
|
|
274
|
+
### Request/Response Examples
|
|
275
|
+
|
|
276
|
+
#### GET /api/v1/users/:id/profile
|
|
277
|
+
```typescript
|
|
278
|
+
// Response (200)
|
|
279
|
+
interface UserProfileResponse {
|
|
280
|
+
user_id: string;
|
|
281
|
+
bio: string | null;
|
|
282
|
+
location: string | null;
|
|
283
|
+
website: string | null;
|
|
284
|
+
photo_url: string | null;
|
|
285
|
+
created_at: string;
|
|
286
|
+
updated_at: string;
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
#### PUT /api/v1/users/:id/profile
|
|
291
|
+
```typescript
|
|
292
|
+
// Request
|
|
293
|
+
interface UpdateProfileRequest {
|
|
294
|
+
bio?: string;
|
|
295
|
+
location?: string;
|
|
296
|
+
website?: string;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// Response (200)
|
|
300
|
+
interface UpdateProfileResponse {
|
|
301
|
+
success: true;
|
|
302
|
+
data: UserProfileResponse;
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## Frontend Components
|
|
307
|
+
|
|
308
|
+
### Component Structure
|
|
309
|
+
```
|
|
310
|
+
src/features/user-profile/
|
|
311
|
+
├── UserProfile.tsx # Main container
|
|
312
|
+
├── ProfileView.tsx # Display mode
|
|
313
|
+
├── ProfileEdit.tsx # Edit form
|
|
314
|
+
├── PhotoUpload.tsx # Photo upload widget
|
|
315
|
+
├── PhotoCropper.tsx # Crop functionality
|
|
316
|
+
├── hooks/
|
|
317
|
+
│ ├── useUserProfile.ts # Data fetching
|
|
318
|
+
│ └── usePhotoUpload.ts # Upload logic
|
|
319
|
+
└── types.ts # TypeScript types
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Component Specs
|
|
323
|
+
|
|
324
|
+
#### UserProfile.tsx
|
|
325
|
+
```typescript
|
|
326
|
+
interface UserProfileProps {
|
|
327
|
+
userId: string;
|
|
328
|
+
editable?: boolean;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Routes:
|
|
332
|
+
// /users/:id/profile - View mode
|
|
333
|
+
// /users/:id/profile/edit - Edit mode
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
#### PhotoUpload.tsx
|
|
337
|
+
```typescript
|
|
338
|
+
interface PhotoUploadProps {
|
|
339
|
+
userId: string;
|
|
340
|
+
currentPhoto?: string;
|
|
341
|
+
onUploadSuccess: (photoUrl: string) => void;
|
|
342
|
+
maxSize?: number; // bytes
|
|
343
|
+
allowedTypes?: string[];
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// Features:
|
|
347
|
+
// - Drag and drop
|
|
348
|
+
// - Crop before upload
|
|
349
|
+
// - Preview
|
|
350
|
+
// - Progress indicator
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
## Architecture Flow
|
|
354
|
+
|
|
355
|
+
```mermaid
|
|
356
|
+
sequenceDiagram
|
|
357
|
+
participant User
|
|
358
|
+
participant Frontend
|
|
359
|
+
participant API
|
|
360
|
+
participant DB
|
|
361
|
+
participant Storage
|
|
362
|
+
|
|
363
|
+
User->>Frontend: View Profile
|
|
364
|
+
Frontend->>API: GET /api/v1/users/:id/profile
|
|
365
|
+
API->>DB: Query user_profiles
|
|
366
|
+
DB-->>API: Profile data
|
|
367
|
+
API-->>Frontend: Profile + photo_url
|
|
368
|
+
Frontend-->>User: Display profile
|
|
369
|
+
|
|
370
|
+
User->>Frontend: Upload Photo
|
|
371
|
+
Frontend->>Storage: Upload image
|
|
372
|
+
Storage-->>Frontend: storage_key
|
|
373
|
+
Frontend->>API: POST /api/v1/users/:id/photo
|
|
374
|
+
API->>DB: Insert profile_photos
|
|
375
|
+
API->>Storage: Get signed URL
|
|
376
|
+
API-->>Frontend: photo_url
|
|
377
|
+
Frontend-->>User: Show new photo
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
## Implementation Tasks
|
|
381
|
+
|
|
382
|
+
### Phase 1: Database (1 day)
|
|
383
|
+
- [ ] Create migration for user_profiles table
|
|
384
|
+
- [ ] Create migration for profile_photos table
|
|
385
|
+
- [ ] Update users table
|
|
386
|
+
- [ ] Run migrations
|
|
387
|
+
- [ ] Seed test data
|
|
388
|
+
|
|
389
|
+
### Phase 2: Backend (2 days)
|
|
390
|
+
- [ ] Create UserProfile model
|
|
391
|
+
- [ ] Create ProfilePhoto model
|
|
392
|
+
- [ ] Implement GET /api/v1/users/:id/profile
|
|
393
|
+
- [ ] Implement PUT /api/v1/users/:id/profile
|
|
394
|
+
- [ ] Implement POST /api/v1/users/:id/photo
|
|
395
|
+
- [ ] Implement DELETE /api/v1/users/:id/photo
|
|
396
|
+
- [ ] Add file upload handling
|
|
397
|
+
- [ ] Add validation
|
|
398
|
+
- [ ] Write tests
|
|
399
|
+
|
|
400
|
+
### Phase 3: Storage Integration (1 day)
|
|
401
|
+
- [ ] Set up Azure Blob Storage
|
|
402
|
+
- [ ] Implement upload service
|
|
403
|
+
- [ ] Implement delete service
|
|
404
|
+
- [ ] Add signed URL generation
|
|
405
|
+
|
|
406
|
+
### Phase 4: Frontend (3 days)
|
|
407
|
+
- [ ] Create UserProfile component
|
|
408
|
+
- [ ] Create ProfileView component
|
|
409
|
+
- [ ] Create ProfileEdit component
|
|
410
|
+
- [ ] Create PhotoUpload component
|
|
411
|
+
- [ ] Add routing
|
|
412
|
+
- [ ] Implement hooks
|
|
413
|
+
- [ ] Add error handling
|
|
414
|
+
- [ ] Add loading states
|
|
415
|
+
|
|
416
|
+
## Dependencies
|
|
417
|
+
|
|
418
|
+
### External Services
|
|
419
|
+
- Azure Blob Storage (or S3)
|
|
420
|
+
- Image processing service (optional)
|
|
421
|
+
|
|
422
|
+
### Internal Services
|
|
423
|
+
- Existing: Auth service, User service
|
|
424
|
+
- New: Profile service, Storage service
|
|
425
|
+
|
|
426
|
+
## Edge Cases
|
|
427
|
+
|
|
428
|
+
| Case | Handling |
|
|
429
|
+
|------|----------|
|
|
430
|
+
| User uploads non-image | Validate MIME type, reject |
|
|
431
|
+
| File too large | Reject with error message |
|
|
432
|
+
| No storage space | Return 503, retry later |
|
|
433
|
+
| Concurrent photo uploads | Use last-write-wins, notify user |
|
|
434
|
+
| Profile doesn't exist | Auto-create on first view |
|
|
435
|
+
| Invalid URL in website | Validate format, store as-is |
|
|
436
|
+
|
|
437
|
+
## Testing Checklist
|
|
438
|
+
|
|
439
|
+
### Backend
|
|
440
|
+
- [ ] CRUD operations for profiles
|
|
441
|
+
- [ ] File upload limits
|
|
442
|
+
- [ ] File type validation
|
|
443
|
+
- [ ] Authorization checks
|
|
444
|
+
- [ ] Error handling
|
|
445
|
+
|
|
446
|
+
### Frontend
|
|
447
|
+
- [ ] View profile
|
|
448
|
+
- [ ] Edit profile
|
|
449
|
+
- [ ] Upload photo (valid)
|
|
450
|
+
- [ ] Upload photo (invalid type)
|
|
451
|
+
- [ ] Upload photo (too large)
|
|
452
|
+
- [ ] Delete photo
|
|
453
|
+
- [ ] Loading states
|
|
454
|
+
- [ ] Error messages
|
|
455
|
+
|
|
456
|
+
## Open Questions
|
|
457
|
+
|
|
458
|
+
1. Should we support multiple photos per user?
|
|
459
|
+
- Decision: No for MVP, single photo only
|
|
460
|
+
|
|
461
|
+
2. Max photo size?
|
|
462
|
+
- Decision: 5MB
|
|
463
|
+
|
|
464
|
+
3. Allowed formats?
|
|
465
|
+
- Decision: JPG, PNG, WEBP
|
|
466
|
+
|
|
467
|
+
4. Photo aspect ratio?
|
|
468
|
+
- Decision: Accept any, crop to 1:1 for display
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
## 🔧 How It Works
|
|
474
|
+
|
|
475
|
+
### 1. Codebase Analysis (One-Time)
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
$ feature-architect init
|
|
479
|
+
|
|
480
|
+
🔍 Analyzing codebase...
|
|
481
|
+
Scanning 245 files
|
|
482
|
+
├── 45 TypeScript files
|
|
483
|
+
├── 32 SQL files
|
|
484
|
+
├── 12 React components
|
|
485
|
+
└── 156 other files
|
|
486
|
+
|
|
487
|
+
📊 Building context index...
|
|
488
|
+
├── Detected: PostgreSQL database
|
|
489
|
+
├── Detected: Express.js API
|
|
490
|
+
├── Detected: React frontend
|
|
491
|
+
├── Detected: Azure Blob Storage
|
|
492
|
+
└── Found 23 API endpoints
|
|
493
|
+
|
|
494
|
+
💾 Storing context...
|
|
495
|
+
Vector database: ~/.feature-architect/vectors/
|
|
496
|
+
Context size: 2.3MB
|
|
497
|
+
Index time: 45 seconds
|
|
498
|
+
|
|
499
|
+
✅ Codebase analyzed and indexed!
|
|
500
|
+
You can now plan features with full context awareness.
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### 2. Feature Planning
|
|
504
|
+
|
|
505
|
+
```bash
|
|
506
|
+
$ feature-architect plan "Add user comments"
|
|
507
|
+
|
|
508
|
+
🧠 Analyzing feature request...
|
|
509
|
+
Feature: Add user comments
|
|
510
|
+
Similar features found: 3
|
|
511
|
+
Relevant code patterns: 12
|
|
512
|
+
|
|
513
|
+
📋 Generating feature plan...
|
|
514
|
+
Use cases: 5 identified
|
|
515
|
+
Database changes: 2 tables
|
|
516
|
+
API endpoints: 5 endpoints
|
|
517
|
+
Frontend components: 4 components
|
|
518
|
+
|
|
519
|
+
📊 Creating diagrams...
|
|
520
|
+
Flow diagram: Generated
|
|
521
|
+
ER diagram: Generated
|
|
522
|
+
|
|
523
|
+
💾 Saving plan...
|
|
524
|
+
Output: docs/features/user-comments.md
|
|
525
|
+
Context: docs/features/user-comments.context.json
|
|
526
|
+
|
|
527
|
+
✅ Feature plan ready!
|
|
528
|
+
View: cat docs/features/user-comments.md
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
---
|
|
532
|
+
|
|
533
|
+
## 🎯 Key Features
|
|
534
|
+
|
|
535
|
+
### AI-Provider Agnostic (Auto-Detection)
|
|
536
|
+
|
|
537
|
+
The agent automatically detects which API key is available and uses the appropriate provider. No manual selection needed!
|
|
538
|
+
|
|
539
|
+
**Priority order:**
|
|
540
|
+
1. `ANTHROPIC_API_KEY` → Claude (Anthropic)
|
|
541
|
+
2. `OPENAI_API_KEY` → OpenAI (GPT-4, etc.)
|
|
542
|
+
3. `GOOGLE_API_KEY` → Gemini
|
|
543
|
+
4. `AI_API_KEY` → Generic fallback (uses Claude)
|
|
544
|
+
|
|
545
|
+
**Force specific provider:**
|
|
546
|
+
```bash
|
|
547
|
+
# Use Claude explicitly
|
|
548
|
+
feature-architect plan "user profile" --provider claude
|
|
549
|
+
|
|
550
|
+
# Use OpenAI explicitly
|
|
551
|
+
feature-architect plan "user profile" --provider openai
|
|
552
|
+
|
|
553
|
+
# Use Gemini explicitly
|
|
554
|
+
feature-architect plan "user profile" --provider gemini
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
### Incremental Updates
|
|
558
|
+
|
|
559
|
+
```bash
|
|
560
|
+
# Re-analyze after code changes
|
|
561
|
+
feature-architect update
|
|
562
|
+
|
|
563
|
+
# See what changed
|
|
564
|
+
feature-architect diff
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
### Context Sharing
|
|
568
|
+
|
|
569
|
+
```bash
|
|
570
|
+
# Export context for team
|
|
571
|
+
feature-architect export-context --output team-context.json
|
|
572
|
+
|
|
573
|
+
# Import shared context
|
|
574
|
+
feature-architect import-context --input team-context.json
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
## 📚 Documentation
|
|
580
|
+
|
|
581
|
+
| Document | Description |
|
|
582
|
+
|----------|-------------|
|
|
583
|
+
| [INSTALLATION.md](./INSTALLATION.md) | Setup and configuration |
|
|
584
|
+
| [USAGE.md](./USAGE.md) | Command reference and workflows |
|
|
585
|
+
| [TEAM_GUIDE.md](./TEAM_GUIDE.md) | Guide for team members |
|
|
586
|
+
| [AI_PROVIDERS.md](./AI_PROVIDERS.md) | AI provider configuration |
|
|
587
|
+
| [EXAMPLES.md](./EXAMPLES.md) | Real-world examples |
|
|
588
|
+
|
|
589
|
+
---
|
|
590
|
+
|
|
591
|
+
## 🚦 Getting Started
|
|
592
|
+
|
|
593
|
+
1. **Install**: `cd HACKATHON_FEATURE_ARCHITECT_AGENT && npm install && npm run build && npm link`
|
|
594
|
+
2. **Set API Key**: `export ANTHROPIC_API_KEY=your-key-here`
|
|
595
|
+
3. **Setup**: `cd your-project && feature-architect init`
|
|
596
|
+
4. **Plan**: `feature-architect plan "your feature here"`
|
|
597
|
+
5. **Implement**: Use the generated plan as your blueprint
|
|
598
|
+
|
|
599
|
+
---
|
|
600
|
+
|
|
601
|
+
## 🤝 Team Usage
|
|
602
|
+
|
|
603
|
+
### For Team Leads
|
|
604
|
+
|
|
605
|
+
```bash
|
|
606
|
+
# Share context with team
|
|
607
|
+
cat .feature-architect/context.json > team-context.json
|
|
608
|
+
|
|
609
|
+
# Commit to repo or share via drive
|
|
610
|
+
git add team-context.json
|
|
611
|
+
git commit -m "feat: add shared context for feature planning"
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
### For Developers
|
|
615
|
+
|
|
616
|
+
```bash
|
|
617
|
+
# 1. Install globally (one-time setup)
|
|
618
|
+
cd HACKATHON_FEATURE_ARCHITECT_AGENT
|
|
619
|
+
npm install && npm run build && npm link
|
|
620
|
+
|
|
621
|
+
# 2. Set your API key (add to ~/.bashrc or ~/.zshrc)
|
|
622
|
+
export ANTHROPIC_API_KEY=your-key-here
|
|
623
|
+
|
|
624
|
+
# 3. Navigate to your project
|
|
625
|
+
cd your-project
|
|
626
|
+
|
|
627
|
+
# 4. Import team context (optional - skip if doing init)
|
|
628
|
+
mkdir -p .feature-architect
|
|
629
|
+
cp team-context.json .feature-architect/context.json
|
|
630
|
+
|
|
631
|
+
# 5. Plan features
|
|
632
|
+
feature-architect plan "my feature"
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
---
|
|
636
|
+
|
|
637
|
+
## 📊 What Makes This Different
|
|
638
|
+
|
|
639
|
+
| Traditional Approach | Feature Architect Agent |
|
|
640
|
+
|---------------------|-------------------------|
|
|
641
|
+
| Ad-hoc planning | Systematic approach |
|
|
642
|
+
| Missed edge cases | Comprehensive coverage |
|
|
643
|
+
| DB design after coding | DB design first |
|
|
644
|
+
| API design on the fly | Complete API contracts |
|
|
645
|
+
| Frontend/backend disconnect | Aligned architecture |
|
|
646
|
+
| Tribal knowledge | Documented patterns |
|
|
647
|
+
| "Just figure it out" | Clear blueprint |
|
|
648
|
+
|
|
649
|
+
---
|
|
650
|
+
|
|
651
|
+
## 🎁 Bonus Features
|
|
652
|
+
|
|
653
|
+
### Diagrams
|
|
654
|
+
|
|
655
|
+
Automatically generates:
|
|
656
|
+
- Flow diagrams (Mermaid)
|
|
657
|
+
- ER diagrams (Mermaid)
|
|
658
|
+
- Sequence diagrams
|
|
659
|
+
- Component trees
|
|
660
|
+
|
|
661
|
+
### Pattern Recognition
|
|
662
|
+
|
|
663
|
+
Learns from your codebase:
|
|
664
|
+
- API patterns
|
|
665
|
+
- Database conventions
|
|
666
|
+
- Component structure
|
|
667
|
+
- Error handling
|
|
668
|
+
- Validation patterns
|
|
669
|
+
|
|
670
|
+
### Context Generation
|
|
671
|
+
|
|
672
|
+
Creates ready-to-use context for:
|
|
673
|
+
- AI coding assistants
|
|
674
|
+
- New team members
|
|
675
|
+
- Code reviews
|
|
676
|
+
- Documentation
|
|
677
|
+
|
|
678
|
+
---
|
|
679
|
+
|
|
680
|
+
## 📖 Next Steps
|
|
681
|
+
|
|
682
|
+
1. Read [INSTALLATION.md](./INSTALLATION.md) to set up
|
|
683
|
+
2. Read [TEAM_GUIDE.md](./TEAM_GUIDE.md) for team usage
|
|
684
|
+
3. Check [EXAMPLES.md](./EXAMPLES.md) for sample outputs
|
|
685
|
+
4. Start planning your first feature!
|
|
686
|
+
|
|
687
|
+
---
|
|
688
|
+
|
|
689
|
+
## 🏆 Why This Wins
|
|
690
|
+
|
|
691
|
+
**Real problems, real solutions:**
|
|
692
|
+
|
|
693
|
+
✅ Developers actually plan before coding
|
|
694
|
+
✅ Consistent architecture across features
|
|
695
|
+
✅ Faster onboarding for new devs
|
|
696
|
+
✅ Better documentation
|
|
697
|
+
✅ Fewer bugs and rework
|
|
698
|
+
✅ AI-tool agnostic (use what you want)
|
|
699
|
+
|
|
700
|
+
**Built for teams:**
|
|
701
|
+
✅ CLI-based (works everywhere)
|
|
702
|
+
✅ Shareable context
|
|
703
|
+
✅ Version controlled plans
|
|
704
|
+
✅ Works with any AI provider
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|