haac-aikit 0.8.3 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/catalog/commands/html.md +54 -22
  2. package/catalog/release-notes.json +31 -0
  3. package/catalog/rules/AGENTS.md.tmpl +10 -0
  4. package/catalog/skills/tier1/html-artifacts.md +142 -96
  5. package/catalog/templates/html-artifacts/01-exploration-code-approaches.html +453 -0
  6. package/catalog/templates/html-artifacts/02-exploration-visual-designs.html +515 -0
  7. package/catalog/templates/html-artifacts/03-code-review-pr.html +638 -0
  8. package/catalog/templates/html-artifacts/04-code-understanding.html +491 -0
  9. package/catalog/templates/html-artifacts/05-design-system.html +629 -0
  10. package/catalog/templates/html-artifacts/06-component-variants.html +605 -0
  11. package/catalog/templates/html-artifacts/07-prototype-animation.html +455 -0
  12. package/catalog/templates/html-artifacts/08-prototype-interaction.html +396 -0
  13. package/catalog/templates/html-artifacts/09-slide-deck.html +592 -0
  14. package/catalog/templates/html-artifacts/10-svg-illustrations.html +492 -0
  15. package/catalog/templates/html-artifacts/11-status-report.html +528 -0
  16. package/catalog/templates/html-artifacts/12-incident-report.html +596 -0
  17. package/catalog/templates/html-artifacts/13-flowchart-diagram.html +395 -0
  18. package/catalog/templates/html-artifacts/14-research-feature-explainer.html +381 -0
  19. package/catalog/templates/html-artifacts/15-research-concept-explainer.html +368 -0
  20. package/catalog/templates/html-artifacts/16-implementation-plan.html +702 -0
  21. package/catalog/templates/html-artifacts/17-pr-writeup.html +595 -0
  22. package/catalog/templates/html-artifacts/18-editor-triage-board.html +573 -0
  23. package/catalog/templates/html-artifacts/19-editor-feature-flags.html +663 -0
  24. package/catalog/templates/html-artifacts/20-editor-prompt-tuner.html +722 -0
  25. package/catalog/templates/html-artifacts/MANIFEST.json +182 -0
  26. package/catalog/templates/html-artifacts/README.md +88 -0
  27. package/catalog/templates/html-artifacts/index.html +822 -0
  28. package/dist/cli.mjs +705 -246
  29. package/dist/cli.mjs.map +1 -1
  30. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- Generate an HTML artifact for the current context using the html-artifacts skill.
1
+ Produce an HTML artifact for the current context using the `html-artifacts` skill and the forked reference templates.
2
2
 
3
3
  ## Usage
4
4
  `/html [optional intent]`
@@ -6,24 +6,56 @@ Generate an HTML artifact for the current context using the html-artifacts skill
6
6
  ## Steps
7
7
 
8
8
  1. **Determine intent**
