Files
loop-loop/skills/init/SKILL.md

103 lines
2.4 KiB
Markdown

---
name: init
description: "Infrastructure setup: scaffold .loop/ directory with harness files and generate config.json. Does NOT plan or write code."
---
# /init — Scaffold the Agent Loop
Create the `.loop/` directory and generate `config.json`. That's it. This skill does NOT plan features, generate stories, or write any project source code.
## STOP: What This Skill Does NOT Do
- Does NOT read or use any spec files
- Does NOT generate prd.json or stories
- Does NOT write any source code
- Does NOT invoke /agent-loop:plan
- Does NOT start the loop
## Steps
### 1. Check if .loop/ already exists
If yes, ask: "`.loop/` already exists. Re-initialize? (This resets config but keeps prd.json and progress.md)"
If they say no, stop.
### 2. Copy harness files
Run these commands:
```bash
mkdir -p .loop
# Find plugin harness source
HARNESS_SRC=$(ls -d ~/.claude/plugins/cache/agent-loop/agent-loop/*/prompts/.. 2>/dev/null | head -1)
if [ -n "$HARNESS_SRC" ]; then
cp -r "$HARNESS_SRC/prompts" .loop/
cp -r "$HARNESS_SRC/templates" .loop/
cp -r "$HARNESS_SRC/lib" .loop/
cp "$HARNESS_SRC/loop.sh" .loop/
chmod +x .loop/loop.sh
else
echo "ERROR: Could not find agent-loop plugin files"
fi
```
Verify `.loop/prompts/generator/_base.md` exists. If not, report the error and stop.
### 3. Create .loop/.gitignore
```
prd.json
progress.md
progress-archive.md
config.json
init.sh
contracts/
triage/
archive/
.archive-staging/
.last-branch
.loop.lock
```
### 4. Detect project and generate config
Read the project root to detect tech stack (package.json, go.mod, Cargo.toml, etc.).
Ask the user:
> **Mode?** (a) Explore (b) Implement (c) Fix
Write `.loop/config.json`:
```json
{
"tool": "claude",
"mode": "<implement|explore|fix>",
"maxIterations": 20,
"skipEval": false,
"evalRetries": 2,
"autoHooks": true,
"branchPrefix": "loop/",
"scopeBudgets": {
"explore": { "maxFilesToRead": 15, "maxLinesToWrite": 0, "maxFilesToModify": 0 },
"implement": { "maxFilesToRead": 50, "maxLinesToWrite": 500, "maxFilesToModify": 10 },
"fix": { "maxFilesToRead": 30, "maxLinesToWrite": 200, "maxFilesToModify": 5 }
}
}
```
### 5. Generate init.sh
Write `.loop/init.sh` with project-specific setup (dependency install, dev server, test runner). Make it executable.
### 6. Done
Tell the user:
> `.loop/` is ready. Next steps:
> ```
> /agent-loop:plan # Generate stories from your spec or feature description
> ```