# Setup Repo

> This skill should be used when configuring a repository for groundwork - detects single-project or monorepo structure and creates .groundwork.yml

- **Type:** Skill
- **Install:** `agentstack add skill-etr-groundwork-setup-repo`
- **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/setup-repo

## Install

```sh
agentstack add skill-etr-groundwork-setup-repo
```

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

## About

# Setup Repository Skill

Configures the repository structure for Groundwork. Detects or asks whether this is a single-project repo or a monorepo, and creates `.groundwork.yml` for monorepos.

## Workflow

### Step 1: Detect Repository Structure

Look for common monorepo patterns:
- Multiple directories with their own `package.json`, `go.mod`, `Cargo.toml`, etc.
- Common monorepo directories: `apps/`, `packages/`, `services/`, `projects/`
- Existing `specs/` directory (suggests single-project)
- Workspace configuration files (`pnpm-workspace.yaml`, `lerna.json`, `turbo.json`)

### Step 2: Ask User

Use `AskUserQuestion` to confirm:

> "I've analyzed your repo structure. Is this:"
> - **Single project** — One project, specs at the repo root
> - **Monorepo** — Multiple projects, each with their own specs

If monorepo indicators were found, mention them:
> "I noticed [apps/, packages/, workspace config], which suggests a monorepo structure."

### Step 3: Configure

**If single project:**
- No config file needed
- Ensure `.groundwork-plans/` is in `.gitignore` (add it if missing) — work-on writes per-task plan files there.
- Confirm: "Single-project mode. Specs will be stored in `specs/` at the repo root."
- Proceed — no `.groundwork.yml` created.

**If monorepo:**
1. Ask which directories are projects. Suggest based on detected structure.
2. Use `AskUserQuestion` with multi-select to confirm project list.
3. Create `.groundwork.yml`:

```yaml
version: 1
projects:
  :
    path: 
  :
    path: 
```

4. Ensure `.groundwork.local` and `.groundwork-plans/` are in `.gitignore` (add any missing entries). `.groundwork-plans/` is where work-on writes per-task plan files.
5. Ask which project to start with using `AskUserQuestion`.
6. Set project context: `GROUNDWORK_PROJECT=` and `GROUNDWORK_PROJECT_ROOT=`

### Step 4: Persist Selection

For monorepo mode, persist the selection to `.groundwork.local` at the repo root (gitignored) so it survives session restarts.

Confirm: "Project **** selected. Specs will be stored in `/specs/`."

## Adding Projects Later

This skill can also be invoked to add or remove projects from an existing `.groundwork.yml`:
- Read existing config
- Present current projects
- Ask what to add/remove
- Update the config file

## Edge Cases

| Situation | Response |
|-----------|----------|
| `.groundwork.yml` already exists | Show current config, ask if user wants to modify |
| No obvious project directories | Ask user to specify paths manually |
| User says single-project but monorepo indicators exist | Accept user's choice, note the indicators |

## 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-setup-repo
- 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%.