9
- - If called with args (e.g. `/html code review of today's PR`): use the args as the intent.
10
- - If called with no args: infer intent from the current conversation — what task is in progress, what was just discussed, what files are open.
11
-
12
- 2. **Pick the use-case pattern**
13
- Using the `html-artifacts` skill, identify which of the eight patterns fits:
14
- Spec/Planning, Code Review, Report/Research, Prototype, Custom Editor, Visual Explainer, Deck, or Design System.
15
-
16
- 3. **Generate the artifact**
17
- - Apply the built-in design system CSS tokens
18
- - If `docs/aikit-html-design-system.html` exists in the project, read it first and inherit its CSS variable values
19
- - Follow the structure guidance for the chosen pattern
20
- - Pure HTML/CSS/JS only no external CDN dependencies
21
- - Include in `<head>`: `<title>`, `<meta name="description" content="...">`, and `<meta name="aikit-pattern" content="...">` (the pattern name from step 2) — required for the index
22
-
23
- 4. **Save and report**
24
- - Determine a short slug from the intent (e.g. `code-review-auth-pr`, `weekly-report`)
25
- - Determine `NN` by listing existing files in `.aikit/artifacts/` (excluding `index.html`) and incrementing the highest number; start at `01`
26
- - Save to `.aikit/artifacts/NN-<slug>.html` (e.g. `07-code-review-auth-pr.html`)
27
- - Regenerate `.aikit/artifacts/index.html` per the "Index page (gallery)" section of the `html-artifacts` skill
28
- - Print both paths
29
- - Suggest opening: `open .aikit/artifacts/index.html` (macOS) / `xdg-open .aikit/artifacts/index.html` (Linux)
9
+ - With args (e.g. `/html code review of today's PR`): use the args as the intent.
10
+ - Without args: infer from the current conversation — what task is in progress, what was just discussed, what files are open.
11
+
12
+ 2. **Pick the pattern**
13
+ Match the intent to one of the **9 patterns** in `.claude/skills/html-artifacts.md`:
14
+ - Exploration & Planning (code approaches · visual directions · implementation plans)
15
+ - Code Review & Understanding (PR review · PR writeup · module map)
16
+ - Design (design system · component variants)
17
+ - Prototyping (animation · interaction)
18
+ - Illustrations & Diagrams (SVG figures · flowcharts)
19
+ - Decks (slide presentations)
20
+ - Research & Learning (feature explainer · concept explainer)
21
+ - Reports (status · incident)
22
+ - Custom Editing Interfaces (triage board · feature flags · prompt tuner)
23
+
24
+ 3. **Look up the template**
25
+ Read `.aikit/templates/html-artifacts/MANIFEST.json`. Find the entry whose `category` matches the pattern from step 2 and whose `slug` matches the intent best (e.g. for a PR review intent → slug `pr-review`).
26
+
27
+ 4. **Read the template**
28
+ Use the Read tool on `.aikit/templates/html-artifacts/<file>.html` for that entry. This is the structural ground truth — copy its CSS variables, class names, layout grids, and visual conventions **verbatim**.
29
+
30
+ 5. **Gather project context**
31
+ Pull real facts the artifact needs to display:
32
+ - For Code Review: `git diff main...HEAD`, file list with classifications
33
+ - For Reports: `git log --since=...`, deploy logs, incident notes
34
+ - For Design System: read `docs/aikit-html-design-system.html` if it exists, else use the tokens from the template
35
+ - For Research/Explainer: read the source files the explainer covers
36
+ - For Implementation Plan: milestones, packages affected, risky code
37
+
38
+ 6. **Produce the filled artifact**
39
+ Write a new HTML file that mirrors the template's structure but with the gathered context replacing the placeholder content. Preserve:
40
+ - All CSS `:root` design tokens
41
+ - All class names and layout grids
42
+ - All cross-cutting techniques (sticky toolbars, scroll-margin-top, microinteractions, `<details>` collapsibles)
43
+ - The visual language: severity colors, badge styles, dot indicators, monospace meta text
44
+ Required in `<head>`:
45
+ - `<title>` and `<meta name="description">`
46
+ - `<meta name="aikit-pattern" content="...">` — exactly one of: `Exploration`, `Code Review`, `Design`, `Prototype`, `Illustrations`, `Deck`, `Research`, `Report`, `Editor`
47
+ Add an `AUTO-GENERATED` pill top-right and a provenance footer (`Sources: ... — generated <ISO timestamp>`).
48
+
49
+ 7. **Save with sequential numbering**
50
+ - Slug from intent: e.g. `code-review-auth-pr`, `weekly-status-mar-10`
51
+ - Determine `NN` by listing `.aikit/artifacts/*.html` (excluding `index.html`) and incrementing the highest number; start at `01`
52
+ - Save to `.aikit/artifacts/NN-<slug>.html`
53
+
54
+ 8. **Regenerate the gallery index**
55
+ Rebuild `.aikit/artifacts/index.html` from scratch per the "Gallery index protocol" in the skill. List all artifacts, group by `<meta name="aikit-pattern">`, drop empty groups.
56
+
57
+ 9. **Report**
58
+ Print both paths and suggest: `open .aikit/artifacts/index.html` (macOS) / `xdg-open .aikit/artifacts/index.html` (Linux).
59
+
60
+ ## Fallback
61
+ If `.aikit/templates/html-artifacts/` does not exist (e.g. project synced before this kit version), run `aikit sync` first, or use the user-driven path: `aikit scaffold html <slug>` to drop a starter, then ask the agent to fill it.
@@ -0,0 +1,31 @@
1
+ {
2
+ "version": 1,
3
+ "releases": [
4
+ {
5
+ "version": "0.9.0",
6
+ "date": "2026-05-12",
7
+ "headline": "HTML artifact scaffolding + 20 forked templates + cross-tool skill discovery",
8
+ "highlights": [
9
+ "NEW `aikit scaffold html <slug>` — drops one of 20 HTML reference templates into the current dir",
10
+ "NEW 20 forked templates at `.aikit/templates/html-artifacts/` (with permission from ThariqS)",
11
+ "NEW `aikit whatsnew` command for release notes",
12
+ "NEW Update-available banner (runs once per 24h; opt out with AIKIT_NO_UPDATE_CHECK=1)",
13
+ "CHANGED `html-artifacts` skill v1.1.0 → v2.0.0: 9 patterns, mandatory template-read protocol",
14
+ "CHANGED `aikit sync` now also syncs templates; `aikit list` shows them as a category",
15
+ "CHANGED Skill discovery propagates to all 6 non-Claude tools via AGENTS.md.tmpl",
16
+ "FIXED gitignore — only `.aikit/artifacts/` ignored; templates are now committable"
17
+ ],
18
+ "breaking": [
19
+ "`html-artifacts.md` skill is a complete rewrite — if you customized it, `aikit sync` will flag a conflict"
20
+ ],
21
+ "migration": [
22
+ "Run `aikit sync` to pull the 20 new templates into `.aikit/templates/html-artifacts/`",
23
+ "Templates will now appear in `git status` after sync (intentional — they're reference material)"
24
+ ],
25
+ "links": {
26
+ "changelog": "https://github.com/Hamad-Center/haac-aikit/blob/main/CHANGELOG.md#090--2026-05-12",
27
+ "release": "https://github.com/Hamad-Center/haac-aikit/releases/tag/v0.9.0"
28
+ }
29
+ }
30
+ ]
31
+ }
@@ -47,6 +47,16 @@ TODO: How to run a single test; framework quirks.
47
47
 
