You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(sync): cascade fleet updates from socket-repo-template
- New docs/references/agent-delegation.md (CLI-subprocess vs. subagent
delegation paths, routing heuristics).
- CLAUDE.md fleet block: "Agents & skills" gains pointer to the
delegation doc.
- socket-hook marker fix: pre-commit/pre-push and the logger-guard
hook now accept `//` and `/* */` comment prefixes alongside `#`,
so `.ts`/`.mts` files use `// socket-hook: allow logger` naturally.
- scanning-quality SKILL.md, security.mts, socket-repo-template-schema
pair: byte-identical resync against template.
Pre-commit bypassed: pre-commit escalates to a full build that
downloads native socket-btm release assets and hits a 403 on the
anonymous code path. The build wouldn't validate any of these changes
(docs + regex broadening), so --no-verify per user instruction.
Perform comprehensive quality analysis across the codebase using specialized agents. Clean up junk files first, then scan and generate a prioritized report with actionable fixes.
11
11
12
+
## Modes
13
+
14
+
-**Default (interactive)** — `AskUserQuestion` is used to confirm cleanup deletions and to pick scan scope.
15
+
-**Non-interactive** — `/scanning-quality non-interactive` (or any of the aliases below) skips every `AskUserQuestion` and applies safe defaults: scan scope = all types, cleanup = leave junk files in place (don't delete without confirmation), report-save = yes (`reports/scanning-quality-YYYY-MM-DD.md`). Use this when running headlessly (e.g. `pnpm run fleet-skill scanning-quality`, CI cron, programmatic Claude). The four-flag programmatic-Claude lockdown rule already strips `AskUserQuestion`, so headless runs default to non-interactive automatically — but call it out explicitly so future readers understand the contract.
16
+
17
+
Detect non-interactive mode via any of: `--non-interactive` argument, `non-interactive` argument, `SCANNING_QUALITY_NONINTERACTIVE=1` env var, or absence of `AskUserQuestion` in the available tool surface.
18
+
12
19
## Scan Types
13
20
14
21
1.**critical** - Crashes, security vulnerabilities, resource leaks, data corruption
@@ -46,7 +53,7 @@ Install zizmor for GitHub Actions security scanning, respecting the soak window
46
53
47
54
### Phase 4: Repository Cleanup
48
55
49
-
Find and remove junk files (with user confirmation via AskUserQuestion):
56
+
Find junk files (interactive mode confirms each batch via `AskUserQuestion`; non-interactive mode lists what was found in the report and leaves them in place — don't delete files without explicit confirmation, even on a clean dirty-tree):
50
57
- SCREAMING_TEXT.md files outside `.claude/` and `docs/`
@@ -62,7 +69,9 @@ Report errors as Critical findings. Warnings are Low findings. (The fleet's stru
62
69
63
70
### Phase 6: Determine Scan Scope
64
71
65
-
Ask user which scans to run using AskUserQuestion (multiSelect). Default: all scans.
72
+
In **interactive** mode, ask the user which scans to run via `AskUserQuestion` (multiSelect). Default: all scans.
73
+
74
+
In **non-interactive** mode, run all scan types — no prompt.
66
75
67
76
### Phase 7: Execute Scans
68
77
@@ -77,7 +86,8 @@ Each agent reports findings as:
77
86
- Deduplicate findings across scan types
78
87
- Sort by severity: Critical > High > Medium > Low
79
88
- Generate markdown report with file:line references, suggested fixes, and coverage metrics
80
-
- Offer to save to `reports/scanning-quality-YYYY-MM-DD.md`
89
+
-**Interactive**: offer to save to `reports/scanning-quality-YYYY-MM-DD.md` via `AskUserQuestion`.
90
+
-**Non-interactive**: save the report unconditionally to `reports/scanning-quality-YYYY-MM-DD.md` (create the directory if missing) so the artifact is visible to the orchestrating runner. If the `Write` tool isn't in the allow list, emit the full markdown to stdout with a leading `=== REPORT MARKDOWN ===` marker so the runner can capture and persist it.
-**Handing off to another agent** — see [`docs/references/agent-delegation.md`](docs/references/agent-delegation.md) for when to reach for `codex:codex-rescue`, the `delegate` subagent (OpenCode → Fireworks/Synthetic/Kimi), `Explore`, `Plan`, vs. driving the skill CLIs directly. The CLI-subprocess contract used by skills lives in [`_shared/multi-agent-backends.md`](.claude/skills/_shared/multi-agent-backends.md).
When a task fits one of the patterns below, hand it off instead of doing it in the current session. The point is to get a _different model's_ take or to keep heavy work out of the main context — not to avoid effort. Don't delegate trivial tasks: the round-trip overhead isn't worth it for things you can answer in one or two tool calls.
4
+
5
+
There are two delegation surfaces in this fleet. They look similar but are used differently.
6
+
7
+
## Surface 1 — CLI subprocess delegation (skills)
8
+
9
+
Skills that need multi-model output spawn the agent CLIs (`codex`, `claude`, `kimi`, `opencode`) as subprocesses and fold the results into a report. The contract — backend registry, detection policy, fallback order, attribution — lives in [`_shared/multi-agent-backends.md`](../../.claude/skills/_shared/multi-agent-backends.md). The canonical implementation is [`reviewing-code/run.mts`](../../.claude/skills/reviewing-code/run.mts).
10
+
11
+
Use this surface when _the skill itself_ is the orchestrator (multi-pass review, parallel scans, fleet-wide runs).
When the _current_ Claude session wants to hand off a single task to another model and consume its result inline, use `Agent(subagent_type=…)`. This is in-conversation delegation, not skill orchestration.
|`codex:codex-rescue`| You want GPT-5.4's take or a heavyweight async investigation. Best for: hard debugging you're stuck on, second implementation pass on a tricky design, deep root-cause work. Persistent runtime — check progress with `/codex:status`, get output with `/codex:result`. Also exposed as `/codex:rescue` for user-driven invocation. |
20
+
|`delegate`| You want a Fireworks / Synthetic / Kimi open model via [OpenCode](https://opencode.ai). Best for: cheap bulk work (classification, summarization, drafting many things), specialist routing (e.g. Qwen-Coder for code-heavy tasks), second opinions from a non-GPT/non-Claude model. Caller specifies the model in the prompt (e.g. `fireworks/qwen3-coder-480b`). Fire-and-forget. **Optional** — only available if the dev has set up the `delegate` agent locally. Skill code must not depend on it. |
21
+
|`Explore`| Codebase search / "where is X defined" / cross-file lookups. Different model isn't the point — context isolation is. |
22
+
|`Plan`| Implementation strategy for a non-trivial task before writing code. |
23
+
|`general-purpose`| Open-ended research that doesn't fit the above. |
24
+
25
+
## Routing heuristics
26
+
27
+
-**Stuck after one or two failed attempts** → `codex:codex-rescue`. A different family often breaks the deadlock.
28
+
-**About to do 20+ similar small operations** → `delegate` with a cheap model. Keep the main context clean.
29
+
-**Want a sanity check on a non-trivial design or diff** → `/codex:adversarial-review` (slash command) _or_`delegate` to a different family, depending on which perspective is more useful.
-**Building a multi-pass workflow** → don't use `Agent(...)` ad hoc; write a skill that uses Surface 1.
32
+
33
+
## When the surfaces overlap
34
+
35
+
A skill that wants `codex` output should call the CLI (Surface 1) so the result lands in a structured report. A live conversation that wants Codex's opinion on the _current_ problem should use the subagent (Surface 2) so the result flows back into the conversation. Same model, different orchestration.
36
+
37
+
## Compatibility note
38
+
39
+
Codex is fleet-wide (the `codex` CLI is a fleet plugin). OpenCode and the `delegate` subagent are **per-developer** — they require local setup outside the repo. Skills that automate work across the fleet must not assume `delegate` exists; humans driving Claude in their own checkout can use it freely.
0 commit comments