Loading...
Loading...
Initialize a new project with deep context gathering and project.md. Triggers include "new project", "start project", "initialize project", "create project", "begin project", "setup project".
npx skill4agent add gannonh/kata-skills kata-new-project.planning/PROJECT.md.planning/config.json/kata-add-milestone[ -f .planning/PROJECT.md ] && echo "ERROR: Project already initialized. Use /kata-track-progress" && exit 1if [ -d .git ] || [ -f .git ]; then
echo "Git repo exists in current directory"
else
git init
echo "Initialized new git repo"
fiCODE_FILES=$(find . -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.swift" -o -name "*.java" 2>/dev/null | grep -v node_modules | grep -v .git | head -20)
HAS_PACKAGE=$([ -f package.json ] || [ -f requirements.txt ] || [ -f Cargo.toml ] || [ -f go.mod ] || [ -f Package.swift ] && echo "yes")
HAS_CODEBASE_MAP=$([ -d .planning/codebase ] && echo "yes")CODE_FILESHAS_PACKAGEHAS_CODEBASE_MAPRun `/kata-map-codebase` first, then return to `/kata-new-project`questioning.mdquestioning.mdmkdir -p .planning/phases/pending .planning/phases/active .planning/phases/completed
touch .planning/phases/pending/.gitkeep .planning/phases/active/.gitkeep .planning/phases/completed/.gitkeep.planning/.planning/phases/.gitkeep.planning/PROJECT.md@./references/project-template.md## Requirements
### Validated
(None yet — ship to validate)
### Active
- [ ] [Requirement 1]
- [ ] [Requirement 2]
- [ ] [Requirement 3]
### Out of Scope
- [Exclusion 1] — [why]
- [Exclusion 2] — [why].planning/codebase/ARCHITECTURE.mdSTACK.md## Requirements
### Validated
- ✓ [Existing capability 1] — existing
- ✓ [Existing capability 2] — existing
- ✓ [Existing capability 3] — existing
### Active
- [ ] [New requirement 1]
- [ ] [New requirement 2]
### Out of Scope
- [Exclusion 1] — [why]## Key Decisions
| Decision | Rationale | Outcome |
| ------------------------- | --------- | --------- |
| [Choice from questioning] | [Why] | — Pending |---
*Last updated: [date] after initialization*git add .planning/PROJECT.md .planning/phases/pending/.gitkeep .planning/phases/active/.gitkeep .planning/phases/completed/.gitkeep
git commit -m "$(cat <<'EOF'
docs: initialize project
[One-liner from PROJECT.md What This Is section]
EOF
)"questions: [
{
header: "Mode",
question: "How do you want to work?",
multiSelect: false,
options: [
{ label: "YOLO (Recommended)", description: "Auto-approve, just execute" },
{ label: "Interactive", description: "Confirm at each step" }
]
},
{
header: "Depth",
question: "How thorough should planning be?",
multiSelect: false,
options: [
{ label: "Quick", description: "Ship fast (3-5 phases, 1-3 plans each)" },
{ label: "Standard", description: "Balanced scope and speed (5-8 phases, 3-5 plans each)" },
{ label: "Comprehensive", description: "Thorough coverage (8-12 phases, 5-10 plans each)" }
]
},
{
header: "Execution",
question: "Run plans in parallel?",
multiSelect: false,
options: [
{ label: "Parallel (Recommended)", description: "Independent plans run simultaneously" },
{ label: "Sequential", description: "One plan at a time" }
]
},
{
header: "Git Tracking",
question: "Commit planning docs to git?",
multiSelect: false,
options: [
{ label: "Yes (Recommended)", description: "Planning docs tracked in version control" },
{ label: "No", description: "Keep .planning/ local-only (add to .gitignore)" }
]
},
{
header: "PR Workflow",
question: "Use PR-based release workflow?",
multiSelect: false,
options: [
{ label: "Yes (Recommended)", description: "Protect main, create PRs, tag via GitHub Release" },
{ label: "No", description: "Commit directly to main, create tags locally" }
]
},
{
header: "GitHub Tracking",
question: "Enable GitHub Milestone/Issue tracking?",
multiSelect: false,
options: [
{ label: "Yes (Recommended)", description: "Create GitHub Milestones for Kata milestones, optionally create Issues for phases" },
{ label: "No", description: "Keep planning local to .planning/ directory only" }
]
}
]
# If GitHub Tracking = Yes, ask follow-up:
{
header: "Issue Creation",
question: "When should GitHub Issues be created for phases?",
multiSelect: false,
options: [
{ label: "Auto", description: "Create Issues automatically for each phase (no prompting)" },
{ label: "Ask per milestone", description: "Prompt once per milestone, decision applies to all phases" },
{ label: "Never", description: "Only create Milestones, no phase-level Issues" }
]
}# Check if gh CLI is authenticated
GH_AUTH=$(gh auth status &>/dev/null && echo "true" || echo "false")
# Check for GitHub remote
HAS_GITHUB_REMOTE=$(git remote -v 2>/dev/null | grep -q 'github\.com' && echo "true" || echo "false")HAS_GITHUB_REMOTE=falsegh repo create --source=. --private --pushgh repo create --source=. --public --pushgh repo createif [ "$GH_AUTH" = "true" ]; then
gh repo create --source=. --private --push && echo "GitHub repository created" || echo "Warning: Failed to create repository"
else
echo "Warning: GitHub CLI not authenticated. Run 'gh auth login' first, then 'gh repo create --source=. --private --push'"
figithub.enabled: trueif [ "$GH_AUTH" = "true" ]; then
gh repo create --source=. --public --push && echo "GitHub repository created" || echo "Warning: Failed to create repository"
else
echo "Warning: GitHub CLI not authenticated. Run 'gh auth login' first, then 'gh repo create --source=. --public --push'"
figithub.enabled: truegithub.enabled: falsegh repo create --source=. --public.planning/config.jsonHAS_GITHUB_REMOTE=true| Agent | When it runs | What it does |
|---|---|---|
| Researcher | Before planning each phase | Investigates domain, finds patterns, surfaces gotchas |
| Plan Checker | After plan is created | Verifies plan actually achieves the phase goal |
| Verifier | After phase execution | Confirms must-haves were delivered |
questions: [
{
header: "Research",
question: "Research before planning each phase? (adds tokens/time)",
multiSelect: false,
options: [
{ label: "Yes (Recommended)", description: "Investigate domain, find patterns, surface gotchas" },
{ label: "No", description: "Plan directly from requirements" }
]
},
{
header: "Plan Check",
question: "Verify plans will achieve their goals? (adds tokens/time)",
multiSelect: false,
options: [
{ label: "Yes (Recommended)", description: "Catch gaps before execution starts" },
{ label: "No", description: "Execute plans without verification" }
]
},
{
header: "Verifier",
question: "Verify work satisfies requirements after each phase? (adds tokens/time)",
multiSelect: false,
options: [
{ label: "Yes (Recommended)", description: "Confirm deliverables match phase goals" },
{ label: "No", description: "Trust execution, skip verification" }
]
},
{
header: "Model Profile",
question: "Which AI models for planning agents?",
multiSelect: false,
options: [
{ label: "Balanced (Recommended)", description: "Sonnet for most agents — good quality/cost ratio" },
{ label: "Quality", description: "Opus for research/roadmap — higher cost, deeper analysis" },
{ label: "Budget", description: "Haiku where possible — fastest, lowest cost" }
]
},
{
header: "Statusline",
question: "Enable Kata statusline? (shows model, context usage, update status)",
multiSelect: false,
options: [
{ label: "Yes (Recommended)", description: "Display live session info in Claude Code statusline" },
{ label: "No", description: "Use default Claude Code statusline" }
]
}
].planning/config.json{
"mode": "yolo|interactive",
"depth": "quick|standard|comprehensive",
"parallelization": true|false,
"commit_docs": true|false,
"pr_workflow": true|false,
"model_profile": "quality|balanced|budget",
"display": {
"statusline": true|false
},
"workflow": {
"research": true|false,
"plan_check": true|false,
"verifier": true|false
},
"github": {
"enabled": true|false,
"issueMode": "auto|ask|never"
}
}github.enabledgithub.issueMode"auto""ask""never"ghgithub.enabled: falsegithub.issueMode: "never"commit_docs: false.planning/.gitignoregit add .planning/config.json
git commit -m "$(cat <<'EOF'
chore: add project config
Mode: [chosen mode]
Depth: [chosen depth]
Parallelization: [enabled/disabled]
Workflow agents: research=[on/off], plan_check=[on/off], verifier=[on/off]
EOF
)"/kata-configure-settingsAskUserQuestion([
{
header: "GitHub Actions",
question: "Scaffold a GitHub Actions workflow to auto-publish on release?",
multiSelect: false,
options: [
{ label: "Yes (Recommended)", description: "Create .github/workflows/release.yml for npm publish" },
{ label: "No", description: "I'll set up CI/CD myself" }
]
}
]).github/workflows/release.yml━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ RECOMMENDED: Enable GitHub Branch Protection
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Since you've enabled PR workflow, we strongly recommend
protecting your main branch to prevent accidental direct pushes.
Go to: https://github.com/{owner}/{repo}/settings/branches
Enable these settings for `main`:
✓ Require a pull request before merging
✓ Do not allow bypassing the above settings
✗ Allow force pushes (uncheck this)
This ensures ALL changes go through PRs — even in emergencies,
you can temporarily disable protection from GitHub settings.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━mkdir -p .github/workflowsname: Publish to npm
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Get package info
id: package
run: |
LOCAL_VERSION=$(node -p "require('./package.json').version")
PACKAGE_NAME=$(node -p "require('./package.json').name")
echo "local_version=$LOCAL_VERSION" >> $GITHUB_OUTPUT
echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
# Get published version (returns empty if not published)
PUBLISHED_VERSION=$(npm view "$PACKAGE_NAME" version 2>/dev/null || echo "")
echo "published_version=$PUBLISHED_VERSION" >> $GITHUB_OUTPUT
echo "Local version: $LOCAL_VERSION"
echo "Published version: $PUBLISHED_VERSION"
- name: Check if should publish
id: check
run: |
LOCAL="${{ steps.package.outputs.local_version }}"
PUBLISHED="${{ steps.package.outputs.published_version }}"
if [ -z "$PUBLISHED" ]; then
echo "Package not yet published, will publish"
echo "should_publish=true" >> $GITHUB_OUTPUT
elif [ "$LOCAL" != "$PUBLISHED" ]; then
echo "Version changed ($PUBLISHED -> $LOCAL), will publish"
echo "should_publish=true" >> $GITHUB_OUTPUT
else
echo "Version unchanged ($LOCAL), skipping publish"
echo "should_publish=false" >> $GITHUB_OUTPUT
fi
- name: Publish to npm
if: steps.check.outputs.should_publish == 'true'
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
if: steps.check.outputs.should_publish == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.package.outputs.local_version }}
name: v${{ steps.package.outputs.local_version }}
generate_release_notes: true
make_latest: truegit add .github/workflows/release.yml
git commit -m "$(cat <<'EOF'
ci: add npm publish workflow
Publishes to npm and creates GitHub Release when:
- Push to main
- package.json version differs from published version
Requires NPM_TOKEN secret in repository settings.
EOF
)"✓ Created .github/workflows/release.yml
## Setup Required
Add NPM_TOKEN secret to your GitHub repository:
1. Go to repo Settings → Secrets and variables → Actions
2. Click "New repository secret"
3. Name: NPM_TOKEN
4. Value: Your npm access token (from npmjs.com → Access Tokens)
The workflow will auto-publish when you merge PRs that bump package.json version..claude/settings.json# Ensure .claude directory exists
mkdir -p .claude
# Check if settings.json exists and has statusLine
if [ -f .claude/settings.json ]; then
# Check if statusLine already configured
if grep -q '"statusLine"' .claude/settings.json; then
echo "Statusline already configured in .claude/settings.json"
else
# Add statusLine to existing settings using node
node -e "
const fs = require('fs');
const settings = JSON.parse(fs.readFileSync('.claude/settings.json', 'utf8'));
settings.statusLine = {
type: 'command',
command: 'node \"\$CLAUDE_PROJECT_DIR/.claude/hooks/kata-statusline.js\"'
};
fs.writeFileSync('.claude/settings.json', JSON.stringify(settings, null, 2));
"
echo "✓ Statusline enabled in .claude/settings.json"
fi
else
# Create new settings.json with statusLine
cat > .claude/settings.json << 'SETTINGS_EOF'
{
"statusLine": {
"type": "command",
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/kata-statusline.js\""
}
}
SETTINGS_EOF
echo "✓ Created .claude/settings.json with statusline"
fi.claude/settings.jsonMODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")| Agent | quality | balanced | budget |
|---|---|---|---|
| kata-project-researcher | opus | sonnet | haiku |
| kata-research-synthesizer | sonnet | sonnet | haiku |
| kata-roadmapper | opus | sonnet | sonnet |
# Check for uncommitted planning files
if git status --porcelain .planning/PROJECT.md .planning/config.json 2>/dev/null | grep -q '.'; then
git add .planning/PROJECT.md .planning/config.json
git commit -m "$(cat <<'EOF'
docs: initialize project
Project context and workflow configuration.
EOF
)"
fiMISSING=""
[ ! -f .planning/PROJECT.md ] && MISSING="${MISSING}\n- .planning/PROJECT.md"
[ ! -f .planning/config.json ] && MISSING="${MISSING}\n- .planning/config.json"
[ ! -f .planning/phases/pending/.gitkeep ] && MISSING="${MISSING}\n- .planning/phases/pending/.gitkeep"
[ ! -f .planning/phases/active/.gitkeep ] && MISSING="${MISSING}\n- .planning/phases/active/.gitkeep"
[ ! -f .planning/phases/completed/.gitkeep ] && MISSING="${MISSING}\n- .planning/phases/completed/.gitkeep"
if [ -n "$MISSING" ]; then
echo "MISSING ARTIFACTS:${MISSING}"
else
echo "ALL ARTIFACTS PRESENT"
fi| Artifact | Location |
|---|---|
| Project | |
| Config | |
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ RECOMMENDED: Enable Branch Protection
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PR workflow is enabled. Protect your main branch:
https://github.com/{owner}/{repo}/settings/branches
Settings for `main`:
✓ Require a pull request before merging
✓ Do not allow bypassing the above settings
✗ Allow force pushes (uncheck)/kata-add-milestone/clear.planning/PROJECT.md.planning/config.json/kata-add-milestone