appydave-tools 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -0
  3. data/AGENTS.md +22 -0
  4. data/CHANGELOG.md +19 -0
  5. data/CLAUDE.md +318 -79
  6. data/README.md +390 -81
  7. data/bin/archive_project.rb +249 -0
  8. data/bin/configuration.rb +21 -1
  9. data/bin/generate_manifest.rb +357 -0
  10. data/bin/subtitle_manager.rb +18 -12
  11. data/bin/subtitle_processor.rb +158 -0
  12. data/bin/sync_from_ssd.rb +236 -0
  13. data/bin/vat +623 -0
  14. data/docs/README.md +169 -0
  15. data/docs/archive/codebase-audit-2025-01.md +424 -0
  16. data/docs/archive/documentation-framework-proposal.md +808 -0
  17. data/docs/archive/purpose-and-philosophy.md +110 -0
  18. data/docs/archive/test-coverage-quick-wins.md +342 -0
  19. data/docs/archive/tool-discovery.md +199 -0
  20. data/docs/archive/tool-documentation-analysis.md +592 -0
  21. data/docs/configuration/.env.example +19 -0
  22. data/docs/configuration/README.md +394 -0
  23. data/docs/configuration/channels.example.json +26 -0
  24. data/docs/configuration/settings.example.json +6 -0
  25. data/docs/development/CODEX-recommendations.md +123 -0
  26. data/docs/development/README.md +100 -0
  27. data/docs/development/cli-architecture-patterns.md +1604 -0
  28. data/docs/development/pattern-comparison.md +284 -0
  29. data/docs/prd-unified-brands-configuration.md +792 -0
  30. data/docs/project-brand-systems-analysis.md +934 -0
  31. data/docs/tools/bank-reconciliation.md +269 -0
  32. data/docs/tools/cli-actions.md +444 -0
  33. data/docs/tools/configuration.md +329 -0
  34. data/docs/{usage → tools}/gpt-context.md +118 -7
  35. data/docs/tools/index.md +324 -0
  36. data/docs/tools/move-images.md +295 -0
  37. data/docs/tools/name-manager.md +322 -0
  38. data/docs/tools/prompt-tools.md +209 -0
  39. data/docs/tools/subtitle-processor.md +242 -0
  40. data/docs/tools/youtube-automation.md +258 -0
  41. data/docs/tools/youtube-manager.md +248 -0
  42. data/docs/vat/dam-vision.md +123 -0
  43. data/docs/vat/session-summary-2025-11-09.md +297 -0
  44. data/docs/vat/usage.md +508 -0
  45. data/docs/vat/vat-testing-plan.md +801 -0
  46. data/lib/appydave/tools/configuration/models/brands_config.rb +238 -0
  47. data/lib/appydave/tools/configuration/models/config_base.rb +7 -0
  48. data/lib/appydave/tools/configuration/models/settings_config.rb +4 -0
  49. data/lib/appydave/tools/{subtitle_manager → subtitle_processor}/clean.rb +1 -1
  50. data/lib/appydave/tools/{subtitle_manager → subtitle_processor}/join.rb +5 -2
  51. data/lib/appydave/tools/vat/config.rb +153 -0
  52. data/lib/appydave/tools/vat/config_loader.rb +91 -0
  53. data/lib/appydave/tools/vat/manifest_generator.rb +239 -0
  54. data/lib/appydave/tools/vat/project_listing.rb +198 -0
  55. data/lib/appydave/tools/vat/project_resolver.rb +132 -0
  56. data/lib/appydave/tools/vat/s3_operations.rb +560 -0
  57. data/lib/appydave/tools/version.rb +1 -1
  58. data/lib/appydave/tools.rb +11 -5
  59. data/package.json +1 -1
  60. metadata +85 -14
  61. data/docs/dam/overview.md +0 -28
  62. data/lib/mj-paste-test/main.rb +0 -35
  63. data/lib/mj-paste-test/prompts.txt +0 -18
  64. data/lib/mj-paste-test/readme-leonardo.md +0 -0
  65. /data/lib/appydave/tools/{subtitle_manager → subtitle_processor}/_doc-clean.md +0 -0
  66. /data/lib/appydave/tools/{subtitle_manager → subtitle_processor}/_doc-join.md +0 -0
  67. /data/lib/appydave/tools/{subtitle_manager → subtitle_processor}/_doc-todo.md +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f220893e70bf53b9a6da3b1a46857c3221f2672aba453616e4bab5b87528d65
4
- data.tar.gz: 1e5aef7918151c423393131dcfc8e2538cd6b95632b2a58dd8f23a1c864f1c06
3
+ metadata.gz: '0819e2db66666e4729144ba1a8dac0032a5b323f4475f9cdc84459aa9309cd49'
4
+ data.tar.gz: ce1185ecbf19793175fa91f4a5c3e401df36394349ec454c7c47fa38e2193727
5
5
  SHA512:
