opencodekit 0.21.10 → 0.23.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.
- package/README.md +1 -1
- package/dist/index.js +4 -25
- package/dist/template/.opencode/.template-manifest.json +115 -188
- package/dist/template/.opencode/AGENTS.md +127 -484
- package/dist/template/.opencode/README.md +2 -2
- package/dist/template/.opencode/agent/build.md +158 -356
- package/dist/template/.opencode/agent/explore.md +0 -1
- package/dist/template/.opencode/agent/plan.md +7 -16
- package/dist/template/.opencode/agent/review.md +0 -1
- package/dist/template/.opencode/agent/scout.md +2 -3
- package/dist/template/.opencode/agent/vision.md +0 -1
- package/dist/template/.opencode/artifacts/.active +1 -0
- package/dist/template/.opencode/artifacts/example/plan.md +12 -0
- package/dist/template/.opencode/artifacts/example/progress.md +4 -0
- package/dist/template/.opencode/artifacts/example/research.md +4 -0
- package/dist/template/.opencode/artifacts/example/spec.md +16 -0
- package/dist/template/.opencode/artifacts/todo.md +5 -0
- package/dist/template/.opencode/artifacts/verify.log +4 -0
- package/dist/template/.opencode/command/clarify.md +46 -0
- package/dist/template/.opencode/command/commit.md +53 -0
- package/dist/template/.opencode/command/create.md +29 -71
- package/dist/template/.opencode/command/design.md +1 -2
- package/dist/template/.opencode/command/explore.md +3 -4
- package/dist/template/.opencode/command/fix.md +55 -0
- package/dist/template/.opencode/command/improve-architecture.md +55 -0
- package/dist/template/.opencode/command/init.md +86 -69
- package/dist/template/.opencode/command/plan.md +30 -60
- package/dist/template/.opencode/command/pr.md +10 -28
- package/dist/template/.opencode/command/refactor.md +65 -0
- package/dist/template/.opencode/command/research.md +7 -29
- package/dist/template/.opencode/command/review-codebase.md +6 -13
- package/dist/template/.opencode/command/ship.md +136 -78
- package/dist/template/.opencode/command/test.md +66 -0
- package/dist/template/.opencode/command/ui-review.md +2 -4
- package/dist/template/.opencode/command/verify.md +15 -23
- package/dist/template/.opencode/dcp.jsonc +96 -85
- package/dist/template/.opencode/memory/README.md +4 -6
- package/dist/template/.opencode/memory/_templates/adr.md +45 -0
- package/dist/template/.opencode/memory/_templates/prd.md +1 -1
- package/dist/template/.opencode/memory/_templates/roadmap.md +1 -1
- package/dist/template/.opencode/memory/_templates/state.md +1 -1
- package/dist/template/.opencode/memory/project/gotchas.md +4 -4
- package/dist/template/.opencode/memory/project/project.md +2 -2
- package/dist/template/.opencode/memory/project/roadmap.md +1 -1
- package/dist/template/.opencode/memory/project/state.md +2 -2
- package/dist/template/.opencode/memory/project/tech-stack.md +2 -2
- package/dist/template/.opencode/memory/session-context.md +1 -1
- package/dist/template/.opencode/opencode.json +14 -152
- package/dist/template/.opencode/plugin/README.md +2 -2
- package/dist/template/.opencode/plugin/guard.ts +62 -0
- package/dist/template/.opencode/plugin/{lib/memory-admin-tools.ts → memory/admin.ts} +4 -4
- package/dist/template/.opencode/plugin/{lib → memory}/capture.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/compile.ts +2 -2
- package/dist/template/.opencode/plugin/{lib → memory}/context.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/curator.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/db/observations.ts +102 -3
- package/dist/template/.opencode/plugin/{lib → memory}/db/schema.ts +43 -1
- package/dist/template/.opencode/plugin/{lib → memory}/db/types.ts +22 -0
- package/dist/template/.opencode/plugin/{lib/memory-db.ts → memory/db.ts} +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/distill.ts +1 -1
- package/dist/template/.opencode/plugin/{lib/memory-helpers.ts → memory/helpers.ts} +5 -1
- package/dist/template/.opencode/plugin/{lib/memory-hooks.ts → memory/hooks.ts} +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/index-generator.ts +2 -2
- package/dist/template/.opencode/plugin/{lib → memory}/inject.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/lint.ts +2 -2
- package/dist/template/.opencode/plugin/memory/tools.ts +322 -0
- package/dist/template/.opencode/plugin/{lib → memory}/validate.ts +2 -2
- package/dist/template/.opencode/plugin/memory.ts +7 -17
- package/dist/template/.opencode/plugin/srcwalk.ts +721 -0
- package/dist/template/.opencode/skill/agent-code-quality-gate/SKILL.md +98 -0
- package/dist/template/.opencode/skill/behavioral-kernel/SKILL.md +52 -0
- package/dist/template/.opencode/skill/brainstorming/SKILL.md +1 -1
- package/dist/template/.opencode/skill/browser-testing-with-devtools/SKILL.md +85 -0
- package/dist/template/.opencode/skill/code-cleanup/SKILL.md +114 -0
- package/dist/template/.opencode/skill/code-navigation/SKILL.md +142 -0
- package/dist/template/.opencode/skill/code-review-and-quality/SKILL.md +131 -0
- package/dist/template/.opencode/skill/context-engineering/SKILL.md +1 -1
- package/dist/template/.opencode/skill/debugging-and-error-recovery/SKILL.md +109 -0
- package/dist/template/.opencode/skill/deep-module-design/SKILL.md +207 -0
- package/dist/template/.opencode/skill/development-lifecycle/SKILL.md +26 -45
- package/dist/template/.opencode/skill/gemini-large-context/SKILL.md +4 -4
- package/dist/template/.opencode/skill/git-workflow-and-versioning/SKILL.md +77 -0
- package/dist/template/.opencode/skill/grill-me/SKILL.md +140 -0
- package/dist/template/.opencode/skill/memory-system/SKILL.md +9 -10
- package/dist/template/.opencode/skill/opensrc/references/example-workflow.md +1 -1
- package/dist/template/.opencode/skill/planning-and-task-breakdown/SKILL.md +116 -0
- package/dist/template/.opencode/skill/shipping-and-launch/SKILL.md +95 -0
- package/dist/template/.opencode/skill/source-driven-development/SKILL.md +103 -0
- package/dist/template/.opencode/skill/spec-driven-development/SKILL.md +121 -0
- package/dist/template/.opencode/skill/srcwalk/SKILL.md +161 -0
- package/dist/template/.opencode/skill/subagent-driven-development/SKILL.md +1 -1
- package/dist/template/.opencode/skill/ubiquitous-language/SKILL.md +184 -0
- package/dist/template/.opencode/skill/using-git-worktrees/SKILL.md +6 -6
- package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +6 -6
- package/dist/template/.opencode/skill/verification-before-completion/references/VERIFICATION_PROTOCOL.md +5 -5
- package/package.json +76 -76
- package/dist/template/.opencode/AGENT_ALIGNMENT.md +0 -564
- package/dist/template/.opencode/agent/painter.md +0 -83
- package/dist/template/.opencode/command/compound.md +0 -240
- package/dist/template/.opencode/command/curate.md +0 -299
- package/dist/template/.opencode/command/handoff.md +0 -149
- package/dist/template/.opencode/command/health.md +0 -356
- package/dist/template/.opencode/command/init-context.md +0 -297
- package/dist/template/.opencode/command/init-user.md +0 -125
- package/dist/template/.opencode/command/iterate.md +0 -200
- package/dist/template/.opencode/command/lfg.md +0 -173
- package/dist/template/.opencode/command/resume.md +0 -78
- package/dist/template/.opencode/command/status.md +0 -126
- package/dist/template/.opencode/command/ui-slop-check.md +0 -169
- package/dist/template/.opencode/plans/1768385996691-silent-wizard.md +0 -247
- package/dist/template/.opencode/plans/1770006237537-mighty-otter.md +0 -418
- package/dist/template/.opencode/plans/1770006913647-glowing-forest.md +0 -170
- package/dist/template/.opencode/plans/1770013678126-witty-planet.md +0 -278
- package/dist/template/.opencode/plans/1770112267595-shiny-rocket.md +0 -258
- package/dist/template/.opencode/plans/swarm-protocol.md +0 -123
- package/dist/template/.opencode/plugin/lib/memory-tools.ts +0 -535
- package/dist/template/.opencode/skill/agent-evals/SKILL.md +0 -208
- package/dist/template/.opencode/skill/anti-ai-slop/SKILL.md +0 -76
- package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +0 -122
- package/dist/template/.opencode/skill/augment-context-engine/mcp.json +0 -6
- package/dist/template/.opencode/skill/beads/SKILL.md +0 -182
- package/dist/template/.opencode/skill/beads/references/BEST_PRACTICES.md +0 -27
- package/dist/template/.opencode/skill/beads/references/BOUNDARIES.md +0 -219
- package/dist/template/.opencode/skill/beads/references/DEPENDENCIES.md +0 -124
- package/dist/template/.opencode/skill/beads/references/EXAMPLES.md +0 -45
- package/dist/template/.opencode/skill/beads/references/FILE_CLAIMING.md +0 -101
- package/dist/template/.opencode/skill/beads/references/GIT_SYNC.md +0 -25
- package/dist/template/.opencode/skill/beads/references/HIERARCHY.md +0 -71
- package/dist/template/.opencode/skill/beads/references/MULTI_AGENT.md +0 -40
- package/dist/template/.opencode/skill/beads/references/RESUMABILITY.md +0 -177
- package/dist/template/.opencode/skill/beads/references/SESSION_PROTOCOL.md +0 -61
- package/dist/template/.opencode/skill/beads/references/TASK_CREATION.md +0 -38
- package/dist/template/.opencode/skill/beads/references/TROUBLESHOOTING.md +0 -38
- package/dist/template/.opencode/skill/beads/references/WORKFLOWS.md +0 -226
- package/dist/template/.opencode/skill/brand-asset-protocol/SKILL.md +0 -222
- package/dist/template/.opencode/skill/code-search-patterns/SKILL.md +0 -224
- package/dist/template/.opencode/skill/code-simplification/SKILL.md +0 -211
- package/dist/template/.opencode/skill/context-condensation/SKILL.md +0 -149
- package/dist/template/.opencode/skill/context-initialization/SKILL.md +0 -69
- package/dist/template/.opencode/skill/context-management/SKILL.md +0 -390
- package/dist/template/.opencode/skill/deep-research/SKILL.md +0 -384
- package/dist/template/.opencode/skill/design-direction-advisor/SKILL.md +0 -139
- package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +0 -191
- package/dist/template/.opencode/skill/executing-plans/SKILL.md +0 -247
- package/dist/template/.opencode/skill/figma-go/SKILL.md +0 -65
- package/dist/template/.opencode/skill/finishing-a-development-branch/SKILL.md +0 -357
- package/dist/template/.opencode/skill/full-output-enforcement/SKILL.md +0 -62
- package/dist/template/.opencode/skill/gh-address-comments/SKILL.md +0 -29
- package/dist/template/.opencode/skill/gh-address-comments/scripts/fetch_comments.py +0 -237
- package/dist/template/.opencode/skill/gh-fix-ci/SKILL.md +0 -38
- package/dist/template/.opencode/skill/gh-fix-ci/scripts/inspect_pr_checks.py +0 -509
- package/dist/template/.opencode/skill/hi-fi-prototype-html/SKILL.md +0 -253
- package/dist/template/.opencode/skill/html-deck-export/SKILL.md +0 -189
- package/dist/template/.opencode/skill/index-knowledge/SKILL.md +0 -413
- package/dist/template/.opencode/skill/memory-grounding/SKILL.md +0 -68
- package/dist/template/.opencode/skill/playwriter/SKILL.md +0 -158
- package/dist/template/.opencode/skill/portless/SKILL.md +0 -109
- package/dist/template/.opencode/skill/prd/SKILL.md +0 -146
- package/dist/template/.opencode/skill/prd-task/SKILL.md +0 -182
- package/dist/template/.opencode/skill/prd-task/references/prd-schema.json +0 -124
- package/dist/template/.opencode/skill/prompt-leverage/SKILL.md +0 -90
- package/dist/template/.opencode/skill/prompt-leverage/references/framework.md +0 -91
- package/dist/template/.opencode/skill/prompt-leverage/scripts/augment_prompt.py +0 -157
- package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +0 -263
- package/dist/template/.opencode/skill/reconcile/SKILL.md +0 -183
- package/dist/template/.opencode/skill/reflection-checkpoints/SKILL.md +0 -183
- package/dist/template/.opencode/skill/requesting-code-review/SKILL.md +0 -443
- package/dist/template/.opencode/skill/requesting-code-review/references/specialist-profiles.md +0 -108
- package/dist/template/.opencode/skill/requesting-code-review/review.md +0 -160
- package/dist/template/.opencode/skill/rtk-command-compression/SKILL.md +0 -134
- package/dist/template/.opencode/skill/screenshot/SKILL.md +0 -48
- package/dist/template/.opencode/skill/screenshot/scripts/ensure_macos_permissions.sh +0 -54
- package/dist/template/.opencode/skill/screenshot/scripts/macos_display_info.swift +0 -22
- package/dist/template/.opencode/skill/screenshot/scripts/macos_permissions.swift +0 -40
- package/dist/template/.opencode/skill/screenshot/scripts/macos_window_info.swift +0 -126
- package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.ps1 +0 -163
- package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.py +0 -585
- package/dist/template/.opencode/skill/security-threat-model/SKILL.md +0 -36
- package/dist/template/.opencode/skill/security-threat-model/references/prompt-template.md +0 -255
- package/dist/template/.opencode/skill/security-threat-model/references/security-controls-and-assets.md +0 -32
- package/dist/template/.opencode/skill/sharing-skills/SKILL.md +0 -214
- package/dist/template/.opencode/skill/skill-creator/SKILL.md +0 -181
- package/dist/template/.opencode/skill/skill-installer/SKILL.md +0 -58
- package/dist/template/.opencode/skill/skill-installer/scripts/github_utils.py +0 -21
- package/dist/template/.opencode/skill/skill-installer/scripts/install-skill-from-github.py +0 -313
- package/dist/template/.opencode/skill/skill-installer/scripts/list-skills.py +0 -106
- package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +0 -244
- package/dist/template/.opencode/skill/swarm-coordination/references/architecture.md +0 -39
- package/dist/template/.opencode/skill/swarm-coordination/references/delegation-worker-protocol.md +0 -145
- package/dist/template/.opencode/skill/swarm-coordination/references/dependency-graph.md +0 -50
- package/dist/template/.opencode/skill/swarm-coordination/references/drift-check.md +0 -90
- package/dist/template/.opencode/skill/swarm-coordination/references/integration-beads.md +0 -20
- package/dist/template/.opencode/skill/swarm-coordination/references/launch-flow.md +0 -186
- package/dist/template/.opencode/skill/swarm-coordination/references/reconciler.md +0 -172
- package/dist/template/.opencode/skill/swarm-coordination/references/tier-enforcement.md +0 -78
- package/dist/template/.opencode/skill/swarm-coordination/references/tmux-integration.md +0 -134
- package/dist/template/.opencode/skill/systematic-debugging/SKILL.md +0 -402
- package/dist/template/.opencode/skill/terse-output-mode/SKILL.md +0 -95
- package/dist/template/.opencode/skill/think-in-code/SKILL.md +0 -136
- package/dist/template/.opencode/skill/ux-quality-gates/SKILL.md +0 -137
- package/dist/template/.opencode/skill/v1-run/SKILL.md +0 -175
- package/dist/template/.opencode/skill/v1-run/mcp.json +0 -6
- package/dist/template/.opencode/skill/verification-gates/SKILL.md +0 -63
- package/dist/template/.opencode/skill/visual-analysis/SKILL.md +0 -154
- package/dist/template/.opencode/skill/web-design-guidelines/SKILL.md +0 -46
- package/dist/template/.opencode/skill/workspace-setup/SKILL.md +0 -76
- package/dist/template/.opencode/skill/writing-plans/SKILL.md +0 -320
- /package/dist/template/.opencode/plugin/{lib → memory}/compact.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/graph.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/maintenance.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/pipeline.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/notify.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/operation-log.ts +0 -0
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: hi-fi-prototype-html
|
|
3
|
-
description: Use when building high-fidelity HTML prototypes, interactive product mockups, app/iOS/Android screen demos, or design-variation explorations (NOT production web apps — use frontend-design for that). Enforces Junior Designer mode (show assumptions early, iterate), single-file inline React for double-clickable mockups, real images instead of generic placeholders, and Playwright click-test before delivery.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Hi-Fi Prototype (HTML as Medium)
|
|
7
|
-
|
|
8
|
-
> Adapted from `huashu-design`. HTML is your **medium**, not your destination. You are a designer who happens to use HTML, not a developer who happens to be designing.
|
|
9
|
-
|
|
10
|
-
## When to Use
|
|
11
|
-
|
|
12
|
-
- **Interactive prototypes** — clickable product mockups for user testing or design review
|
|
13
|
-
- **Design variation exploration** — 3+ side-by-side directions before committing
|
|
14
|
-
- **App / iOS / Android mockups** — single-page or full-flow demos
|
|
15
|
-
- **Concept demos** — convey an interaction or feel before any production code
|
|
16
|
-
- **Information graphics** with hand-tuned typography
|
|
17
|
-
|
|
18
|
-
**Don't use for**:
|
|
19
|
-
|
|
20
|
-
- Production web apps with real backends → `frontend-design` + `react-best-practices`
|
|
21
|
-
- SEO/marketing sites → `frontend-design`
|
|
22
|
-
- Component library work → `mockup-to-code` (mockup → production component)
|
|
23
|
-
|
|
24
|
-
## Core Discipline
|
|
25
|
-
|
|
26
|
-
### 1. Start From Existing Context — Don't Design From Air
|
|
27
|
-
|
|
28
|
-
Good hi-fi designs grow from existing context. Before opening a blank file:
|
|
29
|
-
|
|
30
|
-
- Ask: do you have a design system / UI kit / Figma / brand site / reference screenshots?
|
|
31
|
-
- If yes → run `brand-asset-protocol` to extract real assets
|
|
32
|
-
- If no AND brief is vague → run `design-direction-advisor` first
|
|
33
|
-
- Only as last resort: design from generic intuition (will produce AI slop — see `anti-ai-slop`)
|
|
34
|
-
|
|
35
|
-
### 2. Junior Designer Mode — Show Assumptions Early, Then Iterate
|
|
36
|
-
|
|
37
|
-
You are the user's junior designer. The user is the manager.
|
|
38
|
-
|
|
39
|
-
❌ **Don't** disappear for an hour and reveal a finished file.
|
|
40
|
-
|
|
41
|
-
✅ **Do** open the HTML with your assumptions written as comments + reasoning + grayblock placeholders. Show this **first**. Get nod. Then write components. Show again at 50% done. Iterate.
|
|
42
|
-
|
|
43
|
-
```html
|
|
44
|
-
<!-- Assumptions:
|
|
45
|
-
- Audience: enterprise admins
|
|
46
|
-
- Style direction: Pentagram-style (per design-direction-advisor)
|
|
47
|
-
- 3 variations differ in: density, hierarchy, accent color
|
|
48
|
-
- Real product photos pending from user (Step 1 of brand-asset-protocol)
|
|
49
|
-
-->
|
|
50
|
-
<div class="placeholder">[Hero image — DJI Pocket 4 product render, TBD]</div>
|
|
51
|
-
<div class="placeholder">[Headline copy — TBD from user]</div>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**Why**: misunderstanding the brief is 100× cheaper to fix at this stage than after a finished build.
|
|
55
|
-
|
|
56
|
-
### 3. Give Variations, Not "The Answer"
|
|
57
|
-
|
|
58
|
-
When the user says "design X", don't deliver one polished answer. Deliver **3+ variations** spanning:
|
|
59
|
-
|
|
60
|
-
- by-the-book → novel (a continuum, not all in one corner)
|
|
61
|
-
- different axes: visual, interaction, color, layout, animation
|
|
62
|
-
- let the user mix and match
|
|
63
|
-
|
|
64
|
-
Implementation:
|
|
65
|
-
|
|
66
|
-
- Pure visual comparison → side-by-side static layout (`design_canvas`-style grid)
|
|
67
|
-
- Interactive flow with branching options → full prototype with toggles ("Tweaks") for live parameter swap
|
|
68
|
-
|
|
69
|
-
### 4. Honest Placeholders Beat Bad Implementations
|
|
70
|
-
|
|
71
|
-
- Missing icon? → gray block + label "[icon]". Don't draw a wonky SVG.
|
|
72
|
-
- Missing data? → `<!-- TBD: real data from user -->`. Don't fabricate plausible-looking numbers.
|
|
73
|
-
- Missing image? → labeled placeholder. Don't AI-draw a face.
|
|
74
|
-
|
|
75
|
-
**In hi-fi work, an honest placeholder is 10× better than a clumsy attempt at the real thing.**
|
|
76
|
-
|
|
77
|
-
### 5. System First, Don't Pad Filler
|
|
78
|
-
|
|
79
|
-
Every element earns its place. Whitespace is a design problem solved by **composition**, not by inventing content.
|
|
80
|
-
|
|
81
|
-
Especially watch for these "slop" categories (see `anti-ai-slop`):
|
|
82
|
-
|
|
83
|
-
- **Data slop** — meaningless stats, decorative numbers
|
|
84
|
-
- **Iconography slop** — every heading needs an icon
|
|
85
|
-
- **Gradient slop** — every background gets a gradient
|
|
86
|
-
|
|
87
|
-
> "One thousand no's for every yes."
|
|
88
|
-
|
|
89
|
-
## App / iOS Prototype Rules (override generic placeholder rules)
|
|
90
|
-
|
|
91
|
-
App mockups are **demos at presentation time** — generic gray rectangles and lorem ipsum kill credibility. Different rules apply:
|
|
92
|
-
|
|
93
|
-
### A. Architecture: Default to Single-File Inline React
|
|
94
|
-
|
|
95
|
-
**Default**: all JSX/data/styles inside a `<script type="text/babel">…</script>` tag in one HTML file. Reasons:
|
|
96
|
-
|
|
97
|
-
- `file://` blocks external JS as cross-origin → forces user to spin up an HTTP server → violates "double-click to open" principle
|
|
98
|
-
- Local images must be base64 data URLs (don't assume a server)
|
|
99
|
-
|
|
100
|
-
**Split files only when**:
|
|
101
|
-
|
|
102
|
-
- Single file >1000 lines and unmaintainable → split into `components.jsx` + `data.js`, document the `python3 -m http.server` command in delivery notes
|
|
103
|
-
- Multiple subagents need to write different screens in parallel → `index.html` + per-screen HTML, iframe-aggregated, each screen self-contained
|
|
104
|
-
|
|
105
|
-
| Scenario | Architecture | Delivery |
|
|
106
|
-
| --------------------------------- | ------------------------ | ----------------------------------------- |
|
|
107
|
-
| Single dev, 4-6 screens (default) | Single-file inline React | One `.html`, double-click |
|
|
108
|
-
| Single dev, large app (>10 scr) | Multi-jsx + HTTP server | Include startup command |
|
|
109
|
-
| Multi-agent parallel | Multi-HTML + iframe | `index.html` aggregator, each opens alone |
|
|
110
|
-
|
|
111
|
-
### B. Real Images First, Not "Just Placeholders"
|
|
112
|
-
|
|
113
|
-
By default, **actively fetch real images**. Don't draw SVG. Don't leave gray blocks. Don't wait for user to ask.
|
|
114
|
-
|
|
115
|
-
| Use case | Source |
|
|
116
|
-
| --------------------------------- | ------------------------------------------------------------------- |
|
|
117
|
-
| Art / museum / historical content | Wikimedia Commons (public domain), Met Museum Open Access, AIC API |
|
|
118
|
-
| General lifestyle photography | Unsplash, Pexels (royalty-free) |
|
|
119
|
-
| User's existing assets | `~/Downloads`, project `_archive/`, user's configured asset library |
|
|
120
|
-
|
|
121
|
-
Wikimedia caveat: `curl` via TLS proxy often fails. Use Python `urllib` and a compliant User-Agent (`MyProject/0.1 (https://github.com/you; you@example.com)`). Use the MediaWiki API (`action=query&list=categorymembers`) for batch / `prop=imageinfo&iiurlwidth=` for sized thumbs.
|
|
122
|
-
|
|
123
|
-
**Honest-image test**: before fetching, ask — _"if I remove this image, is information lost?"_
|
|
124
|
-
|
|
125
|
-
| Scenario | Verdict | Action |
|
|
126
|
-
| ------------------------------------------------------------ | ------------------------------ | ------------------------------------------- |
|
|
127
|
-
| Essay list cover / profile background / settings page banner | Decoration, no link to content | **Don't add** — equivalent to gradient slop |
|
|
128
|
-
| Museum content portrait / product detail / map card location | Image IS the content | **Must add** — real image required |
|
|
129
|
-
| Graph / visualization background texture (very subtle) | Atmosphere, not focus | Add at `opacity ≤ 0.08` |
|
|
130
|
-
|
|
131
|
-
❌ Don't pad text essays with Unsplash "inspiration shots." Permission to use real images ≠ license to over-use them.
|
|
132
|
-
|
|
133
|
-
### C. Two Standard Delivery Forms — Ask First
|
|
134
|
-
|
|
135
|
-
Multi-screen app prototypes split into two standard forms. **Ask which one** before defaulting:
|
|
136
|
-
|
|
137
|
-
| Form | When | How |
|
|
138
|
-
| ----------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
|
139
|
-
| **Overview tile (design review default)** | User wants to see all screens, compare layout, walk through consistency | All screens in parallel, each in its own iPhone frame, no clicks needed |
|
|
140
|
-
| **Flow demo (single device)** | User wants to demonstrate a specific user flow (onboarding, purchase) | One iPhone with `AppPhone` state machine — tabs, buttons, annotations all clickable |
|
|
141
|
-
|
|
142
|
-
Routing keywords:
|
|
143
|
-
|
|
144
|
-
- "tile / show all pages / overview / compare / all screens" → overview
|
|
145
|
-
- "demonstrate flow / user path / walk through / clickable / interactive demo" → flow demo
|
|
146
|
-
- Ambiguous → ask. Don't default to flow demo (it's much more work).
|
|
147
|
-
|
|
148
|
-
**Overview skeleton:**
|
|
149
|
-
|
|
150
|
-
```jsx
|
|
151
|
-
<div style={{ display: "flex", gap: 32, flexWrap: "wrap", padding: 48, alignItems: "flex-start" }}>
|
|
152
|
-
{screens.map((s) => (
|
|
153
|
-
<div key={s.id}>
|
|
154
|
-
<div style={{ fontSize: 13, color: "#666", marginBottom: 8, fontStyle: "italic" }}>
|
|
155
|
-
{s.label}
|
|
156
|
-
</div>
|
|
157
|
-
<IosFrame>
|
|
158
|
-
<ScreenComponent data={s} />
|
|
159
|
-
</IosFrame>
|
|
160
|
-
</div>
|
|
161
|
-
))}
|
|
162
|
-
</div>
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
**Flow demo skeleton:**
|
|
166
|
-
|
|
167
|
-
```jsx
|
|
168
|
-
function AppPhone({ initial = "today" }) {
|
|
169
|
-
const [screen, setScreen] = React.useState(initial);
|
|
170
|
-
const [modal, setModal] = React.useState(null);
|
|
171
|
-
// dispatch to the right ScreenComponent, pass onEnter/onClose/onTabChange callbacks
|
|
172
|
-
}
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
Each Screen takes callback props (`onEnter`, `onClose`, `onTabChange`, `onOpen`, `onAnnotation`) — don't hard-code state. TabBar, buttons, cards get `cursor: pointer` + hover feedback.
|
|
176
|
-
|
|
177
|
-
### D. Click-Test Before Delivery
|
|
178
|
-
|
|
179
|
-
Static screenshots only show layout. Interaction bugs only surface when you click. Run a **3-action minimum Playwright test** before saying done:
|
|
180
|
-
|
|
181
|
-
1. Enter detail view
|
|
182
|
-
2. Trigger a key annotation
|
|
183
|
-
3. Switch tabs
|
|
184
|
-
|
|
185
|
-
Check `pageerror` count is 0. If not, fix and re-run.
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
npx playwright test prototype.spec.ts
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
### E. iOS Frame: Use a Pinned-Spec Component, Don't Hand-Code
|
|
192
|
-
|
|
193
|
-
The iPhone Dynamic Island has fixed pixel dimensions (124×36, top:12, centered). Hand-coding the bezel + status bar + island + home indicator → 99% chance of placement bugs (status bar items get squeezed by the island, content top-padding miscalculated).
|
|
194
|
-
|
|
195
|
-
**Rule**: bind to a known-good iOS frame component (e.g. an `IosFrame` you keep in a personal asset library). Don't write `.dynamic-island`, `.status-bar`, `.home-indicator`, or the bezel chrome inline.
|
|
196
|
-
|
|
197
|
-
```jsx
|
|
198
|
-
<IosFrame time="9:41" battery={85}>
|
|
199
|
-
<YourScreen />
|
|
200
|
-
</IosFrame>
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
Same rule for Android (`AndroidFrame`), macOS windows (`MacosWindow`), browser windows (`BrowserWindow`).
|
|
204
|
-
|
|
205
|
-
## Position Questions — Answer Before Designing the System
|
|
206
|
-
|
|
207
|
-
For every page / screen / shot, answer these **4 position questions** before opening CSS:
|
|
208
|
-
|
|
209
|
-
- **Narrative role** — hero / transition / data / quote / closer? (every page in a deck differs)
|
|
210
|
-
- **Viewing distance** — 10cm phone / 1m laptop / 10m projector? (drives font size + density)
|
|
211
|
-
- **Visual temperature** — quiet / excited / cool / authoritative / tender / mournful? (drives palette + rhythm)
|
|
212
|
-
- **Capacity check** — sketch 3 five-second thumbnails on paper. Does the content fit?
|
|
213
|
-
|
|
214
|
-
Then verbalize the design system (palette / type / layout rhythm / component patterns). System serves the answers — don't pick the system first and stuff content in.
|
|
215
|
-
|
|
216
|
-
🛑 **Checkpoint**: state the 4 answers + the system out loud. Wait for user nod **before** opening CSS.
|
|
217
|
-
|
|
218
|
-
## Standard Workflow (with Checkpoints)
|
|
219
|
-
|
|
220
|
-
1. **Understand the need.**
|
|
221
|
-
- 🔍 If task names a specific real product (DJI Pocket 4, Gemini 3 Pro, etc.): WebSearch first, write facts to `product-facts.md`. Don't guess from memory.
|
|
222
|
-
- Ask focused clarifying questions — batch them, don't drip-feed.
|
|
223
|
-
- 🛑 **Checkpoint 1**: send all questions, wait for user to answer in batch.
|
|
224
|
-
- 🛑 If brief is vague → run `design-direction-advisor` and complete Phase 1-4 first.
|
|
225
|
-
|
|
226
|
-
2. **Explore resources + extract assets.** Read design system, linked files, screenshots. For specific brands: run `brand-asset-protocol` (5 steps).
|
|
227
|
-
- 🛑 **Checkpoint 2 (asset self-check)**: physical product → product photo present (not CSS silhouette); digital product → logo + UI screenshot present; colors extracted from real HTML/SVG. Missing → stop and fix.
|
|
228
|
-
|
|
229
|
-
3. **Answer the 4 position questions, then verbalize the system.**
|
|
230
|
-
- 🛑 **Checkpoint 3**: state position answers + system. Wait for nod.
|
|
231
|
-
|
|
232
|
-
4. **Build folder structure.** `<project-name>/` holds main HTML + needed asset copies (don't bulk-copy >20 files).
|
|
233
|
-
|
|
234
|
-
5. **Junior pass.** HTML opens with assumptions + placeholders + reasoning comments.
|
|
235
|
-
- 🛑 **Checkpoint 4**: show early (gray blocks + labels are fine). Wait for feedback before writing components.
|
|
236
|
-
|
|
237
|
-
6. **Full pass.** Fill placeholders, build variations, add Tweaks if needed. **Show again mid-way**, not only at the end.
|
|
238
|
-
|
|
239
|
-
7. **Verify.** Playwright screenshot + console error check. Send to user.
|
|
240
|
-
- 🛑 **Checkpoint 5**: open the file in your own browser. Walk through. AI-written prototype code commonly has subtle interaction bugs.
|
|
241
|
-
|
|
242
|
-
8. **Summary.** Minimal — caveats and next steps only.
|
|
243
|
-
|
|
244
|
-
**Checkpoint principle**: when you hit a 🛑, stop and explicitly say _"I did X, next I plan Y, confirm?"_ — then **actually wait**. Don't say it and immediately continue.
|
|
245
|
-
|
|
246
|
-
## Pairs Well With
|
|
247
|
-
|
|
248
|
-
- `brand-asset-protocol` — extract real brand assets before designing
|
|
249
|
-
- `anti-ai-slop` — actively avoid the AI default aesthetic
|
|
250
|
-
- `design-direction-advisor` — when brief is too vague to start
|
|
251
|
-
- `design-taste-frontend` / `high-end-visual-design` — base aesthetic discipline
|
|
252
|
-
- `frontend-design` — when prototype graduates to production code
|
|
253
|
-
- `playwright` — for the click-test step
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: html-deck-export
|
|
3
|
-
description: Use when building HTML-based slide decks that need to ship as PDF or editable PPTX. MUST load BEFORE writing the first line of HTML if PPTX (with editable text) is a delivery target — choosing the wrong architecture costs 2-3 hours of rework. Covers multi-file vs single-file deck architecture, browser presentation, PDF export, and the 4 hard constraints for editable PPTX.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# HTML Deck Export
|
|
7
|
-
|
|
8
|
-
> Adapted from `huashu-design`. The hardest checkpoint isn't "single-file or multi-file" — it's **"what's the final delivery format?"** Get this wrong and you're rewriting 17 pages of HTML.
|
|
9
|
-
|
|
10
|
-
## The Critical Decision (Before First Line of HTML)
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
Q: What's the final delivery format?
|
|
14
|
-
├── Browser fullscreen presentation only / local HTML → maximum visual freedom
|
|
15
|
-
├── PDF (print / share / archive) → maximum visual freedom, any architecture exports
|
|
16
|
-
└── Editable PPTX (teammates will edit text) → 🛑 MUST follow 4 hard constraints from the first line
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
**Why "editable PPTX" forces decisions early**: PPTX with editable text requires `html2pptx`-style element-by-element DOM translation. That tool needs a structurally constrained HTML (see "4 Hard Constraints" below). Writing visually-rich HTML and converting after is a 2-3 hour rewrite. **From-scratch with constraints adds ~5 minutes per slide.**
|
|
20
|
-
|
|
21
|
-
### Real-Cost Comparison
|
|
22
|
-
|
|
23
|
-
| Path | Approach | Result | Cost |
|
|
24
|
-
| ------------------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
25
|
-
| ❌ **Free-form HTML, fix PPTX later** | Single-file deck-stage + lots of SVG / span / gradient | To get editable PPTX: hand-write hundreds of pptxgenjs lines OR rewrite HTML | **2-3 hour rework + ongoing maintenance debt** (HTML edit ≠ PPTX) |
|
|
26
|
-
| ✅ **Path-A constraints from line 1** | Per-page HTML + 4 constraints + 720×405pt | One command exports 100% editable PPTX, also presents in browser | **+5 min per slide thinking "how do I wrap text in `<p>`?"** |
|
|
27
|
-
|
|
28
|
-
## Opening Questionnaire (paste-ready)
|
|
29
|
-
|
|
30
|
-
> Before I touch HTML, confirm delivery:
|
|
31
|
-
>
|
|
32
|
-
> - **Browser presentation / PDF** → I can use animations, web components, complex SVG, CSS gradients
|
|
33
|
-
> - **Editable PPTX** (someone will edit text in PowerPoint) → I must follow 4 hard HTML constraints from the start. Visual capabilities reduce (no gradients, no web components, no complex SVG), but export becomes a single command
|
|
34
|
-
>
|
|
35
|
-
> Which?
|
|
36
|
-
|
|
37
|
-
**Mixed delivery clarifications:**
|
|
38
|
-
|
|
39
|
-
- "I want HTML presentation **and** editable PPTX" → not actually mixed. Path-A HTML _is_ presentable HTML; just add a deck index. Zero extra cost.
|
|
40
|
-
- "I want PPTX **and** animation/web component" → real conflict. Make the user choose. Don't silently hand-write pptxgenjs (becomes permanent maintenance debt).
|
|
41
|
-
|
|
42
|
-
## Architecture: Single-File vs Multi-File
|
|
43
|
-
|
|
44
|
-
After delivery format is locked, pick architecture:
|
|
45
|
-
|
|
46
|
-
| Architecture | When | Pattern |
|
|
47
|
-
| ------------------------ | ---------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
48
|
-
| **Multi-file** (default) | ≥10 pages, academic/courseware, multi-agent parallel | Each page is its own HTML; an `index.html`/iframe stitcher combines them |
|
|
49
|
-
| **Single-file** | ≤10 pages, pitch decks, cross-page state needed | One HTML with a slide container component (web component or React) |
|
|
50
|
-
|
|
51
|
-
**Multi-file advantages**: independent CSS scopes (no specificity wars), trivial parallel work, individual page reload during dev.
|
|
52
|
-
**Single-file advantages**: one file to share, easy state sharing across slides.
|
|
53
|
-
|
|
54
|
-
### Multi-File Stitcher (skeleton)
|
|
55
|
-
|
|
56
|
-
```html
|
|
57
|
-
<!-- index.html -->
|
|
58
|
-
<!doctype html>
|
|
59
|
-
<style>
|
|
60
|
-
body {
|
|
61
|
-
margin: 0;
|
|
62
|
-
background: #000;
|
|
63
|
-
}
|
|
64
|
-
iframe {
|
|
65
|
-
display: block;
|
|
66
|
-
width: 100vw;
|
|
67
|
-
height: 100vh;
|
|
68
|
-
border: 0;
|
|
69
|
-
}
|
|
70
|
-
</style>
|
|
71
|
-
<iframe id="stage" src="01.html"></iframe>
|
|
72
|
-
<script>
|
|
73
|
-
const slides = ["01.html", "02.html", "03.html", "04.html"];
|
|
74
|
-
let i = 0;
|
|
75
|
-
const stage = document.getElementById("stage");
|
|
76
|
-
document.addEventListener("keydown", (e) => {
|
|
77
|
-
if (e.key === "ArrowRight" && i < slides.length - 1) i++;
|
|
78
|
-
if (e.key === "ArrowLeft" && i > 0) i--;
|
|
79
|
-
stage.src = slides[i];
|
|
80
|
-
});
|
|
81
|
-
</script>
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Each `NN.html` is a fully standalone, double-clickable slide.
|
|
85
|
-
|
|
86
|
-
### Single-File Pattern (web component or React)
|
|
87
|
-
|
|
88
|
-
```html
|
|
89
|
-
<deck-stage>
|
|
90
|
-
<section class="active">Slide 1</section>
|
|
91
|
-
<section>Slide 2</section>
|
|
92
|
-
</deck-stage>
|
|
93
|
-
<script src="deck_stage.js"></script>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Two **hard constraints** for the web-component pattern:
|
|
97
|
-
|
|
98
|
-
- The `<script>` tag for the component **must come after** the `</deck-stage>` close tag (else slot rendering breaks)
|
|
99
|
-
- Section's `display: flex` must be on the `.active` class (not the section itself, else inactive slides fight for space)
|
|
100
|
-
|
|
101
|
-
## The 4 Hard Constraints for Editable PPTX
|
|
102
|
-
|
|
103
|
-
If you need editable PPTX export (via `html2pptx`-style tooling):
|
|
104
|
-
|
|
105
|
-
1. **Body fixed at 720pt × 405pt** — _not_ 1920×1080px. Use `pt` units for the deck container (PowerPoint's native unit).
|
|
106
|
-
2. **All text wrapped in `<p>` or `<h1>`–`<h6>`** — never plain `<div>` with text. Never `<span>` as the primary text carrier.
|
|
107
|
-
3. **`<p>` and `<h*>` themselves cannot have background / border / shadow** — put those on an outer `<div>`.
|
|
108
|
-
4. **No `background-image` on `<div>`** — use real `<img>` tags. No CSS gradients. No web components. No complex decorative SVG.
|
|
109
|
-
|
|
110
|
-
**If your HTML violates any of these**, the editable export will produce broken slides or fail outright. The _image-mode_ PPTX export (slide rendered as an image, embedded in PowerPoint) doesn't have these constraints — but the result is **not editable**.
|
|
111
|
-
|
|
112
|
-
## Two PPTX Export Modes
|
|
113
|
-
|
|
114
|
-
| Mode | Visual fidelity | Editability | When |
|
|
115
|
-
| ----------------- | --------------------- | ---------------------------------- | --------------------------------------------------------------------- |
|
|
116
|
-
| **Image mode** | 100% — pixel-perfect | None — text is image | Visual-rich slides, no edits expected, PDF-equivalent in PPTX wrapper |
|
|
117
|
-
| **Editable mode** | Reduced — constraints | Full — text editable in PowerPoint | Teammates will edit text, brand-spec font fallbacks expected |
|
|
118
|
-
|
|
119
|
-
Tools (per huashu-design pattern):
|
|
120
|
-
|
|
121
|
-
- `playwright` for browser rendering (already in this kit)
|
|
122
|
-
- `pptxgenjs` for PPTX object construction
|
|
123
|
-
- `pdf-lib` for multi-page PDF merge
|
|
124
|
-
- `sharp` (only for editable mode image fallbacks)
|
|
125
|
-
|
|
126
|
-
## PDF Export (Easy Path)
|
|
127
|
-
|
|
128
|
-
PDF tolerates any HTML architecture. Per-page browser screenshot → merge.
|
|
129
|
-
|
|
130
|
-
```js
|
|
131
|
-
// scripts/export-deck-pdf.mjs (skeleton)
|
|
132
|
-
import { chromium } from "playwright";
|
|
133
|
-
import { PDFDocument } from "pdf-lib";
|
|
134
|
-
import fs from "fs";
|
|
135
|
-
|
|
136
|
-
const slides = fs.readdirSync("slides").filter((f) => f.endsWith(".html"));
|
|
137
|
-
const browser = await chromium.launch();
|
|
138
|
-
const ctx = await browser.newContext({ viewport: { width: 1920, height: 1080 } });
|
|
139
|
-
const merged = await PDFDocument.create();
|
|
140
|
-
|
|
141
|
-
for (const file of slides) {
|
|
142
|
-
const page = await ctx.newPage();
|
|
143
|
-
await page.goto(`file://${process.cwd()}/slides/${file}`);
|
|
144
|
-
const pdfBytes = await page.pdf({ width: "1920px", height: "1080px", printBackground: true });
|
|
145
|
-
const tmp = await PDFDocument.load(pdfBytes);
|
|
146
|
-
const pages = await merged.copyPages(tmp, tmp.getPageIndices());
|
|
147
|
-
pages.forEach((p) => merged.addPage(p));
|
|
148
|
-
await page.close();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
fs.writeFileSync("deck.pdf", await merged.save());
|
|
152
|
-
await browser.close();
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
**Single-file deck-stage caveat**: shadow-DOM slot rendering can cause "only first slide exports." Use a per-slide URL fragment (`?slide=N`) and force the active slide before `page.pdf()`, or convert to multi-file before exporting.
|
|
156
|
-
|
|
157
|
-
## Recovery: Rewriting for Editable PPTX After the Fact
|
|
158
|
-
|
|
159
|
-
You're already mid-build and the user pivots to "we need editable PPTX." Two imperfect options:
|
|
160
|
-
|
|
161
|
-
| Option | Cost | When |
|
|
162
|
-
| ----------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------ |
|
|
163
|
-
| **Rewrite HTML to satisfy 4 constraints** | 2-3 hours for a typical 15-20 page deck | Long-term — it's the only path to ongoing one-command export |
|
|
164
|
-
| **Hand-write pptxgenjs version** | 1-2 hours initially + permanent dual-maintenance | One-shot delivery — never edited again |
|
|
165
|
-
|
|
166
|
-
**Always tell the user explicitly** which option you're picking and why. Don't silently choose the maintenance-debt path.
|
|
167
|
-
|
|
168
|
-
## Position Questions for Each Slide
|
|
169
|
-
|
|
170
|
-
Same as `hi-fi-prototype-html` — answer these before writing any slide:
|
|
171
|
-
|
|
172
|
-
- **Narrative role** — hero, transition, data, quote, closer?
|
|
173
|
-
- **Viewing distance** — laptop screen at 1m or projector at 10m? Drives font size and density.
|
|
174
|
-
- **Visual temperature** — quiet/excited/cool/authoritative/tender? Drives palette and rhythm.
|
|
175
|
-
- **Capacity check** — sketch 3 five-second thumbnails. Does it fit? (Most overcrowding is caught here.)
|
|
176
|
-
|
|
177
|
-
## Anti-Patterns
|
|
178
|
-
|
|
179
|
-
- ❌ Drawing slide chrome (page numbers, progress bars, titles) inside each slide AND in the deck stitcher → both render, double chrome
|
|
180
|
-
- ❌ Using `1920×1080px` units for editable-PPTX target (must be `720pt × 405pt`)
|
|
181
|
-
- ❌ One CSS file shared across multi-file slides — defeats the architecture's main benefit (scope isolation)
|
|
182
|
-
- ❌ Building visual-rich slides "we can convert to PPTX later" — the 2-3 hour rework is real
|
|
183
|
-
|
|
184
|
-
## Pairs Well With
|
|
185
|
-
|
|
186
|
-
- `hi-fi-prototype-html` — same checkpoint discipline (4 position questions, junior pass)
|
|
187
|
-
- `brand-asset-protocol` — required for branded decks
|
|
188
|
-
- `anti-ai-slop` — slide decks are slop-prone (gradient backgrounds, emoji bullets)
|
|
189
|
-
- `playwright` — drives PDF / image-mode PPTX export
|