@bovinphang/frontend-craft 2.8.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.
Files changed (195) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +378 -339
  4. package/CHANGELOG.zh-CN.md +377 -338
  5. package/CONTRIBUTING.md +371 -361
  6. package/CONTRIBUTING.zh-CN.md +371 -361
  7. package/README.md +545 -493
  8. package/README.openclaw.md +359 -320
  9. package/README.openclaw.zh-CN.md +359 -320
  10. package/README.zh-CN.md +545 -493
  11. package/agents/fec-code-reviewer.md +24 -3
  12. package/agents/fec-debugger.md +1 -1
  13. package/agents/fec-doc-updater.md +1 -1
  14. package/agents/fec-e2e-runner.md +1 -1
  15. package/agents/fec-figma-implementer.md +1 -1
  16. package/agents/fec-performance-optimizer.md +1 -1
  17. package/agents/fec-refactor-cleaner.md +4 -1
  18. package/agents/fec-refactoring-expert.md +81 -0
  19. package/agents/fec-security-reviewer.md +17 -1
  20. package/agents/fec-test-planner.md +1 -1
  21. package/agents/fec-typescript-reviewer.md +24 -8
  22. package/agents/fec-ui-checker.md +11 -11
  23. package/commands/fec-debug.md +1 -1
  24. package/commands/fec-refactor-plan.md +17 -0
  25. package/commands/fec-refactor.md +18 -0
  26. package/commands/fec-review.md +40 -10
  27. package/commands/fec-scaffold.md +1 -1
  28. package/commands/fec-smell.md +17 -0
  29. package/commands/fec-tdd.md +6 -2
  30. package/dist/bin/frontend-craft.js +190 -38
  31. package/dist/hooks/fec-run-tests.js +5 -1
  32. package/dist/hooks/fec-session-start.js +1 -1
  33. package/docs/example-prompts.md +157 -140
  34. package/docs/ja-JP/README.md +534 -493
  35. package/docs/ko-KR/README.md +534 -493
  36. package/docs/project-structure.md +151 -131
  37. package/docs/refactoring/README.md +50 -0
  38. package/docs/refactoring/catalog.md +105 -0
  39. package/docs/refactoring/smell-refactoring-matrix.md +41 -0
  40. package/docs/review-and-diagram-workflows.md +39 -0
  41. package/docs/runtimes/antigravity.md +18 -10
  42. package/docs/runtimes/augment.md +18 -10
  43. package/docs/runtimes/claude.md +191 -177
  44. package/docs/runtimes/claude.zh-CN.md +189 -175
  45. package/docs/runtimes/cline.md +18 -10
  46. package/docs/runtimes/codebuddy.md +18 -10
  47. package/docs/runtimes/codex.md +18 -10
  48. package/docs/runtimes/compatibility.md +27 -0
  49. package/docs/runtimes/copilot.md +18 -10
  50. package/docs/runtimes/cursor.md +18 -10
  51. package/docs/runtimes/gemini.md +18 -10
  52. package/docs/runtimes/kilo.md +18 -10
  53. package/docs/runtimes/openclaw.md +18 -10
  54. package/docs/runtimes/opencode.md +18 -10
  55. package/docs/runtimes/qoder.md +18 -19
  56. package/docs/runtimes/trae.md +18 -10
  57. package/docs/runtimes/windsurf.md +18 -10
  58. package/docs/superpowers/plans/2026-09-26-content-integrity.md +145 -0
  59. package/docs/superpowers/plans/2026-09-26-diagram-quality.md +170 -0
  60. package/docs/superpowers/specs/2026-09-26-diagram-quality-design.md +77 -0
  61. package/docs/superpowers/specs/2026-09-26-project-optimization-design.md +95 -0
  62. package/docs/zh-CN/example-prompts.md +157 -140
  63. package/docs/zh-CN/project-structure.md +148 -128
  64. package/docs/zh-CN/review-and-diagram-workflows.md +39 -0
  65. package/docs/zh-TW/README.md +534 -493
  66. package/localized/zh-CN/agents/fec-code-reviewer.md +22 -3
  67. package/localized/zh-CN/agents/fec-refactor-cleaner.md +3 -0
  68. package/localized/zh-CN/agents/fec-refactoring-expert.md +53 -0
  69. package/localized/zh-CN/agents/fec-security-reviewer.md +16 -0
  70. package/localized/zh-CN/agents/fec-typescript-reviewer.md +23 -7
  71. package/localized/zh-CN/commands/fec-refactor-plan.md +15 -0
  72. package/localized/zh-CN/commands/fec-refactor.md +14 -0
  73. package/localized/zh-CN/commands/fec-review.md +40 -9
  74. package/localized/zh-CN/commands/fec-smell.md +13 -0
  75. package/localized/zh-CN/commands/fec-tdd.md +4 -0
  76. package/localized/zh-CN/skills/eval_queries.json +244 -0
  77. package/localized/zh-CN/skills/fec-code-review/SKILL.md +20 -1
  78. package/localized/zh-CN/skills/fec-code-review/references/report-template.md +11 -1
  79. package/localized/zh-CN/skills/fec-code-smells/SKILL.md +33 -0
  80. package/localized/zh-CN/skills/fec-code-smells/references/detection-guide.md +25 -0
  81. package/localized/zh-CN/skills/fec-code-smells/references/smell-catalog.md +817 -0
  82. package/localized/zh-CN/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
  83. package/localized/zh-CN/skills/fec-image-generation/SKILL.md +31 -1
  84. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
  85. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
  86. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
  87. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
  88. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
  89. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
  90. package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
  91. package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +10 -3
  92. package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +8 -1
  93. package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
  94. package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
  95. package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
  96. package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +48 -80
  97. package/localized/zh-CN/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
  98. package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
  99. package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +193 -53
  100. package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +3 -0
  101. package/localized/zh-CN/skills/fec-refactoring/SKILL.md +83 -0
  102. package/localized/zh-CN/skills/fec-refactoring/references/principles.md +43 -0
  103. package/localized/zh-CN/skills/fec-refactoring/references/refactoring-vs-feature-change.md +25 -0
  104. package/localized/zh-CN/skills/fec-refactoring/references/when-to-refactor.md +17 -0
  105. package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +59 -0
  106. package/localized/zh-CN/skills/fec-refactoring-api/SKILL.md +25 -0
  107. package/localized/zh-CN/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
  108. package/localized/zh-CN/skills/fec-refactoring-catalog/SKILL.md +21 -0
  109. package/localized/zh-CN/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
  110. package/localized/zh-CN/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
  111. package/localized/zh-CN/skills/fec-refactoring-catalog/references/selection-guide.md +41 -0
  112. package/localized/zh-CN/skills/fec-refactoring-control/SKILL.md +25 -0
  113. package/localized/zh-CN/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
  114. package/localized/zh-CN/skills/fec-refactoring-data/SKILL.md +25 -0
  115. package/localized/zh-CN/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
  116. package/localized/zh-CN/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
  117. package/localized/zh-CN/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
  118. package/localized/zh-CN/skills/fec-refactoring-functions/SKILL.md +25 -0
  119. package/localized/zh-CN/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
  120. package/localized/zh-CN/skills/fec-refactoring-inheritance/SKILL.md +25 -0
  121. package/localized/zh-CN/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
  122. package/localized/zh-CN/skills/fec-refactoring-move-features/SKILL.md +25 -0
  123. package/localized/zh-CN/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
  124. package/localized/zh-CN/skills/fec-refactoring-validation/SKILL.md +52 -0
  125. package/localized/zh-CN/skills/fec-refactoring-validation/references/behavior-preservation.md +15 -0
  126. package/localized/zh-CN/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +25 -0
  127. package/localized/zh-CN/skills/fec-security-review/SKILL.md +16 -0
  128. package/localized/zh-CN/skills/fec-security-review/references/report-template.md +10 -0
  129. package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +3 -0
  130. package/localized/zh-CN/skills/metadata.json +408 -50
  131. package/localized/zh-CN/skills/relations.json +271 -3
  132. package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +1 -0
  133. package/openclaw.plugin.json +2 -3
  134. package/package.json +27 -17
  135. package/skills/eval_queries.json +244 -0
  136. package/skills/fec-code-review/SKILL.md +20 -1
  137. package/skills/fec-code-review/references/report-template.md +11 -1
  138. package/skills/fec-code-smells/SKILL.md +33 -0
  139. package/skills/fec-code-smells/references/detection-guide.md +25 -0
  140. package/skills/fec-code-smells/references/smell-catalog.md +861 -0
  141. package/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
  142. package/skills/fec-data-fetching/SKILL.md +1 -1
  143. package/skills/fec-image-generation/SKILL.md +31 -1
  144. package/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
  145. package/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
  146. package/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
  147. package/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
  148. package/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
  149. package/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
  150. package/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
  151. package/skills/fec-image-generation/references/diagram-workflows.md +10 -3
  152. package/skills/fec-image-generation/references/html-technical-diagrams.md +8 -1
  153. package/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
  154. package/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
  155. package/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
  156. package/skills/fec-image-generation/scripts/export-diagram.mjs +48 -80
  157. package/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
  158. package/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
  159. package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +193 -53
  160. package/skills/fec-legacy-web-standard/SKILL.md +1 -1
  161. package/skills/fec-refactor-clean/SKILL.md +3 -0
  162. package/skills/fec-refactoring/SKILL.md +83 -0
  163. package/skills/fec-refactoring/references/principles.md +60 -0
  164. package/skills/fec-refactoring/references/refactoring-vs-feature-change.md +27 -0
  165. package/skills/fec-refactoring/references/when-to-refactor.md +31 -0
  166. package/skills/fec-refactoring/references/workflow.md +90 -0
  167. package/skills/fec-refactoring-api/SKILL.md +25 -0
  168. package/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
  169. package/skills/fec-refactoring-catalog/SKILL.md +28 -0
  170. package/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
  171. package/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
  172. package/skills/fec-refactoring-catalog/references/selection-guide.md +47 -0
  173. package/skills/fec-refactoring-control/SKILL.md +25 -0
  174. package/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
  175. package/skills/fec-refactoring-data/SKILL.md +25 -0
  176. package/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
  177. package/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
  178. package/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
  179. package/skills/fec-refactoring-functions/SKILL.md +25 -0
  180. package/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
  181. package/skills/fec-refactoring-inheritance/SKILL.md +25 -0
  182. package/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
  183. package/skills/fec-refactoring-move-features/SKILL.md +25 -0
  184. package/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
  185. package/skills/fec-refactoring-validation/SKILL.md +59 -0
  186. package/skills/fec-refactoring-validation/references/behavior-preservation.md +53 -0
  187. package/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +42 -0
  188. package/skills/fec-security-review/SKILL.md +16 -0
  189. package/skills/fec-security-review/references/report-template.md +10 -0
  190. package/skills/fec-tdd-workflow/SKILL.md +5 -1
  191. package/skills/metadata.json +434 -71
  192. package/skills/relations.json +264 -0
  193. package/templates/shared/rules/fec-agent-workflow.md +1 -0
  194. package/docs/superpowers/plans/2026-05-29-fec-debug.md +0 -491
  195. package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +0 -340
