dev-manager-tauri/src-tauri/resources/onboarding/lefthook.yml.tmpl
lanrtop f04eb6e766 feat(onboarding): 接入包 v1.6.0——蓝图机器门控双层实现
A: feat: 提交须含 Feature-Confirmed: true trailer
  - lefthook.yml.tmpl commit-msg 新增 feature-confirmed 命令
  - AGENTS.md.tmpl 需求对齐协议补 trailer 说明

B: pre-commit 检查未关闭 🔵 任务卡(warn only)
  - 新增 .claude/hooks/blueprint-gate.cjs(CommonJS,兼容 ESM 项目)
  - lefthook.yml.tmpl pre-commit 新增 blueprint-gate 命令
  - onboarding.rs dispatch 新增 blueprint-gate.cjs

Feature-Confirmed: true
2026-07-15 13:38:32 +09:00

31 lines
1.5 KiB
Cheetah
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 接入包标准 lefthook 配置(炼境分发)
# 作用:强制 Conventional Commits + 提交前类型检查
# 安装pnpm add -D lefthook && pnpm exec lefthook install
pre-commit:
parallel: true
commands:
# TODO: 按项目调整 typecheck 命令与 globmonorepo 用 --filter <pkg> typecheck
typecheck:
glob: "*.{ts,tsx}"
run: pnpm typecheck
# 🚨 【必填项】项目有 API / 后端层时,必须取消注释并按实际路径配置——
# 否则后端类型错误不会被 pre-commit 拦截(前端 typecheck 只覆盖 src/ 层)。
# 按实际填写一行,其余示例行可删掉:
# api-typecheck:
# glob: "api/**/*.{ts,tsx}"
# run: pnpm --filter api typecheck # monorepo workspace
# # run: pnpm exec tsc -p api/tsconfig.json --noEmit # 独立 tsconfig
# # run: pnpm -r typecheck # 递归所有包
blueprint-gate:
run: node .claude/hooks/blueprint-gate.cjs || true
commit-msg:
commands:
conventional:
run: "head -1 .git/COMMIT_EDITMSG | grep -qE '^(feat|fix|docs|chore|refactor|ci|perf|style|test|build|revert)(\\(.+\\))?!?: .+' || exit 1"
feature-confirmed:
run: |
head -1 .git/COMMIT_EDITMSG | grep -qE '^feat' || exit 0
grep -q 'Feature-Confirmed: true' .git/COMMIT_EDITMSG || { printf '\n⚠ feat: 提交须含 Feature-Confirmed: true trailer\n 在 commit message 末尾加一行Feature-Confirmed: true\n (确认卡已与用户对齐,方可提交)\n\n' >&2; exit 1; }