# Build Unplanned

> Build a feature from description with worktree isolation and TDD. Usage /groundwork:build-unplanned "Add user login

- **Type:** Skill
- **Install:** `agentstack add skill-etr-groundwork-build-unplanned`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [etr](https://agentstack.voostack.com/s/etr)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [etr](https://github.com/etr)
- **Source:** https://github.com/etr/groundwork/tree/main/skills/build-unplanned

## Install

```sh
agentstack add skill-etr-groundwork-build-unplanned
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Build Unplanned Feature

Thin orchestrator for ad-hoc feature development without existing task definitions. Delegates to `plan-task` (blurb mode), `implement-task`, and `validate`.

## Token Discipline

This skill orchestrates long multi-agent workflows. Every turn re-reads the full context window, so unnecessary turns are expensive.

1. **No narration turns.** Do not output text-only turns like "Let me understand your feature" or "Now I'll dispatch implementation." Combine text with a tool call in the same turn, or skip the text entirely.
2. **Batch tool calls.** When multiple tool calls are independent, issue them all in one turn.
3. **No waiting updates.** Do not output "Waiting for results..." turns. Wait silently until results arrive.
4. **Keep context lean.** Do not read file contents you won't use directly. Pass file paths to subagents and let them read in their own context windows.

## Pre-flight: Model Recommendation

**Your current effort level is `{{effort_level}}`.**

Skip this step silently if effort is `high`, `xhigh`, or `max` (the scale is `low`  "You're working from `` (inside **[cwd-project]**), but the selected Groundwork project is **[selected-project]** (`[selected-project-path]/`). What would you like to do?"
     > - "Switch to [cwd-project]"
     > - "Stay with [selected-project]"
     If the user switches, invoke `Skill(skill="groundwork:select-project")`.
   - If CWD doesn't match any project → proceed without warning (shared directory).
3. Proceed with the resolved project context.

## Step 1: Parse Feature Description

- **Argument provided:** Use the argument text as the feature blurb.
- **No argument:** Use `AskUserQuestion` to ask:
  > "What feature would you like to build? Describe it briefly."

## Step 2: Plan → `plan-task`

Call `Skill(skill="groundwork:plan-task")` with the blurb from Step 1 in the conversation context. Do NOT pass a task_id — this triggers blurb/feature mode in plan-task, which will:
- Load existing specs (if any)
- Call `understanding-feature-requests` for requirement clarification
- Generate a `FEATURE-` identifier
- Spawn a Plan agent and persist the plan

**Parse the output:**
- `RESULT: PLANNED | plan_file_path= | identifier= | branch_prefix=` → Save `plan_file_path`, `identifier`, `branch_prefix`. Proceed.
- `RESULT: FAILURE | ...` → Report the failure to the user and stop.

### Step 2.5: Confirm Start

Use `AskUserQuestion`:

> "[identifier] — plan ready. Proceed to implementation?"
> - Option 1: "Yes, begin implementation"
> - Option 2: "Stop here — I'll review the plan first"

**If "Stop here":** Print the plan file path and stop:

    Plan saved to: 
    
    To resume implementation later:
    /groundwork:implement-task 

## Step 3: Implement → `implement-task`

Call `Skill(skill="groundwork:implement-task")` with `plan_file_path` in the conversation context. Do NOT pass a task_id.

**Parse the output:**
- `RESULT: IMPLEMENTED | worktree_path= | branch= | base_branch=` → Save values. Proceed.
- `RESULT: FAILURE | ...` → Report failure to the user and stop.

### Step 3.5: Optional Context Clear Pause

Use `AskUserQuestion`:

> "Implementation complete for [identifier]. Validation runs 9 reviewer agents next and can compound context. Clear context before validation?"
> - Option 1: "Continue to validation now"
> - Option 2: "Stop here — I'll clear and resume manually"

**If "Continue to validation now":** Proceed to Step 4.

**If "Stop here":** Print resume instructions and STOP:

    ## Paused before validation

    Implementation is committed in:
    - **Worktree:** ``
    - **Branch:** ``
    - **Base branch:** ``

    To resume validation in a clean context:

    1. Run `/clear` to clear Claude Code context
    2. `cd `
    3. Run `/groundwork:validate`

    After validation passes, merge manually from the project root:

        cd 
        git checkout 
        git merge --no-ff 
        git worktree remove 
        git branch -d 

## Step 4: Validate

1. `cd` into the worktree path from Step 3
2. Call: `Skill(skill="groundwork:validate")`
3. The validate skill will run 9 verification agents in parallel and fix issues autonomously.

**After validate completes:**
- All agents approved → Proceed to Step 5
- Validation failed → Report failure and worktree location for investigation, stop
- Stuck on recurring issue → Report the stuck finding and stop

## Step 5: Merge Decision

**From the project root** (NOT the worktree), handle merge:

Use `AskUserQuestion` to ask:

> "Implementation and validation complete for [identifier]. Would you like me to merge this into [base-branch] now?"
> - Option 1: "Yes, merge now"
> - Option 2: "No, I'll merge manually later"

**Wait for user response before proceeding.**

**If merging:**

1. Ensure you are in the project root (cd out of worktree if needed)
2. Checkout base branch: `git checkout `
3. Merge: `git merge --no-ff  -m "Merge : [Feature Title]"`
4. If success: Remove worktree and delete branch:
   ```bash
   git worktree remove .worktrees/
   git branch -d 
   ```
5. If conflicts: Report conflicts and keep worktree for manual resolution

**If not merging or conflicts occurred:**

```markdown
## Implementation Complete in Worktree

**Location:** .worktrees/
**Branch:** feature/

When ready to merge:
```bash
git checkout [base-branch]
git merge --no-ff 
git worktree remove .worktrees/
git branch -d 
```

To continue working:
```bash
cd .worktrees/
```
```

## Step 6: Report

Output implementation summary:

```markdown
## Feature Complete: [identifier]

**What was done:**
- [summary]

**Validation:** Passed ([N] iteration(s))

**Worktree status:** [Merged to  | Pending at .worktrees/]
```

Output the final result line:

```
RESULT: SUCCESS | [one-line summary]
```

---

## Reference

### Branch Naming

This skill uses `feature/` prefix (not `task/`) to distinguish ad-hoc features from planned tasks:
- Planned tasks: `task/TASK-NNN`
- Ad-hoc features: `feature/FEATURE-`

### Standalone Usage

This skill is designed for standalone use when:
- No product specs exist
- No task definitions exist
- Quick prototyping is needed
- Ad-hoc feature requests come in

For planned work with existing specs, use `groundwork:work-on` instead.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [etr](https://github.com/etr)
- **Source:** [etr/groundwork](https://github.com/etr/groundwork)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-etr-groundwork-build-unplanned
- Seller: https://agentstack.voostack.com/s/etr
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
