fix: radically simplify skills — each does exactly one thing, no chaining, explicit boundaries

This commit is contained in:
2026-03-27 09:03:47 -04:00
parent fee323a2d6
commit 53086c9dbc
2 changed files with 93 additions and 158 deletions

View File

@@ -1,38 +1,36 @@
---
name: init
description: "Setup task: scaffold .loop/ directory and generate config for the agent loop harness. Not a creative task — do not brainstorm or generate ideas. Reads existing specs if present."
description: "Infrastructure setup: scaffold .loop/ directory with harness files and generate config.json. Does NOT plan or write code."
---
# /init — Initialize Agent Loop for a Project
# /init — Scaffold the Agent Loop
Set up the agent loop harness in the current project. This is infrastructure setup, not creative work.
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.
**IMPORTANT:** Do NOT invoke brainstorming, planning, or idea-generation skills. This skill handles its own flow.
## STOP: What This Skill Does NOT Do
## Instructions
- 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
Follow these steps exactly. Do not skip or reorder them.
## Steps
### Step 1: Scaffold .loop/ Directory
### 1. Check if .loop/ already exists
Check if `.loop/` already exists in the project root.
If yes, ask: "`.loop/` already exists. Re-initialize? (This resets config but keeps prd.json and progress.md)"
**If `.loop/` already exists** and contains `prd.json`, ask the user if they want to re-initialize. If yes, delete `.loop/` and continue. If no, skip to Step 3.
If they say no, stop.
**Create `.loop/` and copy ALL required harness files.** Run these commands exactly:
### 2. Copy harness files
Run these commands:
```bash
mkdir -p .loop
```
Then check if the plugin root has the harness files. Try these paths in order:
1. `${CLAUDE_PLUGIN_ROOT}/prompts/` (if CLAUDE_PLUGIN_ROOT env var is set)
2. `~/.claude/plugins/cache/agent-loop/agent-loop/*/prompts/` (glob for any version)
Copy ALL of these directories and files — every one is required:
```bash
# Find the harness source (plugin cache)
# 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
@@ -41,19 +39,14 @@ if [ -n "$HARNESS_SRC" ]; then
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 the copy worked.** Check that these paths exist:
- `.loop/prompts/generator/_base.md`
- `.loop/prompts/evaluator/_base.md`
- `.loop/templates/progress.md.template`
- `.loop/lib/state.sh`
- `.loop/loop.sh`
Verify `.loop/prompts/generator/_base.md` exists. If not, report the error and stop.
If any are missing, tell the user the scaffold failed and show which files are missing.
Create `.loop/.gitignore`:
### 3. Create .loop/.gitignore
```
prd.json
@@ -69,41 +62,14 @@ archive/
.loop.lock
```
### Step 2: Check for Existing Specs
### 4. Detect project and generate config
Search for existing design documents or specs:
- `docs/superpowers/specs/*.md`
- `docs/specs/*.md`
- `SPEC.md`, `PRD.md`, `DESIGN.md` at root
**If a spec is found:**
> "I found an existing spec at `{path}`. I'll use this as the basis for generating stories."
Read it. The user does NOT need to re-describe what they want. Set mode to `implement` and skip to Step 4.
**If no spec is found**, proceed to Step 3.
### Step 3: Mode Selection
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
> **What would you like to do?**
>
> a) **Explore** — Read-only codebase analysis. No code changes.
> b) **Implement** — Build a feature. Code changes, commits, and tests.
> c) **Fix** — Targeted bug fixes or tech debt.
For **implement** without a spec: "Describe the feature in 1-3 sentences."
For **explore**: "What areas should I focus on?"
For **fix**: "Do you have a list of issues, or should I find them?"
Also read the project to detect the tech stack:
- Check for `package.json`, `Cargo.toml`, `pyproject.toml`, `go.mod`, etc.
- Run `ls` on the project root
### Step 4: Generate Configuration
Create `.loop/config.json` with this EXACT structure:
Write `.loop/config.json`:
```json
{
@@ -115,32 +81,22 @@ Create `.loop/config.json` with this EXACT structure:
"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
}
"explore": { "maxFilesToRead": 15, "maxLinesToWrite": 0, "maxFilesToModify": 0 },
"implement": { "maxFilesToRead": 50, "maxLinesToWrite": 500, "maxFilesToModify": 10 },
"fix": { "maxFilesToRead": 30, "maxLinesToWrite": 200, "maxFilesToModify": 5 }
}
}
```
Adjust `maxIterations` based on estimated story count (stories + 30% for rejections).
### 5. Generate init.sh
Create `.loop/init.sh` with project-specific setup commands. Make it executable.
Write `.loop/init.sh` with project-specific setup (dependency install, dev server, test runner). Make it executable.
### Step 5: Flow into Planning
### 6. Done
Say:
> "Project configured. Generating stories..."
Tell the user:
Then invoke `/agent-loop:plan`. If a spec was found in Step 2, tell the plan skill to use it.
> `.loop/` is ready. Next steps:
> ```
> /agent-loop:plan # Generate stories from your spec or feature description
> ```