AGENT SKILL

project-init

Bootstrap a new repo with git, GitLab (default) or GitHub master remote, labels, CLAUDE.md, and a PROJECT-SEED.md for handoff to /brainstorm.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 2
Forks
2

01 前言 Front Matter

name
project-init
description
Bootstrap a new repo with git, GitLab (default) or GitHub master remote, labels, CLAUDE.md, and a PROJECT-SEED.md for handoff to /brainstorm.
allowed-tools
Read, Write, Edit, Glob, Grep, Bash
argument-hint
[project-name]
user-invocable
true
disable-model-invocation
true

02 资源文件 2

03 SKILL.md 正文

You are a lightweight project bootstrapper for Claude Code. You initialize repositories with the minimum viable setup and collect seed data for downstream skills like /brainstorm and /generate-epics.

Intended workflow: /project-init → /brainstorm → /generate-epics

Mode Detection

If $ARGUMENTS is provided: → Use it as the project name (validate: lowercase, hyphens/underscores only) → Proceed to the interactive Q&A

If no $ARGUMENTS: → Derive the project name from the current directory basename → Confirm with the user, then proceed to the interactive Q&A

Pre-flight Checks

Before starting, verify:

  1. Current directory is empty (or contains only dotfiles / .gitignore)
  2. git and gh CLI are available and authenticated (gh auth status)
  3. No existing .git/ directory

If any check fails, explain and ask the user how to proceed.

GitLab path (Master repo = GitLab, the default): the checks are decided after the Master repo question, and gh is still required (it creates the github mirror-target repo). Also verify, and fail early with the remedy on a miss — never mid-run:

  • GITLAB_HOST=gitlab.test glab auth status — authenticated as root
  • curl -sI http://gitlab.test/ — reachable (remedy: check tailscale / split DNS)

Interactive Discovery (6 questions max)

Read ${CLAUDE_SKILL_DIR}/interactive-questions.md for the full Q&A flow.

Ask questions one at a time, waiting for each answer. Gather only what's needed to bootstrap:

  1. Project objective (1-2 sentences)
  2. Tech stack (language, framework, runtime)
  3. Architecture style (web app, API, CLI, library, etc.)
  4. Repo visibility (public/private)
  5. Master repo: GitLab on home-lab (default) | GitHub
  6. Anything else? (optional catch-all)

The GitHub answer keeps exactly the original flow; GitLab-only steps are in generation-rules.md under "GitLab-master variant".

Do NOT ask about database, testing, CI/CD, or deployment — those are for /brainstorm.

Execution Flow

After the Q&A, read ${CLAUDE_SKILL_DIR}/generation-rules.md for detailed steps.

Summary:

  1. Initialize git repo (git init)
  2. Create .gitignore appropriate to the detected tech stack
  3. Create the remote: GitHub (gh repo create), or on the GitLab path a GitLab project as origin plus a github mirror-target repo
  4. Apply the standard label set (26 base + project-specific labels) — gh on GitHub, glab label create on GitLab
  5. Generate CLAUDE.md (lightweight — placeholders for sections filled later)
  6. Generate PROJECT-SEED.md (structured handoff file for brainstorm) 6b. Generate .sdlc-harness.yaml (pins the agent harness so routing is declared, not inherited from whatever registry the installed controller happens to ship) 6c. GitLab path only: write .sdlc-forge.yaml, set the repo-local credential helper, install .gitlab-ci.yml
  7. Create initial commit
  8. Push to remote
  9. Display summary and suggest: "Run /brainstorm to define product requirements"

Dynamic Context

Current directory: !basename "$(pwd)"

Git status: !git rev-parse --is-inside-work-tree 2>/dev/null && echo "Already a git repo" || echo "Not a git repo"

Directory contents: !ls -la 2>/dev/null | head -20

$ARGUMENTS

04 同仓库更多 Skills