48
48
  TODO: Project-specific security notes.
49
49
 
50
+ ## Skills and templates
51
+ <!-- This section is shipped by haac-aikit so every tool (Claude, Cursor, Aider,
52
+ Copilot, Windsurf, Gemini, Codex) sees the same skill-discovery rules.
53
+ The .claude/ path name is historical; the content there is tool-agnostic. -->
54
+
55
+ - <!-- id: skills.read-on-match --> Skill instructions live at `.claude/skills/*.md`. When a task matches a skill's `## When to use` rules, **read that skill before producing output** — it ships pattern-specific techniques and protocols that this file does not repeat.
56
+ - <!-- id: skills.html-artifacts --> For HTML artifact production (specs, plans, PR reviews, design systems, prototypes, diagrams, decks, research explainers, reports, custom editing interfaces): the `html-artifacts` skill at `.claude/skills/html-artifacts.md` is **mandatory**. Forked reference templates live at `.aikit/templates/html-artifacts/` with a machine-readable `MANIFEST.json`. **Read the matching template first** before writing; do not invent HTML structure from scratch.
57
+ - <!-- id: skills.scaffold-cli --> User-driven scaffolding: `aikit scaffold html <slug>` drops a starter template into the current directory. Run `aikit scaffold html --list` to see all 20.
58
+ - <!-- id: artifacts.output-path --> Filled artifacts go to `.aikit/artifacts/NN-<slug>.html` (incrementing `NN`). Regenerate `.aikit/artifacts/index.html` after each write; the gallery is auto-maintained.
59
+
50
60
  ## Gotchas
51
61
  <!-- High-signal section. Add things the agent repeatedly gets wrong.
52
62
  Tip: prefix the most load-bearing rules with `IMPORTANT:` or `YOU MUST` —
@@ -1,109 +1,155 @@
1
1
  ---
2
2
  name: html-artifacts
3
- description: Use when generating output that would benefit from rich formatting — specs, plans, reports, code review explainers, prototypes, decks, design-system pages, visual explainers, or custom editors. Maintains a gallery index at .aikit/artifacts/index.html so artifacts compound into a navigable project archive. Inspired by Thariq Shihipar's "Unreasonable Effectiveness of HTML" (Anthropic, 2026).
4
- version: "1.1.0"
3
+ description: Use when producing structured output that benefits from rich layout, comparison, drill-in, or interaction — specs, plans, PR reviews, design systems, prototypes, diagrams, decks, research explainers, reports, and custom editors. Scaffolds from 20 forked reference templates at `.aikit/templates/html-artifacts/` and fills them with project context. Maintains a gallery at `.aikit/artifacts/index.html`.
4
+ version: "2.0.0"
5
5
  source: haac-aikit
6
6
  license: MIT
7
+ inspired-by: https://thariqs.github.io/html-effectiveness (templates forked with permission, 2026-05-12)
7
8
  ---
8
9
 
9
10
  ## When to use
10
- - Output is > ~80 lines of content
11
- - Task involves comparison, multiple options, or visual layout
12
- - User asks for a spec, plan, report, PR explainer, or prototype
13
- - User mentions "share", "send to team", or "easy to read"
11
+ - Output is comparison, drill-in, or interactive — not linear prose
12
+ - Task is a spec, plan, review, report, prototype, design system, diagram, deck, explainer, or editor
13
+ - User says "share", "review", "scan", "click through", "demo", "tune"
14
+ - Output would otherwise be > ~80 lines of markdown
15
+
16
+ Default to markdown for linear prose. HTML earns its weight only when structure or interaction is the point.
14
17
 