6
- metadata.gz: fe5e90a6677bcb82e0d1af5fde786eba72d2380f1dcbe291b4fe998b239f71c6381bd33b7dfa87755e2b9390d97241387422c84522d3763236e87688668ed861
7
- data.tar.gz: 70abc6727a6e318d329097b42a72fc8de4061965d60e7d33d013fa361b00a1c6e3b9eabe94a7a15a5e993523ea6ba96b69231c83bdae0f030f16ad0ec4a1e50d
6
+ metadata.gz: d1c6e936fa7d41f160152cf3e037485c9c0e509377f81970df9295cb38bdcc33bfea489da5ab666baa87042d645d609f35048b96826241bc636097c192525015
7
+ data.tar.gz: b4accc9229eda2cd3777f6828e2a3b6988208033a1a5df55f5c487519321a76845cf908fac1056598231973c26d8a9866ab311307157b30dcac472534d42465f
data/.rubocop.yml CHANGED
@@ -127,6 +127,12 @@ RSpec/PendingWithoutReason:
127
127
  RSpec/MultipleMemoizedHelpers:
128
128
  Enabled: false
129
129
 
130
+ RSpec/MessageSpies:
131
+ Enabled: false
132
+
133
+ RSpec/StubbedMock:
134
+ Enabled: false
135
+
130
136
  Metrics/AbcSize:
131
137
  Max: 25
132
138
  Exclude:
