Project init
Skill learnzdevelopmenthub/paadhai/.claude/skills/project-init
Use when setting up a new or existing project — verify GitHub access, initialize repo, write .paadhai.jsonFrom its SKILL.md
npx -y skills add learnzdevelopmenthub/paadhai --skill project-initAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
8.1 KB, as published. Nobody here has run it
project-init: Project Setup
Set up a new or existing GitHub project, write .paadhai.json, create branches and project board.
PREAMBLE — Announcement Banner
[SHELL] Detect context:
BRANCH=$(git branch --show-current)
Display:
────────────────────────────────────────
project-init
9 steps | Branch: <branch>
────────────────────────────────────────
STEP 1 — Verify Prerequisites
[SHELL] Check GitHub CLI auth:
gh auth status
Display authenticated account. If fails → stop:
GitHub CLI not authenticated. Run
gh auth loginfirst.
[SHELL] Check if git repo exists:
git rev-parse --is-inside-work-tree 2>/dev/null || echo "not-a-repo"
If not a repo → git init.
STEP 2 — Detect Existing Project
[SHELL] Check for existing GitHub remote:
git remote get-url origin 2>/dev/null || echo "no-remote"
If remote exists → Existing Project Flow (Step 2b). If no remote → New Project Flow (continue to Step 3).
Step 2b — Existing Project Detection
[SHELL] Extract owner/repo from remote URL:
git remote get-url origin | sed 's/.*github.com[:/]\(.*\)\.git/\1/' | sed 's/.*github.com[:/]\(.*\)/\1/'
[SHELL] Verify repo on GitHub:
gh repo view {owner/repo} --json name,owner,defaultBranchRef,isPrivate
[DELEGATE][FAST-MODEL] Auto-detect existing setup:
- Default branch name
- Does
developbranch exist? - Open milestones (count + titles)
- Open issues (count)
- Project boards linked to repo
Display detected values to user.
STEP 3 — Gather Project Info
Single input round — ask all questions at once.
New project:
- Repo name (will be created on GitHub)?
- Visibility: public or private?
- Branch strategy: develop → main (default) or other?
- Language / framework?
- Build command (e.g.,
npm run build,cargo build,make)? - Lint command (e.g.,
npm run lint,cargo clippy)? - Test command (e.g.,
npm test,cargo test,pytest)? - Create new project board or use existing?
- Target product version? (leave blank for first release)
Existing project:
- Pre-fill all detected values from Step 2b
- Ask user to confirm or override each
- Target product version? (leave blank to keep current or omit)
STEP 4 — Discover or Create Project Board
Always create a new project board for new projects. For existing projects, find the linked one.
New project — Create board:
[SHELL] Create project:
gh project create --owner {owner} --title "{repo-name} — Development Roadmap" --format json
Extract number and id from JSON output.
[SHELL] Link project to the repo:
gh project link {project_number} --owner {owner} --repo {owner}/{repo-name}
Existing project — Find linked board:
[SHELL] List projects for owner:
gh project list --owner {owner} --format json
Find the project linked to this repo by title or by checking linked repos. Use the matching project's number and id.
Both paths — Extract field IDs:
[SHELL] Query Status field and option IDs:
gh api graphql -f query='{ node(id: "{project_id}") { ... on ProjectV2 { fields(first: 20) { nodes { ... on ProjectV2SingleSelectField { id name options { id name } } } } } } }'
Extract: project_id, status_field_id, and option IDs for "Todo", "In Progress", "Done".
Note: Use
node(id: ...)query — NOTorganization(login: ...). The owner may be a user, not an org, andnodeworks for both.
STEP 5 — Action Summary + Human Gate
Display ALL planned actions:
Actions to perform:
─────────────────────────────────────────────
Repo : {owner}/{repo-name} [create / already exists]
.paadhai.json : Will write to project root
{full .paadhai.json content}
Branches : develop [create / already exists], main [already exists]
Project board : {board-name} [create / link existing]
─────────────────────────────────────────────
For existing projects — clearly mark:
[no action]for things that already exist[will create]for new things
G-01: "Proceed with setup? (yes/no)"
Wait for explicit "yes".
STEP 6 — Execute (after G-01)
Execute in this exact order — repo must exist before project can be linked to it.
6a. Create GitHub repo (new projects only):
gh repo create {repo-name} --{public|private} --source=. --remote=origin --push
6b. Create develop branch (if missing):
git checkout -b develop
git push -u origin develop
6c. Create and link project board (new projects only):
# Create project
gh project create --owner {owner} --title "{repo-name} — Development Roadmap" --format json
# Link to repo (use project_number from above)
gh project link {project_number} --owner {owner} --repo {owner}/{repo-name}
# Get field IDs
gh api graphql -f query='{ node(id: "{project_id}") { ... on ProjectV2 { fields(first: 20) { nodes { ... on ProjectV2SingleSelectField { id name options { id name } } } } } } }'
Extract project_id, status_field_id, Todo/In Progress/Done option IDs.
6d. Write .paadhai.json (after all IDs are known):
{
"version": "1",
"project_version": "{project_version}",
"repo": {
"owner": "{owner}",
"name": "{repo-name}",
"develop_branch": "develop",
"main_branch": "main"
},
"github": {
"project_id": "{project_id}",
"project_number": {project_number},
"status_field_id": "{status_field_id}",
"statuses": {
"todo": "{todo_option_id}",
"in_progress": "{in_progress_option_id}",
"done": "{done_option_id}"
}
},
"stack": {
"language": "{language}",
"build_cmd": "{build_cmd}",
"lint_cmd": "{lint_cmd}",
"test_cmd": "{test_cmd}"
},
"branches": {
"feature": "feature/",
"fix": "fix/",
"release": "release/"
}
}
If the user left target version blank, omit the
project_versionfield entirely.
STEP 7 — Branch Protection (Optional)
G-16: "Enable branch protection rules on main and develop? (yes/skip)"
If skip → proceed to Step 8.
If yes → apply protection via GitHub API:
[SHELL] Protect {config.repo.main_branch} (require PR review + CI, no force push):
gh api "repos/{config.repo.owner}/{config.repo.name}/branches/{config.repo.main_branch}/protection" \
--method PUT \
--field required_status_checks='{"strict":true,"contexts":[]}' \
--field enforce_admins=false \
--field required_pull_request_reviews='{"required_approving_review_count":1}' \
--field restrictions=null
[SHELL] Protect {config.repo.develop_branch} (require CI, no force push):
gh api "repos/{config.repo.owner}/{config.repo.name}/branches/{config.repo.develop_branch}/protection" \
--method PUT \
--field required_status_checks='{"strict":true,"contexts":[]}' \
--field enforce_admins=false \
--field required_pull_request_reviews=null \
--field restrictions=null
If either API call fails (e.g., free-plan repository limitation) → warn and skip gracefully:
Branch protection requires a paid GitHub plan for private repos. Skipping.
STEP 8 — Display Results
✓ Repo : https://github.com/{owner}/{repo-name}
✓ .paadhai.json : written
✓ develop : pushed to origin
✓ Project board : {board-url}
✓ Branch protection: <enabled / skipped>
STEP 9 — Smart Handoff
- New project, no SRS → "Run /project-plan to define your requirements."
- Existing project, no SRS → "Run /project-plan to create the SRS."
- Existing project, SRS exists, no issues → "Run /release-plan to create milestones and issues."
- Existing project, issues exist → "Run /dev-start #<issue-number> to begin development."