15
18
  ## Proactive offer rule
16
- When conditions above are met but the user didn't explicitly ask for HTML, say one sentence before proceeding:
17
-
18
- > "I can generate this as an HTML artifact for easier reading — want that?"
19
-
20
- Wait for a yes/no. If yes, proceed with HTML. If no, use markdown.
21
-
22
- ## Use-case patterns
23
-
24
- ### 1. Spec / Planning
25
- **Trigger:** Long spec, multiple options to compare
26
- **Structure:** Tabs per option, decision log section, embedded mockup slots
27
- **Don't:** Skip the decision rationale that's the whole point of the doc
28
-
29
- ### 2. Code Review
30
- **Trigger:** PR explainer, diff walkthrough, architecture audit
31
- **Structure:** Rendered diff with color, severity badges (ok/warn/error), inline margin annotations
32
- **Don't:** Show a raw unified diff without colorunreadable
33
-
34
- ### 3. Report / Research
35
- **Trigger:** Status report, incident summary, research synthesis
36
- **Structure:** Executive summary at top, SVG diagrams, section anchors for navigation
37
- **Don't:** Bury the conclusion — lead with it
38
-
39
- ### 4. Prototype
40
- **Trigger:** Animation tuning, layout exploration, parameter tweaking
41
- **Structure:** Sliders/knobs for live adjustment, preview pane, "copy params" export button
42
- **Don't:** Ship without an export mechanism the params need to go somewhere
43
-
44
- ### 5. Custom Editor
45
- **Trigger:** Ticket triage, config editing, dataset curation
46
- **Structure:** Drag/sort or form UI, constraint warnings, "copy as JSON/prompt" export button
47
- **Don't:** Let the editor be the only output always export
48
-
49
- ### 6. Visual Explainer
50
- **Trigger:** Explaining a concept, system, or workflow where a diagram beats prose
51
- **Structure:** One hero inline `<svg>` with labelled regions, short text blocks anchored to those regions, "view source" toggle that reveals the underlying data
52
- **Don't:** Use raster images or external icon CDNs — keep SVG inline so the artifact stays self-contained and editable
53
-
54
- ### 7. Deck
55
- **Trigger:** Slide presentation, talk preview, pitch, "walk me through this"
56
- **Structure:** One slide per viewport (`100vh`), large body type (≥32px), arrow-key navigation, single idea per slide, speaker notes hidden behind a key press
57
- **Don't:** Generate scrolling content — if the user would scroll, it's a Report, not a Deck
58
-
59
- ### 8. Design System
60
- **Trigger:** Building or documenting a design system, component library reference, token palette
61
- **Structure:** Live component samples beside their source HTML/CSS, swatches for color/spacing/type tokens, copy-on-click for each token value
62
- **Don't:** Use screenshots of components — the components on the page must be the real, live HTML
63
-
64
- ## Built-in design system
65
-
66
- Inject this CSS block into every artifact. If the project has `docs/aikit-html-design-system.html`, read it first and use those variable values instead.
67
-
68
- ```css
69
- :root {
70
- --color-bg: #0f1117;
71
- --color-surface: #1a1d27;
72
- --color-border: #2e3143;
73
- --color-text: #e2e8f0;
74
- --color-muted: #8892a4;
75
- --color-accent: #6366f1;
76
- --color-ok: #22c55e;
77
- --color-warn: #f59e0b;
78
- --color-error: #ef4444;
79
- --radius: 6px;
80
- --font-sans: system-ui, -apple-system, sans-serif;
81
- --font-mono: "JetBrains Mono", "Fira Code", monospace;
82
- --space: 4px;
83
- }
84
- ```
85
-
86
- Pre-built components available: `.card`, `.badge` (`.badge-ok/warn/error/info`), `.tabs` + `.tab` + `.tab-panel`, `.code-block`, `.diff-block` + `.diff-line` + `.diff-line-add/del/ctx`.
19
+ When conditions match but the user didn't ask for HTML, say one sentence and wait:
20
+
21
+ > "I can produce this as an interactive HTML artifact (scaffolded from a template) — want that?"
22
+
23
+ ## Cross-cutting techniques (apply to ALL patterns)
24
+ - **Design tokens** in `:root`: `--clay #D97757`, `--slate #141413`, `--ivory #FAF9F5`, `--oat #E3DACC`, `--olive #788C5D`, `--gray-150 #F0EEE6`, `--gray-300 #D1CFC5`, `--gray-500 #87867F`, `--gray-700 #3D3D3A`, `--white #FFFFFF`
25
+ - **Font stack**: `system-ui, -apple-system, "Segoe UI", Roboto` for sans; `ui-serif, Georgia` for `--serif`; `ui-monospace, "SF Mono"` for `--mono`
26
+ - **Layout**: CSS Grid for structure; flex + gap for toolbars and rows
27
+ - **Sticky**: toolbars / TOCs / column headers use `position: sticky; top: 0; z-index: 1`
28
+ - **Responsive type**: `font-size: clamp(min, Nvw, max)` for headings — no breakpoint jumps
29
+ - **Microinteractions**: `:hover { transform: translateY(-1px) }`, `:active { transform: translateY(1px) }`, transitions 120–600ms with explicit properties — **never `transition: all`**
30
+ - **Semantic HTML**: `<details>`, `<summary>`, native `<button>`, native `<input>` **never div-button hacks**
31
+ - **Mobile**: at least one `@media (max-width: 960px)` breakpoint per artifact
32
+ - **Dot indicators**: small colored circles via `::before` pseudo-elements (severity, ownership, status)
33
+ - **Shadows**: subtle only — `0 1px 3px rgba(20, 20, 19, 0.06)`; never heavy drop shadows
34
+ - **Anchors**: every section heading has an `id`; `scroll-margin-top: 28px` on sections
35
+ - **Provenance footer**: every generated artifact ends with `Sources: generated <ISO timestamp>`
36
+ - **AUTO-GENERATED pill**: top-right badge on agent-produced artifacts so readers know the origin
37
+ - **Prompt callout**: exploration / planning artifacts preserve the originating user request in a cream-tinted box at top
38
+
39
+ ## Pattern playbook (9 patterns, aligned with the source)
40
+
41
+ ### 1. Exploration & Planning
42
+ **Templates**: `01-exploration-code-approaches.html`, `02-exploration-visual-designs.html`, `16-implementation-plan.html`
43
+ **Use for**: comparing N approaches, exploring visual directions, handing off a plan
44
+ **Concrete techniques**: numbered approach badges (`01`/`02`/`03`) in oat chips · equal-width code blocks for visual symmetry · pro/con tables with colored dot bullets (olive=pro, clay=con) · chip metrics footer (bundle, testability, reuse, SSR safety) · recommendation callout with left clay border + serif 22px · light/dark toggle via single `:root` swap · numbered milestone rows with date columns on left · phase cards with package chips · risks table (RISK / SEV / MITIGATION) · "Decide with · person · before slice N" footer on open questions
45
+ **Must-haves**: preserve the originating prompt as a top callout; numbered section dots if > 4 sections
46
+
47
+ ### 2. Code Review & Understanding
48
+ **Templates**: `03-code-review-pr.html`, `17-pr-writeup.html`, `04-code-understanding.html`
49
+ **Use for**: PR reviews, author writeups, module / architecture explainers
50
+ **Concrete techniques**: PR header card (repo · PR# · title · author avatar · branch arrow `→` · `+lines / -lines` · file count) · risk map: horizontal chip cluster with 3-state legend (safe / worth a look / needs attention) · per-file expandable `<details>` with severity badge + line-count chip · diff grid `[line# | mark | code]` on dark slate, `.add/.del/.ctx/.hunk` states at 15% opacity · review comment bubble: left accent + `::before` triangle pointer + line# tag + BLOCKING (clay) / NIT (gray) label · "Suggested next steps" checkbox list at the end · for module maps: inline SVG with hot path in clay, right sidebar with "Key files" + "Gotchas" panels · `<details>` "show source" toggle on long code blocks
51
+ **Must-haves**: severity color coding; collapsed files at the end; clickable jump links between sections
52
+
53
+ ### 3. Design
54
+ **Templates**: `05-design-system.html`, `06-component-variants.html`
55
+ **Use for**: design system references, component-variant matrices
56
+ **Concrete techniques**: color groups in named bands (PRIMARY / NEUTRAL / SEMANTIC) · each swatch shows 64×64 chip + hex + token name · typography table with shared specimen text repeated at each scale, size/leading/weight as right-aligned monospace meta · vertical spacing-bar ruler (`overflow-x: auto`) · radius + elevation showcase cards · core-components stage with `<Button />`-style XML labels above each section · for variants: live control panel (slider + segmented + checkbox) affecting all variants live · "best for: ..." rationale below each variant · hovered-variant code-preview pane
57
+ **Must-haves**: tokens have both hex AND name; components on the page are real HTML, not images
58
+
59
+ ### 4. Prototyping
60
+ **Templates**: `07-prototype-animation.html`, `08-prototype-interaction.html`
61
+ **Use for**: animation tuning, interaction prototypes
62
+ **Concrete techniques**: stage area with the actual interactive element + "click to toggle" caption · right-side knob panel: easing presets as selectable cards with `cubic-bezier(...)` formulas visible · keyframe timeline strip with milestone markers (`fill 0ms · check 80ms · strike 120ms · confetti 200ms · collapse 600ms`) · copy-paste CSS panel below stage with commented sections · for interactions: 2-col layout with stage left, "What you're feeling" design-notes right, "Open questions" deferral panel below
63
+ **Must-haves**: explicit "design decisions baked in" annotations; explicit "open questions" deferred to reviewer; exportable CSS/params
64
+
65
+ ### 5. Illustrations & Diagrams
66
+ **Templates**: `10-svg-illustrations.html`, `13-flowchart-diagram.html`
67
+ **Use for**: SVG figure sheets, interactive flowcharts
68
+ **Concrete techniques**: inline SVG with CSS-var theming (`fill="var(--panel)"`, `stroke="var(--line)"`) · per-figure card with download-each-as-standalone button · "Palette & rules" section at bottom (palette swatches + stroke/radius/label rules) · for flowcharts: process rectangles · decision diamonds · terminal rounded nodes (✅ green for success) · failure paths drawn dashed clay · edge labels on arrows (pass / fail / healthy) · legend at bottom (process step / decision / terminal success / failure path) · click-to-detail right sidebar showing clicked node's metadata
69
+ **Must-haves**: every figure self-contained with its own `<style>` block (downloadable standalone); legend visible for non-trivial diagrams
70
+
71
+ ### 6. Decks
72
+ **Template**: `09-slide-deck.html`
73
+ **Use for**: slide presentations, walkthroughs, pitches
74
+ **Concrete techniques**: `width: 100vw; height: 100vh` per slide · `scroll-snap-type: y mandatory` on body, `scroll-snap-stop: always` on `.slide` · responsive type `font-size: clamp(40px, 6vw, 64px)` · invert variant (`.slide.invert { bg slate; color ivory }`) for decision slides · large-serif metric values (52px) · slide counter top-right (`N / total`) · uppercase mono eyebrow on each slide ("SHIPPED THIS WEEK", "DECISION NEEDED", "ON DECK") · decision card with option chips prefixed `A —` / `B —` · footnote at bottom (absolute, monospace 11px)
75
+ **Must-haves**: arrow-key nav (or scroll-snap); one idea per slide; if user would scroll inside a slide, it's a Report not a Deck
76
+
77
+ ### 7. Research & Learning
78
+ **Templates**: `14-research-feature-explainer.html`, `15-research-concept-explainer.html`
79
+ **Use for**: explaining a feature in your repo, teaching a concept
80
+ **Concrete techniques**: sticky left "ON THIS PAGE" TOC (200px) with nested children · "FILES READ" panel below TOC for provenance · TL;DR callout with clay left border · collapsed `<details>` step rows that expand on click · file:line tags right-aligned in step headers · tabbed code blocks (e.g., `limits.yaml` / `route.ts` / `client response`) for the same concept in different views · ★ tip callouts with cream background distinct from • bullets · for concepts: live interactive widget (manipulable, not just diagram) · hover-linked glossary terms underlined in prose, defined in right sidebar · comparison table with color-coded values (red=bad, green=good)
81
+ **Must-haves**: TL;DR at the very top; clickable TOC; explicit "FILES READ" provenance for repo-specific explainers
82
+
83
+ ### 8. Reports
84
+ **Templates**: `11-status-report.html`, `12-incident-report.html`
85
+ **Use for**: weekly status, sprint reviews, incident post-mortems
86
+ **Concrete techniques**: 4-card metric band with delta sub-labels ("+3 vs wk10", "±0", "SEV-2 · 47m") · incident pills (SEV-2 clay / Resolved olive / Duration / Detected / Owner) · dark TL;DR box at top of incidents · vertical timeline with colored dots (clay = impact, olive = mitigated) and monospace time chips · shipped table with PR# / TITLE / AUTHOR / RISK columns and colored risk badges · velocity bar chart with the spike day colored · carryover items prefixed with status pills (IN REVIEW / BLOCKED / SLIPPED) · impact table (Requests failed / Peak error rate / Users affected / Data loss / SLA breach) · action-items checklist with avatar + due date · footer cites sources ("git log main..HEAD · CI dashboard · deploy log") and generation timestamp · "AUTO-GENERATED" pill top-right
87
+ **Must-haves**: provenance footer; quantified impact for incidents; action items with owners + dates
88
+
89
+ ### 9. Custom Editing Interfaces
90
+ **Templates**: `18-editor-triage-board.html`, `19-editor-feature-flags.html`, `20-editor-prompt-tuner.html`
91
+ **Use for**: throwaway editors for tasks that are hard to describe — kanban, flag configs, prompt tuning
92
+ **Concrete techniques**: native drag-and-drop (`draggable="true"` + `dragstart` / `dragover` / `drop`) with `.dragover` 2px dashed outline · 4-col kanban grid with `data-col` attribute → colored `border-top: 3px` per column · sticky column headers · filter toggle: `display: none` → `inline-block` on `.on` · live summary row that updates on drag · checkbox-based toggle switches with large click targets · dependency warning banners (`display: none` → `flex` on `.show`) · 2-col layout with sticky 320px right control panel · for prompt tuners: editable textarea left + sample-input panels right that re-render live
93
+ **Must-haves**: **always end with an export button** — "Copy as markdown" / "Copy diff" / "Copy params" — that turns the in-UI state back into something pasteable to the next prompt or committable to the repo
94
+
95
+ ## Failure modes (anti-patterns)
96
+ - `transition: all` — animates layout shifts and lags; use explicit property lists
97
+ - Div-based button hacks — breaks keyboard nav; use native `<button>`
98
+ - Unlabeled colors — every swatch and badge needs hex AND token AND role
99
+ - Desktop-only layouts — every artifact needs at least one `@media` breakpoint
100
+ - Hover-only critical info — invisible on touch; use `<details>` or always-visible cards
101
+ - Static code blocks for diffs — color and structure are the point; render `.add`/`.del`/`.ctx` states
102
+ - Walls of prose where structure would earn its weight — re-evaluate; default to markdown
103
+ - Missing `scroll-margin-top` — anchors land under sticky headers
104
+ - Neglected `:active` feedback — clicks feel dead without `translateY(1px)`
105
+ - Missing keyboard nav for editors — native form controls, not div-clicks
106
+ - Missing AUTO-GENERATED badge on agent-produced artifacts — readers deserve to know
107
+ - Missing provenance footer — "where did these numbers come from?" should always be answerable
108
+
109
+ ## Template scaffolding
110
+
111
+ **YOU MUST NOT invent HTML structure from scratch.** Reference templates are the ground truth. Reading one before writing is mandatory.
112
+
113
+ **Template location**: `.aikit/templates/html-artifacts/` (synced from the catalog). Manifest at `.aikit/templates/html-artifacts/MANIFEST.json` maps `slug` → `category` → `file`.
114
+
115
+ ### Scaffolding protocol (agent-driven — follow exactly)
116
+
117
+ 1. **Read the manifest first**: `Read .aikit/templates/html-artifacts/MANIFEST.json`. Find the entry whose `category` matches the pattern from the playbook above and whose `slug` best matches the user's intent.
118
+ 2. **Read the matching template**: `Read .aikit/templates/html-artifacts/<file>.html` (the `file` field from the manifest entry). This is non-optional. If the file is missing, ask the user to run `aikit sync`; do not proceed without it.
119
+ 3. **Gather real project context**: run the appropriate commands — `git diff main...HEAD`, `git log --since=...`, read files mentioned in the prompt, etc. Replace the template's placeholder content with these real facts.
120
+ 4. **Preserve structure verbatim** when writing the filled artifact:
121
+ - All `:root` CSS variables (`--clay`, `--slate`, `--ivory`, `--oat`, `--olive`, `--gray-*`)
122
+ - All class names, layout grids, and microinteraction conventions
123
+ - All cross-cutting techniques (sticky positioning, `scroll-margin-top`, `<details>` collapsibles, native form controls)
124
+ - The pattern's visual language (severity colors, badge styles, dot indicators, monospace meta text)
125
+ 5. **Add required `<head>` elements**: `<title>`, `<meta name="description">`, and `<meta name="aikit-pattern" content="...">` with one of: `Exploration`, `Code Review`, `Design`, `Prototype`, `Illustrations`, `Deck`, `Research`, `Report`, `Editor`.
126
+ 6. **Add AUTO-GENERATED pill** top-right and **provenance footer** (`Sources: ... — generated <ISO timestamp>`).
127
+ 7. **Save** to `.aikit/artifacts/NN-<slug>.html` (increment `NN` from existing files).
128
+ 8. **Regenerate gallery index** per the protocol below.
129
+
130
+ ### User-driven scaffolding (alternative)
131
+
132
+ When the user wants a pristine starter to look at first: `aikit scaffold html <slug>` drops the template into the current directory unmodified. Slugs match the manifest: `code-approaches`, `visual-designs`, `pr-review`, `pr-writeup`, `code-understanding`, `design-system`, `component-variants`, `animation`, `interaction`, `slide-deck`, `svg-illustrations`, `status-report`, `incident-report`, `flowchart`, `feature-explainer`, `concept-explainer`, `implementation-plan`, `triage-board`, `feature-flags`, `prompt-tuner`. Numbers (`03`) and `--list` also work.
87
133
 
88
134
  ## Output rules
89
- - Save to `.aikit/artifacts/NN-<slug>.html` where `NN` is a zero-padded sequence (`07-auth-spec.html`). This path is gitignored.
90
- - Determine `NN` by listing existing files in `.aikit/artifacts/` (ignore `index.html`) and incrementing the highest number; start at `01`.
91
- - Every artifact MUST include `<meta name="aikit-pattern" content="...">` in `<head>` with one of: `Spec`, `Code Review`, `Report`, `Prototype`, `Editor`, `Visual Explainer`, `Deck`, `Design System`. The index uses this to group entries.
92
- - Every artifact MUST include `<title>` and `<meta name="description">` the index renders these.
93
- - Pure HTML/CSS/JS only no external CDN dependencies, no build step.
94
- - Mobile-responsive: use `max-width` + `padding` on body, `<meta name="viewport">`.
95
- - After saving, also rewrite `.aikit/artifacts/index.html` (see below), then print both paths and suggest: `open .aikit/artifacts/index.html` (macOS) or `xdg-open` (Linux).
96
-
97
- ## Index page (gallery)
98
- The index is auto-maintained. After every artifact write, regenerate `.aikit/artifacts/index.html` from scratch — do not try to surgically edit it:
99
-
100
- 1. List `.aikit/artifacts/*.html` excluding `index.html` itself
101
- 2. For each file, read `<title>`, `<meta name="description">`, and `<meta name="aikit-pattern">`
102
- 3. Group entries by pattern (Spec, Code Review, Report, Prototype, Editor, Visual Explainer, Deck, Design System)
103
- 4. Render each group as a section with cards: filename badge, title, one-line description, link to the file
104
- 5. Reuse the built-in design system CSS so the gallery matches the artifacts
105
-
106
- Drop empty groups. Sort entries within a group by filename (which is by `NN`). The index itself uses `<meta name="aikit-pattern" content="Index">` so future tooling can recognize it but it is excluded from its own listing.
135
+ - Save filled artifacts to `.aikit/artifacts/NN-<slug>.html` (`NN` zero-padded; increment from existing files; start at `01`). This path is gitignored.
136
+ - Every artifact MUST include `<meta name="aikit-pattern" content="...">` in `<head>`. Valid values match the 9-pattern playbook: `Exploration`, `Code Review`, `Design`, `Prototype`, `Illustrations`, `Deck`, `Research`, `Report`, `Editor`. The gallery groups by this.
137
+ - Every artifact MUST include `<title>` and `<meta name="description">` the gallery renders these.
138
+ - Pure HTML / CSS / JS only — no CDNs, no build step. Inline `<style>` and `<script>` blocks are fine.
139
+ - After saving, **regenerate `.aikit/artifacts/index.html` from scratch** (see Gallery protocol below), then print both paths and suggest `open .aikit/artifacts/index.html`.
140
+
141
+ ## Gallery index protocol
142
+ After every artifact write, rebuild `.aikit/artifacts/index.html`:
143
+
144
+ 1. List `.aikit/artifacts/*.html` excluding `index.html`.
145
+ 2. For each file read `<title>`, `<meta name="description">`, `<meta name="aikit-pattern">`.
146
+ 3. Group by pattern; drop empty groups; sort within a group by filename (`NN` order).
147
+ 4. Render each group as a section with cards: filename badge, title, one-line description, link.
148
+ 5. Reuse the cross-cutting design tokens so the gallery matches the artifacts.
149
+ 6. The gallery itself uses `<meta name="aikit-pattern" content="Index">` so future tooling can recognize it; it is excluded from its own listing.
107
150
 
108
151
  ## Markdown-first rule
109
- Existing brainstorming and planning skills stay markdown-first. Only switch to HTML when the user accepts the proactive offer or explicitly requests it (e.g. via `/html`). This preserves cross-tool compatibility.
152
+ Existing brainstorming, debugging, and planning skills stay markdown-first. Only switch to HTML when the user accepts the proactive offer or explicitly invokes `/html`. Cross-tool compatibility depends on this.
153
+
154
+ ## Attribution
155
+ Templates forked with permission from [github.com/ThariqS/html-effectiveness](https://github.com/ThariqS/html-effectiveness) (2026-05-12). The pattern taxonomy, sub-types, and technique inventory above are derived from the same source. Adapted for cross-tool agent scaffolding under haac-aikit's MIT license.