From scaffold-new-repo
Scaffold the universal boilerplate for a new repository: LICENSE, README, CHANGELOG, .gitignore, agent config files (AGENTS.md, CLAUDE.md symlink, .claude/settings.json, .github/copilot-instructions.md), and a plans directory. Use when the user says "scaffold a new repo", "set up a new project", "bootstrap a new repository", "initialize a new repo", "create the boilerplate for", or starts a new repository and wants language-agnostic foundation files. Supports go-cli, go-library, javascript, pascal, python, ruby, rust, shell, swift, zig-cli, and generic project types. For language-specific scaffolding, pairs with scaffold-go-cli, scaffold-go-library, and scaffold-rust-cli; for full setup including CI and linters, see bootstrap-project.
How this skill is triggered — by the user, by Claude, or both
Slash command
/scaffold-new-repo:scaffold-new-repoThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate the language-agnostic foundation files that every new repository starts with.
Generate the language-agnostic foundation files that every new repository starts with.
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:
README.md h1 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 .git if 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.README.md and use its h1 heading (converted to kebab-case).gitignore first (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.work or *.test → Go CLI or Go librarynode_modules/ → JavaScript__pycache__/ or *.pyc → Python*.gem or .bundle/ → Ruby*.ppu or *.compiled → Pascalxcuserdata/ alone, or both .build/ and *.ipa together → Swift.zig-cache/ or zig-out/ → Zig CLItarget/ with no other language markers matched → Rust.gitignore does not make it clear.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.
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.
Skip if already inside a git repository.
git init
Read ./references/license.md for the MIT license template and create a LICENSE file from it.
YEAR with the current year (run date +%Y to get it)COPYRIGHT-HOLDER with the detected full nameRead ./references/readme.md for the README template and create a README.md from it.
GITHUB-USERNAME with the detected GitHub usernameRead ./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.
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.
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}.gitignore
Derive {TemplateName} from the user-specified language using these candidates, tried in order until one succeeds:
visual studio → VisualStudio)- (e.g., objective c → Objective-C)C++)
URL-encode special characters in the URL (e.g., C++ → C%2B%2B). Stop at the first successful (non-404) response.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.
Set up the hub-and-spoke agent configuration pattern (see the clean-up-agent-config skill for the full rationale). Create these files:
Read ./references/agents-md.md for the AGENTS.md template and create the canonical instruction file from it.
ln -sfn AGENTS.md CLAUDE.md
Create a minimal team-shared settings scaffold:
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"permissions": {
"allow": [],
"deny": []
}
}
Read ./references/copilot-instructions.md for the Copilot instructions template and create a .github/copilot-instructions.md file from it.
Use the Write tool to create empty .gitkeep files in both subdirectories:
docs/plans/todo/.gitkeepdocs/plans/done/.gitkeepThe Write tool creates parent directories automatically. The todo/ subdirectory holds active plans; done/ holds completed plans preserved for reference.
Stage all generated files and create the initial commit:
git add -A
git commit -S -m "feat: scaffold new repository"
Print a summary of what was created:
.gitignoreLICENSE or README.md, ask the user before overwriting.gitignore already exists, merge new entries rather than overwritinggit init fails, continue generating files but warn the user./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 .gitignore templates./references/agents-md.md -- AGENTS.md template./references/copilot-instructions.md -- .github/copilot-instructions.md templateFetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.
Generates daily or weekly digests of activity from connected sources (chat, email, docs, tasks, CRM), highlighting action items, decisions, mentions, and project updates.
npx claudepluginhub cboone/agent-harness-plugins --plugin scaffold-new-repo