← ClaudeAtlas

bootstrap-projectlisted

把一个刚从本模板派生(Use this template / gh repo create --template / clone+reinit)的新 repo 落地成自洽状态——写 .template.toml 版本锚点、启用 core.hooksPath、同步 Codex adapters、跑 governance;不猜测需要 human 信息的步骤,只报告待办。
a-green-hand-jack/ml-project-repo-agent-native-template · ★ 0 · AI & Automation · score 54
Install: claude install-skill a-green-hand-jack/ml-project-repo-agent-native-template
# bootstrap-project 这是新项目落地器,不是迁移工具。目标 repo 已经拥有完整模板目录形态(GitHub template 派生本身 就会复制整棵树);这个 skill 只负责把 README「派生后的落地步骤」里能自动化的部分收敛成一次 幂等命令,并把需要 human 信息的步骤显式列成待办。 ## 适用边界 适用:刚用 "Use this template" / `gh repo create --template` / clone+`rm -rf .git && git init` 派生出的新 repo,目录形态已经是模板形态,只是版本锚点/hooksPath/adapters/governance 还没跑过。 不适用:迁移一个内容无关的已有 Git repo(用 `adopt-existing-repo` skill);需要人工判断 CODEOWNERS owner、`PROJECT.md` 内容、要不要删无用目录的步骤(本 skill 只报告,不代做)。 ## 输入 / 输出 artifact - 输入:目标 repo 路径(已 `git init`/`git clone`)、`--origin <owner/repo>`(必须显式传入,不推断)。 - 输出:目标 repo 的 `.template.toml`、`lab/docs/audits/template-bootstrap/state/*.json`、 `lab/docs/audits/template-bootstrap-report.md`。 ## 需要读取的 ledger - `plans/20260712-bootstrap-adoption-proof.zh.md`:当前 feature contract(任务树 A)。 - `.agent/template-versioning-policy.md`:`.template.toml` 与四站闭环的语义。 - `scripts/ANATOMY.md`:脚本维护点。 ## 步骤 1. 确认目标已是 Git repo(`.git` 存在)。主路径是 **self-bootstrap**:在派生 repo 内运行它 自己的脚本、目标就是自身(`.`);用上游 checkout 的脚本对另一个路径运行也可以。脚本会拒绝 把**上游模板 repo 自身**当目标(判据只看**身份 remote `origin`**:URL 归一化后——大小写 不敏感、剥 `.git` 后缀——与 `--origin` 同 slug 即拒绝;`upstream` 等其它 remote 不参与, 派生 repo 保留指回模板的 `upstream` remote 不会被误拒)。这是 best-effort 防呆护栏、不是 安全边界:没有 remote 或 `origin` 被改名/改指向的模板 checkout 识别不出来,属已知残余风险。 2. 运行(在派生出的新 repo 内): ```bash python scripts/bootstrap-project.py . --origin <owner/repo> ``` 这会依次做:写/确认 `.template.toml`(origin+version 锚点)、 `git config core.hooksPath .githooks`(目标缺 `.githooks/` 视为模板树不