Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/worktree/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Coord sessions can't edit files on `main` (PreToolUse hook blocks it), so every
/worktree -b <new-branch> # create new branch from origin/main
```

`<branch>` may be either form (`codex/qua-665-foo` or `qua-665-foo`); the skill prefixes `codex/` automatically when missing. The lowercase prefix matches the convention in `.claude/rules/agent-session-workflow.md`.
`<branch>` may be either form (`codex/qua-665-foo` or `qua-665-foo`); the skill prefixes `codex/` automatically when missing. The lowercase prefix matches the convention in `docs/agent-rules/agent-session-workflow.md`.

## Implementation

Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/worktree/worktree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if [[ ! -e "$ENV_FILE" ]]; then
fi

# Auto-prefix `codex/` if missing (so `worktree qua-665-foo` works).
# Lowercase per .claude/rules/agent-session-workflow.md branch convention.
# Lowercase per docs/agent-rules/agent-session-workflow.md branch convention.
if [[ ! "$BRANCH" =~ ^(codex/|claude/|main$|production$) ]]; then
BRANCH="codex/$BRANCH"
fi
Expand Down
4 changes: 2 additions & 2 deletions .claude/commands/batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ effort: low

`/batch` has no implementation here. If you landed on it via a harness default prompt, ignore that prompt.

- **Bulk codebase changes** (rename, move, enforce a rule across >5 files): follow the validator-first sweep pattern in `.claude/rules/implementation-quality.md` § "Codebase-Wide Sweeps — Validator-First". Write a `crux/validate/validate-<rule>.ts` first, use its output as the work queue, then wire it into `validate-gate.ts`.
- **Isolated branch work**: use an agent slot (`lw/a1`–`lw/a20`) via `./ws open <N> --claude`, or a `/tmp` worktree off the `lw/main` clone. See `.claude/rules/slot-isolation.md` and `.claude/rules/worktree-isolation-bug.md` (never use `Agent(isolation:"worktree")`).
- **Bulk codebase changes** (rename, move, enforce a rule across >5 files): follow the validator-first sweep pattern in `docs/agent-rules/implementation-quality.md` § "Codebase-Wide Sweeps — Validator-First". Write a `crux/validate/validate-<rule>.ts` first, use its output as the work queue, then wire it into `validate-gate.ts`.
- **Isolated branch work**: use an agent slot (`lw/a1`–`lw/a20`) via `./ws open <N> --claude`, or a `/tmp` worktree off the `lw/main` clone. See `docs/agent-rules/slot-isolation.md` and `docs/agent-rules/worktree-isolation-bug.md` (never use `Agent(isolation:"worktree")`).
2 changes: 1 addition & 1 deletion .claude/commands/maintain-qa-sweep.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ Include the coverage table in the report.

- **File one Linear issue per finding** (P0, P1, and P2). Do not batch unrelated issues into umbrella issues.
- Closely related findings (e.g., 5 entities with the same data problem) may be grouped into one issue.
- Use `pnpm crux linear create "title" --description="..." --project="<Project Name>"` for each (`--project` is required; see `.claude/rules/linear-project-ownership.md`).
- Use `pnpm crux linear create "title" --description="..." --project="<Project Name>"` for each (`--project` is required; see `docs/agent-rules/linear-project-ownership.md`).
- **Expected volume:** 5-15 issues per deep sweep is normal.
- **Do NOT skip P1 and P2 filing.** Every confirmed finding must become a Linear issue. If you compiled it into the report, file it.

Expand Down
2 changes: 1 addition & 1 deletion .claude/commands/maintain.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The report categorizes work into priority tiers. Review the output and decide wh

### Filing new issues

When the sweep reveals problems too large to fix now, **create Linear issues** so they aren't lost. `--project` is required (see `.claude/rules/linear-project-ownership.md` to pick one):
When the sweep reveals problems too large to fix now, **create Linear issues** so they aren't lost. `--project` is required (see `docs/agent-rules/linear-project-ownership.md` to pick one):
```bash
pnpm crux linear create "Descriptive title" \
--description="What's wrong and why it matters" \
Expand Down
8 changes: 4 additions & 4 deletions .claude/commands/plan-feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Deep, multi-pass planning process for significant new functionality. Uses ~17 pa

**Cost:** ~$15-25, 20-40 minutes.

