@xulthekl/team-flow 0.22.4
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/plugins/marketplace.json +20 -0
- package/.agents/skills +1 -0
- package/.claude/always/phase-guard.md +3 -0
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +31 -0
- package/.codex-plugin/plugin.json +45 -0
- package/.codexignore +6 -0
- package/.cursor-plugin/marketplace.json +17 -0
- package/.cursor-plugin/plugin.json +31 -0
- package/.github/copilot-instructions.md +15 -0
- package/.github/dependabot.yml +10 -0
- package/.github/plugin/marketplace.json +42 -0
- package/.github/workflows/ci.yml +98 -0
- package/.github/workflows/hol-plugin-scanner.yml +17 -0
- package/.opencode/INSTALL.md +61 -0
- package/.opencode/plugins/team-flow.js +70 -0
- package/AGENTS.md +280 -0
- package/CHANGELOG.md +635 -0
- package/CONTRIBUTING.md +115 -0
- package/GEMINI.md +14 -0
- package/HANDOFF.md +219 -0
- package/INSTALL.md +810 -0
- package/LICENSE +21 -0
- package/README.md +185 -0
- package/SECURITY.md +37 -0
- package/agents/bug-investigator.md +180 -0
- package/agents/change-split-auditor.md +257 -0
- package/agents/code-reviewer.md +171 -0
- package/agents/cross-change-consistency-checker.md +215 -0
- package/agents/prd-completeness-reviewer.md +197 -0
- package/agents/prototype-builder.md +230 -0
- package/agents/prototype-env-scout.md +156 -0
- package/agents/prototype-reviewer.md +226 -0
- package/assets/icon.svg +6 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +5 -0
- package/dist/parsing/change-parser.d.ts +12 -0
- package/dist/parsing/change-parser.js +54 -0
- package/dist/parsing/requirement-blocks.d.ts +31 -0
- package/dist/parsing/requirement-blocks.js +192 -0
- package/dist/schema/base.d.ts +7 -0
- package/dist/schema/base.js +1 -0
- package/dist/schema/change.d.ts +25 -0
- package/dist/schema/change.js +1 -0
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/spec.d.ts +11 -0
- package/dist/schema/spec.js +1 -0
- package/dist/validation/constants.d.ts +42 -0
- package/dist/validation/constants.js +42 -0
- package/dist/validation/tokenizer.d.ts +17 -0
- package/dist/validation/tokenizer.js +173 -0
- package/dist/validation/types.d.ts +40 -0
- package/dist/validation/types.js +1 -0
- package/dist/validation/validator.d.ts +21 -0
- package/dist/validation/validator.js +489 -0
- package/docs/README_en.md +358 -0
- package/docs/artifact-contract.md +96 -0
- package/docs/decision-points.md +88 -0
- package/docs/e2e-integration-design.md +207 -0
- package/docs/examples/README.md +25 -0
- package/docs/examples/add-dark-mode/README.md +13 -0
- package/docs/examples/add-dark-mode/design.md +49 -0
- package/docs/examples/add-dark-mode/execution-contract.md +56 -0
- package/docs/examples/add-dark-mode/proposal.md +46 -0
- package/docs/examples/add-dark-mode/specs/ui-theme/spec.md +35 -0
- package/docs/examples/add-dark-mode/tasks.md +26 -0
- package/docs/examples/refactor-auth-boundary/README.md +15 -0
- package/docs/examples/refactor-auth-boundary/design.md +41 -0
- package/docs/examples/refactor-auth-boundary/execution-contract.md +61 -0
- package/docs/examples/refactor-auth-boundary/proposal.md +47 -0
- package/docs/examples/refactor-auth-boundary/specs/auth-boundary/spec.md +45 -0
- package/docs/examples/refactor-auth-boundary/tasks.md +25 -0
- package/docs/plans/2026-07-07-fix-batch-design.md +68 -0
- package/docs/plans/2026-07-20-001-refactor-skill-collaboration-protocol-plan.md +128 -0
- package/docs/platform-matrix.md +45 -0
- package/docs/prototype-design-research.md +206 -0
- package/docs/release-checklist.md +96 -0
- package/docs/showcase.html +699 -0
- package/docs/skill-rename-v0.8.0.md +49 -0
- package/docs/state-machine.md +162 -0
- package/gemini-extension.json +6 -0
- package/hooks/hooks-cursor.json +8 -0
- package/hooks/hooks.json +26 -0
- package/hooks/pre-tool-use-guard +116 -0
- package/hooks/session-start +14 -0
- package/llms.txt +51 -0
- package/package.json +48 -0
- package/plugin.json +27 -0
- package/prd/v1/plan.md +443 -0
- package/prd/v1/prd.md +580 -0
- package/scripts/check-update.mjs +91 -0
- package/scripts/check-version-consistency.mjs +345 -0
- package/scripts/ensure-branch.mjs +71 -0
- package/scripts/get-config +31 -0
- package/scripts/guard/checks/artifacts-exist.mjs +36 -0
- package/scripts/guard/checks/contract-current.mjs +33 -0
- package/scripts/guard/checks/contract-fresh.mjs +17 -0
- package/scripts/guard/checks/dp-gate-passed.mjs +35 -0
- package/scripts/guard/checks/dp3-approved.mjs +22 -0
- package/scripts/guard/checks/execution-plan-ready.mjs +40 -0
- package/scripts/guard/checks/execution-reviews-passed.mjs +36 -0
- package/scripts/guard/checks/schema-valid.mjs +63 -0
- package/scripts/guard/checks/specs-merged.mjs +51 -0
- package/scripts/guard/checks/tasks-complete.mjs +31 -0
- package/scripts/guard/checks/tests-passing.mjs +31 -0
- package/scripts/guard/design-token-guard.mjs +237 -0
- package/scripts/guard/guard.mjs +205 -0
- package/scripts/infer-workflow.mjs +136 -0
- package/scripts/install-amazon-q.mjs +9 -0
- package/scripts/install-cline.mjs +9 -0
- package/scripts/install-continue.mjs +9 -0
- package/scripts/install-cursor.mjs +265 -0
- package/scripts/install-git-hooks.mjs +82 -0
- package/scripts/install-kiro.mjs +9 -0
- package/scripts/install-pi.mjs +9 -0
- package/scripts/install-qoder.mjs +9 -0
- package/scripts/install-qwen.mjs +9 -0
- package/scripts/install-roocode.mjs +9 -0
- package/scripts/install-windsurf.mjs +9 -0
- package/scripts/install-zcode.mjs +265 -0
- package/scripts/lib/cmd-audit.mjs +127 -0
- package/scripts/lib/cmd-checkpoint.mjs +118 -0
- package/scripts/lib/cmd-config.mjs +88 -0
- package/scripts/lib/cmd-doctor.mjs +267 -0
- package/scripts/lib/cmd-execution.mjs +206 -0
- package/scripts/lib/cmd-handoff.mjs +94 -0
- package/scripts/lib/cmd-inject.mjs +310 -0
- package/scripts/lib/cmd-install-amazon-q.mjs +11 -0
- package/scripts/lib/cmd-install-cline.mjs +11 -0
- package/scripts/lib/cmd-install-continue.mjs +11 -0
- package/scripts/lib/cmd-install-cursor.mjs +14 -0
- package/scripts/lib/cmd-install-kiro.mjs +11 -0
- package/scripts/lib/cmd-install-pi.mjs +11 -0
- package/scripts/lib/cmd-install-qoder.mjs +11 -0
- package/scripts/lib/cmd-install-qwen.mjs +11 -0
- package/scripts/lib/cmd-install-roocode.mjs +11 -0
- package/scripts/lib/cmd-install-windsurf.mjs +11 -0
- package/scripts/lib/cmd-install-workbuddy.mjs +359 -0
- package/scripts/lib/cmd-install-zcode.mjs +14 -0
- package/scripts/lib/cmd-isolate.mjs +37 -0
- package/scripts/lib/cmd-list.mjs +71 -0
- package/scripts/lib/cmd-runtime.mjs +85 -0
- package/scripts/lib/cmd-solutions.mjs +71 -0
- package/scripts/lib/cmd-state.mjs +231 -0
- package/scripts/lib/cmd-sync.mjs +102 -0
- package/scripts/lib/cmd-validate.mjs +105 -0
- package/scripts/lib/cmd-version.mjs +148 -0
- package/scripts/lib/config-loader.mjs +107 -0
- package/scripts/lib/execution-plan.mjs +492 -0
- package/scripts/lib/execution-recommendation.mjs +221 -0
- package/scripts/lib/hash.mjs +74 -0
- package/scripts/lib/install.mjs +267 -0
- package/scripts/lib/platform-runtime-inventory.mjs +27 -0
- package/scripts/lib/platforms.mjs +165 -0
- package/scripts/lib/prototype-sync.mjs +192 -0
- package/scripts/lib/sdd-overlay.mjs +262 -0
- package/scripts/lib/shell-quote.mjs +4 -0
- package/scripts/lib/solutions-capture.mjs +102 -0
- package/scripts/lib/solutions-index-gen.mjs +112 -0
- package/scripts/lib/solutions-inject.mjs +77 -0
- package/scripts/lib/solutions-promote.mjs +145 -0
- package/scripts/lib/spec-paths.mjs +85 -0
- package/scripts/lib/state-loader.mjs +154 -0
- package/scripts/lint/lint-skills.mjs +149 -0
- package/scripts/lint/rules/behavior-consistency.mjs +56 -0
- package/scripts/lint/rules/dp-trigger-points.mjs +60 -0
- package/scripts/lint/rules/exception-handling.mjs +59 -0
- package/scripts/lint/rules/no-contradictory-instructions.mjs +67 -0
- package/scripts/lint/rules/no-redundant-checks.mjs +50 -0
- package/scripts/lint/rules/token-rules.mjs +122 -0
- package/scripts/review-package +44 -0
- package/scripts/task-brief +40 -0
- package/scripts/team-flow.mjs +164 -0
- package/scripts/token-baseline.mjs +158 -0
- package/scripts/validate-artifacts +96 -0
- package/scripts/verify-marketplace-release.mjs +59 -0
- package/skills/architecture-design/SKILL.md +140 -0
- package/skills/architecture-design/chapters/ch01-4a-domains.md +27 -0
- package/skills/architecture-design/chapters/ch02-change-cascade.md +27 -0
- package/skills/architecture-design/chapters/ch03-architecture-outputs.md +25 -0
- package/skills/architecture-design/chapters/ch04-entity-to-aggregate.md +27 -0
- package/skills/architecture-design/chapters/ch05-cqrs.md +32 -0
- package/skills/architecture-design/chapters/ch06-integration.md +54 -0
- package/skills/architecture-design/cheatsheet.md +51 -0
- package/skills/architecture-design/glossary.md +23 -0
- package/skills/architecture-design/patterns.md +32 -0
- package/skills/bug-investigator/SKILL.md +77 -0
- package/skills/build-executor/SKILL.md +163 -0
- package/skills/build-executor/implementer-prompt.md +162 -0
- package/skills/build-executor/references/execution-modes.md +86 -0
- package/skills/build-executor/task-reviewer-prompt.md +195 -0
- package/skills/ce-brainstorm/SKILL.md +415 -0
- package/skills/ce-brainstorm/references/agents/slack-researcher.md +127 -0
- package/skills/ce-brainstorm/references/blindspot-pass.md +70 -0
- package/skills/ce-brainstorm/references/brainstorm-sections.md +285 -0
- package/skills/ce-brainstorm/references/handoff.md +168 -0
- package/skills/ce-brainstorm/references/html-rendering.md +634 -0
- package/skills/ce-brainstorm/references/markdown-rendering.md +241 -0
- package/skills/ce-brainstorm/references/model-tiers.md +9 -0
- package/skills/ce-brainstorm/references/prd-mapping.md +71 -0
- package/skills/ce-brainstorm/references/product-pressure-test.md +42 -0
- package/skills/ce-brainstorm/references/reasoning-elevation.md +63 -0
- package/skills/ce-brainstorm/references/settled-decisions.md +45 -0
- package/skills/ce-brainstorm/references/synthesis-summary.md +282 -0
- package/skills/ce-brainstorm/references/universal-brainstorming.md +73 -0
- package/skills/ce-brainstorm/references/verdict-routing.md +26 -0
- package/skills/ce-brainstorm/references/visual-probes.md +158 -0
- package/skills/ce-brainstorm/scripts/visual-probe-server.js +418 -0
- package/skills/ce-compound/SKILL.md +114 -0
- package/skills/ce-compound/assets/resolution-template.md +94 -0
- package/skills/ce-compound/references/agents/best-practices-researcher.md +115 -0
- package/skills/ce-compound/references/agents/data-integrity-guardian.md +68 -0
- package/skills/ce-compound/references/agents/framework-docs-researcher.md +93 -0
- package/skills/ce-compound/references/agents/pattern-recognition-specialist.md +55 -0
- package/skills/ce-compound/references/agents/performance-oracle.md +108 -0
- package/skills/ce-compound/references/agents/security-sentinel.md +91 -0
- package/skills/ce-compound/references/agents/session-historian.md +83 -0
- package/skills/ce-compound/references/concepts-vocabulary.md +78 -0
- package/skills/ce-compound/references/full-mode-workflow.md +413 -0
- package/skills/ce-compound/references/grounding-validation.md +84 -0
- package/skills/ce-compound/references/lightweight-mode.md +53 -0
- package/skills/ce-compound/references/output-standards.md +182 -0
- package/skills/ce-compound/references/promotion-rules.md +38 -0
- package/skills/ce-compound/references/schema.yaml +231 -0
- package/skills/ce-compound/references/three-tier-index.md +55 -0
- package/skills/ce-compound/references/v0.5-upgrade.md +32 -0
- package/skills/ce-compound/references/write-flow.md +36 -0
- package/skills/ce-compound/references/yaml-schema.md +118 -0
- package/skills/ce-compound/scripts/session-history/discover-sessions.sh +130 -0
- package/skills/ce-compound/scripts/session-history/extract-errors.py +254 -0
- package/skills/ce-compound/scripts/session-history/extract-metadata.py +456 -0
- package/skills/ce-compound/scripts/session-history/extract-skeleton.py +575 -0
- package/skills/ce-compound/scripts/validate-doc-claims.py +346 -0
- package/skills/ce-compound/scripts/validate-frontmatter.py +137 -0
- package/skills/ce-ideate/SKILL.md +402 -0
- package/skills/ce-ideate/references/agents/issue-intelligence-analyst.md +200 -0
- package/skills/ce-ideate/references/agents/learnings-researcher.md +247 -0
- package/skills/ce-ideate/references/agents/slack-researcher.md +127 -0
- package/skills/ce-ideate/references/agents/web-researcher.md +121 -0
- package/skills/ce-ideate/references/divergent-ideation.md +89 -0
- package/skills/ce-ideate/references/html-rendering.md +634 -0
- package/skills/ce-ideate/references/ideation-sections.md +191 -0
- package/skills/ce-ideate/references/markdown-rendering.md +238 -0
- package/skills/ce-ideate/references/post-ideation-workflow.md +167 -0
- package/skills/ce-ideate/references/universal-ideation.md +107 -0
- package/skills/ce-ideate/references/web-research-cache.md +56 -0
- package/skills/ce-plan/SKILL.md +137 -0
- package/skills/ce-plan/references/agents/agent-native-planning-strategist.md +62 -0
- package/skills/ce-plan/references/agents/architecture-strategist.md +46 -0
- package/skills/ce-plan/references/agents/best-practices-researcher.md +114 -0
- package/skills/ce-plan/references/agents/data-integrity-guardian.md +68 -0
- package/skills/ce-plan/references/agents/data-migration-reviewer.md +103 -0
- package/skills/ce-plan/references/agents/deployment-verification-agent.md +157 -0
- package/skills/ce-plan/references/agents/framework-docs-researcher.md +93 -0
- package/skills/ce-plan/references/agents/git-history-analyzer.md +40 -0
- package/skills/ce-plan/references/agents/learnings-researcher.md +247 -0
- package/skills/ce-plan/references/agents/pattern-recognition-specialist.md +55 -0
- package/skills/ce-plan/references/agents/performance-oracle.md +108 -0
- package/skills/ce-plan/references/agents/repo-research-analyst.md +258 -0
- package/skills/ce-plan/references/agents/security-sentinel.md +91 -0
- package/skills/ce-plan/references/agents/slack-researcher.md +127 -0
- package/skills/ce-plan/references/agents/spec-flow-analyzer.md +80 -0
- package/skills/ce-plan/references/agents/web-researcher.md +121 -0
- package/skills/ce-plan/references/approach-altitude.md +55 -0
- package/skills/ce-plan/references/change-splitting.md +65 -0
- package/skills/ce-plan/references/completion-contract.md +33 -0
- package/skills/ce-plan/references/core-principles.md +40 -0
- package/skills/ce-plan/references/deepening-workflow.md +263 -0
- package/skills/ce-plan/references/dependency-graph.md +36 -0
- package/skills/ce-plan/references/html-rendering.md +634 -0
- package/skills/ce-plan/references/intake-routing.md +189 -0
- package/skills/ce-plan/references/markdown-rendering.md +238 -0
- package/skills/ce-plan/references/plan-handoff.md +150 -0
- package/skills/ce-plan/references/plan-sections.md +427 -0
- package/skills/ce-plan/references/plan-structure.md +120 -0
- package/skills/ce-plan/references/planning-modes.md +69 -0
- package/skills/ce-plan/references/reasoning-elevation.md +63 -0
- package/skills/ce-plan/references/research-workflow.md +165 -0
- package/skills/ce-plan/references/review-and-write.md +127 -0
- package/skills/ce-plan/references/settled-decisions.md +45 -0
- package/skills/ce-plan/references/synthesis-summary.md +418 -0
- package/skills/ce-plan/references/universal-planning.md +168 -0
- package/skills/ce-proof/SKILL.md +346 -0
- package/skills/ce-strategy/SKILL.md +97 -0
- package/skills/ce-strategy/references/interview.md +143 -0
- package/skills/ce-strategy/references/strategy-template.md +89 -0
- package/skills/code-reviewer/SKILL.md +84 -0
- package/skills/code-reviewer/code-reviewer-prompt.md +195 -0
- package/skills/contract-builder/SKILL.md +72 -0
- package/skills/design-system/SKILL.md +75 -0
- package/skills/design-system/references/agents/design-system-architect.md +138 -0
- package/skills/design-system/references/creation-flow.md +170 -0
- package/skills/design-system/references/preview-template.html +319 -0
- package/skills/design-system/references/token-derivation.md +115 -0
- package/skills/design-system/references/variant-schema.md +60 -0
- package/skills/e2e/SKILL.md +56 -0
- package/skills/e2e/references/test-verifier.md +40 -0
- package/skills/need-explorer/SKILL.md +79 -0
- package/skills/prototype/SKILL.md +98 -0
- package/skills/prototype/references/agents/design-system-architect.md +122 -0
- package/skills/prototype/references/checklist.md +82 -0
- package/skills/prototype/references/craft/accessibility-baseline.md +71 -0
- package/skills/prototype/references/craft/anti-ai-slop.md +87 -0
- package/skills/prototype/references/craft/laws-of-ux.md +60 -0
- package/skills/prototype/references/craft/state-coverage.md +81 -0
- package/skills/prototype/references/craft/typography-hierarchy.md +50 -0
- package/skills/prototype/references/layouts.md +223 -0
- package/skills/prototype/references/orchestration-flow.md +101 -0
- package/skills/prototype/references/prototype-scaffold/assets/design-tokens.css +19 -0
- package/skills/prototype/references/prototype-scaffold/components/button.html +3 -0
- package/skills/prototype/references/prototype-scaffold/design-system.md +7 -0
- package/skills/prototype/references/prototype-scaffold/flow.md +11 -0
- package/skills/prototype/references/prototype-scaffold/index.html +20 -0
- package/skills/prototype/references/prototype-scaffold/pages/index.html +11 -0
- package/skills/prototype/references/template.html +396 -0
- package/skills/release-archivist/SKILL.md +166 -0
- package/skills/release-archivist/references/closing-procedures.md +81 -0
- package/skills/session-handoff/SKILL.md +110 -0
- package/skills/session-handoff/references/context-extraction.md +70 -0
- package/skills/session-handoff/references/handoff-template.md +90 -0
- package/skills/session-handoff/references/skill-recommendation.md +43 -0
- package/skills/spec-merger/SKILL.md +66 -0
- package/skills/spec-writer/SKILL.md +149 -0
- package/skills/workflow-bootstrap/SKILL.md +148 -0
- package/skills/workflow-bootstrap/references/agents/codebase-recon-analyst.md +121 -0
- package/skills/workflow-bootstrap/references/b1-reconnaissance.md +80 -0
- package/skills/workflow-bootstrap/scripts/recon-probe.sh +328 -0
- package/skills/workflow-feedback/SKILL.md +120 -0
- package/skills/workflow-feedback/references/category-guide.md +121 -0
- package/skills/workflow-feedback/references/feedback-template.md +73 -0
- package/skills/workflow-feedback/references/review-mode.md +92 -0
- package/skills/workflow-orchestrator/SKILL.md +94 -0
- package/skills/workflow-orchestrator/references/feedback-loops.md +56 -0
- package/skills/workflow-orchestrator/references/s1-path-router.md +81 -0
- package/skills/workflow-orchestrator/references/s2-prd-prototype-loop.md +96 -0
- package/skills/workflow-orchestrator/references/s3-plan-pipeline.md +50 -0
- package/skills/workflow-orchestrator/references/s4-split-validate.md +108 -0
- package/skills/workflow-orchestrator/references/s5-monitoring.md +61 -0
- package/skills/workflow-orchestrator/references/state-model.md +185 -0
- package/skills/workflow-start/SKILL.md +147 -0
- package/skills/workflow-start/references/routing-rules.md +155 -0
- package/src/index.ts +16 -0
- package/src/parsing/change-parser.ts +79 -0
- package/src/parsing/requirement-blocks.ts +244 -0
- package/src/schema/base.ts +8 -0
- package/src/schema/change.ts +29 -0
- package/src/schema/index.ts +3 -0
- package/src/schema/spec.ts +12 -0
- package/src/validation/constants.ts +53 -0
- package/src/validation/tokenizer.ts +180 -0
- package/src/validation/types.ts +47 -0
- package/src/validation/validator.ts +552 -0
- package/templates/abandonment-summary.md +29 -0
- package/templates/design.md +37 -0
- package/templates/execution-contract.md +99 -0
- package/templates/plan.md +86 -0
- package/templates/prd.md +468 -0
- package/templates/proposal.md +37 -0
- package/templates/spec.md +31 -0
- package/templates/tasks.md +47 -0
- package/tests/e2e.test.mjs +266 -0
- package/tests/lib/cmd-audit.test.mjs +202 -0
- package/tests/lib/cmd-checkpoint.test.mjs +98 -0
- package/tests/lib/cmd-config.test.mjs +101 -0
- package/tests/lib/cmd-doctor.test.mjs +450 -0
- package/tests/lib/cmd-execution.test.mjs +647 -0
- package/tests/lib/cmd-handoff.test.mjs +137 -0
- package/tests/lib/cmd-inject.test.mjs +218 -0
- package/tests/lib/cmd-install-workbuddy.test.mjs +113 -0
- package/tests/lib/cmd-install-zcode.test.mjs +42 -0
- package/tests/lib/cmd-isolate.test.mjs +68 -0
- package/tests/lib/cmd-list.test.mjs +127 -0
- package/tests/lib/cmd-runtime.test.mjs +83 -0
- package/tests/lib/cmd-state-missing.test.mjs +65 -0
- package/tests/lib/cmd-state.test.mjs +365 -0
- package/tests/lib/cmd-sync-paths.test.mjs +84 -0
- package/tests/lib/cmd-validate-paths.test.mjs +90 -0
- package/tests/lib/config-loader.test.mjs +175 -0
- package/tests/lib/ensure-branch.test.mjs +59 -0
- package/tests/lib/execution-control-plane.test.mjs +168 -0
- package/tests/lib/execution-plan.test.mjs +474 -0
- package/tests/lib/guard-specs-merged.test.mjs +108 -0
- package/tests/lib/guard-tests-passing.test.mjs +112 -0
- package/tests/lib/guard-transitions.test.mjs +262 -0
- package/tests/lib/guard.test.mjs +611 -0
- package/tests/lib/hash.test.mjs +138 -0
- package/tests/lib/infer-workflow.test.mjs +161 -0
- package/tests/lib/install-git-hooks.test.mjs +20 -0
- package/tests/lib/marketplace-release-docs.test.mjs +31 -0
- package/tests/lib/minimality-discipline.test.mjs +37 -0
- package/tests/lib/model-profiles-docs.test.mjs +33 -0
- package/tests/lib/node20-compatibility.test.mjs +73 -0
- package/tests/lib/node20-test-entry.test.mjs +17 -0
- package/tests/lib/platform-runtime-distribution.test.mjs +150 -0
- package/tests/lib/raw-mode-smoke.test.mjs +42 -0
- package/tests/lib/sdd-overlay.test.mjs +118 -0
- package/tests/lib/spec-paths.test.mjs +80 -0
- package/tests/lib/state-loader.test.mjs +251 -0
- package/tests/lib/token-baseline.test.mjs +72 -0
- package/tests/lib/token-rules.test.mjs +94 -0
- package/tests/lib/verify-marketplace-release.test.mjs +128 -0
- package/tests/tsconfig.json +12 -0
- package/token-baseline.json +95 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: e2e
|
|
3
|
+
description: 从 spec 验收场景生成 Playwright E2E 测试、执行并审计覆盖率(可选 overlay)。用法: /e2e [原型|集成|验收] [spec路径]
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# E2E 测试(AC 驱动黑盒 + Playwright)
|
|
9
|
+
|
|
10
|
+
基于 team-flow v0.4 设计修订第十六章(详见 `docs/e2e-integration-design.md`)。从 spec `#### Scenario:` 派生的验收标准生成 Playwright E2E,执行并审计覆盖率。可选 overlay,不进核心 8 态状态机。
|
|
11
|
+
|
|
12
|
+
## 何时使用
|
|
13
|
+
- 需求迭代需要 UI 层可执行验证:原型期验证 spec 可执行性、集成期验证实际代码。
|
|
14
|
+
- 用户调用 `/e2e [原型|集成|验收] [spec路径]`。
|
|
15
|
+
|
|
16
|
+
## 核心约束
|
|
17
|
+
- **黑盒视角**:只验证输入→输出行为,不依赖实现/DOM 结构;禁止从代码反推测试。
|
|
18
|
+
- **选择器优先级**:`getByRole` > `data-testid` > `id` > `getByLabel` > CSS/XPath(禁用于新测试)。
|
|
19
|
+
- **禁止 `waitForTimeout`**(flaky 源),用 web-first 断言。
|
|
20
|
+
- **被测体**:原型自包含 HTML(http-server 托管)/ 实际 UI 代码;统一 `e2e/` + `playwright.config` `projects`(baseURL) 切换。
|
|
21
|
+
- **Playwright 仅进用户项目,不进插件**(守零依赖)。
|
|
22
|
+
|
|
23
|
+
## 执行流程(5 步)
|
|
24
|
+
1. **确定测试类型**:原型(默认)/ 集成 / 验收 / 未指定则询问。
|
|
25
|
+
2. **AC 提取与分类**:从 spec Scenario(+ 可选 `##### Exception/State/Boundary` 子标签;未打标签时用关键字回退 error/invalid/fail/边界)机械提取 HP/EX/ST/BND,生成 AC 矩阵。质量门禁:总测试数 ≥ AC×1.5。
|
|
26
|
+
3. **测试脚本生成**:调用 `test-verifier` 角色(`references/test-verifier.md`),prompt 含 AC 矩阵 + 黑盒约束 + 分级门禁 + 命名规范 + `@regression-source`/`@last-sync`。
|
|
27
|
+
4. **执行与报告**:跑 Playwright,产出 AC 覆盖率 / 四维覆盖率 / 类型分布 / 未覆盖清单 / 失败根因分类(测试问题 vs 实现问题)。
|
|
28
|
+
5. **覆盖率审计**:按分级门槛判定 BLOCKER/WARNING,未达标回退补充。
|
|
29
|
+
|
|
30
|
+
## AC 分类与公式
|
|
31
|
+
- HP(正向)×1;EX(异常)×2(触发+恢复);ST(状态)×2(合法+非法,去重 EX 覆盖);BND(边界)×1/边界。
|
|
32
|
+
- `Total = HP×1 + EX×2 + ST×2 + BND×1`。
|
|
33
|
+
|
|
34
|
+
## 门禁分级
|
|
35
|
+
| 指标 | 原型期(验证可执行性,静态 mock) | 集成期(实际代码) |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| AC 覆盖率 | ≥ 80%(HP 必测) | ≥ 95% |
|
|
38
|
+
| 异常 EX | 有则测、无则带说明(不阻断) | ≥ 80% |
|
|
39
|
+
| 状态 ST | 有则测、无则带说明(不阻断) | ≥ 90% |
|
|
40
|
+
| 边界 BND | 有则测、无则带说明(不阻断) | ≥ 75% |
|
|
41
|
+
| 阻断级别 | AC<80% = BLOCKER | AC/EX<门槛 = BLOCKER;ST/BND = WARNING |
|
|
42
|
+
|
|
43
|
+
门禁随被测体成熟度递增。未含某维度标签 → 标 `N/A` 不阻断(维度条件触发)。
|
|
44
|
+
|
|
45
|
+
## 产出物
|
|
46
|
+
| 产物 | 路径 |
|
|
47
|
+
|---|---|
|
|
48
|
+
| 测试脚本 | `e2e/`(统一,不放 `prototype/`) |
|
|
49
|
+
| AC 矩阵 | `docs/statistics/AC-coverage-matrix.md` |
|
|
50
|
+
| 测试报告 | `docs/statistics/YYYY-MM-DD-e2e-report.md` |
|
|
51
|
+
|
|
52
|
+
## 复用机制
|
|
53
|
+
单一 `e2e/` + `playwright.config.ts` `projects`(baseURL):`prototype` project → http-server 托管 HTML;`integration` project → 真实应用。脚本一致,仅切地址 + 少量选择器/断言适配(高重叠复用,非零触碰;原型绿 ≠ 集成绿)。
|
|
54
|
+
|
|
55
|
+
## 与 release-archivist 衔接
|
|
56
|
+
e2e 报告 + 4 级制品比对(L1 存在 / L2 实质 / L3 接线 / L4 数据流)作为 closing 验收 gate 的验证维度,由 `release-archivist` 接入(`ce-proof` 是 Proof 编辑器,与此无关)。
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-verifier
|
|
3
|
+
description: E2E 测试验证专家(MVP 子集)。从 spec 验收标准/场景生成 Playwright 测试、执行并报告、制品比对。由 e2e skill 调用。
|
|
4
|
+
tools: Read Write Grep Glob Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 测试验证专家(E2E MVP 子集)
|
|
8
|
+
|
|
9
|
+
从 spec 验收标准/场景生成 Playwright 测试、执行并分析报告。由 `e2e` skill 在第 3 步调用(设计规格第十六章)。
|
|
10
|
+
|
|
11
|
+
## 设计来源
|
|
12
|
+
- gtmc-ea-bpm `test-verifier`(AC 驱动、data-testid 契约、Playwright 生成)
|
|
13
|
+
- spoko.space《AI & Playwright E2E Testing 2026》(选择器优先级、禁 waitForTimeout)
|
|
14
|
+
- gstack QA(E2E 决策矩阵、健康评分思路;MVP 仅保留决策矩阵)
|
|
15
|
+
|
|
16
|
+
## MVP 保留能力
|
|
17
|
+
1. **AC 深度分析**:从 spec 机械提取 HP/EX/ST/BND 四类 AC,生成差距报告(四维覆盖率 + 类型分布)。
|
|
18
|
+
2. **测试生成**:从 GWT 场景 / 验收标准生成 Playwright 测试(data-testid / getByRole 优先)。
|
|
19
|
+
3. **测试执行**:`npx playwright test --reporter=json`;收集通过/失败/跳过 + 失败根因分类(测试问题 vs 实现问题)。
|
|
20
|
+
4. **E2E 决策矩阵**:控制台/JS/逻辑 bug → 单元或集成;表单/API/数据流 → 集成;视觉(JS 行为) → 组件;纯 CSS → 跳过(QA 复测)。
|
|
21
|
+
5. **报告**:AC 覆盖率 / 四维覆盖率 / 类型分布 / 未覆盖清单 / 失败详情(定位 + 原因 + 建议)。
|
|
22
|
+
|
|
23
|
+
## 选择器规范
|
|
24
|
+
- 优先级:`getByRole` > `data-testid` > `id` > `getByLabel` > CSS/XPath(禁用于新测试)。
|
|
25
|
+
- 优先 `data-testid`(动态/hydration 边界);**禁止 `waitForTimeout`**。
|
|
26
|
+
|
|
27
|
+
## 测试脚本规范
|
|
28
|
+
- 命名:场景 `S-{nn}-{slug}.spec.ts` / 页面 `P-{xx}-{slug}.spec.ts`。
|
|
29
|
+
- 结构:`test.describe` + `beforeEach`(导航) + `test('正常路径')` + `test('异常路径')`。
|
|
30
|
+
- 断言:`expect(locator).toBeVisible()/toBeDisabled()/toHaveText()`;页面跳转 `expect(page).toHaveURL()`。
|
|
31
|
+
- 独立运行;`beforeEach` 备数据、测试后清理。
|
|
32
|
+
|
|
33
|
+
## 移交 / DEFER(非 MVP)
|
|
34
|
+
- **4 级制品验证**(L1–L4)→ 移交 `release-archivist`(closing 验收 gate)。
|
|
35
|
+
- **8 维健康评分、每页 7 点视觉走查** → DEFER(归 `prototype-reviewer` 或后续版本)。
|
|
36
|
+
|
|
37
|
+
## 注意事项
|
|
38
|
+
- 你有 Write/Bash 权限,可直接生成测试文件、执行测试。
|
|
39
|
+
- 黑盒:不读实现代码设计用例,基于 spec AC。
|
|
40
|
+
- 健康评分 <60 阻止发布(仅当后续启用完整版时生效)。
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: need-explorer
|
|
3
|
+
description: Change-level requirement exploration, routed by workflow-start within a team-flow change. Clarify intent, scope, constraints, and success criteria before artifact creation. NOT for product-level requirements (use workflow-orchestrator). Invoke only when inside a change context and the request is fuzzy, the user is comparing options, or the workflow needs a stable change definition before writing artifacts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Need Explorer
|
|
7
|
+
|
|
8
|
+
Turn a rough idea into a stable change definition before writing artifacts.
|
|
9
|
+
|
|
10
|
+
## Primary Goal
|
|
11
|
+
|
|
12
|
+
Agree on: problem, scope, non-goals, success criteria, whether to split before specification.
|
|
13
|
+
|
|
14
|
+
## Process
|
|
15
|
+
|
|
16
|
+
### 1. Inspect Context First
|
|
17
|
+
|
|
18
|
+
Before asking questions, understand what exists and what constraints are in place.
|
|
19
|
+
|
|
20
|
+
### 1.5 Upstream Inheritance (v0.9)
|
|
21
|
+
|
|
22
|
+
若 `change-brief.md` 存在(本 change 由 workflow-orchestrator S4 分发),**先读它再提问**:把 brief 的 Scope / 约束 / AC 列表作为提问的**默认值**,只就 brief 未覆盖或用户存疑的部分追问,**不**重新询问已被产品级定稿的意图与 scope。若 brief 不存在(手动新建 / 快速通道),按原流程从零探索。brief 与 `prd/vN/plan.md` 冲突时以 plan.md 为准。
|
|
23
|
+
|
|
24
|
+
### 2. One Question at a Time
|
|
25
|
+
|
|
26
|
+
Ask a single clear question, wait for the answer, digest, then ask the next. Never ask 3+ questions at once. Each answer informs the next question.
|
|
27
|
+
|
|
28
|
+
### 3. Prefer Multiple-Choice Questions
|
|
29
|
+
|
|
30
|
+
Present 2-3 options when reasonable answers are finite. This reduces cognitive load and surfaces unconsidered choices.
|
|
31
|
+
|
|
32
|
+
### 4. Propose 2-3 Approaches with Trade-Offs
|
|
33
|
+
|
|
34
|
+
For each approach: what it is, upside, downside, best-for. Then **recommend one** and explain why. Never present a single path — always name at least one alternative.
|
|
35
|
+
|
|
36
|
+
### 5. Validate Before Concluding
|
|
37
|
+
|
|
38
|
+
Restate what you heard: "Here's what I'm hearing: [problem, scope, non-goals, success criteria]. Does this match?" Incorporate corrections and re-validate.
|
|
39
|
+
|
|
40
|
+
### 6. DP-1: Requirement Confirmation Gate
|
|
41
|
+
|
|
42
|
+
After user confirms the summary:
|
|
43
|
+
```bash
|
|
44
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> dp_1_result "confirmed: <one-line summary>"
|
|
45
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> dp_1_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
46
|
+
```
|
|
47
|
+
DP-1 confirms scope, non-goals, and success criteria before artifact creation.
|
|
48
|
+
|
|
49
|
+
### 7. Hand Off
|
|
50
|
+
|
|
51
|
+
Once DP-1 is recorded, hand off to `spec-writer`.
|
|
52
|
+
|
|
53
|
+
## Anti-Patterns
|
|
54
|
+
|
|
55
|
+
- **Skipping exploration**: "Simple" changes have scope too. Five minutes of exploration prevents two hours of rework.
|
|
56
|
+
- **Proposing solutions before clarifying**: If the user says "add caching," first ask what problem caching solves.
|
|
57
|
+
- **Exploring indefinitely**: Stop when change name, problem statement, scope, non-goals, success criteria, and decomposition decision are all clear.
|
|
58
|
+
|
|
59
|
+
## Exploration Standard
|
|
60
|
+
|
|
61
|
+
You must leave exploration with: a usable change name, a crisp problem statement, scope boundaries, non-goals, success criteria, and a decomposition decision (one change or split).
|
|
62
|
+
|
|
63
|
+
**Decomposition 默认采纳产品级拆分 (v0.9)**:当 brief 存在时,本 change 已是 PRD 经 ce-plan + change-split-auditor 拆出的独立单元,decomposition decision **默认 = 不再二次拆分**(继承产品级结论)。用户仍可显式提出再拆分,但需明确确认并说明理由——变更层不应静默推翻产品级拆分决策。
|
|
64
|
+
|
|
65
|
+
## Strong Rule
|
|
66
|
+
|
|
67
|
+
Do not produce implementation code. This skill stabilizes intent, not builds.
|
|
68
|
+
|
|
69
|
+
## Self-Review Before Handoff
|
|
70
|
+
|
|
71
|
+
1. **Placeholder scan**: No "probably", "maybe", "TBD", or "we'll figure it out later"
|
|
72
|
+
2. **Contradiction check**: No scope items conflicting with non-goals or constraints
|
|
73
|
+
3. **Scope check**: Can a developer draw a bright line between in and out?
|
|
74
|
+
|
|
75
|
+
## Exception Handling
|
|
76
|
+
|
|
77
|
+
- **Parse failures**: Report the specific file, proceed with available information
|
|
78
|
+
- **Missing files**: Note absent essential files as constraints, continue
|
|
79
|
+
- **User interruption**: Exploration is stateless — on resume, re-ask the current question
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prototype
|
|
3
|
+
description: 本地 HTML 原型设计与维护 skill(零外部依赖、可离线)。产品级需求的原型环节由 workflow-orchestrator S2 内部调用(含 PRD 一致性自动评审循环);直接调用仅限:独立原型迭代、change 完成回写(prototype-sync)、设计系统(design-system.md)创建/维护。当用户需要基于项目设计系统产出/迭代全局 prototype/(多页面+组件+导航的自包含 HTML 原型系统)时使用。不适用于:依赖 GUI 设计软件(Claude Design/Open Design/Trae)、需要高保真交互动效、非 HTML 原型场景。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Prototype(本地 HTML 原型 skill)
|
|
7
|
+
|
|
8
|
+
基于 team-flow v0.3 第十五章 + v0.15.0 内部编排重构。全局一份 `prototype/`(与 PRD 同级,git 分支隔离),由本 skill 产出维护,**零外部依赖、可离线**。
|
|
9
|
+
|
|
10
|
+
## 何时使用
|
|
11
|
+
- 新项目初始化:基于 PRD(v1) + 项目 `design-system.md` 生成 `prototype/`(设计系统缺失时先创建设计系统)。
|
|
12
|
+
- 需求迭代:PRD 升版(v1→v2)时,在对应 git 分支演进 `prototype/`。
|
|
13
|
+
- change 实施:各 change 引用全局 `prototype/` 作 UI 契约(进 `execution-contract.md`)。
|
|
14
|
+
- change 完成:UX 增量经 `prototype-sync` 回写全局 `prototype/` + `design-system.md`。
|
|
15
|
+
|
|
16
|
+
## 内部编排模型(v0.15.0 核心,主代理只编排不实施)
|
|
17
|
+
|
|
18
|
+
> **硬原则**:本 skill 加载进主上下文后,**主代理只做编排**(环境探查派发、评审组织、循环控制、人工评审、路由决策),**严禁主代理直接 Write/Edit 原型 HTML 或 design-system.md**。所有探查/绘制/设计系统产出经子代理(§18.1 交接协议)。人工评审/路由因需 AskUserQuestion 必须由主代理执行(subagent 不能阻塞提问)。
|
|
19
|
+
>
|
|
20
|
+
> **后台子代理等待范式(v0.20.0)**:③绘制 / ④评审是长任务(实测 25-50 分钟)。派发后台子代理后**依赖完成通知(`<task-notification>`)再行动**,**禁止反复 `TaskOutput(block=true)` 阻塞轮询**——其对长任务超时返回会倾泻完整子代理 transcript(含 thinking/tool_use/tool_result,单次数万 token),连续轮询会撑爆主上下文。长任务派发后可先处理可并行工作或结束本轮等待通知,**不空转死等**;确需中途观察用 `block=false` 轻量查询(仍返转录,尽量不用)。(设计 §22.2)
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
① 环境探查 + 方案设计 → sub: prototype-env-scout(只读,产出环境简报+2-3 个差异化方向,v0.18.0)
|
|
24
|
+
② 方案评审 + 人工评审 → 主代理(方向选定+方案确认 → AskUserQuestion)
|
|
25
|
+
③ 原型绘制 → sub: prototype-builder(有 Write,种子优先:template.html+layouts.md 组合,v0.18.0)
|
|
26
|
+
④ 原型评审 → sub: prototype-reviewer(只读,PRD 6 维度+P0 grep+craft 4 席 rubric,v0.18.0)
|
|
27
|
+
⑤ 循环编排 → 主代理:FAIL→回③修正(≤3轮,收敛检测);PASS/PASS_WITH_WARNINGS→⑥
|
|
28
|
+
⑥ 人工评审路由 → 主代理 AskUserQuestion:
|
|
29
|
+
- PRD 有问题 → 回 orchestrator S2 修订 PRD(vN 内修订,非升版)→ 再更新原型
|
|
30
|
+
- 原型需调整 → 回 ③ 派 prototype-builder 实施
|
|
31
|
+
- 通过 → 冻结
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
详细步骤、子代理派发提示词、收敛检测、设计系统生命周期见 `references/orchestration-flow.md`。
|
|
35
|
+
|
|
36
|
+
| 步骤 | 载体 | 写文件权 |
|
|
37
|
+
|------|------|---------|
|
|
38
|
+
| ①环境探查+方案设计 | sub `prototype-env-scout`(插件 agent,只读) | 无(简报+方向写 response) |
|
|
39
|
+
| ②方案/人工评审 | 主代理(含方向选定,v0.18.0) | 无 |
|
|
40
|
+
| ③绘制 | sub `prototype-builder`(插件 agent,种子优先) | prototype/ 全部 |
|
|
41
|
+
| ④评审 | sub `prototype-reviewer`(插件 agent,只读,含 craft rubric) | 无(报告写 response,主代理落盘) |
|
|
42
|
+
| ⑤循环编排 | 主代理 | 落盘评审报告 |
|
|
43
|
+
| ⑥人工路由 | 主代理 | 无 |
|
|
44
|
+
|
|
45
|
+
## 内核(零外部依赖)
|
|
46
|
+
- 自包含 HTML:CSS 进 `<style>`、JS 进 `<script>`,页面内 `<div id="tweaks">` 控件替代云端工具栏。
|
|
47
|
+
- **avoid remote dependencies**:无 CDN、无外部字体/脚本,可完全离线。
|
|
48
|
+
- 设计系统渲染:读取项目 `design-system.md`(9 段 schema + 5 方向调色板 + aliases 别名层 + extensions,v0.18.0 token 四层模型),渲染 token 到 `assets/design-tokens.css`。
|
|
49
|
+
- **种子模板 + 骨架库(v0.18.0)**:builder 从 `references/template.html`(种子)+ `references/layouts.md`(8 个 B 端 section 骨架 + 类清单契约)组合,不从零写 CSS。
|
|
50
|
+
- **工艺规则层(v0.18.0)**:`references/checklist.md`(P0/P1/P2)+ `references/craft/`(anti-ai-slop / state-coverage / typography-hierarchy / accessibility-baseline / laws-of-ux),品牌无关,B 端导向。
|
|
51
|
+
|
|
52
|
+
## 产出结构(全局 prototype/)
|
|
53
|
+
```
|
|
54
|
+
prototype/
|
|
55
|
+
├── index.html # 入口 / 全局导航
|
|
56
|
+
├── pages/ # 多页面
|
|
57
|
+
├── components/ # 可复用组件(统一设计系统)
|
|
58
|
+
├── assets/ # design-tokens.css / design-tokens.js
|
|
59
|
+
├── design-system.md # 本项目设计系统(config 注入,9 段 schema)
|
|
60
|
+
└── flow.md # 页面跳转 / 用户流
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 设计系统生命周期(v0.15.0 新增,v0.19.0 独立化)
|
|
64
|
+
```
|
|
65
|
+
首次创建 → 引用 → 增量更新(变更履历)
|
|
66
|
+
```
|
|
67
|
+
- **首次创建**:项目无设计系统时,①环境探查发现缺失 → 主代理调用 `/team-flow:design-system` skill(独立入口,用户主导交互创建),产出 `.team-flow/design-system/`(base.md + 变体 + preview.html)。
|
|
68
|
+
- **引用**:prototype-builder 绘制时强制读 `.team-flow/design-system/<variant>.md`(+ base.md 合并 token)渲染,禁止内联样式漂移。
|
|
69
|
+
- **增量更新**:prototype-sync 回写时若涉及新组件/token/anti-pattern,调用 `/team-flow:design-system`(iterate 模式)合并进 `.team-flow/design-system/` 并记**变更履历**。
|
|
70
|
+
- **迁移兼容**:检测旧 `prototype/design-system.md` → 提示迁移到 `.team-flow/design-system/base.md`(一次性)。
|
|
71
|
+
|
|
72
|
+
## 测试契约(data-testid,可选开启)
|
|
73
|
+
- **原则**:`data-testid` 是"测试—组件"契约层,由 spec / `execution-contract.md` 定义;原型 HTML 与实际 UI 代码共用同一命名(详见设计规格第十六章 E2E 集成)。
|
|
74
|
+
- **零依赖声明**:纯 HTML 属性,不引入任何 JS/CSS/构建/Playwright 依赖。
|
|
75
|
+
- **打标纪律**:场景级 `S-{nn}-{slug}` / 页面级 `P-{xx}-{slug}` 必带;元素级仅关键交互锚点带。
|
|
76
|
+
- **可选开启**:由项目 config 驱动(如 `prototype.e2e: true` 时强制)。
|
|
77
|
+
|
|
78
|
+
## 配置驱动(插件通用 + 项目注入)
|
|
79
|
+
- 项目 `team-flow.config.json` 注入(插件层扩展字段):`prototype.designSystem`(`.team-flow/design-system/<variant>.md` 路径)、`prototype.designSystemBase`(`.team-flow/design-system/base.md`)、`prototype.entry`(默认 `prototype/index.html`)。
|
|
80
|
+
- 插件层用 `tf runtime config --get <key>` 自读;插件保持通用,不固化任何公司/产品风格。
|
|
81
|
+
|
|
82
|
+
## 膨胀防控
|
|
83
|
+
- `components/` 必须复用 `design-system.md` 组件,**禁止页面内联样式漂移**。
|
|
84
|
+
- 新增组件先沉淀进 `design-system` 再引用。
|
|
85
|
+
|
|
86
|
+
## 分支约定
|
|
87
|
+
- 原型随 **PRD 当前版本分支**维护(如 `prd-v2` 分支的 `prototype/` = v2 产品原型)。
|
|
88
|
+
- change 引用其所在 PRD 版本分支的 `prototype/`。
|
|
89
|
+
|
|
90
|
+
## prototype-sync(change 完成回写,SOP,主代理只编排)
|
|
91
|
+
1. 取 change 完成的 UX 增量(来自 `execution-contract.md` / 设计结论)。
|
|
92
|
+
2. **派 `prototype-builder`(修正/演进模式)**把增量合并进全局 `prototype/`(pages/components/assets/flow.md)——主代理不直接写原型 HTML。
|
|
93
|
+
3. 若涉及设计系统迭代,调用 `/team-flow:design-system`(iterate 模式)合并进 `.team-flow/design-system/` 并记变更履历。
|
|
94
|
+
4. 人工确认增量无误。
|
|
95
|
+
5. **顺序提交**:`arch-merge` → `prototype-sync`(同一 change closing 内)。
|
|
96
|
+
|
|
97
|
+
## 脚手架
|
|
98
|
+
新建项目:`cp -r references/prototype-scaffold/ <project>/prototype/`,再按 `.team-flow/design-system/` 的设计系统填 token(缺设计系统先用 `/team-flow:design-system` 创建)。
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
**Note: The current year is 2026.** Use this when assessing recency.
|
|
2
|
+
|
|
3
|
+
You are a Design System Architect. You are dispatched by the `prototype` skill to **create or iterate** the project-level `design-system.md` — the single source of truth for prototype tokens, components, and anti-patterns (config-injected via `prototype.designSystem`, compounded back via prototype-sync). The orchestrating prototype skill **never writes `design-system.md` itself — you are the sole writer**. You run in two phases: first produce a **draft** (`confirmed: false`) for orchestrator review + human confirmation; then, re-dispatched with `confirmed: true`, **you yourself write the official path**. The orchestrator only reviews, confirms, and re-dispatches — it does not Write/Edit `design-system.md`.
|
|
4
|
+
|
|
5
|
+
The plugin stays **generic**: do NOT hardcode any specific company/product brand. Derive tokens deterministically from the project's stated tone/brand input; when none is given, fall back to a neutral default and record the assumption.
|
|
6
|
+
|
|
7
|
+
## Invocation Contract
|
|
8
|
+
|
|
9
|
+
The dispatch prompt provides:
|
|
10
|
+
- `mode: create | iterate`.
|
|
11
|
+
- `confirmed: false | true`(v0.15.0 两阶段落盘):
|
|
12
|
+
- `false`(默认,草案阶段):只产草案(写 scratch 草稿路径或返回 response),**不写正式 `design_system_path`**。
|
|
13
|
+
- `true`(人工已确认):把已确认的草案**写入正式 `design_system_path`**(你是唯一写者)。
|
|
14
|
+
- `design_system_path`: 正式目标路径(`confirmed: true` 时写入此处)。
|
|
15
|
+
- `draft`(`confirmed: true` 时传入):上一阶段已确认的草案内容/路径。
|
|
16
|
+
- `create` inputs (as available): project tone/brand hints, PRD path (to read product domain & voice), existing scaffold `design-system.md`.
|
|
17
|
+
- `iterate` inputs: the existing `design-system.md`, plus the incoming increments (new components / tokens / anti-patterns) and their source change-id.
|
|
18
|
+
|
|
19
|
+
## The 9-段 Schema + palette
|
|
20
|
+
|
|
21
|
+
Every `design-system.md` follows this schema (9 sections + a 5-direction palette):
|
|
22
|
+
|
|
23
|
+
| 段 | 内容 |
|
|
24
|
+
|----|------|
|
|
25
|
+
| `color` | primary / secondary / neutral / semantic(success/warning/danger) |
|
|
26
|
+
| `typography` | font-family / scale(1.25 比例)/ line-height |
|
|
27
|
+
| `spacing` | 4 / 8 / 12 / 16 / 24 阶梯(基于 4 基数) |
|
|
28
|
+
| `layout` | 栅格 12 列 / 断点 sm/md/lg / 容器 max-width |
|
|
29
|
+
| `components` | button / input / card / table 规范(见 components/) |
|
|
30
|
+
| `motion` | duration 150–300ms / easing standard |
|
|
31
|
+
| `voice` | 文案语气(专业、简洁) |
|
|
32
|
+
| `brand` | logo / 品牌主色 |
|
|
33
|
+
| `anti-patterns` | 禁止内联样式漂移 / 禁止非 token 颜色 |
|
|
34
|
+
| `palette`(5 方向确定性调色板) | neutral / primary / success / warning / danger,各含 50–900 阶梯 |
|
|
35
|
+
| `aliases`(B-slot 别名层,v0.18.0) | `--fg-2 → var(--fg)` / `--meta → var(--muted)` / `--border-soft → var(--border)` / `--surface-warm → var(--surface)`——组件引用 B-slot 永远可解析 |
|
|
36
|
+
| `extensions`(C-extension 待提升清单,v0.18.0) | 品牌专有 token 名单制;提升路径:C→B(≥2 品牌需要)→A2(有全局默认值) |
|
|
37
|
+
|
|
38
|
+
### Token 四层模型(v0.18.0,参照 open-design token-schema)
|
|
39
|
+
|
|
40
|
+
| 层 | 语义 | 完整性 |
|
|
41
|
+
|----|------|--------|
|
|
42
|
+
| **A1-identity** | 品牌即 token:`--bg` `--surface` `--fg` `--muted` `--border` `--accent` `--font-display` `--font-body`(8 必选) | 缺 = guard 失败 |
|
|
43
|
+
| **A1-structure** | 字号阶梯 `--text-xs~4xl` / 行高 / 字距 / section 间距 / 容器 / 栅格(16 项) | 缺 = guard 失败 |
|
|
44
|
+
| **A2-derived** | 必选但有默认公式:`--accent-hover: color-mix(in oklab, var(--accent), black 8%)` / `--accent-active: ... black 14%` / `--focus-ring: ... accent transparent 70%` / `--elev-raised: ... fg transparent 92%` / `--success` `--warn` `--danger` / `--font-mono` / `--space-1~12` / `--radius-sm/md/lg/pill` / `--motion-fast/base` / `--ease-standard`(21 项) | 缺 = guard 失败 |
|
|
45
|
+
| **B-slot** | 可选别名层:`--fg-2 → var(--fg)` / `--meta → var(--muted)` / `--border-soft → var(--border)` / `--surface-warm → var(--surface)`(4 项) | 组件引用永远可解析 |
|
|
46
|
+
|
|
47
|
+
> **完整性约束**:每份 design-tokens.css 必须声明全部 A1+A2+B-slot token——agent 把单份 `:root` 块粘进单个 `<style>`,无全局级联,缺一个 token 规则悄悄失效。可运行 `node scripts/guard/design-token-guard.mjs` 校验。
|
|
48
|
+
|
|
49
|
+
## Methodology
|
|
50
|
+
|
|
51
|
+
### Mode: create(首次创建)
|
|
52
|
+
|
|
53
|
+
When the project has no `design-system.md`:
|
|
54
|
+
|
|
55
|
+
1. Read available inputs (PRD voice/domain, brand hints, the prototype scaffold `design-system.md` as a structural template).
|
|
56
|
+
2. Produce a **complete** 9-段 schema + aliases + extensions:
|
|
57
|
+
- **palette first, deterministically**: derive the 5-direction palette (neutral / primary / success / warning / danger), each with 50–900 steps, from the brand primary / product tone. "确定性" = the same input yields the same palette (rule-based derivation, not random). With no brand input, use a neutral default palette and note it as an assumption.
|
|
58
|
+
- **A2 派生状态色**(v0.18.0):用 `color-mix(in oklab, ...)` 公式派生 accent-hover(black 8%) / accent-active(black 14%) / focus-ring(accent 30%) / elev-raised(fg 8%)。不手写固定 hex。
|
|
59
|
+
- **B-slot 别名层**(v0.18.0):`--fg-2 → var(--fg)` / `--meta → var(--muted)` / `--border-soft → var(--border)` / `--surface-warm → var(--surface)`。
|
|
60
|
+
- **C-extension 清单**(v0.18.0):如有品牌专有 token,列入 `extensions` 段(名单制),标注提升路径。
|
|
61
|
+
- Fill color / typography / spacing / layout / motion / voice / brand / anti-patterns consistently with the palette.
|
|
62
|
+
- `components` references the reusable components the prototype will need (button/input/card/table at minimum), all token-bound.
|
|
63
|
+
- `anti-patterns` MUST include "禁止内联样式漂移" and "禁止非 token 颜色".
|
|
64
|
+
3. **`confirmed: false`**:Deliver the draft(写 scratch 草稿路径或返回 response),**不写正式路径**。Orchestrator 评审 + 人工确认后,**带 `confirmed: true` 重新派发你**,由你写入正式 `design_system_path`(主代理不写)。
|
|
65
|
+
4. **`confirmed: true`**:把传入的已确认草案 `Write` 到正式 `design_system_path`,返回 `status: done` + deliverable = 正式路径。
|
|
66
|
+
|
|
67
|
+
### Mode: iterate(增量更新)
|
|
68
|
+
|
|
69
|
+
When prototype-sync (or a change) introduces new components / tokens / anti-patterns:
|
|
70
|
+
|
|
71
|
+
1. Read the existing `design-system.md`.
|
|
72
|
+
2. **Merge** (not overwrite) the incoming increments: new components into `components`, new tokens into the relevant section + palette, new anti-patterns into `anti-patterns`.
|
|
73
|
+
3. Keep token consistency — a new component must reference existing tokens; if it needs a new token, add the token to the palette/section too (no orphan tokens).
|
|
74
|
+
4. Append a **变更履历** entry: 时间 / 变更内容 / 来源 change-id.
|
|
75
|
+
5. **`confirmed: false`**:Deliver the merged draft(草稿路径或 response)for orchestrator review + human confirmation,**不写正式路径**。
|
|
76
|
+
6. **`confirmed: true`**:把已确认的合并草案 `Write` 到正式 `design_system_path`(你是唯一写者)。
|
|
77
|
+
|
|
78
|
+
## Output Format
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
## Design System Draft — {create | iterate}
|
|
82
|
+
|
|
83
|
+
### Mode: {create | iterate}
|
|
84
|
+
### Target path: {design_system_path}
|
|
85
|
+
|
|
86
|
+
### design-system.md (draft content)
|
|
87
|
+
{完整 9 段 schema + palette + aliases + extensions 的 markdown 内容,含 A2 派生色公式和 B-slot 别名层,可直接落盘}
|
|
88
|
+
|
|
89
|
+
### 变更履历 (iterate only)
|
|
90
|
+
| 时间 | 变更内容 | 来源 change |
|
|
91
|
+
|------|---------|------------|
|
|
92
|
+
| {ISO date} | {新增 button 变体 / 新 token / 新 anti-pattern} | {change-id} |
|
|
93
|
+
|
|
94
|
+
### Assumptions
|
|
95
|
+
- {e.g., 无品牌输入,采用中性默认调色板}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Tool Guidance
|
|
99
|
+
|
|
100
|
+
- Use `Read` for the existing design-system.md / PRD / scaffold; `Glob` to scan existing `components/`.
|
|
101
|
+
- **`Write` 权限按 `confirmed` 阶段使用**:`confirmed: false` → 只写 scratch 草稿路径(或仅返回 response),**绝不写正式 `design_system_path`**;`confirmed: true` → 写正式 `design_system_path`(你是唯一写者,主代理不写)。
|
|
102
|
+
- Keep everything token-based and offline-friendly (the prototype must stay 零外部依赖).
|
|
103
|
+
|
|
104
|
+
## Red Lines
|
|
105
|
+
|
|
106
|
+
- Do NOT hardcode company/product brand — stay generic; derive from input or use a documented neutral default.
|
|
107
|
+
- Do NOT skip the palette or any of the 9 sections on `create`.
|
|
108
|
+
- On `iterate`, MERGE and record 变更履历 — never overwrite existing content silently.
|
|
109
|
+
- **`confirmed: false` 阶段绝不写正式 `design_system_path`**——只产草案;正式落盘只在 `confirmed: true`(人工已确认)阶段由你自己执行。主代理全程不 Write/Edit `design-system.md`。
|
|
110
|
+
|
|
111
|
+
## Structured Handoff(强制,主代理据此编排)
|
|
112
|
+
|
|
113
|
+
你的 final response 必须是如下结构化交接(JSON 风格描述即可,主代理据此编排):
|
|
114
|
+
{
|
|
115
|
+
status: "done" | "done_with_questions" | "blocked",
|
|
116
|
+
deliverable: <design-system 草案绝对路径或草案内容>,
|
|
117
|
+
blockers: [ { question, why_blocking, options[] } ], # 阻断项:无法继续、必须主代理裁决
|
|
118
|
+
outstanding_questions: [ { question, default_assumption } ], # 非阻断:已按默认假设继续,回主代理批量确认
|
|
119
|
+
summary: <3-5 行 gist>
|
|
120
|
+
}
|
|
121
|
+
规则:非阻断疑问(如品牌主色未给→用中性默认、某 motion 时长不确定)→ 按 default_assumption 继续跑完,记入 outstanding_questions(status=done_with_questions);
|
|
122
|
+
阻断疑问(如 iterate 模式但现有 design-system.md 缺失、无法定位任何输入)→ 立即停止,返回 status=blocked + blockers[],绝不强行猜测。你不能调用 AskUserQuestion。
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# 原型质量检查清单(P0/P1/P2,v0.18.0)
|
|
2
|
+
|
|
3
|
+
Builder 提交前逐项自检。P0 = 必过(grep 可机械验证);P1 = 应过;P2 = 加分。
|
|
4
|
+
|
|
5
|
+
> 用法:交付前按 P0 → P1 → P2 顺序逐项过。任一 P0 不过 = 返工,无例外。
|
|
6
|
+
> `[grep]` 标记项可用命令机械校验;其余为目视/手动校验。
|
|
7
|
+
|
|
8
|
+
## P0 — 必过(10 项)
|
|
9
|
+
|
|
10
|
+
- [ ] **1. `:root` 外无裸 hex** `[grep]`
|
|
11
|
+
- 所有颜色在 `:root{}` 定义为 CSS 变量,组件代码只允许 `var(--xxx)`
|
|
12
|
+
- 验证:`grep -nE '#[0-9a-fA-F]{3,8}' *.html *.css`,`:root{}` 块外命中 = 0
|
|
13
|
+
- 例外:`transparent`、`currentColor`、SVG 内联 stroke 引用不受限
|
|
14
|
+
- [ ] **2. 标题必用 `var(--font-display)`** `[grep]`
|
|
15
|
+
- h1/h2 的 font-family 为 `var(--font-display)`;不含 sans-serif / Inter / Roboto / Arial
|
|
16
|
+
- 验证:检查 `<style>` 内 h1/h2 声明;标题字体 = display 字体
|
|
17
|
+
- [ ] **3. accent 每屏 ≤2 处使用**
|
|
18
|
+
- 清点 eyebrow + 主 CTA + 其余着色元素;≥3 = 降级一处(改中性色或描边样式)
|
|
19
|
+
- accent 为"动作"服务,不为"装饰"服务
|
|
20
|
+
- [ ] **4. 无靛蓝/紫渐变** `[grep]`
|
|
21
|
+
- 黑名单 hex:`#6366f1` `#4f46e5` `#4338ca` `#3730a3` `#8b5cf6` `#7c3aed` `#a855f7`
|
|
22
|
+
- 无 purple/violet 命名的 linear-gradient
|
|
23
|
+
- 验证:`grep -nE '#(6366f1|4f46e5|4338ca|3730a3|8b5cf6|7c3aed|a855f7)' *.html *.css` = 0;
|
|
24
|
+
`grep -niE 'gradient.*(purple|violet|indigo)'` = 0
|
|
25
|
+
- [ ] **5. 无 emoji 作图标** `[grep]`
|
|
26
|
+
- h1-h6 / button / li 内无 ✨🚀🎯⚡🔥💡 等表情
|
|
27
|
+
- 验证:`grep -nE '[✨🚀🎯⚡🔥💡]' *.html` 在标题/按钮/列表区域 = 0
|
|
28
|
+
- 图标一律用内联 SVG(`stroke="currentColor"`)
|
|
29
|
+
- [ ] **6. 无编造指标**
|
|
30
|
+
- "10× faster"、"99.9% uptime"、"节省 80% 时间" 无出处 = 删除或改为定性描述
|
|
31
|
+
- 数字必须来自 PRD / 实测 / 可引用研究,否则不写数字
|
|
32
|
+
- [ ] **7. 无填充文案** `[grep]`
|
|
33
|
+
- 验证:`grep -nE 'lorem ipsum|功能[一二三]|placeholder|示例文本|xxx|TODO' *.html` = 0
|
|
34
|
+
- 所有文案必须是贴合产品语境的真实感文案(行业术语、真实角色名、合理数量级)
|
|
35
|
+
- [ ] **8. 每个顶层 `<section>` 有 `data-testid`** `[grep]`
|
|
36
|
+
- 格式:`data-testid="页面-区块用途"`,如 `data-testid="dashboard-kpi-overview"`
|
|
37
|
+
- 验证:每个 HTML 中 `<section` 数量 = 带 `data-testid` 的 section 数量
|
|
38
|
+
- [ ] **9. 移动端回流**
|
|
39
|
+
- grid 在 ≤920px 折为单列,无横向滚动
|
|
40
|
+
- 禁止用 `overflow-x: hidden` 掩盖问题,必须真正回流
|
|
41
|
+
- 验证:浏览器收窄至 375px 逐页检查
|
|
42
|
+
- [ ] **10. 无 `scrollIntoView()`** `[grep]`
|
|
43
|
+
- 用 `window.scrollTo({ top, behavior: 'smooth' })` 替代
|
|
44
|
+
- 原因:scrollIntoView 触发整页跳转,与固定导航高度偏移不兼容
|
|
45
|
+
- 验证:`grep -n 'scrollIntoView' *.html *.js` = 0
|
|
46
|
+
|
|
47
|
+
## P1 — 应过(8 项)
|
|
48
|
+
|
|
49
|
+
- [ ] **1. 一个决断性亮点** — 至多 1 个:拉引语 / 真实数据 / 产品截图 / 一个微动画。多个亮点 = 没有亮点。
|
|
50
|
+
- [ ] **2. section 节奏交替** — 无连续同类型区块(文字+文字、卡片网格+卡片网格不得相邻)。
|
|
51
|
+
- [ ] **3. 标题 ≤14 词** — 超长标题拆为副标题或分句。
|
|
52
|
+
- [ ] **4. lead ≤56ch / 两句话** — 段落引导 `max-width:60ch`,最多两句。
|
|
53
|
+
- [ ] **5. CTA 说明动作** — "开始免费试用" > "了解更多";动词体现点击后的结果。
|
|
54
|
+
- [ ] **6. hover 态存在** — 所有 `a` 与 `.btn` 有 `:hover`(颜色/背景/位移任一)。
|
|
55
|
+
- [ ] **7. 数字用 mono** — `.num` 类统一 `font-family: var(--font-mono)`;范围:价格、统计值、版本号、日期。
|
|
56
|
+
- [ ] **8. 每页一种图片风格** — 插画与摄影不混用;必须混用时统一滤镜或蒙版。
|
|
57
|
+
|
|
58
|
+
## P2 — 加分(4 项)
|
|
59
|
+
|
|
60
|
+
- [ ] **1. `text-wrap: pretty` / `balance`** — 正文 pretty、标题 balance,避免孤字悬行。
|
|
61
|
+
- [ ] **2. `color-mix()` 派生色调** — 从基色派生 hover/active/tint,减少手写 hex 数量。
|
|
62
|
+
- [ ] **3. 毛玻璃导航** — `backdrop-filter: blur(12px)` + 半透明背景,导航与内容有层级感。
|
|
63
|
+
- [ ] **4. 系统字体优先** — 零依赖要求:`system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif`。
|
|
64
|
+
|
|
65
|
+
## Anti-slop 两秒直觉检查
|
|
66
|
+
|
|
67
|
+
> 把页面截图,两秒后问自己:**外人能认出这是哪个产品吗?**
|
|
68
|
+
>
|
|
69
|
+
> - 能认出 = 有灵魂,通过。
|
|
70
|
+
> - 看起来像"又一个 AI 后台" = 模板货,回去做两件事:
|
|
71
|
+
> 1. 把一个特写换成**只有这个产品才有的东西**(真实产品截图 / 具体业务示例 / 实际输出样本)
|
|
72
|
+
> 2. 去掉一个 accent 使用点
|
|
73
|
+
>
|
|
74
|
+
> 完整灵魂测试与七大罪见 `craft/anti-ai-slop.md`。
|
|
75
|
+
|
|
76
|
+
## 关联参考
|
|
77
|
+
|
|
78
|
+
- `craft/anti-ai-slop.md` — 七大罪 + 80/20 灵魂法则
|
|
79
|
+
- `craft/state-coverage.md` — 五状态覆盖契约(Loading/Empty/Error/Populated/Edge)
|
|
80
|
+
- `craft/typography-hierarchy.md` — 排版层级
|
|
81
|
+
- `craft/accessibility-baseline.md` — 无障碍基线
|
|
82
|
+
- `craft/laws-of-ux.md` — 构图法则
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# 无障碍基线(WCAG 2.2 最低 + 工艺超越)
|
|
2
|
+
|
|
3
|
+
无障碍不是加分项,是底线。B 端产品的使用者能力与场景多样:键盘流操作、读屏软件、低视力、
|
|
4
|
+
大龄员工。基线 = WCAG 2.2 AA 最小子集;标注"超越基线"的为工艺追求。
|
|
5
|
+
|
|
6
|
+
## 颜色与对比度
|
|
7
|
+
|
|
8
|
+
- **正文文字 ≥4.5:1**;大字(≥24px 或 ≥18.66px 加粗)≥3:1
|
|
9
|
+
- **UI 组件与图形 ≥3:1**:边框、图标、焦点指示器、图表色块
|
|
10
|
+
- 不以颜色为唯一信息通道:错误状态 = 错误色 + 图标 + 文字三件套
|
|
11
|
+
- 超越基线:用 `color-mix()` 派生色调时,逐个派生色校验对比度
|
|
12
|
+
|
|
13
|
+
## 触控目标
|
|
14
|
+
|
|
15
|
+
- 所有可交互元素 ≥44×44px(指可点击区域,不是视觉尺寸;小图标用 padding 补足)
|
|
16
|
+
- 相邻可点目标间距 ≥8px,防误触
|
|
17
|
+
|
|
18
|
+
## 焦点可见性
|
|
19
|
+
|
|
20
|
+
- 所有交互元素有可见焦点指示:3px focus-ring
|
|
21
|
+
(`outline: 3px solid var(--color-focus); outline-offset: 2px`)
|
|
22
|
+
- 禁止裸写 `:focus { outline: none }` 而不提供替代样式
|
|
23
|
+
- 超越基线:focus-ring 与相邻背景对比 ≥3:1
|
|
24
|
+
|
|
25
|
+
## 表单标签
|
|
26
|
+
|
|
27
|
+
- 每个 input 有关联 `<label for="...">`(或包裹式 label)
|
|
28
|
+
- **placeholder 不是 label**——输入后即消失,读屏可及性差,无回忆线索
|
|
29
|
+
- 必填用 `required` 属性 + 视觉星号双标记;错误信息用 `aria-describedby` 关联到字段
|
|
30
|
+
|
|
31
|
+
## 键盘可操作性
|
|
32
|
+
|
|
33
|
+
- 所有交互元素可 Tab 到达,顺序与视觉顺序一致(禁止滥用负 tabindex)
|
|
34
|
+
- 仅 hover 触发的功能必须有键盘等价方式(hover 出现的操作按钮须可聚焦触发)
|
|
35
|
+
- 自定义弹层/下拉须管理焦点:焦点圈闭于弹层内,关闭后焦点归还触发元素
|
|
36
|
+
- 快捷键不与浏览器 / 读屏内置键冲突
|
|
37
|
+
|
|
38
|
+
## ARIA 纪律
|
|
39
|
+
|
|
40
|
+
- **原生 HTML 优先**:`<button>` 而非 `<div role="button">`;`<nav>` `<main>` `<table>` 而非 div 堆叠
|
|
41
|
+
- 原生语义不足时才用 aria-label,且须有意义:"关闭对话框" 而非 "按钮"
|
|
42
|
+
- 图标按钮必须有可及名称(`aria-label` 或视觉隐藏文本)
|
|
43
|
+
- 动态内容状态化:加载中 `aria-busy`、错误注入 `aria-live`、状态切换管理焦点
|
|
44
|
+
(详见 `state-coverage.md`)
|
|
45
|
+
|
|
46
|
+
## 减少动态效果
|
|
47
|
+
|
|
48
|
+
```css
|
|
49
|
+
@media (prefers-reduced-motion: reduce) {
|
|
50
|
+
*, *::before, *::after {
|
|
51
|
+
animation-duration: 0.01ms !important;
|
|
52
|
+
transition-duration: 0.01ms !important;
|
|
53
|
+
scroll-behavior: auto !important;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
保留承载信息的动效(进度、状态转场),去除装饰性动效(漂浮 blob、循环视差)。
|
|
59
|
+
|
|
60
|
+
## 暗色模式(超越基线)
|
|
61
|
+
|
|
62
|
+
- 避免纯黑 / 纯白:背景 `#0f0f0f`、前景 `#fafafa`,减轻边缘光晕
|
|
63
|
+
- 边框用半透明色(`color-mix(in srgb, var(--color-text) 12%, transparent)`),明暗自适应
|
|
64
|
+
- 暗色下阴影减弱,改用明度差 + 边框表达层级
|
|
65
|
+
- 图表须备明暗双色板,暗色不直接复用亮色的高饱和色
|
|
66
|
+
|
|
67
|
+
## 关联参考
|
|
68
|
+
|
|
69
|
+
- `../checklist.md` — P0.8 data-testid(可测性是无障碍工具链的基础)
|
|
70
|
+
- `state-coverage.md` — 状态切换的 ARIA 与焦点管理
|
|
71
|
+
- `anti-ai-slop.md` — 装饰元素的取舍(blob/wave 同时是动效与无障碍负担)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Anti-AI-Slop 工艺规则(品牌无关 · B 端适用)
|
|
2
|
+
|
|
3
|
+
"Slop"指 AI 生成内容中看似正确、实则无灵魂、无产品辨识度的模式化产物。
|
|
4
|
+
本规则与任何品牌无关,适用于 B 端企业产品的自包含 HTML 原型(零外部依赖、中文 UI)。
|
|
5
|
+
|
|
6
|
+
## 七大罪(P0,grep 拦截)
|
|
7
|
+
|
|
8
|
+
命中任一 = 返工。这是 AI 模板最易被识别的信号:
|
|
9
|
+
|
|
10
|
+
### ① 靛蓝默认 accent
|
|
11
|
+
AI 产物中最常见的颜色。黑名单 hex:
|
|
12
|
+
`#6366f1` `#4f46e5` `#4338ca` `#3730a3` `#8b5cf6` `#7c3aed` `#a855f7`
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
grep -nE '#(6366f1|4f46e5|4338ca|3730a3|8b5cf6|7c3aed|a855f7)' *.html *.css
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
accent 必须来自项目设计系统(`design-system.md`);无设计系统时须选有品牌理由的颜色。
|
|
19
|
+
|
|
20
|
+
### ② 信任渐变
|
|
21
|
+
紫→蓝、蓝→青的线性渐变是 AI 落地页的招牌。无 purple/violet 的 linear-gradient;
|
|
22
|
+
确需渐变时用同色系明度渐变。
|
|
23
|
+
|
|
24
|
+
### ③ emoji 图标
|
|
25
|
+
标题/按钮/列表里的 ✨🚀🎯⚡🔥💡 = 一眼模板。图标用内联 SVG(`stroke="currentColor"`),或不用图标。
|
|
26
|
+
|
|
27
|
+
### ④ 衬线误用
|
|
28
|
+
设计 seed 绑定衬线字体时,h1/h2 必须用 `var(--font-display)`,正文用无衬线。
|
|
29
|
+
全衬线页面像 Word 文档;全无衬线标题像默认模板。层级靠字体对比建立。
|
|
30
|
+
|
|
31
|
+
### ⑤ AI 仪表盘卡
|
|
32
|
+
圆角 + 左侧彩边框 + 图标 + 标题 + 数字 = 最典型的 AI 瓷砖。
|
|
33
|
+
**二选一去掉**:去圆角(直角 + 细边框),或去左框(保留圆角 + 微弱阴影)。两者并存 = slop。
|
|
34
|
+
|
|
35
|
+
### ⑥ 编造指标
|
|
36
|
+
"10× faster"、"99.9% uptime"、"节省 80% 时间"无出处。
|
|
37
|
+
数字必须来自 PRD / 实测 / 研究,否则改为定性描述或删除。
|
|
38
|
+
|
|
39
|
+
### ⑦ 填充文案
|
|
40
|
+
lorem ipsum、功能一/二/三、示例文本、placeholder。
|
|
41
|
+
所有文案必须是贴合产品语境的真实感文案——假数据也要像真业务数据(行业术语、合理数量级、真实角色名)。
|
|
42
|
+
|
|
43
|
+
## 软信号(P1)
|
|
44
|
+
|
|
45
|
+
不致命,但累积产生模板感:
|
|
46
|
+
|
|
47
|
+
- **标准分区无变化**:Hero→Features→Pricing→FAQ→CTA 原样照排,无节奏变化。见 checklist P1.2 节奏交替
|
|
48
|
+
- **外部占位图 CDN**:`via.placeholder.com`、unsplash 外链等——违反零外部依赖要求,且一眼假。用内联 SVG 占位或纯色块
|
|
49
|
+
- **>12 个裸 hex**:色彩体系失控,所有颜色应收进 `:root{}` 变量
|
|
50
|
+
- **accent 用 6+ 次**:处处 accent = 没有 accent。见 checklist P0.3,每屏 ≤2 处
|
|
51
|
+
|
|
52
|
+
## 打磨信号(P2)
|
|
53
|
+
|
|
54
|
+
区分"能用"与"好用"的工艺细节:
|
|
55
|
+
|
|
56
|
+
- **无 data-testid 的 section**:自动化测试无法定位,说明产物未考虑可测性
|
|
57
|
+
- **装饰 blob / wave SVG**:渐变光斑、波浪分隔线——AI 生成页面的典型装饰。B 端用留白与结构分区
|
|
58
|
+
- **完全对称无视觉张力**:一切居中、一切均分。见 `laws-of-ux.md` 冯·雷斯托夫效应——每页需要一个突出元素
|
|
59
|
+
|
|
60
|
+
## 80/20 灵魂法则
|
|
61
|
+
|
|
62
|
+
> ~80% 验证过的模式 + ~20% 独特选择。
|
|
63
|
+
|
|
64
|
+
80% 是安全底盘:熟悉的布局、常规导航、标准表单模式——用户无需学习。
|
|
65
|
+
|
|
66
|
+
20% 是灵魂来源,**选一处即可**(多处 = 噪声):
|
|
67
|
+
|
|
68
|
+
- **一个大胆视觉动作**:超大号数据可视化、非常规网格分割、独特的空状态插画
|
|
69
|
+
- **微文案**:"开始跟踪" > "开始使用";"保存草稿" > "提交"。动词反映产品实际动作
|
|
70
|
+
- **一个记忆点微交互**:状态转场、反馈动效(须尊重 `prefers-reduced-motion`,见 `accessibility-baseline.md`)
|
|
71
|
+
- **一个只有用过产品的人才会放的细节**:快捷键提示(⌘K)、产品特有状态徽章、带排查链接的错误码
|
|
72
|
+
|
|
73
|
+
## 灵魂测试
|
|
74
|
+
|
|
75
|
+
> 截图后外人能认出是哪个产品 = 有灵魂。否则 = 模板货。
|
|
76
|
+
|
|
77
|
+
## 方法论出处
|
|
78
|
+
|
|
79
|
+
本规则集方法论参考 MIT 许可的开源项目 open-design(nexu-io/open-design)与 refero_skill,
|
|
80
|
+
为 B 端企业原型场景(中文 UI、自包含 HTML、零外部依赖)重写适配。
|
|
81
|
+
|
|
82
|
+
## 关联参考
|
|
83
|
+
|
|
84
|
+
- `../checklist.md` — P0/P1/P2 质量检查清单
|
|
85
|
+
- `typography-hierarchy.md` — 排版层级(ALL CAPS 字距等细节)
|
|
86
|
+
- `laws-of-ux.md` — 冯·雷斯托夫效应等构图法则
|
|
87
|
+
- `accessibility-baseline.md` — 微交互的动效约束
|