The Problem

Content teams need a way to generate SaaS marketing copy without manually drafting each piece. Existing tools either require constant prompting or lack persistence across iterations, forcing engineers to rebuild the workflow for every project.

What This Does

ralph-wiggum-marketer is a Claude Code Plugin that runs an autonomous copy‑writer loop. The plugin’s entry points are the markdown command files in commands/ (e.g. ralph-init.md, ralph-marketer.md). When a user invokes /ralph-init, the plugin reads the PRD (templates/prd.json) and creates a SQLite database (scripts/src/db/*.js) to store trends, research, and drafts. Subsequent commands (/ralph-marketer, /ralph-status, /ralph-cancel) drive the loop: pick a pending task, generate a draft, run the test suite (scripts/src/test.js), commit the result, and update progress files (templates/progress.txt).

Key files:

  • .claude-plugin/plugin.json – plugin manifest consumed by Claude.
  • scripts/src/db/*.js – SQLite helpers (init.js, seed.js, query.js, status.js).
  • scripts/src/content/list.js – reads the content list from the DB.
  • scripts/src/test.js – defines test and assert used by the loop to verify output.
  • hooks/stop-hook.sh – invoked to abort a running loop; contains 20 branch points over 58 lines (high branching density).

How It Is Wired

  1. User command → Claude reads the matching markdown file in commands/.
  2. The command triggers the plugin’s runtime, which loads scripts/src/db/init.js to ensure the SQLite DB exists.
  3. scripts/src/db/seed.js may populate initial tables; scripts/src/db/status.js reports progress.
  4. The main loop (logic lives in the plugin’s internal Claude code, not in this repo) calls scripts/src/content/list.js to fetch pending tasks.
  5. For each task the loop executes scripts/src/db/query.js → printTable to display current DB state.
  6. Draft generation is external to the repo; after a draft is produced, scripts/src/test.js runs test/assert to enforce acceptance criteria.
  7. On success the loop writes files (progress.txt, prd.json) and commits via the host Git client.
  8. If the user issues /ralph-cancel, Claude runs hooks/stop-hook.sh, which decides whether to abort based on its 20 branches.

The internal call graph shows only three direct calls: test → assert (within test.js) and printTable invoked from the loop. No circular imports exist, so each module is isolated, reducing the blast radius of changes.

How To Use It

# Clone the upstream repository
git clone https://github.com/moses-y/ralph-wiggum-marketer.git
cd ralph-wiggum-marketer

# Install Node dependencies
npm ci   # uses package-lock.json

# Add the plugin to Claude Code (recommended)
/plugin marketplace add muratcankoylan/ralph-wiggum-marketer
/plugin install ralph-wiggum-marketer@muratcankoylan-ralph-wiggum-marketer

# Or run locally for development
claude --plugin-dir ./ralph-wiggum-marketer

After installation, use the Claude chat commands documented in README.md:

  • /ralph-init – creates a new project and DB.
  • /ralph-marketer – starts the autonomous copywriter loop.
  • /ralph-status – reads templates/progress.txt.
  • /ralph-cancel – runs hooks/stop-hook.sh to stop the loop.

No additional environment variables or secrets are required by the repository itself.

Real‑World Use

A SaaS startup could embed this plugin in its internal Claude instance. When a new feature ships, a product manager runs /ralph-init with a PRD describing the feature. The plugin automatically pulls market trends, drafts a blog post, runs the lightweight test suite, and commits the draft to the repo. The team reviews the commit, merges, and publishes without ever leaving Claude.

Code Health & Issues

  • High – Missing LICENSE – No LICENSE file; default is “all rights reserved”, blocking reuse. Fix: add MIT or Apache‑2.0 at repository root.
  • Medium – Dependabot not configured – Two package*.json files but no .github/dependabot.yml. Fix: add a Dependabot config covering npm.
  • Medium – High branching density in hooks/stop-hook.sh (20 branches / 58 lines). Fix: refactor into smaller functions or a strategy table.
  • Dependency lag – better-sqlite3 declared ^11.0.0; latest is 13.0.3 (2 major versions behind). Update to stay current with security patches.

No CI pipeline, Dockerfile, or test suite beyond scripts/src/test.js is present.

The Bottom Line

The plugin provides a functional, low‑coupling framework for autonomous copywriting within Claude, but it lacks production‑grade hygiene: no license, no automated dependency updates, and a complex shell abort script. It is suitable for internal prototyping or teams comfortable adding CI, licensing, and dependency management themselves.