# Pit Builder

> A Claude skill from srinidhis05/agentura.

- **Type:** Skill
- **Install:** `agentstack add skill-srinidhis05-agentura-pit-builder`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [srinidhis05](https://agentstack.voostack.com/s/srinidhis05)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [srinidhis05](https://github.com/srinidhis05)
- **Source:** https://github.com/srinidhis05/agentura/tree/main/skills/incubator/pit-builder
- **Website:** https://agenturaai.tech

## Install

```sh
agentstack add skill-srinidhis05-agentura-pit-builder
```

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

## About

# Pit Builder Agent

## MANDATORY EXECUTION RULE

**NEVER produce a text-only response.** Every single response you give MUST include at least one tool call (Bash, Write, Read, Edit, or Glob). If you want to explain what you're doing, include the explanation AND a tool call in the same response. A response with only text and no tool call will TERMINATE your execution immediately and the task will FAIL. This is a hard constraint of the runtime — not a suggestion.

Your execution is ONLY successful when you have written `TASK_RESULT.json` containing a valid `pr_url`. Any execution that ends without this file is a FAILURE.

## Task

Create a new "pit" (mini-project) in the **backend-api** Spring Boot backend repo from a structured spec. Clone → read harness → create code → build → push → PR → report. All in one continuous flow.

## Input Format

```json
{
  "feature_name": "expense-tracker",
  "pit_name": "expense_tracker",
  "pit_name_hyphenated": "expense-tracker",
  "backend_spec": {
    "base_path": "/api/v1/expense-tracker",
    "endpoints": [...],
    "documents": [...],
    "properties": { "prefix": "expense-tracker", "fields": {...} }
  },
  "feedback": "(optional) PM feedback for refinement",
  "backend_branch": "(optional) existing branch name for refinement"
}
```

## Execution — One Continuous Flow

Do ALL of the following in order. Do NOT stop between steps. Do NOT summarize between steps. After each step, immediately proceed to the next step's tool calls.

### Step 1: Clone and branch

```bash
git clone https://x-access-token:${GITHUB_TOKEN}@github.com/your-org/backend-api.git /tmp/backend-api
cd /tmp/backend-api
```

If `backend_branch` is provided: `git checkout `
Otherwise: `git checkout -b feat/pit-`

### Step 2: Read the harness (4 files max)

Read these files — they tell you HOW to build:
1. `CLAUDE.md`
2. `DECISIONS.md` (if exists)
3. `GUARDRAILS.md` (if exists)
4. `.claude/skills/pits/SKILL.md`

### Step 3: Create all pit files

Follow `.claude/skills/pits/SKILL.md` step by step:
1. Properties — `@ConfigurationProperties(prefix = "")`
2. Config — `@EnableConfigurationProperties`
3. ExceptionHandler — `@ControllerAdvice` scoped to `projects..controller`
4. Controller — `@RequestMapping("")` with all endpoints
5. Service — business logic for each endpoint
6. DTOs — request/response for each endpoint
7. Documents — `@Document` classes from `backend_spec.documents`
8. Repository — `MongoRepository` interfaces
9. application.yml — config under `:` namespace
10. README.md — endpoint table and error codes

For refinement runs (`backend_branch` present), only change what `feedback` describes.

### Step 4: Build — IMMEDIATELY after creating files, run:

```bash
cd /tmp/backend-api && ./gradlew build -x test
```

If it fails, fix and rebuild. Common issues:
- Missing imports → check existing pits
- Wrong Jackson imports → `com.fasterxml.jackson`, never `tools.jackson`
- Cross-project imports → each pit is isolated

### Step 5: Build, Push, and Deliver — ALL IN ONE FLOW

Run these commands in sequence. Do NOT stop between them. Execute everything in a single continuous bash session:

Once the build passes, IMMEDIATELY continue — do NOT summarize or stop:

```bash
cd /tmp/backend-api

# Commit and push
git add projects//
git add src/main/resources/application.yml
git commit -m "feat: add  pit — "
git push --force-with-lease origin feat/pit-

# Create PR
gh pr create \
  --repo your-org/backend-api \
  --base pre-prod \
  --head feat/pit- \
  --title "feat: add  pit" \
  --body "## Summary
Created  pit from incubation spec.

### Endpoints

### Checklist
- [x] Properties with @ConfigurationProperties
- [x] Config with @EnableConfigurationProperties
- [x] ExceptionHandler scoped to project controllers
- [x] @Timed on every endpoint
- [x] Responses wrapped in ApiEnvelope
- [x] README.md with endpoint docs
- [x] ./gradlew build -x test passes
- [x] No cross-project imports

Generated by Agentura incubator pipeline."
```

Then IMMEDIATELY write TASK_RESULT.json with the PR URL:

```bash
cat > /home/worker/workspace/TASK_RESULT.json  pit with N endpoints. PR: ",
  "pr_url": "",
  "branch": "feat/pit-",
  "endpoints_created": ,
  "files_created": ["list of files"]
}
RESULT_EOF
```

## Guardrails

- NEVER hardcode GITHUB_TOKEN — use `${GITHUB_TOKEN}` env var.
- ALWAYS read harness docs before writing code.
- ALWAYS use `@Timed` on every controller endpoint.
- ALWAYS wrap responses in `ApiEnvelope` via `EnvelopeUtil`.
- NEVER import from another pit's package.
- NEVER use `tools.jackson` — always `com.fasterxml.jackson`.
- ALWAYS use `--force-with-lease` when pushing.
- NEVER produce a text-only response — always include a tool call.

## Source & license

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

- **Author:** [srinidhis05](https://github.com/srinidhis05)
- **Source:** [srinidhis05/agentura](https://github.com/srinidhis05/agentura)
- **License:** Apache-2.0
- **Homepage:** https://agenturaai.tech

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-srinidhis05-agentura-pit-builder
- Seller: https://agentstack.voostack.com/s/srinidhis05
- 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%.
