@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.
- package/.claude-plugin/marketplace.json +61 -0
- package/.claude-plugin/plugin.json +32 -0
- package/.mcp.json +44 -0
- package/CHANGELOG.md +229 -0
- package/CHANGELOG.zh-CN.md +228 -0
- package/CODE_OF_CONDUCT.md +34 -0
- package/CODE_OF_CONDUCT.zh-CN.md +34 -0
- package/CONTRIBUTING.md +356 -0
- package/CONTRIBUTING.zh-CN.md +356 -0
- package/LICENSE +21 -0
- package/README.md +467 -0
- package/README.openclaw.md +262 -0
- package/README.openclaw.zh-CN.md +262 -0
- package/README.zh-CN.md +467 -0
- package/SECURITY.md +44 -0
- package/SECURITY.zh-CN.md +44 -0
- package/agents/fec-architect.md +125 -0
- package/agents/fec-code-reviewer.md +152 -0
- package/agents/fec-debugger.md +44 -0
- package/agents/fec-design-token-mapper.md +75 -0
- package/agents/fec-doc-updater.md +30 -0
- package/agents/fec-e2e-runner.md +107 -0
- package/agents/fec-figma-implementer.md +104 -0
- package/agents/fec-performance-optimizer.md +293 -0
- package/agents/fec-refactor-cleaner.md +32 -0
- package/agents/fec-security-reviewer.md +116 -0
- package/agents/fec-test-planner.md +50 -0
- package/agents/fec-typescript-reviewer.md +142 -0
- package/agents/fec-ui-checker.md +120 -0
- package/commands/fec-debug.md +30 -0
- package/commands/fec-doc-sync.md +18 -0
- package/commands/fec-init.md +70 -0
- package/commands/fec-plan.md +94 -0
- package/commands/fec-refactor-clean.md +19 -0
- package/commands/fec-review.md +66 -0
- package/commands/fec-scaffold.md +205 -0
- package/commands/fec-tdd.md +21 -0
- package/dist/bin/frontend-craft.js +82 -0
- package/dist/hooks/fec-cleanup-claude-cache.js +4 -0
- package/dist/hooks/fec-format-changed-file.js +1 -0
- package/dist/hooks/fec-notify.js +1 -0
- package/dist/hooks/fec-run-tests.js +1 -0
- package/dist/hooks/fec-security-check.js +2 -0
- package/dist/hooks/fec-session-start.js +1 -0
- package/docs/example-prompts.md +124 -0
- package/docs/ja-JP/README.md +467 -0
- package/docs/ko-KR/README.md +467 -0
- package/docs/project-structure.md +119 -0
- package/docs/runtimes/antigravity.md +10 -0
- package/docs/runtimes/augment.md +10 -0
- package/docs/runtimes/claude.md +171 -0
- package/docs/runtimes/claude.zh-CN.md +169 -0
- package/docs/runtimes/cline.md +10 -0
- package/docs/runtimes/codebuddy.md +10 -0
- package/docs/runtimes/codex.md +10 -0
- package/docs/runtimes/copilot.md +10 -0
- package/docs/runtimes/cursor.md +10 -0
- package/docs/runtimes/gemini.md +10 -0
- package/docs/runtimes/kilo.md +10 -0
- package/docs/runtimes/openclaw.md +10 -0
- package/docs/runtimes/opencode.md +10 -0
- package/docs/runtimes/qoder.md +19 -0
- package/docs/runtimes/trae.md +10 -0
- package/docs/runtimes/windsurf.md +10 -0
- package/docs/superpowers/plans/2026-05-29-fec-debug.md +491 -0
- package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +340 -0
- package/docs/zh-CN/example-prompts.md +124 -0
- package/docs/zh-CN/project-structure.md +119 -0
- package/docs/zh-TW/README.md +467 -0
- package/hooks/hooks.json +71 -0
- package/openclaw.plugin.json +26 -0
- package/package.json +101 -0
- package/skills/TEMPLATE.md +155 -0
- package/skills/eval_queries.json +890 -0
- package/skills/fec-accessibility-check/SKILL.md +39 -0
- package/skills/fec-accessibility-check/references/report-template.md +23 -0
- package/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
- package/skills/fec-api-integration/SKILL.md +78 -0
- package/skills/fec-api-integration/references/integration-patterns.md +80 -0
- package/skills/fec-browser-storage/SKILL.md +34 -0
- package/skills/fec-browser-storage/references/storage-patterns.md +65 -0
- package/skills/fec-canvas-threejs/SKILL.md +66 -0
- package/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
- package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
- package/skills/fec-code-review/SKILL.md +135 -0
- package/skills/fec-code-review/references/report-template.md +29 -0
- package/skills/fec-component-testing/SKILL.md +119 -0
- package/skills/fec-data-fetching/SKILL.md +62 -0
- package/skills/fec-data-fetching/references/query-patterns.md +77 -0
- package/skills/fec-debug-framework/SKILL.md +162 -0
- package/skills/fec-dependency-upgrade/SKILL.md +34 -0
- package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
- package/skills/fec-doc-sync/SKILL.md +37 -0
- package/skills/fec-e2e-testing/SKILL.md +40 -0
- package/skills/fec-e2e-testing/references/e2e-advanced.md +176 -0
- package/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
- package/skills/fec-form-handling/SKILL.md +76 -0
- package/skills/fec-form-handling/references/advanced-form-patterns.md +72 -0
- package/skills/fec-implement-from-design/SKILL.md +122 -0
- package/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
- package/skills/fec-legacy-to-modern-migration/SKILL.md +180 -0
- package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
- package/skills/fec-legacy-web-standard/SKILL.md +35 -0
- package/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
- package/skills/fec-list-virtualization/SKILL.md +34 -0
- package/skills/fec-list-virtualization/references/virtualization-patterns.md +52 -0
- package/skills/fec-monorepo-project-standard/SKILL.md +142 -0
- package/skills/fec-motion-interaction/SKILL.md +66 -0
- package/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
- package/skills/fec-nextjs-project-standard/SKILL.md +117 -0
- package/skills/fec-nuxt-project-standard/SKILL.md +122 -0
- package/skills/fec-performance-optimization/SKILL.md +72 -0
- package/skills/fec-pwa-implementation/SKILL.md +36 -0
- package/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
- package/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
- package/skills/fec-react-project-standard/SKILL.md +83 -0
- package/skills/fec-react-project-standard/references/react-project-details.md +642 -0
- package/skills/fec-refactor-clean/SKILL.md +48 -0
- package/skills/fec-responsive-layout/SKILL.md +34 -0
- package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +59 -0
- package/skills/fec-route-protection/SKILL.md +135 -0
- package/skills/fec-security-review/SKILL.md +38 -0
- package/skills/fec-security-review/references/report-template.md +27 -0
- package/skills/fec-security-review/references/security-checklist.md +64 -0
- package/skills/fec-source-driven-development/SKILL.md +61 -0
- package/skills/fec-state-management/SKILL.md +140 -0
- package/skills/fec-state-management/references/state-patterns.md +109 -0
- package/skills/fec-storybook-component-doc/SKILL.md +37 -0
- package/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
- package/skills/fec-svg-animation/SKILL.md +148 -0
- package/skills/fec-tailwind-design-system/SKILL.md +34 -0
- package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +55 -0
- package/skills/fec-tdd-workflow/SKILL.md +52 -0
- package/skills/fec-testing-strategy/SKILL.md +45 -0
- package/skills/fec-typescript-type-safety/SKILL.md +157 -0
- package/skills/fec-typescript-type-safety/references/type-safety-patterns.md +102 -0
- package/skills/fec-ui-design/SKILL.md +90 -0
- package/skills/fec-ui-design/data/product-rules.json +110 -0
- package/skills/fec-ui-design/data/stack-ui-rules.json +14 -0
- package/skills/fec-ui-design/data/style-archetypes.json +74 -0
- package/skills/fec-ui-design/data/ux-quality-rules.json +56 -0
- package/skills/fec-ui-design/references/design-intelligence.md +37 -0
- package/skills/fec-ui-design/references/master-page-overrides.md +30 -0
- package/skills/fec-ui-design/references/pre-delivery-checklist.md +33 -0
- package/skills/fec-ui-design/scripts/design-system.mjs +530 -0
- package/skills/fec-validation-fix/SKILL.md +48 -0
- package/skills/fec-vite-project-standard/SKILL.md +83 -0
- package/skills/fec-vue3-project-standard/SKILL.md +49 -0
- package/skills/fec-vue3-project-standard/references/vue3-project-details.md +547 -0
- package/skills/fec-web-workers/SKILL.md +36 -0
- package/skills/fec-web-workers/references/advanced-workers.md +54 -0
- package/skills/fec-web-workers/references/basic-worker.md +67 -0
- package/skills/metadata.json +1422 -0
- package/skills/relations.json +644 -0
- package/templates/claude/CLAUDE.md +106 -0
- package/templates/claude/settings.json +62 -0
- package/templates/codex/AGENTS.md +105 -0
- package/templates/codex/config.toml +32 -0
- package/templates/openclaw/AGENTS.md +101 -0
- package/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
- package/templates/shared/rules/fec-agent-workflow.md +54 -0
- package/templates/shared/rules/fec-api-layer.md +99 -0
- package/templates/shared/rules/fec-ci-cd.md +128 -0
- package/templates/shared/rules/fec-code-comments.md +33 -0
- package/templates/shared/rules/fec-design-system.md +248 -0
- package/templates/shared/rules/fec-error-handling.md +200 -0
- package/templates/shared/rules/fec-git-conventions.md +73 -0
- package/templates/shared/rules/fec-i18n.md +112 -0
- package/templates/shared/rules/fec-naming-conventions.md +120 -0
- package/templates/shared/rules/fec-performance.md +101 -0
- package/templates/shared/rules/fec-react.md +82 -0
- package/templates/shared/rules/fec-refactoring.md +43 -0
- package/templates/shared/rules/fec-rendering-patterns.md +183 -0
- package/templates/shared/rules/fec-responsive-design.md +227 -0
- package/templates/shared/rules/fec-source-driven-development.md +31 -0
- package/templates/shared/rules/fec-state-management.md +163 -0
- package/templates/shared/rules/fec-testing.md +98 -0
- package/templates/shared/rules/fec-typescript.md +355 -0
- package/templates/shared/rules/fec-vue.md +64 -0
- package/templates/shared/rules/fec-working-modes.md +50 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# 行为准则
|
|
2
|
+
|
|
3
|
+
> **English:** [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
|
|
4
|
+
|
|
5
|
+
## 我们的承诺
|
|
6
|
+
|
|
7
|
+
作为贡献者与维护者,我们承诺参与 `frontend-craft` 社区的每一个人都享有无骚扰的体验,无论其年龄、体型、明显或不易察觉的残疾、族裔、性征、性别认同与表达、经验水平、教育程度、社会经济地位、国籍、外貌、种族、种姓、肤色、宗教或性取向如何。
|
|
8
|
+
|
|
9
|
+
## 我们的标准
|
|
10
|
+
|
|
11
|
+
有助于营造积极环境的行为示例:
|
|
12
|
+
|
|
13
|
+
- 使用友好、包容的语言。
|
|
14
|
+
- 尊重不同的观点与经历。
|
|
15
|
+
- 得体地给予并接受建设性反馈。
|
|
16
|
+
- 关注对社区最有益的事。
|
|
17
|
+
- 对其他社区成员抱持同理心。
|
|
18
|
+
|
|
19
|
+
不可接受的行为示例:
|
|
20
|
+
|
|
21
|
+
- 骚扰、恐吓或歧视性言论。
|
|
22
|
+
- 钓鱼、侮辱性评论或人身攻击。
|
|
23
|
+
- 未经明确许可公开他人隐私信息。
|
|
24
|
+
- 在职业场合中通常会被认为不当的公开或私下行为。
|
|
25
|
+
|
|
26
|
+
## 执行
|
|
27
|
+
|
|
28
|
+
维护者负责阐明并执行可接受行为标准;有权删除、编辑或拒绝与本行为准则不符的评论、提交、Issue、Pull Request 及其他贡献。
|
|
29
|
+
|
|
30
|
+
若遭遇辱骂、骚扰或其他不可接受行为,可向 `package.json` 中列出的维护者报告。我们将尽快、公正地审阅并调查。
|
|
31
|
+
|
|
32
|
+
## 来源说明
|
|
33
|
+
|
|
34
|
+
本行为准则改编自 [Contributor Covenant](https://www.contributor-covenant.org/) 2.1 版。
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
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
|
+
Useful checks:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm test
|
|
17
|
+
npm run pack:skills
|
|
18
|
+
npm run check:skills-publish
|
|
19
|
+
npm run typecheck:openclaw
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Project Structure
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
├── agents/ # Agent definitions (Markdown + YAML frontmatter)
|
|
26
|
+
├── bin/ # CLI entry point (frontend-craft.ts)
|
|
27
|
+
├── commands/ # Custom commands (fec-init, fec-review, fec-scaffold)
|
|
28
|
+
├── docs/ # Runtime installation docs and localized READMEs
|
|
29
|
+
├── hooks/ # Hook configuration (hooks.json)
|
|
30
|
+
├── scripts/ # Source-run maintenance scripts (build, packaging, publishing checks)
|
|
31
|
+
├── skills/ # Skill definitions (SKILL.md, metadata.json)
|
|
32
|
+
├── src/ # Source code
|
|
33
|
+
│ ├── hooks/ # Runtime hook source bundled to dist/hooks/
|
|
34
|
+
│ ├── install/ # Installer core (CLI, interactive wizard, runtime converters)
|
|
35
|
+
│ └── openclaw/ # OpenClaw runtime TypeScript source
|
|
36
|
+
├── templates/ # Templates (Claude/Codex/OpenClaw configs + shared rules)
|
|
37
|
+
├── tests/ # Test suite
|
|
38
|
+
│ ├── converters/ # Converter tests
|
|
39
|
+
│ └── install/ # Installer tests (CLI, E2E, all-runtimes dry-run)
|
|
40
|
+
└── package.json # Project configuration and scripts
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Local Development and Debugging
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# 1. Install dependencies
|
|
47
|
+
npm install
|
|
48
|
+
|
|
49
|
+
# 2. Build dist/bin and dist/hooks
|
|
50
|
+
npm run build
|
|
51
|
+
|
|
52
|
+
# 3. Install to a specific runtime (e.g., claude)
|
|
53
|
+
node dist/bin/frontend-craft.js install claude --local --dry-run # preview first
|
|
54
|
+
node dist/bin/frontend-craft.js install claude --local # actual install
|
|
55
|
+
|
|
56
|
+
# 4. Install to all runtimes
|
|
57
|
+
node dist/bin/frontend-craft.js install --all --dry-run
|
|
58
|
+
|
|
59
|
+
# 5. List all supported runtimes
|
|
60
|
+
node dist/bin/frontend-craft.js list
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`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.
|
|
64
|
+
|
|
65
|
+
## Testing
|
|
66
|
+
|
|
67
|
+
Tests use Node.js built-in `node:test` with `assert/strict`.
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Run all tests
|
|
71
|
+
npm test
|
|
72
|
+
|
|
73
|
+
# Run a single test file
|
|
74
|
+
node --import tsx --test tests/install/cli.test.ts
|
|
75
|
+
|
|
76
|
+
# Run installer tests
|
|
77
|
+
node --import tsx --test tests/install/*.test.ts
|
|
78
|
+
|
|
79
|
+
# Run converter tests
|
|
80
|
+
node --import tsx --test tests/converters/*.test.ts
|
|
81
|
+
|
|
82
|
+
# Run all-runtimes dry-run test
|
|
83
|
+
node --import tsx --test tests/install/all-runtimes-dry.test.ts
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For testing the interactive installation wizard, set `FRONTEND_CRAFT_FORCE_INTERACTIVE=1`:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
FRONTEND_CRAFT_FORCE_INTERACTIVE=1 node --import tsx --test tests/install/cli.test.ts
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`npm test` runs `npm run build` first, then executes the curated converter and installer test suite from `tests/`.
|
|
93
|
+
|
|
94
|
+
## OpenClaw Build
|
|
95
|
+
|
|
96
|
+
The OpenClaw runtime has its own build pipeline:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
npm run build:openclaw # Bundle TypeScript to dist/openclaw/ via esbuild
|
|
100
|
+
npm run typecheck:openclaw # TypeScript type checking
|
|
101
|
+
npm run check:openclaw-dist # Verify dist integrity
|
|
102
|
+
npm run pack:openclaw # Full build + verify + package
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Source: `src/openclaw/` (TypeScript) → `dist/openclaw/index.js` (bundled ESM).
|
|
106
|
+
TypeScript config: `tsconfig.openclaw.json`.
|
|
107
|
+
|
|
108
|
+
## Standalone Skill Packages
|
|
109
|
+
|
|
110
|
+
The canonical skill sources live under `skills/<skill-id>/`. Do not edit generated files under `skill-packages/` by hand.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npm run pack:skills # Build one standalone package per skill
|
|
114
|
+
npm run check:skills-publish # Verify package metadata, index, and copied references
|
|
115
|
+
npm run pack:all # Full test + OpenClaw package + standalone skill packages
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
`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.
|
|
119
|
+
|
|
120
|
+
When changing a skill, keep these source files aligned:
|
|
121
|
+
|
|
122
|
+
- `skills/<skill-id>/SKILL.md` — canonical runtime instruction.
|
|
123
|
+
- `skills/metadata.json` — publish metadata, category, tags, keywords, platform targets, and package version.
|
|
124
|
+
- `skills/eval_queries.json` — positive and negative trigger examples used by routing quality checks.
|
|
125
|
+
- `README.md` and localized README summaries when the public skill list or user-facing behavior changes.
|
|
126
|
+
|
|
127
|
+
## NPM Scripts
|
|
128
|
+
|
|
129
|
+
Use `package.json` scripts as the public development entrypoints.
|
|
130
|
+
|
|
131
|
+
| Script | Purpose |
|
|
132
|
+
| ------------------------------ | -------------------------------------------------------------------------------- |
|
|
133
|
+
| `npm run clean` | Remove `dist/`. |
|
|
134
|
+
| `npm run typecheck` | Run TypeScript checking for the main project with `tsconfig.json`. |
|
|
135
|
+
| `npm run build` | Run `clean`, `typecheck`, and bundle CLI/hooks via `scripts/build-dist.ts`. |
|
|
136
|
+
| `npm test` | Build, then run the curated `node:test` suite with `tsx`. |
|
|
137
|
+
| `npm run build:openclaw` | Build the main project, then bundle OpenClaw runtime output. |
|
|
138
|
+
| `npm run audit:skills` | Build, then report skill instruction size and description overlap signals. |
|
|
139
|
+
| `npm run typecheck:openclaw` | Run TypeScript checking for OpenClaw with `tsconfig.openclaw.json`. |
|
|
140
|
+
| `npm run check:openclaw-dist` | Verify the generated OpenClaw dist output. |
|
|
141
|
+
| `npm run pack:openclaw` | Build, verify, and package the OpenClaw plugin. |
|
|
142
|
+
| `npm run pack:skills` | Build standalone packages under `skill-packages/`. |
|
|
143
|
+
| `npm run check:skills-publish` | Build, then verify standalone skill package metadata and copied files. |
|
|
144
|
+
| `npm run pack:all` | Run tests, package OpenClaw, package skills, and verify skill publishing output. |
|
|
145
|
+
| `npm run sync:version` | Sync package version metadata across release manifests. |
|
|
146
|
+
| `npm run version` | Run `sync:version`, then stage versioned manifests for npm version workflows. |
|
|
147
|
+
| `npm run prepack` | Build before `npm pack`. |
|
|
148
|
+
| `npm run prepublishOnly` | Sync versions and run tests before npm publish. |
|
|
149
|
+
|
|
150
|
+
For common change types:
|
|
151
|
+
|
|
152
|
+
- Skill changes: run `npm test`, `npm run audit:skills`, `npm run pack:skills`, and `npm run check:skills-publish`.
|
|
153
|
+
- OpenClaw changes: run `npm run typecheck:openclaw` and `npm run pack:openclaw`.
|
|
154
|
+
- Release packaging: run `npm run pack:all`; `prepublishOnly` also runs version sync and tests before publish.
|
|
155
|
+
|
|
156
|
+
## Source Maintenance Files
|
|
157
|
+
|
|
158
|
+
Maintenance scripts live under `scripts/` and run from source with `tsx`; they are not published as `dist/scripts`.
|
|
159
|
+
|
|
160
|
+
| File | Purpose |
|
|
161
|
+
| ------------------------------------------ | ------------------------------------ |
|
|
162
|
+
| `scripts/audit-skills.ts` | Skill size and trigger-overlap audit |
|
|
163
|
+
| `scripts/build-dist.ts` | CLI and runtime hook bundler |
|
|
164
|
+
| `scripts/sync-codex-agents-toml.ts` | Sync Codex agents configuration |
|
|
165
|
+
| `scripts/sync-version.ts` | Sync release version metadata |
|
|
166
|
+
| `scripts/pack-skills.ts` | Standalone skill package builder |
|
|
167
|
+
| `scripts/check-skills-publish.ts` | Standalone skill package verifier |
|
|
168
|
+
| `scripts/skill-packaging.ts` | Shared skill packaging helpers |
|
|
169
|
+
| `scripts/openclaw/build.ts` | OpenClaw esbuild bundler |
|
|
170
|
+
| `scripts/openclaw/pack-openclaw.ts` | OpenClaw packaging |
|
|
171
|
+
| `scripts/openclaw/verify-openclaw-dist.ts` | Verify OpenClaw dist completeness |
|
|
172
|
+
|
|
173
|
+
## Runtime Hook Scripts
|
|
174
|
+
|
|
175
|
+
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`.
|
|
176
|
+
|
|
177
|
+
| Source file | Bundled output | Purpose |
|
|
178
|
+
| ---------------------------------- | ----------------------------------- | ---------------------- |
|
|
179
|
+
| `src/hooks/run-tests.ts` | `dist/hooks/run-tests.js` | Test runner helper |
|
|
180
|
+
| `src/hooks/format-changed-file.ts` | `dist/hooks/format-changed-file.js` | Format changed files |
|
|
181
|
+
| `src/hooks/security-check.ts` | `dist/hooks/security-check.js` | Security scanning |
|
|
182
|
+
| `src/hooks/notify.ts` | `dist/hooks/notify.js` | Notification script |
|
|
183
|
+
| `src/hooks/session-start.ts` | `dist/hooks/session-start.js` | Session initialization |
|
|
184
|
+
|
|
185
|
+
## Architecture Overview
|
|
186
|
+
|
|
187
|
+
The universal installer follows this architecture:
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
bin/frontend-craft.ts
|
|
191
|
+
└─ src/install/cli.ts # CLI entry (parse commands: install/list/version/uninstall)
|
|
192
|
+
├─ src/install/registry.ts # Runtime registry (names + installer map)
|
|
193
|
+
├─ src/install/converters/ # Per-runtime adapters (claude, codex, cursor, copilot, etc.)
|
|
194
|
+
├─ src/install/interactive.ts # Interactive wizard (runtime/location prompts)
|
|
195
|
+
├─ src/install/runtime-homes.ts # Global/local directory conventions
|
|
196
|
+
└─ src/install/types.ts # Shared TypeScript types
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
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.
|
|
200
|
+
|
|
201
|
+
## Branch Strategy
|
|
202
|
+
|
|
203
|
+
- `main` - stable release branch.
|
|
204
|
+
- `develop` - development branch, if used.
|
|
205
|
+
- `feature/<name>` - new features.
|
|
206
|
+
- `fix/<name>` - bug fixes.
|
|
207
|
+
- `docs/<name>` - documentation updates.
|
|
208
|
+
|
|
209
|
+
## Commit Convention
|
|
210
|
+
|
|
211
|
+
Use [Conventional Commits](https://www.conventionalcommits.org/):
|
|
212
|
+
|
|
213
|
+
```text
|
|
214
|
+
<type>(<scope>): <description>
|
|
215
|
+
|
|
216
|
+
[optional body]
|
|
217
|
+
[optional footer]
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Common types:
|
|
221
|
+
|
|
222
|
+
| Type | Meaning |
|
|
223
|
+
| ---------- | ------------------------------ |
|
|
224
|
+
| `feat` | New feature |
|
|
225
|
+
| `fix` | Bug fix |
|
|
226
|
+
| `docs` | Documentation |
|
|
227
|
+
| `refactor` | Refactoring |
|
|
228
|
+
| `test` | Tests |
|
|
229
|
+
| `chore` | Build, tooling, or maintenance |
|
|
230
|
+
|
|
231
|
+
Examples:
|
|
232
|
+
|
|
233
|
+
```text
|
|
234
|
+
feat(skills): add e2e testing skill
|
|
235
|
+
fix(hooks): resolve Windows path handling
|
|
236
|
+
docs(readme): update installation steps
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Language and Documentation Policy
|
|
240
|
+
|
|
241
|
+
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.
|
|
242
|
+
|
|
243
|
+
When a pull request changes public behavior, installation steps, runtimes, agents, skills, commands, or hooks:
|
|
244
|
+
|
|
245
|
+
- 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).
|
|
246
|
+
- 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.
|
|
247
|
+
- 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).
|
|
248
|
+
- If translations cannot be completed in the same pull request, open or link a follow-up issue and mention it in the PR description.
|
|
249
|
+
- Keep code examples, runtime names, command names, file paths, and package names consistent across languages.
|
|
250
|
+
|
|
251
|
+
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.
|
|
252
|
+
|
|
253
|
+
## Adding a Skill
|
|
254
|
+
|
|
255
|
+
1. Create a directory under `skills/`, for example `skills/fec-my-skill/`.
|
|
256
|
+
2. Add `SKILL.md` with YAML frontmatter and concise instructions:
|
|
257
|
+
|
|
258
|
+
```markdown
|
|
259
|
+
---
|
|
260
|
+
name: fec-my-skill
|
|
261
|
+
description: Use when the user needs ...
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
# Skill Title
|
|
265
|
+
|
|
266
|
+
## When to Use
|
|
267
|
+
|
|
268
|
+
- ...
|
|
269
|
+
|
|
270
|
+
## Core Rules
|
|
271
|
+
|
|
272
|
+
- ...
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
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`.
|
|
276
|
+
4. Add positive and negative trigger examples to `skills/eval_queries.json`.
|
|
277
|
+
5. Add the skill to the Skills table in `README.md`.
|
|
278
|
+
6. Update the repository tree in `README.md` and localized README files if the visible structure changes.
|
|
279
|
+
7. Run `npm test`, `npm run pack:skills`, and `npm run check:skills-publish`.
|
|
280
|
+
|
|
281
|
+
## Adding an Agent
|
|
282
|
+
|
|
283
|
+
1. Create `agents/my-agent.md`.
|
|
284
|
+
2. Define the YAML frontmatter:
|
|
285
|
+
|
|
286
|
+
```markdown
|
|
287
|
+
---
|
|
288
|
+
name: my-agent
|
|
289
|
+
description: Use this agent when ...
|
|
290
|
+
tools: Read, Edit, Write, Glob, Grep, Bash
|
|
291
|
+
model: sonnet
|
|
292
|
+
skills:
|
|
293
|
+
- relevant-skill
|
|
294
|
+
---
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
1. Update the Agents table in `README.md`.
|
|
298
|
+
2. Sync `README.zh-CN.md`, `docs/*/README.md`, and `.claude-plugin/marketplace.json` when counts or user-facing descriptions change.
|
|
299
|
+
|
|
300
|
+
## Adding a Command
|
|
301
|
+
|
|
302
|
+
1. Create `commands/my-command.md`.
|
|
303
|
+
2. Use YAML frontmatter and Markdown steps.
|
|
304
|
+
3. Update the Commands table in `README.md` and localized user-facing summaries as needed.
|
|
305
|
+
|
|
306
|
+
## Adding a Rule Template
|
|
307
|
+
|
|
308
|
+
1. Create `templates/shared/rules/my-rule.md`.
|
|
309
|
+
2. Add it to the copy list in `commands/fec-init.md`.
|
|
310
|
+
3. Update `templates/claude/CLAUDE.md` rule import examples when applicable.
|
|
311
|
+
|
|
312
|
+
## Universal Installer
|
|
313
|
+
|
|
314
|
+
- Entry point: `bin/frontend-craft.ts` (compiled to `dist/bin/frontend-craft.js`).
|
|
315
|
+
- Implementation: `src/install/` (converters, registry, path helpers).
|
|
316
|
+
- Interactive prompts and input parsing: `src/install/interactive.ts` (tests may set `FRONTEND_CRAFT_FORCE_INTERACTIVE=1` to exercise stdin-fed prompts).
|
|
317
|
+
- Register a new runtime in `src/install/registry.ts`.
|
|
318
|
+
- Add the runtime installer under `src/install/converters/`.
|
|
319
|
+
- Follow global directory conventions from `src/install/runtime-homes.ts`.
|
|
320
|
+
- Add or update tests under `tests/install/`.
|
|
321
|
+
|
|
322
|
+
## Adding a Hook
|
|
323
|
+
|
|
324
|
+
1. Update `hooks/hooks.json`.
|
|
325
|
+
2. Put runtime hook scripts under `src/hooks/` and prefer cross-platform Node.js.
|
|
326
|
+
3. Add each new hook entrypoint to `scripts/build-dist.ts` so `npm run build` bundles it into `dist/hooks/`.
|
|
327
|
+
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/`.
|
|
328
|
+
5. Keep repository maintenance scripts under `scripts/`; do not reference them directly from runtime hook configuration.
|
|
329
|
+
6. Update the Hooks table in `README.md`.
|
|
330
|
+
|
|
331
|
+
## Pull Request Checklist
|
|
332
|
+
|
|
333
|
+
Before opening a pull request:
|
|
334
|
+
|
|
335
|
+
- [ ] The change is scoped and described clearly.
|
|
336
|
+
- [ ] `npm test` passes.
|
|
337
|
+
- [ ] Skill changes pass `npm run audit:skills`, `npm run pack:skills`, and `npm run check:skills-publish`.
|
|
338
|
+
- [ ] `npm run typecheck:openclaw` and `npm run pack:openclaw` pass when OpenClaw code or templates are affected.
|
|
339
|
+
- [ ] `README.md` and `CHANGELOG.md` are updated when user-facing behavior changes (and `CHANGELOG.zh-CN.md` when you ship Chinese-facing release notes).
|
|
340
|
+
- [ ] Localized README files are synced, or a follow-up translation issue is linked.
|
|
341
|
+
- [ ] New runtime, agent, skill, command, hook, or template changes include relevant tests or dry-run coverage.
|
|
342
|
+
- [ ] Release packaging changes pass `npm run pack:all` or are covered by the `prepublishOnly` publish gate.
|
|
343
|
+
- [ ] Security-sensitive changes have been reviewed against `SECURITY.md`.
|
|
344
|
+
|
|
345
|
+
## Code Style
|
|
346
|
+
|
|
347
|
+
- Prefer clear Markdown with stable headings and tables.
|
|
348
|
+
- Keep skill and agent descriptions concise because model routing depends on them.
|
|
349
|
+
- Use cross-platform Node.js scripts for automation.
|
|
350
|
+
- Avoid shell-specific assumptions unless a runtime explicitly requires them.
|
|
351
|
+
|
|
352
|
+
## Reporting Issues
|
|
353
|
+
|
|
354
|
+
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.
|
|
355
|
+
|
|
356
|
+
Do not file security-sensitive vulnerabilities as public issues. Follow [SECURITY.md](SECURITY.md) instead.
|