@seiyasolo/fe-harness
v0.2.2
Published
陈超团队的前端 Claude Code harness — 装/升/体检 CLI(ccfh)+ 4+1 件套源
Maintainers
Readme
@seiyasolo/fe-harness
repo:
miaoa-fe-harness· npm:@seiyasolo/fe-harness· bin:ccfh
陈超团队的前端 Claude Code harness。用 .claude/ 配置 + hooks + taste lint 约束 CC 产出符合团队品味的代码。
栈硬绑、CLI 公开。公司前端组用同栈即可 pnpm add -D @seiyasolo/fe-harness 接入,pnpm exec ccfh init 一键装齐。
技术栈(硬绑定)
| 维度 | 选型 |
|---|---|
| 框架 | React 19 + TanStack 全家桶(Router / Query / Table / Form / Store / Hotkeys / Virtual) |
| 构建 / Lint / Format / TC | Vite+ (vp) 一站式 |
| 样式 | Tailwind v4+ |
| UI | shadcn/ui(copy 进 repo) |
| 包管理 | pnpm |
当前形态:4+1 件套
| 件 | 物理形式 | 作用 |
|---|---|---|
| Stack 脚手架 | package.json deps 锁 + vite.config.ts + pnpm workspace | 物理决定项目用什么栈 |
| Hooks | .claude/hooks/ pre/post/stop bash 脚本 | 物理拦 LLM 写错代码 |
| Taste | .ai/taste/rules.ts + oxlint-plugin/ | 团队特有 lint 规则 |
| Rules(文本) | CLAUDE.md + AGENTS.md | 注入 CC 的硬约束 |
| Slash commands(在建) | .claude/commands/*.md | 研发显式入口 |
详见 docs/harness.md。
安装(给外部组)
# 1. 起空仓
vp create vite -- --template react-ts my-app
cd my-app
# 2. 装 harness
pnpm add -D @seiyasolo/fe-harness
# 如果刚发的新版,pnpm 11 minimumReleaseAge 会拒装(装到上一版)
# → 显式指版本 pnpm add -D @seiyasolo/fe-harness@<version> 强装
pnpm exec ccfh init
# 3. 体检
pnpm exec ccfh doctorccfh init 11 步内置修 K1-K12 + N2/N5 装机痛点。详见 docs/cli.md。
关系:pilot 项目
本 repo 是 harness 源。Pilot(miaoa-refactor / miaoa-combine-app)从这里 cp 配置。将来 ccfh CLI 自动化这条 cp 路径,详见 docs/cli.md。
常用命令
pnpm typecheck # tsc --noEmit
pnpm exec vp check # Oxlint(含自写 plugin) + Oxfmt
pnpm run structure-lint # 目录/文件名/后缀
pnpm run harness-health # trace 聚合报告Hook 执行模型
Write/Edit 触发
↓
PreToolUse(硬阻断,30s timeout)
├─ structure-lint --file <path> 路径级(kebab / 后缀 / index 禁令)
├─ edit-preview + vp check 内容级(tempfile 模拟 Edit 后 lint)
└─ decision:
allow → 写入文件 + heartbeat jsonl
deny → 拒绝 + reason 回灌 CC
↓(allow 才到)
PostToolUse(leak 兜底)
└─ vp check 实际文件
fail → post-tool-use-leak 事件 + decision:block(Pre 漏洞信号)
↓(session 末)
Stop
├─ typecheck(硬阻断,跨文件类型兜底)
└─ structure-lint + harness-health(软警告)哲学(简版)
- Vertical harness > 大而全平台
- Harness engineering > Context engineering — 用代码约束,不靠 prompt 祈祷
- Harness 不控制流程,只设约束 + 物理拦截
- Vite+ 已经做 70% 的 QA — 别重造
- 先跑 n=1 再抽象
- Skill 是参考库不是必经流程
- Slash command 是研发显式入口
完整哲学 + 禁止清单见 CLAUDE.md。
远期规划
见 docs/harness.md §远期。CLI 设计见 docs/cli.md。
