hashline

A safer, less error-prone alternative to patch/diff editing (e.g. apply_patch): reads files as LINE:HASH anchors and applies fail-fast, line-addressed edits.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "hashline" with this command: npx skills add tartavull/hashline/tartavull-hashline-hashline

Hashline Rust Tools

This skill provides a small CLI (hashline) that implements:

  • read: prints file contents with hashline prefixes LINE:HASH|content
  • edit: applies a list of hash-verified edits (set_line, replace_lines, insert_after, optional replace)

The goal is fail-fast edits: if the file changed since the agent last read it, anchors won’t match and the edit will be rejected.

Build

If hashline is already on your PATH (for example installed via Nix/Home Manager), skip this section.

Otherwise, from the skill directory:

cd ~/.codex/skills/hashline
cargo build

Binary path:

~/.codex/skills/hashline/target/debug/hashline

Read

hashline read path/to/file.txt

Optional:

hashline read path/to/file.txt --offset 10 --limit 50

Output format:

12:1a2b|some line content
13:9f00|next line

Use the LINE:HASH part (example 13:9f00) as anchors in edits.

Edit

Edits JSON can be either an array of edit objects, or an object with { "edits": [...] }.

1) Set (replace) a single line

hashline edit path/to/file.txt --edits-json '
[
  {"set_line": {"anchor": "3:abcd", "new_text": "replaced content"}}
]
'
  • new_text may contain \n to replace the single line with multiple lines.
  • new_text: "" deletes that line.

2) Replace a range of lines

hashline edit path/to/file.txt --edits-json '
[
  {"replace_lines": {"start_anchor": "5:aaaa", "end_anchor": "8:bbbb", "new_text": "new block\nsecond line"}}
]
'
  • new_text: "" deletes the whole range.

3) Insert after a line

hashline edit path/to/file.txt --edits-json '
[
  {"insert_after": {"anchor": "10:ccdd", "text": "inserted line"}}
]
'

4) Content replace (no anchors)

This is optional and runs after anchor-based edits.

hashline edit path/to/file.txt --edits-json '
[
  {"replace": {"old_text": "foo", "new_text": "bar", "all": true}}
]
'

Preview

hashline edit path/to/file.txt --edits-file edits.json --preview

Agent usage pattern

  1. hashline read <file>
  2. Select the exact line anchors you will target.
  3. Call hashline edit <file> --edits-json ... with those anchors.
  4. If you get a “changed since last read” error, re-read and retry with updated anchors.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

ll-feishu-audio

飞书语音交互技能。支持语音消息自动识别、AI 处理、语音回复全流程。需要配置 FEISHU_APP_ID 和 FEISHU_APP_SECRET 环境变量。使用 faster-whisper 进行语音识别,Edge TTS 进行语音合成,自动转换 OPUS 格式并通过飞书发送。适用于飞书平台的语音对话场景。

Archived SourceRecently Updated
General

test_skill

import json import tkinter as tk from tkinter import messagebox, simpledialog

Archived SourceRecently Updated
General

51mee-resume-profile

简历画像。触发场景:用户要求生成候选人画像;用户想了解候选人的多维度标签和能力评估。

Archived SourceRecently Updated
General

51mee-resume-parse

简历解析。触发场景:用户上传简历文件要求解析、提取结构化信息。

Archived SourceRecently Updated