---
name: amp-skill-869767c69743
description: Interruption pattern detection and retrieval from Amp thread history. Use for analyzing tool rejection patterns and improving agent behavior.
version: 1.0.0
---


# Amp-Skill: Interruption Pattern Detection and Retrieval

**GF(3) Trit**: 0 (ERGODIC - coordination layer)
**Foundation**: DuckDB ACSet from Amp file-changes

## Overview

Amp-Skill distills usage patterns from Amp thread history, specifically focusing on **interruption patterns** where tool suggestions were rejected in favor of:
1. **Two-lock processes** - user requested confirmation before proceeding
2. **Complete discontinuation** - user abandoned the thread entirely
3. **Reverted operations** - user explicitly undid an AI action

## Retrieval Benchmark Metrics

| Metric | Value |
|--------|-------|
| Total Threads | 616 |
| Total Tool Calls | 2,535 |
| Threads with Interruptions | 282 (45.8%) |
| Reverted Tool Calls | 84 (3.3%) |
| Two-Lock Cascades | 47 |
| Complete Discontinuations | 22 |

## Interruption Pattern Distribution

| Pattern Type | Count | Percentage |
|--------------|-------|------------|
| abandoned | 269 | 62.4% |
| reverted | 84 | 19.5% |
| two_lock | 47 | 10.9% |
| discontinuation | 22 | 5.1% |
| high_rejection | 9 | 2.1% |

## GF(3) Distribution

| Role | Threads | Tool Calls | Reverted |
|------|---------|------------|----------|
| MINUS | 218 | 769 | 27 |
| ERGODIC | 209 | 976 | 26 |
| PLUS | 189 | 790 | 31 |

## File Types Most Frequently Reverted

1. `.org` - 28 reverts (Emacs org-mode files)
2. `.py` - 20 reverts (Python scripts)
3. `.sh` - 18 reverts (Shell scripts)
4. `.md` - 15 reverts (Markdown documentation)

## SQL Access

```sql
-- Query interruption patterns
SELECT * FROM amp_interruptions ORDER BY ts DESC;

-- Find high-rejection threads
SELECT thread_id, tool_call_count, reverted_count,
       ROUND(100.0 * reverted_count / tool_call_count, 1) as revert_pct
FROM amp_threads
WHERE reverted_count > 0
ORDER BY revert_pct DESC;

-- Detect two-lock cascades
SELECT thread_id, COUNT(*) as consecutive_reverts
FROM amp_interruptions
WHERE pattern_type = 'two_lock'
GROUP BY thread_id
ORDER BY consecutive_reverts DESC;
```

## Key Insights

### 1. Abandoned Threads (62.4%)
- Single tool call threads indicate quick task completion OR user abandonment
- Requires context analysis to distinguish

### 2. Two-Lock Cascades (10.9%)
- 47 instances of consecutive reverts within 60 seconds
- Indicates AI attempting same action repeatedly despite rejection
- **Action**: Implement backoff after 2 consecutive reverts

### 3. High-Rejection Threads (2.1%)
- 9 threads with >50% revert rate
- Top offender: 100% revert rate on `capability-signer-prototype.sh`
- **Pattern**: Security-sensitive code rejected multiple times

### 4. File Type Sensitivity
- `.org` files most frequently rejected (28)
- Personal/organizational files have higher rejection rate
- **Action**: Add confirmation prompt for org-mode edits

## Retrieval Benchmark Success Criteria

- [x] All 616 threads loaded from filesystem
- [x] All 2,535 tool calls indexed with metadata
- [x] 5 interruption pattern types detected
- [x] Two-lock pattern detection via SQL windowing
- [x] Discontinuation pattern (thread ends on revert)
- [ ] GF(3) conservation (currently imbalanced by 29)

## Usage

```bash
# Load/refresh Amp threads
bb scripts/amp_thread_loader.bb

# Query via DuckDB
duckdb trit_stream.duckdb "SELECT * FROM amp_interruptions"
```

## Integration with Triadic Protocol

When Amp-Skill detects a high-rejection pattern:
1. **MINUS (-1)**: Validate the rejection pattern
2. **ERGODIC (0)**: Coordinate alternative approaches
3. **PLUS (+1)**: Generate new solution avoiding rejected pattern

## Data Sources

- **Local**: `~/.amp/file-changes/T-*` (2,535 files)
- **API**: None currently (file-changes only contain diffs)
- **Potential**: Amp GraphQL API for full conversation history

## Forward Reference

- unified-reafference (amp universe source)


## Patterns That Work

- Interruption pattern detection via file-changes
- Cross-universe coordination with goose/claude
- GF(3) role assignment (+1 PLUS generator)

## Patterns to Avoid

- Ignoring two-lock cascades
- Missing revert tracking

---
Source attribution: plurigrid
Original project: https://github.com/plurigrid/asi/blob/293ce9f76e3abcd5ba18db284688bc0d9ac6691d/plugins/asi/skills/amp-skill/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2025 SkillCreator.ai

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: plurigrid
Original project: https://github.com/plurigrid/asi/blob/293ce9f76e3abcd5ba18db284688bc0d9ac6691d/plugins/asi/skills/amp-skill/SKILL.md
Attribution basis: Source repository record

Fields of work: Data & Analytics, Development & Engineering, Product Management
Roles: Data Analyst, ML / AI Engineer, Product Manager
Specialties: API, Database
Tools: Duckdb
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 08a89e7f37a77b5ab301a0f2a5438dded0c25609d071f482c03d04cf23aaa8cc
