@qijenchen/design-system 0.1.0-beta.92 → 0.1.0-beta.95
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/AGENTS.md +6 -208
- package/CLAUDE.md +2 -23
- package/dist/components/DataTable/data-table-filter-value-picker.js +4 -0
- package/dist/components/DataTable/data-table-filter-value-picker.js.map +1 -1
- package/dist/components/DataTable/filter-tree.js +6 -0
- package/dist/components/DataTable/filter-tree.js.map +1 -1
- package/dist/patterns/element-anatomy/item-anatomy.js +1 -1
- package/ds-canonical/adapters/claude/agents/README.md +58 -0
- package/ds-canonical/adapters/claude/agents/canonical-reviewer.md +14 -0
- package/ds-canonical/adapters/claude-root-instructions.md +24 -0
- package/ds-canonical/adapters/claude-settings-base.json +172 -0
- package/ds-canonical/commands/README.md +8 -13
- package/ds-canonical/commands/gov-status.md +5 -75
- package/ds-canonical/fork/AGENTS.md +116 -213
- package/ds-canonical/fork/CLAUDE.md +54 -0
- package/ds-canonical/fork/codex/agents/skills/bug-fix-rhythm/SKILL.md +207 -0
- package/ds-canonical/fork/codex/agents/skills/code-quality-audit/SKILL.md +71 -0
- package/ds-canonical/fork/codex/agents/skills/delivery-handoff/SKILL.md +244 -0
- package/ds-canonical/fork/codex/agents/skills/delivery-handoff/references/flow-diagram.md +180 -0
- package/ds-canonical/fork/codex/agents/skills/delivery-handoff/references/handoff-template.md +177 -0
- package/ds-canonical/fork/codex/agents/skills/delivery-handoff/references/inventory-checklist.md +196 -0
- package/ds-canonical/fork/codex/agents/skills/independent-review/SKILL.md +29 -19
- package/ds-canonical/fork/codex/agents/skills/independent-review/agents/openai.yaml +4 -0
- package/ds-canonical/fork/codex/agents/skills/independent-review/references/evidence-contract.md +24 -0
- package/ds-canonical/fork/codex/agents/skills/performance-audit/SKILL.md +114 -0
- package/ds-canonical/fork/codex/agents/skills/product-ui-audit/SKILL.md +244 -0
- package/ds-canonical/fork/codex/agents/skills/product-ui-audit/references/audit-checks.md +250 -0
- package/ds-canonical/fork/codex/agents/skills/product-ui-audit/references/common-misuses.md +329 -0
- package/ds-canonical/fork/codex/agents/skills/product-ui-audit/references/report-template.md +163 -0
- package/ds-canonical/fork/codex/agents/skills/propose-options/SKILL.md +190 -0
- package/ds-canonical/fork/codex/agents/skills/prototype/SKILL.md +246 -0
- package/ds-canonical/fork/codex/agents/skills/prototype/references/audit-checks.md +39 -0
- package/ds-canonical/fork/codex/agents/skills/prototype/references/benchmark-sources.md +94 -0
- package/ds-canonical/fork/codex/agents/skills/prototype/references/checkpoints.md +200 -0
- package/ds-canonical/fork/codex/agents/skills/prototype/references/evaluation-matrix.md +142 -0
- package/ds-canonical/fork/codex/agents/skills/prototype/references/ooux-template.md +198 -0
- package/ds-canonical/fork/codex/agents/skills/prototype/references/proposal-template.md +230 -0
- package/ds-canonical/fork/codex/agents/skills/scan-similar-bugs/SKILL.md +212 -0
- package/ds-canonical/fork/codex/agents/skills/ux-audit/SKILL.md +135 -0
- package/ds-canonical/fork/codex/agents/skills/visual-audit/SKILL.md +259 -0
- package/ds-canonical/fork/codex/agents/skills/visual-audit/output/.gitkeep +0 -0
- package/ds-canonical/fork/codex/agents/skills/visual-audit/references/audit-architecture.md +101 -0
- package/ds-canonical/fork/codex/agents/skills/visual-audit/references/visual-checklist.md +297 -0
- package/ds-canonical/fork/codex/agents/skills/visual-audit/references/world-class-benchmarks.md +198 -0
- package/ds-canonical/fork/codex/hooks.json +44 -3
- package/ds-canonical/fork/common/closed-tool-execution.mjs +1001 -0
- package/ds-canonical/fork/common/instruction.md +116 -0
- package/ds-canonical/fork/consumer/governance-check.mjs +3059 -0
- package/ds-canonical/fork/consumer/lib/closed-tool-execution.mjs +1001 -0
- package/ds-canonical/fork/consumer/lock.json +189 -0
- package/ds-canonical/fork/consumer/lock.schema.json +338 -0
- package/ds-canonical/fork/consumer/managed-files/0235cf6b3fd402a3717881dc205b5bf77aed7632e7d7d6f1811a40e3033bd816.blob +145 -0
- package/ds-canonical/fork/consumer/managed-files/145aab4b4fc470fc9ba7679b4a1d87d4f6a6d604940bd40f8d675c8af696498f.blob +47 -0
- package/ds-canonical/fork/consumer/managed-files/189e551431181e4a88783c02130d2787b801ef731c86e35bcde89a7313aa020e.blob +149 -0
- package/ds-canonical/fork/consumer/managed-files/24ad71c8613ddcf6fd23818cb3bb477a1fb6d83af4550b0bad43099813088686.blob +28 -0
- package/ds-canonical/fork/consumer/managed-files/2d1ef5617a5ce3c39ad9aae1c42af7d199f9270c0a0ccb490b63d62dbc6913db.blob +1001 -0
- package/ds-canonical/fork/consumer/managed-files/3625e02235cf166a50649a4d704cfb68fead69d0e168c481df013ebae9f6be25.blob +1412 -0
- package/ds-canonical/fork/consumer/managed-files/3ddedc67b464bdfe3dde9803a2d917920c96d633678b802eee638a44cd47366a.blob +8 -0
- package/ds-canonical/fork/consumer/managed-files/423729840acdd43c812f17c245b871716c6b60f76e4d3e94864d0e34a815bf8d.blob +348 -0
- package/ds-canonical/fork/consumer/managed-files/46f10bc55cdfdf834d0749eebff42ea0bb8576f361b36d2b6ba1851354c50150.blob +464 -0
- package/ds-canonical/fork/consumer/managed-files/475fba657eaeb8abd88f60635f3eadab27a9d0d3114ba4fffc65f43a2a0fe6e2.blob +124 -0
- package/ds-canonical/fork/consumer/managed-files/61c6aca6d7f04bedbf556eaa9d3043681fe48cbe0e93a8ccb1d69a7c5e23fdcf.blob +113 -0
- package/ds-canonical/fork/consumer/managed-files/63061e05969667005020166ea2ae7df3c96663f7a928e7dd3eebc1471022df56.blob +2398 -0
- package/ds-canonical/fork/consumer/managed-files/65410b66e8799a560e07b71779c186fed2a0ef50575ac44745df7a0938a9c2b4.blob +317 -0
- package/ds-canonical/fork/consumer/managed-files/6929a3c8bb4d69c507720b4754aeb339c6cbb8ff655e0a381d76606d64695e38.blob +393 -0
- package/ds-canonical/fork/consumer/managed-files/6b746628ac11fcccbe277ef6fea94cc2a7b90ea2822e83536eae80d5ee4b3fa5.blob +167 -0
- package/ds-canonical/fork/consumer/managed-files/76d485470d30ff014afacf7ce643763de9f4f956d9fc8128dbc1814774cf2e63.blob +671 -0
- package/ds-canonical/fork/consumer/managed-files/77e06f62670dfee01e9b5e8b0f8dad085ce711d75538c1fb0679d9818acaca82.blob +424 -0
- package/ds-canonical/fork/consumer/managed-files/7937321877e5c34c27dae36c0d507d21cd42fa3f46a8f11a284b8b4a52b6faa4.blob +84 -0
- package/ds-canonical/fork/consumer/managed-files/794bb911ba8ebef58ab0d44a55b9968a19d2c62bcfb310b1ee3a84166f087f21.blob +880 -0
- package/ds-canonical/fork/consumer/managed-files/7b17835d0ceb17cdcdcaf930540a3e5d0943a34a747ac43c12ca8cd485c11581.blob +44 -0
- package/ds-canonical/fork/consumer/managed-files/7eb6cc60abfdabaf6617c336058fad1454ccde08889295767bfd9b7fd153cc6e.blob +778 -0
- package/ds-canonical/fork/consumer/managed-files/81037efa5b3b9f4a875704005fb268acdc9233bb901f44902e4e37e1da92b8e3.blob +46 -0
- package/ds-canonical/fork/consumer/managed-files/884721550b56308812b20917adac7a12f36fdb4ecda6b02460a7f5a219c0c966.blob +78 -0
- package/ds-canonical/fork/consumer/managed-files/91f414b9462ddc1e4be1d4c6ca4ac7a7340a6eec9e98ee109cbc049d3b354b6a.blob +36 -0
- package/ds-canonical/fork/consumer/managed-files/92e4828cdcb96ff0d01daa16f6885f24045a8e72820665650f2a1890dc3a446c.blob +121 -0
- package/ds-canonical/fork/consumer/managed-files/93a89f16f6717d1e4e4e27ec20ef916e3355c7aa890ca74cd9b12db30d8a899f.blob +43 -0
- package/ds-canonical/fork/consumer/managed-files/974521d6b8fe796ea4c58b3c78b0c2b8a1be262b97100d77aaf4cc9c7724bcab.blob +45 -0
- package/ds-canonical/fork/consumer/managed-files/9791c85388d2e2e2bd564e2550fadc3351c4c960a47ce838098afcba7544eb90.blob +959 -0
- package/ds-canonical/fork/consumer/managed-files/a448d2222133335c30e6fda5116e26a40db3283a19d62ccc0663c30d272262a7.blob +174 -0
- package/ds-canonical/fork/consumer/managed-files/ab072e7f2eca51f0e18a5e18c4b333260ee5d219a12cc6df5bb2d683f0b2734d.blob +2636 -0
- package/ds-canonical/fork/consumer/managed-files/bc44cabad181f766611dab6a8f52d81100afadd50ac59799015e8ba7bf46d9eb.blob +596 -0
- package/ds-canonical/fork/consumer/managed-files/c4aa767f11714467de0038a2149cf78074baddc17fc6a9e074b6aed7544c6f3c.blob +80 -0
- package/ds-canonical/fork/consumer/managed-files/c893e9b734b162f4c631fef871128c16a9ab565f796a0e76d7f320f821f220f5.blob +41 -0
- package/ds-canonical/fork/consumer/managed-files/cd9c61f8ff24fb9bcc3663e346e2cfa419cfb84e02aae18d3dc66dd192681696.blob +9 -0
- package/ds-canonical/fork/consumer/managed-files/da2ad2737315d25a5300905ddefd62f1695056a8a1af155c5b34170ad9923bce.blob +38 -0
- package/ds-canonical/fork/consumer/managed-files/e1b11160d6c4043002d2cbff6d9a4ae551698a96137773c4244dadfac152fcb0.blob +222 -0
- package/ds-canonical/fork/consumer/managed-files/e26057408661597aac4a57cdf7e30e2f9d0afb1b9a2dbbb692c3805cd9028ca5.blob +250 -0
- package/ds-canonical/fork/consumer/managed-files/e68ae1915965d8e17d4b2441c00c2b97fe062ea308ae8535c9eebb2fc16fa245.blob +20 -0
- package/ds-canonical/fork/consumer/managed-files/e71c65f45c6af7ce12b6b3c0d8028f185da5b719e2050c9b2a6b243d41ae4878.blob +182 -0
- package/ds-canonical/fork/consumer/managed-files/e813096d69c49812e40e00be9ac8fa14d77f0ec1f97ab4c45cb096b3bedd35de.blob +3 -0
- package/ds-canonical/fork/consumer/managed-files/e930ebca6fd8eeb30802aac0930efae7bcc44cc0996f24de07c11ca6a081fedf.blob +277 -0
- package/ds-canonical/fork/consumer/managed-files/ea94e914d5c8acb84ad7660e5bda0f01b6ccc8cf96b0f6b1ce048f8938d0f5b5.blob +47 -0
- package/ds-canonical/fork/consumer/managed-files/f4db6e616d5229aa7e700c6a3ace022cb9d90baae74e38ca65fce617f18e0d9b.blob +110 -0
- package/ds-canonical/fork/consumer/managed-files/faa128c26102415dc5345e68698efbbd28a395c35ee278dceae044cf430692b2.blob +11 -0
- package/ds-canonical/fork/governance.lock +1552 -103
- package/ds-canonical/fork/hooks/_log-fire.sh +109 -12
- package/ds-canonical/fork/hooks/block_prototype_imports.py +148 -29
- package/ds-canonical/fork/hooks/check_chrome_header_avatar_canonical.sh +23 -12
- package/ds-canonical/fork/hooks/check_consumer_app_invariants.sh +116 -65
- package/ds-canonical/fork/hooks/check_consumer_code_quality.sh +140 -0
- package/ds-canonical/fork/hooks/check_ds_anchor_preflight.sh +84 -30
- package/ds-canonical/fork/hooks/check_dynamic_tailwind_class.sh +16 -6
- package/ds-canonical/fork/hooks/check_escape_marker_abuse.sh +65 -21
- package/ds-canonical/fork/hooks/check_field_family_invariants.sh +90 -24
- package/ds-canonical/fork/hooks/check_fork_product_quality.sh +8 -6
- package/ds-canonical/fork/hooks/check_item_list_gap.sh +4 -2
- package/ds-canonical/fork/hooks/check_layout_space_magic_numbers.sh +31 -13
- package/ds-canonical/fork/hooks/check_opacity_token_usage.sh +220 -95
- package/ds-canonical/fork/hooks/check_pattern_invariants.sh +73 -14
- package/ds-canonical/fork/hooks/check_sidebar_menu_button_implicit_wrap.sh +23 -12
- package/ds-canonical/fork/hooks/check_story_determinism.sh +1 -1
- package/ds-canonical/fork/hooks/check_story_invariants.sh +342 -61
- package/ds-canonical/fork/hooks/check_tabs_content_chrome_body_double_gap.sh +52 -23
- package/ds-canonical/fork/hooks/check_tailwind_wildcard_in_docs.sh +20 -13
- package/ds-canonical/fork/hooks/inject_deploy_url_after_push.sh +105 -22
- package/ds-canonical/fork/hooks/lib/_hook_integrity.sh +158 -0
- package/ds-canonical/fork/hooks/lib/_provider_paths.sh +162 -0
- package/ds-canonical/fork/launchers/approval-evidence.mjs +1131 -0
- package/ds-canonical/fork/launchers/authority-decision-evidence.mjs +413 -0
- package/ds-canonical/fork/launchers/canonical-order.mjs +8 -0
- package/ds-canonical/fork/launchers/fork-governance-dispatcher.sh +139 -29
- package/ds-canonical/fork/launchers/format-provider-hook-output.mjs +25 -0
- package/ds-canonical/fork/launchers/independent-review.mjs +490 -0
- package/ds-canonical/fork/launchers/inject_fork_governance_preamble.sh +88 -43
- package/ds-canonical/fork/launchers/normalize-provider-event.mjs +355 -0
- package/ds-canonical/fork/launchers/product-hook-dispatch-runtime.mjs +1067 -0
- package/ds-canonical/fork/launchers/provider-hook-normalization.mjs +1646 -0
- package/ds-canonical/fork/launchers/provider-hook-output-transport.mjs +525 -0
- package/ds-canonical/fork/launchers/settings-hooks.json +30 -53
- package/ds-canonical/fork/manifest.json +1881 -23
- package/ds-canonical/fork/providers/claude/hook-config.json +333 -0
- package/ds-canonical/fork/providers/claude/instruction.md +54 -0
- package/ds-canonical/fork/providers/claude/skills/bug-fix-rhythm/SKILL.md +207 -0
- package/ds-canonical/fork/providers/claude/skills/code-quality-audit/SKILL.md +71 -0
- package/ds-canonical/fork/providers/claude/skills/delivery-handoff/SKILL.md +244 -0
- package/ds-canonical/fork/providers/claude/skills/delivery-handoff/references/flow-diagram.md +180 -0
- package/ds-canonical/fork/providers/claude/skills/delivery-handoff/references/handoff-template.md +177 -0
- package/ds-canonical/fork/providers/claude/skills/delivery-handoff/references/inventory-checklist.md +196 -0
- package/ds-canonical/fork/providers/claude/skills/independent-review/SKILL.md +43 -0
- package/ds-canonical/fork/providers/claude/skills/independent-review/agents/openai.yaml +4 -0
- package/ds-canonical/fork/providers/claude/skills/independent-review/references/evidence-contract.md +24 -0
- package/ds-canonical/fork/providers/claude/skills/performance-audit/SKILL.md +114 -0
- package/ds-canonical/fork/providers/claude/skills/product-ui-audit/SKILL.md +244 -0
- package/ds-canonical/fork/providers/claude/skills/product-ui-audit/references/audit-checks.md +250 -0
- package/ds-canonical/fork/providers/claude/skills/product-ui-audit/references/common-misuses.md +329 -0
- package/ds-canonical/fork/providers/claude/skills/product-ui-audit/references/report-template.md +163 -0
- package/ds-canonical/fork/providers/claude/skills/propose-options/SKILL.md +190 -0
- package/ds-canonical/fork/providers/claude/skills/prototype/SKILL.md +246 -0
- package/ds-canonical/fork/providers/claude/skills/prototype/references/audit-checks.md +39 -0
- package/ds-canonical/fork/providers/claude/skills/prototype/references/benchmark-sources.md +94 -0
- package/ds-canonical/fork/providers/claude/skills/prototype/references/checkpoints.md +200 -0
- package/ds-canonical/fork/providers/claude/skills/prototype/references/evaluation-matrix.md +142 -0
- package/ds-canonical/fork/providers/claude/skills/prototype/references/ooux-template.md +198 -0
- package/ds-canonical/fork/providers/claude/skills/prototype/references/proposal-template.md +230 -0
- package/ds-canonical/fork/providers/claude/skills/scan-similar-bugs/SKILL.md +212 -0
- package/ds-canonical/fork/providers/claude/skills/ux-audit/SKILL.md +135 -0
- package/ds-canonical/fork/providers/claude/skills/visual-audit/SKILL.md +259 -0
- package/ds-canonical/fork/providers/claude/skills/visual-audit/output/.gitkeep +0 -0
- package/ds-canonical/fork/providers/claude/skills/visual-audit/references/audit-architecture.md +101 -0
- package/ds-canonical/fork/providers/claude/skills/visual-audit/references/visual-checklist.md +297 -0
- package/ds-canonical/fork/providers/claude/skills/visual-audit/references/world-class-benchmarks.md +198 -0
- package/ds-canonical/fork/providers/codex/hook-config.json +57 -0
- package/ds-canonical/fork/providers/codex/skills/bug-fix-rhythm/SKILL.md +207 -0
- package/ds-canonical/fork/providers/codex/skills/code-quality-audit/SKILL.md +71 -0
- package/ds-canonical/fork/providers/codex/skills/delivery-handoff/SKILL.md +244 -0
- package/ds-canonical/fork/providers/codex/skills/delivery-handoff/references/flow-diagram.md +180 -0
- package/ds-canonical/fork/providers/codex/skills/delivery-handoff/references/handoff-template.md +177 -0
- package/ds-canonical/fork/providers/codex/skills/delivery-handoff/references/inventory-checklist.md +196 -0
- package/ds-canonical/fork/providers/codex/skills/independent-review/SKILL.md +43 -0
- package/ds-canonical/fork/providers/codex/skills/independent-review/agents/openai.yaml +4 -0
- package/ds-canonical/fork/providers/codex/skills/independent-review/references/evidence-contract.md +24 -0
- package/ds-canonical/fork/providers/codex/skills/performance-audit/SKILL.md +114 -0
- package/ds-canonical/fork/providers/codex/skills/product-ui-audit/SKILL.md +244 -0
- package/ds-canonical/fork/providers/codex/skills/product-ui-audit/references/audit-checks.md +250 -0
- package/ds-canonical/fork/providers/codex/skills/product-ui-audit/references/common-misuses.md +329 -0
- package/ds-canonical/fork/providers/codex/skills/product-ui-audit/references/report-template.md +163 -0
- package/ds-canonical/fork/providers/codex/skills/propose-options/SKILL.md +190 -0
- package/ds-canonical/fork/providers/codex/skills/prototype/SKILL.md +246 -0
- package/ds-canonical/fork/providers/codex/skills/prototype/references/audit-checks.md +39 -0
- package/ds-canonical/fork/providers/codex/skills/prototype/references/benchmark-sources.md +94 -0
- package/ds-canonical/fork/providers/codex/skills/prototype/references/checkpoints.md +200 -0
- package/ds-canonical/fork/providers/codex/skills/prototype/references/evaluation-matrix.md +142 -0
- package/ds-canonical/fork/providers/codex/skills/prototype/references/ooux-template.md +198 -0
- package/ds-canonical/fork/providers/codex/skills/prototype/references/proposal-template.md +230 -0
- package/ds-canonical/fork/providers/codex/skills/scan-similar-bugs/SKILL.md +212 -0
- package/ds-canonical/fork/providers/codex/skills/ux-audit/SKILL.md +135 -0
- package/ds-canonical/fork/providers/codex/skills/visual-audit/SKILL.md +259 -0
- package/ds-canonical/fork/providers/codex/skills/visual-audit/output/.gitkeep +0 -0
- package/ds-canonical/fork/providers/codex/skills/visual-audit/references/audit-architecture.md +101 -0
- package/ds-canonical/fork/providers/codex/skills/visual-audit/references/visual-checklist.md +297 -0
- package/ds-canonical/fork/providers/codex/skills/visual-audit/references/world-class-benchmarks.md +198 -0
- package/ds-canonical/fork/references/story-baseline-registry.json +117 -0
- package/ds-canonical/fork/references/story-baseline-registry.schema.json +145 -0
- package/ds-canonical/fork/references/utility-registry.json +377 -0
- package/ds-canonical/fork/references/utility-registry.schema.json +373 -0
- package/ds-canonical/fork/review/canonical-order.mjs +8 -0
- package/ds-canonical/fork/review/provider-review-binding.mjs +2377 -0
- package/ds-canonical/fork/skills/bug-fix-rhythm/SKILL.md +19 -12
- package/ds-canonical/fork/skills/code-quality-audit/SKILL.md +19 -15
- package/ds-canonical/fork/skills/delivery-handoff/SKILL.md +17 -11
- package/ds-canonical/fork/skills/independent-review/SKILL.md +37 -0
- package/ds-canonical/fork/skills/independent-review/agents/openai.yaml +4 -0
- package/ds-canonical/fork/skills/independent-review/references/evidence-contract.md +24 -0
- package/ds-canonical/fork/skills/performance-audit/SKILL.md +11 -8
- package/ds-canonical/fork/skills/product-ui-audit/SKILL.md +31 -21
- package/ds-canonical/fork/skills/product-ui-audit/references/audit-checks.md +9 -5
- package/ds-canonical/fork/skills/product-ui-audit/references/report-template.md +30 -26
- package/ds-canonical/fork/skills/propose-options/SKILL.md +6 -4
- package/ds-canonical/fork/skills/prototype/SKILL.md +21 -21
- package/ds-canonical/fork/skills/prototype/references/audit-checks.md +7 -6
- package/ds-canonical/fork/skills/prototype/references/checkpoints.md +26 -17
- package/ds-canonical/fork/skills/prototype/references/evaluation-matrix.md +2 -1
- package/ds-canonical/fork/skills/prototype/references/ooux-template.md +1 -1
- package/ds-canonical/fork/skills/prototype/references/proposal-template.md +6 -5
- package/ds-canonical/fork/skills/scan-similar-bugs/SKILL.md +28 -27
- package/ds-canonical/fork/skills/ux-audit/SKILL.md +8 -5
- package/ds-canonical/fork/skills/visual-audit/SKILL.md +37 -43
- package/ds-canonical/fork/skills/visual-audit/references/audit-architecture.md +15 -15
- package/ds-canonical/fork/skills/visual-audit/references/visual-checklist.md +6 -6
- package/ds-canonical/fork/skills/visual-audit/references/world-class-benchmarks.md +2 -2
- package/ds-canonical/hooks/README.md +37 -23
- package/ds-canonical/hooks/_log-fire.sh +109 -12
- package/ds-canonical/hooks/auto_regen_ds_barrel.sh +52 -20
- package/ds-canonical/hooks/block_prototype_imports.py +148 -29
- package/ds-canonical/hooks/check_audit_post_report_validator.sh +76 -66
- package/ds-canonical/hooks/check_audit_sample_escape.sh +4 -4
- package/ds-canonical/hooks/check_benchmark_citation.sh +3 -3
- package/ds-canonical/hooks/check_canonical_propagation.sh +81 -22
- package/ds-canonical/hooks/check_chrome_header_avatar_canonical.sh +22 -11
- package/ds-canonical/hooks/check_codex_brief_invariants.sh +100 -56
- package/ds-canonical/hooks/check_codex_collab_5step.sh +31 -25
- package/ds-canonical/hooks/check_consumer_app_invariants.sh +116 -65
- package/ds-canonical/hooks/check_consumer_code_quality.sh +140 -0
- package/ds-canonical/hooks/check_datatable_invariants.sh +103 -25
- package/ds-canonical/hooks/check_dim_count_drift.sh +5 -4
- package/ds-canonical/hooks/check_ds_anchor_preflight.sh +83 -29
- package/ds-canonical/hooks/check_dynamic_tailwind_class.sh +16 -6
- package/ds-canonical/hooks/check_escape_marker_abuse.sh +65 -21
- package/ds-canonical/hooks/check_field_controls_contracts.sh +10 -8
- package/ds-canonical/hooks/check_field_family_invariants.sh +90 -24
- package/ds-canonical/hooks/check_file_size_budget.sh +32 -14
- package/ds-canonical/hooks/check_full_story_visual_interaction_sweep.sh +60 -21
- package/ds-canonical/hooks/check_item_list_gap.sh +4 -2
- package/ds-canonical/hooks/check_layout_space_magic_numbers.sh +31 -13
- package/ds-canonical/hooks/check_main_branch_workbench.sh +27 -68
- package/ds-canonical/hooks/check_naming_and_abstraction.sh +20 -9
- package/ds-canonical/hooks/check_opacity_token_usage.sh +220 -95
- package/ds-canonical/hooks/check_orphan_ds_css.sh +48 -18
- package/ds-canonical/hooks/check_overlay_open_focus_escape_probe.sh +29 -11
- package/ds-canonical/hooks/check_pattern_invariants.sh +73 -14
- package/ds-canonical/hooks/check_peoplepicker_ssot_drift.sh +4 -4
- package/ds-canonical/hooks/check_pixel_quantified_audit.sh +3 -2
- package/ds-canonical/hooks/check_plugin_fork_health.sh +151 -41
- package/ds-canonical/hooks/check_post_main_ssot_propagate.sh +5 -109
- package/ds-canonical/hooks/check_propose_discipline.sh +116 -29
- package/ds-canonical/hooks/check_propose_pre_grep_verify.sh +6 -4
- package/ds-canonical/hooks/check_propose_without_benchmark.sh +10 -6
- package/ds-canonical/hooks/check_select_all_canonical.sh +1 -1
- package/ds-canonical/hooks/check_sidebar_menu_button_implicit_wrap.sh +22 -11
- package/ds-canonical/hooks/check_solo_workflow.sh +117 -186
- package/ds-canonical/hooks/check_spec_class_drift.sh +33 -19
- package/ds-canonical/hooks/check_ssot_header_declaration.sh +6 -5
- package/ds-canonical/hooks/check_story_determinism.sh +1 -1
- package/ds-canonical/hooks/check_story_invariants.sh +526 -213
- package/ds-canonical/hooks/check_storybook_addon_packaging.sh +65 -15
- package/ds-canonical/hooks/check_substantive_edit_approval_preflight.sh +137 -67
- package/ds-canonical/hooks/check_tabs_content_chrome_body_double_gap.sh +52 -23
- package/ds-canonical/hooks/check_tailwind_wildcard_in_docs.sh +20 -13
- package/ds-canonical/hooks/check_wrapper_primitive_schema_drift.sh +15 -12
- package/ds-canonical/hooks/chrome_header_dispatcher.sh +75 -26
- package/ds-canonical/hooks/enforce_home_charter.sh +29 -8
- package/ds-canonical/hooks/governance_control_plane.sh +15 -0
- package/ds-canonical/hooks/inject_deploy_url_after_push.sh +105 -22
- package/ds-canonical/hooks/inject_pending_self_audit.sh +27 -24
- package/ds-canonical/hooks/lib/_app_shell_primary_header_consistency.sh +77 -29
- package/ds-canonical/hooks/lib/_approval_re.sh +5 -6
- package/ds-canonical/hooks/lib/_chrome_header_handcraft.sh +66 -20
- package/ds-canonical/hooks/lib/_code_quality.sh +9 -9
- package/ds-canonical/hooks/lib/_cva_default_sync.sh +11 -13
- package/ds-canonical/hooks/lib/_governance_coverage_check.sh +48 -21
- package/ds-canonical/hooks/lib/_hardcoded_strings.sh +13 -10
- package/ds-canonical/hooks/lib/_header_with_tabs_border.sh +68 -48
- package/ds-canonical/hooks/lib/_hook_integrity.sh +158 -0
- package/ds-canonical/hooks/lib/_layout_space_canonical.sh +5 -5
- package/ds-canonical/hooks/lib/_overlay_handcraft.sh +21 -23
- package/ds-canonical/hooks/lib/_person_data_richness.sh +5 -5
- package/ds-canonical/hooks/lib/_provider_paths.sh +162 -0
- package/ds-canonical/hooks/lib/_story_compile_drift.sh +5 -5
- package/ds-canonical/hooks/lib/_tab_lg_chrome_header_equal.sh +247 -27
- package/ds-canonical/hooks/lib/_token_hygiene.sh +39 -22
- package/ds-canonical/hooks/lib/approval-evidence.mjs +1131 -0
- package/ds-canonical/hooks/lib/audit-report-validator.mjs +118 -0
- package/ds-canonical/hooks/lib/provider-marker-regex.mjs +23 -0
- package/ds-canonical/hooks/lib/tsx-governance-analysis.mjs +410 -0
- package/ds-canonical/hooks/log_governance_fires.sh +45 -13
- package/ds-canonical/hooks/log_skill_invokes.sh +8 -7
- package/ds-canonical/hooks/post_edit_dispatcher.sh +106 -28
- package/ds-canonical/hooks/registrations.json +488 -0
- package/ds-canonical/hooks/registrations.schema.json +58 -0
- package/ds-canonical/hooks/retired/2026-06-11-prune-merge/check_propose_plain_chinese.sh +1 -1
- package/ds-canonical/hooks/retired/check_governance_compliance.sh +1 -1
- package/ds-canonical/hooks/session_start_governance_check.sh +109 -78
- package/ds-canonical/hooks/stop_audit_content_quality.sh +20 -0
- package/ds-canonical/hooks/stop_extract_canonical_rules.sh +20 -0
- package/ds-canonical/hooks/stop_passive_logging.sh +133 -59
- package/ds-canonical/hooks/stop_self_audit.sh +349 -210
- package/ds-canonical/hooks/tests/fixtures/transcripts/claude-transcript-jsonl-v1.jsonl +3 -0
- package/ds-canonical/hooks/tests/fixtures/transcripts/claude-transcript-jsonl-v2.jsonl +3 -0
- package/ds-canonical/hooks/tests/registration-output-contracts.mjs +151 -0
- package/ds-canonical/hooks/tests/run-all.sh +35 -5
- package/ds-canonical/hooks/tests/test_auto_regen_ds_barrel.sh +48 -4
- package/ds-canonical/hooks/tests/test_block_prototype_imports.sh +157 -9
- package/ds-canonical/hooks/tests/test_check_app_shell_primary_header_consistency.sh +265 -127
- package/ds-canonical/hooks/tests/test_check_audit_post_report_validator.sh +119 -12
- package/ds-canonical/hooks/tests/test_check_audit_sample_escape.sh +0 -0
- package/ds-canonical/hooks/tests/test_check_benchmark_citation.sh +0 -0
- package/ds-canonical/hooks/tests/test_check_canonical_propagation.sh +56 -5
- package/ds-canonical/hooks/tests/test_check_chrome_header_avatar_canonical.sh +6 -6
- package/ds-canonical/hooks/tests/test_check_chrome_header_handcraft.sh +193 -100
- package/ds-canonical/hooks/tests/test_check_codex_brief_invariants.sh +143 -17
- package/ds-canonical/hooks/tests/test_check_codex_collab_5step.sh +49 -5
- package/ds-canonical/hooks/tests/test_check_consumer_app_invariants.sh +128 -0
- package/ds-canonical/hooks/tests/test_check_consumer_app_story_title.sh +2 -2
- package/ds-canonical/hooks/tests/test_check_consumer_code_quality.sh +64 -0
- package/ds-canonical/hooks/tests/test_check_consumer_ds_primitive_misuse.sh +2 -2
- package/ds-canonical/hooks/tests/test_check_consumer_no_ds_catalog.sh +2 -2
- package/ds-canonical/hooks/tests/test_check_consumer_story_baseline.sh +2 -2
- package/ds-canonical/hooks/tests/test_check_data_table_size_num_to_meta_width.sh +26 -8
- package/ds-canonical/hooks/tests/test_check_datatable_invariants.sh +126 -12
- package/ds-canonical/hooks/tests/test_check_dim_count_drift.sh +13 -8
- package/ds-canonical/hooks/tests/test_check_ds_anchor_preflight.sh +53 -7
- package/ds-canonical/hooks/tests/test_check_dynamic_tailwind_class.sh +3 -3
- package/ds-canonical/hooks/tests/test_check_escape_marker_abuse.sh +17 -7
- package/ds-canonical/hooks/tests/test_check_field_family_invariants.sh +72 -16
- package/ds-canonical/hooks/tests/test_check_file_size_budget.sh +67 -5
- package/ds-canonical/hooks/tests/test_check_fork_user_plugin_install.sh +107 -4
- package/ds-canonical/hooks/tests/test_check_full_story_visual_interaction_sweep.sh +25 -15
- package/ds-canonical/hooks/tests/test_check_header_with_tabs_border.sh +177 -67
- package/ds-canonical/hooks/tests/test_check_item_list_gap.sh +7 -7
- package/ds-canonical/hooks/tests/test_check_layout_space_magic_numbers.sh +2 -2
- package/ds-canonical/hooks/tests/test_check_main_branch_workbench.sh +45 -110
- package/ds-canonical/hooks/tests/test_check_naming_and_abstraction.sh +19 -2
- package/ds-canonical/hooks/tests/test_check_opacity_token_usage.sh +114 -8
- package/ds-canonical/hooks/tests/test_check_orphan_ds_css.sh +38 -22
- package/ds-canonical/hooks/tests/test_check_overlay_open_focus_escape_probe.sh +2 -2
- package/ds-canonical/hooks/tests/test_check_pattern_invariants.sh +68 -6
- package/ds-canonical/hooks/tests/test_check_plugin_fork_health.sh +53 -0
- package/ds-canonical/hooks/tests/test_check_post_main_ssot_propagate.sh +37 -0
- package/ds-canonical/hooks/tests/test_check_propose_cite_required.sh +2 -2
- package/ds-canonical/hooks/tests/test_check_propose_discipline.sh +59 -0
- package/ds-canonical/hooks/tests/test_check_propose_plain_chinese.sh +7 -5
- package/ds-canonical/hooks/tests/test_check_propose_pre_grep_verify.sh +5 -5
- package/ds-canonical/hooks/tests/test_check_propose_without_benchmark.sh +45 -0
- package/ds-canonical/hooks/tests/test_check_sidebar_menu_button_implicit_wrap.sh +5 -5
- package/ds-canonical/hooks/tests/test_check_solo_workflow.sh +183 -105
- package/ds-canonical/hooks/tests/test_check_spec_class_drift.sh +35 -7
- package/ds-canonical/hooks/tests/{test_check_story_anatomy.sh.broken → test_check_story_anatomy.sh} +73 -4
- package/ds-canonical/hooks/tests/{test_check_story_category.sh.broken → test_check_story_category.sh} +82 -2
- package/ds-canonical/hooks/tests/test_check_story_determinism.sh +39 -0
- package/ds-canonical/hooks/tests/test_check_story_invariants.sh +559 -43
- package/ds-canonical/hooks/tests/{test_check_story_name_jargon.sh.broken → test_check_story_name_jargon.sh} +22 -1
- package/ds-canonical/hooks/tests/test_check_storybook_addon_packaging.sh +79 -0
- package/ds-canonical/hooks/tests/test_check_storybook_addon_preset_cjs.sh +2 -2
- package/ds-canonical/hooks/tests/test_check_substantive_edit_approval_preflight.sh +546 -28
- package/ds-canonical/hooks/tests/test_check_tab_lg_chrome_header_equal.sh +180 -98
- package/ds-canonical/hooks/tests/test_check_tabs_content_chrome_body_double_gap.sh +3 -3
- package/ds-canonical/hooks/tests/test_check_tailwind_wildcard_in_docs.sh +2 -2
- package/ds-canonical/hooks/tests/test_check_token_hygiene.sh +63 -15
- package/ds-canonical/hooks/tests/test_check_wrapper_primitive_schema_drift.sh +12 -6
- package/ds-canonical/hooks/tests/test_chrome_header_dispatcher.sh +125 -0
- package/ds-canonical/hooks/tests/test_enforce_home_charter.sh +57 -3
- package/ds-canonical/hooks/tests/test_governance_control_plane.sh +66 -0
- package/ds-canonical/hooks/tests/test_governance_coverage_check.sh +88 -0
- package/ds-canonical/hooks/tests/test_hook_integrity_classification.sh +217 -0
- package/ds-canonical/hooks/tests/test_inject_deploy_url_after_push.sh +85 -2
- package/ds-canonical/hooks/tests/test_inject_pending_self_audit.sh +116 -11
- package/ds-canonical/hooks/tests/test_log_governance_fires.sh +117 -1
- package/ds-canonical/hooks/tests/test_log_skill_invokes.sh +74 -5
- package/ds-canonical/hooks/tests/test_post_edit_dispatcher.sh +234 -77
- package/ds-canonical/hooks/tests/test_provider_peer_symmetry.sh +76 -0
- package/ds-canonical/hooks/tests/test_registration_output_contracts.sh +20 -0
- package/ds-canonical/hooks/tests/test_session_start_governance_check.sh +130 -18
- package/ds-canonical/hooks/tests/test_stop_audit_content_quality.sh +75 -0
- package/ds-canonical/hooks/tests/test_stop_capture_metrics.sh +101 -23
- package/ds-canonical/hooks/tests/test_stop_extract_canonical_rules.sh +75 -0
- package/ds-canonical/hooks/tests/{test_stop_governance_drift_check.sh.broken → test_stop_governance_drift_check.sh} +22 -12
- package/ds-canonical/hooks/tests/test_stop_passive_logging.sh +102 -1
- package/ds-canonical/hooks/tests/test_stop_repository_command_context.sh +38 -0
- package/ds-canonical/hooks/tests/test_stop_self_audit.sh +363 -9
- package/ds-canonical/references/README.md +8 -8
- package/ds-canonical/references/audit-coverage-vs-24-checklist.md +4 -4
- package/ds-canonical/references/build-ui-canonicals.md +3 -3
- package/ds-canonical/references/certified-surfaces.md +46 -15
- package/ds-canonical/references/cva-patterns.md +2 -2
- package/ds-canonical/references/failure-class-registry.json +3 -2
- package/ds-canonical/references/governance-audit-coverage.md +8 -8
- package/ds-canonical/references/naming-conventions.md +1 -1
- package/ds-canonical/references/preflight-gate-baseline.json +210 -3
- package/ds-canonical/references/principle-dim-map.json +15 -9
- package/ds-canonical/references/props-naming.md +1 -1
- package/ds-canonical/references/scenario-definition.md +33 -30
- package/ds-canonical/references/spec-rules.md +1 -1
- package/ds-canonical/references/ssot-consultation.md +3 -3
- package/ds-canonical/references/ssot-index.md +1 -1
- package/ds-canonical/references/story-baseline-registry.json +9 -6
- package/ds-canonical/references/story-baseline-registry.schema.json +145 -0
- package/ds-canonical/references/structural-token-retention.md +1 -1
- package/ds-canonical/references/tailwind-gotchas.md +2 -2
- package/ds-canonical/references/ui-dev-rules.md +1 -1
- package/ds-canonical/rules/README.md +14 -9
- package/ds-canonical/rules/meta-patterns.md +13 -13
- package/ds-canonical/rules/self-verify.md +12 -7
- package/ds-canonical/rules/spec-rules.md +1 -1
- package/ds-canonical/rules/ui-development.md +5 -5
- package/ds-canonical/skills/README.md +27 -15
- package/ds-canonical/skills/bug-fix-rhythm/SKILL.md +14 -7
- package/ds-canonical/skills/canonical-reviewer/SKILL.md +29 -0
- package/ds-canonical/skills/code-quality-audit/SKILL.md +11 -7
- package/ds-canonical/skills/codex-collab/SKILL.md +19 -238
- package/ds-canonical/skills/codex-collab/references/brief-template.md +37 -47
- package/ds-canonical/skills/codex-collab/references/transport.md +38 -57
- package/ds-canonical/skills/codify-corrections/SKILL.md +32 -31
- package/ds-canonical/skills/codify-principle/SKILL.md +33 -32
- package/ds-canonical/skills/component-quality-gate/SKILL.md +13 -13
- package/ds-canonical/skills/component-quality-gate/references/checklist.md +7 -7
- package/ds-canonical/skills/deep-audit-cross-codex/SKILL.md +28 -229
- package/ds-canonical/skills/deep-audit-cross-codex/references/phase-a-workflow.md +36 -131
- package/ds-canonical/skills/deep-audit-cross-codex/references/phase-b-codex-brief.md +33 -187
- package/ds-canonical/skills/deep-audit-cross-codex/references/skill-relationships-antipatterns-benchmarks.md +22 -24
- package/ds-canonical/skills/deep-audit-cross-codex/references/triage-rubric.md +15 -79
- package/ds-canonical/skills/deep-audit-cross-codex/references/upstream-directives-r-mapping.md +24 -23
- package/ds-canonical/skills/delivery-handoff/SKILL.md +14 -8
- package/ds-canonical/skills/design-system-audit/SKILL.md +63 -62
- package/ds-canonical/skills/design-system-audit/references/audit-prompts.md +86 -77
- package/ds-canonical/skills/design-system-audit/references/checkpoints.md +59 -50
- package/ds-canonical/skills/design-system-audit/references/historical-bugs.md +8 -8
- package/ds-canonical/skills/design-system-audit/references/principle-audit-protocol.md +37 -32
- package/ds-canonical/skills/design-system-audit/references/rule-placement.md +39 -38
- package/ds-canonical/skills/ensure-canonical/SKILL.md +36 -34
- package/ds-canonical/skills/governance-health/SKILL.md +26 -22
- package/ds-canonical/skills/governance-status/SKILL.md +30 -0
- package/ds-canonical/skills/independent-review/SKILL.md +37 -0
- package/ds-canonical/skills/independent-review/agents/openai.yaml +4 -0
- package/ds-canonical/skills/independent-review/references/evidence-contract.md +24 -0
- package/ds-canonical/skills/knowledge-prune/SKILL.md +45 -52
- package/ds-canonical/skills/knowledge-prune/references/phase-z-cross-repo-ssot-propagation.md +10 -7
- package/ds-canonical/skills/knowledge-prune/references/prune-dimensions-d5-d10.md +6 -6
- package/ds-canonical/skills/new-component/SKILL.md +18 -12
- package/ds-canonical/skills/new-component/references/new-component-checklist.md +7 -6
- package/ds-canonical/skills/performance-audit/SKILL.md +13 -10
- package/ds-canonical/skills/product-ui-audit/SKILL.md +27 -17
- package/ds-canonical/skills/product-ui-audit/references/audit-checks.md +7 -4
- package/ds-canonical/skills/product-ui-audit/references/report-template.md +30 -26
- package/ds-canonical/skills/propose-options/SKILL.md +1 -1
- package/ds-canonical/skills/prototype/SKILL.md +19 -21
- package/ds-canonical/skills/prototype/references/audit-checks.md +6 -5
- package/ds-canonical/skills/prototype/references/checkpoints.md +26 -17
- package/ds-canonical/skills/prototype/references/ooux-template.md +1 -1
- package/ds-canonical/skills/prototype/references/proposal-template.md +4 -4
- package/ds-canonical/skills/scan-similar-bugs/SKILL.md +22 -21
- package/ds-canonical/skills/story-auto-compile-migrate/SKILL.md +21 -20
- package/ds-canonical/skills/story-writing/SKILL.md +12 -12
- package/ds-canonical/skills/story-writing/references/anatomy-standard.md +1 -1
- package/ds-canonical/skills/story-writing/references/category-templates.md +5 -5
- package/ds-canonical/skills/ux-audit/SKILL.md +12 -9
- package/ds-canonical/skills/visual-audit/SKILL.md +41 -47
- package/ds-canonical/skills/visual-audit/references/audit-architecture.md +7 -7
- package/ds-canonical/skills/visual-audit/references/visual-checklist.md +12 -12
- package/ds-canonical/skills/visual-audit/references/world-class-benchmarks.md +3 -3
- package/ds-canonical/templates/_README.md +6 -7
- package/ds-canonical/templates/consumer-governance.md +78 -0
- package/ds-canonical/templates/dashboard-app.tsx +3 -1
- package/ds-canonical/templates/product-launchers/fork-governance-dispatcher.sh +154 -0
- package/ds-canonical/templates/product-launchers/format-provider-hook-output.mjs +25 -0
- package/ds-canonical/templates/product-launchers/independent-review.mjs +490 -0
- package/ds-canonical/templates/product-launchers/inject_fork_governance_preamble.sh +99 -0
- package/ds-canonical/templates/product-launchers/normalize-provider-event.mjs +355 -0
- package/ds-canonical/templates/product-launchers/product-hook-dispatch-runtime.mjs +1067 -0
- package/ds-canonical/templates/product-provider-wiring.json +80 -0
- package/ds-canonical/templates/product-provider-wiring.schema.json +151 -0
- package/llms-full.txt +6 -6
- package/llms.txt +2 -2
- package/package.json +15 -4
- package/src/tokens/utility-registry.json +119 -4
- package/src/tokens/utility-registry.schema.json +373 -0
- package/tools/README.md +9 -0
- package/tools/codemods/cli.mjs +93 -0
- package/tools/codemods/index.mjs +582 -0
- package/tools/shared/safe-filesystem.mjs +371 -0
- package/tools/visual-baseline/cli.mjs +97 -0
- package/tools/visual-baseline/index.mjs +522 -0
- /package/dist/{react-day-picker.css → index.css} +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-quality-audit
|
|
3
|
+
description: Clean code 量化稽核 — `any` 使用 / dead export / file size / long function / circular dep / magic number。補 `/design-system-audit` 只管「design canonical」的缺口。Invoke via /code-quality-audit scope=all(release / 季度)OR scope=changed(daily)OR scope=component:X(focused)。Auto-chain by `/design-system-audit --deep` Dim 27 + `/component-quality-gate` Ship phase + `/new-component` Phase 4.5。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- _generated: canonical provider skill projection; source: skills/code-quality-audit/SKILL.md; provider: codex; do not edit this adapter view. -->
|
|
7
|
+
|
|
8
|
+
> **Product-role projection(build 自動)**:本 skill 的執行步驟已只保留本 product repo 實際存在的指令。DS-author-only executor 會被改寫為 browser/manual/product-CI 等價驗證,不得在 product 中嘗試不存在的腳本。
|
|
9
|
+
|
|
10
|
+
# Code Quality Audit — Clean Code 量化稽核
|
|
11
|
+
|
|
12
|
+
Scope:**tsx / ts code hygiene**,跟 design canonical 正交。
|
|
13
|
+
|
|
14
|
+
## 為什麼要這 skill
|
|
15
|
+
|
|
16
|
+
`/design-system-audit`(全 dim per design-system-audit SSOT)管 design / spec / canonical correctness。但 **clean code 面向**(`any` 濫用 / dead export / 函式爆長 / circular dep / 檔案超標)**無任何 dim 覆蓋**。每次建元件 / audit / ship 都該跑這層。
|
|
17
|
+
|
|
18
|
+
## 6 個 check
|
|
19
|
+
|
|
20
|
+
| # | Check | Severity | 如何判定 |
|
|
21
|
+
|---|-------|---------|---------|
|
|
22
|
+
| 1 | `any` 使用 | P0 | grep `: any` / `as any` / `<any>` / `any[]` / `Record<X, any>`;支援 `// any-allow: {rationale}` 逃生口(同行或上一行) |
|
|
23
|
+
| 2 | File size(.tsx)| P0 > 800 / P1 > 500 | `wc -l`;budget 500 / transition cap 800(tsx SSOT = `npm run typecheck && npm run build && npm run governance:check` + the installed immutable governance checker;the installed immutable governance checker 僅管治理 md,數字精神一致非同一 policy)|
|
|
24
|
+
| 3 | Long function | P1 > 80 行 | naive:`function`/`const` 宣告到 matching `}` indent 行距 |
|
|
25
|
+
| 4 | Dead export | P1 | `export` 名稱在其他 src/ 檔無出現;exempt `*Props/Options/Config/Args/Context/Variants/Value` 型別 API 慣例 |
|
|
26
|
+
| 5 | Circular dep | P0 | DFS import graph,找 cycle |
|
|
27
|
+
| 6 | Magic number | P1 | 覆蓋不完整 → 由 token 防線(the installed immutable governance checker + the installed immutable governance checker)層負責(primitive color / shadow / Tailwind v4 `[--foo]`);本 skill 不重複 |
|
|
28
|
+
|
|
29
|
+
## When to run
|
|
30
|
+
|
|
31
|
+
- **Daily**:`/code-quality-audit --scope=changed`(git diff)
|
|
32
|
+
- **Component ship**:`/component-quality-gate` Ship phase auto-chain
|
|
33
|
+
- **New component**:`/new-component` Phase 4.5 auto-chain
|
|
34
|
+
- **Release / 季度**:`/code-quality-audit --scope=all`
|
|
35
|
+
- **Focus one component**:`/code-quality-audit --scope=component:<Name>`
|
|
36
|
+
- **CI gate**:`npm run typecheck && npm run build && npm run governance:check`(P0 violation → exit 1)
|
|
37
|
+
|
|
38
|
+
## Workflow
|
|
39
|
+
|
|
40
|
+
1. Run `npm run typecheck && npm run build && npm run governance:check`
|
|
41
|
+
2. Triage findings into P0 / P1 / P2
|
|
42
|
+
3. Auto-fix trivial(unused imports,trivial `any` casts with obvious type)
|
|
43
|
+
4. 依 shared governance 的 Decision Authority classifier 分類並處理:
|
|
44
|
+
- File-size P0 的 component architectural split、circular-dependency 重組、proper type
|
|
45
|
+
與 long-function remediation 都是工程決策,依 Standing Authorization 自主完成並驗證。
|
|
46
|
+
- 只有修法會改變 public component semantics、產品 workflow、interaction 或其他產品/
|
|
47
|
+
UI/UX SSOT,且證據收斂後仍有真實取捨時,才停下取得 exact target-bound decision。
|
|
48
|
+
- 無法分類時 fail closed 並補 source/evidence/independent review;不得用泛用 user
|
|
49
|
+
approval 代替工程判斷。
|
|
50
|
+
|
|
51
|
+
## 禁止
|
|
52
|
+
|
|
53
|
+
- 禁 silent 吞 `any`(必加 `// any-allow: {rationale}`)
|
|
54
|
+
- Dead export 若只是 implementation residue,依 usage/public-surface evidence 自主移除;若會
|
|
55
|
+
改變 public component semantics,依 authority classifier 判定是否存在真正 UI/UX 取捨。
|
|
56
|
+
- Long function 依 tests、public API 與行為不變證據自主重構;禁無證據硬拆。
|
|
57
|
+
|
|
58
|
+
## Integration points
|
|
59
|
+
|
|
60
|
+
| Skill / Hook | How |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `/design-system-audit` Dim 27 | `--deep` 必 chain 本 skill scope=all |
|
|
63
|
+
| `/component-quality-gate` Ship | chain 本 skill scope=component:{Name} |
|
|
64
|
+
| `/new-component` Phase 4.5 | 元件建完必跑 scope=component:{Name} |
|
|
65
|
+
| Hook the installed immutable governance checker → the installed immutable governance checker | PostToolUse Edit/Write on src/ — 只跑 any + file-size(quick);原 check_code_quality.sh folded(2026-05-13 dispatcher consolidation)|
|
|
66
|
+
|
|
67
|
+
## References
|
|
68
|
+
|
|
69
|
+
- `npm run typecheck && npm run build && npm run governance:check` — 實作
|
|
70
|
+
- the installed immutable governance checker(經 canonical post-edit dispatcher chain)— per-edit lite check
|
|
71
|
+
- 相關:token 防線 the installed immutable governance checker + the installed immutable governance checker(正交 — token 紀律 vs code 紀律)
|
|
@@ -0,0 +1,244 @@
|
|
|
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
|
+
<!-- _generated: canonical provider skill projection; source: skills/delivery-handoff/SKILL.md; provider: codex; do not edit this adapter view. -->
|
|
7
|
+
|
|
8
|
+
> **Product-role projection(build 自動)**:本 skill 的執行步驟已只保留本 product repo 實際存在的指令。DS-author-only executor 會被改寫為 browser/manual/product-CI 等價驗證,不得在 product 中嘗試不存在的腳本。
|
|
9
|
+
|
|
10
|
+
# Delivery Handoff Workflow
|
|
11
|
+
|
|
12
|
+
Purpose: 產品 / feature 通過 prototype → audit → stakeholder 決策後確認 final,需要產 **Figma-like inspectable handoff documentation** 給工程 / PM / QA / 其他 stakeholder。
|
|
13
|
+
|
|
14
|
+
本 skill **不是** prototype 階段文件(那是 `/prototype` 的 notes.md),而是**正式交付包**。
|
|
15
|
+
|
|
16
|
+
## When to run
|
|
17
|
+
|
|
18
|
+
**明確觸發**:
|
|
19
|
+
- User 說「要交付」「handoff」「交付文件」「給 X 團隊的文件」
|
|
20
|
+
- User 說「產品確認要上線了」「final 了做 handoff」「給工程交接」
|
|
21
|
+
- Final decision 已下 + product-ui-audit P0 都修完
|
|
22
|
+
|
|
23
|
+
**不觸發**:
|
|
24
|
+
- Prototype 階段(走 `/prototype`,產 exploration notes)
|
|
25
|
+
- Audit 階段(走 `/product-ui-audit`)
|
|
26
|
+
- DS 本身的 spec 維護(不走任何 skill,直接在 `.spec.md` 編)
|
|
27
|
+
- 要跑 audit 檢查 DS 用對不對 → `/product-ui-audit`
|
|
28
|
+
|
|
29
|
+
## 生態位
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
/prototype → exploration + shortlist
|
|
33
|
+
/product-ui-audit → QA gate
|
|
34
|
+
[stakeholder decides final]
|
|
35
|
+
[P0 fixed, P1 resolved]
|
|
36
|
+
/delivery-handoff ← 本 skill,只在 final confirmed 後
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Preconditions
|
|
40
|
+
|
|
41
|
+
- 產品 / feature 已 final(stakeholder 書面或對話確認)
|
|
42
|
+
- `/product-ui-audit` Zero P0(必要)/ P1 有計畫 resolve(建議)
|
|
43
|
+
- 代碼已 merge 或即將 merge 到 main branch
|
|
44
|
+
- 有明確 **target audience**(給工程? 給 PM? 給設計 review? 給跨團隊交接?)— AI 在 Phase 0 clarify
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 5-Phase Workflow
|
|
49
|
+
|
|
50
|
+
### Phase 0 — Scope & audience
|
|
51
|
+
|
|
52
|
+
**clarify with user**:
|
|
53
|
+
1. 交付**哪個 feature**?(single screen? full flow? 整個 module?)
|
|
54
|
+
2. **給誰**?
|
|
55
|
+
- 工程團隊(實作參考 / QA test case)
|
|
56
|
+
- PM / BA(業務理解 / 邊界 case)
|
|
57
|
+
- 設計 review(世界級評估)
|
|
58
|
+
- 跨團隊(onboarding 他們使用)
|
|
59
|
+
3. **format 需求**:
|
|
60
|
+
- Storybook 原生頁(最推薦)
|
|
61
|
+
- Markdown 可 export PDF
|
|
62
|
+
- Mermaid diagram(UI flow)
|
|
63
|
+
- Screenshot / mockup 用 Storybook render
|
|
64
|
+
|
|
65
|
+
### Phase 1 — Inventory 生成
|
|
66
|
+
|
|
67
|
+
**Deterministic 源優先(2026-07-07 治理進化收尾:本 skill 原「幾乎零機械依賴」列冊補強)**:
|
|
68
|
+
- Component / story 母集 = `inspect the installed package public exports and shipped stories` 產出的 manifest(禁憑記憶列)
|
|
69
|
+
- Token 使用 = `rg -o -- '--[a-z][a-z0-9-]*' <feature files> | sort | uniq -c`(機械計數,非印象;字元類含 0-9 — DS token 名 46% 含數字如 `--chart-1`/`--black-a02`,缺數字會截斷合併成假 key)
|
|
70
|
+
- 消費統計交叉驗 `search product token usage and compare it with the installed token documentation` 的消費通道邏輯(同一套 5 通道定義)
|
|
71
|
+
|
|
72
|
+
scan 目標 feature 的 code,自動 inventory:
|
|
73
|
+
|
|
74
|
+
1. **Component 清單**(哪些 DS 元件被此 feature 消費):
|
|
75
|
+
```
|
|
76
|
+
| Component | Count | Consumer files |
|
|
77
|
+
|-----------|-------|----------------|
|
|
78
|
+
| Button | 12 | Checkout.tsx, Summary.tsx, ... |
|
|
79
|
+
| Dialog | 2 | Confirm.tsx, Edit.tsx |
|
|
80
|
+
| Empty | 1 | NoItems.tsx |
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
2. **Token 使用報告**:
|
|
84
|
+
```
|
|
85
|
+
| Token | Usage | Files |
|
|
86
|
+
|-------|-------|-------|
|
|
87
|
+
| --primary | 8 hits | ... |
|
|
88
|
+
| --fg-secondary | 14 hits | ... |
|
|
89
|
+
| --error | 3 hits | ... |
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
3. **Layout primitives 消費**: Empty / item-layout / overlay-surface / ScrollArea / AspectRatio 各幾次。
|
|
93
|
+
|
|
94
|
+
4. **A11y checklist**(先掃再人工 review):
|
|
95
|
+
- aria-label 齊全
|
|
96
|
+
- role / keyboard
|
|
97
|
+
- Dialog title
|
|
98
|
+
- color contrast(此層 AI 報 visible,人工 review 判 final)
|
|
99
|
+
|
|
100
|
+
### Phase 2 — UI flow 圖生成
|
|
101
|
+
|
|
102
|
+
用 **Mermaid** 產 flow(Storybook 支援 render,也可 export PDF)。
|
|
103
|
+
|
|
104
|
+
範本:
|
|
105
|
+
|
|
106
|
+
```mermaid
|
|
107
|
+
flowchart TD
|
|
108
|
+
Start([進入 Checkout]) --> Review[結帳 Review]
|
|
109
|
+
Review -->|修改| Edit[編輯 Cart Dialog]
|
|
110
|
+
Edit --> Review
|
|
111
|
+
Review -->|確認| Payment[付款方式 Step]
|
|
112
|
+
Payment -->|信用卡| Card[Card Form]
|
|
113
|
+
Payment -->|轉帳| Bank[Bank Instructions]
|
|
114
|
+
Card --> Confirm[確認 Dialog]
|
|
115
|
+
Bank --> Confirm
|
|
116
|
+
Confirm -->|確定| Success([訂單成立])
|
|
117
|
+
Confirm -->|取消| Review
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
AI 根據 code(route / onClick / navigation)auto-generate,並以 source/readback 驗證。
|
|
121
|
+
若 flow 可由既有 requirement 與實作唯一重建,直接修正 evidence drift;只有仍存在會改變
|
|
122
|
+
產品/UI/UX SSOT 的真實 flow 取捨才 P2H。
|
|
123
|
+
|
|
124
|
+
### Phase 3 — Per-screen spec sheet
|
|
125
|
+
|
|
126
|
+
每個 screen / modal / flow step 一頁 spec(Storybook 的 Handoff story,或 Markdown 章節):
|
|
127
|
+
|
|
128
|
+
```markdown
|
|
129
|
+
## Screen: Checkout Review
|
|
130
|
+
|
|
131
|
+
**Storybook**: `Features/Checkout/Review`
|
|
132
|
+
**File**: `src/app/features/checkout/Review.tsx`
|
|
133
|
+
|
|
134
|
+
### 用途
|
|
135
|
+
使用者進入結帳後,第一屏預覽購物車 + 小計 + 折扣碼輸入。
|
|
136
|
+
|
|
137
|
+
### 主要元件
|
|
138
|
+
- DataTable(訂單 items)
|
|
139
|
+
- Input(折扣碼)
|
|
140
|
+
- Button(套用)
|
|
141
|
+
- Dialog(編輯 item 彈出)
|
|
142
|
+
- Empty(購物車空狀態)
|
|
143
|
+
|
|
144
|
+
### States
|
|
145
|
+
- **default**: 載入後正常顯示(≥1 item)
|
|
146
|
+
- **empty**: 購物車無 item — 顯示 Empty 元件 + 「回去繼續購物」CTA
|
|
147
|
+
- **error**: 折扣碼無效 — Input error state + Alert 說明
|
|
148
|
+
|
|
149
|
+
### Interactions
|
|
150
|
+
- 點擊 item → open Edit Dialog
|
|
151
|
+
- 輸入 discount → debounce 500ms → auto-validate
|
|
152
|
+
- 按 Apply → post /discount API
|
|
153
|
+
|
|
154
|
+
### A11y
|
|
155
|
+
- ✓ 所有 icon-only 有 aria-label
|
|
156
|
+
- ✓ Dialog 有 title + description
|
|
157
|
+
- ✓ keyboard 可 tab 所有互動
|
|
158
|
+
- ✓ color contrast 通過 WCAG AA
|
|
159
|
+
|
|
160
|
+
### 邊界 case
|
|
161
|
+
- 折扣碼已套用:顯示 "已套用 {code}",Apply Button 變 Clear
|
|
162
|
+
- 網路錯誤:顯示 Alert + retry button
|
|
163
|
+
- 折扣超過總額:capped 折扣 = 總額,顯示說明
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Phase 4 — Handoff Storybook page
|
|
167
|
+
|
|
168
|
+
在 Storybook 建立 `Features/{Feature}/Handoff` page,內含:
|
|
169
|
+
|
|
170
|
+
- **Overview**: feature 一句話重述
|
|
171
|
+
- **UI Flow**: Mermaid diagram(Storybook 支援 render)
|
|
172
|
+
- **Inventory**: 元件 / token / a11y 報告
|
|
173
|
+
- **Screens**: 每個 screen 可點進去的 story link + inline preview
|
|
174
|
+
- **Spec table**: per-screen spec 嵌入
|
|
175
|
+
|
|
176
|
+
Storybook title: `Features/{FeatureName}/Handoff`
|
|
177
|
+
|
|
178
|
+
此 page 就是「Figma-like 的 inspectable 交付」— stakeholder 打開就看到全景。
|
|
179
|
+
|
|
180
|
+
### Checkpoint — Handoff evidence/readback receipt
|
|
181
|
+
|
|
182
|
+
Phase 4 產出後記錄並驗證:
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
📦 Handoff Package Ready
|
|
186
|
+
|
|
187
|
+
Scope: {feature}
|
|
188
|
+
Audience: {engineering / PM / designer / cross-team}
|
|
189
|
+
Package:
|
|
190
|
+
- Storybook page: Features/{Feature}/Handoff
|
|
191
|
+
- Inventory: {N components / M tokens}
|
|
192
|
+
- UI Flow: Mermaid diagram ({N nodes})
|
|
193
|
+
- Spec sheets: {N screens}
|
|
194
|
+
- A11y checklist: {N passed / M needs review}
|
|
195
|
+
|
|
196
|
+
Export formats:
|
|
197
|
+
- Storybook URL: {link}
|
|
198
|
+
- Markdown(可 export PDF): {path}
|
|
199
|
+
|
|
200
|
+
Readback:
|
|
201
|
+
- requirement/source coverage: {complete / findings}
|
|
202
|
+
- links/screens/states/a11y evidence: {verified / findings}
|
|
203
|
+
- audience binding: {source / exact requirement}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
可由 requirement、source、tests 與既有 audience 唯一判定的 finding 由 agent 自主修正並
|
|
207
|
+
繼續。只有 handoff 揭露新的產品/UI/UX outcomes 取捨,或對外分享會構成無法從既有
|
|
208
|
+
requirement 推導的 business commitment,才停在 shared governance 定義的 human-only
|
|
209
|
+
boundary;handoff milestone 本身不是 user engineering-approval gate。
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 世界級 handoff 標準(reference)
|
|
214
|
+
|
|
215
|
+
本 skill 對標:
|
|
216
|
+
- **Figma Dev Mode** — inspectable 元件 + token + spacing
|
|
217
|
+
- **Zeplin** — per-screen spec + asset export
|
|
218
|
+
- **Shopify Polaris Pattern pages** — 完整 flow + usage + edge cases
|
|
219
|
+
- **Material Design Showcase** — UI + spec + code sample 三欄
|
|
220
|
+
|
|
221
|
+
我們的 Storybook handoff page 整合上述 3 個 tool 的優勢到一頁。
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Non-goals
|
|
226
|
+
|
|
227
|
+
- 不替代工程 code review(本 skill 是 **設計 handoff**,不是 code 品質審核)
|
|
228
|
+
- 不寫實作 / fix bug(已經 audit 過,final 了才 invoke 本 skill)
|
|
229
|
+
- 不生成業務需求文件(那是 PM 職責)
|
|
230
|
+
- 不管 release scheduling / branching strategy(那是 DevOps)
|
|
231
|
+
|
|
232
|
+
## Common failure modes
|
|
233
|
+
|
|
234
|
+
- **Audience 不清**: user 說「要 handoff」但沒說給誰 → Phase 0 必 clarify,否則 format 錯
|
|
235
|
+
- **UI flow 過度簡化**: flow 圖少 error path / loading / edge case → 讓 handoff 失真
|
|
236
|
+
- **Component inventory 漏掉 hidden consumption**:e.g., 內部某 function 呼叫 Toast → 需 grep 所有 imports
|
|
237
|
+
- **A11y checklist 自動判 pass**:checklist 只能「visible hits」,color contrast / keyboard 實測需人工
|
|
238
|
+
- **Spec sheet 寫成 code comment 複製**:spec 應該是 design 語言而非 code 描述,翻譯為 UX 詞彙
|
|
239
|
+
|
|
240
|
+
## References
|
|
241
|
+
|
|
242
|
+
- [references/handoff-template.md](references/handoff-template.md) — Storybook Handoff page 結構 + Markdown spec 範本
|
|
243
|
+
- [references/flow-diagram.md](references/flow-diagram.md) — Mermaid UI flow 指引 + 世界級 reference
|
|
244
|
+
- [references/inventory-checklist.md](references/inventory-checklist.md) — 元件 / token / a11y 清單 + grep pattern
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Flow Diagram — Mermaid UI Flow 指引
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## 為什麼用 Mermaid
|
|
6
|
+
|
|
7
|
+
- **Text-based**:可 git diff / review / version control
|
|
8
|
+
- **Storybook 支援**:`mdx` 可直接 render;純 `tsx` story 用 `<pre>` 包 mermaid source + 指引
|
|
9
|
+
- **世界級工具支援**:GitHub / Notion / GitLab / Confluence 都 render
|
|
10
|
+
- **Export**:可 export PNG / SVG / PDF 交付給不進 Storybook 的 stakeholder
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 基本語法
|
|
15
|
+
|
|
16
|
+
### flowchart(最常用)
|
|
17
|
+
|
|
18
|
+
```mermaid
|
|
19
|
+
flowchart TD
|
|
20
|
+
Start([使用者進入 checkout]) --> Cart[Cart Review]
|
|
21
|
+
Cart -->|修改| Edit[Edit Item Dialog]
|
|
22
|
+
Edit --> Cart
|
|
23
|
+
Cart -->|確認| Pay[Payment Step]
|
|
24
|
+
Pay -->|信用卡| Card[Card Form]
|
|
25
|
+
Pay -->|轉帳| Bank[Bank Info]
|
|
26
|
+
Card --> Confirm[Confirm Dialog]
|
|
27
|
+
Bank --> Confirm
|
|
28
|
+
Confirm -->|下單| Success([訂單成立])
|
|
29
|
+
Confirm -->|取消| Cart
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Nodes:
|
|
33
|
+
- `[Text]` = rectangle(主 screen / modal)
|
|
34
|
+
- `([Text])` = stadium(流程起點 / 終點)
|
|
35
|
+
- `{Text}` = rhombus(決策點)
|
|
36
|
+
- `((Text))` = circle(特殊節點,如 async operation)
|
|
37
|
+
|
|
38
|
+
Edges:
|
|
39
|
+
- `-->` arrow
|
|
40
|
+
- `-->|label|` arrow with label(e.g., 條件)
|
|
41
|
+
- `-.->` dashed(非主路徑 / optional)
|
|
42
|
+
- `==>` thick(強調 / primary 路徑)
|
|
43
|
+
|
|
44
|
+
### sequenceDiagram(互動時序)
|
|
45
|
+
|
|
46
|
+
```mermaid
|
|
47
|
+
sequenceDiagram
|
|
48
|
+
User->>UI: 點「套用」
|
|
49
|
+
UI->>API: POST /discount
|
|
50
|
+
API-->>UI: 200 + discount data
|
|
51
|
+
UI->>UI: 更新 state
|
|
52
|
+
UI-->>User: 顯示「已套用」
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
適合:非同步互動 / API 時序 / 多 actor 流程。
|
|
56
|
+
|
|
57
|
+
### stateDiagram(狀態機)
|
|
58
|
+
|
|
59
|
+
```mermaid
|
|
60
|
+
stateDiagram-v2
|
|
61
|
+
[*] --> Idle
|
|
62
|
+
Idle --> Loading: click apply
|
|
63
|
+
Loading --> Applied: 200
|
|
64
|
+
Loading --> Error: 4xx/5xx
|
|
65
|
+
Applied --> Idle: click clear
|
|
66
|
+
Error --> Idle: dismiss
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
適合:元件 / feature 的狀態機(idle / loading / success / error)。
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 世界級 reference
|
|
74
|
+
|
|
75
|
+
對標世界級設計 handoff 的 flow 品質:
|
|
76
|
+
|
|
77
|
+
- **Shopify Polaris Pattern pages**: 每 pattern 有 `flow` section 用 SVG,我們用 Mermaid
|
|
78
|
+
- **Material Design Guidelines**: 流程圖 + 截圖並列
|
|
79
|
+
- **Stripe Documentation**: Payment Flow 用 Mermaid + inline code
|
|
80
|
+
- **Figma Design Process blog posts**: Journey map + flow 混合
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 原則
|
|
85
|
+
|
|
86
|
+
### 1. 一張圖涵蓋一個 feature,不超過 20 個 nodes
|
|
87
|
+
|
|
88
|
+
> 20+ nodes → 拆成多個 sub-flow diagram。
|
|
89
|
+
|
|
90
|
+
### 2. 標示 **error path**(非 happy path)
|
|
91
|
+
|
|
92
|
+
> 只畫 happy path = handoff 失真。user 也要知道錯誤 / 邊界 case 流向何處。
|
|
93
|
+
|
|
94
|
+
### 3. 決策點標清楚
|
|
95
|
+
|
|
96
|
+
> 用 `-->|label|` 寫條件,避免邊無敘述。
|
|
97
|
+
|
|
98
|
+
### 4. Start / End 用 stadium node
|
|
99
|
+
|
|
100
|
+
> `([Start])` / `([End])` 讓讀者知道邊界。
|
|
101
|
+
|
|
102
|
+
### 5. 搭配 spec sheet 引用
|
|
103
|
+
|
|
104
|
+
> Node text 應對應 spec sheet 的 screen / modal 名稱,讀者一眼看出對應。
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 範本 — Checkout 完整 flow
|
|
109
|
+
|
|
110
|
+
```mermaid
|
|
111
|
+
flowchart TD
|
|
112
|
+
Start([進入 /checkout]) --> AuthCheck{已登入?}
|
|
113
|
+
AuthCheck -->|否| Login[Login Screen]
|
|
114
|
+
Login --> Start
|
|
115
|
+
AuthCheck -->|是| CartCheck{購物車有 item?}
|
|
116
|
+
CartCheck -->|否| Empty[Empty Cart Screen]
|
|
117
|
+
Empty -->|回去購物| End1([exit to /products])
|
|
118
|
+
CartCheck -->|是| Review[Cart Review Screen]
|
|
119
|
+
|
|
120
|
+
Review -->|點 item| Edit[Edit Item Dialog]
|
|
121
|
+
Edit -->|save| Review
|
|
122
|
+
Edit -->|cancel| Review
|
|
123
|
+
|
|
124
|
+
Review -->|輸入折扣| Discount{折扣有效?}
|
|
125
|
+
Discount -->|否| DiscountError[顯示 error]
|
|
126
|
+
DiscountError --> Review
|
|
127
|
+
Discount -->|是| Review
|
|
128
|
+
|
|
129
|
+
Review -->|下一步| Payment[Payment Selection]
|
|
130
|
+
Payment -->|信用卡| CardForm[Card Form]
|
|
131
|
+
Payment -->|轉帳| BankInfo[Bank Instructions]
|
|
132
|
+
Payment -->|超商| StoreInfo[Store Instructions]
|
|
133
|
+
|
|
134
|
+
CardForm --> Validate{valid?}
|
|
135
|
+
Validate -->|否| CardError[Inline errors]
|
|
136
|
+
CardError --> CardForm
|
|
137
|
+
Validate -->|是| Confirm[Confirm Dialog]
|
|
138
|
+
|
|
139
|
+
BankInfo --> Confirm
|
|
140
|
+
StoreInfo --> Confirm
|
|
141
|
+
|
|
142
|
+
Confirm -->|確認下單| Submit[POST /order]
|
|
143
|
+
Submit --> SubmitCheck{success?}
|
|
144
|
+
SubmitCheck -->|是| Success([訂單成立 / 跳 /orders/:id])
|
|
145
|
+
SubmitCheck -->|否| RetryToast[Toast: 請稍後再試]
|
|
146
|
+
RetryToast --> Confirm
|
|
147
|
+
|
|
148
|
+
Confirm -->|取消| Payment
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Edge case 節點命名慣例
|
|
154
|
+
|
|
155
|
+
- `XxxError` = 錯誤狀態(顯示 Alert / Notice)
|
|
156
|
+
- `XxxEmpty` = 空狀態(顯示 Empty 元件)
|
|
157
|
+
- `XxxLoading` = 載入中
|
|
158
|
+
- `XxxRetry` = 可重試狀態
|
|
159
|
+
- `XxxSkipped` = 跳過(optional flow)
|
|
160
|
+
|
|
161
|
+
讓讀者一眼看出節點是 happy 還是 edge。
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 集成 Storybook
|
|
166
|
+
|
|
167
|
+
Storybook 8+ 支援 MDX,可直接寫 mermaid code block:
|
|
168
|
+
|
|
169
|
+
````mdx
|
|
170
|
+
# Checkout Flow
|
|
171
|
+
|
|
172
|
+
```mermaid
|
|
173
|
+
flowchart TD
|
|
174
|
+
Start --> End
|
|
175
|
+
```
|
|
176
|
+
````
|
|
177
|
+
|
|
178
|
+
純 tsx story 可用 `<pre>{mermaidSource}</pre>` + 外部 render tool,或用 `mermaid.js` npm lib runtime render。
|
|
179
|
+
|
|
180
|
+
一般推薦 MDX 方式,Storybook 原生支援。
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Handoff Template — Storybook page + Markdown spec
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Storybook Handoff Page 結構
|
|
6
|
+
|
|
7
|
+
位置: `src/app/features/{feature-slug}/{feature-slug}.handoff.stories.tsx`
|
|
8
|
+
|
|
9
|
+
Title: `Features/{Feature Name}/Handoff`
|
|
10
|
+
|
|
11
|
+
每個 handoff page 5 個 story(5 tab):
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
const meta: Meta = {
|
|
15
|
+
title: 'Features/Checkout/Handoff',
|
|
16
|
+
parameters: { layout: 'fullscreen' },
|
|
17
|
+
}
|
|
18
|
+
export default meta
|
|
19
|
+
|
|
20
|
+
export const Overview: Story = {
|
|
21
|
+
name: '0. Overview',
|
|
22
|
+
render: () => <OverviewPage />,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const UIFlow: Story = {
|
|
26
|
+
name: '1. UI Flow',
|
|
27
|
+
render: () => <FlowDiagram />, // Mermaid render
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const Inventory: Story = {
|
|
31
|
+
name: '2. Inventory',
|
|
32
|
+
render: () => <InventoryTables />, // Component / Token / a11y
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const Screens: Story = {
|
|
36
|
+
name: '3. Screens',
|
|
37
|
+
render: () => <ScreenGrid />, // 每 screen 的 preview + link
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const SpecSheets: Story = {
|
|
41
|
+
name: '4. Spec Sheets',
|
|
42
|
+
render: () => <SpecTabs />, // per-screen detail
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Per-screen Markdown Spec 範本
|
|
49
|
+
|
|
50
|
+
每 screen 一份,組合為完整 feature 的 spec sheet:
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
# Screen: {Name}
|
|
54
|
+
|
|
55
|
+
**Storybook**: `Features/{Feature}/{Screen}`
|
|
56
|
+
**Source**: `src/app/features/{slug}/{Screen}.tsx`
|
|
57
|
+
**Route**: `/{path}`
|
|
58
|
+
|
|
59
|
+
## 用途(Why)
|
|
60
|
+
|
|
61
|
+
{1-2 sentence 敘述 user 會在此頁做什麼}
|
|
62
|
+
|
|
63
|
+
## 進入條件(Entry conditions)
|
|
64
|
+
|
|
65
|
+
- {e.g., 已登入 + 購物車有 ≥1 item}
|
|
66
|
+
- {e.g., 付款方式已選擇}
|
|
67
|
+
|
|
68
|
+
## 主要元件(Components used)
|
|
69
|
+
|
|
70
|
+
| Component | Count | Purpose |
|
|
71
|
+
|-----------|-------|---------|
|
|
72
|
+
| Button | 3 | CTA + 次要 action |
|
|
73
|
+
| Input | 1 | 折扣碼輸入 |
|
|
74
|
+
| ... | | |
|
|
75
|
+
|
|
76
|
+
## 狀態(States)
|
|
77
|
+
|
|
78
|
+
### default
|
|
79
|
+
{正常載入後的畫面描述 + 截圖}
|
|
80
|
+
|
|
81
|
+
### empty
|
|
82
|
+
{無資料時的 fallback}
|
|
83
|
+
|
|
84
|
+
### error
|
|
85
|
+
{錯誤情境處理}
|
|
86
|
+
|
|
87
|
+
### loading
|
|
88
|
+
{載入中 skeleton / spinner}
|
|
89
|
+
|
|
90
|
+
## 互動(Interactions)
|
|
91
|
+
|
|
92
|
+
| Action | Element | Result |
|
|
93
|
+
|--------|---------|--------|
|
|
94
|
+
| 點 Apply | Button | POST /discount |
|
|
95
|
+
| 按 Esc | 任何 Dialog | 關閉 |
|
|
96
|
+
| ... | | |
|
|
97
|
+
|
|
98
|
+
## A11y
|
|
99
|
+
|
|
100
|
+
- ✓ icon-only 元件均有 aria-label
|
|
101
|
+
- ✓ Dialog 有 DialogTitle + DialogDescription
|
|
102
|
+
- ✓ keyboard tab order 正確
|
|
103
|
+
- ⚠ {如有未達標項,明列 + 說明}
|
|
104
|
+
|
|
105
|
+
## 邊界(Edge cases)
|
|
106
|
+
|
|
107
|
+
- {e.g., 折扣碼超過總額 → capped}
|
|
108
|
+
- {e.g., 網路斷線 → toast + retry}
|
|
109
|
+
- {e.g., 超過 N items → 分頁}
|
|
110
|
+
|
|
111
|
+
## 業務規則(Business rules)
|
|
112
|
+
|
|
113
|
+
- {e.g., VIP 折扣上限 30%}
|
|
114
|
+
- {e.g., 免運門檻 NT$1000}
|
|
115
|
+
|
|
116
|
+
## Related
|
|
117
|
+
|
|
118
|
+
- Next step: [Screen Y]
|
|
119
|
+
- Alternative: [Screen Z]
|
|
120
|
+
- Design source: [Explorations/ folder](...)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Overview story render 範本
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
function OverviewPage() {
|
|
129
|
+
return (
|
|
130
|
+
<div className="max-w-4xl mx-auto p-8 flex flex-col gap-6">
|
|
131
|
+
<h1 className="text-h1 font-medium">Checkout Feature Handoff</h1>
|
|
132
|
+
<p className="text-body-lg text-fg-secondary">
|
|
133
|
+
使用者從購物車到下單的完整結帳流程。包含 3 screens、4 modals、支援信用卡 / 銀行轉帳 /
|
|
134
|
+
超商付款 3 種付款方式。
|
|
135
|
+
</p>
|
|
136
|
+
|
|
137
|
+
<div className="border-t border-divider pt-6">
|
|
138
|
+
<h2 className="text-h2 font-medium mb-3">Audience</h2>
|
|
139
|
+
<ul className="list-disc pl-5 text-body">
|
|
140
|
+
<li>工程團隊:實作參考 + test case 來源</li>
|
|
141
|
+
<li>QA:邊界 case checklist</li>
|
|
142
|
+
<li>PM:業務規則確認</li>
|
|
143
|
+
</ul>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<div className="border-t border-divider pt-6">
|
|
147
|
+
<h2 className="text-h2 font-medium mb-3">Status</h2>
|
|
148
|
+
<div className="grid grid-cols-3 gap-3">
|
|
149
|
+
<StatCard label="元件消費" value="12" caption="既有 DS" />
|
|
150
|
+
<StatCard label="新元件" value="0" caption="零污染" />
|
|
151
|
+
<StatCard label="A11y" value="✓" caption="WCAG AA" />
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<div className="border-t border-divider pt-6">
|
|
156
|
+
<h2 className="text-h2 font-medium mb-3">Navigation</h2>
|
|
157
|
+
<ul className="list-disc pl-5 text-body">
|
|
158
|
+
<li>Tab 1: UI Flow — Mermaid diagram</li>
|
|
159
|
+
<li>Tab 2: Inventory — 元件 / token / a11y 報告</li>
|
|
160
|
+
<li>Tab 3: Screens — 每 screen preview + link</li>
|
|
161
|
+
<li>Tab 4: Spec Sheets — per-screen detail</li>
|
|
162
|
+
</ul>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 設計原則
|
|
172
|
+
|
|
173
|
+
1. **target audience driven**: 語氣深度因 audience 調整。工程語氣精準 / PM 語氣情境 / 設計語氣對標
|
|
174
|
+
2. **每段可獨立被引用**: per-screen spec 可單獨丟給 team member,不需看其他頁
|
|
175
|
+
3. **不重複 DS spec**: 元件的行為 / variant 由 `components/*/spec.md` owning,handoff 只寫 **feature-level** 使用
|
|
176
|
+
4. **截圖 / preview 是 Storybook render 即可**: 不要 mockup,直接看真實 code 的 output
|
|
177
|
+
5. **Edge case 必寫**: handoff 不寫 edge case = 實作 + QA 會踩坑
|