baldart 3.6.2
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/CHANGELOG.md +599 -0
- package/README.md +566 -0
- package/VERSION +1 -0
- package/bin/baldart.js +143 -0
- package/framework/.claude/agents/REGISTRY.md +169 -0
- package/framework/.claude/agents/api-perf-cost-auditor.md +291 -0
- package/framework/.claude/agents/code-reviewer.md +350 -0
- package/framework/.claude/agents/codebase-architect.md +391 -0
- package/framework/.claude/agents/coder.md +291 -0
- package/framework/.claude/agents/deep-human-insight.md +198 -0
- package/framework/.claude/agents/doc-reviewer.md +440 -0
- package/framework/.claude/agents/email-deliverability-architect.md +193 -0
- package/framework/.claude/agents/hybrid-ml-architect.md +285 -0
- package/framework/.claude/agents/hyper-gamification-designer.md +149 -0
- package/framework/.claude/agents/legal-counsel-gdpr.md +179 -0
- package/framework/.claude/agents/marketing-conversion-strategist.md +162 -0
- package/framework/.claude/agents/motion-expert.md +108 -0
- package/framework/.claude/agents/onboarding-architect-lead.md +230 -0
- package/framework/.claude/agents/plan-auditor.md +546 -0
- package/framework/.claude/agents/prd-card-writer.md +372 -0
- package/framework/.claude/agents/prd.md +744 -0
- package/framework/.claude/agents/qa-sentinel.md +305 -0
- package/framework/.claude/agents/remotion-animator-orchestrator.md +218 -0
- package/framework/.claude/agents/security-reviewer.md +276 -0
- package/framework/.claude/agents/senior-researcher.md +175 -0
- package/framework/.claude/agents/seo-analytics-strategist.md +156 -0
- package/framework/.claude/agents/skill-improver.md +61 -0
- package/framework/.claude/agents/ui-expert.md +191 -0
- package/framework/.claude/agents/visual-designer.md +190 -0
- package/framework/.claude/agents/website-orchestrator.md +118 -0
- package/framework/.claude/agents/wiki-curator.md +145 -0
- package/framework/.claude/commands/baldart-push.md +15 -0
- package/framework/.claude/commands/check.md +237 -0
- package/framework/.claude/commands/codexreview.md +203 -0
- package/framework/.claude/commands/design-review.md +11 -0
- package/framework/.claude/commands/issue-review.md +34 -0
- package/framework/.claude/commands/new.md +331 -0
- package/framework/.claude/commands/qa.md +257 -0
- package/framework/.claude/hooks/framework-edit-gate.js +208 -0
- package/framework/.claude/hooks/lint-before-commit.sh.template +66 -0
- package/framework/.claude/settings.local.json.example +32 -0
- package/framework/.claude/skills/api-design-principles/SKILL.md +567 -0
- package/framework/.claude/skills/api-design-principles/assets/api-design-checklist.md +155 -0
- package/framework/.claude/skills/api-design-principles/assets/rest-api-template.py +182 -0
- package/framework/.claude/skills/api-design-principles/references/graphql-schema-design.md +583 -0
- package/framework/.claude/skills/api-design-principles/references/rest-best-practices.md +408 -0
- package/framework/.claude/skills/baldart-push/SKILL.md +222 -0
- package/framework/.claude/skills/bug/SKILL.md +200 -0
- package/framework/.claude/skills/bug/references/logging-patterns.md +174 -0
- package/framework/.claude/skills/capture/SKILL.md +125 -0
- package/framework/.claude/skills/capture/references/synthesis-template.md +42 -0
- package/framework/.claude/skills/context-primer/SKILL.md +189 -0
- package/framework/.claude/skills/copywriting/SKILL.md +273 -0
- package/framework/.claude/skills/copywriting/references/copy-frameworks.md +338 -0
- package/framework/.claude/skills/copywriting/references/natural-transitions.md +252 -0
- package/framework/.claude/skills/doc-writing-for-rag/SKILL.md +119 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/before-after-examples.md +291 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/compact-templates.md +183 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/frontmatter-minimal.md +112 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/line-count-targets.md +110 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/schemas-and-errors.md +129 -0
- package/framework/.claude/skills/find-skills/SKILL.md +133 -0
- package/framework/.claude/skills/frontend-design/LICENSE.txt +177 -0
- package/framework/.claude/skills/frontend-design/SKILL.md +84 -0
- package/framework/.claude/skills/gamification-design/SKILL.md +130 -0
- package/framework/.claude/skills/issue-review/SKILL.md +45 -0
- package/framework/.claude/skills/kie-ai/SKILL.md +262 -0
- package/framework/.claude/skills/kie-ai/references/models-catalog.md +272 -0
- package/framework/.claude/skills/kie-ai/scripts/kie_api.sh +209 -0
- package/framework/.claude/skills/kie-ai/scripts/remove_greenscreen.py +69 -0
- package/framework/.claude/skills/kie-ai/scripts/setup_api_key.sh +77 -0
- package/framework/.claude/skills/motion-design/LICENSE +21 -0
- package/framework/.claude/skills/motion-design/README.md +82 -0
- package/framework/.claude/skills/motion-design/SKILL.md +336 -0
- package/framework/.claude/skills/motion-design/director/choreography.md +93 -0
- package/framework/.claude/skills/motion-design/director/context-adaptation.md +83 -0
- package/framework/.claude/skills/motion-design/director/core-philosophy.md +53 -0
- package/framework/.claude/skills/motion-design/director/decision-framework.md +91 -0
- package/framework/.claude/skills/motion-design/director/disney-principles.md +102 -0
- package/framework/.claude/skills/motion-design/director/emotion-mapping.md +71 -0
- package/framework/.claude/skills/motion-design/director/motion-personality.md +89 -0
- package/framework/.claude/skills/motion-design/director/narrative-structure.md +62 -0
- package/framework/.claude/skills/motion-design/patterns/ambient-continuous.md +81 -0
- package/framework/.claude/skills/motion-design/patterns/entrance-exit.md +82 -0
- package/framework/.claude/skills/motion-design/patterns/multi-element.md +69 -0
- package/framework/.claude/skills/motion-design/patterns/state-feedback.md +96 -0
- package/framework/.claude/skills/motion-design/reference/property-selection.md +95 -0
- package/framework/.claude/skills/motion-design/reference/quality-checklist.md +67 -0
- package/framework/.claude/skills/motion-design/reference/timing-easing-tables.md +106 -0
- package/framework/.claude/skills/motion-design/reference/troubleshooting.md +73 -0
- package/framework/.claude/skills/new/SKILL.md +1687 -0
- package/framework/.claude/skills/playwright-skill/API_REFERENCE.md +652 -0
- package/framework/.claude/skills/playwright-skill/SKILL.md +157 -0
- package/framework/.claude/skills/playwright-skill/package.json +26 -0
- package/framework/.claude/skills/prd/SKILL.md +228 -0
- package/framework/.claude/skills/prd/assets/card-template.yml +232 -0
- package/framework/.claude/skills/prd/assets/epic-template.yml +190 -0
- package/framework/.claude/skills/prd/assets/prd-template.md +230 -0
- package/framework/.claude/skills/prd/assets/state-template.md +78 -0
- package/framework/.claude/skills/prd/references/api-perf-gate.md +152 -0
- package/framework/.claude/skills/prd/references/audit-phase.md +478 -0
- package/framework/.claude/skills/prd/references/backlog-phase.md +145 -0
- package/framework/.claude/skills/prd/references/discovery-phase.md +359 -0
- package/framework/.claude/skills/prd/references/impact-analysis.md +233 -0
- package/framework/.claude/skills/prd/references/prd-add-phase.md +214 -0
- package/framework/.claude/skills/prd/references/prd-writing-phase.md +145 -0
- package/framework/.claude/skills/prd/references/research-phase.md +216 -0
- package/framework/.claude/skills/prd/references/ui-design-phase.md +61 -0
- package/framework/.claude/skills/prd/references/validation-phase.md +72 -0
- package/framework/.claude/skills/prd-add/SKILL.md +222 -0
- package/framework/.claude/skills/prd-add/references/impact-analysis.md +233 -0
- package/framework/.claude/skills/remotion-best-practices/SKILL.md +48 -0
- package/framework/.claude/skills/remotion-best-practices/rules/3d.md +86 -0
- package/framework/.claude/skills/remotion-best-practices/rules/animations.md +29 -0
- package/framework/.claude/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/framework/.claude/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/framework/.claude/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
- package/framework/.claude/skills/remotion-best-practices/rules/assets.md +78 -0
- package/framework/.claude/skills/remotion-best-practices/rules/audio.md +169 -0
- package/framework/.claude/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
- package/framework/.claude/skills/remotion-best-practices/rules/can-decode.md +75 -0
- package/framework/.claude/skills/remotion-best-practices/rules/charts.md +58 -0
- package/framework/.claude/skills/remotion-best-practices/rules/compositions.md +141 -0
- package/framework/.claude/skills/remotion-best-practices/rules/display-captions.md +184 -0
- package/framework/.claude/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/framework/.claude/skills/remotion-best-practices/rules/fonts.md +152 -0
- package/framework/.claude/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/framework/.claude/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/framework/.claude/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
- package/framework/.claude/skills/remotion-best-practices/rules/gifs.md +141 -0
- package/framework/.claude/skills/remotion-best-practices/rules/images.md +130 -0
- package/framework/.claude/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
- package/framework/.claude/skills/remotion-best-practices/rules/light-leaks.md +73 -0
- package/framework/.claude/skills/remotion-best-practices/rules/lottie.md +67 -0
- package/framework/.claude/skills/remotion-best-practices/rules/maps.md +401 -0
- package/framework/.claude/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
- package/framework/.claude/skills/remotion-best-practices/rules/measuring-text.md +143 -0
- package/framework/.claude/skills/remotion-best-practices/rules/parameters.md +98 -0
- package/framework/.claude/skills/remotion-best-practices/rules/sequencing.md +118 -0
- package/framework/.claude/skills/remotion-best-practices/rules/subtitles.md +36 -0
- package/framework/.claude/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/framework/.claude/skills/remotion-best-practices/rules/text-animations.md +20 -0
- package/framework/.claude/skills/remotion-best-practices/rules/timing.md +179 -0
- package/framework/.claude/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
- package/framework/.claude/skills/remotion-best-practices/rules/transitions.md +197 -0
- package/framework/.claude/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
- package/framework/.claude/skills/remotion-best-practices/rules/trimming.md +52 -0
- package/framework/.claude/skills/remotion-best-practices/rules/videos.md +171 -0
- package/framework/.claude/skills/seo-audit/SKILL.md +394 -0
- package/framework/.claude/skills/seo-audit/references/aeo-geo-patterns.md +279 -0
- package/framework/.claude/skills/seo-audit/references/ai-writing-detection.md +190 -0
- package/framework/.claude/skills/simplify/SKILL.md +137 -0
- package/framework/.claude/skills/skill-creator/LICENSE.txt +202 -0
- package/framework/.claude/skills/skill-creator/SKILL.md +356 -0
- package/framework/.claude/skills/skill-creator/references/output-patterns.md +82 -0
- package/framework/.claude/skills/skill-creator/references/workflows.md +28 -0
- package/framework/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
- package/framework/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
- package/framework/.claude/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/framework/.claude/skills/ui-design/SKILL.md +199 -0
- package/framework/.claude/skills/ui-design/references/component-discovery.md +54 -0
- package/framework/.claude/skills/ui-design/references/evaluation.md +171 -0
- package/framework/.claude/skills/ui-design/references/generation.md +109 -0
- package/framework/.claude/skills/ui-design/references/inventory.md +59 -0
- package/framework/.claude/skills/webapp-testing/LICENSE.txt +202 -0
- package/framework/.claude/skills/webapp-testing/SKILL.md +123 -0
- package/framework/.claude/skills/webapp-testing/examples/console_logging.py +35 -0
- package/framework/.claude/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/framework/.claude/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/framework/.claude/skills/webapp-testing/scripts/with_server.py +106 -0
- package/framework/.claude/skills/worktree-manager/SKILL.md +680 -0
- package/framework/AGENTS.md +240 -0
- package/framework/agents/api-contracts.md +137 -0
- package/framework/agents/architecture.md +145 -0
- package/framework/agents/coding-standards.md +148 -0
- package/framework/agents/data-model.md +110 -0
- package/framework/agents/deployment-protocol.md +232 -0
- package/framework/agents/design-review.md +172 -0
- package/framework/agents/env-reference.md +171 -0
- package/framework/agents/github-issue-subagent.md +252 -0
- package/framework/agents/index.md +261 -0
- package/framework/agents/llm-wiki-methodology.md +216 -0
- package/framework/agents/maintenance-protocol.md +305 -0
- package/framework/agents/observability.md +162 -0
- package/framework/agents/performance.md +155 -0
- package/framework/agents/project-context.md +145 -0
- package/framework/agents/runbook.md +208 -0
- package/framework/agents/security.md +168 -0
- package/framework/agents/skills-mapping.md +286 -0
- package/framework/agents/testing.md +111 -0
- package/framework/agents/workflows.md +215 -0
- package/framework/docs/PROJECT-CONFIGURATION.md +336 -0
- package/framework/docs/references/brand-guidelines.md +170 -0
- package/framework/docs/references/ui-guidelines.template.md +182 -0
- package/framework/routines/code-review.routine.yml +46 -0
- package/framework/routines/doc-review.routine.yml +45 -0
- package/framework/routines/ds-drift.routine.yml +52 -0
- package/framework/routines/full-sweep.routine.yml +51 -0
- package/framework/routines/index.yml +70 -0
- package/framework/routines/skill-improve.routine.yml +50 -0
- package/framework/routines/wiki-review.routine.yml +45 -0
- package/framework/templates/baldart.config.template.yml +113 -0
- package/framework/templates/breaking-change-checklist.md +484 -0
- package/framework/templates/feature-card.template.yml +125 -0
- package/framework/templates/overlays/README.md +44 -0
- package/framework/templates/overlays/copywriting.fidelity-example.md +62 -0
- package/framework/templates/overlays/ui-design.fidelity-example.md +75 -0
- package/framework/templates/skill-project-context.snippet.md +19 -0
- package/framework/templates/spec.template.md +208 -0
- package/package.json +51 -0
- package/src/commands/add.js +229 -0
- package/src/commands/configure.js +385 -0
- package/src/commands/doctor.js +486 -0
- package/src/commands/migrate.js +185 -0
- package/src/commands/push.js +0 -0
- package/src/commands/routines.js +269 -0
- package/src/commands/status.js +130 -0
- package/src/commands/update.js +419 -0
- package/src/commands/version.js +88 -0
- package/src/utils/contamination.js +400 -0
- package/src/utils/git.js +181 -0
- package/src/utils/hooks.js +152 -0
- package/src/utils/routine-adapters/claude-code-cloud.js +78 -0
- package/src/utils/routine-adapters/cron.js +138 -0
- package/src/utils/routine-adapters/github-actions.js +141 -0
- package/src/utils/routine-adapters/index.js +21 -0
- package/src/utils/routines.js +166 -0
- package/src/utils/state.js +143 -0
- package/src/utils/symlinks.js +425 -0
- package/src/utils/ui.js +133 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ui-design
|
|
3
|
+
description: "UI design workflow. Generates context-aware mockups with GAN-inspired generator/evaluator separation, visual verification via Playwright, and structured sprint contracts. Use when: (1) designing new pages or components, (2) the /prd skill reaches its UI design phase (Step 3), (3) redesigning existing pages, (4) creating design options for user review, (5) any task involving 'design UI', 'mockup', 'opzioni di design', 'progetta interfaccia', '3 opzioni', 'design page', 'UI design'. Not for: bug fixes, small tweaks, copy-only changes, or implementing an already-chosen design."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# UI Design Skill
|
|
7
|
+
|
|
8
|
+
Design workflow that produces context-aware mockup options, evaluates them with
|
|
9
|
+
separated generator/evaluator agents (GAN pattern), and delivers an approved
|
|
10
|
+
design with a structured UI Element Inventory.
|
|
11
|
+
|
|
12
|
+
**Architecture principle:** The generator never evaluates its own output.
|
|
13
|
+
Evaluation is always performed by a separate agent with fresh context.
|
|
14
|
+
(Ref: Anthropic "Harness Design for Long-Running Apps")
|
|
15
|
+
|
|
16
|
+
## Project Context
|
|
17
|
+
|
|
18
|
+
**Reads from `baldart.config.yml`:**
|
|
19
|
+
`paths.design_system`, `paths.ui_guidelines`, `paths.components_primitives`,
|
|
20
|
+
`paths.components_root`, `paths.global_styles`, `paths.prd_dir`,
|
|
21
|
+
`identity.design_philosophy`, `identity.language`, `identity.audience_segments`,
|
|
22
|
+
`stack.charting.canonical`, `stack.charting.forbidden`, `stack.charting.wrappers_root`.
|
|
23
|
+
|
|
24
|
+
**Gated by features:**
|
|
25
|
+
`features.has_design_system` (when `true`, design-system reads are BLOCKING; when `false`, skip step 1 of Prerequisites and rely on `paths.ui_guidelines` alone).
|
|
26
|
+
|
|
27
|
+
**Overlay:** loads `.baldart/overlays/ui-design.md` if present — extends base by default; sections marked `## [OVERRIDE] <topic>` replace base sections. See `framework/agents/project-context.md` § 5.
|
|
28
|
+
|
|
29
|
+
**On missing/empty keys:** ask the user; do not assume defaults. See `framework/agents/project-context.md` § 3.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Prerequisites — BLOCKING reads before ANY design work
|
|
34
|
+
|
|
35
|
+
These reads are BLOCKING. Resolve paths from `baldart.config.yml` before opening files. If `features.has_design_system: true`, item 1 is the mandatory entry point and skipping it is a protocol violation.
|
|
36
|
+
|
|
37
|
+
1. **MANDATORY / BLOCKING when `features.has_design_system: true`** — read `${paths.design_system}/INDEX.md` (the design-system entry point: component index, authority matrix, token contract, any project-specific theming pairing rules and overlay decision tree).
|
|
38
|
+
2. **MANDATORY / BLOCKING** — read `${paths.ui_guidelines}` for canonical visual language, typography, accessibility, and brand voice. If the project has a `identity.design_philosophy` set, that philosophy is the lens through which the guidelines apply.
|
|
39
|
+
3. **MANDATORY when `features.has_design_system: true`** — read `${paths.design_system}/tokens-reference.md` (if present): token contract. Never hardcode values that bypass this SSOT.
|
|
40
|
+
4. **MANDATORY when `features.has_design_system: true`** — read the relevant `${paths.design_system}/components/<Name>.md` for every primitive you will touch, and the relevant `${paths.design_system}/patterns/*.md` for the pattern involved.
|
|
41
|
+
5. **MANDATORY for chart / data-viz tasks** — apply `stack.charting`:
|
|
42
|
+
- Propose only libraries in `stack.charting.canonical`. Refuse libraries listed in `stack.charting.forbidden`.
|
|
43
|
+
- If `stack.charting.wrappers_root` is set, propose those project wrappers over raw library usage.
|
|
44
|
+
- If both lists are empty, ask the user which charting library to use before proposing one.
|
|
45
|
+
6. **MUST** run `ui-ux-pro-max` skill for design intelligence (bounded by the design-system SSOT above — advisory only).
|
|
46
|
+
7. **MUST** identify the audience segment for the work, using `identity.audience_segments` as the menu of valid choices. If segments are empty, treat the work as undifferentiated.
|
|
47
|
+
8. If brand inputs are missing (e.g. logo, accent palette), ask — never invent.
|
|
48
|
+
|
|
49
|
+
## Design System Alignment
|
|
50
|
+
|
|
51
|
+
- Token consumption follows the project's chosen mechanism (CSS custom properties in `${paths.global_styles}`, Tailwind config, theme provider, etc.). The base skill assumes nothing; defer to the design-system docs above for the project's mechanism.
|
|
52
|
+
- Canonical sources (resolve via `baldart.config.yml`):
|
|
53
|
+
- `${paths.design_system}/INDEX.md` — component index + authority matrix (when `features.has_design_system: true`)
|
|
54
|
+
- `${paths.design_system}/tokens-reference.md` — human-readable token contract
|
|
55
|
+
- `${paths.design_system}/components/<Name>.md` — per-component specs
|
|
56
|
+
- `${paths.design_system}/patterns/*.md` — pattern docs (e.g. theming, overlays, motion)
|
|
57
|
+
- NEVER hardcode hex colors, shadow tuples, or border-width values when the project has a token contract. Use the tokens listed in the contract.
|
|
58
|
+
- If the project uses multi-tenant theming (`features.multi_tenant_theming: true`), themed-surface text/bg pairing is mandatory per the project's theming pattern doc — consult `.baldart/overlays/ui-design.md` for the exact pairing rule.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Workflow Steps
|
|
63
|
+
|
|
64
|
+
### Step A — Component Discovery
|
|
65
|
+
|
|
66
|
+
Read [references/component-discovery.md](references/component-discovery.md).
|
|
67
|
+
|
|
68
|
+
Before running the cascade, consult `${paths.design_system}/INDEX.md` (when present) and the relevant per-component doc in `${paths.design_system}/components/`. This is the authoritative inventory of tokens-compliant primitives.
|
|
69
|
+
|
|
70
|
+
Run the full cascade: design-system INDEX → project search (`${paths.components_primitives}/*`, `${paths.components_root}/shared/*` if applicable) → 21st.dev catalog → create from scratch. Document which existing components to reuse and which need creation. Any new component must consume the project's design tokens.
|
|
71
|
+
|
|
72
|
+
### Step B — Context Capture
|
|
73
|
+
|
|
74
|
+
Read [references/generation.md](references/generation.md) § Context Capture.
|
|
75
|
+
|
|
76
|
+
1. Identify 1-3 pages where the feature will live.
|
|
77
|
+
2. Capture screenshots via Playwright. Save to `/tmp/prd-design-<slug>/context/`.
|
|
78
|
+
3. Invoke `codebase-architect` to analyze adjacent UI components, layout patterns, and design tokens. Report file paths and rendered structure.
|
|
79
|
+
|
|
80
|
+
### Step C — Generate 3 Options (GENERATOR)
|
|
81
|
+
|
|
82
|
+
Read [references/generation.md](references/generation.md).
|
|
83
|
+
|
|
84
|
+
**MANDATORY:** invoke the `huashu-design` skill before generating any HTML. It provides the HTML prototype engine (React+Babel or vanilla+Tailwind CDN, Tweaks panel, App Prototype shell with AppPhone state manager, Playwright click validation, animated output). Follow its rules for the prototype type in scope.
|
|
85
|
+
|
|
86
|
+
**Filesystem rule (ABSOLUTE):** every HTML file MUST be written to disk with the `Write` tool at `/tmp/prd-design-<slug>/option-X.html` BEFORE opening in a browser. Outputting inline code blocks is not sufficient.
|
|
87
|
+
|
|
88
|
+
Invoke `ui-expert` agent with:
|
|
89
|
+
- Feature description and discovery answers
|
|
90
|
+
- Context screenshots (Read the image files)
|
|
91
|
+
- Codebase-architect findings
|
|
92
|
+
- 21st.dev catalog categories
|
|
93
|
+
- Full generation rules from the reference
|
|
94
|
+
- `huashu-design` prototype rules loaded above
|
|
95
|
+
- `identity.design_philosophy` and `identity.language` to drive aesthetic and copy register
|
|
96
|
+
|
|
97
|
+
Output: 3 HTML files written to `/tmp/prd-design-<slug>/` via `Write` tool.
|
|
98
|
+
|
|
99
|
+
### Step D — Evaluate Options (EVALUATOR — separate agent)
|
|
100
|
+
|
|
101
|
+
Read [references/evaluation.md](references/evaluation.md).
|
|
102
|
+
|
|
103
|
+
Invoke a **separate** `code-reviewer` agent (NOT the same agent that generated):
|
|
104
|
+
- Pass the 3 HTML files
|
|
105
|
+
- Pass the context screenshots as reference
|
|
106
|
+
- Pass the evaluation rubric (7 criteria, scoring 1-5, hard thresholds)
|
|
107
|
+
- Request: produce evaluation report at `/tmp/prd-design-<slug>/evaluation-report.md`
|
|
108
|
+
|
|
109
|
+
**If any option FAIL:** send feedback to generator, re-generate, re-evaluate. Max 5 iterations per option.
|
|
110
|
+
|
|
111
|
+
**If PASS:** proceed to Step E.
|
|
112
|
+
|
|
113
|
+
### Step E — Present to User
|
|
114
|
+
|
|
115
|
+
1. **Open all 3 options in the user's default browser (MANDATORY):**
|
|
116
|
+
```bash
|
|
117
|
+
open /tmp/prd-design-<slug>/option-a.html
|
|
118
|
+
open /tmp/prd-design-<slug>/option-b.html
|
|
119
|
+
open /tmp/prd-design-<slug>/option-c.html
|
|
120
|
+
```
|
|
121
|
+
(On non-macOS hosts, substitute `xdg-open` / `start`.)
|
|
122
|
+
2. Show screenshots inline as supplement.
|
|
123
|
+
3. For each option: approach name, reused vs. new components. **DO NOT give evaluation scores, rankings, or recommendations on which to pick.**
|
|
124
|
+
|
|
125
|
+
**STOP.** Wait for user choice.
|
|
126
|
+
|
|
127
|
+
### Step F — Iterate on Feedback
|
|
128
|
+
|
|
129
|
+
1. User chooses option or requests changes.
|
|
130
|
+
2. Generator applies changes (with context screenshots as reference).
|
|
131
|
+
3. Evaluator re-evaluates (same rubric, fresh context).
|
|
132
|
+
4. Open updated HTML + show screenshot.
|
|
133
|
+
5. Repeat until explicit user approval.
|
|
134
|
+
|
|
135
|
+
### Step G — Save & Produce Inventory
|
|
136
|
+
|
|
137
|
+
Read [references/inventory.md](references/inventory.md).
|
|
138
|
+
|
|
139
|
+
1. Copy approved HTML to `${paths.prd_dir}/<slug>/design.html` (if `features.has_prd_workflow: true`; otherwise ask the user where to persist the design).
|
|
140
|
+
2. Extract UI Element Inventory (sprint contract).
|
|
141
|
+
3. Update state file with chosen option, design decisions, component lists.
|
|
142
|
+
4. Clean up `/tmp/prd-design-<slug>/`.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Design Principles (quick reference)
|
|
147
|
+
|
|
148
|
+
These are enforced — read `${paths.ui_guidelines}` for full spec.
|
|
149
|
+
|
|
150
|
+
- **Minimalism**: every control justifies its existence
|
|
151
|
+
- **Mobile-first**: 320px upward, 44px touch targets, 200% text scaling
|
|
152
|
+
- **Contrast**: every `bg-*` MUST have explicit `text-*` (WCAG 4.5:1)
|
|
153
|
+
- **Multi-tenant theming pairing**: when `features.multi_tenant_theming: true`, themed text-token paired with themed bg-token per the project's theming pattern doc
|
|
154
|
+
- **View State Trinity**: loading (skeletons), error (localized message + retry), empty (CTA). The error language follows `identity.language`.
|
|
155
|
+
- **Separation of concerns**: UI / business logic / data layers stay separate
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## When This Skill is Called by /prd
|
|
160
|
+
|
|
161
|
+
The `/prd` skill invokes this skill for its Step 3 (UI Design Phase).
|
|
162
|
+
The flow maps directly:
|
|
163
|
+
|
|
164
|
+
| /prd Step | This skill Step |
|
|
165
|
+
|-----------|-----------------|
|
|
166
|
+
| 3a — UI Context Analysis | Steps A + B |
|
|
167
|
+
| 3b — 3 Design Options | Steps C + D + E |
|
|
168
|
+
| 3c — Design Iteration | Step F |
|
|
169
|
+
| 3d — Save & Inventory | Step G |
|
|
170
|
+
|
|
171
|
+
The `/prd` skill should invoke `ui-design` and follow its output rather than duplicating the design workflow internally.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Delegation
|
|
176
|
+
|
|
177
|
+
### To `visual-designer` agent
|
|
178
|
+
|
|
179
|
+
For: hero illustrations, custom icons, empty state artwork, decorative backgrounds, onboarding visuals, campaign assets.
|
|
180
|
+
|
|
181
|
+
Provide: asset type, purpose, relevant section, style-guideline reference, brand colors, aspect ratio. Use `identity.design_philosophy` to set the aesthetic direction.
|
|
182
|
+
|
|
183
|
+
### To `motion-expert` agent
|
|
184
|
+
|
|
185
|
+
For: hover states, page transitions, expand/collapse motion, micro-interactions, reduced-motion-safe specs.
|
|
186
|
+
|
|
187
|
+
Provide: triggering action, affected element, desired feedback, accessibility requirements. If `stack.animation.canonical` is set, the motion-expert proposes specs targeting those libraries.
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Linked Skills
|
|
192
|
+
|
|
193
|
+
| Skill | When |
|
|
194
|
+
|-------|------|
|
|
195
|
+
| `huashu-design` | **MANDATORY in Step C** — HTML prototype engine, App Prototype shell, Tweaks, Playwright validation, MP4/GIF export |
|
|
196
|
+
| `ui-ux-pro-max` | Before substantial design for design intelligence |
|
|
197
|
+
| `frontend-design` | To translate design into production code |
|
|
198
|
+
| `webapp-testing` | For browser verification with Playwright |
|
|
199
|
+
| `playwright-skill` | For quick screenshots and responsive checks |
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Component Discovery
|
|
2
|
+
|
|
3
|
+
Cascade obbligatoria prima di proporre o creare qualsiasi componente UI.
|
|
4
|
+
|
|
5
|
+
> Paths in this file resolve from `baldart.config.yml`. See
|
|
6
|
+
> `framework/agents/project-context.md` § 4.
|
|
7
|
+
|
|
8
|
+
## Step 1 — Cerca nel progetto
|
|
9
|
+
|
|
10
|
+
1. Cerca in `${paths.components_root}` componenti riutilizzabili.
|
|
11
|
+
2. Controlla `${paths.components_primitives}` per primitive (Button, Card, Badge, etc.).
|
|
12
|
+
3. Controlla cartelle di dominio derivate da `identity.audience_segments` (es. `${paths.components_root}/<segment>/`). Se `audience_segments` è vuoto, salta questo passaggio.
|
|
13
|
+
4. Preferisci estendere o comporre un componente esistente piuttosto che duplicare.
|
|
14
|
+
|
|
15
|
+
## Step 2 — Cerca nel catalogo 21st.dev
|
|
16
|
+
|
|
17
|
+
Prima di creare un componente da zero, controlla la libreria community.
|
|
18
|
+
|
|
19
|
+
1. Se il progetto traccia un catalogo locale (per esempio `${paths.references_dir}/21st-dev-catalog.md`), leggilo. Altrimenti vai direttamente al sito.
|
|
20
|
+
2. **Freshness check:** confronta `last_updated` nel frontmatter con oggi.
|
|
21
|
+
- Se più vecchio di 15 giorni → esegui il **Catalog Refresh** (sotto).
|
|
22
|
+
- Se fresco → continua.
|
|
23
|
+
3. Trova la categoria rilevante e naviga l'URL 21st.dev linkato.
|
|
24
|
+
4. Se esiste un componente adatto, installa:
|
|
25
|
+
```bash
|
|
26
|
+
npx shadcn@latest add "https://21st.dev/r/<author>/<component-slug>"
|
|
27
|
+
```
|
|
28
|
+
5. Dopo l'installazione, **adatta al design system del progetto**:
|
|
29
|
+
- Token-compliance: usa i token definiti in `${paths.design_system}/tokens-reference.md` (quando `features.has_design_system: true`).
|
|
30
|
+
- Stilistica: applica le regole estetiche di `identity.design_philosophy` come specificate in `${paths.ui_guidelines}` e nell'overlay `.baldart/overlays/ui-design.md` (se presente).
|
|
31
|
+
- Multi-tenant: se `features.multi_tenant_theming: true`, applica la regola di pairing themed text/bg del progetto.
|
|
32
|
+
- Touch target: minimo 44x44px.
|
|
33
|
+
6. Per **pagine landing/marketing**: i componenti possono essere usati con adattamento minimo perché in genere non richiedono il design system completo. Consulta l'overlay del progetto per la regola esatta.
|
|
34
|
+
|
|
35
|
+
## Step 3 — Crea da zero (ultima risorsa)
|
|
36
|
+
|
|
37
|
+
Solo se non esiste né nel progetto né su 21st.dev:
|
|
38
|
+
|
|
39
|
+
- Posiziona il nuovo componente nella cartella shared o di dominio corretta (sotto `${paths.components_root}`).
|
|
40
|
+
- Segui `${paths.ui_guidelines}` per tutte le decisioni stilistiche.
|
|
41
|
+
- Consuma i token definiti in `${paths.design_system}/tokens-reference.md` (quando `features.has_design_system: true`).
|
|
42
|
+
|
|
43
|
+
## Catalog Refresh Protocol
|
|
44
|
+
|
|
45
|
+
Quando il catalogo è stale (>15 giorni da `last_updated`):
|
|
46
|
+
|
|
47
|
+
1. Usa `playwright-skill` per aprire gli URL delle categorie ad alta rilevanza (buttons, cards, tables, forms, heroes, charts, calendars).
|
|
48
|
+
2. Screenshot di ogni pagina ed estrai conteggi aggiornati e nuovi componenti notevoli.
|
|
49
|
+
3. Aggiorna il catalogo locale (es. `${paths.references_dir}/21st-dev-catalog.md`):
|
|
50
|
+
- Aggiorna numeri "Est. Count".
|
|
51
|
+
- Aggiungi nuovi componenti notevoli con comandi di installazione diretti.
|
|
52
|
+
- Aggiorna `last_updated` a oggi.
|
|
53
|
+
- Imposta `next_refresh_due` a oggi + 15 giorni.
|
|
54
|
+
4. Procedi con la ricerca dopo il refresh.
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Evaluation Phase — Criteri e Rubric per il Valutatore
|
|
2
|
+
|
|
3
|
+
> Stylistic identity (design philosophy, theming pairing rules) and project
|
|
4
|
+
> language resolve from `baldart.config.yml`. See
|
|
5
|
+
> `framework/agents/project-context.md` § 4. Project-specific stricter
|
|
6
|
+
> thresholds live in `.baldart/overlays/ui-design.md` § Evaluation.
|
|
7
|
+
|
|
8
|
+
Questo file definisce come valutare i mockup HTML. Il valutatore è un agente SEPARATO dal generatore (pattern GAN — ref: Anthropic "Harness Design for Long-Running Apps").
|
|
9
|
+
|
|
10
|
+
**Principio fondamentale:** chi genera non si auto-valuta. La separazione generatore/valutatore
|
|
11
|
+
elimina il bias sistematico di auto-approvazione.
|
|
12
|
+
|
|
13
|
+
## Ruolo del Valutatore
|
|
14
|
+
|
|
15
|
+
1. Riceve i file HTML generati (`option-a.html`, `option-b.html`, `option-c.html`).
|
|
16
|
+
2. Apre ciascuno in browser via Playwright (`webapp-testing` skill).
|
|
17
|
+
3. Prende screenshot e valuta contro i criteri sotto.
|
|
18
|
+
4. Produce un report strutturato con punteggi e verdetto.
|
|
19
|
+
5. Se FAIL: rimanda al generatore con feedback specifico.
|
|
20
|
+
|
|
21
|
+
## Criteri di Valutazione (7 dimensioni)
|
|
22
|
+
|
|
23
|
+
Ogni criterio ha un punteggio 1-5 con soglie hard.
|
|
24
|
+
|
|
25
|
+
### C1 — Context Fidelity
|
|
26
|
+
|
|
27
|
+
Lo shell UI circostante (sidebar, header, nav) e fedele alle screenshot reali della piattaforma.
|
|
28
|
+
|
|
29
|
+
| Score | Descrizione |
|
|
30
|
+
|-------|-------------|
|
|
31
|
+
| 1 | Shell completamente assente o inventato |
|
|
32
|
+
| 2 | Shell presente ma layout/colori significativamente diversi |
|
|
33
|
+
| 3 | Shell riconoscibile, alcune discrepanze di dettaglio |
|
|
34
|
+
| 4 | Shell fedele, differenze minori trascurabili |
|
|
35
|
+
| 5 | Shell indistinguibile dagli screenshot reali |
|
|
36
|
+
|
|
37
|
+
### C2 — Layout & Spacing
|
|
38
|
+
|
|
39
|
+
Spacing, allineamento, nessun overflow/clipping, proporzioni responsive.
|
|
40
|
+
|
|
41
|
+
| Score | Descrizione |
|
|
42
|
+
|-------|-------------|
|
|
43
|
+
| 1 | Overflow visibile, elementi sovrapposti, layout rotto |
|
|
44
|
+
| 2 | Allineamento inconsistente, spacing irregolare |
|
|
45
|
+
| 3 | Layout funzionale, qualche disallineamento minore |
|
|
46
|
+
| 4 | Layout pulito, spacing coerente, nessun overflow |
|
|
47
|
+
| 5 | Layout perfetto, gerarchia visiva chiara, breathing room bilanciato |
|
|
48
|
+
|
|
49
|
+
### C3 — Design System Compliance
|
|
50
|
+
|
|
51
|
+
`identity.design_philosophy` applicato secondo `${paths.ui_guidelines}` e le regole di `${paths.design_system}/` (quando `features.has_design_system: true`). Se `design_philosophy` è vuoto, valuta solo l'aderenza alle linee guida del progetto.
|
|
52
|
+
|
|
53
|
+
| Score | Descrizione |
|
|
54
|
+
|-------|-------------|
|
|
55
|
+
| 1 | Sembra un template generico, nessuna aderenza alla design philosophy |
|
|
56
|
+
| 2 | Tracce di philosophy ma applicazione parziale o sbagliata |
|
|
57
|
+
| 3 | Philosophy parziale, mix di elementi corretti e generici |
|
|
58
|
+
| 4 | Philosophy coerente, dettagli minori fuori spec |
|
|
59
|
+
| 5 | Perfettamente aderente a `${paths.ui_guidelines}` in ogni elemento |
|
|
60
|
+
|
|
61
|
+
### C4 — Typography & Readability
|
|
62
|
+
|
|
63
|
+
Gerarchia leggibile, dimensioni font corrette, nessuna riga orfana o testo tagliato.
|
|
64
|
+
|
|
65
|
+
| Score | Descrizione |
|
|
66
|
+
|-------|-------------|
|
|
67
|
+
| 1 | Testo illeggibile, gerarchia assente |
|
|
68
|
+
| 2 | Testo leggibile ma gerarchia piatta o inconsistente |
|
|
69
|
+
| 3 | Gerarchia base presente, qualche problema di peso/dimensione |
|
|
70
|
+
| 4 | Gerarchia chiara, font scale corretto, buona leggibilita |
|
|
71
|
+
| 5 | Tipografia impeccabile, gerarchia enfatizza il contenuto giusto |
|
|
72
|
+
|
|
73
|
+
### C5 — Completeness
|
|
74
|
+
|
|
75
|
+
Tutti gli elementi UI presenti e correttamente renderizzati. No icone mancanti, placeholder rotti, sezioni vuote, o lorem ipsum dove dovrebbe esserci testo reale nella lingua del progetto (`identity.language`).
|
|
76
|
+
|
|
77
|
+
| Score | Descrizione |
|
|
78
|
+
|-------|-------------|
|
|
79
|
+
| 1 | Sezioni mancanti, placeholder visibili, layout incompleto |
|
|
80
|
+
| 2 | La maggior parte degli elementi presenti, alcuni placeholder/mancanze |
|
|
81
|
+
| 3 | Tutto presente, qualche dettaglio visivamente grezzo |
|
|
82
|
+
| 4 | Completo e curato, tutti gli stati rappresentati |
|
|
83
|
+
| 5 | Ogni elemento e pixel-perfect, inclusi empty/loading/error states |
|
|
84
|
+
|
|
85
|
+
### C6 — Integration Clarity
|
|
86
|
+
|
|
87
|
+
Elementi nuovi/modificati chiaramente marcati e visivamente coerenti con gli elementi
|
|
88
|
+
circostanti esistenti.
|
|
89
|
+
|
|
90
|
+
| Score | Descrizione |
|
|
91
|
+
|-------|-------------|
|
|
92
|
+
| 1 | Impossibile distinguere cosa e nuovo vs esistente |
|
|
93
|
+
| 2 | Marker presenti ma confusi, nuovo sembra disconnesso |
|
|
94
|
+
| 3 | Marker chiari, integrazione visiva accettabile |
|
|
95
|
+
| 4 | Marker chiari, nuovo si integra naturalmente con l'esistente |
|
|
96
|
+
| 5 | Perfetta integrazione + distinzione: nuovo e ovvio ma coerente |
|
|
97
|
+
|
|
98
|
+
### C7 — Polish (production-readiness)
|
|
99
|
+
|
|
100
|
+
Sembra production-ready, non un wireframe grezzo. Qualcuno vedendo questo dovrebbe
|
|
101
|
+
pensare "e un design reale" non "e una bozza".
|
|
102
|
+
|
|
103
|
+
| Score | Descrizione |
|
|
104
|
+
|-------|-------------|
|
|
105
|
+
| 1 | Wireframe grezzo, box grigi, nessun dettaglio visivo |
|
|
106
|
+
| 2 | Aspetto da prototipo, manca rifinitura |
|
|
107
|
+
| 3 | Decente, sembra un mockup funzionale ma non rifinito |
|
|
108
|
+
| 4 | Curato, sembra quasi pronto per la produzione |
|
|
109
|
+
| 5 | Indistinguibile da un design professionale finito |
|
|
110
|
+
|
|
111
|
+
## Soglie Hard (FAIL se violate)
|
|
112
|
+
|
|
113
|
+
- **Nessun criterio sotto 2** — qualsiasi 1 = FAIL immediato
|
|
114
|
+
- **Media complessiva >= 3.5** — sotto = FAIL
|
|
115
|
+
- **C1 (Context Fidelity) >= 3** — il mockup DEVE essere in-context
|
|
116
|
+
- **C3 (Design System) >= 3** quando `identity.design_philosophy` è impostato — DEVE rispettare la philosophy del progetto
|
|
117
|
+
|
|
118
|
+
L'overlay del progetto può aggiungere soglie più strette (es. C3 >= 4) — vedi `.baldart/overlays/ui-design.md` § Evaluation.
|
|
119
|
+
|
|
120
|
+
## Contrast Check (MUST — ZERO TOLERANCE)
|
|
121
|
+
|
|
122
|
+
Oltre ai 7 criteri, il valutatore DEVE eseguire un check contrasto:
|
|
123
|
+
|
|
124
|
+
- Per ogni elemento con `bg-*`, verificare che esista un `text-*` esplicito
|
|
125
|
+
- Se `features.multi_tenant_theming: true`: themed primary bg DEVE usare il text-token accoppiato per il tenant secondo la regola di pairing del progetto (vedi `${paths.design_system}/patterns/` o overlay)
|
|
126
|
+
- Ratio minimo: 4.5:1 testo normale, 3:1 testo grande
|
|
127
|
+
|
|
128
|
+
Violazione contrasto = FAIL indipendentemente dai punteggi.
|
|
129
|
+
|
|
130
|
+
## Formato Report di Valutazione
|
|
131
|
+
|
|
132
|
+
Salva in `/tmp/prd-design-<slug>/evaluation-report.md`:
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
# Evaluation Report — <slug>
|
|
136
|
+
|
|
137
|
+
Data: YYYY-MM-DD
|
|
138
|
+
Iterazione: N
|
|
139
|
+
|
|
140
|
+
## Option A — <nome approccio>
|
|
141
|
+
|
|
142
|
+
| Criterio | Score | Note |
|
|
143
|
+
|----------|-------|------|
|
|
144
|
+
| C1 Context Fidelity | X/5 | ... |
|
|
145
|
+
| C2 Layout & Spacing | X/5 | ... |
|
|
146
|
+
| C3 Design System | X/5 | ... |
|
|
147
|
+
| C4 Typography | X/5 | ... |
|
|
148
|
+
| C5 Completeness | X/5 | ... |
|
|
149
|
+
| C6 Integration Clarity | X/5 | ... |
|
|
150
|
+
| C7 Polish | X/5 | ... |
|
|
151
|
+
| **Media** | **X.X/5** | |
|
|
152
|
+
| Contrast Check | PASS/FAIL | ... |
|
|
153
|
+
|
|
154
|
+
**Verdetto: PASS / FAIL**
|
|
155
|
+
Feedback per il generatore: [se FAIL, cosa correggere specificamente]
|
|
156
|
+
|
|
157
|
+
## Option B — ...
|
|
158
|
+
(stessa struttura)
|
|
159
|
+
|
|
160
|
+
## Option C — ...
|
|
161
|
+
(stessa struttura)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Loop di Iterazione
|
|
165
|
+
|
|
166
|
+
1. Generatore produce/aggiorna i file HTML.
|
|
167
|
+
2. Valutatore li apre in Playwright, screenshot, valuta.
|
|
168
|
+
3. Se FAIL: report con feedback → torna al generatore.
|
|
169
|
+
4. Se PASS: report finale → si procede con presentazione all'utente.
|
|
170
|
+
5. **Max 5 iterazioni per opzione.** Se ancora sotto soglia dopo 5, procedi con
|
|
171
|
+
la versione migliore e annota i problemi residui nel report.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Generation Phase — Regole per il Generatore
|
|
2
|
+
|
|
3
|
+
Questo file definisce come produrre i mockup HTML. Il generatore è l'agente (o persona) che crea le opzioni di design. NON si auto-valuta — la valutazione spetta a un agente separato (vedi [evaluation.md](evaluation.md)).
|
|
4
|
+
|
|
5
|
+
> Paths and stylistic identity in this file resolve from `baldart.config.yml`.
|
|
6
|
+
> See `framework/agents/project-context.md` § 4. Project-specific stylistic
|
|
7
|
+
> defaults (e.g. forced design philosophy, hard-coded UI language) live in
|
|
8
|
+
> `.baldart/overlays/ui-design.md`.
|
|
9
|
+
|
|
10
|
+
## Regola del Filesystem (ASSOLUTA — rispettare prima di tutto)
|
|
11
|
+
|
|
12
|
+
Ogni file HTML generato DEVE essere scritto su disco con il tool `Write` PRIMA di aprirlo nel browser. Non è sufficiente mostrare il codice in un blocco inline.
|
|
13
|
+
|
|
14
|
+
- Path di destinazione: `/tmp/prd-design-<slug>/option-a.html` (e varianti b, c).
|
|
15
|
+
- Dopo la scrittura, apri nel browser di default (macOS):
|
|
16
|
+
```bash
|
|
17
|
+
open /tmp/prd-design-<slug>/option-a.html
|
|
18
|
+
```
|
|
19
|
+
(Linux: `xdg-open`. Windows: `start`.)
|
|
20
|
+
- Il file esiste su disco → l'utente può interagire, ispezionare, condividere.
|
|
21
|
+
- Solo codice inline → non verificabile, non apribile, non consegnabile.
|
|
22
|
+
|
|
23
|
+
## Skill HTML (OBBLIGATORIA)
|
|
24
|
+
|
|
25
|
+
Invocare la skill `huashu-design` all'inizio della fase di generazione. Essa fornisce:
|
|
26
|
+
|
|
27
|
+
- Junior Designer workflow (assunzioni + reasoning + placeholder → iterazioni)
|
|
28
|
+
- App Prototype shell: per ogni iPhone include AppPhone state manager interattivo
|
|
29
|
+
- Immagini reali da Wikimedia/Met/Unsplash (default per app prototype)
|
|
30
|
+
- Tweaks panel per varianti di design in-page
|
|
31
|
+
- Validazione Playwright click-test prima della consegna
|
|
32
|
+
- Export animazioni → MP4/GIF quando necessario
|
|
33
|
+
|
|
34
|
+
## Prerequisiti
|
|
35
|
+
|
|
36
|
+
1. **MUST** invocare skill `huashu-design` (vedi sopra).
|
|
37
|
+
2. **MUST** leggere `${paths.ui_guidelines}` prima di generare qualsiasi cosa.
|
|
38
|
+
3. **MUST** eseguire il [Component Discovery](component-discovery.md) cascade completo.
|
|
39
|
+
4. **MUST** avere screenshot delle pagine reali dove la feature vivrà (context capture).
|
|
40
|
+
|
|
41
|
+
## Context Capture (obbligatorio)
|
|
42
|
+
|
|
43
|
+
Prima di generare mockup:
|
|
44
|
+
|
|
45
|
+
1. Identifica 1-3 pagine dove la feature sarà integrata o adiacente.
|
|
46
|
+
2. Se `npm run dev` non è in esecuzione, avvialo.
|
|
47
|
+
3. Usa `webapp-testing` skill (Playwright CLI) per navigare e fare screenshot. Salva in `/tmp/prd-design-<slug>/context/`.
|
|
48
|
+
4. Questi screenshot sono il **riferimento visivo** — i mockup DEVONO integrarsi con sidebar, header, navigazione, theming e stile dei componenti reali.
|
|
49
|
+
5. Se le pagine richiedono auth, usa credenziali di test (verifica `MEMORY.md` o chiedi all'utente).
|
|
50
|
+
|
|
51
|
+
## Regole di Generazione dei 3 Mockup
|
|
52
|
+
|
|
53
|
+
Produce 3 file HTML distinti con approcci di design diversi.
|
|
54
|
+
|
|
55
|
+
### Requisiti obbligatori per ogni file
|
|
56
|
+
|
|
57
|
+
- **In-context**: ogni file DEVE includere lo shell UI esistente (sidebar, header, nav) che circonda l'area della feature. Riprodurre fedelmente il chrome della piattaforma basandosi sugli screenshot catturati.
|
|
58
|
+
- **Contenuto nuovo nell'area principale**: chiaramente distinguibile dal chrome esistente.
|
|
59
|
+
- **Stili reali**: usa gli stili dei componenti visibili negli screenshot (border radius, shadow style, button style, card style, colori, spacing).
|
|
60
|
+
- **Pagina esistente modificata**: se la feature modifica una pagina esistente, mostra la pagina INTERA con le modifiche evidenziate (bordo tratteggiato attorno ai nuovi elementi).
|
|
61
|
+
- **Self-contained**: CSS inline, Tailwind CDN, nessuna dipendenza esterna.
|
|
62
|
+
- **Nomi file**: `option-a.html`, `option-b.html`, `option-c.html`.
|
|
63
|
+
- **Rationale**: commento HTML in cima a ogni file che spiega l'approccio e come si integra con la UI esistente.
|
|
64
|
+
- **Design philosophy**: applica `identity.design_philosophy` (es. "Neo-Brutalism", "Minimalist", "Glassmorphism") come definito in `${paths.ui_guidelines}` e nell'overlay del progetto. Se `design_philosophy` è vuoto, mantieni uno stile neutro coerente con gli screenshot.
|
|
65
|
+
- **Lingua**: usa `identity.language` (BCP-47) per tutti i testi UI. Default `en` se non impostato.
|
|
66
|
+
- **Marker**: segna aree nuove/cambiate con label floating in lingua del progetto, es. `NUOVO`/`MODIFICATO` (it) o `NEW`/`CHANGED` (en).
|
|
67
|
+
- **3 differenze significative**: le opzioni devono differire in layout, gerarchia o pattern di interazione — non solo in colori.
|
|
68
|
+
|
|
69
|
+
### Scheletro HTML minimo
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<!DOCTYPE html>
|
|
73
|
+
<html lang="<identity.language>">
|
|
74
|
+
<head>
|
|
75
|
+
<meta charset="UTF-8">
|
|
76
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
77
|
+
<title>UI Design — <Feature Name></title>
|
|
78
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
79
|
+
<style>
|
|
80
|
+
html { scroll-behavior: smooth; }
|
|
81
|
+
</style>
|
|
82
|
+
</head>
|
|
83
|
+
<body>
|
|
84
|
+
<!-- Existing UI shell (sidebar, header, nav) reproduced from screenshots -->
|
|
85
|
+
<!-- New feature content in main area -->
|
|
86
|
+
</body>
|
|
87
|
+
</html>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Presentazione all'Utente
|
|
91
|
+
|
|
92
|
+
Dopo che il valutatore ha approvato (vedi [evaluation.md](evaluation.md)):
|
|
93
|
+
|
|
94
|
+
1. **Apri tutti e 3 i file nel browser di default (OBBLIGATORIO):**
|
|
95
|
+
```bash
|
|
96
|
+
open /tmp/prd-design-<slug>/option-a.html
|
|
97
|
+
open /tmp/prd-design-<slug>/option-b.html
|
|
98
|
+
open /tmp/prd-design-<slug>/option-c.html
|
|
99
|
+
```
|
|
100
|
+
2. Mostra screenshot inline come supplemento.
|
|
101
|
+
3. Per ogni opzione, elenca solo: nome dell'approccio e quali componenti esistenti riusa vs. crea nuovi. **NON dare valutazioni, punteggi, o suggerimenti su quale opzione scegliere. La scelta spetta all'utente.**
|
|
102
|
+
|
|
103
|
+
## Iterazione su Feedback Utente
|
|
104
|
+
|
|
105
|
+
1. L'utente sceglie un'opzione o chiede modifiche.
|
|
106
|
+
2. Applica le modifiche all'opzione scelta, passando gli screenshot di contesto come riferimento.
|
|
107
|
+
3. Sottometti al valutatore per ri-valutazione.
|
|
108
|
+
4. Una volta approvato dal valutatore, apri nel browser e mostra screenshot.
|
|
109
|
+
5. Ripeti fino ad approvazione esplicita dell'utente.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# UI Element Inventory — Sprint Contract
|
|
2
|
+
|
|
3
|
+
L'inventario degli elementi UI e il **contratto vincolante** tra il design approvato
|
|
4
|
+
e l'implementazione. Funziona come uno "sprint contract" (ref: Anthropic
|
|
5
|
+
"Harness Design for Long-Running Apps"): generatore e valutatore concordano su cosa
|
|
6
|
+
significa "fatto" prima che il codice venga scritto.
|
|
7
|
+
|
|
8
|
+
## Quando produrlo
|
|
9
|
+
|
|
10
|
+
Dopo che l'utente ha approvato un'opzione di design (Step 3d nel workflow).
|
|
11
|
+
|
|
12
|
+
## Come produrlo
|
|
13
|
+
|
|
14
|
+
1. Apri il `design.html` approvato.
|
|
15
|
+
2. Leggi la struttura HTML e identifica OGNI elemento UI distinto.
|
|
16
|
+
3. Produci l'inventario strutturato nel formato sotto.
|
|
17
|
+
|
|
18
|
+
## Formato
|
|
19
|
+
|
|
20
|
+
Aggiungi al state file del PRD sotto `## UI Element Inventory`:
|
|
21
|
+
|
|
22
|
+
```markdown
|
|
23
|
+
## UI Element Inventory
|
|
24
|
+
|
|
25
|
+
Source: ${paths.prd_dir}/<slug>/design.html (option <X>, approved <date>)
|
|
26
|
+
|
|
27
|
+
| # | Element | Type | Purpose | Inputs/Outputs | Behavior |
|
|
28
|
+
|---|---------|------|---------|----------------|----------|
|
|
29
|
+
| 1 | <name> | page / section / component / modal / form / button / endpoint | <what it does> | <fields, props, API params> | <interactions, states, validation> |
|
|
30
|
+
| 2 | ... | ... | ... | ... | ... |
|
|
31
|
+
|
|
32
|
+
### New components to create
|
|
33
|
+
- <ComponentName> — <purpose> (NOT existing in codebase)
|
|
34
|
+
|
|
35
|
+
### Existing components to reuse
|
|
36
|
+
- <ComponentName> at <file:path> — <how it's used in the design>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Regole per l'inventario
|
|
40
|
+
|
|
41
|
+
- Ogni sezione visibile, form, bottone, modale, card, lista ed elemento interattivo
|
|
42
|
+
ha la sua riga.
|
|
43
|
+
- Se il design mostra un'interazione API (submit form, data fetch), elenca l'endpoint
|
|
44
|
+
atteso come riga con tipo `endpoint`.
|
|
45
|
+
- Sii specifico: "Save button that calls POST /api/v1/foo/bar" non "a button" (cita l'endpoint reale).
|
|
46
|
+
- Includi error states, loading states, e empty states visibili nel design.
|
|
47
|
+
- Distingui chiaramente tra componenti da creare e componenti da riusare.
|
|
48
|
+
|
|
49
|
+
## Cosa NON includere
|
|
50
|
+
|
|
51
|
+
- Dettagli di implementazione tecnica (nomi di hook, struttura di stato, file path
|
|
52
|
+
del codice sorgente). Quelli vanno nel PRD e nelle backlog cards.
|
|
53
|
+
- Scelte architetturali. L'inventario dice COSA c'e nel design, non COME si implementa.
|
|
54
|
+
|
|
55
|
+
## Artefatti prodotti
|
|
56
|
+
|
|
57
|
+
1. Copia l'HTML approvato in `${paths.prd_dir}/<slug>/design.html`.
|
|
58
|
+
2. Aggiorna il state file del PRD con l'inventario.
|
|
59
|
+
3. Pulisci `/tmp/prd-design-<slug>/`.
|