@bovinphang/frontend-craft 2.7.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +378 -305
- package/CHANGELOG.zh-CN.md +377 -304
- package/CONTRIBUTING.md +371 -361
- package/CONTRIBUTING.zh-CN.md +371 -361
- package/README.md +545 -493
- package/README.openclaw.md +359 -264
- package/README.openclaw.zh-CN.md +359 -264
- package/README.zh-CN.md +545 -493
- package/agents/fec-architect.md +70 -70
- package/agents/fec-code-reviewer.md +103 -82
- package/agents/fec-debugger.md +20 -20
- package/agents/fec-design-token-mapper.md +36 -36
- package/agents/fec-doc-updater.md +13 -13
- package/agents/fec-e2e-runner.md +45 -45
- package/agents/fec-figma-implementer.md +59 -59
- package/agents/fec-performance-optimizer.md +128 -128
- package/agents/fec-refactor-cleaner.md +17 -14
- package/agents/fec-refactoring-expert.md +81 -0
- package/agents/fec-security-reviewer.md +82 -67
- package/agents/fec-test-planner.md +27 -27
- package/agents/fec-typescript-reviewer.md +103 -87
- package/agents/fec-ui-checker.md +64 -64
- package/commands/fec-debug.md +19 -19
- package/commands/fec-doc-sync.md +11 -11
- package/commands/fec-init.md +37 -38
- package/commands/fec-plan.md +58 -58
- package/commands/fec-refactor-clean.md +11 -11
- package/commands/fec-refactor-plan.md +17 -0
- package/commands/fec-refactor.md +18 -0
- package/commands/fec-review.md +71 -41
- package/commands/fec-scaffold.md +41 -41
- package/commands/fec-smell.md +17 -0
- package/commands/fec-tdd.md +17 -13
- package/dist/bin/frontend-craft.js +190 -36
- package/dist/hooks/fec-run-tests.js +5 -1
- package/dist/hooks/fec-session-start.js +1 -1
- package/docs/example-prompts.md +157 -137
- package/docs/ja-JP/README.md +534 -493
- package/docs/ko-KR/README.md +534 -493
- package/docs/project-structure.md +151 -123
- package/docs/refactoring/README.md +50 -0
- package/docs/refactoring/catalog.md +105 -0
- package/docs/refactoring/smell-refactoring-matrix.md +41 -0
- package/docs/review-and-diagram-workflows.md +39 -0
- package/docs/runtimes/antigravity.md +18 -10
- package/docs/runtimes/augment.md +18 -10
- package/docs/runtimes/claude.md +191 -177
- package/docs/runtimes/claude.zh-CN.md +189 -175
- package/docs/runtimes/cline.md +18 -10
- package/docs/runtimes/codebuddy.md +18 -10
- package/docs/runtimes/codex.md +18 -10
- package/docs/runtimes/compatibility.md +27 -0
- package/docs/runtimes/copilot.md +18 -10
- package/docs/runtimes/cursor.md +18 -10
- package/docs/runtimes/gemini.md +18 -10
- package/docs/runtimes/kilo.md +18 -10
- package/docs/runtimes/openclaw.md +18 -10
- package/docs/runtimes/opencode.md +18 -10
- package/docs/runtimes/qoder.md +18 -19
- package/docs/runtimes/trae.md +18 -10
- package/docs/runtimes/windsurf.md +18 -10
- package/docs/superpowers/plans/2026-09-26-content-integrity.md +145 -0
- package/docs/superpowers/plans/2026-09-26-diagram-quality.md +170 -0
- package/docs/superpowers/specs/2026-09-26-diagram-quality-design.md +77 -0
- package/docs/superpowers/specs/2026-09-26-project-optimization-design.md +95 -0
- package/docs/zh-CN/example-prompts.md +157 -137
- package/docs/zh-CN/project-structure.md +148 -123
- package/docs/zh-CN/review-and-diagram-workflows.md +39 -0
- package/docs/zh-TW/README.md +534 -493
- package/localized/zh-CN/agents/fec-architect.md +125 -0
- package/localized/zh-CN/agents/fec-code-reviewer.md +171 -0
- package/localized/zh-CN/agents/fec-debugger.md +44 -0
- package/localized/zh-CN/agents/fec-design-token-mapper.md +75 -0
- package/localized/zh-CN/agents/fec-doc-updater.md +30 -0
- package/localized/zh-CN/agents/fec-e2e-runner.md +107 -0
- package/localized/zh-CN/agents/fec-figma-implementer.md +104 -0
- package/localized/zh-CN/agents/fec-performance-optimizer.md +293 -0
- package/localized/zh-CN/agents/fec-refactor-cleaner.md +35 -0
- package/localized/zh-CN/agents/fec-refactoring-expert.md +53 -0
- package/localized/zh-CN/agents/fec-security-reviewer.md +132 -0
- package/localized/zh-CN/agents/fec-test-planner.md +50 -0
- package/localized/zh-CN/agents/fec-typescript-reviewer.md +158 -0
- package/localized/zh-CN/agents/fec-ui-checker.md +120 -0
- package/localized/zh-CN/commands/fec-debug.md +30 -0
- package/localized/zh-CN/commands/fec-doc-sync.md +19 -0
- package/localized/zh-CN/commands/fec-init.md +70 -0
- package/localized/zh-CN/commands/fec-plan.md +94 -0
- package/localized/zh-CN/commands/fec-refactor-clean.md +19 -0
- package/localized/zh-CN/commands/fec-refactor-plan.md +15 -0
- package/localized/zh-CN/commands/fec-refactor.md +14 -0
- package/localized/zh-CN/commands/fec-review.md +97 -0
- package/localized/zh-CN/commands/fec-scaffold.md +205 -0
- package/localized/zh-CN/commands/fec-smell.md +13 -0
- package/localized/zh-CN/commands/fec-tdd.md +25 -0
- package/localized/zh-CN/skills/TEMPLATE.md +155 -0
- package/localized/zh-CN/skills/eval_queries.json +1257 -0
- package/localized/zh-CN/skills/fec-accessibility-check/SKILL.md +39 -0
- package/localized/zh-CN/skills/fec-accessibility-check/references/report-template.md +23 -0
- package/localized/zh-CN/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
- package/localized/zh-CN/skills/fec-alchemy/SKILL.md +74 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/absorption-plan-template.md +47 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/intake-template.md +55 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/review-checklist.md +31 -0
- package/localized/zh-CN/skills/fec-alchemy/references/methodology.md +94 -0
- package/localized/zh-CN/skills/fec-alchemy/references/originality-and-licensing.md +57 -0
- package/localized/zh-CN/skills/fec-api-integration/SKILL.md +78 -0
- package/localized/zh-CN/skills/fec-api-integration/references/integration-patterns.md +80 -0
- package/localized/zh-CN/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
- package/localized/zh-CN/skills/fec-browser-storage/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-browser-storage/references/storage-patterns.md +65 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/SKILL.md +66 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
- package/localized/zh-CN/skills/fec-code-review/SKILL.md +162 -0
- package/localized/zh-CN/skills/fec-code-review/references/report-template.md +39 -0
- package/localized/zh-CN/skills/fec-code-smells/SKILL.md +33 -0
- package/localized/zh-CN/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-catalog.md +817 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- package/localized/zh-CN/skills/fec-component-testing/SKILL.md +119 -0
- package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +62 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/query-patterns.md +103 -0
- package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +157 -0
- package/localized/zh-CN/skills/fec-debug-framework/references/report-template.md +58 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
- package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +39 -0
- package/localized/zh-CN/skills/fec-drawio-studio/SKILL.md +73 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/brand-icons.json +878 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/shape-index.json +83570 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/data-residency.md +27 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/schema.json +112 -0
- package/localized/zh-CN/skills/fec-e2e-testing/SKILL.md +42 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
- package/localized/zh-CN/skills/fec-form-handling/SKILL.md +76 -0
- package/localized/zh-CN/skills/fec-form-handling/references/advanced-form-patterns.md +101 -0
- package/localized/zh-CN/skills/fec-image-generation/SKILL.md +110 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/localized/zh-CN/skills/fec-image-generation/references/artifact-routing.md +80 -0
- package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +81 -0
- package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +243 -0
- package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +37 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +332 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +462 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1537 -0
- package/localized/zh-CN/skills/fec-implement-from-design/SKILL.md +129 -0
- package/localized/zh-CN/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/SKILL.md +46 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
- package/localized/zh-CN/skills/fec-legacy-web-standard/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
- package/localized/zh-CN/skills/fec-list-virtualization/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-list-virtualization/references/virtualization-patterns.md +80 -0
- package/localized/zh-CN/skills/fec-monorepo-project-standard/SKILL.md +142 -0
- package/localized/zh-CN/skills/fec-motion-interaction/SKILL.md +73 -0
- package/localized/zh-CN/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
- package/localized/zh-CN/skills/fec-nextjs-project-standard/SKILL.md +123 -0
- package/localized/zh-CN/skills/fec-nuxt-project-standard/SKILL.md +122 -0
- package/localized/zh-CN/skills/fec-performance-optimization/SKILL.md +80 -0
- package/localized/zh-CN/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
- package/localized/zh-CN/skills/fec-performance-optimization/references/report-template.md +59 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
- package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +91 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
- package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +54 -0
- package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -0
- package/localized/zh-CN/skills/fec-refactoring/SKILL.md +83 -0
- package/localized/zh-CN/skills/fec-refactoring/references/principles.md +43 -0
- package/localized/zh-CN/skills/fec-refactoring/references/refactoring-vs-feature-change.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring/references/when-to-refactor.md +17 -0
- package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +59 -0
- package/localized/zh-CN/skills/fec-refactoring-api/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/SKILL.md +21 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/selection-guide.md +41 -0
- package/localized/zh-CN/skills/fec-refactoring-control/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/localized/zh-CN/skills/fec-refactoring-data/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/SKILL.md +52 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/behavior-preservation.md +15 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +25 -0
- package/localized/zh-CN/skills/fec-responsive-layout/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-responsive-layout/references/responsive-layout-patterns.md +70 -0
- package/localized/zh-CN/skills/fec-route-protection/SKILL.md +135 -0
- package/localized/zh-CN/skills/fec-security-review/SKILL.md +54 -0
- package/localized/zh-CN/skills/fec-security-review/references/report-template.md +37 -0
- package/localized/zh-CN/skills/fec-security-review/references/security-checklist.md +64 -0
- package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +87 -0
- package/localized/zh-CN/skills/fec-state-management/SKILL.md +140 -0
- package/localized/zh-CN/skills/fec-state-management/references/state-patterns.md +109 -0
- package/localized/zh-CN/skills/fec-storybook-component-doc/SKILL.md +37 -0
- package/localized/zh-CN/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
- package/localized/zh-CN/skills/fec-svg-animation/SKILL.md +148 -0
- package/localized/zh-CN/skills/fec-tailwind-design-system/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +59 -0
- package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +55 -0
- package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +45 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/SKILL.md +54 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety-patterns.md +102 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety.md +148 -0
- package/localized/zh-CN/skills/fec-ui-design/SKILL.md +108 -0
- package/localized/zh-CN/skills/fec-ui-design/data/product-rules.json +231 -0
- package/localized/zh-CN/skills/fec-ui-design/data/stack-ui-rules.json +146 -0
- package/localized/zh-CN/skills/fec-ui-design/data/style-archetypes.json +373 -0
- package/localized/zh-CN/skills/fec-ui-design/data/ux-quality-rules.json +203 -0
- package/localized/zh-CN/skills/fec-ui-design/references/design-intelligence.md +97 -0
- package/localized/zh-CN/skills/fec-ui-design/references/master-page-overrides.md +30 -0
- package/localized/zh-CN/skills/fec-ui-design/references/pre-delivery-checklist.md +39 -0
- package/localized/zh-CN/skills/fec-ui-design/scripts/design-system.mjs +648 -0
- package/localized/zh-CN/skills/fec-validation-fix/SKILL.md +51 -0
- package/localized/zh-CN/skills/fec-validation-fix/references/report-template.md +43 -0
- package/localized/zh-CN/skills/fec-vite-project-standard/SKILL.md +83 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +58 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +162 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +176 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/SKILL.md +61 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/content-plan.md +38 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/theme-system.md +36 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
- package/localized/zh-CN/skills/fec-web-workers/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-web-workers/references/advanced-workers.md +54 -0
- package/localized/zh-CN/skills/fec-web-workers/references/basic-worker.md +67 -0
- package/localized/zh-CN/skills/metadata.json +2004 -0
- package/localized/zh-CN/skills/relations.json +1023 -0
- package/localized/zh-CN/templates/claude/CLAUDE.md +106 -0
- package/localized/zh-CN/templates/claude/settings.json +62 -0
- package/localized/zh-CN/templates/codex/AGENTS.md +105 -0
- package/localized/zh-CN/templates/codex/config.toml +32 -0
- package/localized/zh-CN/templates/openclaw/AGENTS.md +101 -0
- package/localized/zh-CN/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
- package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +55 -0
- package/localized/zh-CN/templates/shared/rules/fec-api-layer.md +99 -0
- package/localized/zh-CN/templates/shared/rules/fec-ci-cd.md +40 -0
- package/localized/zh-CN/templates/shared/rules/fec-code-comments.md +33 -0
- package/localized/zh-CN/templates/shared/rules/fec-design-system.md +72 -0
- package/localized/zh-CN/templates/shared/rules/fec-error-handling.md +56 -0
- package/localized/zh-CN/templates/shared/rules/fec-git-conventions.md +73 -0
- package/localized/zh-CN/templates/shared/rules/fec-i18n.md +64 -0
- package/localized/zh-CN/templates/shared/rules/fec-naming-conventions.md +120 -0
- package/localized/zh-CN/templates/shared/rules/fec-performance.md +101 -0
- package/localized/zh-CN/templates/shared/rules/fec-react.md +82 -0
- package/localized/zh-CN/templates/shared/rules/fec-refactoring.md +47 -0
- package/localized/zh-CN/templates/shared/rules/fec-rendering-patterns.md +40 -0
- package/localized/zh-CN/templates/shared/rules/fec-responsive-design.md +50 -0
- package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +31 -0
- package/localized/zh-CN/templates/shared/rules/fec-state-management.md +60 -0
- package/localized/zh-CN/templates/shared/rules/fec-testing.md +98 -0
- package/localized/zh-CN/templates/shared/rules/fec-typescript.md +112 -0
- package/localized/zh-CN/templates/shared/rules/fec-vue.md +64 -0
- package/localized/zh-CN/templates/shared/rules/fec-working-modes.md +50 -0
- package/openclaw.plugin.json +2 -3
- package/package.json +28 -17
- package/skills/TEMPLATE.md +74 -74
- package/skills/eval_queries.json +922 -678
- package/skills/fec-accessibility-check/SKILL.md +21 -21
- package/skills/fec-accessibility-check/references/report-template.md +12 -12
- package/skills/fec-accessibility-check/references/screen-reader-testing.md +24 -24
- package/skills/fec-alchemy/SKILL.md +50 -50
- package/skills/fec-alchemy/assets/absorption-plan-template.md +32 -32
- package/skills/fec-alchemy/assets/intake-template.md +55 -55
- package/skills/fec-alchemy/assets/review-checklist.md +23 -23
- package/skills/fec-alchemy/references/methodology.md +66 -66
- package/skills/fec-alchemy/references/originality-and-licensing.md +42 -42
- package/skills/fec-api-integration/SKILL.md +61 -61
- package/skills/fec-api-integration/references/integration-patterns.md +30 -30
- package/skills/fec-backend-requirements-handoff/SKILL.md +25 -25
- package/skills/fec-browser-storage/SKILL.md +16 -16
- package/skills/fec-browser-storage/references/storage-patterns.md +16 -16
- package/skills/fec-canvas-threejs/SKILL.md +21 -21
- package/skills/fec-canvas-threejs/references/rendering-patterns.md +10 -10
- package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +37 -37
- package/skills/fec-code-review/SKILL.md +113 -94
- package/skills/fec-code-review/references/report-template.md +23 -13
- package/skills/fec-code-smells/SKILL.md +33 -0
- package/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/skills/fec-code-smells/references/smell-catalog.md +861 -0
- package/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- package/skills/fec-component-testing/SKILL.md +39 -39
- package/skills/fec-data-fetching/SKILL.md +16 -16
- package/skills/fec-data-fetching/references/query-patterns.md +27 -27
- package/skills/fec-debug-framework/SKILL.md +95 -95
- package/skills/fec-debug-framework/references/report-template.md +34 -34
- package/skills/fec-dependency-upgrade/SKILL.md +17 -17
- package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +31 -31
- package/skills/fec-doc-sync/SKILL.md +23 -23
- package/skills/fec-drawio-studio/SKILL.md +42 -38
- package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +1 -1
- package/skills/fec-drawio-studio/data/shape-index.json +83570 -0
- package/skills/fec-drawio-studio/references/diagram-patterns.md +19 -0
- package/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
- package/skills/fec-drawio-studio/references/layout-and-export.md +18 -3
- package/skills/fec-drawio-studio/references/xml-and-mermaid.md +5 -1
- package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +62 -0
- package/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
- package/skills/fec-drawio-studio/scripts/shape-query.mjs +55 -15
- package/skills/fec-e2e-testing/SKILL.md +24 -24
- package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +20 -20
- package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +10 -10
- package/skills/fec-e2e-testing/references/e2e-visual-regression.md +17 -17
- package/skills/fec-e2e-testing/references/playwright-patterns.md +6 -6
- package/skills/fec-form-handling/SKILL.md +21 -21
- package/skills/fec-form-handling/references/advanced-form-patterns.md +41 -41
- package/skills/fec-image-generation/SKILL.md +84 -29
- package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/skills/fec-image-generation/references/diagram-workflows.md +41 -3
- package/skills/fec-image-generation/references/html-technical-diagrams.md +243 -0
- package/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
- package/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/skills/fec-image-generation/scripts/export-diagram.mjs +332 -0
- package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
- package/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
- package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1537 -0
- package/skills/fec-implement-from-design/SKILL.md +81 -81
- package/skills/fec-implement-from-design/references/design-plan-template.md +16 -16
- package/skills/fec-legacy-to-modern-migration/SKILL.md +29 -29
- package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +81 -81
- package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +37 -37
- package/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +31 -31
- package/skills/fec-legacy-web-standard/SKILL.md +17 -17
- package/skills/fec-legacy-web-standard/references/legacy-patterns.md +16 -16
- package/skills/fec-list-virtualization/SKILL.md +16 -16
- package/skills/fec-list-virtualization/references/virtualization-patterns.md +31 -31
- package/skills/fec-monorepo-project-standard/SKILL.md +52 -52
- package/skills/fec-motion-interaction/SKILL.md +51 -51
- package/skills/fec-motion-interaction/references/motion-patterns.md +11 -11
- package/skills/fec-nextjs-project-standard/SKILL.md +64 -64
- package/skills/fec-nuxt-project-standard/SKILL.md +57 -57
- package/skills/fec-performance-optimization/SKILL.md +54 -54
- package/skills/fec-performance-optimization/references/framework-performance-patterns.md +23 -23
- package/skills/fec-performance-optimization/references/report-template.md +31 -31
- package/skills/fec-pwa-implementation/SKILL.md +17 -17
- package/skills/fec-pwa-implementation/references/manifest-and-icons.md +12 -12
- package/skills/fec-pwa-implementation/references/service-worker-workbox.md +13 -13
- package/skills/fec-react-project-standard/SKILL.md +72 -72
- package/skills/fec-react-project-standard/references/react-performance-patterns.md +28 -28
- package/skills/fec-react-project-standard/references/react-project-structure.md +112 -112
- package/skills/fec-react-project-standard/references/react-quality-patterns.md +72 -72
- package/skills/fec-react-project-standard/references/react-runtime-patterns.md +94 -94
- package/skills/fec-refactor-clean/SKILL.md +33 -30
- package/skills/fec-refactor-clean/references/report-template.md +23 -23
- package/skills/fec-refactoring/SKILL.md +83 -0
- package/skills/fec-refactoring/references/principles.md +60 -0
- package/skills/fec-refactoring/references/refactoring-vs-feature-change.md +27 -0
- package/skills/fec-refactoring/references/when-to-refactor.md +31 -0
- package/skills/fec-refactoring/references/workflow.md +90 -0
- package/skills/fec-refactoring-api/SKILL.md +25 -0
- package/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/skills/fec-refactoring-catalog/SKILL.md +28 -0
- package/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/skills/fec-refactoring-catalog/references/selection-guide.md +47 -0
- package/skills/fec-refactoring-control/SKILL.md +25 -0
- package/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/skills/fec-refactoring-data/SKILL.md +25 -0
- package/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/skills/fec-refactoring-validation/SKILL.md +59 -0
- package/skills/fec-refactoring-validation/references/behavior-preservation.md +53 -0
- package/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +42 -0
- package/skills/fec-responsive-layout/SKILL.md +17 -17
- package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +37 -37
- package/skills/fec-route-protection/SKILL.md +26 -26
- package/skills/fec-security-review/SKILL.md +36 -20
- package/skills/fec-security-review/references/report-template.md +22 -12
- package/skills/fec-security-review/references/security-checklist.md +27 -27
- package/skills/fec-source-driven-development/SKILL.md +59 -59
- package/skills/fec-state-management/SKILL.md +34 -34
- package/skills/fec-state-management/references/state-patterns.md +19 -19
- package/skills/fec-storybook-component-doc/SKILL.md +19 -19
- package/skills/fec-storybook-component-doc/references/story-patterns.md +12 -12
- package/skills/fec-svg-animation/SKILL.md +32 -32
- package/skills/fec-tailwind-design-system/SKILL.md +17 -17
- package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +36 -36
- package/skills/fec-tdd-workflow/SKILL.md +32 -28
- package/skills/fec-testing-strategy/SKILL.md +29 -29
- package/skills/fec-typescript-project-standard/SKILL.md +38 -38
- package/skills/fec-typescript-project-standard/references/type-safety-patterns.md +20 -20
- package/skills/fec-typescript-project-standard/references/type-safety.md +18 -18
- package/skills/fec-ui-design/SKILL.md +90 -90
- package/skills/fec-ui-design/references/design-intelligence.md +61 -61
- package/skills/fec-ui-design/references/master-page-overrides.md +15 -15
- package/skills/fec-ui-design/references/pre-delivery-checklist.md +38 -38
- package/skills/fec-validation-fix/SKILL.md +26 -26
- package/skills/fec-validation-fix/references/report-template.md +25 -25
- package/skills/fec-vite-project-standard/SKILL.md +39 -39
- package/skills/fec-vue3-project-standard/SKILL.md +38 -38
- package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +36 -36
- package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +8 -8
- package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +112 -112
- package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +74 -74
- package/skills/fec-web-video-presentation/SKILL.md +33 -33
- package/skills/fec-web-workers/SKILL.md +16 -16
- package/skills/fec-web-workers/references/advanced-workers.md +13 -13
- package/skills/fec-web-workers/references/basic-worker.md +8 -8
- package/skills/metadata.json +485 -116
- package/skills/relations.json +268 -0
- package/templates/claude/CLAUDE.md +60 -60
- package/templates/codex/AGENTS.md +76 -76
- package/templates/codex/config.toml +4 -4
- package/templates/openclaw/AGENTS.md +68 -68
- package/templates/openclaw/OPENCLAW-CONFIG.md +8 -8
- package/templates/shared/rules/fec-agent-workflow.md +41 -40
- package/templates/shared/rules/fec-api-layer.md +52 -52
- package/templates/shared/rules/fec-ci-cd.md +29 -29
- package/templates/shared/rules/fec-code-comments.md +22 -22
- package/templates/shared/rules/fec-design-system.md +53 -53
- package/templates/shared/rules/fec-error-handling.md +40 -40
- package/templates/shared/rules/fec-git-conventions.md +42 -42
- package/templates/shared/rules/fec-i18n.md +48 -48
- package/templates/shared/rules/fec-naming-conventions.md +91 -91
- package/templates/shared/rules/fec-performance.md +78 -78
- package/templates/shared/rules/fec-react.md +58 -58
- package/templates/shared/rules/fec-refactoring.md +34 -34
- package/templates/shared/rules/fec-rendering-patterns.md +36 -36
- package/templates/shared/rules/fec-responsive-design.md +37 -37
- package/templates/shared/rules/fec-source-driven-development.md +22 -22
- package/templates/shared/rules/fec-state-management.md +56 -56
- package/templates/shared/rules/fec-testing.md +64 -64
- package/templates/shared/rules/fec-typescript.md +75 -75
- package/templates/shared/rules/fec-vue.md +42 -42
- package/templates/shared/rules/fec-working-modes.md +34 -34
- package/docs/superpowers/plans/2026-05-29-fec-debug.md +0 -491
- package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +0 -340
- package/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-security-reviewer
|
|
3
|
-
description:
|
|
3
|
+
description: "Focus on front-end and browser-side security reviews: XSS, client key leaks, dangerous DOM/API usage, third-party scripts, CSP, dependencies and supply chains, certified state storage, etc. Actively delegate after changes in user input, authentication, payment, upload, dynamic HTML, external link fetch, etc.; output grading conclusions and write them into reports. Preferred when users require front-end security review, pre-exploitation self-check, or review of OWASP-related client risks."
|
|
4
4
|
tools: Read, Edit, Write, MultiEdit, Glob, Grep, LS, Bash
|
|
5
5
|
model: sonnet
|
|
6
6
|
permissionMode: default
|
|
@@ -13,104 +13,119 @@ skills:
|
|
|
13
13
|
- fec-nextjs-project-standard
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
You are a security reviewer focused on **front-end and browser attack surfaces**. The mission is to discover exploitable client vulnerabilities, configuration errors and supply chain risks before going online; **user input and URLs are not trusted by default**, and it is clear that "front-end verification cannot replace the back-end".
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
For detailed report templates, hierarchical titles and placement agreements, see **`fec-security-review`** Skill; this agent focuses on **workflow, commands and front-end OWASP inspection items**.
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Review modes and coverage
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
2. **密钥与敏感数据** — 打进客户端 bundle 的 secret、误用的 `NEXT_PUBLIC_` / `VITE_` 暴露、日志与上报中的 PII/Token。
|
|
24
|
-
3. **输入与输出** — `dangerouslySetInnerHTML`、`v-html`、模板字符串拼 HTML、`eval`、动态脚本 URL。
|
|
25
|
-
4. **认证与会话(客户端可见部分)** — Token 存取位置(httpOnly vs localStorage)、URL 传敏感字段、客户端鉴权仅作 UX 的误判。
|
|
26
|
-
5. **依赖与供应链** — `npm audit`、已知 CVE、lockfile 异常、非官方 CDN 脚本、缺 SRI 的第三方资源。
|
|
27
|
-
6. **安全编码习惯** — CSP 建议、HTTPS 混合内容、`target="_blank"` 未加 `rel` 等。
|
|
22
|
+
User-specified scope takes precedence over the default. Follow the three modes in `fec-code-review`:
|
|
28
23
|
|
|
29
|
-
|
|
24
|
+
- **Change review**: only when recent changes, current edits, staged changes, a PR or a commit are explicitly requested or clearly established by the active task, review those changes and necessary context. For local changes, inspect staged and unstaged diffs and relevant untracked project files within the requested scope; a staged-only request reviews only staged changes. If there are no changes, report that there is nothing to review; do not switch to recent commits or expand scope automatically.
|
|
25
|
+
- **Targeted review**: when files or directories are specified, inventory and review existing code in that scope, including unchanged code; no Git diff is required.
|
|
26
|
+
- **Project review (default)**: when no scope or change context is specified, or when the entire project is requested, inventory project-owned frontend code, related tests, configuration and dependency declarations, then review in module batches, including unchanged code; no Git diff is required.
|
|
27
|
+
|
|
28
|
+
Select scope before collecting diffs. A file/directory alone means full review of that scope; a path combined with an explicit change request restricts incremental review to that path. An unqualified invocation defaults to project review even if Git changes exist. At review start, state the selected mode and target scope. When automatically delegating review after edits, pass the current change scope explicitly; do not trigger project review merely because the reviewer was called.
|
|
29
|
+
|
|
30
|
+
Exclude dependency directories, build outputs, caches, generated files and third-party code by default, and record exclusions. Keep the frontend responsibility boundary; this is not a backend audit. A nonexistent target or a scope with no relevant files must be reported explicitly, not replaced with another scope.
|
|
31
|
+
|
|
32
|
+
Merge findings with the same root cause across batches. Report **review mode, target scope, reviewed files/modules, exclusions, unreviewed files/modules, completion status and verification commands/results**. If context or execution limits prevent completion, mark the review partial and list remaining modules; never claim complete project coverage. Reading callers for context or running project-wide lint/typecheck does not count as manual review of those files.
|
|
33
|
+
|
|
34
|
+
Change reviews retain merge recommendations. Targeted and project reviews use a risk assessment (Low / Medium / High, with blocking findings), not a claim of merge readiness. Preserve severity levels, evidence requirements and report filenames. Output reports only unless repairs are explicitly requested.
|
|
35
|
+
|
|
36
|
+
## Core Responsibilities
|
|
37
|
+
|
|
38
|
+
1. **Vulnerability Identification** — Common vulnerabilities for SPA/SSR frontends (XSS, open redirects, insecure links, postMessage, prototype pollution risks, etc.).
|
|
39
|
+
2. **Keys and Sensitive Data** — Secrets entered into client bundles, misused `NEXT_PUBLIC_` / `VITE_` exposed, PII/Token in logs and reports.
|
|
40
|
+
3. **Input and Output** — `dangerouslySetInnerHTML`, `v-html`, template string spelling HTML, `eval`, dynamic script URL.
|
|
41
|
+
4. **Authentication and session (visible part of client)** — Token access location (httpOnly vs localStorage), URL transmission sensitive fields, and client authentication are only for UX misjudgment.
|
|
42
|
+
5. **Dependencies and Supply Chain** — `npm audit`, known CVEs, lockfile exceptions, unofficial CDN scripts, third-party resources lacking SRI.
|
|
43
|
+
6. **Secure Coding Practices** — CSP recommendations, HTTPS mixed content, `target="_blank"` without `rel`, etc.
|
|
44
|
+
|
|
45
|
+
## Analysis command (executed when the warehouse allows it)
|
|
30
46
|
|
|
31
47
|
```bash
|
|
32
48
|
npm audit --audit-level=high
|
|
33
|
-
#
|
|
49
|
+
# or pnpm audit / yarn npm audit, whichever is the project
|
|
34
50
|
```
|
|
35
51
|
|
|
36
|
-
|
|
52
|
+
If the project is configured:
|
|
37
53
|
|
|
38
54
|
```bash
|
|
39
55
|
npx eslint . --max-warnings 0
|
|
40
|
-
#
|
|
56
|
+
# If eslint-plugin-security, etc. exist, include them in the interpretation of the results.
|
|
41
57
|
```
|
|
42
58
|
|
|
43
|
-
|
|
59
|
+
And **Grep** high-risk patterns in the code base: `dangerouslySetInnerHTML`, `v-html`, `innerHTML`, `eval(`, `document.write`, `__NEXT_PUBLIC`, `VITE_.*SECRET`, hardcoded `sk-`, `Bearer ` etc. (note the "false positive" below).
|
|
44
60
|
|
|
45
|
-
##
|
|
61
|
+
## Review workflow
|
|
46
62
|
|
|
47
|
-
### 1.
|
|
63
|
+
### 1. First scan
|
|
48
64
|
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
65
|
+
- Run dependency audits; retrieve hardcoded keys and suspicious environment variable usage.
|
|
66
|
+
- Priority review: **Login/callback, payment, upload, rich text, management background, webhook page, external link preview**.
|
|
67
|
+
- Establish threat boundaries first: user input, authentication state, jumps, dynamic HTML, uploads, sensitive operations, third-party scripts, dependencies and client-side storage.
|
|
68
|
+
- Each high-risk conclusion must describe the exploitable path, affected data, and server-side boundary requirements.
|
|
53
69
|
|
|
54
|
-
### 2.
|
|
70
|
+
### 2. Front-end mapping to OWASP (spot check list)
|
|
55
71
|
|
|
56
|
-
1.
|
|
57
|
-
2.
|
|
58
|
-
3.
|
|
59
|
-
4. **XXE** —
|
|
60
|
-
5.
|
|
61
|
-
6.
|
|
62
|
-
7. **XSS** — React/Vue
|
|
63
|
-
8.
|
|
64
|
-
9.
|
|
65
|
-
10.
|
|
72
|
+
1. **Injection (DOM/XSS)** — Is user data frame-escaped? Is the rich text sanitized (DOMPurify, etc.)? Insert `<script>` dynamically?
|
|
73
|
+
2. **Invalid access control (client performance)** — Is the UI that only hides buttons considered "no permissions"? Are sensitive routes guarded only by front-end routing?
|
|
74
|
+
3. **Sensitive data exposure** - Do the source map, error stack, and client logs leak internal paths or tokens? `localStorage` Does refresh token exist?
|
|
75
|
+
4. **XXE** — Browser side XML parsing is less; if you use `DOMParser` to handle untrusted XML, you must still be cautious.
|
|
76
|
+
5. **Access Control and CORS** — Does the front end mistakenly assume that "same origin means security"? Whether to mix `credentials` and wildcard `*` CORS (mostly backend configuration, can be marked as requiring backend confirmation).
|
|
77
|
+
6. **Security configuration error** — Whether CSP, HSTS, and Referrer-Policy are missing (recommended, subject to the deployment layer); whether the debug switch is turned on in production.
|
|
78
|
+
7. **XSS** — Are React/Vue default escaping bypassed? `url(javascript:...)`, SVG, Markdown rendering pipeline.
|
|
79
|
+
8. **Unsafe deserialization** — `JSON.parse` untrusted string, `new Function`, untrusted `postMessage` data not verified.
|
|
80
|
+
9. **Known Vulnerable Component** — audit results and lockfile changes.
|
|
81
|
+
10. **Logs and Monitoring** — Whether security events can be distinguished in client reports; whether keys should not be buried in secrets.
|
|
66
82
|
|
|
67
|
-
### 3.
|
|
83
|
+
### 3. Code pattern cheat sheet (front-end)
|
|
68
84
|
|
|
69
|
-
|
|
|
85
|
+
| Mode | Severity Level | Processing Direction |
|
|
70
86
|
|------|----------|----------|
|
|
71
|
-
|
|
|
72
|
-
| `dangerouslySetInnerHTML` / `v-html`
|
|
73
|
-
| `fetch(userControlledUrl)` / `window.open(
|
|
74
|
-
| `postMessage`
|
|
75
|
-
| Token
|
|
76
|
-
|
|
|
77
|
-
| `target="_blank"`
|
|
78
|
-
| `eval` / `new Function`
|
|
79
|
-
|
|
|
87
|
+
| API Secret readable by source code/built products | CRITICAL | Move to the server or only use public capabilities + back-end proxy |
|
|
88
|
+
| `dangerouslySetInnerHTML` / `v-html` Unsanitized | HIGH→CRITICAL | DOMPurify or disable HTML |
|
|
89
|
+
| `fetch(userControlledUrl)` / `window.open(user URL)` | HIGH | Whitelist domain, protocol verification |
|
|
90
|
+
| `postMessage` unchecked `origin` | HIGH | strict `event.origin` with whitelist |
|
|
91
|
+
| Token stored in clear text `localStorage` | HIGH | httpOnly Cookie or shortened lived + backend rotation strategy |
|
|
92
|
+
| No third-party scripts `integrity` | MEDIUM→HIGH | SRI + Trusted CDN |
|
|
93
|
+
| `target="_blank"` None `rel="noopener noreferrer"` | LOW→MEDIUM | Complete defense `window.opener` |
|
|
94
|
+
| `eval` / `new Function` Contains user fragments | CRITICAL | Eliminate or move out of sandbox |
|
|
95
|
+
| Log printing password/Token | MEDIUM | Desensitization or deletion |
|
|
80
96
|
|
|
81
|
-
##
|
|
97
|
+
## Key Principles
|
|
82
98
|
|
|
83
|
-
1.
|
|
84
|
-
2.
|
|
85
|
-
3.
|
|
86
|
-
4.
|
|
87
|
-
5.
|
|
99
|
+
1. **Defense in Depth** — Output encoding + CSP + multiple layers of backend verification.
|
|
100
|
+
2. **MINIMAL EXPOSURE** — No unnecessary secrets and internal interface details are sent to the browser.
|
|
101
|
+
3. **Safe failure** — The error message does not expose the stack and internal ID (within control).
|
|
102
|
+
4. **Untrusted input** — URL, query, hash, `postMessage`, and storage playback are all considered untrusted until verification.
|
|
103
|
+
5. **Dependency Update** — Provide upgrade or replacement suggestions for high-risk CVEs.
|
|
88
104
|
|
|
89
|
-
##
|
|
105
|
+
## Common false positives (check the context first)
|
|
90
106
|
|
|
91
|
-
- `.env.example
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
107
|
+
- Placeholder in `.env.example`.
|
|
108
|
+
- Explicitly marked fake token in test files (still must avoid confusion with production configuration).
|
|
109
|
+
- A **really public** client ID (such as an OAuth client id) - distinguished from **client secret**.
|
|
110
|
+
- SHA256 for file verification instead of password storage.
|
|
95
111
|
|
|
96
|
-
##
|
|
112
|
+
## When CRITICAL is found
|
|
97
113
|
|
|
98
|
-
1.
|
|
99
|
-
|
|
100
|
-
3. 若密钥已进仓库历史,建议**轮换**并检查 CI/环境变量泄露面。
|
|
114
|
+
1. Write `reports/security-review-YYYY-MM-DD-HHmmss.md`, the entry is clear and reproducible.2. Pin **Blocking Merge** and fix examples (code level) in the conclusion.
|
|
115
|
+
3. If the key has been entered into the warehouse history, it is recommended to **rotate** and check the CI/environment variable leakage surface.
|
|
101
116
|
|
|
102
|
-
##
|
|
117
|
+
## When to delegate
|
|
103
118
|
|
|
104
|
-
-
|
|
105
|
-
-
|
|
119
|
+
- **Should**: New login/payment/upload, rich text, Markdown rendering, external link jump, OAuth callback, any `innerHTML` class API, dependency on major version upgrade.
|
|
120
|
+
- **IMMEDIATELY**: Suspected XSS/key leaks, dependencies on critical CVEs, front-end changes associated with production security incidents.
|
|
106
121
|
|
|
107
|
-
##
|
|
122
|
+
## Success Criteria
|
|
108
123
|
|
|
109
|
-
-
|
|
110
|
-
-
|
|
124
|
+
- No unprocessed CRITICAL; HIGH with a remediation plan or clear risk acceptance statement.
|
|
125
|
+
- There are no improper keys on the client; high-risk dependencies are concluded; the list can be traced back to files and line numbers.
|
|
111
126
|
|
|
112
|
-
##
|
|
127
|
+
## Relationship with Skill
|
|
113
128
|
|
|
114
|
-
|
|
129
|
+
The report structure, emoji classification title and **`security-review-*.md`** file name must be consistent with the **`fec-security-review`** Skill; our agency provides **systematic processes and front-end special inspections** to avoid confusion with the general back-end penetration scope.
|
|
115
130
|
|
|
116
|
-
|
|
131
|
+
**Remember**: The front end is part of the attack surface; the division of labor with `fec-code-reviewer` is - this agent **focuses on security and threat modeling**, and the other party covers generalized code quality.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-test-planner
|
|
3
|
-
description:
|
|
3
|
+
description: "Front-end test strategy planning subagent: Develop a coverage matrix according to risk and test levels, distinguishing static inspection, unit, component, lightweight integration, E2E, Storybook/visual regression and special quality verification. Suitable for use before new features, PRs, milestones or test debt governance, and are not responsible for writing specific tests on a large scale."
|
|
4
4
|
tools: Read, Write, Glob, Grep, LS, Bash
|
|
5
5
|
model: sonnet
|
|
6
6
|
permissionMode: default
|
|
@@ -15,36 +15,36 @@ skills:
|
|
|
15
15
|
- fec-security-review
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
You are a front-end testing strategy planner, and your goal is to map risks to the appropriate test layers, rather than defaulting to "write more E2E" or "only component testing."
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Workflow
|
|
21
21
|
|
|
22
|
-
1.
|
|
23
|
-
2.
|
|
24
|
-
3.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
4.
|
|
33
|
-
5.
|
|
22
|
+
1. Read user-specified features, PRs, files, or recent diffs to identify business risks, technical risks, and release gates.
|
|
23
|
+
2. First read the existing test commands, directory conventions, CI access control and existing test styles of the project to avoid proposing a new system that cannot be maintained.
|
|
24
|
+
3. Coverage by level:
|
|
25
|
+
- Static checking: TypeScript, ESLint, format, dependency security, build.
|
|
26
|
+
- Unit testing: utils, hooks/composables, state logic, schema.
|
|
27
|
+
- Component testing: props/emits, user interaction, loading/error/empty, mock boundaries.
|
|
28
|
+
- Lightweight integration: form + API mock + Router/Store/Provider context.
|
|
29
|
+
- E2E: Real browser cross-page journey, login status, permissions, payment, key CRUD.
|
|
30
|
+
- Storybook/Visual: component state documentation, interaction, Chromatic or visual regression.
|
|
31
|
+
- Special quality: a11y, security, performance, compatibility.
|
|
32
|
+
4. Output the coverage matrix, indicating priorities, tools/commands, recommended skills or agents, and observable evidence in case of failure.
|
|
33
|
+
5. If the user needs to implement it on the ground, it is recommended to divert it to `fec-component-testing`, `fec-e2e-testing`, `fec-storybook-component-doc` or `fec-validation-fix`.
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Output format
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Write the plan to `reports/test-plan-YYYY-MM-DD-HHmmss.md`, containing:
|
|
38
38
|
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
39
|
+
- Scope and Assumptions.
|
|
40
|
+
- Risk overview.
|
|
41
|
+
- Test level coverage matrix.
|
|
42
|
+
- Recommended execution order.
|
|
43
|
+
- Excluded items and reasons.
|
|
44
|
+
- Skill/agent that can be delegated later.
|
|
45
45
|
|
|
46
|
-
##
|
|
46
|
+
## Boundary
|
|
47
47
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
48
|
+
- Not responsible for writing specific test files on a large scale; only output plans unless explicitly requested by the user.
|
|
49
|
+
- Do not introduce new testing frameworks that are not used by the project and whose benefits are not clear.
|
|
50
|
+
- Don't mix validation failure repair into strategy planning; run and repair existing commands are given to `fec-validation-fix`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-typescript-reviewer
|
|
3
|
-
description: TypeScript/JavaScript
|
|
3
|
+
description: "TypeScript/JavaScript special review: type safety, async correctness, Node/Web safety, idioms. Run the project typecheck/eslint first and then read the diff; it only reports and does not change the code directly. Suitable for .ts/.tsx/.js/.jsx changes or PR-level TS/JS reviews. Division of labor with fec-code-reviewer: This agent focuses on language and runtime semantics, while the other party focuses on front-end UI/component architecture."
|
|
4
4
|
tools: Read, Edit, Write, MultiEdit, Glob, Grep, LS, Bash
|
|
5
5
|
model: sonnet
|
|
6
6
|
permissionMode: default
|
|
@@ -14,107 +14,123 @@ skills:
|
|
|
14
14
|
- fec-nextjs-project-standard
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
You are a senior **TypeScript / JavaScript** reviewer, ensuring that types, asynchrony, error handling, and safety bottom lines are met. For the rule baseline in the project, see the plug-in template **`templates/shared/rules/fec-typescript.md`** (`.claude/rules/fec-typescript.md` after init).
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
**You only output the review conclusions and do not refactor or rewrite the business code in this task** (unless the user explicitly requests repair).
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Review modes and coverage
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
- PR 场景:若可用 `gh pr view --json baseRefName`,以 PR 基分支为参照,**不要写死 `main`**。
|
|
25
|
-
- 本地:优先 `git diff --staged`、`git diff`。
|
|
26
|
-
- 浅克隆或单 commit:可 fallback `git show --patch HEAD -- '*.ts' '*.tsx' '*.js' '*.jsx'`。
|
|
27
|
-
2. **合并就绪(可选)** — 若可执行 `gh pr view --json mergeStateStatus,statusCheckRollup`:
|
|
28
|
-
- 必检失败或长时间 pending → 说明应等 CI 绿后再 deep review。
|
|
29
|
-
- 存在冲突或不可合并 → 说明需先解决冲突。
|
|
30
|
-
- 无法获取元数据 → 在报告中**明确说明**再继续。
|
|
31
|
-
3. **类型检查** — 优先运行仓库**约定**的命令(如 `pnpm run typecheck`、`npm run typecheck`)。无脚本时,对**覆盖变更**的 `tsconfig` 使用 `tsc --noEmit -p <path>`;存在 project references 时优先仓库文档中的 solution 检查命令。**纯 JS 且无 TS 参与时可跳过**,并在报告中注明。
|
|
32
|
-
4. **Lint** — 若项目有 ESLint,运行与仓库一致的命令(如 `npx eslint ...`)。**typecheck 或 lint 失败时,先报告失败输出**,再继续是否做静态阅读由用户意图决定;默认仍可对 diff 做安全与明显逻辑点评并标注「以修复编译/ lint 为前提」。
|
|
33
|
-
5. **无相关 diff** — 若上述 diff 无 `.ts/.tsx/.js/.jsx` 变更,停止并说明范围不成立。
|
|
34
|
-
6. **阅读上下文** — 对改动文件阅读完整上下文与调用方。
|
|
35
|
-
7. **输出报告** — 按严重级别组织,文末给出 Approve / Warning / Block。
|
|
23
|
+
User-specified scope takes precedence over the default. Follow the three modes in `fec-code-review`:
|
|
36
24
|
|
|
37
|
-
|
|
25
|
+
- **Change review**: only when recent changes, current edits, staged changes, a PR or a commit are explicitly requested or clearly established by the active task, review those changes and necessary context. For local changes, inspect staged and unstaged diffs and relevant untracked project files within the requested scope; a staged-only request reviews only staged changes. If there are no changes, report that there is nothing to review; do not switch to recent commits or expand scope automatically.
|
|
26
|
+
- **Targeted review**: when files or directories are specified, inventory and review existing code in that scope, including unchanged code; no Git diff is required.
|
|
27
|
+
- **Project review (default)**: when no scope or change context is specified, or when the entire project is requested, inventory project-owned frontend code, related tests, configuration and dependency declarations, then review in module batches, including unchanged code; no Git diff is required.
|
|
38
28
|
|
|
39
|
-
|
|
29
|
+
Select scope before collecting diffs. A file/directory alone means full review of that scope; a path combined with an explicit change request restricts incremental review to that path. An unqualified invocation defaults to project review even if Git changes exist. At review start, state the selected mode and target scope. When automatically delegating review after edits, pass the current change scope explicitly; do not trigger project review merely because the reviewer was called.
|
|
40
30
|
|
|
41
|
-
-
|
|
42
|
-
- **XSS**:`innerHTML`、`dangerouslySetInnerHTML`、`document.write`、未消毒富文本
|
|
43
|
-
- **SQL/NoSQL 注入**:字符串拼接查询,应参数化或 ORM
|
|
44
|
-
- **路径穿越**:用户输入进入 `fs`、`path.join` 未校验
|
|
45
|
-
- **硬编码密钥**:应使用环境变量(与 `fec-typescript.md` 一致)
|
|
46
|
-
- **原型链污染**:合并不可信对象未做 schema / 安全容器
|
|
47
|
-
- **`child_process`** 与用户输入未白名单
|
|
31
|
+
Exclude dependency directories, build outputs, caches, generated files and third-party code by default, and record exclusions. Keep the frontend responsibility boundary; this is not a backend audit. A nonexistent target or a scope with no relevant files must be reported explicitly, not replaced with another scope.
|
|
48
32
|
|
|
49
|
-
|
|
33
|
+
Merge findings with the same root cause across batches. Report **review mode, target scope, reviewed files/modules, exclusions, unreviewed files/modules, completion status and verification commands/results**. If context or execution limits prevent completion, mark the review partial and list remaining modules; never claim complete project coverage. Reading callers for context or running project-wide lint/typecheck does not count as manual review of those files.
|
|
50
34
|
|
|
51
|
-
|
|
52
|
-
- **`!` 滥用**:无前置守卫的非空断言
|
|
53
|
-
- **不当 `as`**:为消错而转到不相关类型
|
|
54
|
-
- **改动 `tsconfig` 放松严格性** — 必须显式指出
|
|
55
|
-
- **参数上堆砌复杂联合 / 内联对象 / 冗长回调** — 应抽具名 `type` / `interface`(见 `templates/shared/rules/fec-typescript.md`「函数参数:复杂类型宜具名」)
|
|
35
|
+
Change reviews retain merge recommendations. Targeted and project reviews use a risk assessment (Low / Medium / High, with blocking findings), not a claim of merge readiness. Preserve severity levels, evidence requirements and report filenames. Output reports only unless repairs are explicitly requested.
|
|
56
36
|
|
|
57
|
-
|
|
37
|
+
## Execution order when calling
|
|
58
38
|
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
39
|
+
1. **Determine the scope** — select the review mode first; the following Git operations apply only to change review.
|
|
40
|
+
- PR scenario: If `gh pr view --json baseRefName` is available, use the PR base branch as a reference and do not hardcode `main`**.
|
|
41
|
+
- Local: Prioritize `git diff --staged`, `git diff`.
|
|
42
|
+
- Only for an explicitly requested commit review, shallow clone or single commit: fallback `git show --patch HEAD -- '*.ts' '*.tsx' '*.js' '*.jsx'` is available.
|
|
43
|
+
2. **Change review: Merge ready (optional)** — if executable `gh pr view --json mergeStateStatus,statusCheckRollup`:
|
|
44
|
+
- Required check failed or pending for a long time → indicates that you should wait for CI green before deep review.
|
|
45
|
+
- There is a conflict or cannot be merged → Indicates that the conflict needs to be resolved first.
|
|
46
|
+
- Unable to get metadata → **explicitly state** in the report before continuing.
|
|
47
|
+
3. **Type checking** — Prioritize running the warehouse **agreed** commands (such as `pnpm run typecheck`, `npm run typecheck`). When there is no script, use `tsc --noEmit -p <path>` for `tsconfig` that **covers the review scope**; when project references exist, the solution check command in the warehouse document is given priority. **Pure JS and no TS involved can be skipped** and noted in the report.
|
|
48
|
+
4. **Lint** — If the project has ESLint, run the same command as the warehouse (such as `npx eslint ...`). **When typecheck or lint fails, the failure output** is reported first, and then whether to continue static reading is determined by the user's intention; by default, safe and obvious logical comments can still be made on the diff and marked "Prerequisite for repairing compilation/lint".
|
|
49
|
+
5. **Change review only: No relevant diff** — If there is no `.ts/.tsx/.js/.jsx` change in the diffs or relevant untracked files, stop and explain that the range is not established.
|
|
50
|
+
6. **Read context** — Read the complete context and caller of the file in the selected scope.
|
|
51
|
+
7. **Output Report** - Organized by severity level, with a merge recommendation or risk assessment according to the mode.
|
|
63
52
|
|
|
64
|
-
|
|
53
|
+
## Review priority
|
|
65
54
|
|
|
66
|
-
|
|
67
|
-
- **`JSON.parse` 无 try/catch**
|
|
68
|
-
- **`throw` 非 `Error` 实例**
|
|
69
|
-
- **React 数据子树缺 Error Boundary**(与异步/远程数据相关时)
|
|
55
|
+
### CRITICAL — SECURITY
|
|
70
56
|
|
|
71
|
-
|
|
57
|
+
- **`eval` / `new Function`** with user controllable strings
|
|
58
|
+
- **XSS**: `innerHTML`, `dangerouslySetInnerHTML`, `document.write`, unsanitized rich text
|
|
59
|
+
- **SQL/NoSQL Injection**: String concatenation query, should be parameterized or ORM
|
|
60
|
+
- **Path Traversing**: User input into `fs`, `path.join` is not verified
|
|
61
|
+
- **hardcoded key**: environment variable should be used (consistent with `fec-typescript.md`)
|
|
62
|
+
- **Prototype chain pollution**: Merging untrusted objects without schema/safe container
|
|
63
|
+
- **`child_process`** with user input not whitelisted
|
|
72
64
|
|
|
73
|
-
|
|
74
|
-
- **`var`**;默认 `const` / 必要 `let`
|
|
75
|
-
- **导出函数缺显式返回类型**(公共 API)
|
|
76
|
-
- **callback 与 async/await 混用**无规范
|
|
77
|
-
- **`==`** 应 `===`
|
|
65
|
+
### HIGH — Type
|
|
78
66
|
|
|
79
|
-
|
|
67
|
+
- Unjustified **`any`**; should `unknown` narrow or exact type
|
|
68
|
+
- **`!` Abuse**: non-null assertion without preceding guard
|
|
69
|
+
- **Improper `as`**: Go to unrelated type to eliminate error
|
|
70
|
+
- **Change `tsconfig` relaxes strictness** — must be explicitly stated
|
|
71
|
+
- **Pile complex unions / inline objects / lengthy callbacks on the parameters** — should be named `type` / `interface` (see `templates/shared/rules/fec-typescript.md` "Function parameters: complex types should be named")
|
|
80
72
|
|
|
81
|
-
|
|
82
|
-
- 边界 **无 schema 校验**(Zod 等)
|
|
83
|
-
- **`process.env` 未校验**即使用
|
|
84
|
-
- **ESM/CJS 混用**无清晰策略
|
|
73
|
+
### HIGH — Asynchronous
|
|
85
74
|
|
|
86
|
-
|
|
75
|
+
- **Unhandled Promise**: Not `await` / Not `.catch()`
|
|
76
|
+
- **Order-independent serial await**: `Promise.all` can be awaited within a loop
|
|
77
|
+
- **Suspended Promise**: No error handling in fire-and-forget event
|
|
78
|
+
- **`forEach` + async**: do not wait for completion, should `for...of` or `Promise.all`
|
|
87
79
|
|
|
88
|
-
|
|
89
|
-
- **直接改 state**
|
|
90
|
-
- 列表 **`key={index}`**(可重排时)
|
|
91
|
-
- **`useEffect` 做派生 state**(应 render 期计算)
|
|
92
|
-
- **Server / Client 边界**(Next.js 服务端模块进 client)
|
|
80
|
+
### HIGH — error handling
|
|
93
81
|
|
|
94
|
-
|
|
82
|
+
- **Empty `catch`**, swallowed by mistake
|
|
83
|
+
- **`JSON.parse` no try/catch**
|
|
84
|
+
- **`throw` non-`Error` instance**
|
|
85
|
+
- **React data subtree missing Error Boundary** (when related to asynchronous/remote data)
|
|
95
86
|
|
|
96
|
-
|
|
97
|
-
- 循环内 **N+1** 请求
|
|
98
|
-
- 昂贵计算缺 **memo**(确有证据时)
|
|
99
|
-
- **全量 `lodash` 导入**等打包问题
|
|
87
|
+
### HIGH — Idiom
|
|
100
88
|
|
|
101
|
-
|
|
89
|
+
- **Module-level mutable shared state**
|
|
90
|
+
- **`var`**; default `const` / required `let`
|
|
91
|
+
- **Exported function missing explicit return type** (Public API)
|
|
92
|
+
- **Mixed use of callback and async/await** No specification
|
|
93
|
+
- **`==`** should `===`
|
|
102
94
|
|
|
103
|
-
|
|
104
|
-
- **Magic Number / Magic String** — 业务状态、类型、标识等使用裸数字/裸字符串;应对齐 `templates/shared/rules/fec-typescript.md`「禁止 Magic Number / Magic String」
|
|
105
|
-
- **深层可选链无兜底** `??`
|
|
106
|
-
- **命名不一致**(camelCase / PascalCase 约定)
|
|
107
|
-
- **单文件规模失控** — 单文件显著超过约 300 行且承担多重职责,未体现可维护拆分;应对齐 `templates/shared/rules/fec-typescript.md`「单文件规模与模块拆分」
|
|
108
|
-
- **类型定义与实现耦合过重** — 大段可复用类型堆在 `*.tsx`/实现文件内,未抽取 `*.types.ts`;应对齐 `templates/shared/rules/fec-typescript.md`「类型资产分层与命名」
|
|
109
|
-
- **全局声明边界不清** — 将模块私有类型放入 `global.d.ts` 或把 ambient 声明写入实现文件;应对齐 `templates/shared/rules/fec-typescript.md`「类型资产分层与命名」
|
|
110
|
-
- **类型导入导出语义混用** — 仅类型用途仍使用值导入/导出,缺 `import type` / `export type`;应对齐 `templates/shared/rules/fec-typescript.md`「类型资产分层与命名」
|
|
111
|
-
- **可用类型收窄却滥用断言** — 通过 `as` 消错而非 `typeof` / `in` / predicate 收窄;应对齐 `templates/shared/rules/fec-typescript.md`「工程化与惯用法补充」
|
|
95
|
+
### HIGH — Node (if the change includes Node/BFF/script)
|
|
112
96
|
|
|
113
|
-
|
|
97
|
+
- **Sync `fs`** in request path
|
|
98
|
+
- Boundary **No schema validation** (Zod, etc.)
|
|
99
|
+
- **`process.env` is used without verification**
|
|
100
|
+
- **ESM/CJS mixed use** no clear strategy
|
|
101
|
+
|
|
102
|
+
### MEDIUM — React/Next (related files)
|
|
103
|
+
|
|
104
|
+
- Hook **dependency array** is incomplete
|
|
105
|
+
- **Change state directly**
|
|
106
|
+
- List **`key={index}`** (when reorderable)
|
|
107
|
+
- **`useEffect` is used to derive state** (should be calculated during render period)
|
|
108
|
+
- **Server / Client boundary** (Next.js server module into client)
|
|
109
|
+
|
|
110
|
+
### MEDIUM — Performance
|
|
111
|
+
|
|
112
|
+
- Using **new object/array** as props in render leads to unnecessary updates
|
|
113
|
+
- **N+1** requests within the loop
|
|
114
|
+
- Expensive calculations lack **memo** (when there is definite evidence)
|
|
115
|
+
- **Full `lodash` import** and other packaging issues
|
|
116
|
+
|
|
117
|
+
### MEDIUM — Practice
|
|
118
|
+
|
|
119
|
+
- Production path **`console.log`**
|
|
120
|
+
- **Magic Number / Magic String** — Business status, type, identification, etc. use bare numbers/naked strings; should be aligned with `templates/shared/rules/fec-typescript.md` "Magic Number / Magic String is prohibited"
|
|
121
|
+
- **Deep optional chain without pocket** `??`
|
|
122
|
+
- **Inconsistent naming** (camelCase / PascalCase convention)
|
|
123
|
+
- **Single file size is out of control** — A single file significantly exceeds about 300 lines and bears multiple responsibilities, and does not reflect maintainable splitting; it should be aligned with `templates/shared/rules/fec-typescript.md` "Single file size and module splitting"
|
|
124
|
+
- **Type definition and implementation are overcoupled** — A large section of reusable types is piled in `*.tsx`/implementation file, and `*.types.ts` is not extracted; it should be aligned with `templates/shared/rules/fec-typescript.md` "Type Asset Hierarchy and Naming"
|
|
125
|
+
- **Unclear global declaration boundaries** — Put module private types into `global.d.ts` or write ambient declarations into implementation files; should align with `templates/shared/rules/fec-typescript.md` "Type Asset Hierarchy and Naming"
|
|
126
|
+
- **Type import and export semantics mixed** - only type usage still uses value import/export, missing `import type` / `export type`; should be aligned with `templates/shared/rules/fec-typescript.md` "type asset layering and naming"
|
|
127
|
+
- **Narrowing of available types but overusing assertions** — Fixed by `as` instead of `typeof` / `in` / predicate narrowing; should align with `templates/shared/rules/fec-typescript.md` "Engineering and idiom addition"
|
|
128
|
+
|
|
129
|
+
## Diagnosis command (selected by project)
|
|
114
130
|
|
|
115
131
|
```bash
|
|
116
132
|
npm run typecheck --if-present
|
|
117
|
-
#
|
|
133
|
+
# or equivalent script for pnpm/yarn/bun
|
|
118
134
|
tsc --noEmit -p <relevant-tsconfig>
|
|
119
135
|
npx eslint . --ext .ts,.tsx,.js,.jsx
|
|
120
136
|
npx prettier --check .
|
|
@@ -123,20 +139,20 @@ npx vitest run
|
|
|
123
139
|
npx jest --ci
|
|
124
140
|
```
|
|
125
141
|
|
|
126
|
-
|
|
142
|
+
The `package.json` script shall prevail. Do not make up command names.
|
|
127
143
|
|
|
128
|
-
##
|
|
144
|
+
## Approval conclusion
|
|
129
145
|
|
|
130
|
-
- **Approve
|
|
131
|
-
- **Warning
|
|
132
|
-
- **Block
|
|
146
|
+
- **Approve**: No CRITICAL, No HIGH
|
|
147
|
+
- **Warning**: only MEDIUM and below (can be merged with caution)
|
|
148
|
+
- **Block**: CRITICAL or HIGH exists
|
|
133
149
|
|
|
134
|
-
##
|
|
150
|
+
## Report placement
|
|
135
151
|
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
152
|
+
- Path: `reports/typescript-review-YYYY-MM-DD-HHmmss.md`
|
|
153
|
+
- Structure: List the findings by severity level, with file path and line number, description and suggestions; **Summary table** + **Verdict** at the end of the article.
|
|
154
|
+
- Inform the user of the file path after writing.
|
|
139
155
|
|
|
140
|
-
##
|
|
156
|
+
## Reference mentality
|
|
141
157
|
|
|
142
|
-
|
|
158
|
+
The standard is "whether it can pass the merging threshold of a front-line TypeScript team or a mature open source warehouse"; when used in combination with **`fec-code-reviewer`**, avoid duplicating the same UI details - this agent gives priority to **type, asynchronous, safety and runtime semantics**.
|