Skip to content

feat(ga): make BrewPress site-agnostic and production-ready#4

Merged
ucguy4u merged 3 commits into
mainfrom
feat/ga-release
Apr 9, 2026
Merged

feat(ga): make BrewPress site-agnostic and production-ready#4
ucguy4u merged 3 commits into
mainfrom
feat/ga-release

Conversation

@ucguy4u

@ucguy4u ucguy4u commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Site-agnostic: removed every hardcoded DevelopersCoffee.com reference from draft_agent.py. Style guide and prompts now use BREWPRESS_SITE_NAME / BREWPRESS_SITE_FOCUS env vars (both optional, sane defaults)
  • Tone fingerprint: DraftAgent.__init__ loads ~/.brewpress/tone.json when present and appends it to the system prompt automatically — silent miss if calibrate hasn't run
  • brewpress doctor: new pre-flight command that checks Python version, all four env vars, HTTPS enforcement, WordPress connectivity, Gemini package install, and tone fingerprint presence
  • Binary builds: release workflow now builds single-file native binaries for Linux x86-64, macOS arm64, and Windows x86-64 via PyInstaller in addition to sdist/wheel
  • README rewrite: production-quality docs — no user-specific content, clear install path, full command reference, site customization section, CI/CD notes
  • .env.example update: added BREWPRESS_SITE_NAME and BREWPRESS_SITE_FOCUS with commented-out defaults
  • Lint clean: fixed all ruff errors across src/ and tests/ (unused imports, line length, import ordering, unused variables)

Test plan

  • python -m pytest tests/ — 496 tests, all pass
  • python -m ruff check src/ tests/ — no errors
  • brewpress doctor exits 0 with valid .env, exits 1 with missing vars
  • brewpress draft --topic "..." uses default site name in generated content
  • Set BREWPRESS_SITE_NAME="Acme Blog" and confirm draft prompt reflects it
  • brewpress calibrate writes ~/.brewpress/tone.json, next draft picks it up

🤖 Generated with Claude Code

uday chauhan and others added 3 commits April 5, 2026 21:16
- Remove hardcoded DevelopersCoffee.com from draft_agent.py; replace with
  configurable BREWPRESS_SITE_NAME / BREWPRESS_SITE_FOCUS env vars
- Add _build_style_guide() that injects tone.json fingerprint when available
- Add brewpress doctor command for env/connectivity pre-flight checks
- Add PyInstaller binary matrix (Linux/macOS/Windows) to release workflow
- Rewrite README for GA: no user-specific content, clear install and config docs
- Update .env.example with site customization vars and usage notes
- Fix all ruff lint errors across src/ and tests/

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Implements the Blog Boost Assistant ADK spec as a first-class BrewPress module:

- BlogBoostAgent: Gemini-backed optimizer with 8 task types
  (seo_audit, rewrite, title_suggestions, meta_description,
   content_feedback, topic_ideas, internal_linking, engagement_message)
- BoostRequest / BoostResult: Pydantic models matching the ADK I/O schema
- Per-task prompt builders with SEO heuristics baked in
  (title 50-60 chars, meta 120-160 chars, keyword in first 100 words,
   H1/H2/H3 rules, keyword density guardrails, no clickbait/stuffing)
- brewpress boost CLI command: runs any task, supports --from-draft to
  load the current saved draft, --json for structured output, --content
  as inline text or path to a .md file
- 31 tests covering construction, parsing, prompt builders, agent runs,
  and error paths

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…rytelling layer

Generator + Critic loop:
- CriticAgent evaluates a BlogJob on 4 dimensions (SEO, clarity, technical
  accuracy, publish readiness), returns pass/revise verdict + revision_instruction
- Deterministic rule overrides model verdict when any score < PASS_THRESHOLD (4)
- brewpress critic [--apply] [--eval] command wires it into the review loop
- brewpress draft --auto-critic runs the critic inline after generation

Deterministic eval (no API):
- boost_eval.run_checks() performs 8 checks: title length, meta length, keyword
  presence, keyword in intro, heading hierarchy, keyword density (stuffing guard),
  code block language hints, hook quality
- Zero external dependencies; instant feedback before burning API tokens

Multimedia attachment:
- upload_image_file() now returns UploadedMedia(id, url, filename) instead of int
- publish() accepts gallery_media list; appended as <figure> tags in post content
- brewpress approve-publish --attach FILE [FILE...] uploads and attaches media
- Orchestrator.publish() accepts extra_media_paths for programmatic use

Storytelling layer (from ADK blog structure spec):
- DraftAgent system prompt extended with Problem→Solution→Expansion arc,
  narrative structure rules (Hook, Prerequisites, Core, Run/Debug, CTA),
  and storytelling techniques (show don't tell, reader as hero, real friction)
- DraftSchema gains hook and cta fields; BlogJob gains hook and cta content fields
- blog_boost.py system prompt versioned as v1.0

62 new tests across test_critic_agent.py and test_boost_eval.py

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@ucguy4u
ucguy4u merged commit 3a2e7f6 into main Apr 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant