@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
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="assets/brand/frontend-craft.png" alt="frontend-craft logo" width="200" />
|
|
4
|
+
|
|
5
|
+
# frontend-craft
|
|
6
|
+
|
|
7
|
+
### 一套工具,适配所有 AI 编程助手,落地生产级前端规范。
|
|
8
|
+
|
|
9
|
+
[](https://github.com/bovinphang/frontend-craft/stargazers)
|
|
10
|
+
[](https://github.com/bovinphang/frontend-craft/actions/workflows/ci.yml)
|
|
11
|
+
[](https://www.npmjs.com/package/frontend-craft)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
16
|
+

|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
**🌐 Language / 语言 / 語言 / 言語 / 언어**
|
|
20
|
+
|
|
21
|
+
[English](README.md) · [**简体中文**](README.zh-CN.md) · [繁體中文](docs/zh-TW/README.md) · [日本語](docs/ja-JP/README.md) · [한국어](docs/ko-KR/README.md)
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
`frontend-craft` 是一个**通用前端插件**,为以下 **15 款 AI 编程助手**注入统一的前端工程规范:
|
|
28
|
+
|
|
29
|
+
`claude` `codex` `cursor` `windsurf` `opencode`
|
|
30
|
+
`kilo` `gemini` `copilot` `antigravity` `augment`
|
|
31
|
+
`trae` `codebuddy` `cline` `openclaw` `qoder`
|
|
32
|
+
|
|
33
|
+
各运行时的路径与注意事项详见 [`docs/runtimes/`](docs/runtimes/)。
|
|
34
|
+
|
|
35
|
+
它将 **13 个专业 agent**、**40 个自动激活 skill**、**8 个斜杠命令**、**5 个事件驱动 hook**、面向 6 个设计工具端点的 **MCP 集成**以及一整套**规则库**打包为一个可安装单元。运行一条命令,团队里的每一次 AI 会话都将以相同的方式编写 React、Vue、Next.js 或 Nuxt——类型安全、可访问、安全、一致。
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 为什么选择 frontend-craft?
|
|
40
|
+
|
|
41
|
+
| 痛点 | frontend-craft 的解法 |
|
|
42
|
+
| --------------------------------------------- | --------------------------------------------------------------------- |
|
|
43
|
+
| AI 助手写出的前端代码风格不一、缺类型、不安全 | **40 个 skill** 将团队规范编码为可自动激活的工作流 |
|
|
44
|
+
| 每款 AI 工具都有自己的插件格式 | **一条 CLI 命令** 把相同的规则、agent 和 hook 安装到 15 个运行时 |
|
|
45
|
+
| 设计稿到代码的交接总有信息损失 | **MCP 集成** 从 Figma、Figma Desktop、Sketch、MasterGo、Pixso、墨刀引入更完整设计上下文 |
|
|
46
|
+
| 代码评审随意、浅层 | **13 个 agent** 输出分级报告:代码、安全、无障碍、性能、TS、UI 还原度 |
|
|
47
|
+
| 没人记得跑 lint 和测试 | **事件驱动 hook** 在保存和会话结束时自动校验 |
|
|
48
|
+
| 新项目每次都从零开始 | **`/fec-init`** 几秒内脚手架化 CLAUDE.md、规则和 settings |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 安装
|
|
53
|
+
|
|
54
|
+
需要 **Node.js 22+**。完整支持 **Windows、macOS 和 Linux**(所有钩子和脚本均使用 Node.js 实现)。
|
|
55
|
+
|
|
56
|
+
### 方式一:全局 CLI 初始化项目(推荐)
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install -g frontend-craft@latest
|
|
60
|
+
cd your-project
|
|
61
|
+
fec init
|
|
62
|
+
fec init codex # 初始化指定运行时
|
|
63
|
+
fec init claude # 初始化 Claude Code
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`fec init` 是终端里的 CLI 初始化命令,用来初始化当前项目。在交互式终端中,不传 runtime 时会弹出选择提示;在非交互环境中,不传 runtime 时 CLI 默认使用 `claude`。`init` 默认安装到当前项目,除非显式传入 `--global`,例如 `fec init codex --global`。AI 助手内的 `/fec-init` 斜杠命令是另一个入口,需要先把 frontend-craft 安装到对应运行时后再使用。
|
|
67
|
+
|
|
68
|
+
### 方式二:免全局安装的交互向导
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npx frontend-craft@latest
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
不想全局安装 `fec` 命令时使用这种方式。向导会走完整安装流程:先选择一个或多个运行时,再决定安装到全局还是当前项目。
|
|
75
|
+
|
|
76
|
+
### 方式三:脚本化安装
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# 安装到当前项目
|
|
80
|
+
npx frontend-craft@latest install --local claude
|
|
81
|
+
|
|
82
|
+
# 全局安装到某个运行时
|
|
83
|
+
npx frontend-craft@latest install --global codex
|
|
84
|
+
|
|
85
|
+
# 预览所有运行时的安装内容(不实际写入)
|
|
86
|
+
npx frontend-craft@latest install --all --dry-run --global
|
|
87
|
+
|
|
88
|
+
# 列出支持的运行时
|
|
89
|
+
npx frontend-craft@latest list
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
> **CI / 脚本场景:** 始终带上 `--global` / `-g` 或 `--local` / `-l`。非 TTY 且未指定时,CLI 默认安装到 `claude --global`。
|
|
93
|
+
|
|
94
|
+
### 方式四:Claude Code Marketplace
|
|
95
|
+
|
|
96
|
+
对 Claude Code 用户,**Claude Code Marketplace** 是推荐的单一来源安装方式。只有在需要跨运行时安装、脚本化/离线复制文件,或非 Marketplace 环境时,才建议对 Claude 使用 CLI。
|
|
97
|
+
|
|
98
|
+
如果已经通过 Marketplace 安装,CLI 不会再安装或更新第二份 Claude 副本,即使传入 `--force` 也不会覆盖;请通过 Claude Code Marketplace 更新。如果已存在另一个作用域的 CLI 管理安装,交互式终端会询问是保持已安装来源并更新,还是卸载后切换到当前来源;非交互终端会停止并打印明确的 `update`、`uninstall`、`install` 命令。
|
|
99
|
+
|
|
100
|
+
完整步骤见 [docs/runtimes/claude.zh-CN.md](docs/runtimes/claude.zh-CN.md) · [English](docs/runtimes/claude.md)。
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 快速开始
|
|
105
|
+
|
|
106
|
+
安装完成后,你在每一次 AI 会话中都拥有一套完整的前端工程工具箱:
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
你:"Review my recent changes"
|
|
110
|
+
→ fec-code-reviewer agent 被调度,输出 reports/code-review-*.md
|
|
111
|
+
|
|
112
|
+
你:"/fec-review"
|
|
113
|
+
→ 按架构、类型、渲染、样式、可访问性等维度执行结构化评审
|
|
114
|
+
|
|
115
|
+
你:"根据这个 Figma 链接实现结算页"
|
|
116
|
+
→ fec-figma-implementer agent 通过 MCP 读取设计稿,输出组件和报告
|
|
117
|
+
|
|
118
|
+
你:"/fec-scaffold dashboard feature"
|
|
119
|
+
→ 按项目约定创建 page / feature / component 标准目录结构
|
|
120
|
+
|
|
121
|
+
你:"/fec-refactor-clean"
|
|
122
|
+
→ 分类并安全清理死代码、未使用导出、样式和依赖
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
下文斜杠命令以 **Claude Code** 为例;其他运行时通过各自的命令系统提供同等能力(详见 [`docs/runtimes/`](docs/runtimes/))。
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## 示例提示词
|
|
130
|
+
|
|
131
|
+
完整的按场景组织的提示词库见 [docs/zh-CN/example-prompts.md](docs/zh-CN/example-prompts.md)。
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
你:「合并前请评审我最近的改动。重点看架构、类型安全、渲染行为、样式、无障碍和缺失测试。」
|
|
135
|
+
你:「先不要写代码,请规划账号账单功能:路由结构、组件边界、数据流、状态归属、校验流程和上线风险。」
|
|
136
|
+
你:「请用 React Hook Form + Zod 构建多步注册表单,包含文件上传、条件字段、异步校验和可访问错误提示。」
|
|
137
|
+
你:「请按 Figma 节点 123:456 实现 UI。复用现有 design token 和组件,匹配间距与响应式状态,并说明假设。」
|
|
138
|
+
你:「`/fec-refactor-clean` 请清理这个模块里的死代码。」
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 里面有什么
|
|
144
|
+
|
|
145
|
+
### 命令(Commands)
|
|
146
|
+
|
|
147
|
+
斜杠命令是结构化工作流的主入口,多数会输出带时间戳的 Markdown 报告到 `reports/`。
|
|
148
|
+
|
|
149
|
+
| 命令 | 用途 | 报告 |
|
|
150
|
+
| --------------------- | ----------------------------------------------------------- | ------------------------------------------------ |
|
|
151
|
+
| `/fec-init` | 初始化项目模板(CLAUDE.md、规则、settings) | — |
|
|
152
|
+
| `/fec-review` | 对指定文件或最近变更的代码执行结构化评审 | `code-review-*.md` |
|
|
153
|
+
| `/fec-scaffold` | 按规范创建 page / feature / component 样板 | — |
|
|
154
|
+
| `/fec-plan` | 统一规划入口:实现架构或测试策略 | `architecture-proposal-*.md` 或 `test-plan-*.md` |
|
|
155
|
+
| `/fec-tdd` | 红 → 绿 → 重构的前端 TDD 循环 | — |
|
|
156
|
+
| `/fec-debug` | 前端问题诊断与修复:构建失败、运行时错误、UI 异常、接口问题 | `debug-*.md` |
|
|
157
|
+
| `/fec-refactor-clean` | 分类并安全清理死代码、未使用导出、样式和依赖 | `refactor-clean-*.md` |
|
|
158
|
+
| `/fec-doc-sync` | 同步 README、runtime 文档、能力表和公开 metadata | — |
|
|
159
|
+
|
|
160
|
+
### 技能(Skills,自动激活)
|
|
161
|
+
|
|
162
|
+
技能是根据文件模式、框架或任务上下文**自动激活**的工作流定义,编码了评审维度、输出约定和报告格式。
|
|
163
|
+
|
|
164
|
+
下方按使用场景分组列出全部自动激活的技能,便于快速找到项目规范、实现、测试、评审、设计、迁移和文档维护能力。
|
|
165
|
+
|
|
166
|
+
**项目规范** — 检测到对应框架时自动生效:
|
|
167
|
+
|
|
168
|
+
| 技能 | 范围 |
|
|
169
|
+
| ------------------------------- | ----------------------------------------------------- |
|
|
170
|
+
| `fec-react-project-standard` | React + TypeScript(结构、组件、路由、状态、API 层) |
|
|
171
|
+
| `fec-vue3-project-standard` | Vue 3 + TypeScript(结构、组件、路由、Pinia、API 层) |
|
|
172
|
+
| `fec-nextjs-project-standard` | Next.js 14+ App Router、SSR/SSG、流式渲染、元数据 |
|
|
173
|
+
| `fec-nuxt-project-standard` | Nuxt 3 SSR/SSG、组合式 API、数据获取、中间件 |
|
|
174
|
+
| `fec-vite-project-standard` | Vite 配置、环境变量安全、HMR、开发代理、构建优化 |
|
|
175
|
+
| `fec-monorepo-project-standard` | pnpm workspace、Turborepo、Nx 结构与任务编排 |
|
|
176
|
+
|
|
177
|
+
**实现能力** — 构建特定前端能力时激活:
|
|
178
|
+
|
|
179
|
+
| 技能 | 范围 |
|
|
180
|
+
| ------------------------- | ---------------------------------------------------------- |
|
|
181
|
+
| `fec-data-fetching` | TanStack Query / 服务端状态获取、缓存、乐观更新 |
|
|
182
|
+
| `fec-api-integration` | 类型化 API client、鉴权刷新、上传、实时集成 |
|
|
183
|
+
| `fec-state-management` | 状态归属、store 选型、URL 状态、服务端/表单/本地状态边界 |
|
|
184
|
+
| `fec-form-handling` | React Hook Form + Zod、动态字段、上传、多步流程 |
|
|
185
|
+
| `fec-browser-storage` | localStorage / sessionStorage / IndexedDB / Cookies 选型 |
|
|
186
|
+
| `fec-route-protection` | React Router、Next.js、Vue Router、Nuxt 的登录态与权限路由 |
|
|
187
|
+
| `fec-pwa-implementation` | manifest、Service Worker、离线缓存、安装提示 |
|
|
188
|
+
| `fec-web-workers` | Web Worker、Transferable、Comlink、Worker 池 |
|
|
189
|
+
| `fec-canvas-threejs` | Canvas 2D、Three.js、React Three Fiber、WebGL |
|
|
190
|
+
| `fec-svg-animation` | CSS / Framer Motion / GSAP SVG 动画与 reduced-motion |
|
|
191
|
+
| `fec-list-virtualization` | react-window / TanStack Virtual 大列表虚拟滚动 |
|
|
192
|
+
|
|
193
|
+
**测试** — 规划或编写前端测试覆盖时激活:
|
|
194
|
+
|
|
195
|
+
| 技能 | 范围 |
|
|
196
|
+
| ----------------------- | --------------------------------------------------------- |
|
|
197
|
+
| `fec-testing-strategy` | 静态检查、单元、组件、集成、E2E、视觉测试分层 |
|
|
198
|
+
| `fec-component-testing` | React Testing Library / Vue Test Utils 组件测试与回归用例 |
|
|
199
|
+
| `fec-e2e-testing` | Playwright / Cypress E2E 与 Page Object 和 CI 集成 |
|
|
200
|
+
| `fec-tdd-workflow` | 测试先行的前端实现,红绿重构循环 |
|
|
201
|
+
|
|
202
|
+
**评审与质量** — 代码评审、验证或清理时激活:
|
|
203
|
+
|
|
204
|
+
| 技能 | 范围 |
|
|
205
|
+
| ------------------------------ | ----------------------------------------------------- |
|
|
206
|
+
| `fec-code-review` | 架构、类型、渲染、样式、可访问性评审 |
|
|
207
|
+
| `fec-typescript-type-safety` | 类型契约、DTO 映射、类型守卫、泛型和类型级检查 |
|
|
208
|
+
| `fec-security-review` | XSS、CSRF、敏感数据泄露、输入校验 |
|
|
209
|
+
| `fec-accessibility-check` | WCAG 2.2、键盘、焦点、触控和屏幕阅读器行为 |
|
|
210
|
+
| `fec-dependency-upgrade` | 依赖升级、lockfile 评审、CVE 修复和迁移验证 |
|
|
211
|
+
| `fec-validation-fix` | 一次性运行并修复 lint、type-check、test、build |
|
|
212
|
+
| `fec-performance-optimization` | Core Web Vitals、包体、渲染、内存、网络与性能预算审查 |
|
|
213
|
+
| `fec-refactor-clean` | 安全清理死代码、未使用导出、样式、路由和依赖 |
|
|
214
|
+
|
|
215
|
+
**设计 UI** — 设计实现、设计系统或视觉打磨时激活:
|
|
216
|
+
|
|
217
|
+
| 技能 | 范围 |
|
|
218
|
+
| ----------------------------- | -------------------------------------------------------- |
|
|
219
|
+
| `fec-ui-design` | UI 方向、视觉识别、界面打磨、状态、视觉 QA |
|
|
220
|
+
| `fec-tailwind-design-system` | Tailwind token、主题扩展、组件变体、class 治理和暗色模式 |
|
|
221
|
+
| `fec-responsive-layout` | 移动优先布局、容器查询、数据密集型响应式界面 |
|
|
222
|
+
| `fec-motion-interaction` | 交互动效、页面转场、滚动动画、reduced-motion |
|
|
223
|
+
| `fec-implement-from-design` | 基于 Figma/Sketch/MasterGo/Pixso/墨刀设计稿或摹客素材实现 UI |
|
|
224
|
+
| `fec-storybook-component-doc` | Storybook 组件文档、设计系统呈现、隔离状态预览 |
|
|
225
|
+
|
|
226
|
+
**遗留迁移** — 现代化迁移时激活:
|
|
227
|
+
|
|
228
|
+
| 技能 | 范围 |
|
|
229
|
+
| -------------------------------- | ---------------------------------------------- |
|
|
230
|
+
| `fec-legacy-web-standard` | JS + jQuery + HTML 遗留项目的开发与维护规范 |
|
|
231
|
+
| `fec-legacy-to-modern-migration` | jQuery/MPA → React/Vue 3 + TS 策略与分阶段流程 |
|
|
232
|
+
|
|
233
|
+
**文档维护** — 文档维护时激活:
|
|
234
|
+
|
|
235
|
+
| 技能 | 范围 |
|
|
236
|
+
| ------------------------------- | ------------------------------------------ |
|
|
237
|
+
| `fec-doc-sync` | 让公开文档与脚本、技能、代理、命令保持同步 |
|
|
238
|
+
| `fec-source-driven-development` | 以项目事实和官方来源验证版本敏感的前端决策 |
|
|
239
|
+
|
|
240
|
+
### 代理(Agents)
|
|
241
|
+
|
|
242
|
+
代理是由主助手调度的专业子代理,专注处理单一任务并返回结构化报告。
|
|
243
|
+
|
|
244
|
+
| 代理 | 聚焦领域 | 报告 |
|
|
245
|
+
| --------------------------- | --------------------------------------------------------- | ---------------------------- |
|
|
246
|
+
| `fec-code-reviewer` | React/Vue/Next/Nuxt、TS、样式、客户端安全(按置信度降噪) | `code-review-*.md` |
|
|
247
|
+
| `fec-typescript-reviewer` | 类型安全、异步正确性、惯用模式(只报告不修改) | `typescript-review-*.md` |
|
|
248
|
+
| `fec-security-reviewer` | XSS、客户端密钥、危险 DOM/API、CSP、依赖审计 | `security-review-*.md` |
|
|
249
|
+
| `fec-performance-optimizer` | 打包体积、渲染性能、网络瓶颈 | `performance-review-*.md` |
|
|
250
|
+
| `fec-architect` | 页面拆分、组件架构、状态流、目录规划 | `architecture-proposal-*.md` |
|
|
251
|
+
| `fec-test-planner` | 风险-层级映射:静态、单元、组件、E2E、视觉、无障碍、安全 | `test-plan-*.md` |
|
|
252
|
+
| `fec-debugger` | 复杂前端诊断:构建、运行时、UI 和接口问题 | `debug-*.md` |
|
|
253
|
+
| `fec-refactor-cleaner` | 分类并安全清理未使用代码、导出、样式、路由和依赖 | `refactor-clean-*.md` |
|
|
254
|
+
| `fec-e2e-runner` | E2E 编写与运行(Playwright/Cypress)、flaky 隔离、Trace | `e2e-summary-*.md` |
|
|
255
|
+
| `fec-doc-updater` | 同步 README、runtime 文档、结构、能力表和 metadata | — |
|
|
256
|
+
| `fec-ui-checker` | 视觉问题排查与设计还原度评估 | `ui-fidelity-review-*.md` |
|
|
257
|
+
| `fec-figma-implementer` | 按 Figma/Sketch/MasterGo/Pixso/墨刀设计稿精确实现 UI | `design-implementation-*.md` |
|
|
258
|
+
| `fec-design-token-mapper` | 将设计变量映射到项目 Design Token | `token-mapping-*.md` |
|
|
259
|
+
|
|
260
|
+
### 钩子(Hooks,事件驱动)
|
|
261
|
+
|
|
262
|
+
钩子在 AI 助手事件触发时**自动执行**,无需手动调用。
|
|
263
|
+
|
|
264
|
+
| 事件 | 行为 |
|
|
265
|
+
| ------------------------- | -------------------------------------------- |
|
|
266
|
+
| `SessionStart` | 清理 Claude 缓存,然后自动检测项目框架和包管理器 |
|
|
267
|
+
| `PreToolUse(Bash)` | 拦截危险命令(`rm -rf`、force push 等) |
|
|
268
|
+
| `PostToolUse(Write/Edit)` | 对修改的文件自动执行 Prettier |
|
|
269
|
+
| `Stop` | 会话结束时执行 lint、type-check、test、build |
|
|
270
|
+
| `Notification` | 跨平台桌面通知(macOS / Linux / Windows) |
|
|
271
|
+
|
|
272
|
+
### MCP 集成
|
|
273
|
+
|
|
274
|
+
将 AI 助手接入设计工具,构建带有更完整设计上下文的设计转代码工作流。
|
|
275
|
+
|
|
276
|
+
| 服务 | 能力 |
|
|
277
|
+
| ----------------- | ------------------------------------ |
|
|
278
|
+
| **Figma** | 读取设计上下文与变量定义 |
|
|
279
|
+
| **Figma Desktop** | Figma 桌面端集成 |
|
|
280
|
+
| **Sketch** | 读取设计选区截图 |
|
|
281
|
+
| **MasterGo** | 读取 DSL 结构、组件层级和样式 |
|
|
282
|
+
| **Pixso** | 本地 MCP:帧数据、代码片段、图片资源 |
|
|
283
|
+
| **墨刀** | 原型数据、设计描述、HTML 导入 |
|
|
284
|
+
| **摹客** | 截图/标注/导出 CSS 工作流(无 MCP) |
|
|
285
|
+
|
|
286
|
+
### 项目模板(`/fec-init`)
|
|
287
|
+
|
|
288
|
+
运行 `/fec-init` 即可将一套开箱即用的规则库和项目配置脚手架化到 `.claude/`:
|
|
289
|
+
|
|
290
|
+
<details>
|
|
291
|
+
<summary>查看全部 20 个模板文件</summary>
|
|
292
|
+
|
|
293
|
+
| 文件 | 用途 |
|
|
294
|
+
| ---------------------------------------- | --------------------------------------------------------------------- |
|
|
295
|
+
| `CLAUDE.md` | 项目说明、常用命令、工作原则、安全要求 |
|
|
296
|
+
| `settings.json` | 权限白名单/黑名单、环境变量 |
|
|
297
|
+
| `rules/fec-vue.md` | Vue 3 组件规范与反模式 |
|
|
298
|
+
| `rules/fec-react.md` | React 组件规范与反模式 |
|
|
299
|
+
| `rules/fec-design-system.md` | 设计系统、Token、可访问性规则 |
|
|
300
|
+
| `rules/fec-testing.md` | 测试与校验规则 |
|
|
301
|
+
| `rules/fec-git-conventions.md` | Conventional Commits 提交规范 |
|
|
302
|
+
| `rules/fec-i18n.md` | 国际化文案规范 |
|
|
303
|
+
| `rules/fec-performance.md` | 前端性能优化规则 |
|
|
304
|
+
| `rules/fec-rendering-patterns.md` | 渲染生命周期、hydration、SSR/CSR 与更新模式 |
|
|
305
|
+
| `rules/fec-responsive-design.md` | 响应式布局、断点、触摸目标与视口行为 |
|
|
306
|
+
| `rules/fec-source-driven-development.md` | Source-driven decisions, official docs, version-sensitive assumptions |
|
|
307
|
+
| `rules/fec-api-layer.md` | API 层类型化与错误处理规范 |
|
|
308
|
+
| `rules/fec-state-management.md` | 状态分类、管理策略与反模式 |
|
|
309
|
+
| `rules/fec-error-handling.md` | 错误分层、Error Boundary、降级 UI、上报规范 |
|
|
310
|
+
| `rules/fec-naming-conventions.md` | 文件、组件、变量、路由、API、CSS 统一命名 |
|
|
311
|
+
| `rules/fec-code-comments.md` | 何时以及如何写前端注释 |
|
|
312
|
+
| `rules/fec-ci-cd.md` | CI/CD 流水线阶段、GitHub Actions / GitLab CI、密钥管理 |
|
|
313
|
+
| `rules/fec-refactoring.md` | 重构约束与功能等价要求 |
|
|
314
|
+
| `rules/fec-agent-workflow.md` | 子代理协作边界与委托规则 |
|
|
315
|
+
| `rules/fec-working-modes.md` | 调研、计划、开发、评审、收尾模式指导 |
|
|
316
|
+
|
|
317
|
+
</details>
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## 配置
|
|
322
|
+
|
|
323
|
+
### 前置条件
|
|
324
|
+
|
|
325
|
+
- **Node.js 22+**
|
|
326
|
+
- **npm、pnpm 或 yarn**
|
|
327
|
+
- **Git Bash 或兼容 shell**(仅 Windows,当 AI 运行时需要调用 shell 命令时)
|
|
328
|
+
|
|
329
|
+
### MCP 设计工具令牌
|
|
330
|
+
|
|
331
|
+
根据团队使用的设计工具设置对应环境变量:
|
|
332
|
+
|
|
333
|
+
| 环境变量 | 工具 | 获取方式 |
|
|
334
|
+
| ---------------- | --------------------- | ----------------------------------------- |
|
|
335
|
+
| `FIGMA_API_KEY` | Figma / Figma Desktop | Figma 账户设置 → Personal Access Tokens |
|
|
336
|
+
| `SKETCH_API_KEY` | Sketch | Sketch 开发者设置 |
|
|
337
|
+
| `MG_MCP_TOKEN` | MasterGo | MasterGo 账户设置 → 安全设置 → 生成 Token |
|
|
338
|
+
| `MODAO_TOKEN` | 墨刀 | 墨刀 AI 功能页面 → 访问令牌 |
|
|
339
|
+
|
|
340
|
+
> **Pixso** 使用本地 MCP 服务 — 在 Pixso 客户端启用即可,无需额外环境变量。
|
|
341
|
+
> **摹客** 暂无 MCP 集成 — 通过截图和导出 CSS 方式工作。
|
|
342
|
+
|
|
343
|
+
添加到 shell 配置文件以持久化:
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
# macOS / Linux — 追加到 ~/.bashrc 或 ~/.zshrc
|
|
347
|
+
export FIGMA_API_KEY="your-figma-api-key"
|
|
348
|
+
export SKETCH_API_KEY="your-sketch-api-key"
|
|
349
|
+
export MG_MCP_TOKEN="your-mastergo-token"
|
|
350
|
+
export MODAO_TOKEN="your-modao-token"
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
```powershell
|
|
354
|
+
# Windows — 设为系统环境变量,或在 PowerShell 中临时设置:
|
|
355
|
+
$env:FIGMA_API_KEY = "your-figma-api-key"
|
|
356
|
+
$env:SKETCH_API_KEY = "your-sketch-api-key"
|
|
357
|
+
$env:MG_MCP_TOKEN = "your-mastergo-token"
|
|
358
|
+
$env:MODAO_TOKEN = "your-modao-token"
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## 报告输出
|
|
364
|
+
|
|
365
|
+
每一次评审、分析和评估都会输出带时间戳的 Markdown 报告到 `reports/`,可作为审计记录和 PR 交付物。
|
|
366
|
+
|
|
367
|
+
<details>
|
|
368
|
+
<summary>查看全部 15 种报告类型</summary>
|
|
369
|
+
|
|
370
|
+
| 报告类型 | 文件名模式 | 来源 |
|
|
371
|
+
| -------------- | -------------------------------------------- | ------------------------------------------------------------------- |
|
|
372
|
+
| 代码审查 | `code-review-YYYY-MM-DD-HHmmss.md` | `/fec-review`、`fec-code-review`、`fec-code-reviewer` |
|
|
373
|
+
| TS/JS 专项评审 | `typescript-review-YYYY-MM-DD-HHmmss.md` | `fec-typescript-reviewer` |
|
|
374
|
+
| 安全审查 | `security-review-YYYY-MM-DD-HHmmss.md` | `fec-security-review`、`fec-security-reviewer` |
|
|
375
|
+
| 无障碍检查 | `accessibility-review-YYYY-MM-DD-HHmmss.md` | `fec-accessibility-check` |
|
|
376
|
+
| 性能分析 | `performance-review-YYYY-MM-DD-HHmmss.md` | `fec-performance-optimizer` |
|
|
377
|
+
| 架构方案 | `architecture-proposal-YYYY-MM-DD-HHmmss.md` | `fec-architect` |
|
|
378
|
+
| 设计还原度 | `ui-fidelity-review-YYYY-MM-DD-HHmmss.md` | `fec-ui-checker` |
|
|
379
|
+
| 设计实现 | `design-implementation-YYYY-MM-DD-HHmmss.md` | `fec-figma-implementer` |
|
|
380
|
+
| Token 映射 | `token-mapping-YYYY-MM-DD-HHmmss.md` | `fec-design-token-mapper` |
|
|
381
|
+
| 设计计划 | `design-plan-YYYY-MM-DD-HHmmss.md` | `fec-implement-from-design` |
|
|
382
|
+
| 测试计划 | `test-plan-YYYY-MM-DD-HHmmss.md` | `/fec-plan`、`fec-testing-strategy`、`fec-test-planner` |
|
|
383
|
+
| 验证修复 | `validation-fix-YYYY-MM-DD-HHmmss.md` | `fec-validation-fix` |
|
|
384
|
+
| 重构清理 | `refactor-clean-YYYY-MM-DD-HHmmss.md` | `/fec-refactor-clean`、`fec-refactor-clean`、`fec-refactor-cleaner` |
|
|
385
|
+
| E2E 运行摘要 | `e2e-summary-YYYY-MM-DD-HHmmss.md` | `fec-e2e-runner`(可选) |
|
|
386
|
+
| 迁移计划 | `migration-plan-YYYY-MM-DD-HHmmss.md` | `fec-legacy-to-modern-migration` |
|
|
387
|
+
|
|
388
|
+
</details>
|
|
389
|
+
|
|
390
|
+
> **建议:** 在 `.gitignore` 中添加 `reports/` 以避免将自动生成的报告提交到代码仓库,或保留提交以便团队查看历史审查记录。
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## 更新与移除
|
|
395
|
+
|
|
396
|
+
`fec` 是 `frontend-craft` 的短命令。如果没有全局安装 `fec`,可以把同样参数接在 `npx frontend-craft@latest` 后使用,例如 `npx frontend-craft@latest update`。
|
|
397
|
+
|
|
398
|
+
### 更新
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
fec update # 更新自动发现到的所有 CLI 管理安装
|
|
402
|
+
fec update <runtime> --local # 更新一个本地 CLI 管理安装
|
|
403
|
+
fec update <runtime> --global # 更新一个全局 CLI 管理安装
|
|
404
|
+
fec upgrade <runtime> --global # `upgrade` 是 `update` 的别名
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### 移除
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
fec uninstall # 移除自动发现到的所有 CLI 管理安装
|
|
411
|
+
fec remove # `remove` 是 `uninstall` 的别名
|
|
412
|
+
fec uninstall <runtime> # 移除指定 runtime 安装
|
|
413
|
+
fec remove <runtime> # 使用别名移除指定 runtime
|
|
414
|
+
fec uninstall --global # 只移除发现到的全局安装
|
|
415
|
+
fec remove --local # 只移除发现到的本地安装
|
|
416
|
+
fec uninstall <runtime> --dry-run # 预览将移除的文件
|
|
417
|
+
fec uninstall <runtime> --force # 连同已修改的托管文件一起移除
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
CLI 会在 runtime 目录写入 `frontend-craft.manifest.json`。不传 runtime 时,`update` 会自动发现这些 manifest,并**跳过你本地修改过的文件**——自定义内容在更新后依然保留。
|
|
421
|
+
|
|
422
|
+
`uninstall`/`remove` 只删除 manifest 记录的文件,默认跳过已修改文件;只有确认要移除修改过的托管文件时才加 `--force`。`--force` 不会覆盖 Claude Code Marketplace 安装。
|
|
423
|
+
|
|
424
|
+
**Claude Code Marketplace** 或 **submodule** 安装的更新方式见 [docs/runtimes/claude.zh-CN.md](docs/runtimes/claude.zh-CN.md) · [English](docs/runtimes/claude.md)。`/fec-init` 只初始化项目配置,不是第二次安装插件本体。
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
## 旧版 Skills CLI
|
|
429
|
+
|
|
430
|
+
如果团队已在使用独立的 [Skills CLI](https://skills.sh/docs/cli),它仍然可以只安装 [`skills/`](skills/) 下的工作流技能包:
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
npx skills add bovinphang/frontend-craft # 按提示操作,加 -g 可全局安装
|
|
434
|
+
npx skills update # 更新到最新版本
|
|
435
|
+
npx skills check # 预览可用更新
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
| CLI | 安装内容 |
|
|
439
|
+
| -------------------- | --------------------------------------------- |
|
|
440
|
+
| `npx frontend-craft` | 技能 + 运行时专属代理、命令、钩子、规则、模板 |
|
|
441
|
+
| `npx skills` | 仅技能(适用于已有 Skills CLI 工作流) |
|
|
442
|
+
|
|
443
|
+
关闭遥测:`DISABLE_TELEMETRY=1`。详见 [skills.sh CLI 文档](https://skills.sh/docs/cli)。
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
## 社区
|
|
448
|
+
|
|
449
|
+
- [贡献指南](CONTRIBUTING.zh-CN.md) — 开发环境、PR 自检清单与多语言同步规则([English](CONTRIBUTING.md))
|
|
450
|
+
- [安全策略](SECURITY.zh-CN.md) — 私密漏洞报告方式与支持范围([English](SECURITY.md))
|
|
451
|
+
- [行为准则](CODE_OF_CONDUCT.zh-CN.md) — 社区参与规范([English](CODE_OF_CONDUCT.md))
|
|
452
|
+
- [变更日志](CHANGELOG.zh-CN.md) — 版本说明([English](CHANGELOG.md))
|
|
453
|
+
- [项目结构](docs/zh-CN/project-structure.md) — 完整目录布局与文件职责([English](docs/project-structure.md))
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## 许可证
|
|
458
|
+
|
|
459
|
+
[MIT](LICENSE) — 自由使用,按需修改,如果可以请回馈社区。
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
<div align="center">
|
|
464
|
+
|
|
465
|
+
**如果 frontend-craft 帮助了你的团队,[请给它一个 Star](https://github.com/bovinphang/frontend-craft)。**
|
|
466
|
+
|
|
467
|
+
</div>
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
**简体中文:** [SECURITY.zh-CN.md](SECURITY.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
Thank you for helping keep `frontend-craft` and its users safe.
|
|
6
|
+
|
|
7
|
+
## Supported Versions
|
|
8
|
+
|
|
9
|
+
Security updates are provided for the latest published version on npm and the default branch of this repository.
|
|
10
|
+
|
|
11
|
+
## Reporting a Vulnerability
|
|
12
|
+
|
|
13
|
+
Please do not report security vulnerabilities through public GitHub issues.
|
|
14
|
+
|
|
15
|
+
Use GitHub Security Advisories when available:
|
|
16
|
+
|
|
17
|
+
[https://github.com/bovinphang/frontend-craft/security/advisories/new](https://github.com/bovinphang/frontend-craft/security/advisories/new)
|
|
18
|
+
|
|
19
|
+
If advisories are unavailable, email the maintainer listed in `package.json`.
|
|
20
|
+
|
|
21
|
+
Please include:
|
|
22
|
+
|
|
23
|
+
- Affected version or commit.
|
|
24
|
+
- Affected runtime, if relevant.
|
|
25
|
+
- Operating system and Node.js version.
|
|
26
|
+
- Reproduction steps or proof of concept.
|
|
27
|
+
- Potential impact.
|
|
28
|
+
- Any known workarounds.
|
|
29
|
+
|
|
30
|
+
## Scope
|
|
31
|
+
|
|
32
|
+
Security-sensitive areas include:
|
|
33
|
+
|
|
34
|
+
- CLI installation behavior and file writes.
|
|
35
|
+
- Hook scripts and command execution.
|
|
36
|
+
- Runtime template generation.
|
|
37
|
+
- MCP configuration templates.
|
|
38
|
+
- Any behavior that may expose secrets, credentials, paths, or private project content.
|
|
39
|
+
|
|
40
|
+
## Response Expectations
|
|
41
|
+
|
|
42
|
+
Maintainers will aim to acknowledge valid reports within 7 days. Fix timelines depend on severity and maintainer availability, but high-impact issues that affect installation safety, command execution, or secret exposure will be prioritized.
|
|
43
|
+
|
|
44
|
+
Once a fix is available, maintainers may publish a patch release and credit the reporter unless they request otherwise.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# 安全策略
|
|
2
|
+
|
|
3
|
+
> **English:** [SECURITY.md](SECURITY.md)
|
|
4
|
+
|
|
5
|
+
感谢你愿意帮助保障 `frontend-craft` 及其用户的安全。
|
|
6
|
+
|
|
7
|
+
## 支持的版本
|
|
8
|
+
|
|
9
|
+
安全更新适用于 npm 上最新发布的版本以及本仓库默认分支。
|
|
10
|
+
|
|
11
|
+
## 报告漏洞
|
|
12
|
+
|
|
13
|
+
请勿通过公开的 GitHub Issue 报告安全漏洞。
|
|
14
|
+
|
|
15
|
+
在可用时,请使用 GitHub Security Advisories:
|
|
16
|
+
|
|
17
|
+
[https://github.com/bovinphang/frontend-craft/security/advisories/new](https://github.com/bovinphang/frontend-craft/security/advisories/new)
|
|
18
|
+
|
|
19
|
+
若无法使用 Advisories,请发邮件至 `package.json` 中列出的维护者。
|
|
20
|
+
|
|
21
|
+
请尽量包含:
|
|
22
|
+
|
|
23
|
+
- 受影响的版本或提交。
|
|
24
|
+
- 相关 runtime(如有)。
|
|
25
|
+
- 操作系统与 Node.js 版本。
|
|
26
|
+
- 复现步骤或概念验证。
|
|
27
|
+
- 潜在影响。
|
|
28
|
+
- 已知变通办法(如有)。
|
|
29
|
+
|
|
30
|
+
## 范围
|
|
31
|
+
|
|
32
|
+
以下领域属于安全敏感范围:
|
|
33
|
+
|
|
34
|
+
- CLI 安装行为与文件写入。
|
|
35
|
+
- Hook 脚本与命令执行。
|
|
36
|
+
- Runtime 模板生成。
|
|
37
|
+
- MCP 配置模板。
|
|
38
|
+
- 可能泄露密钥、凭据、路径或私有项目内容的任何行为。
|
|
39
|
+
|
|
40
|
+
## 响应预期
|
|
41
|
+
|
|
42
|
+
维护者力争在 **7 天内** 确认有效报告。修复时间取决于严重程度与维护者可用性;涉及安装安全、命令执行或密钥泄露的高影响问题将优先处理。
|
|
43
|
+
|
|
44
|
+
修复可用后,维护者可能发布补丁版本;除非报告人另有要求,否则将在致谢中列出贡献者。
|