一键导入
init-sh
Generate an executable init.sh that bootstraps the dev environment (install, build, test, run commands) so fresh sessions can recreate state in one command.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate an executable init.sh that bootstraps the dev environment (install, build, test, run commands) so fresh sessions can recreate state in one command.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | init-sh |
| description | Generate an executable init.sh that bootstraps the dev environment (install, build, test, run commands) so fresh sessions can recreate state in one command. |
| when_to_use | Reach for this at the start of a project, after major tooling changes (new package manager, new build step), or when a fresh session needs to recreate state in one command. Do NOT use for resuming an existing session — use `/session-resume` instead; init-sh produces the script, session-resume reads it. |
| disable-model-invocation | true |
| allowed-tools | ["Read","Write","Glob","Grep","Bash"] |
| logical | repo-root init.sh exists, is executable, idempotent, and ends with one-line written-bytes report |
Write an executable init.sh at the repo root that recreates the dev environment. Anthropic's pattern: pair it with claude-progress.txt so a fresh-context agent can catch up with two commands (bash init.sh, then read progress).
Detect stack. Read (not just glob) the files that exist:
package.json → Node. Extract the scripts.start|dev, scripts.test, scripts.build.composer.json → PHP/Laravel. Note scripts block; note artisan presence.pyproject.toml / requirements.txt → Python. Note pytest, uvicorn, fastapi.Cargo.toml → Rust. Standard cargo run / cargo test.go.mod → Go. Standard go run ./... / go test ./....Makefile → extract targets named install|setup|bootstrap|dev|test|run|start..env.example → note that it exists; agent will need to copy to .env.docker-compose.yml / Dockerfile → note container-based setup.Compose init.sh. Generate a script that:
set -euo pipefail at the top..env.example to .env if .env missing (never clobbers).Idempotency check. Every step must be safe to re-run. Use [ ! -f ], [ ! -d ], or tool-specific no-op commands (npm ci is safer than npm install for re-runs).
Write + chmod. Use Write for the file, then chmod +x init.sh via Bash.
Report — one line: init.sh written (<N> bytes). Run: bash init.sh.
set -euo pipefail, idempotent installs, .env copy guard, optional migrations, dev-server + test commands as docs[ ! -f ]/[ ! -d ] or a no-op-friendly commandchmod +x init.shinit.sh written (<N> bytes). Run: bash init.sh#!/usr/bin/env bash
# init.sh — bootstrap dev env for this repo.
# Generated by /init-sh (long-session plugin).
# Safe to re-run; each step is idempotent.
set -euo pipefail
# 1. Install deps (idempotent)
[ -f package-lock.json ] && [ ! -d node_modules ] && npm ci
[ -f composer.json ] && [ ! -d vendor ] && composer install
[ -f requirements.txt ] && [ ! -d .venv ] && python3 -m venv .venv && . .venv/bin/activate && pip install -r requirements.txt
# 2. Env file
[ -f .env.example ] && [ ! -f .env ] && cp .env.example .env
# 3. DB migrations (if applicable)
# [ -f artisan ] && php artisan migrate --force
# 4. Commands (not auto-run; documented)
echo "dev server: <command>"
echo "test: <command>"
chmod +x fails → report; don't claim success.init.sh is picked up by surface-progress.sh (SessionStart) — future sessions get a hint to run it./session-resume reads progress + spec + features; if init.sh exists, reminds the user to run it first./rest-audit Reliability axis (environment reproducibility).Use when the user describes a multi-step feature or refactor and you need to decide whether to handle it solo, dispatch a parallel `/fan-out`, or run a `/worktree-team` planner→generator→reviewer pipeline. Outputs a routing recommendation with the reasoning behind it.
Use whenever the user asks to apply the same operation to many independent files or components — bulk migration, batch refactor across controllers, parallel exploration of unrelated subsystems. Dispatches one subagent per file with a shared prompt template, then collects the results.
Use to toggle the safe-mode flag at .claude/safe-mode. The flag is written automatically by consecutive-failure-guard once tool failures hit FORGE_SAFE_MODE_THRESHOLD (default 5), and block-destructive.sh denies every Bash/Write/Edit while it exists. /safe-mode off clears the flag, logs the exit, and prompts /postmortem; /safe-mode on enters manually; /safe-mode status reports current state.
Run the 5-stage Token Transformation Pipeline (TRAE §5.2.2) over the current session state — Collection, Ranking, Compression, Budgeting, Assembly. Emits a concrete next-action recommendation (/compact, /lean-md, or /progress-log + fresh session) instead of a generic warning.
Audit or scaffold a CLAUDE.md against the Karpathy 4-section structure (Think Before Coding · Simplicity First · Surgical Changes · Goal-Driven Execution). Companion to /lean-md — structure audit, not size trim.
Print every policy enforcement point declared in plugins/diagnostics/registry/policies.json — id, verdict, plugin, hook event, severity, bypass — grouped by verdict. Single discoverable index of what the harness blocks, anchors, nudges, or logs at runtime.