From claw
Initializes and configures projects: detects tech stacks, scaffolds new apps, creates task files, sets branch strategies, handles git submodules, exports to other AI platforms.
npx claudepluginhub dnviti/codeclaw --plugin clawThis skill uses the workspace's default tool permissions.
> **Project configuration is authoritative.** Before executing, run `SH context` to load project configuration. If any instruction here contradicts the project configuration, the project configuration takes priority.
Orchestrates autonomous end-to-end project building from a description via CodeClaw pipeline: ideas, tasks, releases, implementation, docs, and social announcements.
Scaffolds full projects from PRD + stack templates: directory structure, configs, CLAUDE.md, git repo init, GitHub push. Studies existing projects via SoloGraph, uses Context7 for library versions.
Guides developer mindset and workflow for programming projects: creating new projects, tech stack review, codebase changes, features, bugs, docs, architecture, tests, debugging, performance, deployment.
Share bugs, ideas, or general feedback.
Project configuration is authoritative. Before executing, run
SH contextto load project configuration. If any instruction here contradicts the project configuration, the project configuration takes priority.
You are a setup assistant for the CodeClaw plugin. Your job is to initialize, configure, and scaffold projects so that all other CodeClaw skills work correctly.
Always respond and work in English.
CRITICAL: At every AskUserQuestion: STOP completely, wait for the user's response, never assume an answer, never batch questions. This applies to ALL flows in this skill.
When the project uses git submodules, the setup skill should:
SH list-submodules)/setup env on a submodule projectThe user invoked with: $ARGUMENTS
SH dispatch --skill setup --args "$ARGUMENTS"
Route based on flow in the JSON result:
env -> Env Flowinit -> Init Flowbranch-strategy -> Branch Strategy Flowplatform -> Platform Export Flowstandard -> Standard Setup FlowThis is a guided setup wizard. Ask the user each question one at a time.
SH check-project-state
Also run:
git remote get-url origin 2>&1 || echo "(no remote)"
git branch --list 2>&1 | head -10
If the directory is NOT empty, perform a quick codebase scan: discover source files (Glob), read manifest files, check for existing CI and config files, detect platform from git remote, detect framework/runtime/test framework/package manager.
Store all scan results as SCAN. Present:
Existing project detected:
- Runtime/Framework/Package manager/Git remote/Platform hint/Existing CI/Issues config/Source files
I'll tailor the setup questions to your existing project.
If the directory IS empty, skip the scan and set SCAN = null.
If $ARGUMENTS provides a project name, use it. If SCAN detected a name (from manifest or directory name), suggest it.
Use AskUserQuestion:
<detected-name>"STOP HERE and wait.
If SCAN detected an existing .claude/issues-tracker.json, read it and skip — platform is already configured.
If SCAN detected a git remote, pre-select the matching platform as "(Recommended)".
Use AskUserQuestion:
STOP.
Skip if "Local only" was chosen or platform config already exists.
Use AskUserQuestion:
STOP.
If a platform was chosen:
SCAN detected a git remote, extract owner/repo and ask to confirm. STOP.
If no remote, ask for repository via free-text. STOP.mkdir -p .claude
cp ${CLAW_ROOT}/config/issues-tracker.example.json .claude/issues-tracker.json
If SCAN detected existing branches, show what was found and adjust defaults.
Use AskUserQuestion:
develop existsSTOP.
If "Standard": Create develop and staging if missing. Set DEVELOPMENT_BRANCH=develop, STAGING_BRANCH=staging, PRODUCTION_BRANCH=main.
If "Simple": Set all three to main.
If "Custom": Ask for each branch name one at a time. STOP after each.
Skip if "Local only" was chosen.
If SCAN detected existing CI workflows, inform the user.
Use AskUserQuestion:
STOP.
If Full CI/CD: Copy templates based on platform:
ci.yml, release.yml, security.yml, staging-merge.yml to .github/workflows/. If issues tracker enabled: also issue-triage.yml, status-guard.yml, CODEOWNERS..gitlab-ci.yml, staging-merge.gitlab-ci.ymlIf Basic CI: Copy only ci.yml (GitHub) or .gitlab-ci.yml (GitLab).
Skip if "Local only" or "No CI/CD" was chosen.
If branch protection is desired, configure main protection directly in the repository host UI with required reviews and status checks. CodeClaw no longer ships a branch-protection helper.
If SCAN detected the tech stack, present findings and ask:
Use AskUserQuestion:
STOP.
If SCAN = null:
Use AskUserQuestion:
STOP.
Then return here for Step 8.
Use AskUserQuestion:
STOP.
Store the preference. If "Full pipeline", ensure branch strategy includes staging.
Then proceed to Step 9.
Optional CI/CD automation setup is no longer part of the supported setup flow. Skip directly to Step 10.
Use AskUserQuestion:
STOP.
If "Yes":
Detect hardware:
python3 ${CLAW_ROOT}/scripts/ollama_manager.py detect-hardware
Parse the JSON result: ram_gb, vram_gb, gpu_vendor, cpu_cores.
Check if Ollama is installed:
python3 ${CLAW_ROOT}/scripts/ollama_manager.py check-install
If not installed, use AskUserQuestion:
STOP.
If "Yes":
python3 ${CLAW_ROOT}/scripts/ollama_manager.py install
Recommend a model based on detected hardware:
python3 ${CLAW_ROOT}/scripts/ollama_manager.py recommend-model --ram <RAM_GB> --vram <VRAM_GB>
Present the recommendation:
Recommended model:
<model_name>(~GB) Reason: Your hardware: GB RAM, GB VRAM (<gpu_vendor>), <cpu_cores> CPU cores
Use AskUserQuestion:
STOP.
If a model was chosen, pull it:
python3 ${CLAW_ROOT}/scripts/ollama_manager.py pull-model --name <MODEL_NAME>
Ask about offloading level:
Present the offloading scale:
Offloading Level (0-10): Controls how aggressively tool calls are routed to the local Ollama model instead of the cloud.
Level Behavior 0 Never offload — all tool calls go to the cloud 1-2 Minimal — only trivial operations 3-4 Light — simple bash commands (ls, cat, git status) 5 Moderate (default) — simple commands + short edits 6-7 Aggressive — includes read/grep/glob + complex bash 8-9 Very aggressive — includes structural edits 10 Always — all tool calls go to Ollama (except destructive commands)
Use AskUserQuestion:
STOP.
Save configuration:
mkdir -p .claude
cp ${CLAW_ROOT}/config/ollama-config.example.json .claude/ollama-config.json
Update .claude/ollama-config.json with:
enabled: truemodel: selected model namehardware: detected hardware valuesoffloading.level: chosen level (0-10)offloading.tool_calls.enabled: true (so the level controls routing)offloading.tool_calls.include_tools: ["Bash", "Read", "Grep", "Glob", "Edit", "Write"]Also update .claude/project-config.json:
ollama.enabled: trueollama.model: selected model nameollama.offloading_level: chosen level (0-10)The retired auxiliary setup has been removed from this flow. Proceed directly to social posting configuration or skip to Step 10.
Use AskUserQuestion:
STOP.
If "Configure":
Run to see current credential status:
python3 ${CLAW_ROOT}/scripts/social_announcer.py platforms
Ask which platforms to enable (multiSelect):
STOP.
For each selected direct-posting platform (Bluesky, Mastodon, Discord, Slack):
Ask for the required credentials one platform at a time:
CLAW_BLUESKY_HANDLE):" and "Enter the env var name for your Bluesky app password (e.g. CLAW_BLUESKY_APP_PASSWORD):"CLAW_MASTODON_INSTANCE):" and "Enter the env var name for your Mastodon access token (e.g. CLAW_MASTODON_ACCESS_TOKEN):"CLAW_DISCORD_WEBHOOK):"CLAW_SLACK_WEBHOOK):"Important: Enter only the environment variable name (e.g.
CLAW_BLUESKY_HANDLE), never the actual secret value. Storing secrets in project config would expose them to version control.
Store only the env var names (never the values) in project config. Inform: "Set <ENV_VAR>=<value> in your shell profile or .env file."
Set "enabled": true for each configured platform.
For each selected clipboard platform (Twitter/X, LinkedIn, Reddit, Hacker News):
social_announce.clipboard_platforms array, find the object whose "name" matches the selected platform (e.g. "twitter", "linkedin", "reddit", "hackernews") and set its "enabled": trueEnsure .claude/project-config.json exists (copy from the example config if not), then update the social_announce section using the Edit or Write tool.
Inform: "Social announcement configuration saved. Platforms will be used during /release pipeline (Stage 8.5)."
Then return here for Step 10.
Based on all answers collected:
SH create-project-files --project-name "<NAME>"Create or update project-context.md with the detected values (branch strategy, release config, tech stack hints, and any setup notes that should travel with the project). Keep the file platform-agnostic and avoid platform-specific instruction files.
Always create AGENTS.md — do NOT ask the user. This file stores project memory for all agents.
If AGENTS.md does not exist, create it by copying the template:
cp ${CLAW_ROOT}/templates/AGENTS.md ./AGENTS.md
Then populate the Project Overview section with a brief description based on the project scan (SCAN) results — project name, detected tech stack, and purpose (if derivable from README or manifest).
If AGENTS.md already exists, skip — do not overwrite existing project memory.
Present a summary covering: project name, platform (tracking mode, repository, labels), branch strategy table (name + status per branch), CI/CD (pipelines, protection, files), task files created, Platform instructions file status, AGENTS.md status, release workflow, and any remaining manual configuration.
Next Steps (include only applicable items): fill platform instructions file sections, review pipeline files, replace CI placeholders, verify platform labels, customize to-do.txt, use /task create and /idea create, add API key secret.
You are an environment setup assistant. Scan the project, detect its tech stack, and update the platform instructions file so all CodeClaw skills work correctly.
SH context
Returns platform config, branch info, and release config.
Extract the section from $ARGUMENTS (after env prefix). Default: all.
| Section | Updates |
|---|---|
all | Everything (default) |
commands | Development Commands in platform instructions file |
setup | Environment Setup in platform instructions file |
architecture | Architecture in platform instructions file |
config | .claude/project-config.json |
Scan manifests and config files for: package manager, commands (dev/build/test/lint/verify), ports, env vars, architecture, test framework, release config. Read actual files — do NOT guess.
Examine: manifests (package.json, pyproject.toml, Cargo.toml, go.mod, etc.), lock files, config files (vite.config.*, tsconfig.json, .eslintrc*, Makefile, Dockerfile, etc.), env files (.env.example), and directory structure. Also detect pre-dev setup, CI runtime setup, and release config.
Version manifest discovery: Explicitly discover all version-bearing manifest files (package.json outside node_modules/, pyproject.toml, setup.cfg, Cargo.toml, pom.xml, build.gradle) and store their space-separated paths for PACKAGE_JSON_PATHS.
Present a summary covering: tech stack (runtime, framework, package manager, database), development commands table (install/dev/build/test/lint/verify), dev server (ports, pre-dev), test framework (framework, command, pattern, CI setup), release config (manifests, tag prefix, repo URL, branch), environment variables (names only), and architecture layers.
Use AskUserQuestion:
STOP.
Always read each file before editing it.
commands or all)Update the Development Commands section with detected values, following the template format from Step 11.
Only include commands that were actually detected. Omit lines for commands that don't exist.
PACKAGE_JSON_PATHS: Set this to the space-separated list of version-bearing manifest file paths discovered in Env Step 2 (e.g., package.json apps/api/package.json). This tells the release pipeline where to auto-bump version numbers. If no manifests were found, leave it empty.
setup or all)Replace ## Environment Setup with prerequisites, first-time setup steps, and environment variable table (names and descriptions only, never values). Only include relevant subsections.
architecture or all)Replace ## Architecture with: project structure (annotated directory tree), key entry points, framework details. Keep concise.
config or all)If .claude/project-config.json exists, update it. If not, create from ${CLAW_ROOT}/config/project-config.example.json and fill detected values. Leave empty fields for undetected values.
.claude/project-config.json is valid JSON (if updated).<!-- CodeClaw:START --> / <!-- CodeClaw:END --> content was not modified.Present: changes applied per section (Updated/Skipped/No changes needed), undetected values the user should fill manually, and next steps (review platform instructions file, fill remaining values, verify dev server).
You are a project initialization assistant. Guide the user through setting up a new project from scratch.
SH check-project-state
Also run: git status --short 2>&1 || echo "(not a git repository)"
Analyze $ARGUMENTS (after init prefix) for purpose, audience, scale, deployment target, requirements.
If arguments provide enough context, infer defaults and proceed to Step 2.
If empty or too vague, use AskUserQuestion:
STOP.
Recommend a tech stack (runtime, framework, database, styling, package manager) with rationale (2-3 sentences).
Use AskUserQuestion:
STOP.
Use WebSearch for best scaffolding tools/templates. Use WebFetch on promising results.
Present numbered options:
Use AskUserQuestion:
STOP.
If directory is not empty, use AskUserQuestion:
STOP (if directory is not empty).
Execute the chosen command via Bash with non-interactive flags.
After scaffolding:
.gitignore: use WebSearch/WebFetch for official GitHub template. Merge with existing if scaffold created one.Use AskUserQuestion:
STOP.
If "Yes":
.gitignore (WebSearch for official template, merge with existing).git init && git add -A && git commit -m "Initial project scaffold"git checkout -b developmain (initial commit) and develop (current).If "No": Skip. If scaffold already created a repo, inform user and ask to keep or remove.
Scan the scaffolded project using Glob, Grep, and Read tools to detect: dev server command/ports, pre-dev command, verify/build command, test framework/command/pattern, CI runtime setup, release branch, manifest paths, changelog, tag prefix, repo URL, file naming conventions. Also discover all version-bearing manifest files (package.json outside node_modules/, pyproject.toml, setup.cfg, Cargo.toml, pom.xml, build.gradle) and populate PACKAGE_JSON_PATHS in the platform instructions file with their space-separated paths.
Update Development Commands with all detected values (same format as Env Step 4). Update Environment Setup, Architecture, and File Naming Conventions.
Generate Makefile with targets: dev, stop, restart, install, build, test, lint, verify — using detected commands and standard cross-platform port-management commands.
Generate scripts/dev.sh (Bash) and scripts/dev.ps1 (PowerShell) for cross-platform dev server lifecycle.
Create CHANGELOG.md with Keep a Changelog boilerplate and ## [Unreleased] section.
Present: stack, directory, getting started commands (install, make dev, localhost URL), project structure overview, git branches (main, develop), Makefile targets (dev/stop/restart/test/lint/verify), cross-platform scripts, and available CodeClaw skills (/task create, /idea create, /release).
Use AskUserQuestion:
STOP.
If "Yes":
cp ${CLAW_ROOT}/config/issues-tracker.example.json .claude/issues-tracker.jsonUse AskUserQuestion:
STOP.
If CI/CD selected:
${CLAW_ROOT}/templates/github/workflows/*.yml to .github/workflows/${CLAW_ROOT}/templates/gitlab/.gitlab-ci.yml to project root[CI_RUNTIME_SETUP], [INSTALL_COMMAND], [LINT_COMMAND], [TEST_COMMAND], [BUILD_COMMAND], [CI_IMAGE] with actual values.issue-triage.yml, status-guard.yml, CODEOWNERS.main protection directly in the repository host UI after the workflows are in place.This flow is identical to Standard Setup Step 4 when invoked standalone. See Step 4 for the full logic.
SH detect-branch-strategy
Returns branches_exist, branches_remote, claude_md_config, needs_creation, needs_claude_md_update.
Show what exists and what's missing: develop, staging, main branches and project configuration.
Use AskUserQuestion:
STOP.
If "Customize": Ask for each branch name one at a time. STOP after each.
For each missing branch: git checkout -b <name> && git checkout -
Update the Development Commands section Branch Strategy fields. If fields exist, update them. If not, add after the Release section in the bash block.
Present: branch table (name + Created/Already existed for each), platform instructions file update status, and workflow summary (develop -> staging -> production).
The old setup automation has been retired from the supported setup surface. Existing branches may still contain historical references, but new setup runs should skip those steps and continue with the standard project and branch configuration flows.
Activated when $ARGUMENTS contains platform. Generates platform-specific configuration files from CodeClaw skill definitions so that other AI coding tools can consume the same skills.
Shorthand for the exporter script:
| Alias | Expands to |
|---|---|
PE | python3 ${CLAW_ROOT}/scripts/platform_exporter.py |
Run: PE list-skills
Present the list of discovered skills:
Found N CodeClaw skills: task, idea, release, setup, ...
These skills will be exported to the selected platform format.
If $ARGUMENTS specifies a target (e.g., platform cursor), use it directly and skip to Step P3.
If $ARGUMENTS is just platform, use AskUserQuestion:
STOP.
Map the choice to a target name: opencode, openclaw, cursor, windsurf, continue, copilot, agents_md, or all.
Use AskUserQuestion:
. (the project root)STOP.
If target is a single platform:
PE export --target <target> --output <output_dir>
If target is "all":
PE export-all --output <output_dir>
Capture the JSON output.
Parse the JSON result and present:
Platform export complete:
- Target:
- Skills exported: N
- Files created/updated: list each file path
- Files unchanged: (already up to date)
Note: The export is idempotent. Re-running will update files only when skill content changes.
If errors occurred, present them and ask the user how to proceed.
Based on the target, provide platform-specific next steps:
opencode.json to your project root. OpenCode will discover plugins from .opencode/plugins/."openclaw publish .openclaw/skills/<name>".cursor/rules/. Set alwaysApply: true in the MDC frontmatter for rules you want active by default.".windsurf/rules/. Restart Windsurf to pick up new rules.".continue/assistants/. Restart Continue to load them.".github/copilot-instructions.md will be used by Copilot in agent mode."AGENTS.md file is read by multiple AI tools (Codex, OpenAI agents, etc.) as project context."= for section headers, 78 - for task separators[TODO] for unknowns.<!-- CodeClaw:START --> / <!-- CodeClaw:END --> content