pasha

byletsmoj moj

This is "youtube-automation-agent" — you're turning it into "PaashaClips Studio": a zero-API-key, fully local YouTube content pipeline that also auto-generates Shorts from every video it produces. Everything must run free, offline, on this machine — no paid API keys anywhere in the core pipeline. The only exception is YouTube publishing itself, which needs one free Google Cloud OAuth client — and that must stay a clearly optional, skippable final step, not a requirement to use the app. START HERE - Run /init if you haven't already, so you have a map of this codebase. - Read index.js, the agents/ folder, database/db.js, utils/credential-manager.js, and utils/ffmpeg.js before making changes — confirm my description of the existing architecture below matches what's actually there, and tell me if it doesn't before proceeding. - Existing architecture (verify this): 7 agents (ContentStrategyAgent, ScriptWriterAgent, ThumbnailDesignerAgent, SEOOptimizerAgent, ProductionManagementAgent, PublishingSchedulingAgent, AnalyticsOptimizationAgent), a Database class (sqlite3), CredentialManager, an Express dashboard on port 3456, a DailyAutomation scheduler, and duplicate OAuth flows in modern-auth.js and oauth-server.js. Work through the phases below in order. After each phase: run `npm test` and `npm run lint`, show me a summary of what changed, and wait for me to say "continue" before starting the next phase. Don't break the existing 12 system tests or the simulation-fallback behavior (pipeline must still run with zero dependencies installed, for testing purposes). ═══════════════════════════════════════ PHASE 1 — FIX EXISTING WEAK SPOTS ═══════════════════════════════════════ 1. Consolidate modern-auth.js and oauth-server.js into one OAuth module — keep modern-auth.js's auto-browser-open UX, remove the duplicate flow. Update package.json scripts and README references. 2. Add a loud startup warning (not just logger.warn) if NODE_ENV=production and API_KEY is unset. 3. If FFmpeg isn't found at startup, refuse to start the scheduler entirely (fail loud, not silent — currently it only warns). ═══════════════════════════════════════ PHASE 2 — SWAP TO A FULLY LOCAL, FREE AI STACK ═══════════════════════════════════════ 4. Replace cloud LLM calls in ContentStrategyAgent and ScriptWriterAgent with calls to a local Ollama instance (http://localhost:11434) — e.g. llama3.1:8b, configurable via .env (OLLAMA_MODEL). No API key. 5. Replace ThumbnailDesignerAgent's AI image generation with a templated thumbnail: background + title text overlay using Sharp (already a dependency). Zero external calls. 6. Replace the TTS step in ProductionManagementAgent with a local Piper TTS call instead of any cloud TTS provider. 7. Add startup capability checks for Ollama/Piper (is the service running / binary installed?) in the same style as utils/ffmpeg.js's checkFFmpeg() — clear plain- English install instructions if missing, never a silent crash. 8. Update the capability-check summary in index.js's logCapabilitySummary() to reflect the new local stack instead of the old OpenAI/Gemini/ElevenLabs/Azure checks. ═══════════════════════════════════════ PHASE 3 — SHORTS CLIPPING (NEW AGENT) ═══════════════════════════════════════ 9. Create agents/shorts-clipping-agent.js, following this repo's existing agent pattern (constructor takes db + credentials, has initialize()). After ProductionManagementAgent finishes the long-form .mp4: - Transcribe it locally with faster-whisper (spawn as a Python subprocess, or find a suitable Node binding — your call based on what's cleanest given the existing codebase). - Ask the local Ollama model to pick the 2-3 highest-hook-potential segments. - Cut those segments with FFmpeg into 9:16 vertical clips. - Burn in word-by-word captions using the word-level timestamps faster-whisper provides. 10. Add a `shorts` table to database/db.js: contentId (FK), path, title, durationSec, status (pending_review/approved/rejected). Extend saveProductionData to insert rows. 11. Wire the new agent into index.js's generateContent(), between the production step and the DB-save step. 12. Feature-flag with ENABLE_SHORTS_CLIPPING=true in .env — pipeline must still run correctly with it off, or with faster-whisper not installed (graceful degradation, matching the FFmpeg-check pattern). ═══════════════════════════════════════ PHASE 4 — SIMPLE APPROVAL STEP ═══════════════════════════════════════ 13. Add status: 'pending_review' after production/shorts-clipping completes, before scheduleContent() runs. Nothing publishes without explicit approval — this is a single dashboard action, not a multi-status workflow: just Approve or Reject. 14. Add a minimal dashboard section showing the generated video + thumbnail + shorts with one Approve / Reject button each. Keep this simple — no separate queue page, no elaborate states. ═══════════════════════════════════════ PHASE 5 — ONE-CLICK RUN + OPTIONAL YOUTUBE CONNECTION ═══════════════════════════════════════ 15. Add a single "Generate Video Now" button on the main dashboard that triggers /generate and shows live progress through each stage (strategy → script → thumbnail → TTS → video → shorts). No automation scheduler, no multi-channel support — keep this to one channel, one manual trigger button for now. 16. Make YouTube connection a clearly separate, optional dashboard section: "Connect YouTube (optional)." Without connecting, approved videos just stay in data/videos/, ready for manual upload — the app must be fully useful without ever touching Google's API. ═══════════════════════════════════════ PHASE 6 — REBRAND TO "PaashaClips Studio" ═══════════════════════════════════════ 17. Update package.json name/description, README title, dashboard <title>/header text, and the console startup banner in index.js. 18. Replace the hardcoded "Ethereal Dreamscript" strings in the OAuth success page (both the HTML shown in-browser and the console.log messages) with "PaashaClips Studio." 19. Grep the codebase for any other leftover old-name display strings and update them. Do NOT rename the npm package's internal "name" field or anything referenced programmatically elsewhere — only change user-facing display text. ═══════════════════════════════════════ PHASE 7 — SETUP UX ═══════════════════════════════════════ 20. Update setup.js/walkthrough.js to check for Ollama, Piper, faster-whisper, and FFmpeg — matching the existing FFmpeg-check tone — and give install instructions for whichever are missing. No API key prompts unless the user chooses to also connect YouTube. 21. Update CONTRIBUTING.md/README to describe the new zero-key local stack and how to test the full pipeline end-to-end without any accounts. CONSTRAINTS THROUGHOUT - Nothing in the core pipeline may require an API key, credit card, or paid tier. - The only credential anywhere in the app is the optional YouTube OAuth client. - One concern per commit — commit after each phase with a clear message, don't batch everything into one giant commit. - Add a regression test in test.js for each new piece of behavior, following the existing SystemTest pattern. - Don't touch package-lock.json unless a dependency actually changes.