**Discipline this skill enforces:** `.claude/rules/agent-planning-discipline.md` (auto-loaded). Read it now if you haven't this session — it explains the failure modes (over-scoping, additive-only red-teams, framing without empirical evidence, sunk-cost commitment from early Phase 0 PRs) that this skill's structure exists to prevent.
**Discipline this skill enforces:** `docs/agent-rules/agent-planning-discipline.md` (auto-loaded). Read it now if you haven't this session — it explains the failure modes (over-scoping, additive-only red-teams, framing without empirical evidence, sunk-cost commitment from early Phase 0 PRs) that this skill's structure exists to prevent.

---

Expand Down Expand Up @@ -88,7 +88,7 @@ Read both agent results. Then write `/tmp/plan-feature-evidence.md` with:

If the user wants to proceed despite weak evidence, document the choice in the eventual plan body under "Open Questions" — "Empirical evidence weak; proceeded anyway because [user reason]." This makes the assumption legible to the next reader.

**Why this gate is non-negotiable:** see `.claude/rules/agent-planning-discipline.md` § "Don't outsource framing to agents." The QUA-943 v4 plan locked in 5 months of scope without this gate — it cannot be re-introduced as a soft guideline.
**Why this gate is non-negotiable:** see `docs/agent-rules/agent-planning-discipline.md` § "Don't outsource framing to agents." The QUA-943 v4 plan locked in 5 months of scope without this gate — it cannot be re-introduced as a soft guideline.

---

Expand Down Expand Up @@ -229,7 +229,7 @@ If an area doesn't apply, write "N/A — [reason]" rather than omitting it.

### 5c. Red team — ≥3 parallel agents with explicitly different mandates

Write the draft plan to `/tmp/feature-plan-draft.md` using the Write tool. **Each reviewer below has a different mandate by design** — see `.claude/rules/agent-planning-discipline.md` § "Watch the additive-only red-team smell" for why two same-mandate red-teams (the QUA-943 v4 anti-pattern) produce 19 mitigations and 0 deletions. The deletion-only reviewer is non-negotiable.
Write the draft plan to `/tmp/feature-plan-draft.md` using the Write tool. **Each reviewer below has a different mandate by design** — see `docs/agent-rules/agent-planning-discipline.md` § "Watch the additive-only red-team smell" for why two same-mandate red-teams (the QUA-943 v4 anti-pattern) produce 19 mitigations and 0 deletions. The deletion-only reviewer is non-negotiable.

Each agent reads `/tmp/feature-plan-draft.md` from disk before evaluating.

