Tiny Broccoli: Implement → Check → Commit → Dedup
Use this when the user request is already clear and you can safely implement directly (no plan docs), but you still want:
- repo checks to be green, and
- a dedupe pass over the resulting diff.
Not for
- Big/ambiguous work that needs research, design decisions, or a multi-phase plan.
- “Refactor the whole repo” style requests.
Preconditions (hard stop if missing)
- Confirm you are in the intended repo:
git rev-parse --show-toplevel
- Start from a clean working tree:
git status --porcelain is empty
- Ensure git can create commits (
user.name / user.email configured)
- Ensure required CLIs exist (dedup requires distinct vendors):
codex, claude
Required subskills
Workflow
0) Record BASE_SHA (required)
Capture the base ref before any changes (used later for dedup):
BASE_SHA="$(git rev-parse HEAD)"
1) Choose the repo check command(s) once (required)
Do a one-time tooling detection + configuration so the per-step “build/lint” commands match the target repo.
Detect languages and entrypoints
- Node/TS: look for
package.json in repo root and common subprojects (for example functions/package.json).
- Python: look for
pyproject.toml, uv.lock, poetry.lock, requirements.txt.
Pick build/lint/typecheck commands (prefer repo-native scripts)
- Prefer existing package scripts when present (e.g.
npm run build, npm run lint, npm test).
- Prefer the repo’s configured Python toolchain:
- If
uv is clearly in use: use uv-based commands.
- If Poetry is clearly in use: use
poetry run ....
- If neither: use the repo’s documented commands (README/CONTRIBUTING) if available.
- If multiple options exist or it’s unclear, ask the user once for the canonical build/lint/typecheck commands, then reuse them for every step.
Write down a “Tooling config” block and reuse it for every step
- Example format (adapt to the repo):
- Root (Node): build=
..., lint=...
- functions/ (Node): build=
..., lint=...
- Root (Python): build=
..., typecheck=..., lint/format=...
- From now on, only run the commands from this block after each step (instead of hard-coded defaults).
If the repo has no build/lint tooling
- Explicitly record “No build/lint configured” and skip build/lint steps (do not invent tooling). Call this out in the final summary.
2) Implement the requested change (required)
- Make the smallest correct change that satisfies the request.
- Prefer reusing existing patterns/utilities over creating new ones.
- Keep the change set small and reviewable.
3) Run repo checks and fix only what you broke (required)
- Run the commands from your Tooling config.
- If checks fail due to changes you introduced, fix and re-run until green.
- If checks fail for clearly pre-existing/unrelated reasons, stop and report:
- the exact command(s) you ran, and
- the first actionable error output.
4) Commit once checks are green (required)
git add -A
- Make a single atomic commit for the user-requested change:
git commit -m "<imperative summary>" (example: Fix flaky upload retry).
- Do not create empty/no-op commits (
--allow-empty is prohibited).
5) Run dedup against BASE_SHA (required)
Ensure the working tree is clean, then run the dedupe loop:
if [ -n "$(git status --porcelain)" ]; then
echo "Working tree is not clean; commit or stash before running dedup." >&2
exit 1
fi
resolve_skill_dir() {
local name="$1"
local repo_root=""
repo_root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
local candidates=(
"$repo_root/.agents/skills/$name"
"$repo_root/.claude/skills/$name"
"$HOME/.agents/skills/$name"
"$HOME/.codex/skills/$name"
"$HOME/.claude/skills/$name"
)
for d in "${candidates[@]}"; do
if [[ -d "$d" ]]; then
echo "$d"
return 0
fi
done
echo "Error: skill '$name' not found in repo-scoped or user-scoped skill dirs." >&2
return 1
}
DEDUP_SKILL_DIR="$(resolve_skill_dir dedup)"
python3 "$DEDUP_SKILL_DIR/scripts/run_dedup_loop.py" "${BASE_SHA}"
If dedup creates additional commits, re-run the Tooling config checks once at the end and fix only issues introduced by dedupe changes.
Do not interrupt/restart the dedup loop if it looks quiet; the loop script owns timeouts and retries.
Guardrails
- Keep changes tightly scoped to the user request + required dedupe.
- Avoid drive-by refactors, renames, formatting-only churn, or dependency upgrades unless required.
- End state must be: checks green (or explicitly “no checks configured”), clean working tree, and at least one meaningful commit.
1---2name: besimple-tiny-broccoli3description: Small-change wrapper: implement → run repo checks → atomic commit → run dedup (BASE_SHA..HEAD).4---56# Tiny Broccoli: Implement → Check → Commit → Dedup78Use this when the user request is already clear and you can safely implement directly (no plan docs), but you still want:91) repo checks to be green, and102) a dedupe pass over the resulting diff.1112## Not for1314- Big/ambiguous work that needs research, design decisions, or a multi-phase plan.15- “Refactor the whole repo” style requests.1617## Preconditions (hard stop if missing)1819- Confirm you are in the intended repo: `git rev-parse --show-toplevel`20- Start from a clean working tree: `git status --porcelain` is empty21- Ensure git can create commits (`user.name` / `user.email` configured)22- Ensure required CLIs exist (dedup requires distinct vendors): `codex`, `claude`2324## Required subskills2526- `dedup`2728## Workflow2930### 0) Record `BASE_SHA` (required)3132Capture the base ref **before any changes** (used later for `dedup`):3334```bash35BASE_SHA="$(git rev-parse HEAD)"36```3738### 1) Choose the repo check command(s) once (required)3940Do a one-time **tooling detection + configuration** so the per-step “build/lint” commands match the target repo.4142**Detect languages and entrypoints**43 - **Node/TS**: look for `package.json` in repo root and common subprojects (for example `functions/package.json`).44 - **Python**: look for `pyproject.toml`, `uv.lock`, `poetry.lock`, `requirements.txt`.45**Pick build/lint/typecheck commands (prefer repo-native scripts)**46 - Prefer existing package scripts when present (e.g. `npm run build`, `npm run lint`, `npm test`).47 - Prefer the repo’s configured Python toolchain:48 - If `uv` is clearly in use: use `uv`-based commands.49 - If Poetry is clearly in use: use `poetry run ...`.50 - If neither: use the repo’s documented commands (README/CONTRIBUTING) if available.51 - If multiple options exist or it’s unclear, ask the user **once** for the canonical build/lint/typecheck commands, then reuse them for every step.52**Write down a “Tooling config” block and reuse it for every step**53 - Example format (adapt to the repo):54 - **Root (Node)**: build=`...`, lint=`...`55 - **functions/ (Node)**: build=`...`, lint=`...`56 - **Root (Python)**: build=`...`, typecheck=`...`, lint/format=`...`57 - From now on, *only* run the commands from this block after each step (instead of hard-coded defaults).58**If the repo has no build/lint tooling**59 - Explicitly record “No build/lint configured” and skip build/lint steps (do not invent tooling). Call this out in the final summary.6061### 2) Implement the requested change (required)6263- Make the smallest correct change that satisfies the request.64- Prefer reusing existing patterns/utilities over creating new ones.65- Keep the change set small and reviewable.6667### 3) Run repo checks and fix only what you broke (required)6869- Run the commands from your **Tooling config**.70- If checks fail due to changes you introduced, fix and re-run until green.71- If checks fail for clearly pre-existing/unrelated reasons, stop and report:72 - the exact command(s) you ran, and73 - the first actionable error output.7475### 4) Commit once checks are green (required)7677- `git add -A`78- Make a single atomic commit for the user-requested change:79 - `git commit -m "<imperative summary>"` (example: `Fix flaky upload retry`).80- Do not create empty/no-op commits (`--allow-empty` is prohibited).8182### 5) Run `dedup` against `BASE_SHA` (required)8384Ensure the working tree is clean, then run the dedupe loop:8586```bash87if [ -n "$(git status --porcelain)" ]; then88 echo "Working tree is not clean; commit or stash before running dedup." >&289 exit 190fi91```9293```bash94resolve_skill_dir() {95 local name="$1"96 local repo_root=""97 repo_root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"9899 local candidates=(100 "$repo_root/.agents/skills/$name"101 "$repo_root/.claude/skills/$name"102 "$HOME/.agents/skills/$name"103 "$HOME/.codex/skills/$name"104 "$HOME/.claude/skills/$name"105 )106107 for d in "${candidates[@]}"; do108 if [[ -d "$d" ]]; then109 echo "$d"110 return 0111 fi112 done113114 echo "Error: skill '$name' not found in repo-scoped or user-scoped skill dirs." >&2115 return 1116}117118DEDUP_SKILL_DIR="$(resolve_skill_dir dedup)"119python3 "$DEDUP_SKILL_DIR/scripts/run_dedup_loop.py" "${BASE_SHA}"120```121122If `dedup` creates additional commits, re-run the **Tooling config** checks once at the end and fix only issues introduced by dedupe changes.123Do not interrupt/restart the dedup loop if it looks quiet; the loop script owns timeouts and retries.124125## Guardrails126127- Keep changes tightly scoped to the user request + required dedupe.128- Avoid drive-by refactors, renames, formatting-only churn, or dependency upgrades unless required.129- End state must be: checks green (or explicitly “no checks configured”), clean working tree, and at least one meaningful commit.