← Catalog

@srobroek/pi-agent-mechanic

mechanic subagent: cheap, exact mechanical edits (renames, bulk edits, formatting, moving code) that run the given check.

Package

Install

Install with PiG

pig install npm:@srobroek/pi-agent-mechanic

Install with Pi

pi install npm:@srobroek/pi-agent-mechanic
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "subagents": {
    "agents": [
      "./agents"
    ]
  },
  "extensions": [
    "./_kit/prereqs.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.10.0 (README.md). PiG does not review it.

agent-mechanic

A lean mechanic subagent for mechanical edits: renames, bulk edits, formatting and moving code, where the caller has already decided the change.

Agent

mechanic (mode subagent, steps 60):

  • does exactly the described change, with no redesign or unrelated cleanup;
  • finds every occurrence first, including imports, tests and docs;
  • runs the check the caller names, or the repository's obvious test or typecheck;
  • stops and reports anything that is not purely mechanical;
  • replies with VERDICT: DONE|PARTIAL|BLOCKED, the changed paths and the check result, in at most 120 words.

It may read, grep, glob, edit (which covers write and patch) and run shell. It may load skills from the lang-*, quality-* and toolchain-* families that OpenCode allows it, only for how to do the change in that language. Code Mode (execute) and subagents are denied. Its rules also deny questions and web access, so its requests carry no tool catalog. .env reads and external_directory ask. It declares the cheap model tier through the x-opencode-model-role request header, so with the model-roles plugin that tier picks its model; without it the agent inherits the caller's model.

Pi tools

Pi mechanic is allowlisted for symbol_search, module_report, project_report, read_symbol, read_enclosing, ast_grep_search, ast_grep_outline, lens_diagnostics, pi_lens_activate_tools, ast_grep_replace, and lsp_navigation from required companion pi-lens. pi-subagents is also required for the subagent runtime.

Pi mechanic lists the skills OpenCode allows it and inherits no other skill.

pi-lens keeps ast_grep_* tools inactive until pi_lens_activate_tools runs; they are available starting the next turn. Call lsp_navigation rename, rename_file and codeAction with apply: false to get the planned edits, check every target path is inside your working directory, then apply them with the edit/write tools.

Install

Install the Pi package from npm:

pi install npm:@srobroek/pi-agent-mechanic
opencode plugin add 'github:srobroek/harness-plugins::path:plugins/agent-mechanic/opencode'

OMP installs the same agent from this repository's marketplace:

omp plugin marketplace add srobroek/harness-plugins
omp plugin install agent-mechanic@harness-plugins

In OMP the agent runs on the @smol role and has the read, grep, ast_grep, glob, edit, write, ast_edit and bash tools. OMP has no per-path ask, so .env reads and external_directory do not ask there. The generated agent file lists what its translation drops.

This plugin ships no skills, so it is not in the Claude Code marketplace.

Works with

This package works with these pi packages. Install them next to it.

PackageRequiredForInstall
pi-subagentsyesthe subagent toolpi install npm:pi-subagents
pi-lensyescode-intelligence and structural-edit tools for the subagentpi install npm:pi-lens