appydave-tools 0.69.0 → 0.71.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.
- checksums.yaml +4 -4
- data/.claude/commands/brainstorming-agent.md +227 -0
- data/.claude/commands/cli-test.md +251 -0
- data/.claude/commands/dev.md +234 -0
- data/.claude/commands/po.md +227 -0
- data/.claude/commands/progress.md +51 -0
- data/.claude/commands/uat.md +321 -0
- data/.rubocop.yml +11 -0
- data/AGENTS.md +43 -0
- data/CHANGELOG.md +24 -0
- data/CLAUDE.md +96 -3
- data/README.md +15 -0
- data/bin/dam +39 -7
- data/bin/jump.rb +29 -0
- data/bin/subtitle_processor.rb +54 -1
- data/bin/zsh_history.rb +846 -0
- data/docs/README.md +162 -68
- data/docs/architecture/cli/exe-bin-convention.md +434 -0
- data/docs/architecture/cli-patterns.md +631 -0
- data/docs/architecture/gpt-context/gpt-context-architecture.md +325 -0
- data/docs/architecture/gpt-context/gpt-context-implementation-guide.md +419 -0
- data/docs/architecture/gpt-context/gpt-context-vision.md +179 -0
- data/docs/architecture/testing/testing-patterns.md +762 -0
- data/docs/backlog.md +120 -0
- data/docs/cli-tests/FR-3-jump-location-tool.md +515 -0
- data/docs/dam/batch-s3-listing-requirements.md +780 -0
- data/docs/guides/tools/video-file-namer.md +400 -0
- data/docs/specs/fr-002-gpt-context-help-system.md +265 -0
- data/docs/specs/fr-003-jump-location-tool.md +779 -0
- data/docs/specs/zsh-history-tool.md +820 -0
- data/docs/uat/FR-3-jump-location-tool.md +741 -0
- data/exe/jump +11 -0
- data/exe/{subtitle_manager → subtitle_processor} +1 -1
- data/exe/zsh_history +11 -0
- data/lib/appydave/tools/configuration/openai.rb +1 -1
- data/lib/appydave/tools/dam/file_helper.rb +28 -0
- data/lib/appydave/tools/dam/project_listing.rb +220 -138
- data/lib/appydave/tools/dam/s3_operations.rb +112 -60
- data/lib/appydave/tools/dam/ssd_status.rb +226 -0
- data/lib/appydave/tools/dam/status.rb +3 -51
- data/lib/appydave/tools/jump/cli.rb +561 -0
- data/lib/appydave/tools/jump/commands/add.rb +52 -0
- data/lib/appydave/tools/jump/commands/base.rb +43 -0
- data/lib/appydave/tools/jump/commands/generate.rb +153 -0
- data/lib/appydave/tools/jump/commands/remove.rb +58 -0
- data/lib/appydave/tools/jump/commands/report.rb +214 -0
- data/lib/appydave/tools/jump/commands/update.rb +42 -0
- data/lib/appydave/tools/jump/commands/validate.rb +54 -0
- data/lib/appydave/tools/jump/config.rb +233 -0
- data/lib/appydave/tools/jump/formatters/base.rb +48 -0
- data/lib/appydave/tools/jump/formatters/json_formatter.rb +19 -0
- data/lib/appydave/tools/jump/formatters/paths_formatter.rb +21 -0
- data/lib/appydave/tools/jump/formatters/table_formatter.rb +183 -0
- data/lib/appydave/tools/jump/location.rb +134 -0
- data/lib/appydave/tools/jump/path_validator.rb +47 -0
- data/lib/appydave/tools/jump/search.rb +230 -0
- data/lib/appydave/tools/subtitle_processor/transcript.rb +51 -0
- data/lib/appydave/tools/version.rb +1 -1
- data/lib/appydave/tools/zsh_history/command.rb +37 -0
- data/lib/appydave/tools/zsh_history/config.rb +235 -0
- data/lib/appydave/tools/zsh_history/filter.rb +184 -0
- data/lib/appydave/tools/zsh_history/formatter.rb +75 -0
- data/lib/appydave/tools/zsh_history/parser.rb +101 -0
- data/lib/appydave/tools.rb +25 -0
- data/package.json +1 -1
- metadata +53 -4
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
# VideoFileNamer - Filename Generation Tool
|
|
2
|
+
|
|
3
|
+
> **Web-based utility for generating structured video segment filenames** following the FliVideo naming convention.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📋 Overview
|
|
8
|
+
|
|
9
|
+
**App Name**: VideoFileNamer
|
|
10
|
+
**Type**: Web Application (Replit)
|
|
11
|
+
**Purpose**: Generate structured filenames for video recording segments with clipboard management
|
|
12
|
+
**Target Users**: Content creators, video producers, YouTubers
|
|
13
|
+
**Database**: ReplDB
|
|
14
|
+
|
|
15
|
+
### Important Clarification
|
|
16
|
+
|
|
17
|
+
⚠️ **This application does NOT rename or modify actual files on your system.** It is purely a filename generator that:
|
|
18
|
+
- Creates structured filenames following conventions
|
|
19
|
+
- Copies filenames to your clipboard
|
|
20
|
+
- You manually rename files in your file manager
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 🎯 Core Features
|
|
25
|
+
|
|
26
|
+
### 1. Automatic Filename Generation
|
|
27
|
+
|
|
28
|
+
Generates filenames using a standardized format compatible with **FliVideo naming conventions**:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
[chapter]-[part]-[label]-[metadata?].mov
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Format Components:**
|
|
35
|
+
- **Chapter**: Sequential number (1, 2, 3, etc.) - auto-incremented
|
|
36
|
+
- **Part**: Part number within chapter (1, 2, 3, etc.) - resets on new chapter
|
|
37
|
+
- **Label**: Chapter name/description (intro, content, outro, etc.)
|
|
38
|
+
- **Metadata** (Optional): Additional tags (cta, endcards, etc.)
|
|
39
|
+
|
|
40
|
+
### 2. Real-Time Filename Preview
|
|
41
|
+
|
|
42
|
+
- Read-only column shows generated filename as you type
|
|
43
|
+
- Updates instantly when you modify chapter, part, label, or metadata
|
|
44
|
+
- Visual feedback for filename generation
|
|
45
|
+
|
|
46
|
+
### 3. Clipboard Integration
|
|
47
|
+
|
|
48
|
+
- Copy individual filenames to clipboard with one click
|
|
49
|
+
- Auto-clipboard option: Automatically copy filenames to clipboard after you finish typing
|
|
50
|
+
- Clipboard actions are logged for debugging
|
|
51
|
+
|
|
52
|
+
### 4. Smart Row Management
|
|
53
|
+
|
|
54
|
+
- **Next Chapter**: Adds new row with chapter incremented, part reset to 1
|
|
55
|
+
- **Next Part**: Adds new row with same chapter, part incremented
|
|
56
|
+
- Preserves labels when adding new parts in same chapter
|
|
57
|
+
- Prevents manual data entry redundancy
|
|
58
|
+
|
|
59
|
+
### 5. Data Persistence
|
|
60
|
+
|
|
61
|
+
- Stores generated filenames and metadata in ReplDB
|
|
62
|
+
- Retrieve history of previously generated names
|
|
63
|
+
- Track transcript text alongside filenames
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 🎬 Filename Format & Examples
|
|
68
|
+
|
|
69
|
+
### Default Structure
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
[chapter number]-[part number]-[label].mov
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### With Metadata
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
[chapter number]-[part number]-[label]-[metadata].mov
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Examples
|
|
82
|
+
|
|
83
|
+
| Input | Output |
|
|
84
|
+
|-------|--------|
|
|
85
|
+
| Chapter: 1, Part: 1, Label: intro | `1-1-intro.mov` |
|
|
86
|
+
| Chapter: 1, Part: 2, Label: intro | `1-2-intro.mov` |
|
|
87
|
+
| Chapter: 2, Part: 1, Label: content | `2-1-content.mov` |
|
|
88
|
+
| Chapter: 2, Part: 1, Label: content, Metadata: cta | `2-1-content-cta.mov` |
|
|
89
|
+
| Chapter: 3, Part: 2, Label: outro, Metadata: endcards | `3-2-outro-endcards.mov` |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 🖥️ User Interface & Workflow
|
|
94
|
+
|
|
95
|
+
### Initial Load
|
|
96
|
+
|
|
97
|
+
- Empty table displayed on startup
|
|
98
|
+
- One pre-filled row created automatically:
|
|
99
|
+
- Chapter: 1
|
|
100
|
+
- Part: 1
|
|
101
|
+
- Label: (empty - user fills in)
|
|
102
|
+
|
|
103
|
+
### Typical Workflow
|
|
104
|
+
|
|
105
|
+
1. **View default row**: Table shows one empty row (1-1)
|
|
106
|
+
2. **Enter label**: Type label name (e.g., "intro")
|
|
107
|
+
3. **See filename update**: Read-only column shows `1-1-intro.mov`
|
|
108
|
+
4. **Copy filename**: Click copy button or enable auto-clipboard
|
|
109
|
+
5. **Add more segments**: Use "Next Part" to add 1-2, "Next Chapter" to add 2-1
|
|
110
|
+
6. **Continue workflow**: Repeat for each segment
|
|
111
|
+
|
|
112
|
+
### UI Elements
|
|
113
|
+
|
|
114
|
+
#### Input Fields (Per Row)
|
|
115
|
+
- **Chapter**: Numeric input (auto-incremented via buttons)
|
|
116
|
+
- **Part**: Numeric input (auto-incremented via buttons)
|
|
117
|
+
- **Label**: Text input (chapter name/description)
|
|
118
|
+
- **Metadata**: Text input (optional tags)
|
|
119
|
+
|
|
120
|
+
#### Output Column
|
|
121
|
+
- **Filename**: Read-only display of generated name
|
|
122
|
+
- **Copy Button**: One-click clipboard copy
|
|
123
|
+
|
|
124
|
+
#### Control Buttons
|
|
125
|
+
- **Next Chapter**: Increment chapter, reset part to 1, add new row
|
|
126
|
+
- **Next Part**: Increment part, keep chapter, add new row
|
|
127
|
+
- **Auto-Clipboard Checkbox**: Toggle auto-copy functionality
|
|
128
|
+
|
|
129
|
+
#### Additional Controls
|
|
130
|
+
- **Delete Row**: Remove row from table
|
|
131
|
+
- **Clear All**: Start fresh
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## ⚙️ Technical Specifications
|
|
136
|
+
|
|
137
|
+
### Filename Generation Algorithm
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
1. Validate inputs (chapter, part, label not empty)
|
|
141
|
+
2. Format chapter as integer (1, 2, 3... not 01, 02, 03)
|
|
142
|
+
3. Format part as integer (1, 2, 3... not 01, 02, 03)
|
|
143
|
+
4. Combine: "{chapter}-{part}-{label}"
|
|
144
|
+
5. Append metadata if provided: "{chapter}-{part}-{label}-{metadata}"
|
|
145
|
+
6. Append extension: "{chapter}-{part}-{label}-{metadata}.mov"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Auto-Increment Logic
|
|
149
|
+
|
|
150
|
+
**Next Chapter Button:**
|
|
151
|
+
- Chapter: current_chapter + 1
|
|
152
|
+
- Part: reset to 1
|
|
153
|
+
- Label: prompt user for new chapter name
|
|
154
|
+
- Create new row with these values
|
|
155
|
+
|
|
156
|
+
**Next Part Button:**
|
|
157
|
+
- Chapter: keep same
|
|
158
|
+
- Part: current_part + 1
|
|
159
|
+
- Label: preserve from previous row
|
|
160
|
+
- Create new row with these values
|
|
161
|
+
|
|
162
|
+
### Debouncing
|
|
163
|
+
|
|
164
|
+
- API calls debounced to 1 second after user stops typing
|
|
165
|
+
- Prevents excessive database operations
|
|
166
|
+
- Smooth typing experience without lag
|
|
167
|
+
|
|
168
|
+
### Auto-Clipboard
|
|
169
|
+
|
|
170
|
+
- Triggered 1 second after user finishes editing
|
|
171
|
+
- Only copies when auto-clipboard is enabled
|
|
172
|
+
- Shows toast notification: "Filename copied to clipboard"
|
|
173
|
+
- Logged for debugging
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 📊 Data Structure
|
|
178
|
+
|
|
179
|
+
### File Entry
|
|
180
|
+
|
|
181
|
+
```json
|
|
182
|
+
{
|
|
183
|
+
"id": "unique-identifier",
|
|
184
|
+
"chapter": 1,
|
|
185
|
+
"part": 1,
|
|
186
|
+
"label": "intro",
|
|
187
|
+
"metadata": ["cta"],
|
|
188
|
+
"filename": "1-1-intro-cta.mov",
|
|
189
|
+
"transcript": "Optional transcript text...",
|
|
190
|
+
"createdAt": "2024-11-25T10:30:00Z",
|
|
191
|
+
"updatedAt": "2024-11-25T10:30:00Z"
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Database Storage (ReplDB)
|
|
196
|
+
|
|
197
|
+
- **Filenames Table**: Stores all generated filename entries
|
|
198
|
+
- **Metadata Table**: Optional - stores transcript and additional context
|
|
199
|
+
- **History**: Full edit history maintained for reference
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 🔍 Input Validation
|
|
204
|
+
|
|
205
|
+
### Required Fields
|
|
206
|
+
- ✅ **Chapter**: Must be numeric, > 0
|
|
207
|
+
- ✅ **Part**: Must be numeric, > 0
|
|
208
|
+
- ✅ **Label**: Must not be empty
|
|
209
|
+
|
|
210
|
+
### Optional Fields
|
|
211
|
+
- ⭕ **Metadata**: Optional, can contain multiple comma-separated tags
|
|
212
|
+
|
|
213
|
+
### Error Handling
|
|
214
|
+
|
|
215
|
+
**Display descriptive errors:**
|
|
216
|
+
- "Chapter must be a number greater than 0"
|
|
217
|
+
- "Label cannot be empty"
|
|
218
|
+
- "Database connection error - please try again"
|
|
219
|
+
- "Clipboard copy failed - try again manually"
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 📝 Logging & Debugging
|
|
224
|
+
|
|
225
|
+
### Logged Events
|
|
226
|
+
|
|
227
|
+
**Input Changes:**
|
|
228
|
+
```
|
|
229
|
+
[LOG] Chapter changed: 1 → 2
|
|
230
|
+
[LOG] Part changed: 1 → 2
|
|
231
|
+
[LOG] Label changed: "" → "intro"
|
|
232
|
+
[LOG] Metadata changed: "" → "cta"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Filename Generation:**
|
|
236
|
+
```
|
|
237
|
+
[LOG] Filename generated: 1-1-intro.mov
|
|
238
|
+
[LOG] Filename updated: 1-1-intro.mov → 1-1-intro-cta.mov
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Clipboard Actions:**
|
|
242
|
+
```
|
|
243
|
+
[LOG] Filename copied to clipboard: 1-1-intro.mov
|
|
244
|
+
[LOG] Auto-clipboard enabled: true
|
|
245
|
+
[LOG] Auto-clipboard disabled: false
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Database Operations:**
|
|
249
|
+
```
|
|
250
|
+
[LOG] Saving filename to database: 1-1-intro.mov
|
|
251
|
+
[LOG] Retrieved 12 filenames from history
|
|
252
|
+
[LOG] Database error: Connection timeout
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Browser Console
|
|
256
|
+
|
|
257
|
+
- All events logged to browser console (F12 → Console tab)
|
|
258
|
+
- Timestamps included for debugging
|
|
259
|
+
- Debug information easily searchable for troubleshooting
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## 🎬 Integration with FliVideo
|
|
264
|
+
|
|
265
|
+
VideoFileNamer is a companion tool to **FliVideo** that generates segment filenames following FliVideo naming conventions:
|
|
266
|
+
|
|
267
|
+
### FliVideo Naming Standards
|
|
268
|
+
|
|
269
|
+
| Element | Format | Example |
|
|
270
|
+
|---------|--------|---------|
|
|
271
|
+
| Project Folder | `[sequence]-[project-name]` | `a27-my-video-project` |
|
|
272
|
+
| Episode Folder | `[sequence]-[episode-name]` | `01-introduction` |
|
|
273
|
+
| **Video Segment** | **`[chapter]-[part]-[label].mov`** | **`1-1-intro.mov`** ✅ |
|
|
274
|
+
| Project Structure | `/project/recordings/` | `/a27-my-video/recordings/` |
|
|
275
|
+
|
|
276
|
+
### Workflow Integration
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
Ecamm Live Recording
|
|
280
|
+
↓
|
|
281
|
+
[automatic save with date/time name]
|
|
282
|
+
↓
|
|
283
|
+
VideoFileNamer
|
|
284
|
+
[generate: 1-1-intro.mov]
|
|
285
|
+
↓
|
|
286
|
+
Manual Rename
|
|
287
|
+
[1-1-intro.mov on file system]
|
|
288
|
+
↓
|
|
289
|
+
FliVideo Project
|
|
290
|
+
[organized in recordings/ folder]
|
|
291
|
+
↓
|
|
292
|
+
Transcription & Processing
|
|
293
|
+
[FliVideo handles this automatically]
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## 🚀 Quick Start
|
|
299
|
+
|
|
300
|
+
### Access the App
|
|
301
|
+
|
|
302
|
+
1. Open Replit project: **VideoFileNamer (4)**
|
|
303
|
+
2. Start development server: `npm run dev`
|
|
304
|
+
3. Navigate to: `http://localhost:5000`
|
|
305
|
+
|
|
306
|
+
### Basic Usage
|
|
307
|
+
|
|
308
|
+
1. **First segment**:
|
|
309
|
+
- Label field shows empty, type "intro"
|
|
310
|
+
- Filename generates: `1-1-intro.mov`
|
|
311
|
+
- Click copy or enable auto-clipboard
|
|
312
|
+
|
|
313
|
+
2. **Second attempt at intro**:
|
|
314
|
+
- Click "Next Part"
|
|
315
|
+
- Filename generates: `1-2-intro.mov`
|
|
316
|
+
- Label preserved automatically
|
|
317
|
+
|
|
318
|
+
3. **Move to next chapter**:
|
|
319
|
+
- Click "Next Chapter"
|
|
320
|
+
- System prompts for new chapter name: "content"
|
|
321
|
+
- Filename generates: `2-1-content.mov`
|
|
322
|
+
|
|
323
|
+
### Common Actions
|
|
324
|
+
|
|
325
|
+
| Action | Steps |
|
|
326
|
+
|--------|-------|
|
|
327
|
+
| Copy filename | Click copy button OR enable auto-clipboard |
|
|
328
|
+
| Add video segment | Click "Next Part" (same chapter) |
|
|
329
|
+
| Start new chapter | Click "Next Chapter" (reset part) |
|
|
330
|
+
| Undo/Delete row | Click delete button on row |
|
|
331
|
+
| Clear everything | Click "Clear All" button |
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## 🔧 Troubleshooting
|
|
336
|
+
|
|
337
|
+
### Application Won't Start
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
# Check if port is in use
|
|
341
|
+
lsof -i :5000
|
|
342
|
+
|
|
343
|
+
# Kill existing process
|
|
344
|
+
pkill -f "node|tsx"
|
|
345
|
+
|
|
346
|
+
# Start fresh
|
|
347
|
+
npm run dev
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Typing Lag
|
|
351
|
+
|
|
352
|
+
- Debouncing is set to 1 second
|
|
353
|
+
- Short delay is normal while API processes
|
|
354
|
+
- Should feel responsive after debouncing implementation
|
|
355
|
+
- Check browser console (F12) for errors
|
|
356
|
+
|
|
357
|
+
### Filenames Not Saving
|
|
358
|
+
|
|
359
|
+
- Check ReplDB connection status
|
|
360
|
+
- Verify metadata fields are not empty
|
|
361
|
+
- Check browser console for database errors
|
|
362
|
+
- Try refreshing page and re-entering data
|
|
363
|
+
|
|
364
|
+
### Clipboard Copy Failed
|
|
365
|
+
|
|
366
|
+
- Some browsers restrict clipboard access
|
|
367
|
+
- Try using the copy button instead of auto-clipboard
|
|
368
|
+
- Or manually select and copy the filename text
|
|
369
|
+
- Check browser console for permission errors
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## 📦 Feature Checklist
|
|
374
|
+
|
|
375
|
+
- ✅ Automatic filename generation
|
|
376
|
+
- ✅ Real-time filename preview
|
|
377
|
+
- ✅ Chapter/part smart increment buttons
|
|
378
|
+
- ✅ Label preservation on next part
|
|
379
|
+
- ✅ Optional metadata support
|
|
380
|
+
- ✅ Clipboard copy (manual)
|
|
381
|
+
- ✅ Auto-clipboard option with debouncing
|
|
382
|
+
- ✅ ReplDB persistence
|
|
383
|
+
- ✅ Comprehensive logging
|
|
384
|
+
- ✅ Error handling and validation
|
|
385
|
+
- ✅ User-friendly UI with table layout
|
|
386
|
+
- ✅ Responsive design
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## 📖 Related Documentation
|
|
391
|
+
|
|
392
|
+
- **[FliVideo Naming Conventions](../../../architecture/dam/dam-vision.md)** - Project/episode/segment naming standards
|
|
393
|
+
- **[FliVideo Overview](../../../../../../flivideo/docs/fli-video.md)** - Complete VAM system
|
|
394
|
+
- **[DAM (Digital Asset Management)](./dam/)** - Video project organization
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
**Last Updated**: 2025-11-25
|
|
399
|
+
**Status**: Active
|
|
400
|
+
**Platform**: Replit (Web-based)
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# FR-002: GPT Context AI-Friendly Help System
|
|
2
|
+
|
|
3
|
+
**Status**: Ready for Development
|
|
4
|
+
**Priority**: High
|
|
5
|
+
**Created**: 2025-12-07
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Summary
|
|
10
|
+
|
|
11
|
+
Enhance GPT Context's help system to provide structured, comprehensive documentation suitable for AI agent consumption. Model after DAM's multi-level help architecture.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## User Story
|
|
16
|
+
|
|
17
|
+
As an AI agent using GPT Context via skills, I want structured, comprehensive help output so I can understand all options and use the tool correctly without guessing.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Current State
|
|
22
|
+
|
|
23
|
+
**GPT Context help** (`gpt_context --help`):
|
|
24
|
+
- Basic OptionParser output
|
|
25
|
+
- Lists flags with brief descriptions
|
|
26
|
+
- No examples, no detailed explanations
|
|
27
|
+
- No `--version` flag
|
|
28
|
+
|
|
29
|
+
**DAM help** (`dam help`):
|
|
30
|
+
- Multi-level: `dam help`, `dam help [topic]`
|
|
31
|
+
- Structured sections with examples
|
|
32
|
+
- Topic-specific deep dives
|
|
33
|
+
- Machine-parseable format
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Requirements
|
|
38
|
+
|
|
39
|
+
### Must Have
|
|
40
|
+
|
|
41
|
+
1. **Enhanced `--help` output** with structured sections:
|
|
42
|
+
- Synopsis (command signature)
|
|
43
|
+
- Description (what the tool does)
|
|
44
|
+
- Options (all flags with details)
|
|
45
|
+
- Output Formats (tree, content, json, aider, files)
|
|
46
|
+
- Examples (real-world usage)
|
|
47
|
+
|
|
48
|
+
2. **Each option must include**:
|
|
49
|
+
- Flag(s): `-i, --include`
|
|
50
|
+
- Description: What it does
|
|
51
|
+
- Default: Default value if any
|
|
52
|
+
- Valid values: For constrained options like `-f`
|
|
53
|
+
|
|
54
|
+
3. **Add `--version` flag**
|
|
55
|
+
- Output: `gpt_context version X.Y.Z`
|
|
56
|
+
|
|
57
|
+
4. **Real-world examples** in help output:
|
|
58
|
+
```
|
|
59
|
+
Examples:
|
|
60
|
+
# Gather Ruby library code
|
|
61
|
+
gpt_context -i 'lib/**/*.rb' -e 'spec/**/*' -d
|
|
62
|
+
|
|
63
|
+
# Project structure overview
|
|
64
|
+
gpt_context -i '**/*' -f tree -e 'node_modules/**/*'
|
|
65
|
+
|
|
66
|
+
# Generate aider command
|
|
67
|
+
gpt_context -i 'lib/**/*.rb' -f aider -p "Add logging"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Nice to Have
|
|
71
|
+
|
|
72
|
+
- `gpt_context help formats` - detailed format documentation
|
|
73
|
+
- `gpt_context help examples` - extended examples collection
|
|
74
|
+
- Markdown-formatted output option (`--help --format md`)
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Technical Implementation
|
|
79
|
+
|
|
80
|
+
### File Locations
|
|
81
|
+
|
|
82
|
+
- **CLI**: `bin/gpt_context.rb`
|
|
83
|
+
- **Options**: `lib/appydave/tools/gpt_context/options.rb`
|
|
84
|
+
- **Version**: `lib/appydave/tools/version.rb` (already exists)
|
|
85
|
+
|
|
86
|
+
### Approach
|
|
87
|
+
|
|
88
|
+
**Option A: Enhanced OptionParser** (Recommended)
|
|
89
|
+
- Keep single `--help` flag
|
|
90
|
+
- Add custom `banner` and `separator` calls for structure
|
|
91
|
+
- Add `--version` flag
|
|
92
|
+
- Simpler, maintains current architecture
|
|
93
|
+
|
|
94
|
+
**Option B: Subcommand Pattern** (Like DAM)
|
|
95
|
+
- Add `help` subcommand with topics
|
|
96
|
+
- More complex, requires CLI restructure
|
|
97
|
+
- Overkill for single-purpose tool
|
|
98
|
+
|
|
99
|
+
### Recommended: Option A
|
|
100
|
+
|
|
101
|
+
Enhance the existing OptionParser in `bin/gpt_context.rb`:
|
|
102
|
+
|
|
103
|
+
```ruby
|
|
104
|
+
# Current structure (simplified)
|
|
105
|
+
OptionParser.new do |opts|
|
|
106
|
+
opts.banner = "Usage: gpt_context [options]"
|
|
107
|
+
opts.on('-i', '--include PATTERN', 'Include pattern') { ... }
|
|
108
|
+
# etc
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Enhanced structure
|
|
112
|
+
OptionParser.new do |opts|
|
|
113
|
+
opts.banner = <<~BANNER
|
|
114
|
+
GPT Context Gatherer - Collect project files for AI context
|
|
115
|
+
|
|
116
|
+
SYNOPSIS
|
|
117
|
+
gpt_context [options]
|
|
118
|
+
|
|
119
|
+
DESCRIPTION
|
|
120
|
+
Collects and packages codebase files for AI assistant context.
|
|
121
|
+
Outputs to clipboard (default), file, or stdout.
|
|
122
|
+
|
|
123
|
+
BANNER
|
|
124
|
+
|
|
125
|
+
opts.separator ""
|
|
126
|
+
opts.separator "OPTIONS"
|
|
127
|
+
opts.separator ""
|
|
128
|
+
|
|
129
|
+
opts.on('-i', '--include PATTERN',
|
|
130
|
+
'Glob pattern for files to include (repeatable)',
|
|
131
|
+
'Example: -i "lib/**/*.rb" -i "bin/**/*.rb"') do |pattern|
|
|
132
|
+
# ...
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
opts.on('-e', '--exclude PATTERN',
|
|
136
|
+
'Glob pattern for files to exclude (repeatable)',
|
|
137
|
+
'Example: -e "spec/**/*" -e "node_modules/**/*"') do |pattern|
|
|
138
|
+
# ...
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
opts.on('-f', '--format FORMATS',
|
|
142
|
+
'Output format(s): tree, content, json, aider, files',
|
|
143
|
+
'Comma-separated. Default: content',
|
|
144
|
+
'Example: -f tree,content') do |formats|
|
|
145
|
+
# ...
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
opts.on('-o', '--output TARGET',
|
|
149
|
+
'Output target: clipboard, filename, or stdout',
|
|
150
|
+
'Default: clipboard') do |target|
|
|
151
|
+
# ...
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
opts.on('-d', '--debug', 'Enable debug output') do
|
|
155
|
+
# ...
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
opts.on('-l', '--line-limit N', Integer,
|
|
159
|
+
'Limit lines per file (default: unlimited)') do |n|
|
|
160
|
+
# ...
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
opts.on('-p', '--prompt TEXT',
|
|
164
|
+
'Prompt text for aider format') do |text|
|
|
165
|
+
# ...
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
opts.separator ""
|
|
169
|
+
opts.separator "OUTPUT FORMATS"
|
|
170
|
+
opts.separator " tree - Directory tree structure"
|
|
171
|
+
opts.separator " content - File contents with headers"
|
|
172
|
+
opts.separator " json - Structured JSON output"
|
|
173
|
+
opts.separator " aider - Aider CLI command format"
|
|
174
|
+
opts.separator " files - File paths only"
|
|
175
|
+
opts.separator ""
|
|
176
|
+
|
|
177
|
+
opts.separator "EXAMPLES"
|
|
178
|
+
opts.separator " # Gather Ruby library code for AI context"
|
|
179
|
+
opts.separator " gpt_context -i 'lib/**/*.rb' -e 'spec/**/*' -d"
|
|
180
|
+
opts.separator ""
|
|
181
|
+
opts.separator " # Project structure overview"
|
|
182
|
+
opts.separator " gpt_context -i '**/*' -f tree -e 'node_modules/**/*'"
|
|
183
|
+
opts.separator ""
|
|
184
|
+
opts.separator " # Save to file with tree and content"
|
|
185
|
+
opts.separator " gpt_context -i 'src/**/*.ts' -f tree,content -o context.txt"
|
|
186
|
+
opts.separator ""
|
|
187
|
+
opts.separator " # Generate aider command"
|
|
188
|
+
opts.separator " gpt_context -i 'lib/**/*.rb' -f aider -p 'Add logging'"
|
|
189
|
+
opts.separator ""
|
|
190
|
+
|
|
191
|
+
opts.on('-v', '--version', 'Show version') do
|
|
192
|
+
puts "gpt_context version #{Appydave::Tools::VERSION}"
|
|
193
|
+
exit
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
opts.on('-h', '--help', 'Show this help') do
|
|
197
|
+
puts opts
|
|
198
|
+
exit
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Acceptance Criteria
|
|
206
|
+
|
|
207
|
+
- [ ] `gpt_context --help` shows structured output with sections
|
|
208
|
+
- [ ] All options include description, default (if any), and examples
|
|
209
|
+
- [ ] Examples section shows 3-4 real-world use cases
|
|
210
|
+
- [ ] Output formats section explains each format
|
|
211
|
+
- [ ] `gpt_context --version` outputs version number
|
|
212
|
+
- [ ] Help output is easily parseable by AI agents (clear sections, consistent formatting)
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Testing
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
# Manual verification
|
|
220
|
+
gpt_context --help # Should show enhanced help
|
|
221
|
+
gpt_context --version # Should show version
|
|
222
|
+
gpt_context -v # Short version flag
|
|
223
|
+
|
|
224
|
+
# Verify help includes all required sections
|
|
225
|
+
gpt_context --help | grep -E "^(SYNOPSIS|DESCRIPTION|OPTIONS|OUTPUT FORMATS|EXAMPLES)"
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Add spec:
|
|
229
|
+
```ruby
|
|
230
|
+
# spec/appydave/tools/gpt_context/cli_spec.rb
|
|
231
|
+
describe 'CLI help' do
|
|
232
|
+
it 'includes synopsis section' do
|
|
233
|
+
output = `bin/gpt_context.rb --help`
|
|
234
|
+
expect(output).to include('SYNOPSIS')
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
it 'includes examples section' do
|
|
238
|
+
output = `bin/gpt_context.rb --help`
|
|
239
|
+
expect(output).to include('EXAMPLES')
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
it 'shows version' do
|
|
243
|
+
output = `bin/gpt_context.rb --version`
|
|
244
|
+
expect(output).to match(/gpt_context version \d+\.\d+\.\d+/)
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Definition of Done
|
|
252
|
+
|
|
253
|
+
1. Enhanced `--help` output with all sections
|
|
254
|
+
2. `--version` flag working
|
|
255
|
+
3. Specs pass
|
|
256
|
+
4. Manual verification complete
|
|
257
|
+
5. Commit with `kfeat "add AI-friendly help system to GPT Context"`
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Reference
|
|
262
|
+
|
|
263
|
+
- **DAM help implementation**: `bin/dam` lines 1-200 (help system)
|
|
264
|
+
- **Current GPT Context CLI**: `bin/gpt_context.rb`
|
|
265
|
+
- **GPT Context architecture**: `docs/architecture/gpt-context/`
|