lore-modularize

lore-modularize is a skill for Claude Code, Codex from koersliven/Lore. It costs 15 tokens per session (1,028 once invoked), scanned A, original, Apache-2.0.

A tool that discovers meaningful code modules and divides existing project knowledge between them. A module is a distinct area of a codebase with its own entry point, API, handler, or data model.

In plain words
What is it for?
Use it when a project has accumulated file-related knowledge but no module structure, especially after code organization changes. It creates module records while keeping unmatched or general knowledge at project level.
Why use it?
It makes a growing knowledge base easier to navigate by connecting each fact to the part of the project it concerns. Knowledge shared across modules can retain links to all relevant areas.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/koersliven/lore/lore-modularize
Any agent
npx skills add koersliven/Lore --skill lore-modularize
Clone the repo
git clone --depth 1 https://github.com/koersliven/Lore

Made for: Claude Code, Codex.

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 lore-modularize

README.md
[![agentmods](https://agentmods.dev/badge/skills/koersliven/lore/lore-modularize.svg)](https://agentmods.dev/skills/koersliven/lore/lore-modularize)
Your own site
<a href="https://agentmods.dev/skills/koersliven/lore/lore-modularize"><img src="https://agentmods.dev/badge/skills/koersliven/lore/lore-modularize.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,028 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00015 $0.01028
Opus 5 $0.00008 $0.00514
Sonnet 5 $0.00003 $0.00206
Haiku 4.5 $0.00002 $0.00103

Measured 3d ago against content hash 0c60a8913a83, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

lore-modularize scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/lore-modularize/SKILL.md · 134 lines

How it starts

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

/modularize — Auto Module Discovery & Knowledge Partition

全自动模块发现与知识分区。不需要用户确认,代码结构即定义。

When to Trigger

  • /lore-evolve detects no modules/ directory but has accumulated knowledge with file references
  • User explicitly invokes this skill

Purpose

扫描代码目录结构,自动识别模块边界,将现有知识按 affected_files 路径归类到对应模块。零干预,猜错了后续对话会自动修正。

Process

Step 1: Check Prerequisites

  • If .ai-context/modules/ already exists → exit silently (already modular)
  • If snapshot.md does not exist → exit silently (nothing to partition)

Step 2: Discover Modules from Code Structure

扫描项目目录结构,识别独立模块。判定标准:

一个目录包含以下任一即视为模块

  • Controller/Route/Handler 类文件
  • 独立的服务入口或 API 定义
  • 独立的数据模型定义

模块命名规则

  • 直接使用目录名(src/order/order
  • 同一模块可能分散在多个子目录 → 以父目录为准

排除规则

  • test/, __tests__/, spec/, fixtures/ — 测试目录不是模块
  • shared/, common/, util/, helpers/ — 共享工具不是模块
  • 只有单文件且无入口点的目录不是模块

Step 3: Classify Knowledge by Module

读取 snapshot.md 和所有 increments,对每条知识:

  1. 提取 affected_files 和关联文件路径
  2. 路径匹配:文件路径包含哪个模块目录 → 归到该模块
  3. 多模块匹配:涉及多个模块 → 同时归到各模块,记录交叉引用
  4. 零匹配:路径不匹配任何模块 → 归到全局知识
  5. 无法提取路径:纯业务知识 → 归到全局

Step 4: Create Module Structure

.ai-context/modules/
├── _index.md                  # 模块注册表
├── {{module-name}}/
│   ├── knowledge.md           # 模块知识(L1+L3)
│   ├── specs/                 # prescriptive 层(L0,由 /lore-spec 管理)
│   │   └── index.md           # Spec 目录索引
│   ├── increments/            # 模块增量
│   ├── progress.md            # 模块进度
│   └── cross-refs.md          # 跨模块依赖

Step 5: Write Module Specs Index

对每个模块,创建 specs/index.md

# Specs: {{module-name}}

> Managed by /lore-spec. Do not edit manually.

## Specs

| Spec | Type | Status | Created |
|------|------|--------|---------|

## Status Legend

- **draft**: 正在设计
- **proposed**: 已提出,待评审
- **approved**: 已批准,可以实现
- **implemented**: 已实现,知识已提取
- **superseded**: 已废弃

Step 6: Write Module Knowledge Files

对每个模块,使用 templates/module-knowledge.md 模板创建 knowledge.md

  • 从 snapshot 中提取该模块相关的知识条目
  • 保持原有证据溯源(author/timestamp/confidence/source)

Read the full file on GitHub · 134 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 First seen · 134 lines · 15 tokens per session scan A 0c60a8913a83

Subscribe to this mod's changes

lore-modularize is a skill published in the GitHub repository koersliven/Lore (5 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 15 tokens to every session and 1,028 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

trpc

Skill "trpc" from neverinfamous/memory-journal-mcp, covering trpc guidelines, 1. routers and procedures, 2. context and middleware and 3. client integration.

neverinfamous/memory-journal-mcp · 50 tokens

faf-context

Use FAF project context tools on this server — init, score, sync, discover; claim equals wire.

Wolfe-Jam/rust-faf-mcp · 24 tokens

journal-optimizer

Guided database pruning and optimization workflows for memory-journal-mcp. Uses importance scores, relationship density, and entry metadata to identify low-value entries for safe soft-deletion. Includes dry-run previews, backup gates, and revert guidance. Use when the user says "clean up the database", "optimize…

neverinfamous/memory-journal-mcp · 101 tokens

wrap

Session-end retrospective. Produces a dated retro file, appends to a cross-session tooling journal, and reconciles NEXTSESSION.md so the next session can resume cleanly. Invoke as /wrap when ending a session, or /wrap -q for the local repo work only (NEXTSESSION.md + CLAUDE.md, no retro or journal).

nullphase-net/enfurbish · 72 tokens

personal-context

Interview the user to build or update a reusable "about me" context file for AI tools — who they are, their role and background, how they work, and how they want AI to help. Use when the user says "build my personal context", "create my about-me context", "set up my AI context", "update my personal context", or wants…

nocodework/ai-context-kit · 97 tokens

refresh-context

Review and refresh an existing personal-context.md or company-context.md — check what has gone stale, fill gaps against the current template, and update the file. Use when the user says "refresh my context", "review my context", "is my context still up to date", "my context is stale", or after a change in role, offer…

nocodework/ai-context-kit · 90 tokens