- template/.claude/commands/coauthor.md.jinja:生成项目自带 /coauthor on|off|status, 薄包装调用 ./scripts/claude-attribution.sh,Claude Code 里打 / 即可发现 - 仅本项目生效,不装全局、不影响用户其它项目(install-skill.sh 未改) - 两个脚本不变(开关 + 门禁);终端/CI 仍可直接用脚本 - README 署名章节补 /coauthor 用法 + 文件树补 coauthor.md.jinja 验证:仅后端/全栈两配置均生成 coauthor.md + 两脚本;命令体动作 off/on/status 读写 git config 正确;~/.claude/commands 未受影响;check-docs 通过。
This commit is contained in:
@@ -113,7 +113,17 @@ domain/(实体+值对象+端口 Protocol) → application/services → infrastru
|
||||
|
||||
## Claude 署名策略(每个生成项目自带)
|
||||
|
||||
控制提交信息里是否包含 `Co-Authored-By: Claude` 署名。**默认 off(不含)**,由 commit-msg 门禁每次提交强制执行。
|
||||
控制提交信息里是否包含 `Co-Authored-By: Claude` 署名。**默认 off(不含)**,由 commit-msg 门禁每次提交强制执行。仅本项目生效。
|
||||
|
||||
在 Claude Code 里(项目自带斜杠命令,打 `/` 即可找到):
|
||||
|
||||
```
|
||||
/coauthor status # 查看当前策略
|
||||
/coauthor off # 不含署名(默认)
|
||||
/coauthor on # 保留署名
|
||||
```
|
||||
|
||||
或在终端直接用脚本(CI / 不用 Claude 时):
|
||||
|
||||
```bash
|
||||
./scripts/claude-attribution.sh status # 查看当前策略
|
||||
@@ -178,7 +188,8 @@ scaffold/
|
||||
│ ├── claude-attribution.sh ← 开关:本项目提交是否含 Claude 署名(默认 off)
|
||||
│ └── check-claude-attribution.sh ← commit-msg 门禁:按开关移除/保留署名
|
||||
├── .claude/commands/
|
||||
│ └── new-feature.md.jinja ← 项目内命令:按规则引导生成功能分层代码
|
||||
│ ├── new-feature.md.jinja ← 项目内命令:按规则引导生成功能分层代码
|
||||
│ └── coauthor.md.jinja ← 项目内命令:/coauthor 切换 Claude 署名开关
|
||||
├── .claude/rules/
|
||||
│ ├── # 原理层(10 个,静态,始终复制)
|
||||
│ ├── architecture.md / ddd.md / design-discipline.md ...
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
设置本项目提交是否包含 Claude 署名(`Co-Authored-By: Claude`)。
|
||||
|
||||
参数:$ARGUMENTS
|
||||
|
||||
## 行为
|
||||
|
||||
按参数运行开关脚本并回报结果(参数为空时默认 `status`):
|
||||
|
||||
```bash
|
||||
./scripts/claude-attribution.sh <on|off|status>
|
||||
```
|
||||
|
||||
- `off` —— 提交移除 Claude 署名(**默认**)
|
||||
- `on` —— 提交保留 Claude 署名
|
||||
- `status` —— 查看当前策略
|
||||
|
||||
## 步骤
|
||||
|
||||
1. 解析参数为 `on` / `off` / `status` 之一;无参或无法识别时用 `status`。
|
||||
2. 运行 `./scripts/claude-attribution.sh <参数>`,把输出原样回报给用户。
|
||||
3. 一句话说明:策略存于 `git config scaffold.includeClaude`,**仅本项目生效**;由 commit-msg 门禁(pre-commit)每次提交强制执行——`off` 时自动剥除任何 Claude 署名行。
|
||||
|
||||
## 注意
|
||||
- 只改本项目设置,不碰其它项目、不碰全局。
|
||||
- 不要手改 `.pre-commit-config.yaml` 或门禁脚本来达到目的——用本命令切换即可。
|
||||
Reference in New Issue
Block a user