create-yss-spec 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +1 -1
- package/src/cli.js +56 -8
- package/template/.agents/rules/yss-ai-skills.md +59 -0
- package/template/.agents/skills/.yss-skills-manifest.json +28 -0
- package/template/.agents/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.agents/skills/file-export-download/SKILL.md +160 -0
- package/template/.agents/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.agents/skills/formily-foundation/SKILL.md +176 -0
- package/template/.agents/skills/formily-foundation/references/examples.md +486 -0
- package/template/.agents/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.agents/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.agents/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.agents/skills/frontend-commit/SKILL.md +118 -0
- package/template/.agents/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.agents/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.agents/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.agents/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.agents/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.agents/skills/page-form-module/SKILL.md +168 -0
- package/template/.agents/skills/page-list-module/SKILL.md +137 -0
- package/template/.agents/skills/page-skeleton/SKILL.md +76 -0
- package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.agents/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.agents/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.agents/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.agents/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.agents/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.agents/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.agents/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.agents/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.agents/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.agents/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.agents/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.agents/skills/yss-components/SKILL.md +1 -1
- package/template/.agents/skills/yss-design-system/SKILL.md +1 -1
- package/template/.agents/skills/yss-formily/SKILL.md +233 -265
- package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.agents/skills/yss-hook/SKILL.md +1 -1
- package/template/.agents/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.agents/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.agents/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.agents/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.agents/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.agents/skills/yss-router/references/boundaries.md +1 -1
- package/template/.agents/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.agents/skills/yss-ui/SKILL.md +1 -1
- package/template/.agents/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.agents/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.agents/skills/ytable-usage/SKILL.md +251 -0
- package/template/.agents/skills/ytree-usage/SKILL.md +132 -0
- package/template/.claude/skills/.yss-skills-manifest.json +29 -0
- package/template/.claude/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.claude/skills/file-export-download/SKILL.md +160 -0
- package/template/.claude/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.claude/skills/formily-foundation/SKILL.md +176 -0
- package/template/.claude/skills/formily-foundation/references/examples.md +486 -0
- package/template/.claude/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.claude/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.claude/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.claude/skills/frontend-commit/SKILL.md +118 -0
- package/template/.claude/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.claude/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.claude/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.claude/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.claude/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.claude/skills/page-form-module/SKILL.md +168 -0
- package/template/.claude/skills/page-list-module/SKILL.md +137 -0
- package/template/.claude/skills/page-skeleton/SKILL.md +76 -0
- package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.claude/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.claude/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.claude/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.claude/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.claude/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.claude/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.claude/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.claude/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.claude/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.claude/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.claude/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.claude/skills/yss-components/SKILL.md +1 -1
- package/template/.claude/skills/yss-design-system/SKILL.md +1 -1
- package/template/.claude/skills/yss-formily/SKILL.md +233 -265
- package/template/.claude/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.claude/skills/yss-hook/SKILL.md +1 -1
- package/template/.claude/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.claude/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.claude/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.claude/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.claude/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.claude/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.claude/skills/yss-router/references/boundaries.md +1 -1
- package/template/.claude/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.claude/skills/yss-ui/SKILL.md +1 -1
- package/template/.claude/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.claude/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.claude/skills/ytable-usage/SKILL.md +251 -0
- package/template/.claude/skills/ytree-usage/SKILL.md +132 -0
- package/template/.codex/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.codex/skills/file-export-download/SKILL.md +160 -0
- package/template/.codex/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.codex/skills/formily-foundation/SKILL.md +176 -0
- package/template/.codex/skills/formily-foundation/references/examples.md +486 -0
- package/template/.codex/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.codex/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.codex/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.codex/skills/frontend-commit/SKILL.md +118 -0
- package/template/.codex/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.codex/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.codex/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.codex/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.codex/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.codex/skills/page-form-module/SKILL.md +168 -0
- package/template/.codex/skills/page-list-module/SKILL.md +137 -0
- package/template/.codex/skills/page-skeleton/SKILL.md +76 -0
- package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.codex/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.codex/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.codex/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.codex/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.codex/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.codex/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.codex/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.codex/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.codex/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.codex/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.codex/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.codex/skills/yss-components/SKILL.md +1 -1
- package/template/.codex/skills/yss-design-system/SKILL.md +1 -1
- package/template/.codex/skills/yss-formily/SKILL.md +233 -265
- package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.codex/skills/yss-hook/SKILL.md +1 -1
- package/template/.codex/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.codex/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.codex/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.codex/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.codex/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.codex/skills/yss-router/references/boundaries.md +1 -1
- package/template/.codex/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.codex/skills/yss-ui/SKILL.md +1 -1
- package/template/.codex/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.codex/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.codex/skills/ytable-usage/SKILL.md +251 -0
- package/template/.codex/skills/ytree-usage/SKILL.md +132 -0
- package/template/.cursor/skills/.yss-skills-manifest.json +29 -0
- package/template/.cursor/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.cursor/skills/file-export-download/SKILL.md +160 -0
- package/template/.cursor/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.cursor/skills/formily-foundation/SKILL.md +176 -0
- package/template/.cursor/skills/formily-foundation/references/examples.md +486 -0
- package/template/.cursor/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.cursor/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.cursor/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.cursor/skills/frontend-commit/SKILL.md +118 -0
- package/template/.cursor/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.cursor/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.cursor/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.cursor/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.cursor/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.cursor/skills/page-form-module/SKILL.md +168 -0
- package/template/.cursor/skills/page-list-module/SKILL.md +137 -0
- package/template/.cursor/skills/page-skeleton/SKILL.md +76 -0
- package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.cursor/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.cursor/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.cursor/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.cursor/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.cursor/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.cursor/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.cursor/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.cursor/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.cursor/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.cursor/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.cursor/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.cursor/skills/yss-components/SKILL.md +1 -1
- package/template/.cursor/skills/yss-design-system/SKILL.md +1 -1
- package/template/.cursor/skills/yss-formily/SKILL.md +233 -265
- package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.cursor/skills/yss-hook/SKILL.md +1 -1
- package/template/.cursor/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.cursor/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.cursor/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.cursor/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.cursor/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.cursor/skills/yss-router/references/boundaries.md +1 -1
- package/template/.cursor/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.cursor/skills/yss-ui/SKILL.md +1 -1
- package/template/.cursor/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.cursor/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.cursor/skills/ytable-usage/SKILL.md +251 -0
- package/template/.cursor/skills/ytree-usage/SKILL.md +132 -0
- package/template/.cursorrules +32 -0
- package/template/.hermes/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.hermes/skills/file-export-download/SKILL.md +160 -0
- package/template/.hermes/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.hermes/skills/formily-foundation/SKILL.md +176 -0
- package/template/.hermes/skills/formily-foundation/references/examples.md +486 -0
- package/template/.hermes/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.hermes/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.hermes/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.hermes/skills/frontend-commit/SKILL.md +118 -0
- package/template/.hermes/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.hermes/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.hermes/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.hermes/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.hermes/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.hermes/skills/page-form-module/SKILL.md +168 -0
- package/template/.hermes/skills/page-list-module/SKILL.md +137 -0
- package/template/.hermes/skills/page-skeleton/SKILL.md +76 -0
- package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.hermes/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.hermes/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.hermes/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.hermes/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.hermes/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.hermes/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.hermes/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.hermes/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.hermes/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.hermes/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.hermes/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.hermes/skills/yss-components/SKILL.md +1 -1
- package/template/.hermes/skills/yss-design-system/SKILL.md +1 -1
- package/template/.hermes/skills/yss-formily/SKILL.md +233 -265
- package/template/.hermes/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.hermes/skills/yss-hook/SKILL.md +1 -1
- package/template/.hermes/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.hermes/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.hermes/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.hermes/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.hermes/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.hermes/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.hermes/skills/yss-router/references/boundaries.md +1 -1
- package/template/.hermes/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.hermes/skills/yss-ui/SKILL.md +1 -1
- package/template/.hermes/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.hermes/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.hermes/skills/ytable-usage/SKILL.md +251 -0
- package/template/.hermes/skills/ytree-usage/SKILL.md +132 -0
- package/template/.pi/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.pi/skills/file-export-download/SKILL.md +160 -0
- package/template/.pi/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.pi/skills/formily-foundation/SKILL.md +176 -0
- package/template/.pi/skills/formily-foundation/references/examples.md +486 -0
- package/template/.pi/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.pi/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.pi/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.pi/skills/frontend-commit/SKILL.md +118 -0
- package/template/.pi/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.pi/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.pi/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.pi/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.pi/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.pi/skills/page-form-module/SKILL.md +168 -0
- package/template/.pi/skills/page-list-module/SKILL.md +137 -0
- package/template/.pi/skills/page-skeleton/SKILL.md +76 -0
- package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.pi/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.pi/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.pi/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.pi/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.pi/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.pi/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.pi/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.pi/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.pi/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.pi/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.pi/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.pi/skills/yss-components/SKILL.md +1 -1
- package/template/.pi/skills/yss-design-system/SKILL.md +1 -1
- package/template/.pi/skills/yss-formily/SKILL.md +233 -265
- package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.pi/skills/yss-hook/SKILL.md +1 -1
- package/template/.pi/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.pi/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.pi/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.pi/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.pi/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.pi/skills/yss-router/references/boundaries.md +1 -1
- package/template/.pi/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.pi/skills/yss-ui/SKILL.md +1 -1
- package/template/.pi/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.pi/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.pi/skills/ytable-usage/SKILL.md +251 -0
- package/template/.pi/skills/ytree-usage/SKILL.md +132 -0
- package/template/.qoder/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.qoder/skills/file-export-download/SKILL.md +160 -0
- package/template/.qoder/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.qoder/skills/formily-foundation/SKILL.md +176 -0
- package/template/.qoder/skills/formily-foundation/references/examples.md +486 -0
- package/template/.qoder/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.qoder/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.qoder/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.qoder/skills/frontend-commit/SKILL.md +118 -0
- package/template/.qoder/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.qoder/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.qoder/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.qoder/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.qoder/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.qoder/skills/page-form-module/SKILL.md +168 -0
- package/template/.qoder/skills/page-list-module/SKILL.md +137 -0
- package/template/.qoder/skills/page-skeleton/SKILL.md +76 -0
- package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.qoder/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.qoder/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.qoder/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.qoder/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.qoder/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.qoder/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.qoder/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.qoder/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.qoder/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.qoder/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.qoder/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.qoder/skills/yss-components/SKILL.md +1 -1
- package/template/.qoder/skills/yss-design-system/SKILL.md +1 -1
- package/template/.qoder/skills/yss-formily/SKILL.md +233 -265
- package/template/.qoder/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.qoder/skills/yss-hook/SKILL.md +1 -1
- package/template/.qoder/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.qoder/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.qoder/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.qoder/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.qoder/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.qoder/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.qoder/skills/yss-router/references/boundaries.md +1 -1
- package/template/.qoder/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.qoder/skills/yss-ui/SKILL.md +1 -1
- package/template/.qoder/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.qoder/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.qoder/skills/ytable-usage/SKILL.md +251 -0
- package/template/.qoder/skills/ytree-usage/SKILL.md +132 -0
- package/template/.trae/skills/.yss-skills-manifest.json +29 -0
- package/template/.trae/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.trae/skills/file-export-download/SKILL.md +160 -0
- package/template/.trae/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.trae/skills/formily-foundation/SKILL.md +176 -0
- package/template/.trae/skills/formily-foundation/references/examples.md +486 -0
- package/template/.trae/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.trae/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.trae/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.trae/skills/frontend-commit/SKILL.md +118 -0
- package/template/.trae/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.trae/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.trae/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.trae/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.trae/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.trae/skills/page-form-module/SKILL.md +168 -0
- package/template/.trae/skills/page-list-module/SKILL.md +137 -0
- package/template/.trae/skills/page-skeleton/SKILL.md +76 -0
- package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.trae/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.trae/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.trae/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.trae/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.trae/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.trae/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.trae/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.trae/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.trae/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.trae/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.trae/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.trae/skills/yss-components/SKILL.md +1 -1
- package/template/.trae/skills/yss-design-system/SKILL.md +1 -1
- package/template/.trae/skills/yss-formily/SKILL.md +233 -265
- package/template/.trae/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.trae/skills/yss-hook/SKILL.md +1 -1
- package/template/.trae/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.trae/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.trae/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.trae/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.trae/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.trae/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.trae/skills/yss-router/references/boundaries.md +1 -1
- package/template/.trae/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.trae/skills/yss-ui/SKILL.md +1 -1
- package/template/.trae/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.trae/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.trae/skills/ytable-usage/SKILL.md +251 -0
- package/template/.trae/skills/ytree-usage/SKILL.md +132 -0
- package/template/AGENTS.md +1 -13
- package/template/docs/adr/README.md +7 -0
- package/template/docs/agents/skill-migrations.md +16 -0
- package/template/docs/agents/skills-maintenance.md +2 -2
- package/template/docs/agents/yss-skill-registry.yaml +125 -25
- package/template/docs/process/implementation-repo-integration.md +1 -1
- package/template/docs/user-guide//344/272/247/345/223/201/347/240/224/345/217/221/345/205/250/347/224/237/345/221/275/345/221/250/346/234/237/346/234/200/344/275/263/345/256/236/350/267/265.md +4 -4
- package/template/docs/user-guide//347/224/237/345/221/275/345/221/250/346/234/237/346/234/200/344/275/263/345/256/236/350/267/265.md +1 -1
- package/template/scripts/lib/scenario-checks.mjs +21 -0
- package/template/scripts/lib/skill-governance.mjs +50 -0
- package/template/scripts/lib/skill-registry.mjs +82 -5
- package/template/scripts/lib/skill-supply-chain.mjs +5 -1
- package/template/scripts/verify-governance-release +7 -5
- package/template/scripts/verify-skill-governance +10 -0
- package/template/scripts/verify-template +3 -2
- package/template/skills-lock.json +285 -29
- package/template.manifest.json +30 -7
- package/template.snapshot.json +5 -4
- package/template/.agents/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.agents/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.agents/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.agents/skills/yss-formily/references/examples.md +0 -65
- package/template/.claude/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.claude/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.claude/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.claude/skills/yss-formily/references/examples.md +0 -65
- package/template/.codex/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.codex/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.codex/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.codex/skills/yss-formily/references/examples.md +0 -65
- package/template/.cursor/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.cursor/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.cursor/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.cursor/skills/yss-formily/references/examples.md +0 -65
- package/template/.hermes/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.hermes/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.hermes/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.hermes/skills/yss-formily/references/examples.md +0 -65
- package/template/.pi/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.pi/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.pi/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.pi/skills/yss-formily/references/examples.md +0 -65
- package/template/.qoder/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.qoder/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.qoder/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.qoder/skills/yss-formily/references/examples.md +0 -65
- package/template/.trae/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.trae/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.trae/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.trae/skills/yss-formily/references/examples.md +0 -65
- package/template/docs/adr/0001-product-design-prototype-entrypoint.md +0 -54
- package/template/docs/adr/0002-yss-project-repository-mode.md +0 -3
- package/template/docs/adr/0003-machine-readable-lifecycle-registry.md +0 -5
- package/template/docs/adr/0006-stable-lifecycle-ids-and-generated-structure.md +0 -5
- package/template/docs/adr/0007-lifecycle-native-work-units.md +0 -5
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# 前端 Type、Scope 与示例
|
|
2
|
+
|
|
3
|
+
## 目录
|
|
4
|
+
|
|
5
|
+
- [规则优先级](#规则优先级)
|
|
6
|
+
- [Type 选择](#type-选择)
|
|
7
|
+
- [Scope 选择](#scope-选择)
|
|
8
|
+
- [原子提交边界](#原子提交边界)
|
|
9
|
+
- [消息示例](#消息示例)
|
|
10
|
+
- [前端验证](#前端验证)
|
|
11
|
+
- [规范依据](#规范依据)
|
|
12
|
+
|
|
13
|
+
## 规则优先级
|
|
14
|
+
|
|
15
|
+
1. 仓库 commitlint 的 resolved config 和 hooks。
|
|
16
|
+
2. 仓库 `AGENTS.md`、`CONTRIBUTING.md`、提交模板及明确文档。
|
|
17
|
+
3. 当前 monorepo 的包或应用名称,以及目标路径近期的有效提交。
|
|
18
|
+
4. 本参考的通用回退规则。
|
|
19
|
+
|
|
20
|
+
仓库允许空 scope 时仍优先使用能帮助团队定位业务影响的 scope;跨全仓且没有清晰主域时可以省略。只有 commitlint 明确支持且团队历史稳定使用时才采用多 scope。
|
|
21
|
+
|
|
22
|
+
## Type 选择
|
|
23
|
+
|
|
24
|
+
| Type | 使用条件 | 不要用于 |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| `feat` | 增加用户、调用方或运维人员可感知的能力 | 纯重构或依赖升级 |
|
|
27
|
+
| `fix` | 修复错误、回归、异常状态或不符合预期的行为 | 仅格式化代码 |
|
|
28
|
+
| `docs` | 只修改文档 | 代码行为变化 |
|
|
29
|
+
| `style` | 仅空格、格式、分号等,不改变语义 | UI 样式或视觉功能变更 |
|
|
30
|
+
| `refactor` | 不增功能、不修 bug 的结构调整 | 性能优化或行为修复 |
|
|
31
|
+
| `perf` | 有明确性能收益的代码变化 | 无证据的“优化”措辞 |
|
|
32
|
+
| `test` | 只增加或修正测试 | 功能代码及其配套测试 |
|
|
33
|
+
| `build` | 构建系统、外部依赖、打包或编译配置 | 一般业务配置 |
|
|
34
|
+
| `ci` | CI/CD 配置和流水线脚本 | 本地构建配置 |
|
|
35
|
+
| `chore` | 其他不改变产品行为的维护工作 | 无法理解改动时的兜底 |
|
|
36
|
+
| `revert` | 明确回滚一个或多个既有提交 | 普通修复 |
|
|
37
|
+
|
|
38
|
+
## Scope 选择
|
|
39
|
+
|
|
40
|
+
按以下顺序选择首个清晰候选:
|
|
41
|
+
|
|
42
|
+
1. **仓库限定值**:若 `scope-enum` 生效,只能使用允许值或按规则省略。
|
|
43
|
+
2. **monorepo 包或应用**:`apps/admin-portal` 使用 `admin-portal`;`packages/design-system` 使用 `design-system`。
|
|
44
|
+
3. **业务模块**:`views/DataPush`、相关 API、hook 和测试共同实现推送任务时使用 `data-push`,不使用 `views`。
|
|
45
|
+
4. **共享能力**:确实跨业务复用时使用 `auth`、`router`、`store`、`i18n`、`api-client`、`design-system` 等已有名称。
|
|
46
|
+
5. **工程边界**:依赖升级可用 `deps`,构建和 CI 可用 `build`、`ci`;scope 不应重复无意义信息。
|
|
47
|
+
|
|
48
|
+
命名使用小写 kebab-case。优先采用仓库或产品已有术语,不自行翻译稳定模块名。`components`、`hooks`、`utils`、`views`、`index` 和具体文件名通常信息不足,只有它们本身就是对外包或仓库既定 scope 时才使用。
|
|
49
|
+
|
|
50
|
+
## 原子提交边界
|
|
51
|
+
|
|
52
|
+
- 同一功能的页面、API 适配、状态逻辑、测试和最小测试配置可以同提交。
|
|
53
|
+
- `package.json` 与对应 lockfile 必须同提交;与业务功能无关的批量依赖升级单独使用 `build(deps)`。
|
|
54
|
+
- 生成 API 客户端和消费端若共同实现同一契约能力,可按业务域提交;无关的大规模重新生成必须拆分。
|
|
55
|
+
- 顺手格式化、调试日志、个人 IDE 配置和无关文件不要混入。
|
|
56
|
+
- 两个独立业务模块或不同发布风险的改动应拆分;同一文件内无法安全分离时先请求用户决定。
|
|
57
|
+
|
|
58
|
+
## 消息示例
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
feat(data-push): 优化推送任务数据源与调度规则展示
|
|
62
|
+
|
|
63
|
+
- 将英文星期转换为中文调度描述
|
|
64
|
+
- 按数据源目录映射业务名称并补充单元测试
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
fix(auth): 修复令牌刷新并发请求重复跳转登录的问题
|
|
69
|
+
|
|
70
|
+
- 复用进行中的刷新请求,避免多个失败响应重复触发跳转
|
|
71
|
+
- 保持刷新失败后的退出流程不变
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
build(deps): 升级 Vue 与类型检查工具链
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
feat(api-client)!: 统一分页响应字段命名
|
|
80
|
+
|
|
81
|
+
- 将列表响应统一为 items 和 total
|
|
82
|
+
- 更新调用方与契约测试
|
|
83
|
+
|
|
84
|
+
BREAKING CHANGE: 原 records 字段改为 items,所有自定义适配器需同步迁移
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
错误与修正:
|
|
88
|
+
|
|
89
|
+
| 错误 | 修正方向 |
|
|
90
|
+
|---|---|
|
|
91
|
+
| `fix:修复问题` | 使用 ASCII 冒号并说明具体行为 |
|
|
92
|
+
| `fixL 新增下载` | 选择合法 type,例如 `feat(download): 支持导出任务文件` |
|
|
93
|
+
| `fix: useDataPushTasks.ts` | 描述修复结果,而不是文件名 |
|
|
94
|
+
| `feat(views): 新增用户管理` | 优先使用 `feat(user-management): ...` |
|
|
95
|
+
| `chore: 修改代码` | 先理解真实意图,再选择准确 type 和摘要 |
|
|
96
|
+
|
|
97
|
+
## 前端验证
|
|
98
|
+
|
|
99
|
+
- 根据 lockfile 选择 `pnpm`、`npm`、`yarn` 或 `bun`,优先运行 `package.json` 已有脚本。
|
|
100
|
+
- 功能或修复至少运行相关测试;类型相关变更运行 type-check;lint、format 只使用不会意外重写无关文件的检查模式。
|
|
101
|
+
- monorepo 优先运行受影响包的过滤命令,除非仓库要求全量检查。
|
|
102
|
+
- 不把“hook 会跑”当作跳过必要验证的理由;也不要编造不存在的脚本。
|
|
103
|
+
|
|
104
|
+
## 规范依据
|
|
105
|
+
|
|
106
|
+
- [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/)
|
|
107
|
+
- [commitlint:AI Agents](https://commitlint.js.org/guides/ai-agents.html)
|
|
108
|
+
- [commitlint 官方 committing-with-commitlint skill](https://github.com/conventional-changelog/commitlint/tree/master/skills/committing-with-commitlint)
|
|
109
|
+
- [Angular Commit Message Guidelines](https://github.com/angular/angular/blob/main/contributing-docs/commit-message-guidelines.md)
|
|
110
|
+
- [Git SubmittingPatches](https://git-scm.com/docs/SubmittingPatches)
|
|
111
|
+
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: java-backend-commit
|
|
3
|
+
description: 分析并提交 Java、Spring Boot、Maven、Gradle、单体服务和多模块后端项目的 Git 改动;当用户要求生成 commit message、检查提交规范、拆分原子提交、暂存并执行 git commit,或修复 commitlint 与 commit-msg hook 拒绝时使用。读取仓库实际规则、模块结构和 diff,选择服务或业务域 scope,生成英文 type/scope 与中文标题和正文,并安全验证提交。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Java 后端规范提交
|
|
7
|
+
|
|
8
|
+
## 触发条件
|
|
9
|
+
|
|
10
|
+
- 用户要求为 Java 后端项目生成 commit message、检查提交规范或执行 `git commit`。
|
|
11
|
+
- 需要将跨层改动(接口、领域、持久化、迁移、测试)拆分为可独立构建和回滚的原子提交。
|
|
12
|
+
- commitlint、`commit-msg` 或 `pre-commit` hook 拒绝提交,需要按规则修复。
|
|
13
|
+
- 适用于 Java、Spring Boot、Maven、Gradle、单体服务和多模块后端仓库。
|
|
14
|
+
|
|
15
|
+
## 不适用场景
|
|
16
|
+
|
|
17
|
+
- Vue、React 等前端或微前端仓库:使用 `../frontend-commit/SKILL.md`。
|
|
18
|
+
- yss-ui 组件库仓库自身的提交与发版:使用 `../commit-linting/SKILL.md`。
|
|
19
|
+
- 仅请求代码实现,不涉及提交信息或 `git commit` 操作。
|
|
20
|
+
- 无代码改动,或改动内容与提交请求不匹配。
|
|
21
|
+
- 合并提交、发布提交、自动依赖机器人提交和数据库基线发布:遵循仓库专用流程,不套用本技能的常规模板。
|
|
22
|
+
|
|
23
|
+
## 硬约束(禁止/必须)
|
|
24
|
+
|
|
25
|
+
- 必须把仓库规则视为最高优先级:依次遵循 `AGENTS.md`、`CONTRIBUTING.md`、Git hooks、解析后的 commitlint 配置、本地配置和近期历史;通用规则只作回退。
|
|
26
|
+
- 只在用户明确要求提交时执行暂存和 `git commit`;若仅要求提交信息或审查,只输出候选消息与依据。
|
|
27
|
+
- 必须保留用户和他人的既有改动。禁止默认使用 `git add -A`、`git add .`、`git commit -a`、`--no-verify`,也不要自动 amend、rebase、push 或改写已发布历史。
|
|
28
|
+
- 提交必须是可独立理解、构建和回滚的逻辑变更。不要按 `controller/service/repository` 技术分层拆成无法工作的提交。
|
|
29
|
+
- 遇到密钥、令牌、私钥、证书、keystore、生产口令、`.env` 实值或意外大文件时停止提交并报告具体路径,不要在输出中泄露内容。
|
|
30
|
+
- 已有暂存内容视为用户选择,除非用户授权,不要擅自取消暂存或混入其他文件。
|
|
31
|
+
- 不提交 `target/`、`build/`、IDE 缓存、日志或本地运行产物。只提交项目本来就跟踪且由本次意图产生的生成源码。
|
|
32
|
+
- 已在共享环境执行的版本化数据库迁移(Flyway、Liquibase)通常不可重写;发现修改既有迁移时先报告风险。
|
|
33
|
+
- `fixup!` 只用于用户明确要求的评审或 autosquash 工作流;revert 优先使用 Git 生成的回滚信息并保留被回滚 SHA,不要把普通反向修改伪装成 revert。
|
|
34
|
+
|
|
35
|
+
## 工作流
|
|
36
|
+
|
|
37
|
+
### 1. 建立仓库契约
|
|
38
|
+
|
|
39
|
+
1. 确认仓库根目录、当前分支和工作树状态。
|
|
40
|
+
2. 搜索并读取仓库级说明、贡献指南、提交模板、commitlint 配置和 `commit-msg`、`pre-commit` hooks。
|
|
41
|
+
3. 读取根 `pom.xml`、`settings.gradle` 或 `settings.gradle.kts` 以及相关模块构建文件,确认 Maven `artifactId`、Gradle 子项目、服务和限界上下文。
|
|
42
|
+
4. 如果仓库使用 commitlint,优先使用本地依赖读取解析后的配置;不要为了校验联网安装依赖。没有 Node 工具时,直接读取 hook 和配置文件并按仓库命令验证。
|
|
43
|
+
5. 查看相关模块近期的非 merge 提交,了解仓库已经形成的 scope、工单 footer、DCO 和语言习惯,但不要复制历史中的明显错误。
|
|
44
|
+
|
|
45
|
+
### 2. 审查真实改动
|
|
46
|
+
|
|
47
|
+
至少检查:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git status --short --branch
|
|
51
|
+
git diff --cached --name-status
|
|
52
|
+
git diff --cached
|
|
53
|
+
git diff --name-status
|
|
54
|
+
git diff
|
|
55
|
+
git ls-files --others --exclude-standard
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- 同时理解暂存区、未暂存区和未跟踪文件;结合 API、领域模型、持久化、配置和测试判断真实行为。
|
|
59
|
+
- 将同一业务能力所需的接口、应用服务、领域逻辑、持久化、迁移和测试作为候选原子单元,而不是按目录机械拆分。
|
|
60
|
+
- 检查 Flyway、Liquibase 等数据库变更是否触碰既有版本化迁移。
|
|
61
|
+
- 若无改动、改动与请求不符、多个逻辑变更无法安全拆分,先说明并停止。需要逐行拆分同一文件时,不要靠猜测改写暂存区。
|
|
62
|
+
|
|
63
|
+
### 3. 选择 type、scope 与正文
|
|
64
|
+
|
|
65
|
+
先读取 `./references/scope-and-examples.md`,再按「标准代码骨架」的格式生成。
|
|
66
|
+
|
|
67
|
+
- type 默认从 `feat/fix/docs/style/refactor/perf/test/chore/revert/build/ci` 中选择,但仓库枚举优先。
|
|
68
|
+
- scope 优先级为:仓库枚举 → Maven artifactId 或 Gradle 子项目 → 服务或限界上下文 → 跨模块能力。使用小写 kebab-case;不要仅使用 `controller`、`service`、`repository` 或类名。
|
|
69
|
+
- 标题使用英文 type/scope、ASCII `:` 和中文摘要;描述业务、调用方或运维可感知的结果,不写“修改代码”或单个 Java 类名。
|
|
70
|
+
- 默认将完整 header 控制在 72 个字符内;仓库存在更严格限制时服从仓库。标题末尾不加句号,不用 emoji 或全角冒号。
|
|
71
|
+
- 简单单文件变更可以没有 body;跨层实现、数据迁移、并发或事务修复、重要功能和行为变化使用 body 解释做了什么、为什么以及如何验证。
|
|
72
|
+
- REST/GraphQL/RPC 契约、事件格式、公共 Java API、配置语义或数据库兼容性发生真实破坏时,使用 `!` 和 `BREAKING CHANGE:` 并写迁移方式。
|
|
73
|
+
- 仅在已知编号或仓库要求时加入工单、DCO、`Signed-off-by` 等 footer,禁止编造;不要因为 Spring 项目采用 DCO 就推断所有 Java 项目都必须签署。
|
|
74
|
+
|
|
75
|
+
### 4. 验证并提交
|
|
76
|
+
|
|
77
|
+
1. 优先使用仓库 wrapper:Maven 使用 `./mvnw`,Gradle 使用 `./gradlew`;根据模块和变更运行已有的最小充分测试、编译、静态检查和格式检查。
|
|
78
|
+
2. 通过仓库已有命令校验完整候选消息。commitlint 存在时使用 stdin 校验 header、body 和 footer;退出码为 0 才继续。
|
|
79
|
+
3. 仅暂存属于当前原子提交的明确路径或安全 hunks,再重新检查 `git diff --cached --check`、`--name-status` 和完整 staged diff。
|
|
80
|
+
4. 执行正常 `git commit`,允许 hooks 运行。
|
|
81
|
+
5. hook 若格式化或修改文件,重新检查 staged 与 working tree,确认实际提交内容没有漂移。
|
|
82
|
+
6. 提交成功后检查 `git show --stat --oneline --decorate HEAD` 和 `git status --short`,向用户报告 commit hash、消息、已运行检查以及剩余未提交改动。
|
|
83
|
+
|
|
84
|
+
## 标准代码骨架
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
type(scope)!: 中文行为摘要
|
|
88
|
+
|
|
89
|
+
- 说明关键行为或原因
|
|
90
|
+
- 说明兼容性、迁移、测试或必要约束
|
|
91
|
+
|
|
92
|
+
BREAKING CHANGE: 说明不兼容影响和迁移方式
|
|
93
|
+
Refs: 已知工单号
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
示例:
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
fix(settlement): 修复重复回调导致结算流水重复入账的问题
|
|
100
|
+
|
|
101
|
+
- 使用业务幂等键拦截已处理回调
|
|
102
|
+
- 保留失败回调的可重试能力
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## 交付检查清单
|
|
106
|
+
|
|
107
|
+
- [ ] type 与 scope 通过仓库校验规则,完整消息经仓库命令校验通过。
|
|
108
|
+
- [ ] scope 来自仓库枚举、构建模块或业务域,未使用 `controller`、`service`、`repository` 或类名兜底。
|
|
109
|
+
- [ ] 标题为英文 type/scope + ASCII 冒号 + 中文摘要,完整 header 不超过 72 字符。
|
|
110
|
+
- [ ] 提交可独立理解、构建和回滚;数据库迁移与对应实体、查询和测试同提交。
|
|
111
|
+
- [ ] 暂存区不包含 `target/`、`build/`、日志或本地运行产物。
|
|
112
|
+
- [ ] 已使用仓库 wrapper 运行与变更范围匹配的最小充分检查。
|
|
113
|
+
- [ ] 提交后已核对 `git show --stat` 与 `git status --short`,并向用户报告 hash 与剩余改动。
|
|
114
|
+
|
|
115
|
+
## 失败兜底策略
|
|
116
|
+
|
|
117
|
+
- 无法区分 `feat`、`fix`、`refactor` 时继续检查需求和行为;仍有高影响歧义则询问用户,不自动降级为 `chore`。
|
|
118
|
+
- hook 拒绝时按输出修正并重新校验,绝不使用 `--no-verify`。
|
|
119
|
+
- 仓库 parser 或 hook 不支持标准破坏性标记时,不要绕过校验或静默删掉标记;报告规则冲突,并采用仓库明确批准的兼容方案。
|
|
120
|
+
- 两个独立业务域或不同发布风险的改动无法安全拆分时,先给出拆分方案并停止;同一文件内无法分离时请求用户决定。
|
|
121
|
+
- 发现修改既有版本化迁移、密钥或意外大文件时停止提交,报告具体路径并等待用户处理。
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Java 后端 Type、Scope 与示例
|
|
2
|
+
|
|
3
|
+
## 目录
|
|
4
|
+
|
|
5
|
+
- [规则优先级](#规则优先级)
|
|
6
|
+
- [Type 选择](#type-选择)
|
|
7
|
+
- [Scope 选择](#scope-选择)
|
|
8
|
+
- [原子提交边界](#原子提交边界)
|
|
9
|
+
- [消息示例](#消息示例)
|
|
10
|
+
- [Java 验证](#java-验证)
|
|
11
|
+
- [规范依据](#规范依据)
|
|
12
|
+
|
|
13
|
+
## 规则优先级
|
|
14
|
+
|
|
15
|
+
1. 仓库 commitlint 的 resolved config 和 hooks。
|
|
16
|
+
2. 仓库 `AGENTS.md`、`CONTRIBUTING.md`、提交模板及明确文档。
|
|
17
|
+
3. Maven/Gradle 模块定义、稳定业务术语及目标路径近期的有效提交。
|
|
18
|
+
4. 本参考的通用回退规则。
|
|
19
|
+
|
|
20
|
+
仓库允许空 scope 时仍优先使用能说明服务或业务域的 scope;跨全仓且没有清晰主域时可以省略。只有仓库明确要求时才添加工单 footer、DCO 或签名。
|
|
21
|
+
|
|
22
|
+
## Type 选择
|
|
23
|
+
|
|
24
|
+
| Type | 使用条件 | 不要用于 |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| `feat` | 新增 API、业务能力、运维能力或可用配置 | 纯重构或依赖升级 |
|
|
27
|
+
| `fix` | 修复错误结果、异常、回归、事务或并发缺陷 | 仅格式化代码 |
|
|
28
|
+
| `docs` | 只修改文档或 Javadoc | 代码行为变化 |
|
|
29
|
+
| `style` | 仅格式、空格、导入排序等,不改变语义 | 接口或 UI 风格变化 |
|
|
30
|
+
| `refactor` | 不增功能、不修 bug 的结构调整 | 性能优化或行为修复 |
|
|
31
|
+
| `perf` | 有明确性能收益的代码或查询变化 | 无证据的“优化”措辞 |
|
|
32
|
+
| `test` | 只增加或修正测试 | 功能代码及其配套测试 |
|
|
33
|
+
| `build` | Maven/Gradle、依赖、插件、打包或编译配置 | 一般业务配置 |
|
|
34
|
+
| `ci` | CI/CD 配置和流水线脚本 | 本地构建配置 |
|
|
35
|
+
| `chore` | 其他不改变产品行为的维护工作 | 无法理解改动时的兜底 |
|
|
36
|
+
| `revert` | 明确回滚一个或多个既有提交 | 普通修复 |
|
|
37
|
+
|
|
38
|
+
## Scope 选择
|
|
39
|
+
|
|
40
|
+
按以下顺序选择首个清晰候选:
|
|
41
|
+
|
|
42
|
+
1. **仓库限定值**:若 `scope-enum` 生效,只能使用允许值或按规则省略。
|
|
43
|
+
2. **构建模块**:Maven 使用稳定的 `artifactId`,Gradle 使用子项目名,例如 `order-service`、`risk-engine`。
|
|
44
|
+
3. **服务或限界上下文**:单模块项目按稳定业务域使用 `order`、`customer`、`settlement`、`valuation` 等名称。
|
|
45
|
+
4. **跨模块能力**:确实横跨业务域时使用仓库已有的 `api`、`db`、`security`、`messaging`、`observability`、`deps`、`build` 或 `ci`。
|
|
46
|
+
|
|
47
|
+
命名使用小写 kebab-case。优先采用 `pom.xml`、Gradle settings、包名和产品文档中的既有术语。`controller`、`service`、`repository`、`entity`、`common` 和具体类名通常不能表达业务影响,不应作为默认 scope。
|
|
48
|
+
|
|
49
|
+
## 原子提交边界
|
|
50
|
+
|
|
51
|
+
- 同一业务能力的 controller、application/domain service、repository、DTO、迁移和测试可以同提交,确保提交可构建和回滚。
|
|
52
|
+
- 公共契约与所有必需调用方修改通常同提交;若仓库支持分阶段兼容迁移,则按兼容阶段拆分。
|
|
53
|
+
- `pom.xml`、version catalog 或 Gradle 文件与其 lock/verification metadata 一起提交;无关依赖升级单独使用 `build(deps)`。
|
|
54
|
+
- Flyway/Liquibase 新迁移与对应实体、查询和测试可同提交;不要顺手重写已发布版本化迁移。
|
|
55
|
+
- 两个独立业务域、不同发布风险或不同回滚策略的改动应拆分;同一文件内无法安全分离时先请求用户决定。
|
|
56
|
+
|
|
57
|
+
## 消息示例
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
feat(order): 支持批量取消待支付订单
|
|
61
|
+
|
|
62
|
+
- 增加批量取消接口并复用单笔状态校验
|
|
63
|
+
- 保持已支付订单处理和审计记录不变
|
|
64
|
+
- 补充事务回滚与部分非法状态测试
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
fix(settlement): 修复重复回调导致结算流水重复入账的问题
|
|
69
|
+
|
|
70
|
+
- 使用业务幂等键拦截已处理回调
|
|
71
|
+
- 保留失败回调的可重试能力
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
build(deps): 升级 Spring Boot 与数据库驱动
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
feat(customer-api)!: 统一客户查询响应结构
|
|
80
|
+
|
|
81
|
+
- 将分页数据统一为 items 和 total
|
|
82
|
+
- 更新 OpenAPI 契约与消费者测试
|
|
83
|
+
|
|
84
|
+
BREAKING CHANGE: 原 records 字段改为 items,调用方需更新反序列化模型
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
perf(valuation): 批量加载估值参数以减少重复查询
|
|
89
|
+
|
|
90
|
+
- 将逐条查询合并为按产品批量加载
|
|
91
|
+
- 增加查询次数断言并验证计算结果保持一致
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
错误与修正:
|
|
95
|
+
|
|
96
|
+
| 错误 | 修正方向 |
|
|
97
|
+
|---|---|
|
|
98
|
+
| `fix:修改 OrderService` | 使用 ASCII 冒号并描述修复结果 |
|
|
99
|
+
| `feat(controller): 新增接口` | 使用服务、模块或业务域 scope |
|
|
100
|
+
| `chore: 修改数据库` | 判断是功能、修复、性能还是构建变化 |
|
|
101
|
+
| `fix(order): 修复 bug` | 说明错误场景和用户可感知结果 |
|
|
102
|
+
|
|
103
|
+
## Java 验证
|
|
104
|
+
|
|
105
|
+
- 优先使用 wrapper,避免依赖开发机全局 Maven 或 Gradle 版本。
|
|
106
|
+
- Maven 多模块可基于真实模块使用 `./mvnw -pl <module> -am test`;Gradle 可使用 `./gradlew :<module>:test`。不要编造模块路径或任务。
|
|
107
|
+
- API 变更运行契约或集成测试;数据库变更运行迁移和 repository 测试;并发、事务和性能变更运行能证明关键性质的测试。
|
|
108
|
+
- 使用仓库已有 Checkstyle、SpotBugs、PMD、Error Prone、JaCoCo 或格式检查任务;不要擅自引入新工具。
|
|
109
|
+
- 测试产生的 `target/`、`build/`、日志和报告不得进入提交。
|
|
110
|
+
|
|
111
|
+
## 规范依据
|
|
112
|
+
|
|
113
|
+
- [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/)
|
|
114
|
+
- [commitlint:AI Agents](https://commitlint.js.org/guides/ai-agents.html)
|
|
115
|
+
- [commitlint 官方 committing-with-commitlint skill](https://github.com/conventional-changelog/commitlint/tree/master/skills/committing-with-commitlint)
|
|
116
|
+
- [Spring Framework CONTRIBUTING](https://github.com/spring-projects/spring-framework/blob/main/CONTRIBUTING.md)
|
|
117
|
+
- [Git SubmittingPatches](https://git-scm.com/docs/SubmittingPatches)
|
|
118
|
+
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: page-form-module
|
|
3
|
+
description: 指导实现 YSS UI 新增、编辑和查看表单模块,覆盖 YFormily Schema、mode 0/1/2、详情渲染、数据回显与回填、表单值被意外清空排查、校验、提交 loading、弹窗销毁和列表刷新;当页面包含表单页、Modal 或 Drawer 表单,或编辑时回显丢失、提交后表单未重置时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Page Form Module Skill
|
|
7
|
+
|
|
8
|
+
## 触发条件
|
|
9
|
+
|
|
10
|
+
- 实现新增、编辑、查看表单页,或 Drawer/Modal 中的表单闭环。
|
|
11
|
+
- 需要处理 Schema、mode 0/1/2、回填、校验、提交和成功后列表刷新。
|
|
12
|
+
|
|
13
|
+
## 不适用场景
|
|
14
|
+
|
|
15
|
+
- 页面只包含列表查询,不包含任何表单编辑。
|
|
16
|
+
- 表单为分步流程:使用 `formily-step-flow`。
|
|
17
|
+
- 仅修复单个联动表达式:使用 `formily-linkage-effects`。
|
|
18
|
+
|
|
19
|
+
## 必读依赖
|
|
20
|
+
|
|
21
|
+
- 表单基础:`../formily-foundation/SKILL.md`
|
|
22
|
+
- 联动副作用:`../formily-linkage-effects/SKILL.md`
|
|
23
|
+
- 模式与详情:`../formily-mode-slot-detail/SKILL.md`
|
|
24
|
+
- 分步表单:`../formily-step-flow/SKILL.md`
|
|
25
|
+
- 接口与错误处理:`../yss-api-integration/SKILL.md`
|
|
26
|
+
|
|
27
|
+
## 文档检索
|
|
28
|
+
|
|
29
|
+
1. MCP 可用时,先用 `get_component_docs` 查询 `YFormily` 的 `mode`、`detail-options`、实例提交与回填 API,再按场景用 `get_demo` 获取 `formily/modes`、`formily/group`、`formily/linkage` 或 `formily/steps` 示例。
|
|
30
|
+
2. 精确查询无结果时,先用 `search_docs` 或 `list_components` 校正名称;仅在 MCP 不可用、调用失败或校正后仍无结果时,回退读取最新 `llms-full.txt`。文档版本与当前依赖不一致时,再核对当前源码、CodeGraph 和真实导出。
|
|
31
|
+
3. 当前会话已经加载上述本地 Skill 时,不要再通过 MCP 重复查询同一 Skill;仅在依赖 Skill 缺失时使用 `list_skills`、`get_skill` 补齐规则。
|
|
32
|
+
|
|
33
|
+
## 硬约束(禁止/必须)
|
|
34
|
+
|
|
35
|
+
- 提交前必须调用 `formRef.submit()` 或 `Submit.onSubmit` 进入完整校验链路。
|
|
36
|
+
- `open/mode/currentId/formModel/submitting` 和回填、提交、关闭方法收敛在同一 Hook。
|
|
37
|
+
- **数据前置同步原则(必守)**:表单数据必须在 `openCreate`/`openEdit` 触发前**同步赋好 `formModel.value`**;**严禁**在弹窗/抽屉组件内部通过 `watch(visible) + await nextTick() + initForm()` 异步回填数据(会导致首次编辑正常,切换新增再编辑时因时序差读取到残留空对象导致回显变空白的经典 Bug)。
|
|
38
|
+
- **单一信任源**:使用 `v-model="formModel"` + `ref="formRef"` 调用 `submit()` 驱动;**严禁**在组件顶层写 `const form = createForm()` 与 `v-model`、`form.setValues`、`form.reset` 混用。
|
|
39
|
+
- **禁止滥用动态 `:key`**:**严禁**在 `YFormily`/`YssFormily` 上使用 `:key="isEdit ? 'edit' : 'create'"` 等强制 Remount,应直接通过 `:mode` 或响应式数据驱动。
|
|
40
|
+
- **弹窗生命周期隔离**:Modal/Drawer 必须配置 `:destroy-on-close="true"`,且内部 `YFormily` 必须使用 `v-if="open"` 随容器打开挂载、关闭销毁,避免宽度为 0 导致栅格退化,并彻底回收脏状态。
|
|
41
|
+
- 新增/编辑/查看使用 `YFormily :mode="mode"`,`mode=2` 不渲染保存按钮。
|
|
42
|
+
- Drawer 默认使用响应式宽度;基础表单设置 `FormLayout { labelWidth: 140, labelAlign: 'right' }`。
|
|
43
|
+
- Drawer/Modal 中的 `FormGrid` 默认使用 `maxColumns: 2`、`minColumns: 1`、`minWidth: 320~360`;禁止 `minColumns: 2` 锁死两列。
|
|
44
|
+
- 备注、说明和长文本通过 `x-decorator-props.gridSpan` 跨满整行。
|
|
45
|
+
- 下拉选择器异步数据源必须使用 `enum` 或 `x-reactions` / `field.dataSource` 注入,严禁写入 `x-component-props.options`;基础字典下拉优先在弹窗打开前 `await` 拉取完成或在页面初始化提前拉取。
|
|
46
|
+
- **表单校验规则规范**:必填文本字段声明 `whitespace: true`(如 `{ required: true, whitespace: true, message: '请输入xxx' }`);自定义长度与格式校验必须使用条件式函数,空值放行交由 `required` 报错,非空才校验具体规则,禁止多个自定义校验重复承担必填职责。YFormily 适配层虽会归一化反馈展示,但不能代替正确的 Schema 语义。
|
|
47
|
+
- 长整型 ID 按字符串原样回填和提交,禁止 `Number()`/`parseInt()`;表单中的普通数值按生成 DTO 真实类型处理。
|
|
48
|
+
- 禁止使用 `if (res?.success)` 包裹保存成功逻辑,也禁止在 `catch` 重复 `message.error`。
|
|
49
|
+
|
|
50
|
+
## 标准代码骨架
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import { ref } from 'vue';
|
|
54
|
+
|
|
55
|
+
/** 默认表单模型 */
|
|
56
|
+
const createDefaultModel = () => ({
|
|
57
|
+
name: '',
|
|
58
|
+
code: '',
|
|
59
|
+
description: '',
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
/** YFormily 业务侧仅需的实例方法。 */
|
|
63
|
+
interface FormilyFormRef {
|
|
64
|
+
submit: () => Promise<Record<string, unknown>>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** 管理表单的模式、可见性、数据模型与提交链路。 */
|
|
68
|
+
export const useRuleForm = (onSuccess: () => void) => {
|
|
69
|
+
const open = ref(false);
|
|
70
|
+
const mode = ref<0 | 1 | 2>(0);
|
|
71
|
+
const currentId = ref<string>();
|
|
72
|
+
const formModel = ref(createDefaultModel());
|
|
73
|
+
const submitting = ref(false);
|
|
74
|
+
const formRef = ref<FormilyFormRef>();
|
|
75
|
+
|
|
76
|
+
/** 打开新增:同步赋空值 */
|
|
77
|
+
const openCreate = (): void => {
|
|
78
|
+
mode.value = 0;
|
|
79
|
+
currentId.value = undefined;
|
|
80
|
+
formModel.value = createDefaultModel();
|
|
81
|
+
open.value = true;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** 打开编辑:同步赋目标行数据,前置完成回填 */
|
|
85
|
+
const openEdit = (record: Record<string, any>): void => {
|
|
86
|
+
mode.value = 1;
|
|
87
|
+
currentId.value = record.id;
|
|
88
|
+
formModel.value = {
|
|
89
|
+
name: record.name ?? '',
|
|
90
|
+
code: record.code ?? '',
|
|
91
|
+
description: record.description ?? '',
|
|
92
|
+
};
|
|
93
|
+
open.value = true;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/** 关闭并清理 */
|
|
97
|
+
const close = (): void => {
|
|
98
|
+
open.value = false;
|
|
99
|
+
formModel.value = createDefaultModel();
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/** 校验并保存表单。 */
|
|
103
|
+
const submit = async (): Promise<void> => {
|
|
104
|
+
if (mode.value === 2 || submitting.value || !formRef.value) return;
|
|
105
|
+
|
|
106
|
+
submitting.value = true;
|
|
107
|
+
try {
|
|
108
|
+
const values = await formRef.value.submit();
|
|
109
|
+
await saveRule({ ...formModel.value, ...values, id: currentId.value });
|
|
110
|
+
close();
|
|
111
|
+
onSuccess();
|
|
112
|
+
} catch {
|
|
113
|
+
// Formily 校验反馈或 mutator 已展示错误,此处不重复 Toast。
|
|
114
|
+
} finally {
|
|
115
|
+
submitting.value = false;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
return { open, mode, currentId, formModel, submitting, formRef, openCreate, openEdit, close, submit };
|
|
120
|
+
};
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`saveRule` 必须替换为当前 Orval 真实生成方法,不得照抄占位名。
|
|
124
|
+
|
|
125
|
+
```vue
|
|
126
|
+
<YFormily
|
|
127
|
+
v-if="open"
|
|
128
|
+
ref="formRef"
|
|
129
|
+
v-model="formModel"
|
|
130
|
+
:schema="schema"
|
|
131
|
+
:mode="mode"
|
|
132
|
+
:detail-options="{ bordered: true, maxColumns: 2, minColumns: 1, minWidth: 320 }"
|
|
133
|
+
/>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
/** Drawer 表单的基础布局 Schema。 */
|
|
138
|
+
export const drawerFormLayout = {
|
|
139
|
+
type: 'void',
|
|
140
|
+
'x-component': 'FormLayout',
|
|
141
|
+
'x-component-props': { layout: 'horizontal', labelWidth: 140, labelAlign: 'right' },
|
|
142
|
+
properties: {
|
|
143
|
+
grid: {
|
|
144
|
+
type: 'void',
|
|
145
|
+
'x-component': 'FormGrid',
|
|
146
|
+
'x-component-props': { maxColumns: 2, minColumns: 1, minWidth: 340, columnGap: 24, rowGap: 16 },
|
|
147
|
+
properties: {},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## 交付检查清单
|
|
154
|
+
|
|
155
|
+
- [ ] `mode=0/1/2` 语义、回填和查看态渲染正确。
|
|
156
|
+
- [ ] 提交先校验,又防重入,loading 始终在 `finally` 恢复。
|
|
157
|
+
- [ ] Drawer/Modal 内 `YFormily` 按可见性条件挂载与销毁。
|
|
158
|
+
- [ ] label 宽度和右对齐一致,FormGrid 能从 2 列响应式收缩为 1 列。
|
|
159
|
+
- [ ] 长字段已跨行,长整型 ID 未转 number。
|
|
160
|
+
- [ ] 没有 `if (res?.success)` 和重复错误 Toast。
|
|
161
|
+
- [ ] 成功后关闭表单并通知上层刷新。
|
|
162
|
+
- [ ] 业务层未导入 `@formily/antdv` UI 组件。
|
|
163
|
+
|
|
164
|
+
## 失败兜底策略
|
|
165
|
+
|
|
166
|
+
- 提交无响应时,先确认 `submit()` 是否实际调用并查看 Formily 校验反馈。
|
|
167
|
+
- 编辑回填异常时,核对真实 DTO、字段路径与 Schema path,不在模板散落转换。
|
|
168
|
+
- 表单过大时,拆分 Schema 生成函数、字典 Hook 和提交 Hook,保持 `index.vue` 不超过 150 行。
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: page-list-module
|
|
3
|
+
description: 指导实现 YSS UI 标准列表、远程分页、查询重置、YTable 工具栏、行操作、批量操作和左树右表模块;当页面需要查询、表格、分页或 CRUD 列表闭环时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Page List Module Skill
|
|
7
|
+
|
|
8
|
+
## 触发条件
|
|
9
|
+
|
|
10
|
+
- 实现查询、表格、分页、行操作或批量操作组合的业务列表。
|
|
11
|
+
- 实现左树右表、远程分页、工具栏或列设置。
|
|
12
|
+
|
|
13
|
+
## 不适用场景
|
|
14
|
+
|
|
15
|
+
- 仅实现表单提交,没有列表或分页。
|
|
16
|
+
- 仅展示本地静态数据,不涉及业务查询与列表操作。
|
|
17
|
+
|
|
18
|
+
## 必读依赖
|
|
19
|
+
|
|
20
|
+
- 组件选型:`../component-selection-imports/SKILL.md`
|
|
21
|
+
- 表格 API:`../ytable-usage/SKILL.md`
|
|
22
|
+
- 查询表单:`../yss-formily/SKILL.md`
|
|
23
|
+
- 接口、错误链路和长整型:`../yss-api-integration/SKILL.md`
|
|
24
|
+
- 左树右表高度:`../ytree-usage/SKILL.md`、`../yss-use-tree-height/SKILL.md`、`../yss-use-table-height/SKILL.md`
|
|
25
|
+
|
|
26
|
+
## 文档检索
|
|
27
|
+
|
|
28
|
+
1. MCP 可用时,按当前页面实际使用的能力调用 `get_component_docs` 查询 `YTable`、`YFormily`、`useTableHeight` 或 `useTreeHeight`,再用 `get_demo` 获取对应官方示例;不要只凭 Skill 内的静态片段推断 API。
|
|
29
|
+
2. 精确查询无结果时,先用 `search_docs` 或 `list_components` 校正名称;仅在 MCP 不可用、调用失败或校正后仍无结果时,回退读取最新 `llms-full.txt`。文档版本与当前依赖不一致时,再核对当前源码、CodeGraph 和真实导出。
|
|
30
|
+
3. 当前会话已经加载上述本地 Skill 时,不要再通过 MCP 重复查询同一 Skill;仅在依赖 Skill 缺失时使用 `list_skills`、`get_skill` 补齐规则。
|
|
31
|
+
|
|
32
|
+
## 硬约束(禁止/必须)
|
|
33
|
+
|
|
34
|
+
- 列表请求必须收敛在 `useXxxList`,模板不直接请求。
|
|
35
|
+
- 后端查询参数可用 `pageIndex/pageSize`;YTable 分页状态必须使用 `current/pageSize/total`。
|
|
36
|
+
- 远程分页必须配置 `pageable`、`pagination.remote = true`、`v-model:pagination` 和 `@page-change`;事件参数固定为 `{ current, pageSize }`,禁止读取 `currentPage`。
|
|
37
|
+
- 禁止臆造 `request`/`search-params` 等 Prop,也禁止把实例 `refresh()` 当成远程重新查询;该方法只调用 vxe `updateData()` 刷新当前表格数据,远程查询/重置/刷新必须调用业务 Hook。
|
|
38
|
+
- 查询区使用纵向 `search-content`:`YFormily` 仅渲染字段,查询/重置按钮在外部 `.xxx__search-actions` 独占下一行并右对齐。
|
|
39
|
+
- 新增、导入、批量操作等主操作直接放入 `#toolbar-right` 插槽即可自动渲染;**无需配置 `:toolbar-config="{ custom: true }"`**,避免无端展示列设置图标;**仅在业务明确需要列设置时才传入 `:toolbar-config="{ custom: true }"`**。
|
|
40
|
+
- 删除等危险操作默认使用 `actionConfig.buttons[].isConfirm` 按钮项气泡确认,禁止默认使用居中 `Modal.confirm`。
|
|
41
|
+
- 列定义、状态映射和筛选配置放入 `constant.ts`;超过 10 行的列不得内联在 `index.vue`。
|
|
42
|
+
- 长整型 ID 保持字符串透传,禁止 `Number()`/`parseInt()` 等会丢失精度的转换;页码、状态值等普通 number 按真实生成类型使用。
|
|
43
|
+
- 禁止使用 `if (res?.success)` 包裹成功逻辑,也禁止在 `else`/`catch` 重复调用 `message.error`;mutator 已对 `success === false` 提示并 reject。
|
|
44
|
+
|
|
45
|
+
## 标准代码骨架
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { reactive, ref } from 'vue';
|
|
49
|
+
|
|
50
|
+
/** 管理规则列表数据、查询条件和远程分页。 */
|
|
51
|
+
export const useRuleList = () => {
|
|
52
|
+
const loading = ref(false);
|
|
53
|
+
const dataList = ref<RuleItem[]>([]);
|
|
54
|
+
const query = reactive<RuleQuery>({ pageIndex: 1, pageSize: 20, keyword: '' });
|
|
55
|
+
const pagination = reactive({ current: 1, pageSize: 20, total: 0, remote: true });
|
|
56
|
+
|
|
57
|
+
/** 请求规则列表;错误 Toast 由 mutator 处理。 */
|
|
58
|
+
const fetchData = async (): Promise<void> => {
|
|
59
|
+
loading.value = true;
|
|
60
|
+
try {
|
|
61
|
+
query.pageIndex = pagination.current;
|
|
62
|
+
query.pageSize = pagination.pageSize;
|
|
63
|
+
const res = await queryRuleList(query);
|
|
64
|
+
dataList.value = res.data ?? [];
|
|
65
|
+
pagination.total = res.totalCount ?? 0;
|
|
66
|
+
} catch {
|
|
67
|
+
dataList.value = [];
|
|
68
|
+
pagination.total = 0;
|
|
69
|
+
} finally {
|
|
70
|
+
loading.value = false;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** 处理页码或每页数量变化。 */
|
|
75
|
+
const handlePageChange = ({ current, pageSize }: { current: number; pageSize: number }): void => {
|
|
76
|
+
pagination.current = current;
|
|
77
|
+
pagination.pageSize = pageSize;
|
|
78
|
+
void fetchData();
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** 从第一页执行查询。 */
|
|
82
|
+
const handleSearch = (): void => {
|
|
83
|
+
pagination.current = 1;
|
|
84
|
+
void fetchData();
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** 重置查询条件并回到第一页。 */
|
|
88
|
+
const handleReset = (): void => {
|
|
89
|
+
Object.assign(query, { pageIndex: 1, pageSize: pagination.pageSize, keyword: '' });
|
|
90
|
+
pagination.current = 1;
|
|
91
|
+
void fetchData();
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return { loading, dataList, query, pagination, fetchData, handlePageChange, handleSearch, handleReset };
|
|
95
|
+
};
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`RuleItem`、`RuleQuery`、`queryRuleList` 必须替换为当前 Orval 生成类型和真实方法,禁止照抄占位名。
|
|
99
|
+
|
|
100
|
+
```vue
|
|
101
|
+
<YTable
|
|
102
|
+
v-if="isReady"
|
|
103
|
+
ref="tableRef"
|
|
104
|
+
v-model:selected-row-keys="selectedRowKeys"
|
|
105
|
+
:row-config="{ keyField: 'id', useKey: true }"
|
|
106
|
+
:data="dataList"
|
|
107
|
+
:columns="TABLE_COLUMNS"
|
|
108
|
+
:loading="loading"
|
|
109
|
+
:height="tableHeight"
|
|
110
|
+
pageable
|
|
111
|
+
v-model:pagination="pagination"
|
|
112
|
+
@page-change="handlePageChange"
|
|
113
|
+
>
|
|
114
|
+
<template #toolbar-right>
|
|
115
|
+
<YButton :disabled="selectedRowKeys.length === 0" @click="handleBatchDelete">批量删除</YButton>
|
|
116
|
+
<YButton type="primary" @click="openCreate">新增</YButton>
|
|
117
|
+
</template>
|
|
118
|
+
</YTable>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## 交付检查清单
|
|
122
|
+
|
|
123
|
+
- [ ] 已确认真实 Orval 导出、查询 DTO 和响应字段。
|
|
124
|
+
- [ ] 查询参数与 YTable 分页字段已映射,`page-change` 回调读取 `current/pageSize` 而非 `currentPage`。
|
|
125
|
+
- [ ] 若包含批量操作,首列已配置 `type: 'checkbox'`,设置了 `:row-config="{ keyField: 'xxx', useKey: true }"`,批量按钮配置了 `:disabled="selectedRowKeys.length === 0"`,操作成功后已清空选中态。
|
|
126
|
+
- [ ] 查询/重置会回到第一页,远程分页配置完整。
|
|
127
|
+
- [ ] 主操作在 `#toolbar-right`,列设置已开启。
|
|
128
|
+
- [ ] 删除使用气泡确认,操作按钮的 loading/close 在成功与失败后都会恢复。
|
|
129
|
+
- [ ] 长整型 ID 未转 number,普通 number 仍符合真实类型。
|
|
130
|
+
- [ ] 没有 `if (res?.success)` 和重复错误 Toast。
|
|
131
|
+
- [ ] loading、空态和失败后数据状态可预期。
|
|
132
|
+
|
|
133
|
+
## 失败兜底策略
|
|
134
|
+
|
|
135
|
+
- 分页字段混乱时,在 Hook 中分离 YTable 状态和后端参数,不直接把 `pageIndex/totalCount` 绑到组件。
|
|
136
|
+
- 列表逻辑过大时,拆分 `useListData` 和 `useListActions`,不得回填到 `index.vue`。
|
|
137
|
+
- 响应字段不稳定时,在 Hook API 边界做最小映射,禁止在模板散落兼容分支。
|