# The Pradhya Workbench Pack

A drop-in set of Claude Code primitives that add the **seven reliability
surfaces** around a capable model. Companion artifact to the **Agent Workbench**
practice (Pradhya Practice 20). Original Pradhya work — copy it into any repo.

## The seven surfaces → what ships them

| Surface | File |
|---|---|
| Instructions | `CLAUDE.md` (router + operational rules) |
| State / memory | `state.md` |
| Scope | `tasks.md` (`scope:` line) + `hooks/scope-guard.py` |
| Feedback | `hooks/feedback-log.py` → private runtime log (outside the worktree) |
| Verification | `commands/verify.md` (`/verify`) |
| Review | `agents/reviewer.md` (read-only reviewer subagent) |
| Handoff | `commands/handoff.md` (`/handoff`) |

## Install

From the repo you want to harden:

```bash
bash /path/to/workbench/install.sh        # or pass a target dir as $1
```

The installer is idempotent — it maps these files into your repo's `.claude/`
(and writes `CLAUDE.md`, `state.md`, `tasks.md` at the root) and never
overwrites a file you've already filled in.

The feedback hook does **not** create a tracked `feedback.jsonl`. Its default
log is `.git/pradhya-workbench/feedback.jsonl`, which keeps runtime state out of
your deliverable and out of `git status`. See its resolved location or most
recent safe record with:

```bash
python3 .claude/hooks/feedback-log.py --path
python3 .claude/hooks/feedback-log.py --last
```

Each record contains only a UTC timestamp, a coarse executable category, and
the exit status. Command arguments and output are not persisted because they
may contain credentials or private data. To choose an explicit location, set
`PRADHYA_FEEDBACK_LOG` to a path outside the working tree. For synthetic
exercises only, setting
`PRADHYA_FEEDBACK_INCLUDE_ERROR=1` adds one short, best-effort-redacted stderr
line; redaction cannot guarantee that arbitrary secrets are removed.

## Layout in this pack vs. once installed

This pack ships with plain directory names so the files are easy to browse.
`install.sh` places them where Claude Code reads them:

```
this pack/                 ->   your repo after install/
  settings.json            ->     .claude/settings.json
  agents/reviewer.md       ->     .claude/agents/reviewer.md
  commands/verify.md       ->     .claude/commands/verify.md
  commands/handoff.md      ->     .claude/commands/handoff.md
  hooks/scope-guard.py     ->     .claude/hooks/scope-guard.py
  hooks/feedback-log.py    ->     .claude/hooks/feedback-log.py
  CLAUDE.md                ->     CLAUDE.md          (repo root)
  state.md                 ->     state.md           (repo root)
  tasks.md                 ->     tasks.md           (repo root)
```

The runtime feedback log is created on the first Bash result; it is not copied
by the installer or committed with the project.

## Adapt it

- Change the `done when:` default in `tasks.md` to your real test command.
- Change the `scope:` globs to your real layout.
- The hooks fail **open** — a missing or template `tasks.md` never blocks edits.
  Scope only bites once you write a real `scope:` line.
- Keep the feedback log metadata-only on real projects. If a task needs the
  full error, read that command's direct tool result instead of persisting it.
