3 Commits

Author SHA1 Message Date
AgriciDaniel 5c21c90bc0 fix(audit): grand-audit remediation across all 32 sub-skills + v1.11.0
A 17-agent Codex (gpt-5.5, xhigh) audit of the skill repo and brain vault
surfaced 672 findings; 11 file-disjoint Codex fix agents remediated them,
folding in best-practice ports from Gogh and the Fable-5 brain.

Security: SSRF guards (generate_hero redirect bypass, blog_preflight HEAD,
nlp_analyze, all URL-fetch sub-skills), XSS escaping (blog_render raw HTML +
attrs, audio embed, google_report, video srcdoc, Hugo unsafe), path/symlink
write confinement, API-key redaction in logs, agent tool least-privilege.

Delivery contract: deterministic strict gates, review nonce moved out of the
draft dir, broken images/links now block, first-failure halt, repair-only
iteration counting.

Currency (2026): FAQPage + E-E-A-T reframed to Google guidance, Google-Extended
corrected, GA Gemini image IDs and 3.1 TTS, MCP schema alignment, Ads v24.2.

Consistency: one 30/25/15/15/15 scoring rubric, fixed broken reference/template
paths, added missing scripts (discourse_research.py, sync_flow.py), Gogh
deterministic chart-SVG CLI, restored orchestrator Untrusted-Data Contract.

Packaging: v1.11.0 across plugin.json/pyproject/CITATION/README/CHANGELOG,
217->232 tests, installer defaults to AI-Marketing-Hub/claude-blog.

Verify: 232 tests pass, prose lint clean, claude plugin validate passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 15:45:30 +03:00
Daniel c72877a2d1 fix(security): CI/Deps/Misc hardening + sync_flow blocking drift
Closes 9 audit findings (4 MEDIUM + 4 LOW + 1 INFO) across CI, dependency
hygiene, supply-chain, path-traversal, and operational visibility.

CI workflow (.github/workflows/ci.yml):
- Add top-level `permissions: contents: read` (closes VULN-501).
- Add `concurrency: cancel-in-progress: true` to save runner minutes.
- Replace ad-hoc `pip install pytest textstat beautifulsoup4` with
  `pip install -e ".[dev]"` so PR builds resolve identically to local
  development and stay within the bounded ranges (closes VULN-502).

Dependabot (.github/dependabot.yml):
- Add 3 nested-manifest entries: skills/blog-google/scripts,
  skills/blog-notebooklm/scripts, skills/blog-audio/scripts. Previously
  Dependabot was blind to ~80% of the dependency surface (closes VULN-504).

pyproject.toml:
- Bound the previously-unbounded `advanced` extras (lxml, jsonschema, spacy,
  sentence-transformers, scikit-learn, language-tool-python). Closes VULN-406.
- Sync `core` extras with requirements.txt upper bounds (closes VULN-407).
- Add new `ads` optional group with `google-ads>=22.0.0,<26.0.0` to declare
  the previously-phantom import in keyword_planner.py (closes VULN-404).
- Pin `pytest>=8.0,<9.0` in `dev` (was open-ended).

keyword_planner.py:
- Move `import os` to module top (was gated inside `except ImportError`,
  causing NameError on the happy path — VULN-008 functional bug).
- Update install hint to point at the new `pip install 'claude-blog[ads]'`
  extras group.

google_report.py:
- Replace `domain.replace(":","_").replace("/","_")` with whitelist
  `re.sub(r"[^A-Za-z0-9._-]", "_", domain)[:128]` and add containment
  assertion via `Path.resolve()` to refuse writes outside output_dir
  (closes VULN-014 path traversal on Windows backslash, NUL byte, etc.).

scripts/sync_flow.py (W10 worker):
- Restructure `sync()` into 5 explicit phases: (1) fetch+stage in memory,
  (2) compute drift against lockfile from staged hashes, (3) enforce drift
  policy with `sys.exit(2)` UNLESS --allow-drift OR --dry-run, (4) write
  staged content via record_write (preserves atomic + path-traversal +
  host-allowlist guards), (5) write lockfile.
- New `--allow-drift` argparse flag. Drift now blocks BEFORE filesystem
  mutation, not after (closes VULN-018 indirect prompt injection vector
  via T11 instruction-context boundary).

install.sh + install.ps1:
- Capture pip stderr to a logfile (`mktemp` on Unix, GUID temp on Windows)
  instead of swallowing with `2>/dev/null`. Surface logfile location on
  failure with first-error line (closes VULN-507/804: silent dependency
  install failures hid supply-chain anomalies).

README.md:
- Reframe install-flow ordering: clone+checkout-tag is now the recommended
  path, with curl|bash documented as a convenience option carrying explicit
  trust caveat (closes VULN-005 supply-chain CTI risk; not auto-CRITICAL
  per audit gates, addressed via documentation rather than removal).

Verifier gate (passing):
- pytest tests/ -> 51 passed
- python3 scripts/sync_flow.py --help -> shows --allow-drift flag
- ast.parse on all modified .py files -> OK
- claude plugin validate . -> Validation passed

Council: codex GPT-5.5 high-reasoning. Codex Q1 (split into commits)
applied: this is commit 3 of 3 in the audit-fix series.

Audit: ../Documents/Obsidian Vault/wiki/audits/2026-04-27 claude-blog
       cybersecurity skill audit + 7-agent dispatch.md
Follows: 478c1b9 (Commit 2, credentials/OAuth), f48a719 (Commit 1, MCP/secret).

Deferred (next iteration, not release-blocking):
- VULN-006 lock file generation (separate generated commit per codex Q2)
- VULN-503 SHA-pin GitHub Actions (Dependabot already covers tag bumps)
- VULN-016 patchright SHA hash, VULN-021 stack-trace cleanup (~12 sites),
  VULN-022 bare except cleanup, VULN-031 import-time side effects, and
  remaining LOW/INFO items (~10).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 16:14:39 +03:00
Daniel bb12717899 feat(blog-flow): integrate FLOW framework prompts (find/optimize/win/sync)
New skills/blog-flow/ sub-skill ports the seo-flow pattern to the blog
surface. Surfaces 30 blog-applicable evidence-led prompts from FLOW
(github.com/AgriciDaniel/flow, CC BY 4.0 content + MIT code).

Commands:
  /blog flow                        Show overview + stage menu
  /blog flow find [topic|url]       5 prompts: keyword/intent/audience
  /blog flow optimize [url]         21 prompts: select 2-3 by context
  /blog flow win [url]              3 prompts: BOFU, conversion, scorecard
  /blog flow prompts                Full index (incl. 1 leverage prompt)
  /blog flow sync                   Pull latest from FLOW repo

The local-stage prompts (GBP, citations, local audits) are intentionally
excluded; those target brick-and-mortar work, not blogs. Use claude-seo's
seo-flow for the local stage.

scripts/sync_flow.py:
  - Stdlib only (urllib, no requests/PyGithub).
  - HTTPS-only host allowlist (api.github.com).
  - 5 MB response size cap.
  - Atomic writes via tempfile + rename.
  - Path-traversal guard (every output path must resolve inside
    skills/blog-flow/references/).
  - Anonymous-first GitHub API; honors GITHUB_TOKEN env or `gh auth
    token` only after a 403.
  - --dry-run reports planned changes without writing.
  - --ref <sha> pins fetches to a specific FLOW commit for
    reproducible installs.
  - SHA-256 lockfile (flow-prompts.lock) with drift detection on
    every run.
  - CC BY 4.0 license-header injection on every synced markdown
    file plus the auto-generated prompts/README.md index.

Initial sync of 33 files included (5 find + 1 leverage + 21 optimize +
3 win + framework + bibliography + index). All carry the CC BY 4.0
attribution header.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 14:04:09 +03:00