sk-hashline-protocol
Skill4 starsChanged 6 months agoMITView on GitHub
Enforces hash-anchored line verification to prevent stale-line edits during file mutations. Use when any agent performs file mutations in a worktree — mandates that read lines carry content-identifier hashes and that those hashes are verified before an edit is committed.
In this repository43 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- cutting-a-releaseSkill
- cutting-a-releaseSkill
- adding-a-pipeline-stepSkill
- brainstormingSkill
- change-modelsSkill
- creating-a-pipelineSkill
- deleting-a-pipeline-stepSkill
- finishing-a-development-branchSkill
- migrating-a-pipelineSkill
- optimizing-a-pipelineSkill
- pipeline-architect-protocolSkill
- pipeline-auditor-protocolSkill
- pipeline-failure-analyzer-protocolSkill
- pipeline-optimizer-protocolSkill
- pipeline-quality-reviewer-protocolSkill
- pipeline-spec-reviewer-protocolSkill
- pipeline-task-executor-protocolSkill
- running-a-pipelineSkill
- sk-4d-methodSkill
- sk-claude-code-conventionsSkill
- sk-dynamic-routingSkill
- sk-hierarchical-contextSkill
- skill-architect-protocolSkill
- sk-model-migrationSkill
- sk-model-resolverSkill
- sk-pipeline-grillingSkill
- sk-pipeline-pathsSkill
- sk-pipeline-patternsSkill
- sk-pipeline-stateSkill
- sk-platform-dispatchSkill
- sk-rationalization-resistanceSkill
- sk-spec-driven-developmentSkill
- sk-worktree-safetySkill
- sk-write-review-isolationSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- updating-a-pipeline-stepSkill
- using-superpipelinesSkill
- verification-before-completionSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
If the current hash does not match the recorded hash, the write operation is REJECTED.
- Distinctive: line 38
When all hashes match, the mutation is committed to the isolated worktree for Stage 1 functional review.
- Distinctive: line 42
NEVER target a file edit using static line numbers.
- Distinctive: line 43
ALWAYS re-read the file upon a hash mismatch.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Hashline Protocol — Anchored Edit Verification
<overview>
The Hashline Protocol ensures atomic mutation safety. Every line read is tagged with a 16-character content-identifier hash; an edit is only committed when the underlying file state matches the recorded hash, eliminating stale-line and whitespace-drift errors.
</overview><glossary>
<term name="Content Identifier Hash">A 16-character string appended to a line representing its exact content state.</term>
<term name="Hashline Edit">A mutation operation that references the content-identifier hash rather than a line number.</term>
</glossary>Protocol Execution
<protocol>
### 1. READ WITH HASHES
- Target files are read with line-level hash annotations.
- Expected format: `<line_number>#<HASH>| <content>`
- Example: `42#a3f9b2c1d8e04f7a| return result`2. PREPARE THE EDIT
- The target block is identified by its content, not its line number.
- The edit payload includes the explicit
<HASH>identifiers alongside the target content. - Example payload reference:
#a3f9b2c1d8e04f7a→ replacement content.
3. VERIFICATION (PRE-WRITE)
- The harness recalculates the current hash of each target line before writing.
- If the current hash does not match the recorded hash, the write operation is REJECTED.
- On rejection, the file is re-read to acquire fresh hashes; the hash is never guessed or synthesized.
4. COMMIT
- When all hashes match, the mutation is committed to the isolated worktree for Stage 1 functional review.
</protocol>
<invariants>
- NEVER target a file edit using static line numbers; always anchor to the Content Identifier Hash.
- ALWAYS re-read the file upon a hash mismatch; never guess or synthesize the current state.
- Edits must be fully localized to the targeted hashes to prevent collateral mutations.
</invariants>Reference Skills
sk-worktree-safety— Isolated worktree safety principles.
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.