Landing
Landing

Comments (0)

No comments yet. Be the first!

Project Tasks

29 planning tasks
#1

Generate system requirement document

3m 54s0.1 cr used
Done
#2

Generate personas & user flows

0m 7s0.1 cr used
Done
#7

Create flow for Solo Creator / Operator

0m 6sCredits in parent
Done
#8

Create flow for Setup / Installer

0m 6sCredits in parent
Done
#9

Landing

6m 53sCredits in subtasks
Done
#19

Repair Landing JSX

1m 7s0.2 cr used
Done
#15

Landing / Navigation

0m 24s0.8 cr used
Done
#12

Landing / Filmstrip Hero

0m 46s0.8 cr used
Done
#13

Landing / Local Stack

0m 41s0.8 cr used
Done
#14

Landing / Local Handoff

0m 40s0.8 cr used
Done
#16

Landing / Footer

0m 16s0.8 cr used
Done
#17

Navigation

0m 24sCredits in parent
Done
#18

Footer

0m 16sCredits in parent
Done
#10

Login

5m 56sCredits in subtasks
Error
#31

Repair Login JSX

0m 39s0.2 cr used
Done
#30

Repair Login JSX

0m 41s0.2 cr used
Done
#21

Login / Navigation

0m 0s0.8 cr used
Done
#20

Login / Identity Console

0m 29s0.8 cr used
Done
#22

Login / Footer

0m 0s0.8 cr used
Done
#11

Dashboard

5m 13sCredits in subtasks
Paused
#28

Dashboard / Navigation

0.8 cr needed
Paused
#23

Dashboard / Pipeline Rail

0.8 cr needed
Paused
#24

Dashboard / Run Console

0.8 cr needed
Paused
#25

Dashboard / Asset Review

0.8 cr needed
Paused
#26

Dashboard / Capability Cassette

0.8 cr needed
Paused
#27

Dashboard / You Tube Optional

0.8 cr needed
Paused
#29

Dashboard / Footer

0.8 cr needed
Paused
#5

Architecture

0.1 cr needed
Paused
#6

Workspace task plan

0.1 cr needed
Paused
Preview dataChanges stay in this preview.
Landing design preview
Landing: Read local setup guidance
Landing: Review required local stack
Landing: Continue to Dashboard
Dashboard: 1. Check local capability status
Dashboard: 2. Follow install instructions for missing capability
Dashboard: Generate Video Now
Dashboard: Confirm degraded pipeline run
Preview dataChanges stay in this preview.
Landing design preview
Landing: Read local setup guidance
Landing: Review required local stack
Landing: Continue to Dashboard
Dashboard: 1. Check local capability status
Dashboard: 2. Follow install instructions for missing capability
Dashboard: Generate Video Now
Dashboard: Confirm degraded pipeline run