migrate-to-modules

migrate-to-modules is a skill for Claude Code from ryanzhao1011/workframe. It costs 169 tokens per session (3,699 once invoked), scanned B, original, MIT.

A migration workflow for moving an older project into a modules directory structure. It designs the module tree, previews each file’s new location, waits for review, then moves files, writes metadata, and rebuilds indexes.

In plain words
What is it for?
Use it to migrate scattered project documents and assets into modules, preserve backups where applicable, replace references, and rebuild the project index.
Why use it?
It reduces the risk of breaking references or losing files when reorganising an existing project, while requiring review before changes are made.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the core plugin — 36 skills, 4 agents, 12 hooks shipped together

Good fit Use it to migrate scattered project documents and assets into modules, preserve backups where applicable, replace references, and rebuild the project index.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ryanzhao1011/workframe/migrate-to-modules
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ryanzhao1011/workframe --skill migrate-to-modules
Clone the repo
git clone --depth 1 https://github.com/ryanzhao1011/workframe

Made for: Claude Code.

Or install core, the plugin that ships this one along with the rest of its 36 skills, 4 agents, 12 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for migrate-to-modules

README.md
[![agentmods](https://agentmods.dev/badge/skills/ryanzhao1011/workframe/migrate-to-modules/github.svg)](https://agentmods.dev/skills/ryanzhao1011/workframe/migrate-to-modules)
Your own site
<a href="https://agentmods.dev/skills/ryanzhao1011/workframe/migrate-to-modules"><img src="https://agentmods.dev/badge/skills/ryanzhao1011/workframe/migrate-to-modules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for migrate-to-modules

Your own site · 80×15
<a href="https://agentmods.dev/skills/ryanzhao1011/workframe/migrate-to-modules"><img src="https://agentmods.dev/badge/skills/ryanzhao1011/workframe/migrate-to-modules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 169 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,699 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00169 $0.03699
Opus 5.5 $0.00068 $0.01480
Sonnet 5.5 $0.00034 $0.00740
Haiku 4.5 $0.00017 $0.00370

Measured 3d ago against content hash bbfd83f33ba4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

migrate-to-modules scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

grep -rln "<old-path-or-keyword>" .claude/ .workframe/ projects/ company-context/ my-workspace/
plugins/core/skills/migrate-to-modules/SKILL.md · 314 lines

How it starts

The opening of the file, as written. The whole thing — 314 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Migrate to Modules Skill

前置依赖

调用本 skill 前需读 skill: document-norms §1(归属矩阵)/ §3(三段制 overview)/ §4(索引层级)/ §8(修改 SOP,含删除前 grep)。

参考插件根 reference/module-architecture.md(modules/ 体系完整设计)。

定位

老项目一次性迁移到 modules/ 体系的统一入口。强约束:必须 dry-run 用户 review 后才执行实际搬运。

适用范围:

  • 存量项目(典型场景:含散落 PRD / spec / decisions / plans / obsidian 归属规范文件等)
  • 已有代码 + 散落需求文档的工程仓库
  • 项目首次启用 modules/ 体系(一次性,不重复执行)

不适用:

  • 创建单个新模块/需求 → 调 module-init
  • 修改已有 modules/ 结构 → 直接 Edit + 调 module-index-refresh
  • 仅刷新索引 → 调 module-index-refresh

输入

输入 说明
老资产位置(必需) 列出 docs/ / projects/specs/ / obsidian-knowledge.md 等待迁源。逐条标注项目内 / 项目外——决定搬还是拷,见下
目标 modules/ 路径根 默认 projects/modules/
模块树初稿(可选) 用户给定基础模块/子模块列表;不给则 AI 推荐
是否保留 _legacy/ 兜底 默认是;保留 projects/_legacy/<old-path>/ 备份

跨项目导入 = 只拷不删(硬约束):待迁源在当前项目之外时(典型场景:用户新建项目、 把老项目资料喂进来),源目录一律只读——禁止移动、删除、写入,_legacy/ 备份与 「删除老项目顶层 docs/」等清源动作全部不适用。那是用户仍在使用的仓库,动它一个字都是越界。 本 skill 默认的「搬」只对项目内的源成立。

工作流(4 步 + 强 SOP)

Step 1: 模块树设计(人工 + AI 推荐)

1.1 老资产盘点
  • 全量列出待迁源文件(递归 .md / .yaml / asset / png / pdf)

  • 按目录分组统计数量

  • 报告:

    待迁源盘点:
      docs/                 (43 .md, 12 png, 3 pdf)
      docs/decisions/       (8 .md)
      docs/plans/           (15 .md)
      .claude/rules/local/obsidian-knowledge.md
      projects/specs/auth/  (5 .md)
    
1.2 AI 推荐基础模块树

读全部 .md 的 H1 + frontmatter module / tags / area,聚类推荐基础模块:

推荐基础模块(10 个,按文档密度排序):
  1. profile      (档案与个性化,14 文档)
  2. messaging    (消息与通知,10 文档)
  3. payment      (支付与结算,8 文档)
  ...
1.3 用户 review + 调整

用户可:

  • 重命名基础模块
  • 合并/拆分基础模块
  • 提供子模块拆分建议(按需)
  • 标记某些资产"不进 modules/,留在 specs/plans/" 或 "归档到 _legacy/"

输出:用户确认的模块树 + 子模块拆分(如果用户给)。

Step 2: dry-run 映射(绝对禁止跳过)

2.1 生成 file→target 映射

对每个待迁源文件,根据:

  • 模块树
  • frontmatter module / tags / area
  • 文件路径关键词
  • H1 标题语义

推断目标路径:

file → target 映射 dry-run(103 文件):

✅ 自动推断高置信(72 文件):
  docs/auth/login-flow.md  →  modules/auth/login/requirements/login-flow/main/prd.md
  docs/decisions/0042-jwt-vs-session.md  →  modules/auth/login/decisions/2024-12-08-jwt-vs-session.md
  ...

⚠️ 自动推断低置信(18 文件):
  docs/misc/bot-policy.md  →  modules/messaging/bot/research/bot-policy.md ?
  ...

❓ 无法推断(8 文件):
  docs/old-architecture-2023.md  →  ???
  ...

📦 建议归档 _legacy/(5 文件):
  docs/2022-prd-discarded.md  →  _legacy/docs/2022-prd-discarded.md

Read the full file on GitHub · 314 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago Changed bbfd83f33ba4
  2. 1mo ago Changed · -4 lines · +54 tokens per session 0a03a9698d41
  3. 3mo ago First seen · 318 lines · 115 tokens per session scan B 788bf28abd47

Subscribe to this mod's changes

migrate-to-modules is a skill published in the GitHub repository ryanzhao1011/workframe (9 stars, last pushed 5d ago), licensed MIT. It adds 169 tokens to every session and 3,699 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

migrate-to-modules compared with skills from other repositories

migrate-to-modules next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
migrate-to-modulesryanzhao1011/workframeSkill95d agoMITB169Claude Code
html-prototypemayuemarsha-del/pm-skillsSkill56mo agoMITA97Claude Code
feature-acceptancemayuemarsha-del/pm-skillsSkill56mo agoMITA192Claude Code
prdmayuemarsha-del/pm-skillsSkill56mo agoMITA202Claude Code
ui-walkthroughmayuemarsha-del/pm-skillsSkill56mo agoMITA231Claude Code
gbgcielebak/goal-by-goalSkill15mo agoMITA150Claude Code
competitor-researchmayuemarsha-del/pm-skillsSkill56mo agoMITA123Claude Code