文档生成
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- AI 智能
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- macOS
- 底层运行要求
- Python
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: scaffold-new-repo
description: >- Use when this capability is needed. Generate the language-agnostic foundation files that ever…
category: AI 智能
runtime: Python
---
# scaffold-new-repo 输出预览
## PART A: 任务判断
- 适用问题:提示词、Agent 工作流、模型评估或自动化推理。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Workflow / 1. Gather Project Information / 2. Detect User Identity”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于提示词、Agent 工作流、模型评估或自动化推理,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Workflow / 1. Gather Project Information / 2. Detect User Identity”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、读取环境变量、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令、读取环境变量。
先用一个小任务确认它会围绕“Workflow / 1. Gather Project Information / 2. Detect User Identity”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: scaffold-new-repo
description: >- Use when this capability is needed. Generate the language-agnostic foundation files that ever…
category: AI 智能
source: tomevault-io/skills-registry
---
# scaffold-new-repo
## 什么时候使用
- 把 AI / Agent方向的常用动作沉淀成 Agent 可调用的技能 适合处理AI Agent、提示词、模型评估与自动化推理,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查…
- 面向提示词、Agent 工作流、模型评估或自动化推理,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Workflow / 1. Gather Project Information / 2. Detect User Identity」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "scaffold-new-repo" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Workflow / 1. Gather Project Information / 2. Detect User Identity
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python | 读取文件、写入/修改文件、执行终端命令、读取环境变量 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Scaffold New Repo
Generate the language-agnostic foundation files that every new repository starts with.
Workflow
1. Gather Project Information
If the user provided a project name in their request, use it directly instead of detecting from git remote or README. If they specified a project type (one of go-cli, go-library, javascript, pascal, python, ruby, rust, shell, swift, zig-cli, generic), use it instead of inferring from .gitignore. Any remaining parameters should still be gathered normally.
Derive what you can automatically, then ask for only what's missing:
- Project name -- derive from the git remote URL or
README.mdh1 heading, not from the directory or branch name (those are often misleading, e.g. worktree paths). Detection order:git remote get-url origin-- extract the repo name from the URL (strip the trailing.gitif present, take the last path segment). If the command exits non-zero, returns empty output, or the URL cannot be parsed into a repo name, treat this as "no remote" and continue to step 2.- If there is no usable remote, check for an existing
README.mdand use its h1 heading (converted to kebab-case) - Only if both the remote and README detection fail, ask the user for the project name
- Short description -- ask the user for a one-sentence description.
- Project type -- check the existing
.gitignorefirst (GitHub often generates one when creating the repo). Infer the project type from its contents: Check heuristics in the order listed below. The first match wins.go.workor*.test→ Go CLI or Go librarynode_modules/→ JavaScript__pycache__/or*.pyc→ Python*.gemor.bundle/→ Ruby*.ppuor*.compiled→ Pascalxcuserdata/alone, or both.build/and*.ipatogether → Swift.zig-cache/orzig-out/→ Zig CLItarget/with no other language markers matched → Rust- Minimal or macOS-only entries → Shell or Generic
- Only ask the user for the project type if the
.gitignoredoes not make it clear.
- Project type options: Go CLI, Go library, JavaScript, Pascal, Python, Ruby, Rust, Shell, Swift, Zig CLI, Generic
2. Detect User Identity
Detect the user's GitHub username and full name for use in templates:
# GitHub username (for module paths, URLs, clone commands)
gh api user -q .login
# Full name (for LICENSE copyright)
git config user.name
If either command fails or returns empty output, ask the user to provide the value. Use the GitHub username wherever templates reference GITHUB-USERNAME and the full name wherever they reference COPYRIGHT-HOLDER.
3. Prepare the Directory
If the current directory is empty or the user specifies a directory name:
mkdir -p PROJECT-NAME
cd PROJECT-NAME
If the current directory already has files, confirm with the user before adding boilerplate alongside existing content.
4. Initialize Git
Skip if already inside a git repository.
git init
5. Generate LICENSE
Read ./references/license.md for the MIT license template and create a LICENSE file from it.
- Replace
YEARwith the current year (rundate +%Yto get it) - Replace
COPYRIGHT-HOLDERwith the detected full name
6. Generate README.md
Read ./references/readme.md for the README template and create a README.md from it.
- Replace the heading with the exact binary or repository name (kebab-case)
- Insert the short description
- Tailor the Installation section placeholder to the project type
- Replace
GITHUB-USERNAMEwith the detected GitHub username
7. Generate CHANGELOG.md
Read ./references/changelog.md for the CHANGELOG template and create a CHANGELOG.md from it.
No replacements needed. This is a static file ready for the first release.
8. Generate .gitignore
Read ./references/gitignore-templates.md for the curated language templates.
If a .gitignore already exists (e.g., generated by GitHub), merge the appropriate template entries into it, avoiding duplicates.
If no .gitignore exists, create one using the appropriate template based on the project type.
GitHub Fallback for Unlisted Types
When the user explicitly specifies a project type that is NOT in the curated list above:
Attempt to fetch the template from GitHub's gitignore repository using WebFetch:
https://raw.githubusercontent.com/github/gitignore/main/{TemplateName}.gitignoreDerive
{TemplateName}from the user-specified language using these candidates, tried in order until one succeeds:- Title-cased with spaces removed (e.g.,
visual studio→VisualStudio) - Title-cased with spaces replaced by
-(e.g.,objective c→Objective-C) - The user's input as-is (e.g.,
C++) URL-encode special characters in the URL (e.g.,C++→C%2B%2B). Stop at the first successful (non-404) response.
- Title-cased with spaces removed (e.g.,
If any fetch succeeds: merge the fetched entries with the common entries (
.DS_Store,.env,.claude/settings.local.json), avoiding duplicates. Use the combined result as the.gitignore.If all candidate fetches fail (404 or network error): fall back to the Generic template and inform the user that no template was found for that language.
This fallback is ONLY used when the user explicitly specifies a type not in the curated list. It is never used during auto-detection from an existing .gitignore.
9. Bootstrap Agent Config Files
Set up the hub-and-spoke agent configuration pattern (see the clean-up-agent-config skill for the full rationale). Create these files:
AGENTS.md
Read ./references/agents-md.md for the AGENTS.md template and create the canonical instruction file from it.
- Replace the heading with the exact binary or repository name (kebab-case)
- Insert the short description in the Overview section
CLAUDE.md (symlink)
ln -sfn AGENTS.md CLAUDE.md
.claude/settings.json
Create a minimal team-shared settings scaffold:
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"permissions": {
"allow": [],
"deny": []
}
}
.github/copilot-instructions.md
Read ./references/copilot-instructions.md for the Copilot instructions template and create a .github/copilot-instructions.md file from it.
- Replace the heading with the exact binary or repository name (kebab-case)
- The file cross-references AGENTS.md for full project conventions
10. Create docs/plans/
Use the Write tool to create empty .gitkeep files in both subdirectories:
docs/plans/todo/.gitkeepdocs/plans/done/.gitkeep
The Write tool creates parent directories automatically. The todo/ subdirectory holds active plans; done/ holds completed plans preserved for reference.
11. Create Initial Commit
Stage all generated files and create the initial commit:
git add -A
git commit -S -m "feat: scaffold new repository"
12. Summary
Print a summary of what was created:
- List every file generated
- Note the project type used for
.gitignore - Note the agent config files and symlink
- Suggest running the add-community-files skill to add CONTRIBUTING.md, CODE_OF_CONDUCT.md, .github/SECURITY.md, and .github/PULL_REQUEST_TEMPLATE.md
Error Handling
- If the target directory already contains a
LICENSEorREADME.md, ask the user before overwriting - If a
.gitignorealready exists, merge new entries rather than overwriting - If
git initfails, continue generating files but warn the user - If the user provides an unrecognized project type, attempt the GitHub fallback (see Step 8). If that also fails, fall back to Generic and mention it
Reference Templates
./references/license.md-- MIT license template./references/readme.md-- README template./references/changelog.md-- CHANGELOG template (Keep a Changelog format)./references/gitignore-templates.md-- Per-language.gitignoretemplates./references/agents-md.md-- AGENTS.md template./references/copilot-instructions.md--.github/copilot-instructions.mdtemplate
Source: cboone/agent-harness-plugins — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核