# Impasse Detector

> Detects when the agent is stuck in a reasoning loop or unproductive state by analyzing tool usage and sentiment patterns.

- **Type:** Skill
- **Install:** `agentstack add skill-sounder25-foundational-agent-skills-17-impasse-detector`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Sounder25](https://agentstack.voostack.com/s/sounder25)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [Sounder25](https://github.com/Sounder25)
- **Source:** https://github.com/Sounder25/Foundational-Agent-Skills/tree/main/17_impasse_detector

## Install

```sh
agentstack add skill-sounder25-foundational-agent-skills-17-impasse-detector
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# SKILL-017: Impasse Detector

## Overview

Critical **meta-cognitive skill** that acts as a circuit breaker for unproductive loops. It analyzes recent conversation history and tool outputs to detect "stuck" states, preventing token wastage on failing paths and forcing escalation or delegation.

## Trigger Phrases

- `check logic`
- `am i stuck`
- `detect loop`
- `impasse check`

## Inputs

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `--TranscriptPath` | string | No | $null | Path to conversation log/json |
| `--Content` | string | No | $null | Direct string content to analyze |
| `--Lookback` | int | No | 10 | Number of recent turns to analyze |

## Outputs

### 1. Analysis Result (JSON)

```json
{
  "status": "IMPASSE",
  "confidence": 0.95,
  "reasons": [
    "Apology loop detected (4 occurrences)",
    "High frequency of file reads (6 in window)"
  ],
  "recommendation": "ESCALATE_TO_USER",
  "score": 80
}
```

### 2. Status Codes

- `CLEAR`: No issues detected.
- `IMPASSE`: Significant loop/blockage detected.
- `UNKNOWN`: Insufficient data.

## Preconditions

1. Access to conversation history OR a provided transcript string.
2. PowerShell 5.1+ or Core 7+.

## Safety/QA Checks

1. **Read-Only**: This skill only analyzes text; it does not modify state.
2. **Fail-Safe**: If input is missing/malformed, defaults to "UNKNOWN" rather than crashing.

## Stop Conditions

| Condition | Action |
|-----------|--------|
| No input provided | Return status "UNKNOWN" (0 confidence) |
| File not found | Return error JSON |

## Implementation

See `scripts/detect_impasse.ps1`.

## Integration with Other Skills

**All agent loops should:**

1. Call SKILL-017 every 5-10 turns.
2. If status is `IMPASSE`, trigger **SKILL-020 (Failure Postmortem)** AND **SKILL-010 (Async Feedback)**.
3. If score > 90, stop execution and warn user.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Sounder25](https://github.com/Sounder25)
- **Source:** [Sounder25/Foundational-Agent-Skills](https://github.com/Sounder25/Foundational-Agent-Skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-sounder25-foundational-agent-skills-17-impasse-detector
- Seller: https://agentstack.voostack.com/s/sounder25
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
