@qijenchen/design-system 0.1.0-beta.10 → 0.1.0-beta.13
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/CLAUDE.md +201 -0
- package/README.md +7 -15
- package/cli-init.mjs +90 -0
- package/ds-canonical/commands/README.md +26 -0
- package/ds-canonical/commands/gov-status.md +79 -0
- package/ds-canonical/hooks/README.md +145 -0
- package/ds-canonical/hooks/_log-fire.sh +44 -0
- package/ds-canonical/hooks/block_prototype_imports.py +111 -0
- package/ds-canonical/hooks/check_app_shell_primary_header_consistency.sh +68 -0
- package/ds-canonical/hooks/check_audit_post_report_validator.sh +88 -0
- package/ds-canonical/hooks/check_audit_sample_escape.sh +73 -0
- package/ds-canonical/hooks/check_benchmark_citation.sh +106 -0
- package/ds-canonical/hooks/check_canonical_propagation.sh +189 -0
- package/ds-canonical/hooks/check_chrome_header_handcraft.sh +70 -0
- package/ds-canonical/hooks/check_codex_brief_invariants.sh +83 -0
- package/ds-canonical/hooks/check_codex_collab_5step.sh +108 -0
- package/ds-canonical/hooks/check_datatable_invariants.sh +117 -0
- package/ds-canonical/hooks/check_dim_count_drift.sh +72 -0
- package/ds-canonical/hooks/check_field_controls_contracts.sh +110 -0
- package/ds-canonical/hooks/check_field_family_invariants.sh +205 -0
- package/ds-canonical/hooks/check_file_size_budget.sh +60 -0
- package/ds-canonical/hooks/check_header_with_tabs_border.sh +87 -0
- package/ds-canonical/hooks/check_main_branch_workbench.sh +93 -0
- package/ds-canonical/hooks/check_naming_and_abstraction.sh +165 -0
- package/ds-canonical/hooks/check_opacity_token_usage.sh +149 -0
- package/ds-canonical/hooks/check_pattern_invariants.sh +194 -0
- package/ds-canonical/hooks/check_peoplepicker_ssot_drift.sh +56 -0
- package/ds-canonical/hooks/check_pixel_quantified_audit.sh +53 -0
- package/ds-canonical/hooks/check_propose_plain_chinese.sh +74 -0
- package/ds-canonical/hooks/check_propose_pre_grep_verify.sh +70 -0
- package/ds-canonical/hooks/check_select_all_canonical.sh +58 -0
- package/ds-canonical/hooks/check_solo_workflow.sh +258 -0
- package/ds-canonical/hooks/check_spec_class_drift.sh +88 -0
- package/ds-canonical/hooks/check_story_invariants.sh +612 -0
- package/ds-canonical/hooks/check_substantive_edit_approval_preflight.sh +105 -0
- package/ds-canonical/hooks/check_tab_lg_chrome_header_equal.sh +66 -0
- package/ds-canonical/hooks/check_wrapper_primitive_schema_drift.sh +104 -0
- package/ds-canonical/hooks/enforce_home_charter.sh +44 -0
- package/ds-canonical/hooks/inject_pending_self_audit.sh +204 -0
- package/ds-canonical/hooks/lib/_approval_re.sh +33 -0
- package/ds-canonical/hooks/lib/_code_quality.sh +73 -0
- package/ds-canonical/hooks/lib/_cva_default_sync.sh +69 -0
- package/ds-canonical/hooks/lib/_governance_coverage_check.sh +49 -0
- package/ds-canonical/hooks/lib/_hardcoded_strings.sh +163 -0
- package/ds-canonical/hooks/lib/_layout_space_canonical.sh +56 -0
- package/ds-canonical/hooks/lib/_overlay_handcraft.sh +141 -0
- package/ds-canonical/hooks/lib/_person_data_richness.sh +42 -0
- package/ds-canonical/hooks/lib/_story_compile_drift.sh +48 -0
- package/ds-canonical/hooks/lib/_token_hygiene.sh +95 -0
- package/ds-canonical/hooks/log_governance_fires.sh +50 -0
- package/ds-canonical/hooks/log_skill_invokes.sh +41 -0
- package/ds-canonical/hooks/post_edit_dispatcher.sh +62 -0
- package/ds-canonical/hooks/retired/check_anatomy_section_numbering.sh +106 -0
- package/ds-canonical/hooks/retired/check_avatar_hovercard.sh +90 -0
- package/ds-canonical/hooks/retired/check_button_icon_literal.sh.retired-2026-04-28 +38 -0
- package/ds-canonical/hooks/retired/check_container_breathing.sh +142 -0
- package/ds-canonical/hooks/retired/check_governance_compliance.sh +61 -0
- package/ds-canonical/hooks/retired/check_icon_only_padding_formula.sh +104 -0
- package/ds-canonical/hooks/retired/check_item_content_primitive.sh +150 -0
- package/ds-canonical/hooks/retired/check_item_list_gap.sh +153 -0
- package/ds-canonical/hooks/retired/check_sideoffset_canonical.sh +65 -0
- package/ds-canonical/hooks/retired/check_spec_iteration_tag.sh +87 -0
- package/ds-canonical/hooks/retired/check_ssot_consultation.sh +88 -0
- package/ds-canonical/hooks/retired/check_sync_update.sh +20 -0
- package/ds-canonical/hooks/retired/check_third_party_dom_verified.sh +95 -0
- package/ds-canonical/hooks/retired/enforce_home_charter.sh +125 -0
- package/ds-canonical/hooks/retired/post_edit_canonical_interrogate.sh +109 -0
- package/ds-canonical/hooks/retired/pre_edit_spec_check.sh +68 -0
- package/ds-canonical/hooks/retired/pre_new_component_spec.sh +39 -0
- package/ds-canonical/hooks/retired/pre_write_subsumption_check.sh +112 -0
- package/ds-canonical/hooks/retired/stop_meta_self_audit.sh.retired-2026-05-13 +76 -0
- package/ds-canonical/hooks/retired/tests/test_check_anatomy_section_numbering.sh +14 -0
- package/ds-canonical/hooks/retired/tests/test_check_avatar_hovercard.sh +15 -0
- package/ds-canonical/hooks/retired/tests/test_check_container_breathing.sh +15 -0
- package/ds-canonical/hooks/retired/tests/test_check_governance_compliance.sh +15 -0
- package/ds-canonical/hooks/retired/tests/test_check_icon_only_padding_formula.sh +79 -0
- package/ds-canonical/hooks/retired/tests/test_check_item_content_primitive.sh +15 -0
- package/ds-canonical/hooks/retired/tests/test_check_item_list_gap.sh +163 -0
- package/ds-canonical/hooks/retired/tests/test_check_sideoffset_canonical.sh +15 -0
- package/ds-canonical/hooks/retired/tests/test_check_spec_iteration_tag.sh +15 -0
- package/ds-canonical/hooks/retired/tests/test_check_ssot_consultation.sh +15 -0
- package/ds-canonical/hooks/retired/tests/test_check_sync_update.sh +14 -0
- package/ds-canonical/hooks/retired/tests/test_check_third_party_dom_verified.sh +15 -0
- package/ds-canonical/hooks/retired/tests/test_enforce_home_charter.sh +15 -0
- package/ds-canonical/hooks/retired/tests/test_pre_edit_spec_check.sh +15 -0
- package/ds-canonical/hooks/retired/tests/test_pre_new_component_spec.sh +15 -0
- package/ds-canonical/hooks/retired/tests/test_pre_write_subsumption_check.sh +63 -0
- package/ds-canonical/hooks/session_start_governance_check.sh +263 -0
- package/ds-canonical/hooks/stop_passive_logging.sh +322 -0
- package/ds-canonical/hooks/stop_self_audit.sh +450 -0
- package/ds-canonical/hooks/tests/KNOWN-BROKEN.md +15 -0
- package/ds-canonical/hooks/tests/run-all.sh +76 -0
- package/ds-canonical/hooks/tests/test_block_prototype_imports.sh +143 -0
- package/ds-canonical/hooks/tests/test_check_app_shell_primary_header_consistency.sh +140 -0
- package/ds-canonical/hooks/tests/test_check_audit_post_report_validator.sh +115 -0
- package/ds-canonical/hooks/tests/test_check_audit_sample_escape.sh +93 -0
- package/ds-canonical/hooks/tests/test_check_benchmark_citation.sh +115 -0
- package/ds-canonical/hooks/tests/test_check_canonical_propagation.sh +133 -0
- package/ds-canonical/hooks/tests/test_check_chrome_header_handcraft.sh +123 -0
- package/ds-canonical/hooks/tests/test_check_code_quality.sh +15 -0
- package/ds-canonical/hooks/tests/test_check_codex_collab_5step.sh +96 -0
- package/ds-canonical/hooks/tests/test_check_cva_default_sync.sh +15 -0
- package/ds-canonical/hooks/tests/test_check_datatable_invariants.sh +122 -0
- package/ds-canonical/hooks/tests/test_check_dim_count_drift.sh +98 -0
- package/ds-canonical/hooks/tests/test_check_field_controls_contracts.sh +126 -0
- package/ds-canonical/hooks/tests/test_check_field_family_invariants.sh +194 -0
- package/ds-canonical/hooks/tests/test_check_file_size_budget.sh +32 -0
- package/ds-canonical/hooks/tests/test_check_hardcoded_strings.sh +14 -0
- package/ds-canonical/hooks/tests/test_check_header_with_tabs_border.sh +110 -0
- package/ds-canonical/hooks/tests/test_check_layout_space_canonical.sh +73 -0
- package/ds-canonical/hooks/tests/test_check_main_branch_workbench.sh +147 -0
- package/ds-canonical/hooks/tests/test_check_naming_and_abstraction.sh +136 -0
- package/ds-canonical/hooks/tests/test_check_opacity_token_usage.sh +110 -0
- package/ds-canonical/hooks/tests/test_check_overlay_handcraft.sh +126 -0
- package/ds-canonical/hooks/tests/test_check_pattern_invariants.sh +148 -0
- package/ds-canonical/hooks/tests/test_check_peoplepicker_ssot_drift.sh +108 -0
- package/ds-canonical/hooks/tests/test_check_person_data_richness.sh +58 -0
- package/ds-canonical/hooks/tests/test_check_pixel_quantified_audit.sh +142 -0
- package/ds-canonical/hooks/tests/test_check_propose_plain_chinese.sh +126 -0
- package/ds-canonical/hooks/tests/test_check_propose_pre_grep_verify.sh +117 -0
- package/ds-canonical/hooks/tests/test_check_select_all_canonical.sh +125 -0
- package/ds-canonical/hooks/tests/test_check_solo_workflow.sh +201 -0
- package/ds-canonical/hooks/tests/test_check_spec_class_drift.sh +135 -0
- package/ds-canonical/hooks/tests/test_check_story_anatomy.sh.broken +197 -0
- package/ds-canonical/hooks/tests/test_check_story_category.sh.broken +187 -0
- package/ds-canonical/hooks/tests/test_check_story_compile_drift.sh +15 -0
- package/ds-canonical/hooks/tests/test_check_story_invariants.sh +209 -0
- package/ds-canonical/hooks/tests/test_check_story_name_jargon.sh.broken +53 -0
- package/ds-canonical/hooks/tests/test_check_story_slot_split.sh +156 -0
- package/ds-canonical/hooks/tests/test_check_substantive_edit_approval_preflight.sh +176 -0
- package/ds-canonical/hooks/tests/test_check_tab_lg_chrome_header_equal.sh +138 -0
- package/ds-canonical/hooks/tests/test_check_token_hygiene.sh +21 -0
- package/ds-canonical/hooks/tests/test_check_wrapper_primitive_schema_drift.sh +169 -0
- package/ds-canonical/hooks/tests/test_enforce_home_charter.sh +77 -0
- package/ds-canonical/hooks/tests/test_inject_pending_self_audit.sh +125 -0
- package/ds-canonical/hooks/tests/test_log_governance_fires.sh +10 -0
- package/ds-canonical/hooks/tests/test_log_skill_invokes.sh +7 -0
- package/ds-canonical/hooks/tests/test_post_edit_dispatcher.sh +108 -0
- package/ds-canonical/hooks/tests/test_session_start_governance_check.sh +143 -0
- package/ds-canonical/hooks/tests/test_stop_capture_metrics.sh +95 -0
- package/ds-canonical/hooks/tests/test_stop_governance_drift_check.sh.broken +125 -0
- package/ds-canonical/hooks/tests/test_stop_harvest_corrections.sh +10 -0
- package/ds-canonical/hooks/tests/test_stop_passive_logging.sh +100 -0
- package/ds-canonical/hooks/tests/test_stop_self_audit.sh +76 -0
- package/ds-canonical/hooks/tests/test_stop_tsc_sanity.sh +10 -0
- package/ds-canonical/references/README.md +43 -0
- package/ds-canonical/references/audit-coverage-vs-24-checklist.md +74 -0
- package/ds-canonical/references/build-ui-canonicals.md +69 -0
- package/ds-canonical/references/cva-patterns.md +41 -0
- package/ds-canonical/references/drag-canonical.md +331 -0
- package/ds-canonical/references/item-anatomy-recipe.md +225 -0
- package/ds-canonical/references/naming-conventions.md +56 -0
- package/ds-canonical/references/principle-dim-map.json +515 -0
- package/ds-canonical/references/props-naming.md +45 -0
- package/ds-canonical/references/spec-rules.md +58 -0
- package/ds-canonical/references/ssot-consultation.md +63 -0
- package/ds-canonical/references/ssot-index.md +40 -0
- package/ds-canonical/references/story-baseline-registry.json +79 -0
- package/ds-canonical/references/structural-token-retention.md +42 -0
- package/ds-canonical/references/tailwind-gotchas.md +87 -0
- package/ds-canonical/references/ui-dev-rules.md +60 -0
- package/ds-canonical/rules/README.md +34 -0
- package/ds-canonical/rules/meta-patterns.md +87 -0
- package/ds-canonical/rules/self-verify.md +53 -0
- package/ds-canonical/rules/spec-rules.md +25 -0
- package/ds-canonical/rules/story-rules.md +56 -0
- package/ds-canonical/rules/ui-development.md +87 -0
- package/ds-canonical/skills/README.md +88 -0
- package/ds-canonical/skills/bug-fix-rhythm/SKILL.md +181 -0
- package/ds-canonical/skills/code-quality-audit/SKILL.md +63 -0
- package/ds-canonical/skills/codex-collab/SKILL.md +249 -0
- package/ds-canonical/skills/codex-collab/references/brief-template.md +48 -0
- package/ds-canonical/skills/codex-collab/references/transport.md +58 -0
- package/ds-canonical/skills/codify-corrections/SKILL.md +184 -0
- package/ds-canonical/skills/codify-principle/SKILL.md +151 -0
- package/ds-canonical/skills/component-quality-gate/SKILL.md +102 -0
- package/ds-canonical/skills/component-quality-gate/references/checklist.md +79 -0
- package/ds-canonical/skills/deep-audit-cross-codex/SKILL.md +247 -0
- package/ds-canonical/skills/deep-audit-cross-codex/references/phase-a-workflow.md +123 -0
- package/ds-canonical/skills/deep-audit-cross-codex/references/phase-b-codex-brief.md +165 -0
- package/ds-canonical/skills/deep-audit-cross-codex/references/triage-rubric.md +91 -0
- package/ds-canonical/skills/delivery-handoff/SKILL.md +229 -0
- package/ds-canonical/skills/delivery-handoff/references/flow-diagram.md +180 -0
- package/ds-canonical/skills/delivery-handoff/references/handoff-template.md +177 -0
- package/ds-canonical/skills/delivery-handoff/references/inventory-checklist.md +196 -0
- package/ds-canonical/skills/design-system-audit/SKILL.md +343 -0
- package/ds-canonical/skills/design-system-audit/references/audit-prompts.md +1260 -0
- package/ds-canonical/skills/design-system-audit/references/checkpoints.md +240 -0
- package/ds-canonical/skills/design-system-audit/references/historical-bugs.md +240 -0
- package/ds-canonical/skills/design-system-audit/references/principle-audit-protocol.md +364 -0
- package/ds-canonical/skills/design-system-audit/references/rule-placement.md +175 -0
- package/ds-canonical/skills/design-system-audit/references/spec-template.md +66 -0
- package/ds-canonical/skills/ensure-canonical/SKILL.md +196 -0
- package/ds-canonical/skills/governance-health/SKILL.md +146 -0
- package/ds-canonical/skills/knowledge-prune/SKILL.md +303 -0
- package/ds-canonical/skills/new-component/SKILL.md +170 -0
- package/ds-canonical/skills/new-component/references/new-component-checklist.md +85 -0
- package/ds-canonical/skills/performance-audit/SKILL.md +107 -0
- package/ds-canonical/skills/product-ui-audit/SKILL.md +230 -0
- package/ds-canonical/skills/product-ui-audit/references/audit-checks.md +246 -0
- package/ds-canonical/skills/product-ui-audit/references/common-misuses.md +329 -0
- package/ds-canonical/skills/product-ui-audit/references/report-template.md +159 -0
- package/ds-canonical/skills/propose-options/SKILL.md +177 -0
- package/ds-canonical/skills/prototype/SKILL.md +244 -0
- package/ds-canonical/skills/prototype/references/audit-checks.md +37 -0
- package/ds-canonical/skills/prototype/references/benchmark-sources.md +94 -0
- package/ds-canonical/skills/prototype/references/checkpoints.md +191 -0
- package/ds-canonical/skills/prototype/references/evaluation-matrix.md +141 -0
- package/ds-canonical/skills/prototype/references/ooux-template.md +198 -0
- package/ds-canonical/skills/prototype/references/proposal-template.md +229 -0
- package/ds-canonical/skills/scan-similar-bugs/SKILL.md +198 -0
- package/ds-canonical/skills/story-auto-compile-migrate/SKILL.md +159 -0
- package/ds-canonical/skills/story-writing/SKILL.md +122 -0
- package/ds-canonical/skills/story-writing/references/anatomy-standard.md +217 -0
- package/ds-canonical/skills/story-writing/references/category-templates.md +174 -0
- package/ds-canonical/skills/story-writing/references/example-selection.md +70 -0
- package/ds-canonical/skills/story-writing/references/self-check.md +20 -0
- package/ds-canonical/skills/ux-audit/SKILL.md +130 -0
- package/ds-canonical/skills/visual-audit/SKILL.md +245 -0
- package/ds-canonical/skills/visual-audit/output/.gitkeep +0 -0
- package/ds-canonical/skills/visual-audit/references/audit-architecture.md +100 -0
- package/ds-canonical/skills/visual-audit/references/visual-checklist.md +297 -0
- package/ds-canonical/skills/visual-audit/references/world-class-benchmarks.md +198 -0
- package/package.json +9 -5
- package/src/components/Accordion/accordion.spec.md +114 -0
- package/src/components/Alert/alert.spec.md +197 -0
- package/src/components/AppShell/app-shell.spec.md +331 -0
- package/src/components/AspectRatio/aspect-ratio.spec.md +134 -0
- package/src/components/Avatar/avatar.spec.md +329 -0
- package/src/components/Badge/badge.spec.md +380 -0
- package/src/components/Breadcrumb/breadcrumb.spec.md +257 -0
- package/src/components/BulkActionBar/bulk-action-bar.spec.md +210 -0
- package/src/components/Button/button.spec.md +460 -0
- package/src/components/Calendar/calendar.spec.md +242 -0
- package/src/components/Carousel/carousel.spec.md +253 -0
- package/src/components/Chart/chart.spec.md +155 -0
- package/src/components/Checkbox/checkbox.spec.md +344 -0
- package/src/components/Chip/chip.spec.md +237 -0
- package/src/components/CircularProgress/circular-progress.spec.md +268 -0
- package/src/components/Coachmark/coachmark.spec.md +230 -0
- package/src/components/Combobox/combobox.spec.md +180 -0
- package/src/components/Command/command.spec.md +171 -0
- package/src/components/DataTable/data-table.spec.md +525 -0
- package/src/components/DateGrid/date-grid.spec.md +215 -0
- package/src/components/DatePicker/date-picker.spec.md +334 -0
- package/src/components/DescriptionList/description-list.spec.md +214 -0
- package/src/components/Dialog/dialog.spec.md +202 -0
- package/src/components/DropdownMenu/dropdown-menu.spec.md +250 -0
- package/src/components/Empty/empty.spec.md +214 -0
- package/src/components/Field/field-controls.spec.md +338 -0
- package/src/components/Field/field.spec.md +438 -0
- package/src/components/Field/form-validation.spec.md +152 -0
- package/src/components/FieldControlGroup/field-control-group.spec.md +176 -0
- package/src/components/FileItem/file-item.spec.md +467 -0
- package/src/components/FileUpload/file-upload.spec.md +123 -0
- package/src/components/FileViewer/file-viewer.spec.md +373 -0
- package/src/components/HoverCard/hover-card.spec.md +157 -0
- package/src/components/Input/input.spec.md +193 -0
- package/src/components/LinkInput/link-input.spec.md +130 -0
- package/src/components/Menu/menu-item.spec.md +290 -0
- package/src/components/NameCard/name-card.spec.md +171 -0
- package/src/components/Notice/notice.spec.md +149 -0
- package/src/components/NumberInput/number-input.spec.md +126 -0
- package/src/components/OverflowIndicator/overflow-indicator.spec.md +120 -0
- package/src/components/PeoplePicker/people-picker.spec.md +263 -0
- package/src/components/Popover/popover.spec.md +198 -0
- package/src/components/ProgressBar/progress-bar.spec.md +232 -0
- package/src/components/RadioGroup/radio-group.spec.md +141 -0
- package/src/components/Rating/rating.spec.md +208 -0
- package/src/components/ScrollArea/scroll-area.spec.md +145 -0
- package/src/components/SegmentedControl/segmented-control.spec.md +295 -0
- package/src/components/Select/select.spec.md +299 -0
- package/src/components/SelectMenu/select-menu.spec.md +220 -0
- package/src/components/SelectionControl/selection-item.spec.md +128 -0
- package/src/components/Separator/separator.spec.md +109 -0
- package/src/components/Sheet/sheet.spec.md +148 -0
- package/src/components/Sidebar/sidebar.spec.md +713 -0
- package/src/components/Skeleton/skeleton.spec.md +104 -0
- package/src/components/Slider/slider.spec.md +353 -0
- package/src/components/Steps/steps.spec.md +465 -0
- package/src/components/Switch/switch.spec.md +215 -0
- package/src/components/Tabs/tabs.spec.md +314 -0
- package/src/components/Tag/tag.spec.md +282 -0
- package/src/components/Textarea/textarea.spec.md +151 -0
- package/src/components/TimePicker/time-picker.spec.md +279 -0
- package/src/components/Toast/toast.spec.md +177 -0
- package/src/components/Tooltip/tooltip.spec.md +139 -0
- package/src/components/TreeView/tree-view.spec.md +374 -0
- package/src/patterns/action-bar/action-bar.spec.md +458 -0
- package/src/patterns/element-anatomy/element-anatomy.spec.md +215 -0
- package/src/patterns/element-anatomy/inline-action.spec.md +315 -0
- package/src/patterns/element-anatomy/item-anatomy.spec.md +1042 -0
- package/src/patterns/header-canonical/header-canonical.spec.md +285 -0
- package/src/patterns/horizontal-overflow/horizontal-overflow.spec.md +191 -0
- package/src/patterns/overlay-surface/overlay-surface.spec.md +428 -0
- package/src/patterns/resize-handle/resize-handle.spec.md +109 -0
- package/src/tokens/color/color.spec.md +804 -0
- package/src/tokens/density/density.spec.md +127 -0
- package/src/tokens/elevation/elevation.spec.md +81 -0
- package/src/tokens/layoutSpace/layoutSpace.spec.md +314 -0
- package/src/tokens/motion/motion.spec.md +97 -0
- package/src/tokens/opacity/opacity.spec.md +78 -0
- package/src/tokens/orphan-tokens.spec.md +117 -0
- package/src/tokens/radius/radius.spec.md +123 -0
- package/src/tokens/typography/typography.spec.md +202 -0
- package/src/tokens/uiSize/uiSize.spec.md +438 -0
- package/src/styles/preset.css +0 -31
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Phase A — Claude solo full audit workflow
|
|
2
|
+
|
|
3
|
+
## A.0 全盤閱讀 file list canonical(禁 sample)
|
|
4
|
+
|
|
5
|
+
### 治理 home(always-load + path-scoped)
|
|
6
|
+
- `CLAUDE.md` 全文
|
|
7
|
+
- `.claude/rules/meta-patterns.md`(31 active M-rules,M1-M32 with M27/M33/M34/M35 retired)
|
|
8
|
+
- `.claude/rules/spec-rules.md`
|
|
9
|
+
- `.claude/rules/ui-development.md`
|
|
10
|
+
- `.claude/rules/story-rules.md`
|
|
11
|
+
- `.claude/rules/self-verify.md`
|
|
12
|
+
- `.claude/rules/README.md`
|
|
13
|
+
|
|
14
|
+
### Reference SSOT(快速索引)
|
|
15
|
+
- `.claude/references/ssot-index.md`
|
|
16
|
+
- `.claude/references/ssot-consultation.md`
|
|
17
|
+
- `.claude/references/build-ui-canonicals.md`
|
|
18
|
+
- `.claude/references/naming-conventions.md`
|
|
19
|
+
- `.claude/references/ui-dev-rules.md`(若存在)
|
|
20
|
+
- `.claude/references/props-naming.md`
|
|
21
|
+
- `.claude/references/tailwind-gotchas.md`
|
|
22
|
+
|
|
23
|
+
### DS spec.md(全部)
|
|
24
|
+
```bash
|
|
25
|
+
# 列舉所有 spec.md
|
|
26
|
+
find src/design-system -name "*.spec.md" -type f
|
|
27
|
+
# 預期 ~60 file:components/* + patterns/* + tokens/*
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
每個必 Read 全文(spec ≤ 300 lines budget,foundational SSOT ≤ 800-1200)。
|
|
31
|
+
|
|
32
|
+
### 記憶
|
|
33
|
+
- `~/.claude/.../memory/MEMORY.md`(index)
|
|
34
|
+
- 對 MEMORY.md 列的每個 active project memory file Read 全文(`project_*.md`)
|
|
35
|
+
- 對 feedback memory(`feedback_*.md`)只讀 description 比對 user 提的 topic 是否觸及 → 觸及才 Read 全文
|
|
36
|
+
|
|
37
|
+
### Output gate
|
|
38
|
+
|
|
39
|
+
A.0 結束時 output `.claude/planning/<date>-phaseA-preflight.md`(session-local,不 commit):
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
# Phase A.0 全盤閱讀清單
|
|
43
|
+
|
|
44
|
+
## 讀完
|
|
45
|
+
- CLAUDE.md(<N> lines)
|
|
46
|
+
- meta-patterns.md(31 active M-rules verify list)
|
|
47
|
+
- spec.md ×<N>(file list)
|
|
48
|
+
- tokens spec.md ×<N>
|
|
49
|
+
- patterns spec.md ×<N>
|
|
50
|
+
- memory active files: <list>
|
|
51
|
+
|
|
52
|
+
## 預警點(讀過程發現的疑似漂移 / TODO)
|
|
53
|
+
- <spec X 提到 Y 但 src/ 沒實作>
|
|
54
|
+
- <token Z 0 consumer>
|
|
55
|
+
- ...
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## A.1 全 dim deep audit chain(per design-system-audit SSOT)
|
|
59
|
+
|
|
60
|
+
直接 invoke `/design-system-audit --deep`。每 dim sub-agent dispatch prompt 必含:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
你是 dim <N> sub-agent。NO-SAMPLE STRICT NO-ESCAPE — 必 DS-wide 全盤掃,
|
|
64
|
+
禁 sample top N / 禁 heavy agent skip。觸發 `check_audit_sample_escape.sh`
|
|
65
|
+
BLOCKER 字串(「sample」「top N」「heavy agent skip」「為節省」「先抽樣」
|
|
66
|
+
「pick representative」)= 立刻撤回 dispatch。
|
|
67
|
+
|
|
68
|
+
每 finding 必 cite: <file:line> + <引文 quote> + <為何違反 spec / rule>
|
|
69
|
+
|
|
70
|
+
不確定 → STOP propose,別假答案。
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## A.2 Triage rubric
|
|
74
|
+
|
|
75
|
+
詳 `triage-rubric.md`(scope classifier + propose format)。
|
|
76
|
+
|
|
77
|
+
## A.3 Autonomous batch 7 軸 optimize 清單
|
|
78
|
+
|
|
79
|
+
對齊 CLAUDE.md `# 自主執行 canonical`:
|
|
80
|
+
|
|
81
|
+
1. **言簡意賅** — comment / spec / prop name 短而精
|
|
82
|
+
2. **效率 + 效能** — 避 unnecessary re-render / memoization gap / O(N²) algorithm(可 chain `/performance-audit`)
|
|
83
|
+
3. **SSOT 鐵律** — M17 token / primitive / pattern consume;M23 既有 canonical 優先;M29 anchor preflight;M30 wrapper extends primitive
|
|
84
|
+
4. **易懂 + 維護 + 擴充** — file ≤ budget;function ≤ 80;naming 一致(`# 命名與語言一致性`)
|
|
85
|
+
5. **世界級 + 一致設計語言** — mindset #1 + M8 ≥3 家 cite + M22 inline cite + M26 propose 前 WebFetch
|
|
86
|
+
6. **完整 self-verify** — M20 score / M31 dual-track 5-step / M32 pixel-quantified audit
|
|
87
|
+
7. **自動 self-improve** — M14 5-layer pipeline / M20 best-practice scoring
|
|
88
|
+
|
|
89
|
+
## A.4 Verify gate(per self-verify.md 4 階段)
|
|
90
|
+
|
|
91
|
+
| Layer | Cmd | PASS criteria |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| TypeScript | `npx tsc -b` | 0 errors |
|
|
94
|
+
| Content | `node scripts/audit-content-quality.mjs --check` | ✅ No content drift |
|
|
95
|
+
| Canonical | `node scripts/extract-canonical-rules.mjs` | ✅ All extracted rule keywords covered |
|
|
96
|
+
| Component invariants | `node scripts/data-table-invariants.mjs`(若觸動 DataTable)| PASS |
|
|
97
|
+
| Visual | `/visual-audit --scope=changed` | playwright snapshot diff Δ < 0.1% |
|
|
98
|
+
| Pixel-quantified | M32 audit(若動 alignment / spacing)| `rect.top / left / height` numeric verify |
|
|
99
|
+
|
|
100
|
+
任一 FAIL → STOP,不可進 Phase B。
|
|
101
|
+
|
|
102
|
+
## A complete output
|
|
103
|
+
|
|
104
|
+
```markdown
|
|
105
|
+
# Phase A 完成
|
|
106
|
+
|
|
107
|
+
## Findings(全 dim per design-system-audit SSOT)
|
|
108
|
+
- P0: <N> 項
|
|
109
|
+
- P1: <M> 項
|
|
110
|
+
- P2: <K> 項
|
|
111
|
+
|
|
112
|
+
## SSOT-UI/UX(待 user 拍板,中文人話 propose)
|
|
113
|
+
<決策 1-N per triage-rubric.md format>
|
|
114
|
+
|
|
115
|
+
## Autonomous landed(commit <hash>)
|
|
116
|
+
- <N> 項 spec / hook / story / code 修正
|
|
117
|
+
- file:line diff link
|
|
118
|
+
|
|
119
|
+
## 不 verify 但 Phase A 結論
|
|
120
|
+
- <列出僅 grep 看到但未跑 visual 的 case>
|
|
121
|
+
|
|
122
|
+
→ 等 user 拍板 SSOT-UI/UX 後 → 進 Phase B
|
|
123
|
+
```
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Phase B — Codex parallel audit + 比稿辯論
|
|
2
|
+
|
|
3
|
+
## B.0 Transport discovery(per codex-collab/SKILL.md Step 0.4)
|
|
4
|
+
|
|
5
|
+
3-test 順序固定:
|
|
6
|
+
```bash
|
|
7
|
+
ls -la node_modules/.bin/codex && node_modules/.bin/codex --version # 1 Local CLI(canonical)
|
|
8
|
+
which codex 2>/dev/null && codex --version 2>/dev/null # 2 Global(罕見)
|
|
9
|
+
ls -la ~/.codex/auth.json # 3 Auth(sanity)
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
**Decision**:1 ✅ → local CLI / 1 ❌ + 2 ✅ → global / 1+2 ❌ + 3 ✅ → `npm install` / 全 ❌ → 報 user。**禁 Explore agent 替身**(M31)。
|
|
13
|
+
|
|
14
|
+
## B.1 Brief template
|
|
15
|
+
|
|
16
|
+
⚠️ **Faithful relay invariant**(M31 Step 0.05,user-verbatim,不可只送 paraphrase):
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
## User 原話(verbatim)
|
|
20
|
+
「<user 在本 session 對 deep audit 的原話 quote,中英 / 符號 / 圖文 ref 全保>」
|
|
21
|
+
|
|
22
|
+
## Claude Phase A 結果摘要
|
|
23
|
+
|
|
24
|
+
### 全盤閱讀
|
|
25
|
+
- 讀完:CLAUDE.md / 31 active M-rules / spec.md ×<N> / tokens / patterns / memory active
|
|
26
|
+
|
|
27
|
+
### 全 dim NO-SAMPLE deep audit findings
|
|
28
|
+
- P0: <列具體 file:line + 違反 spec / rule>
|
|
29
|
+
- P1: <同>
|
|
30
|
+
- P2: <同>
|
|
31
|
+
|
|
32
|
+
### SSOT-UI/UX 已 ASK user
|
|
33
|
+
- <列 N 項>
|
|
34
|
+
|
|
35
|
+
### Autonomous landed
|
|
36
|
+
- <列 N 項 file:line + commit hash>
|
|
37
|
+
|
|
38
|
+
### Phase A 結論(不 verify 但抓到)
|
|
39
|
+
- <列 grep 看到 / suspect drift / 未跑 visual>
|
|
40
|
+
|
|
41
|
+
## 你的任務(Phase B,獨立)
|
|
42
|
+
|
|
43
|
+
1. **全盤閱讀**(per A.0 file list,不 sample):
|
|
44
|
+
- CLAUDE.md / `.claude/rules/*` / `.claude/references/*`
|
|
45
|
+
- `packages/design-system/src/**/*.spec.md` 全部(~60 file)
|
|
46
|
+
- `packages/design-system/src/tokens/**/*.spec.md` + `packages/design-system/src/patterns/**/*.spec.md`
|
|
47
|
+
- `~/.claude/.../memory/MEMORY.md` index + active project memory
|
|
48
|
+
|
|
49
|
+
2. **全 dim deep audit NO-SAMPLE**(對齊 `.claude/skills/design-system-audit/SKILL.md` Group A-P 全 dim per SKILL.md):
|
|
50
|
+
- 每 dim 全 DS-wide 掃,禁 sample top N
|
|
51
|
+
- 每 finding 必 cite: <file:line> + <quote> + <違反 spec / rule>
|
|
52
|
+
|
|
53
|
+
3. **整理完整報告**(P0 / P1 / P2 分類):
|
|
54
|
+
```
|
|
55
|
+
### Codex Phase B audit
|
|
56
|
+
- P0: <list>
|
|
57
|
+
- P1: <list>
|
|
58
|
+
- P2: <list>
|
|
59
|
+
|
|
60
|
+
### 跟 Claude Phase A 對照
|
|
61
|
+
- Claude 抓 + 你不同意:<list + cite>
|
|
62
|
+
- 你抓 + Claude 漏:<list + cite>
|
|
63
|
+
- 兩邊都漏的盲區:<list + cite>
|
|
64
|
+
|
|
65
|
+
### 真理由 disagreement(必 cite battle)
|
|
66
|
+
- <題 1>: Claude 立場 / 你立場 / spec.md path:line 引文 / world-class ≥3 家對照
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
4. **禁**:
|
|
70
|
+
- frame 答案進 Claude 思路(不可 paraphrase Claude 結論)
|
|
71
|
+
- sample / heavy agent skip(NO-SAMPLE STRICT)
|
|
72
|
+
- pass-through 共識(必獨立 own report)
|
|
73
|
+
- 直接給 user verdict(共識由 Claude Phase B.5 synthesize)
|
|
74
|
+
|
|
75
|
+
## 請獨立解讀 user 原話(per M31 Step 0.05)
|
|
76
|
+
|
|
77
|
+
User 原話可能跟我 paraphrase 不同。請以「你直接看 user 原話該怎麼解讀」為主,
|
|
78
|
+
不要被 Claude 結論 frame。如果 user 想要的方向你判斷跟我不同,直接寫出來。
|
|
79
|
+
|
|
80
|
+
## Cite invariant(M22)
|
|
81
|
+
|
|
82
|
+
每 claim 必附 inline cite:URL / GitHub source path + line / screenshot ref。
|
|
83
|
+
無 cite = unverified rumor,自動降 P2 「pending verification」。
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## B.2 Step 4 self-check 必過(M22/M23/M27→M23(c)/M8)
|
|
87
|
+
|
|
88
|
+
對 codex reply 跑 4 題:
|
|
89
|
+
|
|
90
|
+
| # | Check | 失敗 → |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| 1 | M22 cite check — codex 引的 benchmark 有 inline URL / GitHub line? | reply 要求補 cite |
|
|
93
|
+
| 2 | M23 DS-first — codex 建議是否覆蓋 DS 既有 canonical(spec.md / token / variant)? | 必 grep verify DS 既有,有命中 → 拒絕 codex / 修正 |
|
|
94
|
+
| 3 | M23(c) prop namespace — codex prop name 是否撞 DS 既有? | wrap-and-rename |
|
|
95
|
+
| 4 | M8 ≥3 source — codex 只引 1 家? | reply 要求補到 3 家 |
|
|
96
|
+
|
|
97
|
+
## B.3 Step 4.5 Verify each claim(anti-pass-through)
|
|
98
|
+
|
|
99
|
+
逐條 codex finding 過:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
Finding N: <codex claim 一句話>
|
|
103
|
+
|
|
104
|
+
Verify:
|
|
105
|
+
1. Grep DS-internal: rg "<keyword>" src/ → <hit / miss + 行號>
|
|
106
|
+
2. WebFetch external(若 cite world-class): URL → <真 quote 對照>
|
|
107
|
+
3. Run invariant script(若 codex 給數字): bash <script> → <實 value vs codex value>
|
|
108
|
+
4. Counter-example scan: grep <pattern> DS-wide → <反例 / 無>
|
|
109
|
+
|
|
110
|
+
Verdict: ✅ verified / ❌ FALSE / ⚠️ partial
|
|
111
|
+
Reasoning: <一句話>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## B.4 Cite battle template
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
Disagreement N: <topic>
|
|
118
|
+
|
|
119
|
+
| Side | Position | Cite | Quote |
|
|
120
|
+
|---|---|---|---|
|
|
121
|
+
| Claude Phase A | <stance> | <file:line / URL> | 「<quote>」 |
|
|
122
|
+
| Codex Phase B | <stance> | <file:line / URL> | 「<quote>」 |
|
|
123
|
+
|
|
124
|
+
WebFetch external:
|
|
125
|
+
- Polaris: <URL> → 「<quote>」
|
|
126
|
+
- Material: <URL> → 「<quote>」
|
|
127
|
+
- Atlassian: <URL> → 「<quote>」
|
|
128
|
+
|
|
129
|
+
Verdict: <Claude / Codex / Both / STOP-ask-user>
|
|
130
|
+
Reasoning: <cite + world-class consensus + DS internal canonical alignment>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## B.5 Step 5 比稿 matrix(per finding)
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
| Finding | Claude v1 | Codex v1 | Verdict | Final synthesized |
|
|
137
|
+
|---|---|---|---|---|
|
|
138
|
+
| <N> | <stance> | <stance> | ✅ accept C / ✅ accept C+ / ✅ accept Claude / 修正 = synthesize / 重啟 | <final 方案> |
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**禁** pass-through 直接 paste codex / 「兩邊都對」打太極 / vote without cite。
|
|
142
|
+
|
|
143
|
+
## Phase B complete output
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
# Phase B 完成
|
|
147
|
+
|
|
148
|
+
## Codex independent findings(NO-SAMPLE)
|
|
149
|
+
- P0: <N> / P1: <M> / P2: <K>
|
|
150
|
+
|
|
151
|
+
## 比稿結果
|
|
152
|
+
- Claude 抓 + Codex 漏: <list>
|
|
153
|
+
- Codex 抓 + Claude 漏: <list>(這些是 Phase A 漏掉的盲區!)
|
|
154
|
+
- Cite battle resolved: <K 題,各題 verdict>
|
|
155
|
+
- Cite battle deferred(evidence 對等): <N 題,STOP 等 user>
|
|
156
|
+
|
|
157
|
+
## 共識 SSOT-UI/UX(中文人話 propose)
|
|
158
|
+
<決策 1-N per triage-rubric.md format>
|
|
159
|
+
|
|
160
|
+
## 共識 autonomous landed(commit <hash>)
|
|
161
|
+
- <N> 項
|
|
162
|
+
- file:line + diff link
|
|
163
|
+
|
|
164
|
+
→ 進 Phase C
|
|
165
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Triage rubric — SSOT-UI/UX vs Non-SSOT scope classifier
|
|
2
|
+
|
|
3
|
+
## Scope classifier(critical 第 1 步)
|
|
4
|
+
|
|
5
|
+
### SSOT-UI/UX substantive(必 ASK user)
|
|
6
|
+
|
|
7
|
+
任一命中 → **STOP propose 等 user A/B**:
|
|
8
|
+
|
|
9
|
+
- 動 `packages/design-system/src/components/<X>/<X>.tsx` 的 cva variant / size / state(視覺 surface)
|
|
10
|
+
- 動 spec.md 的「視覺結構 / canonical / SSOT / 何時用 / 何時不用 / 邊界案例 / Layout Family」段落 substantive meaning
|
|
11
|
+
- 加 / 刪 / 改 token(`tokens/**/*.css` / `*.spec.md`)
|
|
12
|
+
- 加新 prop / 重命名 prop / 改 prop default value(API contract)
|
|
13
|
+
- 跨元件 design language 改動(同類 row primitive 重新訂 padding / dismiss canonical 跨元件改)
|
|
14
|
+
- 新 family 宣告 / 改 family 歸屬
|
|
15
|
+
- 新 pattern 加入 `patterns/` 或既有 pattern scope 改變
|
|
16
|
+
|
|
17
|
+
### Non-SSOT(AUTO 整批做完,M33 anti-defer)
|
|
18
|
+
|
|
19
|
+
- Bug fix(spec 既有 canonical + code 跑掉 → 對齊 spec)
|
|
20
|
+
- Code clean(unused import / dead export / typo / 排版)
|
|
21
|
+
- Refactor 不動行為(extract helper / rename internal symbol / consolidate condition)
|
|
22
|
+
- 命名一致對齊既有 canonical(per `# 命名與語言一致性`)
|
|
23
|
+
- Test / audit / verify(playwright / invariant script / hook regex 加廣)
|
|
24
|
+
- Audit dim / hook 加廣(對齊 spec wording 廣度,M34)
|
|
25
|
+
- Pointer / cross-link 補完整(reciprocal Dim 3 / SSOT pointer)
|
|
26
|
+
- Spec typo / markdown layout / 標點
|
|
27
|
+
- Memory file rotate(已 absorb → demote)
|
|
28
|
+
- Governance / hook / skill 內部 refactor(無 BLOCKER 邏輯改)
|
|
29
|
+
|
|
30
|
+
## SSOT-UI/UX propose 中文人話 format(per `feedback_propose_in_plain_chinese.md`)
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
### 決策 N:<一句話標題,zero jargon>
|
|
34
|
+
|
|
35
|
+
**現況**:
|
|
36
|
+
- <目前 spec / code 行為,具體一句話人話>
|
|
37
|
+
- 證據:<file:line>
|
|
38
|
+
|
|
39
|
+
**影響**:
|
|
40
|
+
- 不改:<具體後果>
|
|
41
|
+
- 改了:<具體後果>
|
|
42
|
+
|
|
43
|
+
**選項**:
|
|
44
|
+
- A. <做法 1>
|
|
45
|
+
- 後果:<好處 / 代價>
|
|
46
|
+
- 涉及檔案:<count + file 列表>
|
|
47
|
+
- B. <做法 2>
|
|
48
|
+
- 後果:<好處 / 代價>
|
|
49
|
+
- 涉及檔案:<count + file 列表>
|
|
50
|
+
- C. 不動
|
|
51
|
+
- 後果:<漂移持續累積 / 或維持現況的成本>
|
|
52
|
+
|
|
53
|
+
**我推**:<A / B / C> 因 <理由>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 4-Q gate(propose 前必 inline 跑,失敗 → 不列 option)
|
|
57
|
+
|
|
58
|
+
| Q | Check | 失敗 → |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| Q1 M22 cite | 3-column owner table(spec path:line / canonical sentence / conflicting code)| 撤回 propose,先補 anchor |
|
|
61
|
+
| Q2 M17 SSOT | 既有 token / primitive / pattern 列消費清單 | 撤回,先 consume 既有 |
|
|
62
|
+
| Q3 Rule-of-3 | 同概念 ≥ 3 處 → 選 SSOT 其他 pointer | 撤回,選 SSOT home |
|
|
63
|
+
| Q4 M10 下游 | 修上游 ≥ 3 處下游 redundant 可清 | 提案加上「下游 N 處同步 retire」 |
|
|
64
|
+
|
|
65
|
+
### 禁用 jargon list(propose 內 zero tolerance)
|
|
66
|
+
|
|
67
|
+
❌ `L1-L7` / `canonical` / `primitive` / `SSOT` / `consume` / `traits` / `M-rule` / `cva` / `tier` / `tokens` / `wrapper`
|
|
68
|
+
✅ 翻成:`主檔` / `設計原則` / `共用零件` / `通用基底` / `共用設計來源` / `沿用` / `行為類型` / `規則 N` / `樣式拼裝表` / `層級` / `設計變數` / `外殼`
|
|
69
|
+
|
|
70
|
+
## Non-SSOT autonomous 7 軸 simultaneous optimize
|
|
71
|
+
|
|
72
|
+
每次動 code 前 mental check:
|
|
73
|
+
|
|
74
|
+
1. **言簡意賅** — comment / spec 文字短而精;禁長 docstring;禁不必要 comment(per CLAUDE.md `# Tone and style`)
|
|
75
|
+
2. **效率 + 效能** — 避 unnecessary re-render / memo gap / O(N²) algorithm / context thrashing
|
|
76
|
+
3. **SSOT 鐵律** — 動 visual decision 前 grep DS 既有 token / variant / pattern(M23)/ spec.md owner(M29)/ wrapper extends primitive(M30)/ token 而非 hardcode(M17)
|
|
77
|
+
4. **易懂 + 維護 + 擴充** — file size budget(governance ≤ 200/300/500/800)/ function ≤ 80 / naming 一致 / public API 穩定
|
|
78
|
+
5. **世界級 + 一致設計語言** — mindset #1(Polaris / Material / Atlassian / Ant / Carbon / Apple HIG ≥ 3 cite)+ M22 inline cite + M26 propose 前 WebFetch ≥ 3 source
|
|
79
|
+
6. **完整 self-verify** — M20 best-practice score ≥ 80 / M31 5-step(Layer A own + Layer C codex 比稿)/ M32 pixel-quantified audit
|
|
80
|
+
7. **自動 self-improve** — M14 5-layer pipeline(對話結論 → spec / hook / SKILL / CLAUDE.md / memory 該動的全動)+ M20 stop hook auto-score
|
|
81
|
+
|
|
82
|
+
任一軸明顯 degrade → 撤回方案重來,**禁** 「先這樣 / 之後優化」defer keyword(M33 BLOCKER)。
|
|
83
|
+
|
|
84
|
+
## 共識決策(Phase B.5)同 format
|
|
85
|
+
|
|
86
|
+
Phase B 共識(Claude + Codex 雙 verify PASS)走相同 propose / autonomous 分流:
|
|
87
|
+
|
|
88
|
+
- SSOT-UI/UX 共識 → 中文人話 propose user 拍板
|
|
89
|
+
- Non-SSOT 共識 → autonomous batch(7 軸 optimize)
|
|
90
|
+
|
|
91
|
+
**禁** Phase B 共識降回 Phase A 已 ASK 的同 decision 重 ASK(浪費 user 時間)。已 ASK 的 → 等 user 拍板;新發現(Phase B 抓的 Phase A 漏)→ 新 propose。
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: delivery-handoff
|
|
3
|
+
description: Generate stakeholder-ready handoff documentation when a product / feature is confirmed final. Produces Storybook handoff page + UI flow diagram + component usage inventory + token consumption report + a11y checklist + per-screen spec — a Figma-like inspectable delivery package. Invoke via /delivery-handoff when user says「要交付」「handoff」「交付文件」「給 X 團隊的文件」「產品確認要上線了」. **只在產品確認 final 後才 invoke**,非 prototype 階段。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Delivery Handoff Workflow
|
|
7
|
+
|
|
8
|
+
Purpose: 產品 / feature 通過 prototype → audit → stakeholder 決策後確認 final,需要產 **Figma-like inspectable handoff documentation** 給工程 / PM / QA / 其他 stakeholder。
|
|
9
|
+
|
|
10
|
+
本 skill **不是** prototype 階段文件(那是 `/prototype` 的 notes.md),而是**正式交付包**。
|
|
11
|
+
|
|
12
|
+
## When to run
|
|
13
|
+
|
|
14
|
+
**明確觸發**:
|
|
15
|
+
- User 說「要交付」「handoff」「交付文件」「給 X 團隊的文件」
|
|
16
|
+
- User 說「產品確認要上線了」「final 了做 handoff」「給工程交接」
|
|
17
|
+
- Final decision 已下 + product-ui-audit P0 都修完
|
|
18
|
+
|
|
19
|
+
**不觸發**:
|
|
20
|
+
- Prototype 階段(走 `/prototype`,產 exploration notes)
|
|
21
|
+
- Audit 階段(走 `/product-ui-audit`)
|
|
22
|
+
- DS 本身的 spec 維護(不走任何 skill,直接在 `.spec.md` 編)
|
|
23
|
+
- 要跑 audit 檢查 DS 用對不對 → `/product-ui-audit`
|
|
24
|
+
|
|
25
|
+
## 生態位
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
/prototype → exploration + shortlist
|
|
29
|
+
/product-ui-audit → QA gate
|
|
30
|
+
[stakeholder decides final]
|
|
31
|
+
[P0 fixed, P1 resolved]
|
|
32
|
+
/delivery-handoff ← 本 skill,只在 final confirmed 後
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Preconditions
|
|
36
|
+
|
|
37
|
+
- 產品 / feature 已 final(stakeholder 書面或對話確認)
|
|
38
|
+
- `/product-ui-audit` Zero P0(必要)/ P1 有計畫 resolve(建議)
|
|
39
|
+
- 代碼已 merge 或即將 merge 到 main branch
|
|
40
|
+
- 有明確 **target audience**(給工程? 給 PM? 給設計 review? 給跨團隊交接?)— AI 在 Phase 0 clarify
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 5-Phase Workflow
|
|
45
|
+
|
|
46
|
+
### Phase 0 — Scope & audience
|
|
47
|
+
|
|
48
|
+
**clarify with user**:
|
|
49
|
+
1. 交付**哪個 feature**?(single screen? full flow? 整個 module?)
|
|
50
|
+
2. **給誰**?
|
|
51
|
+
- 工程團隊(實作參考 / QA test case)
|
|
52
|
+
- PM / BA(業務理解 / 邊界 case)
|
|
53
|
+
- 設計 review(世界級評估)
|
|
54
|
+
- 跨團隊(onboarding 他們使用)
|
|
55
|
+
3. **format 需求**:
|
|
56
|
+
- Storybook 原生頁(最推薦)
|
|
57
|
+
- Markdown 可 export PDF
|
|
58
|
+
- Mermaid diagram(UI flow)
|
|
59
|
+
- Screenshot / mockup 用 Storybook render
|
|
60
|
+
|
|
61
|
+
### Phase 1 — Inventory 生成
|
|
62
|
+
|
|
63
|
+
scan 目標 feature 的 code,自動 inventory:
|
|
64
|
+
|
|
65
|
+
1. **Component 清單**(哪些 DS 元件被此 feature 消費):
|
|
66
|
+
```
|
|
67
|
+
| Component | Count | Consumer files |
|
|
68
|
+
|-----------|-------|----------------|
|
|
69
|
+
| Button | 12 | Checkout.tsx, Summary.tsx, ... |
|
|
70
|
+
| Dialog | 2 | Confirm.tsx, Edit.tsx |
|
|
71
|
+
| Empty | 1 | NoItems.tsx |
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
2. **Token 使用報告**:
|
|
75
|
+
```
|
|
76
|
+
| Token | Usage | Files |
|
|
77
|
+
|-------|-------|-------|
|
|
78
|
+
| --primary | 8 hits | ... |
|
|
79
|
+
| --fg-secondary | 14 hits | ... |
|
|
80
|
+
| --error | 3 hits | ... |
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
3. **Layout primitives 消費**: Empty / item-layout / overlay-surface / ScrollArea / AspectRatio 各幾次。
|
|
84
|
+
|
|
85
|
+
4. **A11y checklist**(先掃再人工 review):
|
|
86
|
+
- aria-label 齊全
|
|
87
|
+
- role / keyboard
|
|
88
|
+
- Dialog title
|
|
89
|
+
- color contrast(此層 AI 報 visible,人工 review 判 final)
|
|
90
|
+
|
|
91
|
+
### Phase 2 — UI flow 圖生成
|
|
92
|
+
|
|
93
|
+
用 **Mermaid** 產 flow(Storybook 支援 render,也可 export PDF)。
|
|
94
|
+
|
|
95
|
+
範本:
|
|
96
|
+
|
|
97
|
+
```mermaid
|
|
98
|
+
flowchart TD
|
|
99
|
+
Start([進入 Checkout]) --> Review[結帳 Review]
|
|
100
|
+
Review -->|修改| Edit[編輯 Cart Dialog]
|
|
101
|
+
Edit --> Review
|
|
102
|
+
Review -->|確認| Payment[付款方式 Step]
|
|
103
|
+
Payment -->|信用卡| Card[Card Form]
|
|
104
|
+
Payment -->|轉帳| Bank[Bank Instructions]
|
|
105
|
+
Card --> Confirm[確認 Dialog]
|
|
106
|
+
Bank --> Confirm
|
|
107
|
+
Confirm -->|確定| Success([訂單成立])
|
|
108
|
+
Confirm -->|取消| Review
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
AI 根據 code(route / onClick / navigation)auto-generate,user review 後微調。
|
|
112
|
+
|
|
113
|
+
### Phase 3 — Per-screen spec sheet
|
|
114
|
+
|
|
115
|
+
每個 screen / modal / flow step 一頁 spec(Storybook 的 Handoff story,或 Markdown 章節):
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
## Screen: Checkout Review
|
|
119
|
+
|
|
120
|
+
**Storybook**: `Features/Checkout/Review`
|
|
121
|
+
**File**: `src/app/features/checkout/Review.tsx`
|
|
122
|
+
|
|
123
|
+
### 用途
|
|
124
|
+
使用者進入結帳後,第一屏預覽購物車 + 小計 + 折扣碼輸入。
|
|
125
|
+
|
|
126
|
+
### 主要元件
|
|
127
|
+
- DataTable(訂單 items)
|
|
128
|
+
- Input(折扣碼)
|
|
129
|
+
- Button(套用)
|
|
130
|
+
- Dialog(編輯 item 彈出)
|
|
131
|
+
- Empty(購物車空狀態)
|
|
132
|
+
|
|
133
|
+
### States
|
|
134
|
+
- **default**: 載入後正常顯示(≥1 item)
|
|
135
|
+
- **empty**: 購物車無 item — 顯示 Empty 元件 + 「回去繼續購物」CTA
|
|
136
|
+
- **error**: 折扣碼無效 — Input error state + Alert 說明
|
|
137
|
+
|
|
138
|
+
### Interactions
|
|
139
|
+
- 點擊 item → open Edit Dialog
|
|
140
|
+
- 輸入 discount → debounce 500ms → auto-validate
|
|
141
|
+
- 按 Apply → post /discount API
|
|
142
|
+
|
|
143
|
+
### A11y
|
|
144
|
+
- ✓ 所有 icon-only 有 aria-label
|
|
145
|
+
- ✓ Dialog 有 title + description
|
|
146
|
+
- ✓ keyboard 可 tab 所有互動
|
|
147
|
+
- ✓ color contrast 通過 WCAG AA
|
|
148
|
+
|
|
149
|
+
### 邊界 case
|
|
150
|
+
- 折扣碼已套用:顯示 "已套用 {code}",Apply Button 變 Clear
|
|
151
|
+
- 網路錯誤:顯示 Alert + retry button
|
|
152
|
+
- 折扣超過總額:capped 折扣 = 總額,顯示說明
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Phase 4 — Handoff Storybook page
|
|
156
|
+
|
|
157
|
+
在 Storybook 建立 `Features/{Feature}/Handoff` page,內含:
|
|
158
|
+
|
|
159
|
+
- **Overview**: feature 一句話重述
|
|
160
|
+
- **UI Flow**: Mermaid diagram(Storybook 支援 render)
|
|
161
|
+
- **Inventory**: 元件 / token / a11y 報告
|
|
162
|
+
- **Screens**: 每個 screen 可點進去的 story link + inline preview
|
|
163
|
+
- **Spec table**: per-screen spec 嵌入
|
|
164
|
+
|
|
165
|
+
Storybook title: `Features/{FeatureName}/Handoff`
|
|
166
|
+
|
|
167
|
+
此 page 就是「Figma-like 的 inspectable 交付」— stakeholder 打開就看到全景。
|
|
168
|
+
|
|
169
|
+
### ⚠️ Checkpoint — User review handoff package
|
|
170
|
+
|
|
171
|
+
Phase 4 產出後 pause,讓 user review:
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
📦 Handoff Package Ready
|
|
175
|
+
|
|
176
|
+
Scope: {feature}
|
|
177
|
+
Audience: {engineering / PM / designer / cross-team}
|
|
178
|
+
Package:
|
|
179
|
+
- Storybook page: Features/{Feature}/Handoff
|
|
180
|
+
- Inventory: {N components / M tokens}
|
|
181
|
+
- UI Flow: Mermaid diagram ({N nodes})
|
|
182
|
+
- Spec sheets: {N screens}
|
|
183
|
+
- A11y checklist: {N passed / M needs review}
|
|
184
|
+
|
|
185
|
+
Export formats:
|
|
186
|
+
- Storybook URL: {link}
|
|
187
|
+
- Markdown(可 export PDF): {path}
|
|
188
|
+
|
|
189
|
+
請 review:
|
|
190
|
+
(a) 通過,準備 share 給 {audience}
|
|
191
|
+
(b) 需要修改: ...
|
|
192
|
+
(c) 還缺 ... 補齊
|
|
193
|
+
(d) Audience 換人,調整語氣 / 深度
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## 世界級 handoff 標準(reference)
|
|
199
|
+
|
|
200
|
+
本 skill 對標:
|
|
201
|
+
- **Figma Dev Mode** — inspectable 元件 + token + spacing
|
|
202
|
+
- **Zeplin** — per-screen spec + asset export
|
|
203
|
+
- **Shopify Polaris Pattern pages** — 完整 flow + usage + edge cases
|
|
204
|
+
- **Material Design Showcase** — UI + spec + code sample 三欄
|
|
205
|
+
|
|
206
|
+
我們的 Storybook handoff page 整合上述 3 個 tool 的優勢到一頁。
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Non-goals
|
|
211
|
+
|
|
212
|
+
- 不替代工程 code review(本 skill 是 **設計 handoff**,不是 code 品質審核)
|
|
213
|
+
- 不寫實作 / fix bug(已經 audit 過,final 了才 invoke 本 skill)
|
|
214
|
+
- 不生成業務需求文件(那是 PM 職責)
|
|
215
|
+
- 不管 release scheduling / branching strategy(那是 DevOps)
|
|
216
|
+
|
|
217
|
+
## Common failure modes
|
|
218
|
+
|
|
219
|
+
- **Audience 不清**: user 說「要 handoff」但沒說給誰 → Phase 0 必 clarify,否則 format 錯
|
|
220
|
+
- **UI flow 過度簡化**: flow 圖少 error path / loading / edge case → 讓 handoff 失真
|
|
221
|
+
- **Component inventory 漏掉 hidden consumption**:e.g., 內部某 function 呼叫 Toast → 需 grep 所有 imports
|
|
222
|
+
- **A11y checklist 自動判 pass**:checklist 只能「visible hits」,color contrast / keyboard 實測需人工
|
|
223
|
+
- **Spec sheet 寫成 code comment 複製**:spec 應該是 design 語言而非 code 描述,翻譯為 UX 詞彙
|
|
224
|
+
|
|
225
|
+
## References
|
|
226
|
+
|
|
227
|
+
- [references/handoff-template.md](references/handoff-template.md) — Storybook Handoff page 結構 + Markdown spec 範本
|
|
228
|
+
- [references/flow-diagram.md](references/flow-diagram.md) — Mermaid UI flow 指引 + 世界級 reference
|
|
229
|
+
- [references/inventory-checklist.md](references/inventory-checklist.md) — 元件 / token / a11y 清單 + grep pattern
|