Version 0.9.0 · CLI: openmole init · openmole update
npm 官方包名 / npm package name:
openmole
安装:npm install -g openmole· CLI 命令已更名openmole
npm official package name:
openmole— install withnpm install -g openmole. The CLI command isopenmole.
OpenMole is a refactoring methodology and agent plugin framework driven by code bad smells. Rules live in phase skills; project artifacts live under openmole/changes/<change-name>/.
| Command (IDE slash / protocol) | Skill | Phase |
|---|---|---|
/mole-explore · mole:explore
|
openmole-explore |
Create/continue change; identify bad smells |
/mole-plan · mole:plan
|
openmole-plan |
Task breakdown |
/mole-verify · mole:verify
|
openmole-verify |
Verify coverage |
/mole-apply · mole:apply
|
openmole-apply |
Execute refactoring |
/mole-archive · mole:archive
|
openmole-archive |
Archive change |
Main outputs per phase: badsmells.md, tasks.md, analysis.md, and code changes.
openmole/
├── config.yaml # current_change · installed_ides · init_version · init_at
└── changes/
├── <change-name>/
│ ├── badsmells.md
│ ├── tasks.md
│ └── analysis.md
└── archive/
mole:explore → review badsmells → mole:plan → review tasks → mole:verify → mole:apply → user confirm → mole:archive
openmole/ # npm package root
├── bin/openmole.js # CLI entry
├── cli/ # init · update · IDE adapters
├── skills/ # phase skills (openmole-*)
├── commands/ # IDE commands (mole-*.md)
├── .cursor-plugin/ # Cursor manifest
├── .claude-plugin/ # Claude Code manifest
├── .codex/ # Codex install guide
├── gemini-extension.json # Gemini CLI extension
├── .opencode/plugins/openmole.js # OpenCode plugin (zero npm deps at runtime)
└── templates/ # config / gitignore templates
- Skills / Commands: Markdown + YAML frontmatter
- Plugin harnesses: Cursor, OpenCode, Claude Code, Codex, Gemini CLI, Kiro, Qoder, WorkBuddy, Trae
-
CLI: Node.js ESM +
@clack/prompts(CLI only; plugin runtime has no third-party npm deps) - License: MIT
npm registry (recommended)
npm install -g openmole
cd /path/to/your-project
openmole init # welcome screen → interactive IDE selectionClone + link (development)
git clone https://github.com/agiledon/openmole.git
cd openmole && npm install && npm link
cd /path/to/your-project
openmole initInstall CLI from GitHub
npm install -g github:agiledon/openmole
cd /path/to/your-project
openmole initPackage name on npm is
openmole(theopenmolename is taken). The CLI command isopenmole.
After upgrading OpenMole, run openmole update in the target project to refresh IDE configs.
| Flag | Description |
|---|---|
--ides cursor,opencode,... |
Non-interactive IDE list |
--all |
Configure all 9 IDEs |
--none |
Workspace only (openmole/) |
--force |
Overwrite existing workspace / IDE config |
--global |
OpenCode user config (~/.config/opencode/) |
--dry-run |
Print plan only |
openmole init will:
- Create
openmole/config.yaml,openmole/changes/,openmole/changes/archive/ - Install skills/commands per selected IDE (see table)
- Merge gitignore snippet into
.gitignore(machine-local symlinks)
| IDE | Install model |
|---|---|
| Cursor | Project .cursor/skills/ + .cursor/commands/; user symlink ~/.cursor/plugins/local/openmole
|
| OpenCode | Project opencode.json → .opencode/plugins/openmole.js (--global → user config) |
| Claude Code | Project .claude/skills/ + .claude/commands/; user symlink ~/.claude/plugins/local/openmole
|
| Codex | Project .codex/skills/ (skills only, Codex does not expose slash commands) |
| Gemini CLI | Project .gemini/skills/, .gemini/commands/, .gemini/extensions/openmole symlink |
| Kiro | Project .kiro/skills/, .kiro/commands/
|
| Qoder | Project .qoder/skills/, .qoder/commands/
|
| WorkBuddy | Project .workbuddy/skills/, .workbuddy/commands/
|
| Trae | Project .trae/skills/ (no slash commands; skills auto-discovered) |
Extend mode: If openmole/config.yaml exists, workspace is preserved; only IDEs missing from installed_ides are configured.
Re-install IDE configs listed in openmole/config.yaml installed_ides (use after upgrading OpenMole):
openmole update
openmole update /path/to/project
openmole update --dry-run| IDE | Doc |
|---|---|
| Cursor | .cursor/INSTALL.md |
| OpenCode | .opencode/INSTALL.md |
| Claude Code | .claude/INSTALL.md |
| Codex | .codex/INSTALL.md |
| Gemini CLI | .gemini/INSTALL.md |
| Kiro | .kiro/INSTALL.md |
| Qoder | .qoder/INSTALL.md |
| WorkBuddy | .workbuddy/INSTALL.md |
| Trae | .trae/INSTALL.md |
bash scripts/validate-cli.sh # full CLI + plugin tests + npm pack check
bash scripts/validate-plugin.sh # plugin only
bash scripts/npm-pack-check.sh # tarball content check
npm link && openmole --helpMaintainers: publish with npm publish --access public (package name openmole).
- Plugin architecture inspired by Superpowers
- Change workspace design
- CLI init design
- OpenSpec: mole-cli-init (archived)
OpenMole 框架在 npm 官方包名为
openmole— 安装:npm install -g openmole。CLI 命令已更名openmole。
OpenMole(坏味道驱动重构)是一套面向编码 Agent 的软件重构方法论与 Plugin 框架。规约内嵌于各 phase skill;目标项目工件位于 openmole/changes/<change-name>/。
当前版本:0.9.0(CLI:openmole init · openmole update)
| 命令(IDE slash / 协议) | Skill | 阶段 |
|---|---|---|
/mole-explore · mole:explore
|
openmole-explore |
创建/继续 change,识别坏味道 |
/mole-plan · mole:plan
|
openmole-plan |
任务分解 |
/mole-verify · mole:verify
|
openmole-verify |
覆盖验证 |
/mole-apply · mole:apply
|
openmole-apply |
重构执行 |
/mole-archive · mole:archive
|
openmole-archive |
归档 change |
各阶段主要产出:badsmells.md、tasks.md、analysis.md、代码变更。
openmole/
├── config.yaml # current_change · installed_ides · init_version · init_at
└── changes/
├── <change-name>/
│ ├── badsmells.md
│ ├── tasks.md
│ └── analysis.md
└── archive/
mole:explore → 审阅 badsmells → mole:plan → 审阅 tasks → mole:verify → mole:apply → 用户确认 → mole:archive
openmole/ # npm package root
├── bin/openmole.js # CLI 入口
├── cli/ # init · update · IDE adapters
├── skills/ # phase skills(openmole-*)
├── commands/ # IDE commands(mole-*.md)
├── .cursor-plugin/ # Cursor manifest
├── .claude-plugin/ # Claude Code manifest
├── .codex/ # Codex install guide
├── gemini-extension.json # Gemini CLI extension
├── .opencode/plugins/openmole.js # OpenCode plugin(零 npm 依赖)
└── templates/ # config / gitignore 模板
- Skill / Command:Markdown + YAML frontmatter
- Plugin harness:Cursor、OpenCode、Claude Code、Codex、Gemini CLI、Kiro、Qoder、WorkBuddy、Trae
-
CLI:Node.js ESM +
@clack/prompts(仅 CLI;plugin 运行时零第三方依赖) - 许可证:MIT
npm registry(推荐)
npm install -g openmole
cd /path/to/your-project
openmole init # welcome 画面 → 交互式选择 IDE本仓库开发 / 本地 link
git clone https://github.com/agiledon/openmole.git
cd openmole && npm install && npm link
cd /path/to/your-project
openmole init从 GitHub 安装 CLI
npm install -g github:agiledon/openmole
cd /path/to/your-project
openmole initnpm 包名为
openmole(openmole已被占用);CLI 命令已更名openmole。
升级 OpenMole 后,在目标项目执行 openmole update 刷新 IDE 配置。
| 选项 | 说明 |
|---|---|
--ides cursor,opencode,... |
非交互指定 IDE |
--all |
配置全部 9 个 IDE |
--none |
仅创建 openmole/ 工作区 |
--force |
覆盖已有 workspace / IDE 配置 |
--global |
OpenCode 写入用户级 ~/.config/opencode/
|
--dry-run |
只打印计划,不写文件 |
openmole init 会:
- 创建
openmole/config.yaml、openmole/changes/、openmole/changes/archive/ - 按所选 IDE 安装 skill/command(见下表)
- 合并 gitignore 片段 到项目
.gitignore(忽略机器相关的 plugin symlink)
| IDE | 安装方式 |
|---|---|
| Cursor | 项目 .cursor/skills/ + .cursor/commands/;用户级 ~/.cursor/plugins/local/openmole symlink |
| OpenCode | 项目 opencode.json 注册 .opencode/plugins/openmole.js(--global → 用户配置) |
| Claude Code | 项目 .claude/skills/ + .claude/commands/;用户级 ~/.claude/plugins/local/openmole symlink |
| Codex | 项目 .codex/skills/(仅 skill,Codex 无 slash 命令概念) |
| Gemini CLI | 项目 .gemini/skills/、.gemini/commands/、.gemini/extensions/openmole symlink |
| Kiro | 项目 .kiro/skills/、.kiro/commands/
|
| Qoder | 项目 .qoder/skills/、.qoder/commands/
|
| WorkBuddy | 项目 .workbuddy/skills/、.workbuddy/commands/
|
| Trae | 项目 .trae/skills/(无 slash 命令;skill 自动发现) |
Extend 模式:已存在 openmole/config.yaml 时保留 workspace,仅为 installed_ides 中缺失的 IDE 追加配置。
在已 init 的项目中,按 openmole/config.yaml 的 installed_ides 重新安装 IDE 配置(升级 OpenMole 包后使用):
openmole update # 当前目录
openmole update /path/to/project
openmole update --dry-run| IDE | 文档 |
|---|---|
| Cursor | .cursor/INSTALL.md |
| OpenCode | .opencode/INSTALL.md |
| Claude Code | .claude/INSTALL.md |
| Codex | .codex/INSTALL.md |
| Gemini CLI | .gemini/INSTALL.md |
| Kiro | .kiro/INSTALL.md |
| Qoder | .qoder/INSTALL.md |
| WorkBuddy | .workbuddy/INSTALL.md |
| Trae | .trae/INSTALL.md |
bash scripts/validate-cli.sh # CLI + plugin 全量测试 + npm pack 检查
bash scripts/validate-plugin.sh # plugin only
bash scripts/npm-pack-check.sh # 发布前 tarball 内容检查
npm link && openmole --help维护者:npm publish --access public 发布(包名 openmole)。
bash scripts/npm-pack-check.sh # 验证 tarball 内容
npm pack # 本地预览(可选)