Skip to content

09: Retire root-level plugin infrastructure — delete src/, commands/, .codex-plugin/, clean root to pure workspace #57

Description

@MatthewYe

Parent

#47

Depends on

#56 (Move shared content assets into core) — must complete first

What to build

#56 完成后,根级旧插件的所有资产已迁入 packages/core/。本 issue 退役剩余的根级插件基础设施,将根目录退化为纯 monorepo workspace root。

删除清单

路径 说明 替代者
src/index.ts 根级 OpenCode plugin 入口 packages/opencode/src/index.ts
src/shared.ts 重复的 shared 逻辑 packages/core/src/shared.ts#56 已处理)
src/generate-codex.ts 根级 Codex 生成器 packages/codex/src/index.ts
src/ 整个目录 所有 4 个文件
commands/ 旧版手写 autopilot 命令 packages/opencode/commands/(模板拼接)
.codex-plugin/ 根级 plugin.json packages/codex/.codex-plugin/
templates/agents/ 旧版 .toml agent 文件 packages/codex/.codex/agents/

清理清单

路径 操作 说明
skills/ 删除上游技能副本,仅保留本地 4 个(skill-creatoropencode-plugin-scaffoldsetup-autopilotaudit-autopilot 构建脚本从 upstream/skills/ 独立复制
templates/ 删除 AGENTS.mdagents/(已在 #56 迁移) templates/ 清空后可删除目录

package.json 改造

退化为纯 workspace root:

- "name": "@matthewye/autopilot-toolkit",
+ "name": "autopilot-toolkit-monorepo",
+ "private": true,
- "main": "./dist/index.js",
- "files": [...],
- "dependencies": {
-   "@opencode-ai/plugin": "latest",
-   "adm-zip": "^0.5.17",
-   "gray-matter": "^4.0.3"
- },
- "devDependencies": {
-   "@types/adm-zip": "^0.5.8",
-   "@types/node": "latest",
-   ...
- },
  "scripts": {
-   "build": "... && bun build src/index.ts --outdir dist --target node && bun run src/generate-codex.ts",
+   "build": "bun run build:core && bun run build:opencode && bun run build:codex",
-   "dev": "bun run --watch src/index.ts",
    "test": "bun test",
    ...
  }

保留的 devDependencies:@biomejs/biome@types/buntypescript

skills/ 清理

删除可通过 upstream/skills/ 获取的上游技能副本(约 20+ 个目录),仅保留 4 个本地原创技能。

Acceptance criteria

  • src/ 目录完全删除
  • commands/ 目录完全删除
  • .codex-plugin/ 目录完全删除
  • templates/agents/ 删除(AGENTS.md 已在 08: Move shared content assets into core package #56 迁移)
  • skills/ 仅含 4 个本地技能,无上游副本
  • package.json 退化为纯 workspace root(private: true,无 main/files/dependencies
  • bun run build 全量通过
  • bun test 全部通过
  • bun run lint:autopilot 无回归
  • git status 无意外 untracked/staged 文件

Blocked by

#56

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolvedAutopilot has resolved this issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions