Backend Diagnose Workflow
Purpose
- Execute
/diagnose-equivalent flow in a single agent.
- Produce root-cause-oriented recommendations with explicit confidence.
Execution Contract
This skill follows the non-entry execution contract standard.
Required contract_extensions: confidence, hypothesis_count.
See codex-execution-contract.md and non-entry-execution-contract-template.md for full rules.
input:
objective: "Diagnose backend timeout failure"
contract_extensions: { confidence: "medium", hypothesis_count: 3 }
output:
status: "completed"
quality_gate:
gate_id: "backend-diagnosis-check"
gate_type: "diagnosis"
trigger: "post-diagnosis review"
criteria:
- "Primary hypothesis is validated"
- "Confidence level matches the findings"
result: "pass"
evidence:
- "Primary hypothesis confirmed"
blockers: []
branching:
on_pass: "handoff"
on_fail: "deepen_diagnosis"
max_cycles: 2
contract_extensions: { confidence: "high", hypothesis_count: 3 }
Contract Compliance
- Emit structured output compliant with
codex-execution-contract.md.
- Always include baseline output fields:
status, summary, changed_files, tests, quality_gate, blockers, next_actions.
- Validate required input fields from
../workflow-entry/references/non-entry-execution-contract-template.md (objective, scope, constraints, acceptance_criteria, allowed_commands, sandbox_mode) before proceeding.
- Echo required skill extensions in
contract_extensions: confidence, hypothesis_count.
- Treat missing required fields as contract violations and regenerate output before handoff.
- On contract violation (missing/invalid field, invalid status value, or missing extension keys): do not proceed; emit status: blocked with violation description in blockers.
- Reference:
non-entry-execution-contract-template.md.
Workflow
- Structure problem type:
- change failure
- new discovery
- Collect missing context and constraints.
- Gather evidence: logs, traces, failing tests, reproduction steps.
- Build hypotheses and causal chains.
- Validate hypotheses with minimal reproducible checks.
- Derive solution options with tradeoffs.
- Choose recommendation and define implementation steps.
- Record residual risks and post-fix verification items.
Confidence Policy
high: enough evidence to implement recommended fix safely.
medium: additional investigation likely required but bounded.
low: fundamental evidence gaps remain.
If confidence is below high, iterate investigation up to two additional loops.
After two loops, escalate decision to user.
Required Output Structure
- identified causes
- cause relationships (independent/dependent/exclusive)
- investigated scope
- recommendation with rationale
- alternatives
- residual risks
- post-resolution verification checklist
Hard Rules
- Do not stop at symptom-level conclusions.
- Do not skip alternative-hypothesis evaluation.
- Do not propose fixes without impact and regression analysis.
Quality Gate Evidence
- This executor owns
quality_gate emission and branching using quality-gate-evidence-template.md.
- Emit canonical fields:
gate_id, gate_type, trigger, criteria, result, evidence, blockers, branching.
- Use
gate_type: diagnosis for backend diagnosis quality checks.
- Normalize local statuses into
result: pass|fail|blocked before handoff.
- If
result: blocked, emit [Stop: quality-gate-failed] and pause for escalation handling.
Stop/Approval Protocol
Use canonical markers: [Stop: <Gate Name>].
Classify every stop as approval_gate or escalation_gate.
At each stop, emit a full gate record: gate_name, gate_type, trigger, ask_method, required_user_action, resume_if, fallback_if_rejected.
Default ask_method is AskUserQuestion.
Resume an approval_gate only with explicit user approved: true; resume an escalation_gate only after user direction or reroute.
Respect batch boundary: investigation loops may continue, but any write fix requires [Stop: pre-implementation-approval].
Enforce max_revision_cycles: 2; overflow requires human intervention.
Agent-local confidence improvement never replaces user approvals.
Stop points for this skill:
[Stop: pre-implementation-approval] (approval_gate)
[Stop: high-risk-change] (approval_gate)
[Stop: requirement-change-detected] (escalation_gate)
[Stop: quality-gate-failed] (escalation_gate)
[Stop: revision-limit-reached] (escalation_gate)
Full protocol and payload schema: ../workflow-entry/references/stop-approval-section-template.md.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: backend-diagnose-workflow3description: Backend diagnosis workflow for Claude without investigator/verifier/solver subagents. Performs evidence collection, validation, and solution derivation with confidence control. Use when this capability is needed.4---56# Backend Diagnose Workflow78## Purpose910- Execute `/diagnose`-equivalent flow in a single agent.11- Produce root-cause-oriented recommendations with explicit confidence.1213## Execution Contract1415This skill follows the non-entry execution contract standard.16Required `contract_extensions`: `confidence`, `hypothesis_count`.17See [`codex-execution-contract.md`](../workflow-entry/references/codex-execution-contract.md) and [`non-entry-execution-contract-template.md`](../workflow-entry/references/non-entry-execution-contract-template.md) for full rules.1819```yaml20input:21 objective: "Diagnose backend timeout failure"22 contract_extensions: { confidence: "medium", hypothesis_count: 3 }23output:24 status: "completed"25 quality_gate:26 gate_id: "backend-diagnosis-check"27 gate_type: "diagnosis"28 trigger: "post-diagnosis review"29 criteria:30 - "Primary hypothesis is validated"31 - "Confidence level matches the findings"32 result: "pass"33 evidence:34 - "Primary hypothesis confirmed"35 blockers: []36 branching:37 on_pass: "handoff"38 on_fail: "deepen_diagnosis"39 max_cycles: 240 contract_extensions: { confidence: "high", hypothesis_count: 3 }41```4243## Contract Compliance4445- Emit structured output compliant with [`codex-execution-contract.md`](../workflow-entry/references/codex-execution-contract.md).46- Always include baseline output fields: `status`, `summary`, `changed_files`, `tests`, `quality_gate`, `blockers`, `next_actions`.47- Validate required input fields from `../workflow-entry/references/non-entry-execution-contract-template.md` (objective, scope, constraints, acceptance_criteria, allowed_commands, sandbox_mode) before proceeding.48- Echo required skill extensions in `contract_extensions`: `confidence`, `hypothesis_count`.49- Treat missing required fields as contract violations and regenerate output before handoff.50- On contract violation (missing/invalid field, invalid status value, or missing extension keys): do not proceed; emit status: blocked with violation description in blockers.51- Reference: [`non-entry-execution-contract-template.md`](../workflow-entry/references/non-entry-execution-contract-template.md).5253## Workflow54551. Structure problem type:56 - change failure57 - new discovery582. Collect missing context and constraints.593. Gather evidence: logs, traces, failing tests, reproduction steps.604. Build hypotheses and causal chains.615. Validate hypotheses with minimal reproducible checks.626. Derive solution options with tradeoffs.637. Choose recommendation and define implementation steps.648. Record residual risks and post-fix verification items.6566## Confidence Policy6768- `high`: enough evidence to implement recommended fix safely.69- `medium`: additional investigation likely required but bounded.70- `low`: fundamental evidence gaps remain.7172If confidence is below `high`, iterate investigation up to two additional loops.73After two loops, escalate decision to user.7475## Required Output Structure7677- identified causes78- cause relationships (independent/dependent/exclusive)79- investigated scope80- recommendation with rationale81- alternatives82- residual risks83- post-resolution verification checklist8485## Hard Rules8687- Do not stop at symptom-level conclusions.88- Do not skip alternative-hypothesis evaluation.89- Do not propose fixes without impact and regression analysis.9091## Quality Gate Evidence9293- This executor owns `quality_gate` emission and branching using [`quality-gate-evidence-template.md`](../workflow-entry/references/quality-gate-evidence-template.md).94- Emit canonical fields: `gate_id`, `gate_type`, `trigger`, `criteria`, `result`, `evidence`, `blockers`, `branching`.95- Use `gate_type: diagnosis` for backend diagnosis quality checks.96- Normalize local statuses into `result: pass|fail|blocked` before handoff.97- If `result: blocked`, emit `[Stop: quality-gate-failed]` and pause for escalation handling.9899## Stop/Approval Protocol100101Use canonical markers: `[Stop: <Gate Name>]`.102Classify every stop as `approval_gate` or `escalation_gate`.103At each stop, emit a full gate record: `gate_name`, `gate_type`, `trigger`, `ask_method`, `required_user_action`, `resume_if`, `fallback_if_rejected`.104Default `ask_method` is `AskUserQuestion`.105Resume an `approval_gate` only with explicit user `approved: true`; resume an `escalation_gate` only after user direction or reroute.106Respect batch boundary: investigation loops may continue, but any write fix requires `[Stop: pre-implementation-approval]`.107Enforce `max_revision_cycles: 2`; overflow requires human intervention.108Agent-local confidence improvement never replaces user approvals.109110Stop points for this skill:111- `[Stop: pre-implementation-approval]` (`approval_gate`)112- `[Stop: high-risk-change]` (`approval_gate`)113- `[Stop: requirement-change-detected]` (`escalation_gate`)114- `[Stop: quality-gate-failed]` (`escalation_gate`)115- `[Stop: revision-limit-reached]` (`escalation_gate`)116117Full protocol and payload schema: [`../workflow-entry/references/stop-approval-section-template.md`](../workflow-entry/references/stop-approval-section-template.md).118119---120> Converted and distributed by [TomeVault](https://tomevault.io/claim/ssaattww) — claim your Tome and manage your conversions.121<!-- tomevault:4.0:skill_md:2026-04-14 -->