agentleFS
matthewdonsemail-labmatthewdonsemail-lab/log/.claude/skills/log-log-tool-from-one-off/SKILL.md

log-log-tool-from-one-off

Skill103 starsChanged 7 days agoMITView on GitHub

Turning a hand-rolled one-off into a log tool. A log play (docs/useCases/log/toolFromOneOff.md): When the agent reaches for a one-off to get or change data (a scratch script over log.db, a raw `sqlite3` query, a `curl` to a platform or a link, a `python -c` or `bun -e`), log has no tool for that job yet. The hook labels the call `readsData` or `actsOnData` with what it touched, counts it in log.db, and says so before or right after it runs. It never blocks: the agent may finish the one-off, then makes it a real command and MCP tool so it routes from then on. The owner isn't asked; the guide below is the whole procedure.

  • Commits and pushes

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Not labelled: git, gh, bun test, tsc, log itself, a VACUUM INTO copy of log.db, the devlog, ~/.logCli/mcp logs, files written inside the …

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Turning a hand-rolled one-off into a log tool

This is the log play log/toolFromOneOff. Before anything else, call the log MCP tool getGuide({ useCase: "log/toolFromOneOff" }): it returns this page and makes it the session's play, so every log tool's answer says which step you are on and a send with no play loaded is refused (rules 157, 158). Then follow the steps in order.

Draft every message from that person's own thread and the owner's real replies (voice with no text, search), never from memory, and never send two that read alike (sameAsSent).

When the agent reaches for a one-off to get or change data (a scratch script over log.db, a raw sqlite3 query, a curl to a platform or a link, a python -c or bun -e), log has no tool for that job yet. The hook labels the call readsData or actsOnData with what it touched, counts it in log.db, and says so before or right after it runs. It never blocks: the agent may finish the one-off, then makes it a real command and MCP tool so it routes from then on. The owner isn't asked; the guide below is the whole procedure.

How the owner asks for it: "turn that one-off into a tool", "make that script a log command", "stop hand-rolling that", "vendor that query into log"

Run it from a fresh context

Say: "go on docs/useCases/log/toolFromOneOff.md for <the one-off>". The agent reads this page and runs the steps.

What the hook labels

Every host's tool call is first unwrapped into the commands it really runs, the files it writes and the code it executes: a shell heredoc that writes a script and runs it, Hermes execute_code with terminal(), write_file(), subprocess, sqlite3.connect or requests inside, a write tool making a scratch script that a later call runs, browser_exec code fetching a platform's API, and tool_call wrappers (a real mcp__log__* tool inside one is never labelled). Then:

LabelWhenTarget
readsDataa SELECT or a read-only open of log.db, reading ~/.logCli files, a GET to a platform, resolving a linklog.db (<tables>), ~/.logCli/<folder>, <platform> API, a link (<host>)
actsOnDataINSERT, UPDATE, DELETE on log.db, writing ~/.logCli files, a POST, PUT or DELETE to a platformthe same

Not labelled: git, gh, bun test, tsc, log itself, a VACUUM INTO copy of log.db, the devlog, ~/.logCli/mcp logs, files written inside the repo's src, scripts or docs, every log MCP tool, and delegate_task.

The steps

#StepToolDone when
1See the one-offs the hook counted, most frequent firsttoolScaffold with no namethe one-off is listed with its label and target
2Name it and say what it does, a dry runtoolScaffold { name, summary, flags, asks } (acts: true when it changes data)the planned files and syntax-tree edits are listed
3Write it: the command, its test, its rules, its guide group and its use case, then the docs and skills buildstoolScaffoldLive { the same, confirmLive: true }every edit landed and both builds passed
4Move the one-off's logic into the command's rows function, and its real case into the testsrc/cli/<name>/index.ts, bun test src/cli/<name>the test passes on synthetic data
5Reload the MCP so the tool exists in this sessiontouch src/mcp/server/index.ts (the reload proxy restarts the server; toolScaffoldLive does it)the tool shows up
6Call the new tool's dry run with the one-off's inputs and compare the answersthe new toolit answers what the one-off answered
7Commit it with the devlog, then open or extend the PRgit commit, gh pr createthe remote branch equals HEAD; the router offers the tool from now on

What the runs taught

  • A scratch script over log.db is the usual one. Finding a person's messages across platforms by name was a bun script with bun:sqlite, messages JOIN chats and senderLabel LIKE; it became saidBy.
  • Hermes has no hook that can advise before a tool runs. Its pre_tool_call can only block, ask the owner or rewrite the arguments, so on Hermes the advice comes with the call's result (transform_tool_result); Claude Code, Codex, OpenCode and Antigravity get it before the call.
  • Name it by the job, not the query. The name and summary are the tool's description, so the router models find it by what the owner asks for.

Related

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.