package/CONTRIBUTING.md CHANGED
@@ -1,361 +1,371 @@
1
- # Contributing Guide
2
-
3
- Thanks for your interest in `frontend-craft`. Issues, pull requests, documentation fixes, runtime adapters, and better examples are all welcome.
4
-
5
- **Simplified Chinese:** [CONTRIBUTING.zh-CN.md](CONTRIBUTING.zh-CN.md)
6
-
7
- ## Development Setup
8
-
9
- - Node.js >= 22 for the universal installer and OpenClaw package build.
10
- - Git.
11
- - Run `npm install` before local development.
12
-
13
- For documentation-only changes, focus on the language and documentation policy plus the pull request checklist. For skill or OpenClaw changes, use the focused sections below before opening a pull request.
14
-
15
- Quick checks (minimum recommended):
16
-
17
- ```bash
18
- npm test # General validation
19
- npm run pack:skills # Skill changes
20
- npm run check:skills-publish # Skill changes
21
- npm run typecheck:openclaw # OpenClaw changes
22
- ```
23
-
24
- See the NPM Scripts section and Pull Request Checklist for complete scenario-specific checks.
25
-
26
- ## Project Structure
27
-
28
- ```
29
- ├── agents/ # Agent definitions (Markdown + YAML frontmatter)
30
- ├── bin/ # CLI entry point (frontend-craft.ts)
31
- ├── commands/ # Custom commands (fec-init, fec-review, fec-scaffold)
32
- ├── docs/ # Runtime installation docs and localized READMEs
33
- ├── hooks/ # Hook configuration (hooks.json)
34
- ├── scripts/ # Source-run maintenance scripts (build, packaging, publishing checks)
35
- ├── skills/ # Skill definitions (SKILL.md, metadata.json)
36
- ├── src/ # Source code
37
- │ ├── hooks/ # Runtime hook source bundled to dist/hooks/
38
- │ ├── install/ # Installer core (CLI, interactive wizard, runtime converters)
39
- │ └── openclaw/ # OpenClaw runtime TypeScript source
40
- ├── templates/ # Templates (Claude/Codex/OpenClaw configs + shared rules)
41
- ├── tests/ # Test suite
42
- │ ├── converters/ # Converter tests
43
- │ └── install/ # Installer tests (CLI, E2E, all-runtimes dry-run)
44
- └── package.json # Project configuration and scripts
45
- ```
46
-
47
- ## Local Development and Debugging
48
-
49
- ```bash
50
- # 1. Install dependencies
51
- npm install
52
-
53
- # 2. Build dist/bin and dist/hooks
54
- npm run build
55
-
56
- # 3. Install to a specific runtime (e.g., claude)
57
- node dist/bin/frontend-craft.js install claude --local --dry-run # preview first
58
- node dist/bin/frontend-craft.js install claude --local # actual install
59
-
60
- # 4. Install to all runtimes
61
- node dist/bin/frontend-craft.js install --all --dry-run
62
-
63
- # 5. List all supported runtimes
64
- node dist/bin/frontend-craft.js list
65
- ```
66
-
67
- `npm run build` runs `clean`, `typecheck`, and `scripts/build-dist.ts`. Run it before using `dist/bin/frontend-craft.js` or the bundled hook scripts locally.
68
-
69
- ## Testing
70
-
71
- Tests use Node.js built-in `node:test` with `assert/strict`.
72
-
73
- ```bash
74
- # Run all tests
75
- npm test
76
-
77
- # Run a single test file
78
- node --import tsx --test tests/install/cli.test.ts
79
-
80
- # Run installer tests
81
- node --import tsx --test tests/install/*.test.ts
82
-
83
- # Run converter tests
84
- node --import tsx --test tests/converters/*.test.ts
85
-
86
- # Run all-runtimes dry-run test
87
- node --import tsx --test tests/install/all-runtimes-dry.test.ts
88
- ```
89
-
90
- For testing the interactive installation wizard, set `FRONTEND_CRAFT_FORCE_INTERACTIVE=1`:
91
-
92
- ```bash
93
- FRONTEND_CRAFT_FORCE_INTERACTIVE=1 node --import tsx --test tests/install/cli.test.ts
94
- ```
95
-
96
- `npm test` runs `npm run build` first, then executes the curated converter and installer test suite from `tests/`.
97
-
98
- ## OpenClaw Build
99
-
100
- The OpenClaw runtime has its own build pipeline:
101
-
102
- ```bash
103
- npm run build:openclaw # Bundle TypeScript to dist/openclaw/ via esbuild
104
- npm run typecheck:openclaw # TypeScript type checking
105
- npm run check:openclaw-dist # Verify dist integrity
106
- npm run pack:openclaw # Full build + verify + package
107
- ```
108
-
109
- Source: `src/openclaw/` (TypeScript) → `dist/openclaw/index.js` (bundled ESM).
110
- TypeScript config: `tsconfig.openclaw.json`.
111
-
112
- ## Standalone Skill Packages
113
-
114
- The canonical skill sources live under `skills/<skill-id>/`. Do not edit generated files under `skill-packages/` by hand.
115
-
116
- ```bash
117
- npm run pack:skills # Build one standalone package per skill
118
- npm run check:skills-publish # Verify package metadata, index, and copied references
119
- npm run pack:all # Build + test + OpenClaw package + standalone skill packages
120
- ```
121
-
122
- `npm run pack:skills` writes `skill-packages/<skill-id>/` with `SKILL.md`, only the referenced `references/` files, `metadata.json`, `package.json`, `README.md`, and `LICENSE`. It also writes `skill-packages/index.json` for platform crawlers and release automation.
123
-
124
- When changing a skill, keep these source files aligned:
125
-
126
- - `skills/<skill-id>/SKILL.md` — canonical runtime instruction.
127
- - `skills/metadata.json` — publish metadata, category, tags, keywords, platform targets, and package version.
128
- - `skills/eval_queries.json` — positive and negative trigger examples used by routing quality checks.
129
- - `README.md` and localized README summaries when the public skill list or user-facing behavior changes.
130
-
131
- ## NPM Scripts
132
-
133
- Use `package.json` scripts as the public development entrypoints.
134
-
135
- | Script | Purpose |
136
- | ------------------------------ | -------------------------------------------------------------------------------- |
137
- | `npm run clean` | Remove `dist/`. |
138
- | `npm run typecheck` | Run main TypeScript checks plus checked skill support scripts. |
139
- | `npm run build` | Run `clean`, `typecheck`, and bundle CLI/hooks via `scripts/build-dist.ts`. |
140
- | `npm test` | Build, then run the curated `node:test` suite with `tsx`. |
141
- | `npm run build:openclaw` | Build the main project, then bundle OpenClaw runtime output. |
142
- | `npm run audit:skills` | Build, then report skill instruction size and description overlap signals. |
143
- | `npm run typecheck:openclaw` | Run TypeScript checking for OpenClaw with `tsconfig.openclaw.json`. |
144
- | `npm run check:openclaw-dist` | Verify the generated OpenClaw dist output. |
145
- | `npm run pack:openclaw` | Build, verify, and package the OpenClaw plugin. |
146
- | `npm run pack:skills` | Build first, then create standalone packages under `skill-packages/`. |
147
- | `npm run check:skills-publish` | Build first, then verify standalone skill package metadata and copied files. |
148
- | `npm run pack:all` | Build, run tests, package OpenClaw, package skills, and verify skill output. |
149
- | `npm run sync:version` | Sync package version metadata across release manifests. |
150
- | `npm run version` | Run `sync:version`, then stage versioned manifests for npm version workflows. |
151
- | `npm run prepack` | Build before `npm pack`. |
152
- | `npm run prepublishOnly` | Sync versions and run tests before npm publish. |
153
-
154
- For common change types:
155
-
156
- - Skill changes: run `npm test`, `npm run audit:skills`, `npm run pack:skills`, and `npm run check:skills-publish`.
157
- - OpenClaw changes: run `npm run typecheck:openclaw` and `npm run pack:openclaw`.
158
- - Release packaging: run `npm run pack:all`; `prepublishOnly` also runs version sync and tests before publish.
159
-
160
- ## Source Maintenance Files
161
-
162
- Maintenance scripts live under `scripts/` and run from source with `tsx`; they are not published as `dist/scripts`.
163
-
164
- | File | Purpose |
165
- | ------------------------------------------ | ------------------------------------ |
166
- | `scripts/audit-skills.ts` | Skill size and trigger-overlap audit |
167
- | `scripts/build-dist.ts` | CLI and runtime hook bundler |
168
- | `scripts/clean-dist.mjs` | Remove generated `dist/` output |
169
- | `scripts/sync-codex-agents-toml.ts` | Sync Codex agents configuration |
170
- | `scripts/sync-version.ts` | Sync release version metadata |
171
- | `scripts/pack-skills.ts` | Standalone skill package builder |
172
- | `scripts/check-skills-publish.ts` | Standalone skill package verifier |
173
- | `scripts/skill-packaging.ts` | Shared skill packaging helpers |
174
- | `scripts/openclaw/build.ts` | OpenClaw esbuild bundler |
175
- | `scripts/openclaw/pack-openclaw.ts` | OpenClaw packaging |
176
- | `scripts/openclaw/verify-openclaw-dist.ts` | Verify OpenClaw dist completeness |
177
-
178
- ## Runtime Hook Scripts
179
-
180
- Hook scripts live under `src/hooks/` and are bundled into `dist/hooks/` for published runtime use. Maintenance scripts live under `scripts/` and run from source with `tsx`; they are not published as `dist/scripts`.
181
-
182
- | Source file | Bundled output | Purpose |
183
- | ---------------------------------- | ----------------------------------- | ---------------------- |
184
- | `src/hooks/run-tests.ts` | `dist/hooks/run-tests.js` | Test runner helper |
185
- | `src/hooks/format-changed-file.ts` | `dist/hooks/format-changed-file.js` | Format changed files |
186
- | `src/hooks/security-check.ts` | `dist/hooks/security-check.js` | Security scanning |
187
- | `src/hooks/notify.ts` | `dist/hooks/notify.js` | Notification script |
188
- | `src/hooks/session-start.ts` | `dist/hooks/session-start.js` | Session initialization |
189
-
190
- ## Architecture Overview
191
-
192
- The universal installer follows this architecture:
193
-
194
- ```
195
- bin/frontend-craft.ts
196
- └─ src/install/cli.ts # CLI entry (parse commands: install/list/version/uninstall)
197
- ├─ src/install/registry.ts # Runtime registry (names + installer map)
198
- ├─ src/install/converters/ # Per-runtime adapters (claude, codex, cursor, copilot, etc.)
199
- ├─ src/install/interactive.ts # Interactive wizard (runtime/location prompts)
200
- ├─ src/install/runtime-homes.ts # Global/local directory conventions
201
- └─ src/install/types.ts # Shared TypeScript types
202
- ```
203
-
204
- Each runtime converter under `src/install/converters/` implements the `InstallContext` interface from `types.ts`, writing skills, agents, commands, hooks, and templates to the target runtime's configuration directory.
205
-
206
- ## Branch Strategy
207
-
208
- - `main` - stable release branch.
209
- - `develop` - development branch, if used.
210
- - `feature/<name>` - new features.
211
- - `fix/<name>` - bug fixes.
212
- - `docs/<name>` - documentation updates.
213
-
214
- ## Commit Convention
215
-
216
- Use [Conventional Commits](https://www.conventionalcommits.org/):
217
-
218
- ```text
219
- <type>(<scope>): <description>
220
-
221
- [optional body]
222
- [optional footer]
223
- ```
224
-
225
- Common types:
226
-
227
- | Type | Meaning |
228
- | ---------- | ------------------------------ |
229
- | `feat` | New feature |
230
- | `fix` | Bug fix |
231
- | `docs` | Documentation |
232
- | `refactor` | Refactoring |
233
- | `test` | Tests |
234
- | `chore` | Build, tooling, or maintenance |
235
-
236
- Examples:
237
-
238
- ```text
239
- feat(skills): add e2e testing skill
240
- fix(hooks): resolve Windows path handling
241
- docs(readme): update installation steps
242
- ```
243
-
244
- ## Language and Documentation Policy
245
-
246
- English is the source language for public project governance, runtime documentation, release notes, and GitHub collaboration templates. Localized README files should stay user-focused and link back to English docs for detailed contributor or maintainer workflows.
247
-
248
- When a pull request changes public behavior, installation steps, runtimes, agents, skills, commands, or hooks:
249
-
250
- - Update `README.md` and `CHANGELOG.md` first (and [`CHANGELOG.zh-CN.md`](CHANGELOG.zh-CN.md) when the change is release-noteworthy for Chinese readers).
251
- - Sync user-facing summaries in `README.zh-CN.md`, `docs/zh-TW/README.md`, `docs/ja-JP/README.md`, and `docs/ko-KR/README.md` when the change affects users.
252
- - Claude Code Marketplace install and update steps are maintained in [`docs/runtimes/claude.md`](docs/runtimes/claude.md) and [`docs/runtimes/claude.zh-CN.md`](docs/runtimes/claude.zh-CN.md). When that flow changes, update those files (the root README and localized READMEs only link there).
253
- - If translations cannot be completed in the same pull request, open or link a follow-up issue and mention it in the PR description.
254
- - Keep code examples, runtime names, command names, file paths, and package names consistent across languages.
255
-
256
- Issues and pull requests are easiest to review in English. If you are more comfortable writing in Chinese, that is also welcome; maintainers can help translate titles and summaries when needed.
257
-
258
- ## Adding a Skill
259
-
260
- 1. Create a directory under `skills/`, for example `skills/fec-my-skill/`.
261
- 2. Add `SKILL.md` with YAML frontmatter and concise instructions:
262
-
263
- ```markdown
264
- ---
265
- name: fec-my-skill
266
- description: Use when the user needs ...
267
- ---
268
-
269
- # Skill Title
270
-
271
- ## When to Use
272
-
273
- - ...
274
-
275
- ## Core Rules
276
-
277
- - ...
278
- ```
279
-
280
- 3. Add an entry to `skills/metadata.json` with `id`, display `name`, taxonomy `category`, `tags`, `summary`, publish metadata, `keywords`, and `platforms`. The `version`, `license`, `homepage`, and `repository` fields should match `package.json`.
281
- 4. Add positive and negative trigger examples to `skills/eval_queries.json`.
282
- 5. Add the skill to the Skills table in `README.md`.
283
- 6. Update the repository tree in `README.md` and localized README files if the visible structure changes.
284
- 7. Run `npm test`, `npm run pack:skills`, and `npm run check:skills-publish`.
285
-
286
- ## Adding an Agent
287
-
288
- 1. Create `agents/my-agent.md`.
289
- 2. Define the YAML frontmatter:
290
-
291
- ```markdown
292
- ---
293
- name: my-agent
294
- description: Use this agent when ...
295
- tools: Read, Edit, Write, Glob, Grep, Bash
296
- model: sonnet
297
- skills:
298
- - relevant-skill
299
- ---
300
- ```
301
-
302
- 1. Update the Agents table in `README.md`.
303
- 2. Sync `README.zh-CN.md`, `docs/*/README.md`, and `.claude-plugin/marketplace.json` when counts or user-facing descriptions change.
304
-
305
- ## Adding a Command
306
-
307
- 1. Create `commands/my-command.md`.
308
- 2. Use YAML frontmatter and Markdown steps.
309
- 3. Update the Commands table in `README.md` and localized user-facing summaries as needed.
310
-
311
- ## Adding a Rule Template
312
-
313
- 1. Create `templates/shared/rules/my-rule.md`.
314
- 2. Add it to the copy list in `commands/fec-init.md`.
315
- 3. Update `templates/claude/CLAUDE.md` rule import examples when applicable.
316
-
317
- ## Universal Installer
318
-
319
- - Entry point: `bin/frontend-craft.ts` (compiled to `dist/bin/frontend-craft.js`).
320
- - Implementation: `src/install/` (converters, registry, path helpers).
321
- - Interactive prompts and input parsing: `src/install/interactive.ts` (tests may set `FRONTEND_CRAFT_FORCE_INTERACTIVE=1` to exercise stdin-fed prompts).
322
- - Register a new runtime in `src/install/registry.ts`.
323
- - Add the runtime installer under `src/install/converters/`.
324
- - Follow global directory conventions from `src/install/runtime-homes.ts`.
325
- - Add or update tests under `tests/install/`.
326
-
327
- ## Adding a Hook
328
-
329
- 1. Update `hooks/hooks.json`.
330
- 2. Put runtime hook scripts under `src/hooks/` and prefer cross-platform Node.js.
331
- 3. Add each new hook entrypoint to `scripts/build-dist.ts` so `npm run build` bundles it into `dist/hooks/`.
332
- 4. In `hooks/hooks.json`, use **`${CLAUDE_PLUGIN_ROOT}/dist/hooks/<script>.js`** for bundled hook entrypoints (Claude Code substitutes the root at runtime; see the official [Plugins reference](https://code.claude.com/docs/en/plugins-reference)). The Claude installer in this repo also expands **`${CLAUDE_PLUGIN_ROOT}`** and legacy **`${FRONTEND_CRAFT_ROOT}`** to absolute paths when it writes `hooks.json` under `.claude/`.
333
- 5. Keep repository maintenance scripts under `scripts/`; do not reference them directly from runtime hook configuration.
334
- 6. Update the Hooks table in `README.md`.
335
-
336
- ## Pull Request Checklist
337
-
338
- Before opening a pull request:
339
-
340
- - [ ] The change is scoped and described clearly.
341
- - [ ] `npm test` passes.
342
- - [ ] Skill changes pass `npm run audit:skills`, `npm run pack:skills`, and `npm run check:skills-publish`.
343
- - [ ] `npm run typecheck:openclaw` and `npm run pack:openclaw` pass when OpenClaw code or templates are affected.
344
- - [ ] `README.md` and `CHANGELOG.md` are updated when user-facing behavior changes (and `CHANGELOG.zh-CN.md` when you ship Chinese-facing release notes).
345
- - [ ] Localized README files are synced, or a follow-up translation issue is linked.
346
- - [ ] New runtime, agent, skill, command, hook, or template changes include relevant tests or dry-run coverage.
347
- - [ ] Release packaging changes pass `npm run pack:all` or are covered by the `prepublishOnly` publish gate.
348
- - [ ] Security-sensitive changes have been reviewed against `SECURITY.md`.
349
-
350
- ## Code Style
351
-
352
- - Prefer clear Markdown with stable headings and tables.
353
- - Keep skill and agent descriptions concise because model routing depends on them.
354
- - Use cross-platform Node.js scripts for automation.
355
- - Avoid shell-specific assumptions unless a runtime explicitly requires them.
356
-
357
- ## Reporting Issues
358
-
359
- Use [GitHub Issues](https://github.com/bovinphang/frontend-craft/issues) for bugs and feature requests. Include the runtime, operating system, Node.js version, exact command, expected behavior, and actual behavior whenever possible.
360
-
361
- Do not file security-sensitive vulnerabilities as public issues. Follow [SECURITY.md](SECURITY.md) instead.
1
+ # Contributing Guide
2
+
3
+ Thanks for your interest in `frontend-craft`. Issues, pull requests, documentation fixes, runtime adapters, and better examples are all welcome.
4
+
5
+ **Simplified Chinese:** [CONTRIBUTING.zh-CN.md](CONTRIBUTING.zh-CN.md)
6
+
7
+ ## Development Setup
8
+
9
+ - Node.js >= 22 for the universal installer and OpenClaw package build.
10
+ - Git.
11
+ - pnpm 12.4.1 (pinned in package.json); installing pnpm through npm requires Node.js >=22.13. The published plugin still supports Node.js >=22.0.0.
12
+ - pnpm-lock.yaml is the sole dependency lockfile. pnpm-workspace.yaml permits esbuild build scripts and explicitly skips optional SDK/native setup not used by this project.
13
+ - Run `pnpm install --frozen-lockfile` before local development.
14
+
15
+ For documentation-only changes, focus on the language and documentation policy plus the pull request checklist. For skill or OpenClaw changes, use the focused sections below before opening a pull request.
16
+
17
+ Quick checks (minimum recommended):
18
+
19
+ `pnpm lint` checks source code and both content languages. `pnpm format:check` checks changed source/config files without modifying them. `pnpm test` recursively discovers `tests/**/*.test.ts`, so new tests need no script-list update.
20
+
21
+ ```bash
22
+ pnpm test # General validation
23
+ pnpm run pack:skills # Skill changes
24
+ pnpm run check:skills-publish # Skill changes
25
+ pnpm run typecheck:openclaw # OpenClaw changes
26
+ ```
27
+
28
+ See the Development Scripts section and Pull Request Checklist for complete scenario-specific checks.
29
+
30
+ ## Project Structure
31
+
32
+ ```
33
+ ├── agents/ # Agent definitions (Markdown + YAML frontmatter)
34
+ ├── bin/ # CLI entry point (frontend-craft.ts)
35
+ ├── commands/ # Custom commands (fec-init, fec-review, fec-scaffold)
36
+ ├── docs/ # Runtime installation docs and localized READMEs
37
+ ├── hooks/ # Hook configuration (hooks.json)
38
+ ├── scripts/ # Source-run maintenance scripts (build, packaging, publishing checks)
39
+ ├── skills/ # Skill definitions (SKILL.md, metadata.json)
40
+ ├── src/ # Source code
41
+ │ ├── hooks/ # Runtime hook source bundled to dist/hooks/
42
+ │ ├── install/ # Installer core (CLI, interactive wizard, runtime converters)
43
+ │ └── openclaw/ # OpenClaw runtime TypeScript source
44
+ ├── templates/ # Templates (Claude/Codex/OpenClaw configs + shared rules)
45
+ ├── tests/ # Test suite
46
+ │ ├── converters/ # Converter tests
47
+ │ └── install/ # Installer tests (CLI, E2E, all-runtimes dry-run)
48
+ └── package.json # Project configuration and scripts
49
+ ```
50
+
51
+ ## Local Development and Debugging
52
+
53
+ ```bash
54
+ # 1. Install dependencies
55
+ pnpm install
56
+
57
+ # 2. Build dist/bin and dist/hooks
58
+ pnpm run build
59
+
60
+ # 3. Install to a specific runtime (e.g., claude)
61
+ node dist/bin/frontend-craft.js install claude --local --dry-run # preview first
62
+ node dist/bin/frontend-craft.js install claude --local # actual install
63
+
64
+ # 4. Install to all runtimes
65
+ node dist/bin/frontend-craft.js install --all --dry-run
66
+
67
+ # 5. List all supported runtimes
68
+ node dist/bin/frontend-craft.js list
69
+ ```
70
+
71
+ `pnpm run build` runs `clean`, `typecheck`, and `scripts/build-dist.ts`. Run it before using `dist/bin/frontend-craft.js` or the bundled hook scripts locally.
72
+
73
+ ## Testing
74
+
75
+ Tests use Node.js built-in `node:test` with `assert/strict`.
76
+
77
+ ```bash
78
+ # Run all tests
79
+ pnpm test
80
+
81
+ # Run a single test file
82
+ node --import tsx --test tests/install/cli.test.ts
83
+
84
+ # Run installer tests
85
+ node --import tsx --test tests/install/*.test.ts
86
+
87
+ # Run converter tests
88
+ node --import tsx --test tests/converters/*.test.ts
89
+
90
+ # Run all-runtimes dry-run test
91
+ node --import tsx --test tests/install/all-runtimes-dry.test.ts
92
+ ```
93
+
94
+ For testing the interactive installation wizard, set `FRONTEND_CRAFT_FORCE_INTERACTIVE=1`:
95
+
96
+ ```bash
97
+ FRONTEND_CRAFT_FORCE_INTERACTIVE=1 node --import tsx --test tests/install/cli.test.ts
98
+ ```
99
+
100
+ `pnpm test` runs `pnpm run build` first, then executes the curated converter and installer test suite from `tests/`.
101
+
102
+ ## OpenClaw Build
103
+
104
+ The OpenClaw runtime has its own build pipeline:
105
+
106
+ ```bash
107
+ pnpm run build:openclaw # Bundle TypeScript to dist/openclaw/ via esbuild
108
+ pnpm run typecheck:openclaw # TypeScript type checking
109
+ pnpm run check:openclaw-dist # Verify dist integrity
110
+ pnpm run pack:openclaw # Full build + verify + package
111
+ ```
112
+
113
+ Source: `src/openclaw/` (TypeScript) → `dist/openclaw/index.js` (bundled ESM).
114
+ TypeScript config: `tsconfig.openclaw.json`.
115
+
116
+ ## Standalone Skill Packages
117
+
118
+ The canonical skill sources live under `skills/<skill-id>/`. Do not edit generated files under `skill-packages/` by hand.
119
+
120
+ ```bash
121
+ pnpm run pack:skills # Build one standalone package per skill
122
+ pnpm run check:skills-publish # Verify package metadata, index, and copied references
123
+ pnpm run pack:all # Build + test + OpenClaw package + standalone skill packages
124
+ ```
125
+
126
+ `pnpm run pack:skills` writes `skill-packages/<skill-id>/` with `SKILL.md`, only the referenced `references/` files, `metadata.json`, `package.json`, `README.md`, and `LICENSE`. It also writes `skill-packages/index.json` for platform crawlers and release automation.
127
+
128
+ When changing a skill, keep these source files aligned:
129
+
130
+ - `skills/<skill-id>/SKILL.md` — canonical runtime instruction.
131
+ - `skills/metadata.json` — publish metadata, category, tags, keywords, platform targets, and package version.
132
+ - `skills/eval_queries.json` — positive and negative trigger examples used by routing quality checks.
133
+ - `README.md` and localized README summaries when the public skill list or user-facing behavior changes.
134
+
135
+ ## Development Scripts
136
+
137
+ Use `package.json` scripts as the public development entrypoints.
138
+
139
+ | Script | Purpose |
140
+ | ------------------------------ | -------------------------------------------------------------------------------- |
141
+ | `pnpm run lint` | Check code and bilingual content declarations. |
142
+ | `pnpm run format:check` | Check changed source formatting. |
143
+ | `pnpm run check:content` | Validate YAML, names, references and localization structure. |
144
+ | `pnpm run clean` | Remove `dist/`. |
145
+ | `pnpm run typecheck` | Run main TypeScript checks plus checked skill support scripts. |
146
+ | `pnpm run build` | Run `clean`, `typecheck`, and bundle CLI/hooks via `scripts/build-dist.ts`. |
147
+ | `pnpm test` | Build, then run the curated `node:test` suite with `tsx`. |
148
+ | `pnpm run build:openclaw` | Build the main project, then bundle OpenClaw runtime output. |
149
+ | `pnpm run audit:skills` | Build, then report skill instruction size and description overlap signals. |
150
+ | `pnpm run typecheck:openclaw` | Run TypeScript checking for OpenClaw with `tsconfig.openclaw.json`. |
151
+ | `pnpm run check:openclaw-dist` | Verify the generated OpenClaw dist output. |
152
+ | `pnpm run pack:openclaw` | Build, verify, and package the OpenClaw plugin. |
153
+ | `pnpm run pack:skills` | Build first, then create standalone packages under `skill-packages/`. |
154
+ | `pnpm run check:skills-publish` | Build first, then verify standalone skill package metadata and copied files. |
155
+ | `pnpm run pack:all` | Build, run tests, package OpenClaw, package skills, and verify skill output. |
156
+ | `pnpm run sync:version` | Sync package version metadata across release manifests. |
157
+ | `pnpm run version` | Sync versioned manifests without automatically staging files. |
158
+ | `pnpm run prepack` | Build before `npm pack`. |
159
+ | `pnpm run prepublishOnly` | Sync versions and run tests before npm publish. |
160
+
161
+ For common change types:
162
+
163
+ - Skill changes: run `pnpm test`, `pnpm run audit:skills`, `pnpm run pack:skills`, and `pnpm run check:skills-publish`.
164
+ - OpenClaw changes: run `pnpm run typecheck:openclaw` and `pnpm run pack:openclaw`.
165
+ - Release packaging: CI runs `pnpm run pack:all`; `prepublishOnly` also runs version sync and tests before publish.
166
+
167
+ ## Source Maintenance Files
168
+
169
+ Maintenance scripts live under `scripts/` and run from source with `tsx`; they are not published as `dist/scripts`.
170
+
171
+ | File | Purpose |
172
+ | ------------------------------------------ | ------------------------------------ |
173
+ | `scripts/audit-skills.ts` | Skill size and trigger-overlap audit |
174
+ | `scripts/build-dist.ts` | CLI and runtime hook bundler |
175
+ | `scripts/clean-dist.mjs` | Remove generated `dist/` output |
176
+ | `scripts/sync-codex-agents-toml.ts` | Sync Codex agents configuration |
177
+ | `scripts/sync-version.ts` | Sync release version metadata |
178
+ | `scripts/pack-skills.ts` | Standalone skill package builder |
179
+ | `scripts/check-skills-publish.ts` | Standalone skill package verifier |
180
+ | `scripts/skill-packaging.ts` | Shared skill packaging helpers |
181
+ | `scripts/openclaw/build.ts` | OpenClaw esbuild bundler |
182
+ | `scripts/openclaw/pack-openclaw.ts` | OpenClaw packaging |
183
+ | `scripts/openclaw/verify-openclaw-dist.ts` | Verify OpenClaw dist completeness |
184
+
185
+ ## Runtime Hook Scripts
186
+
187
+ Hook scripts live under `src/hooks/` and are bundled into `dist/hooks/` for published runtime use. Maintenance scripts live under `scripts/` and run from source with `tsx`; they are not published as `dist/scripts`.
188
+
189
+ | Source file | Bundled output | Purpose |
190
+ | ---------------------------------- | ----------------------------------- | ---------------------- |
191
+ | `src/hooks/cleanup-claude-cache.ts` | `dist/hooks/fec-cleanup-claude-cache.js` | Cache cleanup |
192
+ | `src/hooks/run-tests.ts` | `dist/hooks/fec-run-tests.js` | Test runner helper |
193
+ | `src/hooks/format-changed-file.ts` | `dist/hooks/fec-format-changed-file.js` | Format changed files |
194
+ | `src/hooks/security-check.ts` | `dist/hooks/fec-security-check.js` | Security scanning |
195
+ | `src/hooks/notify.ts` | `dist/hooks/fec-notify.js` | Notification script |
196
+ | `src/hooks/session-start.ts` | `dist/hooks/fec-session-start.js` | Session initialization |
197
+
198
+ ## Architecture Overview
199
+
200
+ The universal installer follows this architecture:
201
+
202
+ ```
203
+ bin/frontend-craft.ts
204
+ └─ src/install/cli.ts # CLI entry (parse commands: install/list/version/uninstall)
205
+ ├─ src/install/registry.ts # Runtime registry (names + installer map)
206
+ ├─ src/install/converters/ # Per-runtime adapters (claude, codex, cursor, copilot, etc.)
207
+ ├─ src/install/interactive.ts # Interactive wizard (runtime/location prompts)
208
+ ├─ src/install/runtime-homes.ts # Global/local directory conventions
209
+ └─ src/install/types.ts # Shared TypeScript types
210
+ ```
211
+
212
+ Each runtime converter under `src/install/converters/` implements the `InstallContext` interface from `types.ts`, writing skills, agents, commands, hooks, and templates to the target runtime's configuration directory.
213
+
214
+ ## Branch Strategy
215
+
216
+ - `main` - stable release branch.
217
+ - `develop` - development branch, if used.
218
+ - `feature/<name>` - new features.
219
+ - `fix/<name>` - bug fixes.
220
+ - `docs/<name>` - documentation updates.
221
+
222
+ ## Commit Convention
223
+
224
+ Use [Conventional Commits](https://www.conventionalcommits.org/):
225
+
226
+ ```text
227
+ <type>(<scope>): <description>
228
+
229
+ [optional body]
230
+ [optional footer]
231
+ ```
232
+
233
+ Common types:
234
+
235
+ | Type | Meaning |
236
+ | ---------- | ------------------------------ |
237
+ | `feat` | New feature |
238
+ | `fix` | Bug fix |
239
+ | `docs` | Documentation |
240
+ | `refactor` | Refactoring |
241
+ | `test` | Tests |
242
+ | `chore` | Build, tooling, or maintenance |
243
+
244
+ Examples:
245
+
246
+ ```text
247
+ feat(skills): add e2e testing skill
248
+ fix(hooks): resolve Windows path handling
249
+ docs(readme): update installation steps
250
+ ```
251
+
252
+ ## Language and Documentation Policy
253
+
254
+ English is the source language for public project governance, runtime documentation, release notes, and GitHub collaboration templates. Localized README files should stay user-focused and link back to English docs for detailed contributor or maintainer workflows.
255
+
256
+ When a pull request changes public behavior, installation steps, runtimes, agents, skills, commands, or hooks:
257
+
258
+ - Update `README.md` and `CHANGELOG.md` first (and [`CHANGELOG.zh-CN.md`](CHANGELOG.zh-CN.md) when the change is release-noteworthy for Chinese readers).
259
+ - Sync user-facing summaries in `README.zh-CN.md`, `docs/zh-TW/README.md`, `docs/ja-JP/README.md`, and `docs/ko-KR/README.md` when the change affects users.
260
+ - Claude Code Marketplace install and update steps are maintained in [`docs/runtimes/claude.md`](docs/runtimes/claude.md) and [`docs/runtimes/claude.zh-CN.md`](docs/runtimes/claude.zh-CN.md). When that flow changes, update those files (the root README and localized READMEs only link there).
261
+ - If translations cannot be completed in the same pull request, open or link a follow-up issue and mention it in the PR description.
262
+ - Keep code examples, runtime names, command names, file paths, and package names consistent across languages.
263
+
264
+ Issues and pull requests are easiest to review in English. If you are more comfortable writing in Chinese, that is also welcome; maintainers can help translate titles and summaries when needed.
265
+
266
+ ## Adding a Skill
267
+
268
+ 1. Create a directory under `skills/`, for example `skills/fec-my-skill/`.
269
+ 2. Add `SKILL.md` with YAML frontmatter and concise instructions:
270
+
271
+ ```markdown
272
+ ---
273
+ name: fec-my-skill
274
+ description: Use when the user needs ...
275
+ ---
276
+
277
+ # Skill Title
278
+
279
+ ## When to Use
280
+
281
+ - ...
282
+
283
+ ## Core Rules
284
+
285
+ - ...
286
+ ```
287
+
288
+ 3. Add an entry to `skills/metadata.json` with `id`, display `name`, taxonomy `category`, `tags`, `summary`, publish metadata, `keywords`, and `platforms`. The `version`, `license`, `homepage`, and `repository` fields should match `package.json`.
289
+ 4. Add positive and negative trigger examples to `skills/eval_queries.json`.
290
+ 5. Add the skill to the Skills table in `README.md`.
291
+ 6. Update the repository tree in `README.md` and localized README files if the visible structure changes.
292
+ 7. Run `pnpm test`, `pnpm run pack:skills`, and `pnpm run check:skills-publish`.
293
+
294
+ ## Adding an Agent
295
+
296
+ 1. Create `agents/my-agent.md`.
297
+ 2. Define the YAML frontmatter:
298
+
299
+ ```markdown
300
+ ---
301
+ name: my-agent
302
+ description: Use this agent when ...
303
+ tools: Read, Edit, Write, Glob, Grep, Bash
304
+ model: sonnet
305
+ skills:
306
+ - relevant-skill
307
+ ---
308
+ ```
309
+
310
+ 1. Update the Agents table in `README.md`.
311
+ 2. Sync `README.zh-CN.md`, `docs/*/README.md`, and `.claude-plugin/marketplace.json` when counts or user-facing descriptions change.
312
+
313
+ ## Adding a Command
314
+
315
+ 1. Create `commands/my-command.md`.
316
+ 2. Use YAML frontmatter and Markdown steps.
317
+ 3. Update the Commands table in `README.md` and localized user-facing summaries as needed.
318
+
319
+ ## Adding a Rule Template
320
+
321
+ 1. Create `templates/shared/rules/my-rule.md`.
322
+ 2. Add it to the copy list in `commands/fec-init.md`.
323
+ 3. Update `templates/claude/CLAUDE.md` rule import examples when applicable.
324
+
325
+ ## Universal Installer
326
+
327
+ - Entry point: `bin/frontend-craft.ts` (compiled to `dist/bin/frontend-craft.js`).
328
+ - Implementation: `src/install/` (converters, registry, path helpers).
329
+ - Interactive prompts and input parsing: `src/install/interactive.ts` (tests may set `FRONTEND_CRAFT_FORCE_INTERACTIVE=1` to exercise stdin-fed prompts).
330
+ - Register a new runtime in `src/install/registry.ts`.
331
+ - Add the runtime installer under `src/install/converters/`.
332
+ - Follow global directory conventions from `src/install/runtime-homes.ts`.
333
+ - Add or update tests under `tests/install/`.
334
+
335
+ ## Adding a Hook
336
+
337
+ 1. Update `hooks/hooks.json`.
338
+ 2. Put runtime hook scripts under `src/hooks/` and prefer cross-platform Node.js.
339
+ 3. Add each new hook entrypoint to `scripts/build-dist.ts` so `pnpm run build` bundles it into `dist/hooks/`.
340
+ 4. In `hooks/hooks.json`, use **`${CLAUDE_PLUGIN_ROOT}/dist/hooks/<script>.js`** for bundled hook entrypoints (Claude Code substitutes the root at runtime; see the official [Plugins reference](https://code.claude.com/docs/en/plugins-reference)). The Claude installer in this repo also expands **`${CLAUDE_PLUGIN_ROOT}`** and legacy **`${FRONTEND_CRAFT_ROOT}`** to absolute paths when it writes `hooks.json` under `.claude/`.
341
+ 5. Keep repository maintenance scripts under `scripts/`; do not reference them directly from runtime hook configuration.
342
+ 6. Update the Hooks table in `README.md`.
343
+
344
+ ## Pull Request Checklist
345
+
346
+ Before opening a pull request:
347
+
348
+ - [ ] The change is scoped and described clearly.
349
+ - [ ] `pnpm test` passes.
350
+ - [ ] Skill changes pass `pnpm run audit:skills`, `pnpm run pack:skills`, and `pnpm run check:skills-publish`.
351
+ - [ ] `pnpm run typecheck:openclaw` and `pnpm run pack:openclaw` pass when OpenClaw code or templates are affected.
352
+ - [ ] `README.md` and `CHANGELOG.md` are updated when user-facing behavior changes (and `CHANGELOG.zh-CN.md` when you ship Chinese-facing release notes).
353
+ - [ ] Localized README files are synced, or a follow-up translation issue is linked.
354
+ - [ ] New runtime, agent, skill, command, hook, or template changes include relevant tests or dry-run coverage.
355
+ - [ ] Release packaging changes pass `pnpm run pack:all` or are covered by the `prepublishOnly` publish gate.
356
+ - [ ] Security-sensitive changes have been reviewed against `SECURITY.md`.
357
+
358
+ ## Code Style
359
+
360
+ - Prefer clear Markdown with stable headings and tables.
361
+ - Keep skill and agent descriptions concise because model routing depends on them.
362
+ - Use cross-platform Node.js scripts for automation.
363
+ - Avoid shell-specific assumptions unless a runtime explicitly requires them.
364
+
365
+ ## Reporting Issues
366
+
367
+ Use [GitHub Issues](https://github.com/bovinphang/frontend-craft/issues) for bugs and feature requests. Include the runtime, operating system, Node.js version, exact command, expected behavior, and actual behavior whenever possible.
368
+
369
+ Do not file security-sensitive vulnerabilities as public issues. Follow [SECURITY.md](SECURITY.md) instead.
370
+
371
+ When changing review or diagram capabilities, synchronize scope defaults, natural-language examples, tool prerequisites, QA limits, and coverage reporting across README translations and runtime guides. See [review scope and technical diagram delivery](docs/review-and-diagram-workflows.md).