From spindev-core
Bring a project up to baseline for working with Claude — ensure it's a git repo on `main`, detect bringup vs protected mode and manage the breadcrumb accordingly, scaffold missing `CLAUDE.md`/`README.md`, stamp the canonical PR-workflow rules block into `CLAUDE.md`, auto-junction dev-setup-owned dependency skills (`end-session`, `review-plan`) into `~/.claude/skills/`, and report missing plugin skills (`simplify`, `codex`, `superpowers`, `claude-md-management`) with install commands. Safe to re-run. Triggers: `/init-project`, "initialize this project", "set up this repo for Claude", "bring this project up to baseline".
How this skill is triggered — by the user, by Claude, or both
Slash command
/spindev-core:init-projectThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Bring a project up to baseline for working with Claude. Idempotent — every action checks current state first and no-ops when the project already matches baseline. Safe to run repeatedly.
Bring a project up to baseline for working with Claude. Idempotent — every action checks current state first and no-ops when the project already matches baseline. Safe to run repeatedly.
Announce at start: "Running /init-project to bring this project up to baseline."
/init-project (slash command)CLAUDE.md and README.md in the target projectgit init (only after user confirmation)~/.claude/skills/## Project Mode breadcrumb in CLAUDE.mdCLAUDE.mdIt does not authorize:
reset --hard, branch -D) — always askclaude plugin install on the user's behalf — print the command, let them run itCLAUDE.md / README.md — beyond the breadcrumb and PR-rules block, leave them aloneWalk these in order. Announce the current step. Skip steps that clearly do not apply and say so.
git rev-parse --git-dir — is this a git repo?git remote get-url origin — any remote?git branch --list and git log --oneline -20 — any feature branches, squash-merge history?CLAUDE.md exist? Does README.md exist?package.json, pyproject.toml, Cargo.toml, go.mod, etc.)? Use them to infer stack.No .git and the directory looks code-shaped (source files or manifest present) → ask the user, then:
git init
git symbolic-ref HEAD refs/heads/main
If the user declines, continue with the docs and dependency steps anyway.
Run scripts/detect-mode.sh — prints bringup or protected.
Heuristic (matches end-session):
git log, ORgh api repos/{owner}/{repo}/branches/main/protection returns 200 (only if gh auth status is clean)→ protected. Otherwise bringup.
CLAUDE.mdBringup: ensure this block exists under a ## Project Mode heading:
Bringup. Commits go straight to
main, no feature branches, no PR workflow yet. Promote to protected mode (and remove this breadcrumb) when the first feature branch + PR lands.
Protected: remove any existing bringup breadcrumb.
CLAUDE.md existsIf missing, create a minimal file. Infer what you can from manifest files; ask the user for:
A minimal starting CLAUDE.md (scope + mode + PR rules block) is enough. Do not pad with generic advice. If CLAUDE.md already exists, leave its body alone — only manage the breadcrumb (step 4) and the PR-rules block (step 7).
README.md existsIf missing, create a minimal human-facing README: title, one-line purpose, setup, usage. Ask for anything not inferrable. If it exists, leave it alone.
CLAUDE.mdIdempotent — bracketed by HTML comment markers. On re-run, replace the block between markers if present; otherwise append.
<!-- init-project:pr-rules-start -->
## Pull Request Workflow
**NEVER open a PR until all four are true:**
1. Local branch is up to date with `origin` for both this branch and the target (`git fetch origin`).
2. This branch is rebased onto the target (usually `main`) with no merge conflicts.
3. Every CI gate that blocks merge has been run locally and passed — tests, typecheck, lint, and any project-specific checks listed in `.github/workflows/*.yml` or equivalent.
4. The branch has been pushed to `origin` after the rebase.
**PR defaults:** auto-merge enabled, squash merge. Title and body should come from the session summary or recent commits.
If any of the four conditions isn't met, finish the prep first — don't open the PR.
<!-- init-project:pr-rules-end -->
Two categories, handled differently.
Auto-junction (dev-setup-owned): end-session, review-plan. For each, if ~/.claude/skills/<name> doesn't already point at ~/src/dev-setup/.claude/skills/<name>, run:
scripts/install-dep-skill.sh <name>
Check + report (plugin-sourced): simplify, codex, superpowers, claude-md-management. Probe ~/.claude/plugins/ for each; for any missing, print the install hint for the user to run. Do not auto-install. If the exact CLI for installing a plugin has changed, detect at runtime (claude --help, claude plugin --help) and print whatever form the installed claude supports.
One short message summarizing:
CLAUDE.md, README.md, breadcrumb, PR-rules block)Always pause and confirm before:
git reset --hard, git clean -fd, git branch -D, git push --forceend-session — sets up vs wraps up. Share the same breadcrumb text and mode heuristic.claude-md-management:claude-md-improver — init-project does not audit existing CLAUDE.md; suggest claude-md-improver in the final report if the user wants a deeper pass.If you notice a clear bug in this skill during execution — wrong command, broken path, reference to something that no longer exists — fix it and note the fix in the final report. Judgment-call improvements: describe and ask before editing.
This skill is served from a read-only plugin cache (~/.claude/plugins/cache/spindev-core@spinlockdevelopment/<version>/). Edits there do not persist and do not propagate. To actually apply the fix, edit the authoritative copy at plugins/spindev-core/skills/init-project/SKILL.md (or its scripts/) in a clone of spinlockdevelopment/dev-setup — typically ~/src/dev-setup — commit (bringup: straight to main; protected: feature branch + PR), and push. Consumers pick it up on their next /plugin marketplace update.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub spinlockdevelopment/dev-setup --plugin spindev-core