appydave-tools 0.15.0 → 0.16.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/CHANGELOG.md +7 -0
- data/CLAUDE.md +113 -29
- data/README.md +262 -86
- data/bin/subtitle_manager.rb +18 -12
- data/bin/subtitle_processor.rb +158 -0
- data/docs/archive/codebase-audit-2025-01.md +424 -0
- data/docs/archive/documentation-framework-proposal.md +808 -0
- data/docs/archive/purpose-and-philosophy.md +110 -0
- data/docs/archive/test-coverage-quick-wins.md +342 -0
- data/docs/archive/tool-discovery.md +199 -0
- data/docs/archive/tool-documentation-analysis.md +592 -0
- data/docs/tools/bank-reconciliation.md +269 -0
- data/docs/tools/cli-actions.md +444 -0
- data/docs/tools/configuration.md +329 -0
- data/docs/{usage → tools}/gpt-context.md +118 -7
- data/docs/tools/index.md +324 -0
- data/docs/tools/move-images.md +295 -0
- data/docs/tools/name-manager.md +322 -0
- data/docs/tools/prompt-tools.md +209 -0
- data/docs/tools/subtitle-processor.md +242 -0
- data/docs/tools/youtube-automation.md +258 -0
- data/docs/tools/youtube-manager.md +248 -0
- data/lib/appydave/tools/{subtitle_manager → subtitle_processor}/clean.rb +1 -1
- data/lib/appydave/tools/{subtitle_manager → subtitle_processor}/join.rb +5 -2
- data/lib/appydave/tools/version.rb +1 -1
- data/lib/appydave/tools.rb +2 -4
- data/package.json +1 -1
- metadata +29 -12
- data/lib/mj-paste-test/main.rb +0 -35
- data/lib/mj-paste-test/prompts.txt +0 -18
- data/lib/mj-paste-test/readme-leonardo.md +0 -0
- /data/lib/appydave/tools/{subtitle_manager → subtitle_processor}/_doc-clean.md +0 -0
- /data/lib/appydave/tools/{subtitle_manager → subtitle_processor}/_doc-join.md +0 -0
- /data/lib/appydave/tools/{subtitle_manager → subtitle_processor}/_doc-todo.md +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# AppyDave Tools - Purpose & Philosophy
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
**AppyDave Tools** is a consolidated productivity toolkit built for AppyDave's YouTube content creation workflow. All utilities live in one repository for easier maintenance compared to managing separate codebases.
|
|
6
|
+
|
|
7
|
+
## Philosophy
|
|
8
|
+
|
|
9
|
+
### Consolidated Toolkit
|
|
10
|
+
- **One repository** - All tools in single codebase for easier management
|
|
11
|
+
- **YouTube workflow focus** - Built specifically for content creator productivity
|
|
12
|
+
- **Single-purpose utilities** - Each tool solves one specific problem
|
|
13
|
+
- **Independent operation** - Tools work standalone, no forced dependencies
|
|
14
|
+
- **Shareable individually** - Individual tools can be featured in standalone videos
|
|
15
|
+
|
|
16
|
+
### AppyDave Context
|
|
17
|
+
- Built for AppyDave's specific workflows and needs
|
|
18
|
+
- Published publicly as part of AppyDave's knowledge sharing
|
|
19
|
+
- Tools demonstrate productivity techniques for YouTube creators
|
|
20
|
+
- Language-agnostic approach (currently Ruby, could be rewritten if needed)
|
|
21
|
+
|
|
22
|
+
### Practical Implementation
|
|
23
|
+
- Solve real workflow problems quickly
|
|
24
|
+
- Iterate based on actual YouTube production usage
|
|
25
|
+
- Simple, working implementations
|
|
26
|
+
- Documentation reflects real content creation scenarios
|
|
27
|
+
|
|
28
|
+
## Tool Categories
|
|
29
|
+
|
|
30
|
+
### AI & Context Management
|
|
31
|
+
- **GPT Context Gatherer** - Collect project files for AI context analysis
|
|
32
|
+
- **Prompt Tools** - AI prompt completion workflows
|
|
33
|
+
|
|
34
|
+
### Content & Media
|
|
35
|
+
- **Subtitle Manager** - Process and join SRT subtitle files
|
|
36
|
+
- **YouTube Manager** - Manage YouTube video metadata via API
|
|
37
|
+
- **YouTube Automation** - Automated YouTube workflows with GPT agents
|
|
38
|
+
- **Move Images** - Organize downloaded images into project folders
|
|
39
|
+
|
|
40
|
+
### Configuration
|
|
41
|
+
- **Configuration Tool** - Manage multi-channel and project configurations
|
|
42
|
+
|
|
43
|
+
## Design Principles
|
|
44
|
+
|
|
45
|
+
1. **CLI-First** - Command-line tools for speed and scriptability
|
|
46
|
+
2. **Single-Purpose** - Each tool does one thing well
|
|
47
|
+
3. **Independent** - No forced dependencies between tools
|
|
48
|
+
4. **Documented** - Clear examples for real-world usage
|
|
49
|
+
5. **Open Source** - MIT licensed for community benefit
|
|
50
|
+
|
|
51
|
+
## Integration Options
|
|
52
|
+
|
|
53
|
+
### Claude Code Integration
|
|
54
|
+
- Future: Claude skill interface to access tools directly
|
|
55
|
+
- Current: Standard CLI usage from terminal
|
|
56
|
+
|
|
57
|
+
### Sharing with Other Projects
|
|
58
|
+
When sharing these tools, three key paths to reference:
|
|
59
|
+
1. **Project root** - `/Users/davidcruwys/dev/ad/appydave-tools/`
|
|
60
|
+
2. **Tools directory** - `/Users/davidcruwys/dev/ad/appydave-tools/bin/`
|
|
61
|
+
3. **Documentation** - `/Users/davidcruwys/dev/ad/appydave-tools/docs/`
|
|
62
|
+
|
|
63
|
+
## Repository Strategy
|
|
64
|
+
|
|
65
|
+
### Why One Codebase?
|
|
66
|
+
- **Easier maintenance** - Single repo vs managing multiple separate repos
|
|
67
|
+
- **Version control** - Already established with semantic-release
|
|
68
|
+
- **Shared infrastructure** - Common testing, linting, CI/CD
|
|
69
|
+
- **Cohesive documentation** - All tools documented together
|
|
70
|
+
|
|
71
|
+
### Language Flexibility
|
|
72
|
+
- Currently implemented in Ruby
|
|
73
|
+
- Not tied to Ruby as identity - could be rewritten in another language
|
|
74
|
+
- Implementation language is a practical choice, not a constraint
|
|
75
|
+
|
|
76
|
+
## Use Cases
|
|
77
|
+
|
|
78
|
+
Primary use case is **AppyDave's YouTube workflow**, including:
|
|
79
|
+
- **Developers** - Gathering code context for AI assistants
|
|
80
|
+
- **Content Creators** - Video subtitle management, metadata updates
|
|
81
|
+
- **Automators** - Scripting repetitive YouTube tasks
|
|
82
|
+
- **Multi-Channel Managers** - Managing configurations across channels
|
|
83
|
+
|
|
84
|
+
## Future Direction
|
|
85
|
+
|
|
86
|
+
- Add new tools as AppyDave workflow needs arise
|
|
87
|
+
- Individual tools may be featured in standalone video tutorials
|
|
88
|
+
- Keep tools independent and single-purpose
|
|
89
|
+
- Maintain public access for community learning
|
|
90
|
+
- Claude skill integration for easier access
|
|
91
|
+
|
|
92
|
+
## Not Goals
|
|
93
|
+
|
|
94
|
+
- ❌ Building a monolithic framework
|
|
95
|
+
- ❌ Creating tool dependencies or required workflows
|
|
96
|
+
- ❌ Enterprise-scale features or complexity
|
|
97
|
+
- ❌ Forcing users to adopt the entire suite
|
|
98
|
+
|
|
99
|
+
## Contributing
|
|
100
|
+
|
|
101
|
+
Contributions welcome for:
|
|
102
|
+
- Bug fixes to existing tools
|
|
103
|
+
- Documentation improvements
|
|
104
|
+
- New single-purpose tools that fit the workflow
|
|
105
|
+
- Performance improvements
|
|
106
|
+
|
|
107
|
+
Not looking for:
|
|
108
|
+
- Tools that create dependencies between existing utilities
|
|
109
|
+
- Framework-style architectures
|
|
110
|
+
- Features that complicate simple tools
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
# Test Coverage Quick Wins
|
|
2
|
+
|
|
3
|
+
**Current Coverage:** 85.84% (1655 / 1928 lines)
|
|
4
|
+
|
|
5
|
+
**Goal:** Increase to 90%+ with minimal effort
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Missing Test Files (Quick Wins)
|
|
10
|
+
|
|
11
|
+
### 🎯 Priority 1: CLI Actions (0/4 specs) - HIGH IMPACT
|
|
12
|
+
|
|
13
|
+
**Files without specs:**
|
|
14
|
+
1. `lib/appydave/tools/cli_actions/base_action.rb` ⭐ **CRITICAL**
|
|
15
|
+
2. `lib/appydave/tools/cli_actions/get_video_action.rb`
|
|
16
|
+
3. `lib/appydave/tools/cli_actions/prompt_completion_action.rb`
|
|
17
|
+
4. `lib/appydave/tools/cli_actions/update_video_action.rb`
|
|
18
|
+
|
|
19
|
+
**Why high impact:**
|
|
20
|
+
- BaseAction is a template class used by all actions
|
|
21
|
+
- Testing BaseAction tests the pattern used across the codebase
|
|
22
|
+
- CLI actions are user-facing entry points
|
|
23
|
+
|
|
24
|
+
**Estimated effort:** 2-3 hours for all 4
|
|
25
|
+
|
|
26
|
+
**RSpec convention adherence:**
|
|
27
|
+
- ✅ Template Method Pattern - Already established in codebase
|
|
28
|
+
- ✅ Use `described_class` for class under test
|
|
29
|
+
- ✅ Group by method with `describe '#method_name'`
|
|
30
|
+
- ✅ Use `context` for different scenarios
|
|
31
|
+
- ✅ No `require` statements (handled by spec_helper)
|
|
32
|
+
|
|
33
|
+
**Example test structure for BaseAction:**
|
|
34
|
+
|
|
35
|
+
```ruby
|
|
36
|
+
# spec/appydave/tools/cli_actions/base_action_spec.rb
|
|
37
|
+
# frozen_string_literal: true
|
|
38
|
+
|
|
39
|
+
RSpec.describe Appydave::Tools::CliActions::BaseAction do
|
|
40
|
+
# Create concrete test class since BaseAction is abstract
|
|
41
|
+
let(:test_action_class) do
|
|
42
|
+
Class.new(described_class) do
|
|
43
|
+
protected
|
|
44
|
+
|
|
45
|
+
def define_options(opts, options)
|
|
46
|
+
opts.on('-t', '--test VALUE', 'Test option') { |v| options[:test] = v }
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def validate_options(options)
|
|
50
|
+
raise ArgumentError, 'Test option required' unless options[:test]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def execute(options)
|
|
54
|
+
"Executed with: #{options[:test]}"
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
let(:test_action) { test_action_class.new }
|
|
60
|
+
|
|
61
|
+
describe '#action' do
|
|
62
|
+
context 'with valid options' do
|
|
63
|
+
it 'executes successfully' do
|
|
64
|
+
expect { test_action.action(['-t', 'value']) }.not_to raise_error
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
context 'with missing required options' do
|
|
69
|
+
it 'raises ArgumentError' do
|
|
70
|
+
expect { test_action.action([]) }.to raise_error(ArgumentError, 'Test option required')
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
context 'with help flag' do
|
|
75
|
+
it 'displays help and exits' do
|
|
76
|
+
expect { test_action.action(['-h']) }.to raise_error(SystemExit)
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
describe 'template method pattern' do
|
|
82
|
+
it 'calls define_options during initialization' do
|
|
83
|
+
# Test that subclass hook is called
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
it 'calls validate_options before execute' do
|
|
87
|
+
# Test validation happens
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
it 'calls execute with parsed options' do
|
|
91
|
+
# Test execution happens
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### 🎯 Priority 2: GPT Context Options (1 file) - MEDIUM IMPACT
|
|
100
|
+
|
|
101
|
+
**File without spec:**
|
|
102
|
+
- `lib/appydave/tools/gpt_context/options.rb`
|
|
103
|
+
|
|
104
|
+
**Why medium impact:**
|
|
105
|
+
- Already have specs for FileCollector and OutputHandler
|
|
106
|
+
- Options class is smaller, focused
|
|
107
|
+
- Completes the gpt_context module coverage
|
|
108
|
+
|
|
109
|
+
**Estimated effort:** 30-45 minutes
|
|
110
|
+
|
|
111
|
+
**Test structure:**
|
|
112
|
+
|
|
113
|
+
```ruby
|
|
114
|
+
# spec/appydave/tools/gpt_context/options_spec.rb
|
|
115
|
+
# frozen_string_literal: true
|
|
116
|
+
|
|
117
|
+
RSpec.describe Appydave::Tools::GptContext::Options do
|
|
118
|
+
describe '#initialize' do
|
|
119
|
+
context 'with default options' do
|
|
120
|
+
it 'sets default values' do
|
|
121
|
+
options = described_class.new([])
|
|
122
|
+
expect(options.include_patterns).to be_empty
|
|
123
|
+
expect(options.exclude_patterns).to be_empty
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
context 'with include patterns' do
|
|
128
|
+
it 'parses multiple -i flags' do
|
|
129
|
+
options = described_class.new(['-i', '*.rb', '-i', '*.md'])
|
|
130
|
+
expect(options.include_patterns).to eq(['*.rb', '*.md'])
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
context 'with exclude patterns' do
|
|
135
|
+
it 'parses -e flags' do
|
|
136
|
+
options = described_class.new(['-e', 'spec/**/*'])
|
|
137
|
+
expect(options.exclude_patterns).to eq(['spec/**/*'])
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
context 'with format option' do
|
|
142
|
+
it 'parses format flag' do
|
|
143
|
+
options = described_class.new(['-f', 'tree'])
|
|
144
|
+
expect(options.format).to eq('tree')
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
context 'with output file' do
|
|
149
|
+
it 'parses output flag' do
|
|
150
|
+
options = described_class.new(['-o', 'output.txt'])
|
|
151
|
+
expect(options.output_file).to eq('output.txt')
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
context 'with line limit' do
|
|
156
|
+
it 'parses line limit flag' do
|
|
157
|
+
options = described_class.new(['-l', '100'])
|
|
158
|
+
expect(options.line_limit).to eq(100)
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
describe '#valid?' do
|
|
164
|
+
context 'with no include patterns' do
|
|
165
|
+
it 'returns false' do
|
|
166
|
+
options = described_class.new([])
|
|
167
|
+
expect(options.valid?).to be false
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
context 'with include patterns' do
|
|
172
|
+
it 'returns true' do
|
|
173
|
+
options = described_class.new(['-i', '*.rb'])
|
|
174
|
+
expect(options.valid?).to be true
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### 🎯 Priority 3: Root-level Files (2 files) - LOW IMPACT
|
|
184
|
+
|
|
185
|
+
**Files without specs:**
|
|
186
|
+
- `lib/appydave/tools/debuggable.rb` - Likely a simple module
|
|
187
|
+
- `lib/appydave/tools/version.rb` - Auto-generated version file
|
|
188
|
+
|
|
189
|
+
**Why low impact:**
|
|
190
|
+
- Version file is auto-generated (should not be tested)
|
|
191
|
+
- Debuggable is likely a simple concern/module
|
|
192
|
+
|
|
193
|
+
**Estimated effort:** 15-30 minutes (only test debuggable)
|
|
194
|
+
|
|
195
|
+
**Skip version.rb** - It's auto-generated by semantic-release
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## RSpec Conventions to Follow
|
|
200
|
+
|
|
201
|
+
Based on existing specs in the codebase:
|
|
202
|
+
|
|
203
|
+
### ✅ DO:
|
|
204
|
+
1. **Use `described_class`** instead of explicit class name
|
|
205
|
+
2. **Group by method** with `describe '#method_name'` (instance) or `describe '.method_name'` (class)
|
|
206
|
+
3. **Use `context` for scenarios** - "with valid input", "when error occurs"
|
|
207
|
+
4. **Use `let` for test data** - lazy evaluation, cleaner setup
|
|
208
|
+
5. **Freeze string literals** - `# frozen_string_literal: true` at top
|
|
209
|
+
6. **No require statements** - spec_helper handles all requires
|
|
210
|
+
7. **Use RSpec matchers** - `expect(...).to eq(...)`, not `should`
|
|
211
|
+
8. **Test behavior, not implementation** - Focus on public API
|
|
212
|
+
|
|
213
|
+
### ❌ DON'T:
|
|
214
|
+
1. **Don't use `should` syntax** - Use `expect` instead
|
|
215
|
+
2. **Don't manually require files** - spec_helper does this
|
|
216
|
+
3. **Don't test private methods directly** - Test through public API
|
|
217
|
+
4. **Don't duplicate setup** - Use `let`, `let!`, `before` blocks
|
|
218
|
+
5. **Don't write brittle tests** - Avoid testing internal state unless necessary
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Example from Existing Codebase
|
|
223
|
+
|
|
224
|
+
**Good example:** `spec/appydave/tools/subtitle_processor/clean_spec.rb`
|
|
225
|
+
|
|
226
|
+
```ruby
|
|
227
|
+
RSpec.describe Appydave::Tools::SubtitleProcessor::Clean do
|
|
228
|
+
let(:file_path) { File.expand_path('../../../fixtures/subtitle_processor/test.srt', __dir__) }
|
|
229
|
+
let(:simple_content) do
|
|
230
|
+
<<~SRT
|
|
231
|
+
1
|
|
232
|
+
00:00:00,060 --> 00:00:01,760
|
|
233
|
+
<u>The</u> quick
|
|
234
|
+
SRT
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
describe '#initialize' do
|
|
238
|
+
it 'initializes with file_path' do
|
|
239
|
+
expect { described_class.new(file_path: file_path) }.not_to raise_error
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
it 'raises error when both file_path and srt_content are provided' do
|
|
243
|
+
expect { described_class.new(file_path: file_path, srt_content: simple_content) }
|
|
244
|
+
.to raise_error(ArgumentError, 'You cannot provide both a file path and an SRT content stream.')
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
describe '#clean' do
|
|
249
|
+
context 'when initialized with file_path' do
|
|
250
|
+
let(:cleaner) { described_class.new(file_path: file_path) }
|
|
251
|
+
|
|
252
|
+
it 'normalizes the subtitles correctly' do
|
|
253
|
+
cleaned_content = cleaner.clean
|
|
254
|
+
expect(cleaned_content.strip.encode('UTF-8')).to eq(expected_content.strip.encode('UTF-8'))
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
**Why this is good:**
|
|
262
|
+
- ✅ Uses `described_class`
|
|
263
|
+
- ✅ Groups by method
|
|
264
|
+
- ✅ Uses `context` for scenarios
|
|
265
|
+
- ✅ Uses `let` for test data
|
|
266
|
+
- ✅ Frozen string literal
|
|
267
|
+
- ✅ No requires
|
|
268
|
+
- ✅ Tests behavior (clean works) not implementation
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Implementation Plan
|
|
273
|
+
|
|
274
|
+
### Step 1: BaseAction (Highest Priority)
|
|
275
|
+
```bash
|
|
276
|
+
# Create spec file
|
|
277
|
+
touch spec/appydave/tools/cli_actions/base_action_spec.rb
|
|
278
|
+
|
|
279
|
+
# Run tests for just this file
|
|
280
|
+
bundle exec rspec spec/appydave/tools/cli_actions/base_action_spec.rb
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Step 2: CLI Action Subclasses
|
|
284
|
+
```bash
|
|
285
|
+
# Create spec files
|
|
286
|
+
touch spec/appydave/tools/cli_actions/get_video_action_spec.rb
|
|
287
|
+
touch spec/appydave/tools/cli_actions/update_video_action_spec.rb
|
|
288
|
+
touch spec/appydave/tools/cli_actions/prompt_completion_action_spec.rb
|
|
289
|
+
|
|
290
|
+
# Run tests
|
|
291
|
+
bundle exec rspec spec/appydave/tools/cli_actions/
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Step 3: GPT Context Options
|
|
295
|
+
```bash
|
|
296
|
+
# Create spec file
|
|
297
|
+
touch spec/appydave/tools/gpt_context/options_spec.rb
|
|
298
|
+
|
|
299
|
+
# Run tests
|
|
300
|
+
bundle exec rspec spec/appydave/tools/gpt_context/
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Step 4: Verify Coverage
|
|
304
|
+
```bash
|
|
305
|
+
# Run full suite
|
|
306
|
+
bundle exec rspec
|
|
307
|
+
|
|
308
|
+
# Check new coverage (should be 90%+)
|
|
309
|
+
cat coverage/.last_run.json
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Estimated Impact
|
|
315
|
+
|
|
316
|
+
**Current:** 85.84% (1655 / 1928 lines)
|
|
317
|
+
|
|
318
|
+
**After Priority 1 (CLI Actions):**
|
|
319
|
+
- Estimated lines in cli_actions: ~150 lines
|
|
320
|
+
- Assuming 80% test coverage of those lines: +120 lines
|
|
321
|
+
- New total: ~1775 / 1928 = **92.1%**
|
|
322
|
+
|
|
323
|
+
**After Priority 2 (Options):**
|
|
324
|
+
- Estimated lines in options.rb: ~50 lines
|
|
325
|
+
- Assuming 80% coverage: +40 lines
|
|
326
|
+
- New total: ~1815 / 1928 = **94.1%**
|
|
327
|
+
|
|
328
|
+
**Target: 94% coverage with ~4-5 hours of effort**
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Notes
|
|
333
|
+
|
|
334
|
+
- **BaseAction is abstract** - Test via concrete subclass or test doubles
|
|
335
|
+
- **Integration vs unit** - CLI actions may need integration-style tests (harder to unit test)
|
|
336
|
+
- **VCR cassettes** - YouTube actions may need VCR for API mocking (already in use)
|
|
337
|
+
- **Don't test version.rb** - It's auto-generated
|
|
338
|
+
- **Focus on public API** - Don't test private methods directly
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
**Recommendation:** Start with BaseAction spec - it will establish the pattern for all other CLI action specs and provide the biggest coverage boost.
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# AI Agent Tool Discovery Guide
|
|
2
|
+
|
|
3
|
+
**Purpose:** Help AI agents quickly identify the right tool for user requests
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Quick Task Reference
|
|
8
|
+
|
|
9
|
+
| User Says... | Use This Tool | Example Command |
|
|
10
|
+
|--------------|---------------|-----------------|
|
|
11
|
+
| "Feed my codebase to ChatGPT/Claude" | **GPT Context Gatherer** | `gpt_context -i '**/*.rb' -d` |
|
|
12
|
+
| "Clean messy YouTube auto-captions" | **Subtitle Processor** | `subtitle_processor clean -f input.srt` |
|
|
13
|
+
| "Merge subtitle files from multi-part recording" | **Subtitle Processor** | `subtitle_processor join -d ./parts` |
|
|
14
|
+
| "Update 50 video titles" | **YouTube Manager** | `youtube_manager update --video-id ID --title "New"` |
|
|
15
|
+
| "Get video metadata for backup" | **YouTube Manager** | `youtube_manager get --video-id ID` |
|
|
16
|
+
| "Organize downloaded images into video project" | **Move Images** | `bin/move_images.rb -f b40 intro b40` |
|
|
17
|
+
| "Setup tool configuration" | **Configuration** | `ad_config -c` |
|
|
18
|
+
| "Edit channel configurations" | **Configuration** | `ad_config -e` |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Problem → Tool Mapping
|
|
23
|
+
|
|
24
|
+
### "I have subtitle problems"
|
|
25
|
+
- **One messy SRT file** → `subtitle_processor clean`
|
|
26
|
+
- Removes HTML tags, merges duplicates, normalizes spacing
|
|
27
|
+
- **Multiple SRT files to merge** → `subtitle_processor join`
|
|
28
|
+
- Adjusts timestamps, synchronizes timeline, handles buffers
|
|
29
|
+
- **Upload/download YouTube captions** → `youtube_manager` (not subtitle_processor)
|
|
30
|
+
|
|
31
|
+
### "I need to work with YouTube videos"
|
|
32
|
+
- **Metadata operations (CRUD)** → `youtube_manager`
|
|
33
|
+
- Get, update title/description/tags/category
|
|
34
|
+
- **Bulk updates across videos** → `youtube_manager` (loop through video IDs)
|
|
35
|
+
- **Automation workflows** → `youtube_automation` (internal use, deprecated API)
|
|
36
|
+
|
|
37
|
+
### "I need AI assistance"
|
|
38
|
+
- **Feed codebase to AI** → `gpt_context` ⭐ PRIMARY USE CASE
|
|
39
|
+
- **Template-based prompts** → `prompt_tools` (deprecated API, not recommended)
|
|
40
|
+
- **Workflow automation** → `youtube_automation` (internal use)
|
|
41
|
+
|
|
42
|
+
### "I need configuration"
|
|
43
|
+
- **Setup tools** → `ad_config -c` (creates templates)
|
|
44
|
+
- **Multi-channel management** → `ad_config -e` (edit channels.json)
|
|
45
|
+
- **Team collaboration** → Share JSON configs via Git/Dropbox
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Tool Disambiguation
|
|
50
|
+
|
|
51
|
+
### "subtitle_processor" vs "youtube_manager"
|
|
52
|
+
- **subtitle_processor**: Transforms local SRT files (clean/merge/process)
|
|
53
|
+
- **youtube_manager**: CRUD operations on YouTube video metadata via API
|
|
54
|
+
- **Different purposes**: One is file processor, one is API manager
|
|
55
|
+
|
|
56
|
+
### "prompt_tools" vs "youtube_automation"
|
|
57
|
+
- **prompt_tools**: Single OpenAI Completion API call with template support
|
|
58
|
+
- **youtube_automation**: Sequence runner executing multiple prompts
|
|
59
|
+
- **Both use deprecated API**: Neither recommended for new work
|
|
60
|
+
|
|
61
|
+
### "gpt_context" vs "prompt_tools"
|
|
62
|
+
- **gpt_context**: Collects project files for AI context (no API calls)
|
|
63
|
+
- **prompt_tools**: Executes OpenAI API calls with prompts
|
|
64
|
+
- **Use gpt_context for**: Feeding code to Claude/ChatGPT
|
|
65
|
+
- **Use prompt_tools for**: Automated API-based completions (if migrated to Chat API)
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Scenario-Based Discovery
|
|
70
|
+
|
|
71
|
+
### Scenario: FliVideo Multi-Part Recording Workflow
|
|
72
|
+
```
|
|
73
|
+
1. Record video in 5 parts → 5 video files + 5 SRT subtitle files
|
|
74
|
+
2. Generate subtitles → YouTube auto-captions (messy)
|
|
75
|
+
3. Clean each subtitle → subtitle_processor clean
|
|
76
|
+
4. Merge subtitle parts → subtitle_processor join
|
|
77
|
+
5. Upload video → (external tool)
|
|
78
|
+
6. Update metadata → youtube_manager
|
|
79
|
+
7. Organize B-roll images → move_images
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Scenario: Post-Rebrand Bulk Video Updates
|
|
83
|
+
```
|
|
84
|
+
1. Changed channel name → Need to update 50 video descriptions
|
|
85
|
+
2. Export video list → youtube_manager get (or YouTube Studio)
|
|
86
|
+
3. Loop through videos → youtube_manager update --video-id ID --description "New"
|
|
87
|
+
4. Verify changes → youtube_manager get
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Scenario: AI-Assisted Code Development
|
|
91
|
+
```
|
|
92
|
+
1. Need AI help with codebase → gpt_context
|
|
93
|
+
2. Gather Ruby files → gpt_context -i '**/*.rb' -e 'spec/**/*' -d
|
|
94
|
+
3. Feed to Claude/ChatGPT → Paste from clipboard or read file
|
|
95
|
+
4. Iterate with AI → Re-run gpt_context as codebase changes
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Tool Entry Points by User Type
|
|
101
|
+
|
|
102
|
+
### 👨💻 Developer Using AI Assistants
|
|
103
|
+
**Primary tool:** GPT Context Gatherer ⭐
|
|
104
|
+
**Workflow:** Collect codebase → Feed to AI → Get help with development
|
|
105
|
+
|
|
106
|
+
### 🎥 YouTuber with Multi-Part Recordings (FliVideo workflow)
|
|
107
|
+
**Primary tools:** Subtitle Processor → YouTube Manager
|
|
108
|
+
**Workflow:** Clean captions → Merge parts → Upload → Update metadata
|
|
109
|
+
|
|
110
|
+
### 📹 YouTuber Managing Multiple Channels
|
|
111
|
+
**Primary tools:** Configuration Manager → YouTube Manager
|
|
112
|
+
**Workflow:** Setup channels.json → Switch contexts → Bulk update videos
|
|
113
|
+
|
|
114
|
+
### ⚙️ Tool Administrator
|
|
115
|
+
**Primary tool:** Configuration Manager
|
|
116
|
+
**Workflow:** Create templates → Setup team configs → Share via Git/Dropbox
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Tool Relationships & Dependencies
|
|
121
|
+
|
|
122
|
+
### Independent Tools (No Dependencies)
|
|
123
|
+
- **gpt_context**: Standalone file collector
|
|
124
|
+
- **subtitle_processor**: Standalone SRT file processor
|
|
125
|
+
- **move_images**: Standalone image organizer
|
|
126
|
+
|
|
127
|
+
### Configuration-Dependent Tools
|
|
128
|
+
- **youtube_manager**: Needs channels.json (optional, for multi-channel)
|
|
129
|
+
- **youtube_automation**: Requires youtube_automation.json + Dropbox paths
|
|
130
|
+
- **prompt_tools**: No config needed (just OpenAI API key)
|
|
131
|
+
|
|
132
|
+
### Workflow Sequences
|
|
133
|
+
```
|
|
134
|
+
Configuration Setup First:
|
|
135
|
+
ad_config -c → Edit configs → Use other tools
|
|
136
|
+
|
|
137
|
+
FliVideo Production:
|
|
138
|
+
subtitle_processor clean → subtitle_processor join → youtube_manager
|
|
139
|
+
|
|
140
|
+
Context Engineering:
|
|
141
|
+
gpt_context → Feed to AI → Develop → Repeat
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Active vs Deprecated Tools
|
|
147
|
+
|
|
148
|
+
### ✅ ACTIVE TOOLS (Use these)
|
|
149
|
+
1. **GPT Context Gatherer** ⭐ - Primary use case
|
|
150
|
+
2. **YouTube Manager** - CRUD operations on videos
|
|
151
|
+
3. **Subtitle Processor** - SRT file transformation
|
|
152
|
+
4. **Configuration Manager** - JSON config management
|
|
153
|
+
5. **Move Images** - Video asset organization
|
|
154
|
+
|
|
155
|
+
### ⚠️ DEPRECATED API (Avoid for new work)
|
|
156
|
+
6. **Prompt Tools** - Uses deprecated OpenAI Completion API
|
|
157
|
+
7. **YouTube Automation** - Internal use only, deprecated API, hardcoded paths
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Common Pitfalls & Troubleshooting
|
|
162
|
+
|
|
163
|
+
### "I can't find subtitle_manager"
|
|
164
|
+
→ Renamed to `subtitle_processor` (more accurate naming)
|
|
165
|
+
|
|
166
|
+
### "Bundler version mismatch"
|
|
167
|
+
→ Run: `eval "$(rbenv init -)" && gem install bundler:2.6.2`
|
|
168
|
+
|
|
169
|
+
### "YouTube Manager not authenticating"
|
|
170
|
+
→ Check `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` in `.env`
|
|
171
|
+
|
|
172
|
+
### "Move Images not working"
|
|
173
|
+
→ Check hardcoded paths in bin/move_images.rb (development tool, may need customization)
|
|
174
|
+
|
|
175
|
+
### "GPT Context output too large"
|
|
176
|
+
→ Use `-e` to exclude node_modules, .git, spec directories
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Keywords for Discovery
|
|
181
|
+
|
|
182
|
+
**GPT Context Gatherer:**
|
|
183
|
+
- Keywords: AI, context, codebase, ChatGPT, Claude, feed code, token limit, files, patterns
|
|
184
|
+
|
|
185
|
+
**YouTube Manager:**
|
|
186
|
+
- Keywords: video metadata, title, description, tags, category, bulk update, YouTube API, CRUD
|
|
187
|
+
|
|
188
|
+
**Subtitle Processor:**
|
|
189
|
+
- Keywords: SRT, subtitle, captions, clean, merge, join, multi-part, FliVideo, timeline
|
|
190
|
+
|
|
191
|
+
**Configuration:**
|
|
192
|
+
- Keywords: settings, channels, multi-channel, team collaboration, JSON config, paths
|
|
193
|
+
|
|
194
|
+
**Move Images:**
|
|
195
|
+
- Keywords: video assets, B-roll, images, organize, download folder, project structure
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
**Last Updated:** January 2025
|