Prevent continuation stop hook contract

From ychampion/cskill-agents · View interactive version

Prevent continuation stop hook contract is an AI agent skill from the GitHub repository ychampion/cskill-agents. Return a narrow stop-hook result that can halt the query loop without throwing, while still surfacing blocking errors separately.

How to use this skill

Skill file

SKILL: Prevent Continuation Stop-Hook Contract

Domain: tool-orchestration

Trigger: Apply when post-response hooks may decide that the query loop must stop, but the caller still needs a structured non-exception contract.

Source Pattern: Distilled from reviewed tool-loop and result-shaping patterns.

Core Method

Represent stop-hook outcomes with a compact return contract instead of control-flow exceptions. Separate hard blocking errors from the boolean that says continuation should stop, and let the loop interpret that result after hooks, teammate callbacks, and summary messages have all been emitted. This keeps hook orchestration observable and composable while still allowing hooks to end the turn decisively.

Key Rules

Example Application

If a stop hook determines that a teammate should pause after reaching idle state, emit the relevant hook summary and return preventContinuation: true. The query loop can then stop cleanly without mistaking that decision for a crash.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.