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!

Architecture

No Services Diagrams Yet

Architecture diagrams will be automatically generated when the Project Manager creates tasks for your project.

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