Initialize .claude/ structure and surgically add PopKit section to CLAUDE.md without overwriting. Detects conflicts, creates config, prompts for Power Mode. Use for new projects only - use analyze-project for existing.
Surgically initializes .claude/ structure and PopKit config without overwriting existing files. Creates CLAUDE.md with HTML markers, detects project type, and triggers Power Mode setup. Use only for new projects via `/popkit:project init`.
/plugin marketplace add jrc1883/popkit-claude/plugin install popkit-core@popkit-claudeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
checklists/init-checklist.jsonscripts/detect_project_type.pytemplates/cli/pyproject.toml.templatetemplates/fastapi/pyproject.toml.templatetemplates/library/package.json.templatetemplates/nextjs/package.json.templatetemplates/nextjs/tsconfig.json.templateworkflows/init-workflow.jsonInitialize project with Claude Code configuration. Never destroys user content - surgically adds PopKit section using HTML markers.
Trigger: /popkit:project init or new project setup
<!-- POPKIT:START/END --> markers - Required for updates.claude/popkit/ - Required for deploy, routines, state| Step | When | Decision ID |
|---|---|---|
| 0 | Plugin conflicts detected | plugin_conflict |
| 6 | After directory creation | power_mode_setup |
| 8 | After init complete | next_action |
Skipping these violates PopKit UX standard.
from plugin_detector import run_detection, format_conflict_report
result, plugins = run_detection()
if result["total"] > 0:
# Use AskUserQuestion: "View details" | "Continue anyway" | "Cancel"
# Detect: package.json→node, Cargo.toml→rust, pyproject.toml→python, go.mod→go
mkdir -p .claude/{agents,commands,hooks,skills,scripts,logs,plans}
mkdir -p .claude/popkit/routines/{morning,nightly}
# .claude/popkit/config.json
{
"version": "1.0",
"project_name": "<name>",
"project_prefix": "<prefix>", # First letters
"default_routines": {"morning": "pk", "nightly": "pk"},
"tier": "free",
"features": {"power_mode": "not_configured"}
}
Decision Flow:
CLAUDE.md exists?
├─ NO → Create with: header + PopKit section
└─ YES → Read content
├─ Has markers? → Edit ONLY between markers
└─ No markers? → Append at END
Markers (REQUIRED):
<!-- POPKIT:START -->
## PopKit Integration
Quick Commands: /popkit:next, /popkit:routine morning, /popkit:git commit
Config: .claude/popkit/, Power Mode: [status]
<!-- POPKIT:END -->
See examples/claude-md-update.py for full implementation.
Only if missing. See examples/ for schemas.
Use AskUserQuestion:
- question: "Set up Power Mode for multi-agent orchestration?"
- options:
- "Native Async (Recommended)" - 5+ agents, zero setup (requires Claude Code 2.0.64+)
- "Upstash Redis (Optional)" - 10+ agents, cloud-based, env vars only (no Docker)
- "File Mode (Fallback)" - 2-3 agents, automatic fallback
- "Skip for now"
Update CLAUDE.md with selected mode.
.claude/logs/
.claude/STATUS.json
.claude/power-mode-state.json
.claude/popkit/state.json
.worktrees/
.generated/
Use AskUserQuestion:
- question: "What would you like to do next?"
- options:
- "Analyze codebase" → /popkit:project analyze
- "Setup quality gates" → /popkit:project setup
- "View issues" → /popkit:issue list
- "Done for now"
PopKit Project Initialization
═════════════════════════════
[1/5] Checking conflicts... ✓ No conflicts
[2/5] Detecting type... ✓ Node.js (Next.js 14)
[3/5] Creating structure... ✓ .claude/popkit/config.json
[4/5] Updating CLAUDE.md... ✓ Section appended with markers
[5/5] Power Mode... ✓ [Based on selection]
Summary:
Config: .claude/popkit/config.json
CLAUDE.md: <!-- POPKIT:START/END --> markers
Power Mode: [status]
Ready: /popkit:routine morning
| Path | Purpose |
|---|---|
.claude/popkit/config.json | Project config |
.claude/popkit/routines/ | Custom routines |
.claude/STATUS.json | Session state |
CLAUDE.md | Has markers |
Triggers: /popkit:project init, manual skill invocation
Followed by: analyze, mcp, setup, power init, issue list
From output-styles/visual-components.md:
[1/5], [2/5]═════════════════| Skill | Relationship |
|---|---|
pop-analyze-project | Run after init |
pop-doc-sync | Keeps section in sync |
pop-plugin-test | Validates plugin |
See examples/ for:
claude-md-update.py - Full surgical update logicconfig-schema.json - PopKit config schemastatus-schema.json - STATUS.json schematier-comparison.md - Free vs Premium vs Pro features