theseus-protocol
Skill64 starsChanged 4 months agoMITView on GitHub
Thoughtbox-first Theseus workflow for behavior-preserving refactors. Use this when structure changes but behavior must stay fixed and scope drift needs hard boundaries.
- Deletes or force-pushes
In this repository102 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- assumptionsSkill
- capture-learningSkill
- Codex-opus-4-6-promptingSkill
- Codex-promptSkill
- mcp-code-modeSkill
- deploy-team-hubSkill
- diagramSkill
- distillSkill
- effect-tsSkill
- escalateSkill
- evalSkill
- experimentSkill
- hddSkill
- hub-auditSkill
- hub-collabSkill
- implementSkill
- knowledgeSkill
- peer-notebook-delivery-guardSkill
- research-taskSkill
- session-reviewSkill
- source-command-hdd-decideSkill
- source-command-hdd-hddSkill
- source-command-hdd-researchSkill
- source-command-hdd-stage-adrSkill
- source-command-hdd-validateSkill
- statusSkill
- supabaseSkill
- synthesizeSkill
- tasteSkill
- teamSkill
- test-suiteSkill
- thoughtbox:debugSkill
- thoughtbox:decisionSkill
- thoughtbox:evolutionSkill
- thoughtbox:knowledge-querySkill
- thoughtbox:onboardSkill
- thoughtbox:refactorSkill
- thoughtbox:researchSkill
- thoughtbox:session-reviewSkill
- thoughtbox-teamSkill
- ulc-loopSkill
- ulysses-protocolSkill
- workflow-brainstormingSkill
- workflow-ideationSkill
- workflow-reflectionSkill
- workflow-revisionSkill
- workflows-compoundSkill
- workflowSkill
- workflows-planSkill
- workflows-reviewSkill
- workflows-workSkill
- workflow-tournamentSkill
- assumptionsSkill
- capture-learningSkill
- claude-opus-4-6-promptingSkill
- claude-promptSkill
- mcp-code-modeSkill
- deploy-team-hubSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Do not use .theseus/ files or scripts/theseus.sh as authoritative state.
- Very specific: line 18
Do not rely on implicit git reset --hard recovery in the active workflow.
- Very specific: line 19
Do not use legacy direct handles like thoughtbox_gateway or thoughtbox_theseus as the interaction surface when Code Mode is available.
- Very specific: line 37
If you need schema or example confirmation, call thoughtbox_search before executing.
- Very specific: line 39
Use thoughtbox_execute and call tb.theseus({ operation: ...
- Very specific: line 64
After init, test files are write-locked and out-of-scope writes require a visa.
- Very specific: line 106
Before checkpoint, you may optionally run a reviewer or judge agent to produce the Cassandra-style audit.
- Distinctive: line 138
Use the returned state as the only source of truth for scope, visas, and audit history.
- Distinctive: line 158
Test files are never modified during the refactor.
- Distinctive: line 166
Use subagents only at explicit checkpoint phases.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Theseus Protocol
Theseus is a Thoughtbox-owned refactoring protocol.
The server-side Theseus implementation behind tb.theseus(...) owns scope,
visa state, audit state, and terminal status.
Codex hooks only ask Thoughtbox whether a write should be blocked.
Do not use .theseus/ files or scripts/theseus.sh as authoritative state.
Do not rely on implicit git reset --hard recovery in the active workflow.
Do not use legacy direct handles like thoughtbox_gateway or thoughtbox_theseus
as the interaction surface when Code Mode is available.
API Surface
The current public Thoughtbox MCP surface is Code Mode:
- Discovery:
thoughtbox_search - Execution:
thoughtbox_execute - Theseus operations:
tb.theseus({ ... })
Each thoughtbox_execute call should contain at most one state-mutating
Theseus operation. Read-only confirmation calls such as
tb.theseus({ operation: "status" }) are safe to use for state checks.
Runtime Contract
- Protocol entry is explicit-only in v1.
- If you need schema or example confirmation, call
thoughtbox_searchbefore executing. - Use
thoughtbox_executeand calltb.theseus({ operation: ... })for every protocol transition. - Hooks consult Thoughtbox before mutating file operations.
- Hooks do not spawn agents or mutate protocol state.
- Helper agents may audit or gather evidence, but only the coordinator calls
tb.theseus.
Commands
init
Required inputs:
- Declared scope
- Optional refactor description
Call:
async () => {
return await tb.theseus({
operation: "init",
scope: ["src/module-a.ts", "src/module-b/"],
description: "<refactor goal>",
});
}After init, test files are write-locked and out-of-scope writes require a visa.
visa
Required inputs:
- Out-of-scope file path
- Justification
Call:
async () => {
return await tb.theseus({
operation: "visa",
filePath: "src/dependency.ts",
justification: "<why the scope must expand>",
antiPatternAcknowledged: true,
});
}This is the only supported way to expand scope in the active workflow.
checkpoint
Required inputs:
- Diff hash or equivalent checkpoint identity
- Atomic narrative
- Cassandra verdict
Call:
async () => {
return await tb.theseus({
operation: "checkpoint",
diffHash: "<diff hash>",
commitMessage: "<atomic narrative>",
approved: true,
feedback: "<optional audit rationale>",
});
}Before checkpoint, you may optionally run a reviewer or judge agent to produce the Cassandra-style audit. That agent returns only a verdict and rationale. The coordinator records the outcome with tb.theseus.
outcome
Required inputs:
- Whether validation passed
- Optional details
Call:
async () => {
return await tb.theseus({
operation: "outcome",
testsPassed: false,
details: "<what failed>",
});
}The protocol records whether the refactor remains in a valid state. Recovery requirements are described by protocol state, not hidden local git resets.
status
Call:
async () => {
return await tb.theseus({
operation: "status",
});
}Use the returned state as the only source of truth for scope, visas, and audit history.
complete
Call:
async () => {
return await tb.theseus({
operation: "complete",
terminalState: "complete",
summary: "<what structural yield was achieved>",
});
}Completion should yield protocol closure plus reusable knowledge about successes, audit failures, or scope exhaustion.
Invariants
- Scope is explicit and server-owned.
- Test files are never modified during the refactor.
- Out-of-scope writes require a visa.
- Checkpoints are explicit and auditable.
- Audit evidence may come from helper agents, but state transitions belong to the coordinator.
- Knowledge capture includes failures, not just successful refactors.
Subagent Use
Use subagents only at explicit checkpoint phases.
Good uses:
- Cassandra-style audit before
checkpoint - Independent diff review for premature abstraction
- Focused evidence gathering around a requested visa
Bad uses:
- Hook-triggered subagents
- Letting a helper agent call
tb.theseus - Treating git rollback behavior as the protocol itself
References
- Public MCP surface:
thoughtbox_search,thoughtbox_execute - Theseus SDK call:
tb.theseus({ operation: ... }) - Durable context and thought trace: Thoughtbox session, thought, and knowledge operations through Code Mode
- Protocol implementation:
src/protocol/theseus-tool.ts - Enforcement design reference:
references/theseus-gate.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

