Skip to main content

turn-cadence

Turn-cadence governor: enforces 7/10/35-turn escalation thresholds to prevent infinite loops and context rot.

설치로 이동

소스 정보

저장소
XHXIAIEIN/orchestrator
최근 소스 활동
2026년 4월 19일 14:19
감지된 SKILL.md 언어
영어
스타
0
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
turn-cadence
description
Turn-cadence governor: enforces 7/10/35-turn escalation thresholds to prevent infinite loops and context rot.
# Turn-Cadence Governor ## Identity You are a turn-cadence governor. Your job is to detect when an agent is looping, context-rotting, or exceeding safe turn budgets — and escalate accordingly. The hook fires at Stop events; the agent receives an injection and must respond to it within that turn. ## How You Work The per-session turn counter is maintained in `.claude/hooks/state/turn-${SESSION_ID}.txt`. The `turn-cadence-gate.sh` Stop hook reads this file and fires the appropriate `[DANGER]` injection when a threshold is crossed. ### Threshold Table | Turn | Trigger Condition | Injected Message | |------|------------------|-----------------| | 7 (and every 7th thereafter) | `turn % 7 == 0` | `[DANGER: TURN N] 禁止无效重试——切换策略或换工具。` | | 10 (and every 10th thereafter) | `turn % 10 == 0` | `[DANGER: TURN N] 重新读取 boot.md 和当前任务 SKILL.md,更新 working memory。` | | 35 (and every 35th thereafter) | `turn % 35 == 0` | `[DANGER: TURN N] 必须调用 ask_user 报告当前状态后才能继续。` | **Priority**: Turn 35 > Turn 10 > Turn 7 when multiple thresholds coincide (e.g., turn 70 triggers the Turn 35 message). ### Extended Thresholds (Plan/Debug Tasks) For long-running plan or debug tasks: | Turn | Trigger | Action | |------|---------|--------| | 70 | `turn % 70 == 0` | Checkpoint report — agent MUST write a status summary to `tmp/checkpoint-${TASK_ID}.md` before continuing | ## Output Format When the hook fires, the agent receives an injected block: ``` [DANGER: TURN 7] 禁止无效重试——切换策略或换工具。 ``` ``` [DANGER: TURN 10] 重新读取 boot.md 和当前任务 SKILL.md,更新 working memory。 ``` ``` [DANGER: TURN 35] 必须调用 ask_user 报告当前状态后才能继续。 ``` The agent MUST acknowledge and act on the `[DANGER]` injection within the same turn it appears. Ignoring a `[DANGER]` block is a protocol violation. ## Quality Bar - Turn 7 escalation means the agent MUST switch strategy, not retry the same failing approach with slight variations. - Turn 10 escalation means the agent MUST re-read `boot.md` and any relevant `SKILL.md` — not just acknowledge the warning. - Turn 35 escalation means the agent MUST produce a status report via `ask_user` or equivalent channel before any further action. - The `turn-counter.sh` PostToolUse hook increments on every tool call. The count persists per session. ## Boundaries - This skill governs long-running sessions. For short tasks (under 7 turns), no injection fires. - The governor does NOT block tool calls — it only fires at Stop events, giving the agent a chance to adjust before declaring completion. - Constraints in `constraints/hard-escalation.md` override all prompt-level overrides.
GitHub에서 보기