@bovinphang/frontend-craft 2.5.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.
Files changed (180) hide show
  1. package/.claude-plugin/marketplace.json +61 -0
  2. package/.claude-plugin/plugin.json +32 -0
  3. package/.mcp.json +44 -0
  4. package/CHANGELOG.md +229 -0
  5. package/CHANGELOG.zh-CN.md +228 -0
  6. package/CODE_OF_CONDUCT.md +34 -0
  7. package/CODE_OF_CONDUCT.zh-CN.md +34 -0
  8. package/CONTRIBUTING.md +356 -0
  9. package/CONTRIBUTING.zh-CN.md +356 -0
  10. package/LICENSE +21 -0
  11. package/README.md +467 -0
  12. package/README.openclaw.md +262 -0
  13. package/README.openclaw.zh-CN.md +262 -0
  14. package/README.zh-CN.md +467 -0
  15. package/SECURITY.md +44 -0
  16. package/SECURITY.zh-CN.md +44 -0
  17. package/agents/fec-architect.md +125 -0
  18. package/agents/fec-code-reviewer.md +152 -0
  19. package/agents/fec-debugger.md +44 -0
  20. package/agents/fec-design-token-mapper.md +75 -0
  21. package/agents/fec-doc-updater.md +30 -0
  22. package/agents/fec-e2e-runner.md +107 -0
  23. package/agents/fec-figma-implementer.md +104 -0
  24. package/agents/fec-performance-optimizer.md +293 -0
  25. package/agents/fec-refactor-cleaner.md +32 -0
  26. package/agents/fec-security-reviewer.md +116 -0
  27. package/agents/fec-test-planner.md +50 -0
  28. package/agents/fec-typescript-reviewer.md +142 -0
  29. package/agents/fec-ui-checker.md +120 -0
  30. package/commands/fec-debug.md +30 -0
  31. package/commands/fec-doc-sync.md +18 -0
  32. package/commands/fec-init.md +70 -0
  33. package/commands/fec-plan.md +94 -0
  34. package/commands/fec-refactor-clean.md +19 -0
  35. package/commands/fec-review.md +66 -0
  36. package/commands/fec-scaffold.md +205 -0
  37. package/commands/fec-tdd.md +21 -0
  38. package/dist/bin/frontend-craft.js +82 -0
  39. package/dist/hooks/fec-cleanup-claude-cache.js +4 -0
  40. package/dist/hooks/fec-format-changed-file.js +1 -0
  41. package/dist/hooks/fec-notify.js +1 -0
  42. package/dist/hooks/fec-run-tests.js +1 -0
  43. package/dist/hooks/fec-security-check.js +2 -0
  44. package/dist/hooks/fec-session-start.js +1 -0
  45. package/docs/example-prompts.md +124 -0
  46. package/docs/ja-JP/README.md +467 -0
  47. package/docs/ko-KR/README.md +467 -0
  48. package/docs/project-structure.md +119 -0
  49. package/docs/runtimes/antigravity.md +10 -0
  50. package/docs/runtimes/augment.md +10 -0
  51. package/docs/runtimes/claude.md +171 -0
  52. package/docs/runtimes/claude.zh-CN.md +169 -0
  53. package/docs/runtimes/cline.md +10 -0
  54. package/docs/runtimes/codebuddy.md +10 -0
  55. package/docs/runtimes/codex.md +10 -0
  56. package/docs/runtimes/copilot.md +10 -0
  57. package/docs/runtimes/cursor.md +10 -0
  58. package/docs/runtimes/gemini.md +10 -0
  59. package/docs/runtimes/kilo.md +10 -0
  60. package/docs/runtimes/openclaw.md +10 -0
  61. package/docs/runtimes/opencode.md +10 -0
  62. package/docs/runtimes/qoder.md +19 -0
  63. package/docs/runtimes/trae.md +10 -0
  64. package/docs/runtimes/windsurf.md +10 -0
  65. package/docs/superpowers/plans/2026-05-29-fec-debug.md +491 -0
  66. package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +340 -0
  67. package/docs/zh-CN/example-prompts.md +124 -0
  68. package/docs/zh-CN/project-structure.md +119 -0
  69. package/docs/zh-TW/README.md +467 -0
  70. package/hooks/hooks.json +71 -0
  71. package/openclaw.plugin.json +26 -0
  72. package/package.json +101 -0
  73. package/skills/TEMPLATE.md +155 -0
  74. package/skills/eval_queries.json +890 -0
  75. package/skills/fec-accessibility-check/SKILL.md +39 -0
  76. package/skills/fec-accessibility-check/references/report-template.md +23 -0
  77. package/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
  78. package/skills/fec-api-integration/SKILL.md +78 -0
  79. package/skills/fec-api-integration/references/integration-patterns.md +80 -0
  80. package/skills/fec-browser-storage/SKILL.md +34 -0
  81. package/skills/fec-browser-storage/references/storage-patterns.md +65 -0
  82. package/skills/fec-canvas-threejs/SKILL.md +66 -0
  83. package/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
  84. package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
  85. package/skills/fec-code-review/SKILL.md +135 -0
  86. package/skills/fec-code-review/references/report-template.md +29 -0
  87. package/skills/fec-component-testing/SKILL.md +119 -0
  88. package/skills/fec-data-fetching/SKILL.md +62 -0
  89. package/skills/fec-data-fetching/references/query-patterns.md +77 -0
  90. package/skills/fec-debug-framework/SKILL.md +162 -0
  91. package/skills/fec-dependency-upgrade/SKILL.md +34 -0
  92. package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
  93. package/skills/fec-doc-sync/SKILL.md +37 -0
  94. package/skills/fec-e2e-testing/SKILL.md +40 -0
  95. package/skills/fec-e2e-testing/references/e2e-advanced.md +176 -0
  96. package/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
  97. package/skills/fec-form-handling/SKILL.md +76 -0
  98. package/skills/fec-form-handling/references/advanced-form-patterns.md +72 -0
  99. package/skills/fec-implement-from-design/SKILL.md +122 -0
  100. package/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
  101. package/skills/fec-legacy-to-modern-migration/SKILL.md +180 -0
  102. package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
  103. package/skills/fec-legacy-web-standard/SKILL.md +35 -0
  104. package/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
  105. package/skills/fec-list-virtualization/SKILL.md +34 -0
  106. package/skills/fec-list-virtualization/references/virtualization-patterns.md +52 -0
  107. package/skills/fec-monorepo-project-standard/SKILL.md +142 -0
  108. package/skills/fec-motion-interaction/SKILL.md +66 -0
  109. package/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
  110. package/skills/fec-nextjs-project-standard/SKILL.md +117 -0
  111. package/skills/fec-nuxt-project-standard/SKILL.md +122 -0
  112. package/skills/fec-performance-optimization/SKILL.md +72 -0
  113. package/skills/fec-pwa-implementation/SKILL.md +36 -0
  114. package/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
  115. package/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
  116. package/skills/fec-react-project-standard/SKILL.md +83 -0
  117. package/skills/fec-react-project-standard/references/react-project-details.md +642 -0
  118. package/skills/fec-refactor-clean/SKILL.md +48 -0
  119. package/skills/fec-responsive-layout/SKILL.md +34 -0
  120. package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +59 -0
  121. package/skills/fec-route-protection/SKILL.md +135 -0
  122. package/skills/fec-security-review/SKILL.md +38 -0
  123. package/skills/fec-security-review/references/report-template.md +27 -0
  124. package/skills/fec-security-review/references/security-checklist.md +64 -0
  125. package/skills/fec-source-driven-development/SKILL.md +61 -0
  126. package/skills/fec-state-management/SKILL.md +140 -0
  127. package/skills/fec-state-management/references/state-patterns.md +109 -0
  128. package/skills/fec-storybook-component-doc/SKILL.md +37 -0
  129. package/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
  130. package/skills/fec-svg-animation/SKILL.md +148 -0
  131. package/skills/fec-tailwind-design-system/SKILL.md +34 -0
  132. package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +55 -0
  133. package/skills/fec-tdd-workflow/SKILL.md +52 -0
  134. package/skills/fec-testing-strategy/SKILL.md +45 -0
  135. package/skills/fec-typescript-type-safety/SKILL.md +157 -0
  136. package/skills/fec-typescript-type-safety/references/type-safety-patterns.md +102 -0
  137. package/skills/fec-ui-design/SKILL.md +90 -0
  138. package/skills/fec-ui-design/data/product-rules.json +110 -0
  139. package/skills/fec-ui-design/data/stack-ui-rules.json +14 -0
  140. package/skills/fec-ui-design/data/style-archetypes.json +74 -0
  141. package/skills/fec-ui-design/data/ux-quality-rules.json +56 -0
  142. package/skills/fec-ui-design/references/design-intelligence.md +37 -0
  143. package/skills/fec-ui-design/references/master-page-overrides.md +30 -0
  144. package/skills/fec-ui-design/references/pre-delivery-checklist.md +33 -0
  145. package/skills/fec-ui-design/scripts/design-system.mjs +530 -0
  146. package/skills/fec-validation-fix/SKILL.md +48 -0
  147. package/skills/fec-vite-project-standard/SKILL.md +83 -0
  148. package/skills/fec-vue3-project-standard/SKILL.md +49 -0
  149. package/skills/fec-vue3-project-standard/references/vue3-project-details.md +547 -0
  150. package/skills/fec-web-workers/SKILL.md +36 -0
  151. package/skills/fec-web-workers/references/advanced-workers.md +54 -0
  152. package/skills/fec-web-workers/references/basic-worker.md +67 -0
  153. package/skills/metadata.json +1422 -0
  154. package/skills/relations.json +644 -0
  155. package/templates/claude/CLAUDE.md +106 -0
  156. package/templates/claude/settings.json +62 -0
  157. package/templates/codex/AGENTS.md +105 -0
  158. package/templates/codex/config.toml +32 -0
  159. package/templates/openclaw/AGENTS.md +101 -0
  160. package/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
  161. package/templates/shared/rules/fec-agent-workflow.md +54 -0
  162. package/templates/shared/rules/fec-api-layer.md +99 -0
  163. package/templates/shared/rules/fec-ci-cd.md +128 -0
  164. package/templates/shared/rules/fec-code-comments.md +33 -0
  165. package/templates/shared/rules/fec-design-system.md +248 -0
  166. package/templates/shared/rules/fec-error-handling.md +200 -0
  167. package/templates/shared/rules/fec-git-conventions.md +73 -0
  168. package/templates/shared/rules/fec-i18n.md +112 -0
  169. package/templates/shared/rules/fec-naming-conventions.md +120 -0
  170. package/templates/shared/rules/fec-performance.md +101 -0
  171. package/templates/shared/rules/fec-react.md +82 -0
  172. package/templates/shared/rules/fec-refactoring.md +43 -0
  173. package/templates/shared/rules/fec-rendering-patterns.md +183 -0
  174. package/templates/shared/rules/fec-responsive-design.md +227 -0
  175. package/templates/shared/rules/fec-source-driven-development.md +31 -0
  176. package/templates/shared/rules/fec-state-management.md +163 -0
  177. package/templates/shared/rules/fec-testing.md +98 -0
  178. package/templates/shared/rules/fec-typescript.md +355 -0
  179. package/templates/shared/rules/fec-vue.md +64 -0
  180. package/templates/shared/rules/fec-working-modes.md +50 -0
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "@bovinphang/frontend-craft",
3
+ "version": "2.5.0",
4
+ "description": "Universal frontend plugin for Claude Code, Codex, Cursor, OpenCode, Gemini CLI, Qoder, Windsurf, Copilot, OpenClaw, and more — skills, agents, commands, hooks, and MCP templates.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": {
8
+ "name": "Bovin Phang",
9
+ "email": "pengbaowen@msn.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/bovinphang/frontend-craft"
14
+ },
15
+ "homepage": "https://github.com/bovinphang/frontend-craft",
16
+ "bugs": {
17
+ "url": "https://github.com/bovinphang/frontend-craft/issues"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "engines": {
23
+ "node": ">=22.0.0"
24
+ },
25
+ "bin": {
26
+ "frontend-craft": "dist/bin/frontend-craft.js",
27
+ "fec": "dist/bin/frontend-craft.js"
28
+ },
29
+ "files": [
30
+ "dist/bin",
31
+ "dist/hooks",
32
+ "agents",
33
+ "skills",
34
+ "commands",
35
+ "hooks",
36
+ "templates",
37
+ ".mcp.json",
38
+ ".claude-plugin",
39
+ "openclaw.plugin.json",
40
+ "README.md",
41
+ "README.zh-CN.md",
42
+ "CHANGELOG.zh-CN.md",
43
+ "CODE_OF_CONDUCT.zh-CN.md",
44
+ "CONTRIBUTING.zh-CN.md",
45
+ "SECURITY.zh-CN.md",
46
+ "CONTRIBUTING.md",
47
+ "CHANGELOG.md",
48
+ "CODE_OF_CONDUCT.md",
49
+ "SECURITY.md",
50
+ "LICENSE",
51
+ "docs"
52
+ ],
53
+ "scripts": {
54
+ "clean": "node scripts/clean-dist.mjs",
55
+ "typecheck": "npm run typecheck:ts && npm run typecheck:skill-scripts",
56
+ "typecheck:ts": "tsc --noEmit -p tsconfig.json",
57
+ "typecheck:skill-scripts": "tsc --allowJs --checkJs --noEmit --strict --module NodeNext --moduleResolution NodeNext --target ES2022 skills/fec-ui-design/scripts/design-system.mjs",
58
+ "build": "npm run clean && npm run typecheck && tsx scripts/build-dist.ts",
59
+ "test:only": "node --import tsx --test --test-concurrency=1 tests/converters/codex-agents.test.ts tests/install/cli.test.ts tests/install/end-to-end.test.ts tests/install/update.test.ts tests/install/all-runtimes-dry.test.ts tests/install/metadata-consistency.test.ts tests/install/npm-pack.test.ts tests/install/skill-package.test.ts tests/install/ui-design-intelligence.test.ts tests/install/sync-version.test.ts tests/install/claude-cache.test.ts",
60
+ "test": "npm run build && npm run test:only",
61
+ "build:openclaw:bundle": "tsx scripts/openclaw/build.ts",
62
+ "build:openclaw": "npm run build && npm run build:openclaw:bundle",
63
+ "audit:skills": "npm run build && tsx scripts/audit-skills.ts",
64
+ "typecheck:openclaw": "tsc --noEmit -p tsconfig.openclaw.json",
65
+ "check:openclaw-dist": "tsx scripts/openclaw/verify-openclaw-dist.ts",
66
+ "pack:openclaw": "npm run build:openclaw && npm run check:openclaw-dist && tsx scripts/openclaw/pack-openclaw.ts",
67
+ "pack:skills": "npm run build && tsx scripts/pack-skills.ts",
68
+ "check:skills-publish": "npm run build && tsx scripts/check-skills-publish.ts",
69
+ "pack:all": "npm run build && npm run test:only && npm run build:openclaw:bundle && npm run check:openclaw-dist && tsx scripts/openclaw/pack-openclaw.ts && tsx scripts/pack-skills.ts && tsx scripts/check-skills-publish.ts",
70
+ "prepack": "npm run build",
71
+ "sync:version": "tsx scripts/sync-version.ts",
72
+ "version": "npm run sync:version && git add package.json package-lock.json .claude-plugin/plugin.json .claude-plugin/marketplace.json openclaw.plugin.json skills/metadata.json",
73
+ "prepublishOnly": "npm run sync:version && npm test"
74
+ },
75
+ "devDependencies": {
76
+ "@sinclair/typebox": "^0.34.49",
77
+ "@types/node": "^22.19.15",
78
+ "esbuild": "^0.28.0",
79
+ "openclaw": "^2026.4.20",
80
+ "prettier": "^3.5.0",
81
+ "tsx": "^4.22.3",
82
+ "typescript": "^5.7.3"
83
+ },
84
+ "keywords": [
85
+ "frontend",
86
+ "claude-code",
87
+ "codex",
88
+ "cursor",
89
+ "opencode",
90
+ "gemini-cli",
91
+ "qoder",
92
+ "windsurf",
93
+ "copilot",
94
+ "openclaw",
95
+ "mcp",
96
+ "design-to-code",
97
+ "i18n",
98
+ "playwright",
99
+ "eslint"
100
+ ]
101
+ }
@@ -0,0 +1,155 @@
1
+ # Skill 模板规范
2
+
3
+ > 所有 Skill 必须遵循 agentskills 结构:目录名、frontmatter `name` 和公开 skill id 保持一致;frontmatter 只保留 `name` 与 `description`。
4
+
5
+ ---
6
+
7
+ ## 目录结构
8
+
9
+ ```text
10
+ skills/fec-[主题]/
11
+ SKILL.md
12
+ references/ # 可选:按需加载的详细规范、示例或清单
13
+ scripts/ # 可选:需要确定性执行的脚本
14
+ assets/ # 可选:输出会用到的模板或资源
15
+ ```
16
+
17
+ ## Frontmatter
18
+
19
+ ```yaml
20
+ ---
21
+ name: fec-[主题]
22
+ description: Use when ...
23
+ ---
24
+ ```
25
+
26
+ - `name` 必须等于父目录名。
27
+ - `description` 是主要触发依据,必须写清"做什么"和"什么时候用"。
28
+ - 不要在 frontmatter 中加入 `version`、`metadata` 或触发说明以外的字段。
29
+ - 使用 `Use when ...` 开头,并包含必要的英文/中文关键词。
30
+
31
+ ---
32
+
33
+ ## 模板结构
34
+
35
+ ```markdown
36
+ # Skill: [Skill 名称]
37
+
38
+ ## Purpose
39
+
40
+ 一句话说明这个 Skill 解决什么问题,面向什么场景。
41
+
42
+ ## Procedure
43
+
44
+ 分步骤实现指南,每步包含代码示例。
45
+
46
+ ### 1. [步骤标题]
47
+
48
+ 说明 + 代码示例
49
+
50
+ ### 2. [步骤标题]
51
+
52
+ 说明 + 代码示例
53
+
54
+ ...
55
+
56
+ ## Constraints
57
+
58
+ - 边界条件 / 注意事项 1
59
+ - 反模式 / 陷阱 1
60
+ - 性能 / 安全约束 1
61
+
62
+ ## Expected Output
63
+
64
+ 明确产出物是什么,如何验证。
65
+
66
+ ```
67
+
68
+ ---
69
+
70
+ ## 编写规范
71
+
72
+ ### Purpose
73
+
74
+ - 一句话,不超过 30 字
75
+ - 说明解决什么问题,而非如何解决
76
+ - 示例: "管理表单状态、校验和提交,避免受控组件的性能问题"
77
+
78
+ ### Trigger and Boundary
79
+
80
+ - 触发条件主要写在 frontmatter `description`,正文不要再重复长篇 `When to Use`。
81
+ - `description` 必须包含 should-trigger 场景和近邻 should-not-trigger 边界。
82
+ - 示例: `Use when building substantial forms with React Hook Form and Zod. Do not use for trivial 1-3 field forms without validation.`
83
+
84
+ ### Capability Relations
85
+
86
+ - `SKILL.md` 必须自包含,不能依赖另一个 skill 或 agent 才能理解或执行。
87
+ - 不要在 skill 正文添加 `Related Agent`。
88
+ - 不要从 skill 正文链接到 `../agents`、`../../agents`、`../skills` 或 `../../skills`。
89
+ - 相关 skill、边界 workflow 和能力标签统一维护在 `skills/relations.json`。
90
+ - Agent 可以在自己的 frontmatter `skills:` 字段中引用 skills;skill 不反向引用 agent。
91
+
92
+ ### Procedure
93
+
94
+ - 按实施顺序分步骤,每步有编号和标题
95
+ - 每个步骤包含:
96
+ - 1-2 句说明
97
+ - 可运行的代码示例(TypeScript 优先)
98
+ - 关键参数的注释说明
99
+ - 涉及安装的步骤先给出安装命令
100
+ - 代码示例遵循项目已有的编码规范
101
+ - 优先展示完整的最小可运行示例,而非片段
102
+ - `SKILL.md` 只保留每次使用都需要的核心流程;接近 **180-220 行**时优先拆到 `references/`。
103
+ - 长代码、框架变体、进阶配置、评估清单放入一层 `references/` 文件,并从 `SKILL.md` 明确说明何时加载。
104
+
105
+ ### Constraints
106
+
107
+ - 列出 3-6 条关键约束
108
+ - 包括:性能陷阱、安全注意、反模式、兼容性限制
109
+ - 每条简洁,必要时附简短解释
110
+ - 示例:
111
+ - 虚拟列表中的项目不在 DOM 中直到滚动到,搜索引擎可能无法索引
112
+
113
+ ### Expected Output
114
+
115
+ - 明确说明产出物是什么
116
+ - 如何验证产出是否正确
117
+ - 1-3 句话
118
+
119
+ ---
120
+
121
+ ## 代码示例约定
122
+
123
+ - 使用 TypeScript(.tsx / .ts),除非场景明确要求 JavaScript
124
+ - 遵循 React 18+ / Vue 3+ 现代语法
125
+ - 变量和函数名语义化,避免缩写(除非是行业约定如 `ctx`、`ref`)
126
+ - 关键行添加行内注释说明"为什么"而非"是什么"
127
+ - 安装命令使用 `npm install`(不锁包管理器)
128
+
129
+ ---
130
+
131
+ ## Progressive Disclosure
132
+
133
+ - `SKILL.md`:触发后每次都需要的操作顺序、约束、边界和最小示例。
134
+ - `references/`:按需加载的详细示例、框架变体、配置模板和长检查清单。
135
+ - 避免把同一说明同时写在 `SKILL.md` 和 reference 中;正文只做导航。
136
+ - reference 只放一层,链接必须使用相对路径。
137
+
138
+ ---
139
+
140
+ ## 触发评估
141
+
142
+ 每个 skill 维护正负样例,用于 description 优化:
143
+
144
+ - `should_trigger`:8-10 条真实用户问法。
145
+ - `should_not_trigger`:8-10 条近邻误触发问法。
146
+ - 高重叠 skill 优先覆盖 React/Vue/Next/Nuxt、review/security/a11y、component/E2E/Storybook、legacy/migration。
147
+
148
+ ---
149
+
150
+ ## 文件命名
151
+
152
+ - 目录格式: `skills/fec-{主题}/`
153
+ - 必备文件: `skills/fec-{主题}/SKILL.md`
154
+ - 使用小写和连字符
155
+ - 示例: `skills/fec-storybook-component-doc/`、`skills/fec-list-virtualization/`