mirror of
https://github.com/EveryInc/compound-engineering-plugin.git
synced 2026-09-19 01:09:55 +08:00
34e79c8f3c
Adds an `output:html` / `output:md` argument to ce-plan and ce-brainstorm so the agent emits the artifact as a single self-contained HTML file when the user wants a rendered surface (TOC, diagrams, collapsibles) instead of markdown. Output mode is exclusive — the skill writes either `.md` OR `.html`, never both. Pipeline mode forces markdown so automated downstream consumers always get a stable text shape. Replaces the prescriptive template files with a two-layer reference architecture: - **Section contract per skill** (`plan-sections.md`, `brainstorm-sections.md`) describes WHAT the artifact contains: outcome statements, a decide-whether- warranted off-ramp, hard floor of required sections, an include-when- material catalog (Key Decisions placed early as framing choices), agent agency above the floor, and ID/content rules (continuous R-IDs across groups, repo-relative paths, ASCII identifiers). - **Format-rendering ref per format** (`markdown-rendering.md`, `html-rendering.md`, byte-duplicated across ce-plan and ce-brainstorm) describes HOW to render the contract in that format: hard invariants, precedence stack for style preferences, format principles, affordance idioms, agent-consumability rules, and a post-compose audit. The HTML reference teaches failure-mode defenses as principles, not pinned values: local text contrast (defends against muted-on-tinted washout), body `<strong>` uncolored by default, no JS framework runtimes, paint-order halo on diagram labels (width is a judgment call), geometry-first shape differentiation, plan diagrams are not directional sketches, and a single-source-of-truth rule (no hidden `<script type="application/json">` metadata copy — metadata is visible text only). Stable IDs appear as both anchor IDs and visible text so downstream agents (ce-work, ce-doc-review) can scan an HTML plan the same way they scan markdown. ce-work is updated to glob both formats, flip status visibly in HTML (`<span class="status">active</span>` → `completed`) alongside the markdown frontmatter convention, and tolerate HTML wrapper noise when locating section regions by their contract name. Tests pin the architecture: byte-parity across the two rendering refs, exclusivity of output mode (no `OUTPUT_FORMAT_SOURCE`, format-keyed option 4 in the post-generation menu), and the failure-mode defenses in html-rendering.md.