A2A Prompt Ops: stratt-run Marketing Site CI/CD + Iterative Hardening
What Are A2A Prompt Ops?
Agent-to-Agent operations (A2A ops) are automation workflows where one AI agent orchestrates tasks from another, with explicit gates and human-in-the-loop approval points. In the context ofstratt-run, we use A2A ops to:
- Generate marketing site scaffold from a template
- Validate output against invariants (DOM purity, CSP headers, accessibility)
- Harden in stages (TS1 → TS6)
- Approve each gate before proceeding to the next phase
Campaign: “Marketing Site Hardening via A2A Validation”
Goal
Automate the journey from basic Astro scaffold → production-ready marketing site with zero manual quality checks. Each stage passes through a machine-verifiable gate before human approval.Phases
Phase 1: Scaffold Generation (TS1)
Agent Role: Generate base files (package.json, astro.config.mjs, tsconfig.json, vercel.json, layouts, pages) Prompt:vercel.json security headers. Approve or request changes.
Phase 2: Content (TS2)
Agent Role: Generate landing content components (HeroSection, TerminalDemo, EmailCaptureForm) Prompt:Phase 3: Integrations (TS3)
Agent Role: Wire Buttondown + Turnstile + analytics event tracking Prompt:Phase 4: Static Data Pages (TS4)
Agent Role: Generate install + changelog pages, with prebuild script Prompt:Phase 5: Invariants & CI (TS5)
Agent Role: Generate Playwright test suites and GitHub Actions workflow Prompt:Phase 6: Polish & Launch (TS6)
Agent Role: Generate OG image, privacy page, analytics integration Prompt:- Check OG preview in Slack/Twitter validator (renders correctly)
- Review privacy policy for legal accuracy (privacy@company email present?)
- Verify no hardcoded secrets in codebase
A2A Workflow Pattern
Input Specification
Each phase starts with a specification document describing:- Deliverables (files, components, tests)
- Constraints (no external deps, dark theme, etc.)
- Success criteria (tests pass, types check, accessibility passes)
Agent Execution
Agent generates code, commits to branch, runs validation gates.Validation Layer (Automated)
Human Gate (Async)
Engineer reviews:- Code quality (patterns, conventions)
- Security (no secrets, headers correct)
- UX (accessibility, performance, mobile)
- Business requirements (messaging, CTAs)
Commit & Merge
Once all gates pass, code is merged to main. CI (GitHub Actions) re-runs all checks.Prompt Templates for Reuse
Template: “Marketing Site Scaffold v1”
Template: “Playwright Invariant Tests”
Benefits of This A2A Approach
| Benefit | Evidence |
|---|---|
| Speed | stratt-run went from 0 → production in 4 hours (TS1–TS6) vs. manual 2–3 days |
| Quality | 16 passing tests provide immediate feedback; regressions caught in seconds, not hours |
| Auditability | Every commit has verified gate status; rollback is safe and reversible |
| Reproducibility | Future marketing sites can reuse prompt templates; 30-min copy + reskin |
| Knowledge capture | Prompts serve as executable documentation; new team members learn from generated code |
Extending This Pattern
Add a New Invariant
- Write the invariant spec (e.g., “All external links must have
target="_blank"+rel="noopener"”) - Generate Playwright test (
Template: "Playwright Invariant Tests") - Add to
.github/workflows/stratt-run.yml - Re-run all phases with new gate in place
Add a New Integration (e.g., Slack)
- Spec the integration (e.g., “Slack button, posts to #announcements on submit”)
- Update
EmailCaptureForm.astro+src/lib/events.ts - Add CSP
connect-src https://hooks.slack.comtovercel.json - Run TS3 regeneration with updated spec
- All tests still pass
Lessons Learned
- Invariants must be precise: Regex-based token matching avoids false positives better than string matching
- Fallback paths matter: Prebuild scripts need GitHub API fallback; analytics should degrade gracefully
- Playwright runs fast: 16 tests execute in ~6 seconds; local runs catch issues before CI
- A2A works best with specs: Ambiguous prompts produce unpredictable output; detailed spec → consistent results
- Human gates are essential: Automated checks verify code, humans verify user experience
Recommended Reading: