Irmia DevKit (弥亚开发工具箱)

August 6, 2026 · View on GitHub

An AstrBot plugin providing 65 secure, structured code development tools for LLM Agents.

Requires: Python ≥ 3.10, AstrBot any version.

⚠️ This plugin is designed for single-user local development. Do not deploy in multi-user shared bot scenarios. All file operations are intended for use within the working directory only.

Installation

Place the plugin folder into AstrBot's data/plugins/ directory and restart AstrBot.

Configuration

config.json is auto-generated on first launch. All fields can be configured via AstrBot WebUI.

FieldDescription
owner_sidAdmin session ID (optional; plugin auto-reads AstrBot admin list)
allowed_idsAdditional allowed user IDs (comma-separated)
group_config_enabledEnable per-group permission config (default: false, restart required)
tool_groups10 group bool switches (false = disable entire group)
disabled_toolsComma-separated names of individually disabled tools
es_pathEverything CLI path (auto-detect if empty)
gh_pathGitHub CLI path (auto-detect if empty)
backup_dirsafe_edit backup directory (default: ~/.irmia/backups)

Dependencies

ToolDependencyBehavior if missing
es_searchEverything + es.exe (Windows) / locate / fdReturns error or Python os.walk scan
gh_pr / gh_issue / gh_release / gh_repoGitHub CLIReturns error
html_extractbeautifulsoup4, lxml optionalbs4 required, lxml falls back to html.parser
syntax_check (Nim/Go/JS/TS)Respective compilersSkipped (skipped=true)
lint_runnerruff / pylint / eslint (auto-fallback)Returns install hint
rg_searchripgrep (optional, Python fallback)Falls back to stdlib scan
config_diff (YAML)pyyaml (optional)Returns install hint
code_index (multi-lang)tree-sitter + grammar (optional)Zero-deps for Python; other languages skipped

The remaining 50+ tools use Python standard library only.

Design

safe_edit enforces a defensive editing workflow: backup → exact replacement → whitespace-tolerant fallback → syntax check → auto-rollback on failure. When the LLM's old string is off by a level of indentation, whitespace alignment automatically retries before failing. Multi-match ambiguity is resolved through occurrence=N with line-by-line previews.

Permission control: Two-layer defense — on_llm_request hook removes plugin tools from req.func_tool (LLM cannot see them) + protect_tool wraps each tool's call() with admin check. Automatically reads AstrBot's global admin list; no duplicate configuration needed.

17 tools return structured {proposal, evidence, options, next_call} on failure or ambiguity instead of plain error text.

syntax_check/lint_runner/rg_search include surrounding code context in their results, enabling the LLM to locate issues without an extra file read.

65 tools organized into 10 groups. Disable entire groups or individual tools via config.json.

Tool List (65)

🔒 Safe Edit Chain (10)

ToolDescription
safe_editBackup → replace → syntax check → keep/rollback; line-insert/delete modes; auto-strips copied line-number prefixes. Only way to edit code
safe_writeCreate new files / overwrite whole files with syntax check
safe_rollbackRollback file to a backup
safe_backupsList backup files (auto retention: 10 per file + 500MB LRU)
file_patchExact text replacement for non-code files, occurrence disambiguation
file_previewPreview replacement effect (dry-run diff)
syntax_checkSyntax check for Python / Nim / Go / JS / TS
lint_runnerCode quality check (ruff / pylint / eslint with auto-fallback)
test_runnerUnified pytest / go test / cargo test / jest runner
multi_editAtomic multi-file editing with full rollback

🔀 Git & GitHub (11)

ToolDescription
git_statusRepository status (--porcelain)
git_diffWorkspace/staged diff
git_logRecent N commits
git_commitStage + commit (>10 files blocked; files for selective staging / force)
git_branchCurrent branch
git_remoteRemote URL
git_pushPush to origin (no --force)
gh_prPull Request: create/list/merge/view
gh_issueIssue: create/list/close
gh_releaseRelease: create/list
gh_repoRepo: create/view/CI status/CI logs/auth check

📁 File System (12)

ToolDescription
safe_readEnhanced safe file read: auto-encoding, line-number prefixes, binary/hex, head/tail, line ranges, skeleton
es_searchEverything/locate/fd filename search
rg_searchFile content search (ripgrep + Python fallback)
dir_treeDirectory tree visualization
dir_listStructured directory listing
file_diffFile-to-file diff
file_hashMD5 / SHA1 / SHA256
file_zipZIP archive
file_unzipZIP extract (Zip-slip protection)
file_removeDelete files/directories (sandbox + confirmation)
disk_infoDisk partition usage (Windows/Linux)
config_diffKey-level JSON/YAML config comparison

📊 System Info (4)

ToolDescription
port_checkPort detection / batch scan
proc_listProcess list
sys_snapshotSystem snapshot (CPU/mem/processes/uptime)
tool_statsTool call statistics

🧾 Execution & Audit (2)

ToolDescription
shell_execStrict allowlisted command execution with timeout/truncation
op_logSQLite audit trail query for tool calls

🌐 Network (3)

ToolDescription
http_getHTTP GET + HTML→Markdown extraction (SSRF protection, markdown pagination by default)
http_postHTTP POST
http_downloadBinary download (500MB cap + path sandbox)

📝 Text Processing (8)

ToolDescription
html_extractHTML → text/links/tables/CSS selector
json_queryjq-style JSON path query
text_filterLine filter (grep/head/tail/count)
diff_stringsString unified diff
csv_parseCSV/TSV → structured data
csv_genStructured data → CSV/TSV
md_stripMarkdown → plain text
log_parseNginx/Apache/syslog/JSONL parser

🔤 Encoding & ⏱ Time (2)

ToolDescription
encode_decodeBase64 / URL / Hex encode/decode (action + format)
timeCurrent time / timestamp ↔ ISO / time diff (action)

🧩 Extensions (6)

ToolDescription
semver_compareSemantic version comparison
uuid_genUUID / hex / token generation
project_initProject structure scan
git_changelogGit log semantic grouping
db_querySQLite read-only query
dep_scanPython import graph + cycle detection

🤖 Code Understanding (6)

ToolDescription
code_indexBuild semantic index (symbols + call edges)
code_exploreNatural language codebase exploration
code_diff_impactBlast radius analysis for file changes
code_packPrecision context packing — collect call chain sources
code_statusIndex health check — coverage and status
symbol_renamePython symbol rename using codegraph + token replacement

🧠 Skill

NameTrigger
dev-workflowCode tasks: edit / fix / refactor / implement

Architecture

See ARCHITECTURE.md for:

  • Module dependency graph and data flow
  • How to add a new tool (step-by-step guide)
  • Response protocol specification
  • Security architecture details
  • Async execution model
  • Testing strategy

Testing

pip install pytest
python -m pytest tests/ -v

Current local verification: 678 passed and 8 skipped. Coverage includes SSRF, safe_edit, Zip-slip, SQL injection, ReDoS, registry consistency, linter/test fallback, auth permission checks, semantic indexing, atomic edits, safe command execution, and audit logging.

Version

2.6.4 · Changelog

Author

伊尔弥亚 (irmia2026) · https://github.com/irmia2026/irmia_devkit_open