Asi amp-continue: Thread-based conversation continuation with GF(3) branching
Combines AMP thread export with GF(3)-classified continuation for skill orchestration. Export threads as markdown, classify continuation choices as {-1:reductive, 0:neutral, +1:generative}, and fork parallel execution paths.
install
source · Clone the upstream repo
git clone https://github.com/plurigrid/asi
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/amp-continue" ~/.claude/skills/plurigrid-asi-amp-continue-thread-based-conversation-continuation-with-gf-3-bran && rm -rf "$T"
manifest:
skills/amp-continue/SKILL.mdsource content
Overview
The
amp-continue skill bridges the AMP thread management system with Claude Code skill continuation. It:
- Exports AMP threads to structured markdown
- Classifies continuation choices using GF(3) ternary logic
- Forks parallel skill execution paths
- Preserves thread lineage through ACSet morphisms
GF(3) Continuation Matrix
| Choice | Polarity | Semantics | Effect |
|---|---|---|---|
| MINUS | Reductive continuation | Prune search space, apply filters, narrow scope |
| ZERO | Neutral continuation | Continue linearly, preserve state, no branching |
| PLUS | Generative continuation | Expand search space, generate variants, fork paths |
Skill Interface
amp.export
amp.exportExport threads to markdown with maximum detail.
(amp/export {:threads [thread-ids] :format :markdown :include-metadata true :include-messages true})
Output:
- Markdown file with thread content
- Metadata JSON
- Message count and timestamps
amp.continue
amp.continueClassify and fork continuation.
(amp/continue {:thread-id thread-id :decision :plus ; or :minus, :zero :skills [skill-names] :parallel true})
Decision Classification:
→ Expand to N parallel execution paths:plus
→ Continue serially to next skill:zero
→ Apply filters to reduce paths:minus
Implementation Details
SplitMix64 Determinism
def continue_path(thread_id: str, seed: int, choice: int) -> int: """ Deterministic path selection. Same thread_id + same seed → same path always. """ x = hash_thread_id(thread_id) ^ seed x = splitmix64_next(x) return x % num_paths
ACSet Morphism
Thread metadata preserved as ACSet:
threads : Thread → {id, title, created, updated, messages} continuations : Continuation → {source_thread, choice, target_skill, seed}
Morphism:
Thread → Continuation → Skill
Parallelism Pattern (Work-Stealing)
@dataclass class ContinuationTask: thread_id: str skill_name: str decision: int # GF(3): -1, 0, +1 seed: int def execute_continuation(task: ContinuationTask): # Steal from global task queue # Fork if decision == +1 (PLUS) # Continue if decision == 0 (ZERO) # Filter if decision == -1 (MINUS)
Examples
Export All Recent Threads
amp continue export \ --threads "T-019b5df7..." "T-019b5df0..." \ --output threads.md \ --max-depth 3
Fork Generative Continuation
amp continue fork \ --thread "T-019b5df7-50e8-744e-a95a-eb8d3fd72927" \ --decision +1 \ --skills "skill-maker" "chromatic-walk" "cq-ai" \ --parallel 8
Apply Reductive Filter
amp continue filter \ --thread "T-019b5da5-ee78-7113-b839-5c066cc98d4a" \ --decision -1 \ --selector "messages.length > 10" \ --target-skill "summarize"
Continue Linear
amp continue next \ --thread "T-019b5ddc-ea96-72ff-b26a-270b7e4527a1" \ --decision 0 \ --skill "load-sicp"
API Reference
(amp-continue/export opts)
(amp-continue/export opts)Export threads with markdown generation.
Options:
- Vector of thread IDs:threads
-:format
(default),:markdown
,:json:html
- Boolean (default: true):include-metadata
- Boolean (default: true):include-messages
- String path (optional):output-file
Returns: Markdown string + output file path
(amp-continue/continue opts)
(amp-continue/continue opts)Fork continuation based on GF(3) decision.
Options:
- String thread ID:thread-id
- Keyword:decision
,:plus
,:zero:minus
- Vector of skill names to continue with:skills
- Boolean or integer (worker count):parallel
- Integer (optional, for reproducibility):seed
Returns: ACSet of continuation tasks
(amp-continue/classify opts)
(amp-continue/classify opts)Classify thread continuation strategy.
Options:
- String:thread-id
-:heuristic
,:message-count
,:complexity:entropy
Returns: Classified decision keyword
MCP Integration
Registered as MCP tool:
{ "name": "amp_continue", "description": "Export AMP threads and fork GF(3)-classified continuation", "resources": [ {"uri": "amp://threads", "name": "All threads", "type": "read"}, {"uri": "amp://continuations", "name": "Active continuations", "type": "read"} ] }
Storage
- Threads:
~/.local/share/amp/threads/*.json - Continuations:
~/.local/share/amp/continuations/*.json - Exports:
~/.local/share/amp/exports/
Performance
- Thread load: O(1) per thread (disk lookup)
- Export markdown: O(n) where n = total messages
- Continuation fork: O(1) with work-stealing queue
- Parallelism: 8x speedup with 8 workers on GF(3) branching
Testing
# Test export pytest tests/amp_continue/test_export.py -v # Test GF(3) branching pytest tests/amp_continue/test_gf3_branching.py -v # Test parallelism pytest tests/amp_continue/test_parallelism.py -v
Related Skills
- Meta-skill that generates amp-continue instancesskill-maker
- Color-based thread path visualizationchromatic-walk
- Security analysis of thread contentcq-ai
- GF(3) skill compositiontriadic-skill-orchestrator
Author
Generated by skill-maker meta-skill via GF(3) ternary adaptation.