openclaw-plugin-code-power
v1.1.0
Published
Enhanced coding capabilities for OpenClaw
Readme
openclaw-plugin-code-power
Code Power Plugin For OpenClaw
Overview
This repository provides an OpenClaw plugin that adds "code power" tools for software engineering tasks.
It currently registers six tools:
code_analyze: single-file and multi-file static analysis with lightweight issue detectionglob: fast file discovery by glob patternls: directory tree listing for workspace explorationmulti_edit: multiple ordered text edits on one file in a single operationtodo_write: store a structured todo list for the current sessiontodo_read: read the structured todo list for the current session
Tools
code_analyze
Parameters:
code(string, optional): source code text (single-snippet mode)language(string, optional): language label used for reportingfilename(string, optional): target label in reportfiles(array<string>, optional): explicit file paths for batch analysisglobPattern(string, optional): glob pattern for batch discoveryglobPath(string, optional): base directory forglobPatternmaxFiles(number, optional): max files collected via glob, default20includePerFile(boolean, optional): include per-file details in multi-file modeoutputMode(summary|detailed, optional): defaultsummaryincludeIssues(boolean, optional): defaulttruemaxIssues(number, optional): max issues returned per file, default10
Returns:
- Single mode: text report +
detailswith score/stats/issues - Multi mode: aggregate report +
detailswith totals, issue summary, worst files, and optional per-file entries
Notes:
- The analyzer is heuristic/regex-based, not AST-based.
- Default behavior is lightweight to reduce token usage.
glob
Parameters:
pattern(string, required): glob pattern to match filespath(string, optional): search directory (absolute or workspace-relative)
Returns:
- Matching absolute file paths sorted by modification time (newest first)
detailswith{ path, pattern, count, truncated, limit }
ls
Parameters:
path(string, optional): absolute directory path, defaults to workspace rootignore(array<string>, optional): extra directory/file names to ignore
Returns:
- Tree-style directory listing text
detailswith{ path, count, truncated, limit, ignores }
multi_edit
Parameters:
filePath(string, required): absolute file path to modifyedits(array, required): ordered list of editsoldString(string): text to replacenewString(string): replacement textreplaceAll(boolean, optional): replace all matches whentrue
Behavior:
- Applies edits sequentially in memory and writes once after validation.
- Supports creating a file when the first edit uses
oldString: "".
Returns:
- Text summary and
detailsincluding byte delta and per-edit results
todo_write
Parameters:
todos(array, required): list of todo items
Todo item shape:
id(string)content(string)status(one of):pending,in_progress,completed,cancelled
Behavior:
- Todos are stored in-memory in the plugin process.
- The store key is the session id (
ctx.sessionIdtrimmed); if missing it falls back to__global__.
Returns:
- A JSON string of the saved todos
- Tool
detailsincluding summary counts (e.g.total,active)
todo_read
Parameters:
- None
Behavior:
- Reads the same in-memory session store used by
todo_write.
Returns:
- A JSON string of all todos for the current session
- Tool
detailsincluding summary counts (e.g.total,active)
Configuration
openclaw.plugin.json uses a schema of:
{ type: "object", additionalProperties: false }
At the moment, the plugin does not require any custom configuration fields.
Install / Run (CLI)
This package also ships a CLI (openclaw-plugin-code-power, from dist/bin/cli.js).
The CLI runs two commands:
openclaw plugins install <spec> --yesopenclaw gateway restart
Recommended flow
Build:
pnpm install
pnpm run buildInstall from dist:
./dist/bin/cli.js --spec ./distCLI options
--dry-run: print commands without executing them--openclaw <cmd>: override theopenclawexecutable (default:openclaw)--spec <path>: path containingopenclaw.plugin.json- default:
OPENCLAW_PLUGIN_SPECenv var - if not set: falls back to the CLI’s package root (for the built CLI, this is typically
dist)
- default:
Development Notes
- Plugin entry:
src/plugin/index.ts - Tools:
src/plugin/tools/* - Build copies plugin sources and plugin metadata into
dist/(seescripts/build.mjs)
Notes / Limitations
todo_*data is in-memory only; it will reset when the OpenClaw gateway (or plugin process) restarts.code_analyzeis regex/heuristic based (it is not a full language parser or type-aware analyzer).glob/ls/multi_editenforce workspace boundary checks.
Thanks
License
MIT License © Herbert He
