Skip to content
Back to skills

Harness Setup

ASecurity

Generate a Claude Code harness for any project. Scans your actual code to create tailored CLAUDE.md, settings.json, and safety hooks. Run /shipwithai-harness:setup

  • 10 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added August 31, 2026
developmentgobashtestingdatabase

Works with

  • claude code

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned August 31, 2026

npx -y skills add ShipWithAI/shipwithai-plugins --skill harness-setup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Harness Setup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Harness Setup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/shipwithai-harness-setup/badge)](https://www.skillsdirectory.com/skills/shipwithai-harness-setup)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: harness-setup
description: "Generate a Claude Code harness for any project. Scans your actual code to create tailored CLAUDE.md, settings.json, and safety hooks. Run /shipwithai-harness:setup"
version: 2.0.0
license: MIT
---

# Harness Setup

Analyze your project and generate a production-ready Claude Code harness.
Works for **any stack** — reads your actual code instead of filling templates.

## When to Use

- Project missing a CLAUDE.md, or existing one is generic/outdated
- Need settings.json with balanced permission rules
- Want validate-command.py + protect-files.py safety hooks

## Step 0: Check for Existing CLAUDE.md

If `CLAUDE.md` exists and has content:

Ask: "Found existing CLAUDE.md. **Overwrite** with new harness, or **skip**?"
- Skip → stop
- Overwrite → continue

## Step 1: Deep Project Scan (parallel reads)

Read `references/analysis-guide.md` for extraction instructions. Then run all reads **simultaneously**.

**Read whichever of these exist:**
- Root config files: `package.json`, `pom.xml`, `pyproject.toml`, `go.mod`, `Cargo.toml`,
  `composer.json`, `Gemfile`, `build.gradle`
- `Makefile` (if exists)
- `.env.example` (if exists)
- Directory structure: glob `**` to depth 2
- One representative source file (entry point or a typical service/controller)
- One test file (look in `tests/`, `test/`, `spec/`, `src/test/`, `__tests__/`)

**After reading, extract answers to:**

| Question | Source |
|---|---|
| Stack | Config files + deps (see analysis-guide.md §Stack Identification) |
| Run/build/test/lint commands | `scripts` in package.json, Makefile targets, pom.xml goals |
| Directory structure | Glob result — top 3–5 meaningful dirs |
| ORM/database | Deps + schema file location |
| Env vars needed | `.env.example` or grep `process.env.`/`os.getenv(` in source |
| Test framework + location | Test file imports + directory name |
| Package manager | Lockfile presence: `bun.lockb`→bun, `pnpm-lock.yaml`→pnpm, `yarn.lock`→yarn, else npm |
| Port | Dev script, `application.properties:server.port`, or stack default |

**Show summary before asking questions:**

```
🔍 Scan complete

Stack:     Go (Gin framework)
Commands:  run: go run ./cmd/... | test: go test ./... | lint: golangci-lint run
Structure: cmd/, internal/, pkg/, migrations/
Database:  GORM — models in internal/models/
Tests:     Go testing (testify) in *_test.go files
Port:      8080
Env vars:  DATABASE_URL, JWT_SECRET, PORT
```

## Step 2: Ask 2 Questions

**Q1 (required):** "Describe your project in one sentence."

**Q2 (optional):** "Any conventions Claude should follow that aren't visible in the code?
Leave blank to skip."

## Step 3: Generate Harness Files

**Write all content from your scan findings. Do not use templates.**

### 3a. CLAUDE.md

Write from scratch using what you found. Include only verified facts:
- **Header:** project name (from config or dirname), description (Q1 answer), stack, date
- **Commands:** exact commands found — never assume defaults
- **Architecture:** actual directory names with one-line descriptions
- **Database:** ORM name + schema file path (omit if none detected)
- **Environment:** env var names from .env.example or source scan (omit if none found)
- **Conventions:** Q2 answer (omit entire section if Q2 was left blank)

**Hard cap: 200 lines. Zero unfilled placeholders.**

### 3b. .claude/settings.json

1. Read `assets/base-settings.json`
2. Read `references/toolchain-rules.md` — add the rows that match your scan findings
3. Merge and write to `.claude/settings.json`

### 3c. Safety hooks

```bash
mkdir -p .claude/hooks
```

Copy `assets/hooks/validate-command.py` → `.claude/hooks/validate-command.py`
Copy `assets/hooks/protect-files.py` → `.claude/hooks/protect-files.py`

```bash
chmod +x .claude/hooks/validate-command.py .claude/hooks/protect-files.py
```

### 3d. docs/ARCHITECTURE.md

Write from scan findings (30–50 lines):
- Stack + key dependency versions detected
- Directory map with one-line descriptions per dir
- Entry point(s)
- Data layer summary

## Step 4: Validate and Show Output

```bash
grep -c '{{' CLAUDE.md || true   # Must be 0 — no unfilled placeholders
wc -l CLAUDE.md                   # Must be ≤ 200
ls -la .claude/hooks/             # Must show -rwxr-xr-x for both .py files
```

Show:

```
✅ Harness generated

Files created:
  CLAUDE.md               ← tailored to your project
  .claude/settings.json   ← customized for your toolchain
  .claude/hooks/validate-command.py
  .claude/hooks/protect-files.py
  docs/ARCHITECTURE.md    ← architecture snapshot

Run /shipwithai-harness:doctor to verify health
```

Files in this skill

  • SKILL.md4.6 KB
  • assets/base-settings.json1.2 KB
  • assets/hooks/protect-files.py1.2 KB
  • assets/hooks/validate-command.py1.7 KB
  • evals/evals.json2 KB
  • references/analysis-guide.md3.5 KB
  • references/phase-model.md1.8 KB
  • references/toolchain-rules.md2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.