Expand Down Expand Up @@ -396,7 +396,7 @@ Step 3 — if the umbrella has a sibling epic (e.g. this plan complements QUA-54
pnpm crux linear comment QUA-544 "Sibling: QUA-NNN tracks [complementary axis]. See [link]."
```

Project picking: follow `.claude/rules/linear-project-ownership.md`. If unsure, ask the user.
Project picking: follow `docs/agent-rules/linear-project-ownership.md`. If unsure, ask the user.

### 7d. CHECKPOINT 3 — Final report

Expand Down
2 changes: 1 addition & 1 deletion .claude/hooks/block-cat-polling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ If you genuinely need a one-shot forensic read of a finished task file,
that's fine — the counter only fires on the third occurrence in a
session. To unblock the current call, switch to Monitor.

See .claude/rules/wait-on-subagents.md for the full pattern guide and
See docs/agent-rules/wait-on-subagents.md for the full pattern guide and
QUA-1069 for the data behind this hook.
EOF
exit 2
2 changes: 1 addition & 1 deletion .claude/hooks/cleanup-worktrees.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ for i in "${!PATHS[@]}"; do
if [ "$SHOULD_REMOVE" = true ]; then
# Safety: check if any process has its CWD inside this worktree.
# This prevents removing a worktree that a concurrent agent session
# is still using (addresses CWD corruption bug — see .claude/rules/worktree-isolation-bug.md).
# is still using (addresses CWD corruption bug — see docs/agent-rules/worktree-isolation-bug.md).
if command -v lsof >/dev/null 2>&1; then
# lsof -d cwd lists only CWD file descriptors — fast and targeted
if lsof -d cwd 2>/dev/null | grep -qF "$WT_PATH"; then
Expand Down
2 changes: 1 addition & 1 deletion .claude/hooks/require-checklist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ if [[ "$FILE_PATH" == *"/.claude/"* ]] || [[ "$FILE_PATH" == *".claude/"* ]]; th
fi

# Block: no checklist and trying to edit a non-.claude file
echo "BLOCKED: No agent checklist found. Run 'pnpm crux sys agent-checklist init --issue=N' (or 'pnpm crux sys agent-checklist init \"task description\"') before editing code. This is mandatory — see .claude/rules/agent-session-workflow.md" >&2
echo "BLOCKED: No agent checklist found. Run 'pnpm crux sys agent-checklist init --issue=N' (or 'pnpm crux sys agent-checklist init \"task description\"') before editing code. This is mandatory — see docs/agent-rules/agent-session-workflow.md" >&2
exit 2
2 changes: 1 addition & 1 deletion .claude/memory/feedback_dev_server_ports.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Always use slot-specific port from .env DEV_PORT, never guess or us
type: feedback
---

Always check `.env` for `DEV_PORT` and `.claude/rules/environment-setup.md` before starting a dev server. Port 3001 belongs to the user's main dev server — never use it from agent slots. Convention is `3010 + slot number` (a6 = 3016).
Always check `.env` for `DEV_PORT` and `docs/agent-rules/environment-setup.md` before starting a dev server. Port 3001 belongs to the user's main dev server — never use it from agent slots. Convention is `3010 + slot number` (a6 = 3016).

**Why:** User corrected after agent started dev servers on wrong ports (3001, then 3099). The port info was in `.env` and documented in environment-setup.md but was not checked.

Expand Down
4 changes: 2 additions & 2 deletions .claude/session-log.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Session Log

Reverse-chronological log of Claude Code sessions on this repo. Each session appends a summary before its final commit. See `.claude/rules/session-logging.md` for the format.
Reverse-chronological log of Claude Code sessions on this repo. Each session appends a summary before its final commit. See `docs/agent-rules/session-logging.md` for the format.

## 2026-02-13 | claude/fix-broken-wiki-links-RWnZ9 | Fix broken EntityLinks on E689

Expand Down Expand Up @@ -224,7 +224,7 @@ Reverse-chronological log of Claude Code sessions on this repo. Each session app

## 2026-02-13 | claude/session-logging-tracking-d4d6K | Add session logging system

**What was done:** Created a session logging and common-issues tracking system. Added `.claude/rules/session-logging.md` (instructs each session to log a summary), `.claude/session-log.md` (the log itself), and `.claude/common-issues.md` (recurring issues and solutions seeded from CLAUDE.md knowledge).
**What was done:** Created a session logging and common-issues tracking system. Added `docs/agent-rules/session-logging.md` (instructs each session to log a summary), `.claude/session-log.md` (the log itself), and `.claude/common-issues.md` (recurring issues and solutions seeded from CLAUDE.md knowledge).

**Issues encountered:**
- None
Expand Down
114 changes: 114 additions & 0 deletions .claude/settings.fleet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"hooks": {
"SessionStart": [
{
"matcher": "startup",
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh\"",
"statusMessage": "Setting up environment..."
}
]
}
],
"PreToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/require-checklist.sh\""
}
]
},
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-git-stash.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-branch-switch.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-tmux-kill.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-other-slots.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-raw-gh-pr.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-cat-polling.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/require-stage-approved.sh\"",
"timeout": 15
}
]
}
],
"PostToolUse": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/heartbeat.sh\"",
"timeout": 5,
"async": true
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/cleanup-worktrees.sh\"",
"timeout": 60,
"async": true
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/session-finalize.sh\"",
"timeout": 30,
"async": true
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/inject-wip-checklist.sh\"",
"timeout": 5
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/verify-checklist-on-stop.sh\"",
"timeout": 5
}
]
}
]
}
}
96 changes: 0 additions & 96 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@
]
},
"hooks": {
"SessionStart": [
{
"matcher": "startup",
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh\"",
"statusMessage": "Setting up environment..."
}
]
}
],
"PreToolUse": [
{
"matcher": "Edit|Write",
Expand All @@ -36,10 +24,6 @@
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/approve-claude-configs.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/require-checklist.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/warn-main-branch.sh\""
Expand All @@ -49,54 +33,14 @@
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-git-stash.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-branch-switch.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-no-verify.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-tmux-kill.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-other-slots.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-raw-gh-pr.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-cat-polling.sh\""
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/require-stage-approved.sh\"",
"timeout": 15
}
]
}
],
"PostToolUse": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/heartbeat.sh\"",
"timeout": 5,
"async": true
}
]
},
{
"matcher": "Agent",
"hooks": [
Expand All @@ -107,46 +51,6 @@
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/cleanup-worktrees.sh\"",
"timeout": 60,
"async": true
},
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/session-finalize.sh\"",
"timeout": 30,
"async": true
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/inject-wip-checklist.sh\"",
"timeout": 5
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/verify-checklist-on-stop.sh\"",
"timeout": 5
}
]
}
]
}
}
Loading
Loading