data/AGENTS.md ADDED
@@ -0,0 +1,22 @@
1
+ # Repository Guidelines
2
+
3
+ ## Project Structure & Module Organization
4
+ Core Ruby code lives in `lib/appydave/tools/` with one folder per CLI (gpt_context, youtube_manager, subtitle_processor, etc.). Executables in `bin/` are for development helpers, while packaged entrypoints reside in `exe/`. Specs mirror the library layout under `spec/`, supported by sample data in `spec/samples/`. Shared docs and walkthroughs are collected under `docs/`. Temporary or generated artifacts (`coverage/`, `tmp/`, `transient/`) should stay out of commits.
5
+
6
+ ## Build, Test, and Development Commands
7
+ `bin/setup` installs gem dependencies and any Node helpers declared in `package.json`. Run `bundle exec rake spec` (aliased as `rake spec`) for the full test suite, and keep `guard` running during feature work to auto-rerun specs. Use `bundle exec rubocop` to enforce lint rules, and `bin/console` for an interactive Pry session preloaded with the gem. CLI binaries can be invoked directly, e.g., `bin/gpt_context.rb -i '**/*.rb' -d`.
8
+
9
+ ## Coding Style & Naming Conventions
10
+ The codebase targets Ruby 2.7 with two-space indentation and descriptive method names. Follow `.rubocop.yml`: 200-character line limit, relaxed metrics inside `spec/`, and RuboCop RSpec/Rake plugins enabled. Namespaces follow `AppyDave::Tools::<Feature>` inside `lib/`, and CLI filenames stay snake_case (`bin/move_images.rb`). Prefer keyword args, early returns, and guard clauses over deeply nested conditionals.
11
+
12
+ ## Testing Guidelines
13
+ RSpec is the canonical framework. Name files `*_spec.rb` that mirror lib paths (e.g., `spec/gpt_context/collector_spec.rb`). Isolate behavior with `describe '#method'` blocks, keep helpers in `spec/support`, and favor `let`/`let!` over global state. Run focused tests via `bundle exec rspec spec/path/to/file_spec.rb` when iterating, then finish with `rake spec`. Add regression tests for every bug fix to keep CLI behavior stable.
14
+
15
+ ## Commit & Pull Request Guidelines
16
+ Commits follow conventional commits consumed by semantic-release (`feat:`, `fix:`, `chore:`, `feat!:`, etc.). Scope messages to a single tool when possible (`fix(subtitle_processor): correct offset buffer`). Before opening a PR, ensure `rake spec` and `rubocop` pass, summarize the change, link issues or YouTube scripts, and include CLI output or screenshots if user-facing behavior shifts. Leave follow-up tasks in checklists so reviewers can track outstanding work.
17
+
18
+ ## Agent Coordination
19
+ Claude is the primary automation agent; align with the collaboration notes in `CLAUDE.md` before introducing new flows or prompt templates. When scripting repeatable tasks (gpt_context runs, metadata syncs), document the expected Claude inputs/outputs so the agent can reproduce them. Flag breaking CLI changes in PR descriptions with a dedicated **Claude Impact** subsection to keep downstream automations in sync.
20
+
21
+ ## Security & Configuration Tips
22
+ Keep API keys and OAuth secrets in `.env` or `~/.config/appydave/` (managed via `ad_config`). Never commit those files; `.gitignore` already excludes them. Validate YouTube API changes against a test channel before touching production content, and rotate credentials when machines change owners.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ # [0.16.0](https://github.com/appydave/appydave-tools/compare/v0.15.0...v0.16.0) (2025-11-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fix cops ([6c1d59b](https://github.com/appydave/appydave-tools/commit/6c1d59bd870af519825556f7304d6ca1677d8649))
7
+
8
+
9
+ ### Features
10
+
11
+ * update documentation and general purpose rename and fixes via claude ([027c3df](https://github.com/appydave/appydave-tools/commit/027c3dff11e572359e6f2d1ebc17010dc3b8d7ee))
12
+
13
+ # [0.15.0](https://github.com/appydave/appydave-tools/compare/v0.14.1...v0.15.0) (2025-11-08)
14
+
15
+
16
+ ### Features
17
+
18
+ * update claude and git leaks ([0b8212f](https://github.com/appydave/appydave-tools/commit/0b8212fa65a920c608876c4f4f37c166dc552039))
19
+
1
20
  ## [0.14.1](https://github.com/appydave/appydave-tools/compare/v0.14.0...v0.14.1) (2025-08-06)
2
21
 
3
22
 
data/CLAUDE.md CHANGED
@@ -2,9 +2,48 @@
2
2
 
3
3
  This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
4
 
5
+ ## Project Purpose
6
+
7
+ **AppyDave Tools** is a consolidated productivity toolkit built for AppyDave's YouTube content creation workflow. All utilities live in one repository for easier maintenance than managing separate codebases.
8
+
9
+ **📖 See [docs/purpose-and-philosophy.md](./docs/purpose-and-philosophy.md) for complete philosophy and design principles.**
10
+
11
+ **Key Points:**
12
+ - **Consolidated toolkit** - One codebase for easier maintenance
13
+ - **YouTube workflow** - Built specifically for content creator productivity
14
+ - **Single-purpose tools** - Each tool solves one problem independently
15
+ - **Shareable individually** - Tools can be featured in standalone videos
16
+ - **Language flexible** - Currently Ruby, could be rewritten if needed
17
+
5
18
  ## Common Commands
6
19
 
7
20
  ### Development Setup
21
+
22
+ **⚠️ IMPORTANT: Bundler Setup for Claude Code**
23
+
24
+ This project requires Bundler 2.6.2. If you encounter `Could not find 'bundler' (2.6.2)` errors during Claude Code execution:
25
+
26
+ **Automatic fix (recommended):**
27
+ ```bash
28
+ eval "$(rbenv init -)" && gem install bundler:2.6.2
29
+ ```
30
+
31
+ **Make permanent** - Add to your `.zshrc` or `.bashrc`:
32
+ ```bash
33
+ # Add rbenv to PATH and initialize
34
+ eval "$(rbenv init - zsh)"
35
+ ```
36
+
37
+ **For Claude Code:** The `eval "$(rbenv init -)"` command is automatically prepended to bash commands when needed.
38
+
39
+ **Manual verification:**
40
+ ```bash
41
+ which ruby # Should show: /Users/[user]/.rbenv/shims/ruby
42
+ ruby --version # Should show: ruby 3.4.2
43
+ bundler --version # Should show: Bundler version 2.6.2
44
+ ```
45
+
46
+ **Standard setup:**
8
47
  ```bash
9
48
  bin/setup # Install dependencies and setup development environment
10
49
  bin/console # Interactive Ruby console for experimentation
@@ -16,15 +55,16 @@ bin/console # Interactive Ruby console for experimentation
16
55
 
17
56
  #### Quick Reference Index
18
57
 
19
- | Command | Gem Command | Description |
20
- |---------|-------------|-------------|
21
- | **GPT Context** | `gpt_context` | Collect project files for AI context ⭐ |
22
- | **YouTube Manager** | `youtube_manager` | Manage YouTube video metadata via API |
23
- | **Subtitle Manager** | `subtitle_manager` | Process and join SRT subtitle files |
24
- | **Prompt Tools** | `prompt_tools` | AI prompt completion workflows |
25
- | **YouTube Automation** | `youtube_automation` | Automated YouTube workflows with GPT agents |
26
- | **Configuration** | `ad_config` | Manage appydave-tools configuration files |
27
- | **Move Images** | N/A (dev only) | Organize video project images (development tool) |
58
+ | Command | Gem Command | Description | Status |
59
+ |---------|-------------|-------------|--------|
60
+ | **GPT Context** | `gpt_context` | Collect project files for AI context | PRIMARY |
61
+ | **YouTube Manager** | `youtube_manager` | CRUD operations on YouTube video metadata | ACTIVE |
62
+ | **Subtitle Processor** | `subtitle_processor` | Transform SRT files (clean/merge) | ACTIVE |
63
+ | **VAT (Video Asset Tools)** | `vat` | Multi-tenant video project storage orchestration | ✅ ACTIVE |
64
+ | **Configuration** | `ad_config` | Manage JSON configs (channels, paths, sequences) | ✅ ACTIVE |
65
+ | **Move Images** | N/A (dev only) | Organize video asset images | ✅ ACTIVE |
66
+ | **Prompt Tools** | `prompt_tools` | OpenAI Completion API wrapper | ⚠️ DEPRECATED API |
67
+ | **YouTube Automation** | `youtube_automation` | Prompt sequence runner | ⚠️ INTERNAL USE |
28
68
 
29
69
  ---
30
70
 
@@ -73,21 +113,25 @@ bin/youtube_manager.rb update --video-id ID --category-id 28
73
113
  - Update video title, description, tags, and category
74
114
  - Generate detailed reports
75
115
 
76
- #### 3. Subtitle Manager (`bin/subtitle_manager.rb`)
116
+ #### 3. Subtitle Processor (`bin/subtitle_processor.rb`)
77
117
  Process and manage SRT subtitle files:
78
118
 
79
119
  ```bash
80
120
  # Clean and normalize SRT files
81
- bin/subtitle_manager.rb clean -f input.srt -o cleaned.srt
121
+ bin/subtitle_processor.rb clean -f input.srt -o cleaned.srt
82
122
 
83
123
  # Join multiple SRT files
84
- bin/subtitle_manager.rb join -d ./subtitles -f "*.srt" -o merged.srt
85
- bin/subtitle_manager.rb join -f "part1.srt,part2.srt" -s asc -b 100 -o final.srt
124
+ bin/subtitle_processor.rb join -d ./subtitles -f "*.srt" -o merged.srt
125
+ bin/subtitle_processor.rb join -f "part1.srt,part2.srt" -s asc -b 100 -o final.srt
86
126
 
87
127
  # Join with options
88
- bin/subtitle_manager.rb join -d ./subs -f "*.srt" -s inferred -b 200 -o output.srt -L detail
128
+ bin/subtitle_processor.rb join -d ./subs -f "*.srt" -s inferred -b 200 -o output.srt -L detail
89
129
  ```
90
130
 
131
+ **Operations:**
132
+ - **clean**: Removes HTML tags (`<u>`), merges duplicate entries, normalizes spacing
133
+ - **join**: Parses multiple SRT files, adjusts timestamps with buffer, merges timeline
134
+
91
135
  **Options:**
92
136
  - `-d, --directory` - Directory containing SRT files
93
137
  - `-f, --files` - File pattern or comma-separated list
@@ -95,22 +139,100 @@ bin/subtitle_manager.rb join -d ./subs -f "*.srt" -s inferred -b 200 -o output.s
95
139
  - `-b, --buffer` - Buffer between files in milliseconds (default: 100)
96
140
  - `-L, --log-level` - Log level: none, info, detail
97
141
 
98
- **Note:** Internal module is called `SubtitleMaster` but CLI tool is `subtitle_manager`
142
+ **Use cases:** Cleaning YouTube auto-captions, merging FliVideo multi-part recording subtitles
143
+
144
+ **Note:** Renamed from `subtitle_manager` to `subtitle_processor` (accurate - processes files, doesn't manage state)
145
+
146
+ #### 4. VAT - Video Asset Tools (`bin/vat`)
147
+ Multi-tenant video project storage orchestration:
148
+
149
+ ```bash
150
+ # List all brands
151
+ vat list
152
+
153
+ # List projects for a brand
154
+ vat list appydave
155
+ vat list appydave 'b6*' # Pattern matching
156
+
157
+ # Upload to S3 (collaboration)
158
+ vat s3-up appydave b65
159
+ vat s3-up voz boy-baker --dry-run
160
+
161
+ # Download from S3
162
+ vat s3-down appydave b65
163
+ vat s3-down --dry-run # Auto-detect from PWD
164
+
165
+ # Check sync status
166
+ vat s3-status appydave b65
167
+
168
+ # Clean up S3
169
+ vat s3-cleanup appydave b65 --force
99
170
 
100
- #### 4. Prompt Tools (`bin/prompt_tools.rb`)
101
- AI prompt completion workflows:
171
+ # Archive to SSD
172
+ vat archive appydave b63
173
+
174
+ # Sync from SSD
175
+ vat sync-ssd appydave
176
+ ```
177
+
178
+ **Core Features:**
179
+ - **Multi-tenant**: Manages 6 brands (appydave, voz, aitldr, kiros, joy, ss)
180
+ - **Smart sync**: MD5-based file comparison (skips unchanged files)
181
+ - **Pattern matching**: `'b6*'` expands to b60-b69 projects
182
+ - **Short names**: `b65` → `b65-guy-monroe-marketing-plan` (FliVideo pattern)
183
+ - **Auto-detection**: Detects brand/project from current directory
184
+ - **Hybrid storage**: Local → S3 (90-day collaboration) → SSD (archive)
185
+
186
+ **Brand Shortcuts:**
187
+ - `appydave` → `v-appydave`
188
+ - `voz` → `v-voz`
189
+ - `aitldr` → `v-aitldr`
190
+ - `kiros` → `v-kiros`
191
+ - `joy` → `v-beauty-and-joy`
192
+ - `ss` → `v-supportsignal`
193
+
194
+ **Workflows:**
195
+ - **FliVideo** (AppyDave): Sequential chapter recording, short name support (`b65`)
196
+ - **Storyline** (VOZ, AITLDR): Script-first content, full project names (`boy-baker`)
197
+
198
+ **Use cases:**
199
+ - Collaborate on video edits with team (upload → edit → download)
200
+ - Archive completed projects to external SSD
201
+ - Quick project discovery across multiple brands
202
+ - Manage 50GB+ video files with smart sync
203
+
204
+ **Configuration:**
205
+ - System: `video-projects-root` in `~/.config/appydave/settings.json` (**required**)
206
+ - Per-brand: `.video-tools.env` (AWS credentials, S3 bucket, SSD path)
207
+
208
+ **Migration note:** The old `~/.vat-config` file is deprecated. VAT now uses `settings.json`. See [Configuration Management](#configuration-management) section below.
209
+
210
+ See detailed usage guide: [docs/usage/vat.md](./docs/usage/vat.md)
211
+
212
+ #### 5. Prompt Tools (`bin/prompt_tools.rb`) ⚠️ DEPRECATED API
213
+ OpenAI Completion API wrapper with template support:
102
214
 
103
215
  ```bash
104
- # Run AI prompt completion
105
- bin/prompt_tools.rb completion [options]
216
+ # Run prompt from text
217
+ bin/prompt_tools.rb completion -p "Your prompt" -o output.txt
218
+
219
+ # Run prompt from file with placeholders
220
+ bin/prompt_tools.rb completion -f template.md -k key1=value1,key2=value2 -c
106
221
  ```
107
222
 
108
- **Features:**
109
- - OpenAI GPT integration
110
- - Prompt execution and management
223
+ **What it does:**
224
+ - Sends prompts to OpenAI **Completion API** (older GPT-3 models like `davinci-codex`)
225
+ - Supports template files with `{placeholder}` substitution
226
+ - Outputs to file, clipboard, or stdout
111
227
 
112
- #### 5. YouTube Automation (`bin/youtube_automation.rb`)
113
- Automated YouTube workflows using GPT agents:
228
+ **Status:** ⚠️ **Not in active use** - Uses **deprecated OpenAI Completion API**
229
+
230
+ **Modern alternative:** Use ChatGPT/Claude directly or migrate to OpenAI Chat API
231
+
232
+ **Potential use cases:** Template-based content generation (if migrated to Chat API)
233
+
234
+ #### 5. YouTube Automation (`bin/youtube_automation.rb`) ⚠️ INTERNAL USE
235
+ Prompt sequence runner for content workflows:
114
236
 
115
237
  ```bash
116
238
  # Run automation sequence
@@ -118,6 +240,21 @@ bin/youtube_automation.rb -s 01-1
118
240
  bin/youtube_automation.rb -s 01-1 -d # with debug output
119
241
  ```
120
242
 
243
+ **What it does:**
244
+ - Loads sequence config from `~/.config/appydave/youtube_automation.json`
245
+ - Reads prompt templates from Dropbox path (`_common/raw_prompts/`)
246
+ - Executes OpenAI Completion API calls
247
+ - Saves responses to output files
248
+
249
+ **Requirements:**
250
+ - Sequence definitions in JSON config
251
+ - Prompt template files in configured Dropbox location
252
+ - `OPENAI_ACCESS_TOKEN` environment variable
253
+
254
+ **Status:** ⚠️ **Internal tool** - Hardcoded paths, deprecated API, not documented for external use
255
+
256
+ **Relationship to Move Images:** These are separate tools - Move Images organizes downloaded images into video asset folders
257
+
121
258
  **Options:**
122
259
  - `-s, --sequence` - Sequence number (required, e.g., 01-1)
123
260
  - `-d, --debug` - Enable debug mode
@@ -140,9 +277,15 @@ bin/configuration.rb -e
140
277
  ```
141
278
 
142
279
  **Configuration Types:**
143
- - **settings** - General settings and paths
280
+ - **settings** - General settings and paths (project folders: content, video, published, abandoned)
144
281
  - **channels** - YouTube channel definitions (code, name, youtube_handle)
145
- - **youtube_automation** - Automation workflow configurations
282
+ - **youtube_automation** - Automation workflow configurations (prompt sequences)
283
+
284
+ **Team Collaboration Features:**
285
+ - **Shareable configs**: JSON files can be version-controlled (no secrets included)
286
+ - **Per-developer paths**: Each team member customizes paths in their `~/.config/appydave/`
287
+ - **Consistent structure**: Same channel codes/names across team
288
+ - **Secrets separation**: API keys stored in `.env` files (gitignored), not in configs
146
289
 
147
290
  #### 7. Move Images (`bin/move_images.rb`)
148
291
  Organize and rename downloaded images into video project asset folders.
@@ -190,10 +333,12 @@ Bank transaction reconciliation tool - **DEPRECATED, DO NOT USE**
190
333
  ```bash
191
334
  rake spec # Run all RSpec tests
192
335
  rake # Default task: compile, spec (clobber compile spec)
193
- guard # Watch files and auto-run tests + rubocop on changes
336
+ RUBYOPT="-W0" guard # Watch files and auto-run tests + rubocop (suppress Ruby 3.4 warnings)
194
337
  bundle exec rspec -f doc # Run tests with detailed documentation format
195
338
  ```
196
339
 
340
+ **Note:** Ruby 3.4.2 shows platform constant warnings from Bundler. Use `RUBYOPT="-W0"` to suppress them.
341
+
197
342
  ### Linting & Style
198
343
  ```bash
199
344
  rubocop # Run RubyGem style checks
@@ -210,12 +355,20 @@ gem build # Build gemspec into .gem file
210
355
 
211
356
  ## Architecture Overview
212
357
 
213
- This is a Ruby gem called `appydave-tools` that provides YouTube automation and content creation tools.
358
+ `appydave-tools` is AppyDave's consolidated productivity toolkit for YouTube content creation. Single-purpose utilities in one repository for easier maintenance than separate codebases.
359
+
360
+ **Philosophy:** See [docs/purpose-and-philosophy.md](./docs/purpose-and-philosophy.md) for project philosophy and design principles.
361
+
362
+ **Tool Categories:**
363
+ - AI & Context Management (GPT Context, Prompt Tools)
364
+ - Content & Media (Subtitles, YouTube Manager, YouTube Automation, Move Images)
365
+ - Configuration (Multi-channel config management)
214
366
 
215
367
  ### Core Structure
216
368
  - **CLI Tools**: Multiple executable scripts in `bin/` for different functionalities
217
369
  - **Modular Design**: Organized into focused modules under `lib/appydave/tools/`
218
- - **Configuration System**: Flexible config management with channel and project settings
370
+ - **Independent Operation**: Each tool solves a specific problem standalone
371
+ - **Configuration System**: Flexible config management for multi-project workflows
219
372
  - **Type System**: Custom type classes for data validation and transformation
220
373
 
221
374
  ### Key Components
@@ -242,7 +395,7 @@ This is a Ruby gem called `appydave-tools` that provides YouTube automation and
242
395
  - Caption/subtitle management
243
396
  - Detailed reporting capabilities
244
397
 
245
- #### Subtitle Management (`lib/appydave/tools/subtitle_manager/`)
398
+ #### Subtitle Management (`lib/appydave/tools/subtitle_processor/`)
246
399
  - SRT file cleaning and normalization
247
400
  - Multi-part subtitle joining
248
401
  - Timeline synchronization
@@ -281,94 +434,180 @@ This is a Ruby gem called `appydave-tools` that provides YouTube automation and
281
434
  ## Configuration Management
282
435
 
283
436
  ### Configuration Overview
284
- The gem uses JSON configuration files for managing YouTube channels, OpenAI settings, and automation workflows.
437
+ The gem uses JSON configuration files for managing YouTube channels, settings, and automation workflows. All configuration files are stored in `~/.config/appydave/`.
285
438
 
286
- **Configuration Tool:** `bin/configuration.rb`
439
+ **Configuration Tool:** `bin/configuration.rb` (installed as `ad_config`)
287
440
 
288
- ### Setting Up Configuration
441
+ **Complete configuration guide:** [docs/configuration/README.md](./docs/configuration/README.md)
289
442
 
290
- 1. **List available configurations:**
291
- ```bash
292
- bin/configuration.rb -l
293
- ```
443
+ ### Quick Start
294
444
 
295
- 2. **Create missing configuration files:**
445
+ **First-time setup:**
296
446
  ```bash
447
+ # Create empty configuration files (safe - won't overwrite existing files)
297
448
  bin/configuration.rb -c
449
+
450
+ # Copy example files
451
+ cp docs/configuration/settings.example.json ~/.config/appydave/settings.json
452
+ cp docs/configuration/channels.example.json ~/.config/appydave/channels.json
453
+ cp docs/configuration/.env.example .env
454
+
455
+ # Edit your values
456
+ bin/configuration.rb -e
298
457
  ```
299
458
 
300
- 3. **View configuration values:**
459
+ ### Configuration Commands
460
+
301
461
  ```bash
462
+ # List all configurations
463
+ bin/configuration.rb -l
464
+
465
+ # Create missing configuration files (safe - won't overwrite)
466
+ bin/configuration.rb -c
467
+
468
+ # View configuration values
302
469
  bin/configuration.rb -p settings,channels,youtube_automation
303
- ```
304
470
 
305
- 4. **Edit configurations in VS Code:**
306
- ```bash
471
+ # Edit configurations in VS Code
307
472
  bin/configuration.rb -e
308
473
  ```
309
474
 
310
475
  ### Configuration Types
311
476
 
312
- #### 1. Settings Config
313
- General application settings and paths.
477
+ #### 1. Settings Config (`~/.config/appydave/settings.json`)
478
+ General application settings and paths (non-secret configuration).
314
479
 
315
- **Typical structure:**
480
+ **Structure:**
316
481
  ```json
317
482
  {
318
- "project_paths": {
319
- "content": "/path/to/content",
320
- "video": "/path/to/video",
321
- "published": "/path/to/published",
322
- "abandoned": "/path/to/abandoned"
323
- }
483
+ "video-projects-root": "/Users/yourname/dev/video-projects",
484
+ "ecamm-recording-folder": "/Users/yourname/ecamm",
485
+ "download-folder": "/Users/yourname/Downloads",
486
+ "download-image-folder": "/Users/yourname/Downloads/images"
324
487
  }
325
488
  ```
326
489
 
327
- #### 2. Channels Config
490
+ **Key Settings:**
491
+
492
+ | Key | Purpose | Used By | Required |
493
+ |-----|---------|---------|----------|
494
+ | `video-projects-root` | Root directory for all video projects | VAT commands | ✅ For VAT |
495
+ | `ecamm-recording-folder` | Where Ecamm Live saves recordings | Move Images | Optional |
496
+ | `download-folder` | General downloads directory | Move Images | Optional |
497
+ | `download-image-folder` | Image downloads (defaults to `download-folder`) | Move Images | Optional |
498
+
499
+ **Safe to:**
500
+ - ✅ Version control (after removing personal paths)
501
+ - ✅ Share with team (as template)
502
+ - ✅ Commit to git (as `.example` file)
503
+
504
+ #### 2. Channels Config (`~/.config/appydave/channels.json`)
328
505
  YouTube channel definitions for multi-channel management.
329
506
 
330
- **Typical structure:**
507
+ **Structure:**
331
508
  ```json
332
509
  {
333
- "channels": [
334
- {
335
- "code": "main",
336
- "name": "Main Channel",
337
- "youtube_handle": "@channelhandle"
510
+ "channels": {
511
+ "appydave": {
512
+ "code": "ad",
513
+ "name": "AppyDave",
514
+ "youtube_handle": "@appydave",
515
+ "locations": {
516
+ "content_projects": "/path/to/content",
517
+ "video_projects": "/Users/yourname/dev/video-projects/v-appydave",
518
+ "published_projects": "/path/to/published",
519
+ "abandoned_projects": "/path/to/abandoned"
520
+ }
338
521
  }
339
- ]
522
+ }
340
523
  }
341
524
  ```
342
525
 
343
- #### 3. YouTube Automation Config
344
- Automation workflow configurations and sequences.
526
+ **Channel Properties:**
345
527
 
346
- #### 4. OpenAI Config (via dotenv)
347
- OpenAI API integration settings managed through environment variables:
528
+ | Property | Description | Example |
529
+ |----------|-------------|---------|
530
+ | `key` | Internal identifier (object key) | `"appydave"` |
531
+ | `code` | Short code for project naming | `"ad"` |
532
+ | `name` | Display name | `"AppyDave"` |
533
+ | `youtube_handle` | YouTube @ handle | `"@appydave"` |
348
534
 
349
- ```bash
350
- # .env file
351
- OPENAI_API_KEY=your_api_key_here
352
- ```
535
+ **Location Properties:**
536
+
537
+ | Location | Purpose | Can Use "NOT-SET" |
538
+ |----------|---------|-------------------|
539
+ | `content_projects` | Content planning/scripts | ✅ Yes |
540
+ | `video_projects` | Active video projects | ❌ No (required) |
541
+ | `published_projects` | Published video archives | ✅ Yes |
542
+ | `abandoned_projects` | Abandoned projects | ✅ Yes |
543
+
544
+ Use `"NOT-SET"` as a placeholder for unconfigured locations.
353
545
 
354
- ### Configuration Locations
355
- Configuration files are typically stored in:
356
- - `~/.config/appydave-tools/` (user-level)
357
- - Or project-specific locations as defined in settings
546
+ **Safe to:**
547
+ - Version control structure (remove personal paths first)
548
+ - ⚠️ Each developer customizes paths locally
549
+ - Share channel definitions (codes, names, handles)
358
550
 
359
- ### Environment Variables
360
- The gem uses `dotenv` for environment variable management. Create a `.env` file in your project root:
551
+ #### 3. YouTube Automation Config (`~/.config/appydave/youtube_automation.json`)
552
+ Automation workflow configurations and sequences (internal use).
553
+
554
+ #### 4. Environment Variables (`.env` file - project root)
555
+ **⚠️ CRITICAL: Secrets and API keys stored here, NEVER commit to version control!**
361
556
 
362
557
  ```bash
363
- # Required for YouTube API
364
- GOOGLE_CLIENT_ID=your_client_id
365
- GOOGLE_CLIENT_SECRET=your_client_secret
558
+ # OpenAI API Configuration (required for prompt_tools and youtube_automation)
559
+ # Get your API key from: https://platform.openai.com/api-keys
560
+ OPENAI_ACCESS_TOKEN=sk-your-actual-api-key-here
561
+ OPENAI_ORGANIZATION_ID=org-your-actual-org-id
366
562
 
367
- # Required for OpenAI features
368
- OPENAI_API_KEY=your_openai_api_key
563
+ # Enable OpenAI tools (set to 'true' to enable)
564
+ TOOLS_ENABLED=false
369
565
  ```
370
566
 
371
- **IMPORTANT:** Never commit `.env` files to version control. Ensure `.env` is in your `.gitignore`.
567
+ **Environment Variables:**
568
+
569
+ | Variable | Purpose | Required For | Secret? |
570
+ |----------|---------|--------------|---------|
571
+ | `OPENAI_ACCESS_TOKEN` | OpenAI API key | prompt_tools, youtube_automation | ✅ SECRET |
572
+ | `OPENAI_ORGANIZATION_ID` | OpenAI org ID | prompt_tools, youtube_automation | ✅ SECRET |
573
+ | `TOOLS_ENABLED` | Enable OpenAI configuration | Optional | ❌ No |
574
+
575
+ **Safe to:**
576
+ - ❌ **NEVER** version control
577
+ - ❌ **NEVER** share
578
+ - ❌ **NEVER** commit to git
579
+ - ✅ Keep local only
580
+ - ✅ Share `.env.example` template
581
+
582
+ ### Safety Features
583
+
584
+ **Automatic Backups:**
585
+ - Every config save creates timestamped backup: `filename.backup.YYYYMMDD-HHMMSS`
586
+ - Backups stored alongside config files in `~/.config/appydave/`
587
+ - Restore from backup: `cp settings.json.backup.20251109-203015 settings.json`
588
+
589
+ **Safe Configuration Creation:**
590
+ - `ad_config -c` only creates missing files, never overwrites existing ones
591
+ - Prevents accidental data loss from running setup commands
592
+
593
+ **Secrets Separation:**
594
+ - API keys stored in `.env` files (gitignored), not in JSON configs
595
+ - Configuration files can be safely version-controlled (after removing personal paths)
596
+
597
+ ### Migration from Legacy Config
598
+
599
+ **From `~/.vat-config` (DEPRECATED):**
600
+
601
+ The old `~/.vat-config` file is no longer used. VAT now uses `settings.json`.
602
+
603
+ **Migration steps:**
604
+ 1. Check your old config: `cat ~/.vat-config`
605
+ 2. Add value to settings.json: `ad_config -e`
606
+ 3. Add: `"video-projects-root": "/your/path/from/vat/config"`
607
+ 4. Test VAT still works: `vat list`
608
+ 5. Delete old file: `rm ~/.vat-config`
609
+
610
+ **Note:** The `vat init` command is deprecated. Use `ad_config -c` instead.
372
611
 
373
612
  ## Git Hooks & Security
374
613