agentleFS
gustavo-meilusgustavo-meilus/superpipelines/skills/sk-hashline-protocol/SKILL.md

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.

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
  1. Distinctive:

    If the current hash does not match the recorded hash, the write operation is REJECTED.

    line 34
  2. Distinctive:

    When all hashes match, the mutation is committed to the isolated worktree for Stage 1 functional review.

    line 38
  3. Distinctive:

    NEVER target a file edit using static line numbers.

    line 42
  4. Distinctive:

    ALWAYS re-read the file upon a hash mismatch.

    line 43

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.