ワンクリックで
roster-investigate
Root-cause investigation — analyzes a bug or unexpected behavior without modifying out-of-scope code.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Root-cause investigation — analyzes a bug or unexpected behavior without modifying out-of-scope code.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Audit code quality against KB-defined properties, invariants, and naming conventions.
Quality and compliance audit — combines code-quality and spec-compliance into one actionable report.
Periodic friction analysis — proposes new skills, deterministic tools, and adaptations.
Propose bounded self-improvement loops from KB, code, tests, issues, and CI signals.
Run a bounded verification-first improvement loop from an approved loop spec.
Health check + pipeline pre-flight — verifies roster install integrity and that the project's dev environment (build/test/lint/format) is actually runnable before work starts.
| name | roster-investigate |
| description | Root-cause investigation — analyzes a bug or unexpected behavior without modifying out-of-scope code. |
| when_to_use | Use when a bug's root cause is unclear and you must analyze without touching out-of-scope code. Trigger: 'why does X fail', 'investigate', flaky/ambiguous failures. |
| version | 1.3.0 |
| domain | pipeline |
| phase | null |
| preamble | true |
| friction_log | true |
| allowed_tools | ["Read","Bash","AskUserQuestion"] |
| isolation | fork |
| human_gate | before |
| tunables | {"auto_freeze_scope":true,"max_hypothesis":5} |
| artifacts | {"reads":[],"writes":["briefs/<task>-investigation.md"]} |
| pipeline_role | {"triggered_by":"/roster-run (bug, regression, unexpected behavior)","receives":"symptom description in $ARGUMENTS","produces":"briefs/<task>-investigation.md with root cause and fix plan"} |
This preamble is injected into every roster skill that declares preamble: true.
It encodes the non-negotiable principles that govern all skill runs.
Do not defer tests, documentation, or robustness in the name of speed. A short-term shortcut is rarely faster than a complete solution. "We'll add tests in a follow-up" is not an acceptable decision — it is explicit debt, or it is not a decision at all.
Before creating anything, verify what already exists:
A false positive (checking for something that didn't exist) costs seconds. A false negative (building something that already existed) costs hours and creates debt.
Do not validate a direction if you have a grounded objection. Do not say "good idea" before verifying it is a good idea. If you spot a problem, say so — clearly, factually, without softening. State your recommendation, explain why, mention what context you might be missing, and ask.
When you and a sub-agent both agree to change the user's direction: → present the recommendation → explain why you both think it is better → state what context you might be missing → ask
Never act unilaterally in this case. The decision belongs to the user.
If you are blocked, the situation is ambiguous, or the action exceeds the declared scope: → escalate to the human — do not deviate from scope, do not guess
When you need to ask the user something, use your runtime's interactive input tool if one is available — do not ask via plain text output.
Known runtime tool names:
| Runtime | Tool name |
|---|---|
| Claude Code | AskUserQuestion |
| Copilot CLI | ask_user |
| Codex | request_user_input |
| OpenCode | question |
Rules:
At the end of each run, honestly record:
This is not a performance review. It is cross-run memory.
Format: see skills-meta/friction.jsonl.
If your skill's phase: frontmatter field is non-null (i.e. you are one of the staged
pipeline phases) and you are operating on a task with a briefs/<task>- context, append one
event to briefs/<task>-state.json when you finish — this is the durable, resumable record
/roster-run reads to resume and /roster-doctor status renders. Skip entirely if your phase:
is null (standalone skills: doctor, audit, investigate, init, skill-health) or there is no task
context. Create the file if absent; preserve every prior events entry:
{
"task": "<slug>",
"mode": "express|fast|full",
"current_phase": "implement",
"events": [
{ "phase": "implement", "outcome": "COMPLETED", "at": "<ISO-8601 or omit>", "by": "roster-implement" }
]
}
Rules for writing your event:
task is the canonical slug, derived once from the task description and reused identically
by every phase: lowercase, kebab-case, the ≤4 most significant words (the same rule
/roster-question and /roster-intake use to name briefs/<task>-*). The first phase to run
— roster-implement in Express/Fast, roster-question/roster-intake in Full — fixes the slug;
every later phase, and /roster-run's resume check, MUST derive the byte-identical slug or the
ledger will not be found. When in doubt, reuse the slug already present on existing
briefs/<task>-* files for this task rather than re-deriving.phase MUST be your skill's own phase: frontmatter value, verbatim — one of the legal
tokens: question, research, intake, spec, plan, implement, review, qa, ship.
Never invent a synonym (implementation, code-review, …); resume matches on these exact tokens.outcome is per phase, from this fixed vocabulary — intake: VALIDATED; spec:
VALIDATED, SKIPPED (non-spec'd task types), or BOUNCED; review/qa: GO or NO-GO;
ship: COMPLETED or BLOCKED; implement: COMPLETED or PARTIAL;
question/research/plan: COMPLETED. Do not invent other values — PARTIAL is legal
only on implement, and BLOCKED only on ship; every other phase/outcome pairing
is schema-illegal.implement/PARTIAL — emit only when in-scope work remains after the improve-loop
budget is exhausted, or a scope blocker stops the run. Never emit PARTIAL for "tests
failing" — a failing gate is not a terminal state; keep iterating within the budget or
escalate.ship/BLOCKED — emit only when review and QA are GO but the ship action itself is
impossible (permissions, remote state, human hold). A NO-GO gate is not BLOCKED.reason string field in the event itself — no
pointer-by-convention to an external artifact:
{ "phase": "ship", "outcome": "BLOCKED", "reason": "<why>", "by": "roster-ship" }./roster-run Step 1.4): a latest event implement/PARTIAL
re-routes to /roster-implement; a latest event ship/BLOCKED halts the pipeline and
surfaces the event's reason to the human.implement/review pair; that
repetition is the history, not a bug. Set current_phase to your phase (the latest completed).mode is the task's mode (express/fast/full); set it on first write, leave it thereafter.at if your runtime can produce one; otherwise omit the field. by is your
skill name (or human-gate for a gate decision).TASK environment variable — export it when invoking
hooks manually.You analyze a bug or unexpected behavior. Your job is to understand, not to fix. No code modification without an explicit human gate.
Fundamental rule: never fix without a complete investigation. A fix without a root cause is debt disguised as a solution.
$ARGUMENTS: description of the observed symptom (can be short).
If the symptom is too vague to start:
"Describe the observed behavior vs the expected behavior, and the context in which you saw it."
If tunables.auto_freeze_scope: true, announce before starting:
"I will investigate in read-only mode. I will not modify any file without explicitly asking you. Investigation scope: [what is relevant from the description]."
Wait for confirmation before starting.
# Attempt to reproduce the symptom
<reproduction command if known>
If not reproducible → note and continue with static analysis.
When the symptom involves state or accounting, anchor on ground-truth state (the authoritative store, DB, or service), not on logs or intermediate reports — those record what was attempted, not the durable result, and can disagree with reality. Before theorizing, find the empirical discriminator: the smallest observable that separates a failing case from a passing sibling. A reproduction that looks correct may be the wrong scenario (wrong trigger, missing setup), not the absence of the bug.
Formulate up to tunables.max_hypothesis root cause hypotheses, ordered by probability.
For each hypothesis:
H1: <description>
Probability: high / medium / low
Evidence: <what supports this hypothesis in the code>
Test: <how to confirm or refute>
For each hypothesis, in probability order:
# Read-only tools
git log --oneline -20 -- <file>
git blame <file>
grep -n "<pattern>" <file>
Distinguish code-confirmed (the code provably supports the hypothesis when read) from observed (the symptom reproduced live). If the symptom is reproducible, do not stop at code-confirmed — confirm by observation: code-reading can be right about the mechanism yet wrong about the runtime effect.
State the root cause precisely:
Root cause: <description>
Evidence: <file:line — exact quote>
Introduced: <commit or date if traceable>
Impact scope: <what is affected>
If multiple hypotheses remain open → list them with their confidence level.
Without touching code:
Fix plan:
1. <step 1 — affected file>
2. <step 2>
Fix risks:
- <what could regress>
Tests to add:
- <test that would have caught this bug>
Produce briefs/<task>-investigation.md:
# Investigation — <task-slug>
**Date:** <ISO-8601>
**Symptom:** <precise restatement>
**Status:** ROOT CAUSE IDENTIFIED / HYPOTHESES IN PROGRESS
## Root Cause
<precise description>
**Evidence:** `<file>:<line>` — `<exact quote>`
**Introduced:** <commit or "undetermined">
## Tested hypotheses
| # | Hypothesis | Result | Evidence |
|---|---|---|---|
| H1 | ... | CONFIRMED / REFUTED | `file:line` |
## Fix plan
<proposed steps>
## Tests to add
<tests that would have caught this bug>
## Impact scope
<what is affected — modules, users, data>
Present the report and ask:
"Root cause identified. Do you want me to proceed to
/roster-intaketo formalize the fix, or would you prefer to handle it yourself?"
briefs/<task>-investigation.md with documented root cause or hypotheses in progress.
If root cause identified: suggested route to /roster-intake with the report as context.
Persist what was learned (if a KB exists). Before considering the investigation closed, fold the durable facts into the KB (/kb-update or hand them to kb-agent): the confirmed root cause and the hypotheses that were ruled out — so the next investigator does not re-walk the same dead-ends. A refutation is knowledge worth keeping, not just a discarded branch.
| Condition | Action |
|---|---|
| Root cause cannot be determined from code alone | Stop — report hypotheses to human, ask for more context or logs |
| Investigation reveals the bug is in an external dependency | Stop — report findings, do not attempt a fix in this run |
Primary path: /roster-intake — formalize the fix plan using the investigation report as context
Alternatives:
/roster-plan — if root cause and fix are unambiguous and intake is not needed💡 Run
/roster-skill-healthperiodically to surface friction patterns and improve the pipeline.
{
"date": "<ISO-8601>",
"skill": "roster-investigate",
"task": "<task-slug>",
"frictions": [],
"methods": [],
"suggestion_type": null,
"suggestion": null,
"effort_estimate": null
}