Codebase Analysis 标志

Codebase Analysis

社区
robbyt
codebase-analysis

Codebase analysis via the Codex MCP server with a read-only sandbox. Trigger when user needs architecture overview ("analyze this codebase with Codex", "have Codex map dependencies"), onboarding to unfamiliar code, understanding legacy systems, or identifying technical debt.

概览

发布者robbyt
代码仓库claude-skills
技能名称codebase-analysis
星标数
42
复刻数
2
附带文件
仅含指令
链接
  • Markdown 格式的指令

    模型按需加载的 SKILL.md 文件,因此只有在请求确实匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 robbyt 发布于 GitHub。请在安装前查看源内容。

安装

在 TypingMind 中安装 Codebase Analysis AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/robbyt/claude-skills/tree/main/plugins/codex/skills/codebase-analysis
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/robbyt/claude-skills.git /tmp/claude-skills
mkdir -p .claude/skills
cp -r /tmp/claude-skills/plugins/codex/skills/codebase-analysis .claude/skills/codebase-analysis
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Codebase Analysis,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Codebase Analysis。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Codebase Analysis 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会获取指令,因此未使用的技能不会产生额外费用。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Codebase Analysis via Codex

Use Codex to get a second-opinion architectural read of the current project, with the sandbox locked to read-only. Codex consults; Claude writes.

Transport

Always use the MCP tool. The plugin's MCP server (scripts/codex-mcp-server.mjs, started from .mcp.json) runs codex exec for each call. Tool name: mcp__plugin_codex_cli__codex. If the example below errors with an unknown-tool error, run /mcp and substitute the actual prefix (e.g., mcp__codex_cli__codex). Shell fallback is a last resort (see ../references/commands.md).

Model

Pin model: "gpt-6-sol" with config: { "model_reasoning_effort": "medium" } on the opening call. Codebase analysis benefits from the flagship's reasoning across many files — don't downgrade to gpt-6-luna here. Set both on the first codex call only; codex-reply reuses them unless you escalate. Honor an explicit user-named model if given. See ../references/patterns.md → Models and Reasoning effort. Escalate to gpt-6-astra (pass model + config on the codex-reply) from round 3, when a disagreement survives a round, or when re-reviewing the same area in a fresh thread — see ../references/patterns.md → Escalating to gpt-6-astra.

Basic call

mcp__plugin_codex_cli__codex({
  "prompt": "<task>\nAnalyze this project's architecture: entry points, major modules, component relationships, and notable dependencies.\n</task>\n\n<compact_output_contract>\nStructured sections, one per topic. Cite the files each claim is based on.\n</compact_output_contract>\n\n<grounding_rules>\nGround claims in files you read. Label inferences, and list what you could not determine.\n</grounding_rules>",
  "sandbox": "read-only",
  "model": "gpt-6-sol",
  "config": { "model_reasoning_effort": "medium" }
})

The response includes a threadId. Use mcp__plugin_codex_cli__codex-reply with that id to drill in without re-establishing context.

When to Use

  • Onboarding to an unfamiliar codebase
  • Understanding legacy systems
  • Mapping component relationships
  • Finding hidden dependencies
  • Architecture documentation
  • Technical debt assessment

Examples

Full project analysis:

mcp__plugin_codex_cli__codex({
  "prompt": "Analyze this project. Report on:\n- Overall architecture\n- Key dependencies\n- Component relationships\n- Potential issues",
  "sandbox": "read-only",
  "model": "gpt-6-sol",
  "config": { "model_reasoning_effort": "medium" }
})

Flow mapping:

mcp__plugin_codex_cli__codex({
  "prompt": "Map the authentication flow. Identify every component involved from request to session creation.",
  "sandbox": "read-only",
  "model": "gpt-6-sol",
  "config": { "model_reasoning_effort": "medium" }
})

Dependency analysis:

mcp__plugin_codex_cli__codex({
  "prompt": "Analyze dependencies: direct vs transitive, outdated packages, circular dependencies, bundle-size impact.",
  "sandbox": "read-only",
  "model": "gpt-6-sol",
  "config": { "model_reasoning_effort": "medium" }
})

Iterative workflow (prefer codex-reply)

When you're still working on the same area of the codebase, continue the existing thread rather than starting a new codex call. Codex retains context between rounds; fresh calls force it to re-read files and drift from its prior reasoning.

Typical loop:

  1. Initial consult → save the threadId from the response.
  2. Claude reads related files / runs a query / makes a change.
  3. codex-reply with new findings or a follow-up question.
  4. Repeat — but cap at 3–4 rounds total, and run round 3 onward on gpt-6-astra. If the thread isn't converging, stop and bring the current state back to the user.

threadId is an MCP argument — pass it as the threadId field of codex-reply, not in the prompt text. See ../references/mcp-schema.md for wrong-vs-right examples.

Example — three rounds on the same architecture thread:

# Round 1 — initial map (opening call pins model + effort)
mcp__plugin_codex_cli__codex({
  "prompt": "Map the auth flow end-to-end.",
  "sandbox": "read-only",
  "model": "gpt-6-sol",
  "config": { "model_reasoning_effort": "medium" }
})
# → threadId: "019da14b-..."  /  flags: uncertainty about session rotation

# Round 2 — Claude reads src/session/ and reports back
mcp__plugin_codex_cli__codex-reply({
  "threadId": "019da14b-...",
  "prompt": "src/session/rotate.ts shows a 15m rotation window, not the 1h you assumed. Does that change anything in your flow map?"
})

# Round 3 — drill into a specific layer; escalate to gpt-6-astra (the thread keeps its history)
mcp__plugin_codex_cli__codex-reply({
  "threadId": "019da14b-...",
  "prompt": "Focus on the data layer. What invariants does this flow depend on and where are they enforced?",
  "model": "gpt-6-astra",
  "config": { "model_reasoning_effort": "medium" }
})

Start a fresh thread when: the user switches topic, the threadId is no longer in context, or Claude has made substantial code changes that would be cleaner to re-prime than to patch incrementally. See ../references/patterns.md.

After the analysis

Codex's read is a second opinion, not authoritative — it can misread structure or miss context it never saw.

  • Relay the findings to the user and attribute them to Codex, rather than presenting them as verified fact.
  • Spot-check claims against the actual code before acting on them (see ../references/patterns.md → Validation) — especially dependency, impact, and "nothing else uses this" claims.
  • Surface uncertainty or disagreement to the user instead of smoothing it over into a confident-sounding summary.
  • For broad analyses, consider running the codex:consult agent in the background. For prompt blocks and recipes, see ../references/prompting.md.

Safety

  • Always sandbox: "read-only". Codex must not modify files.
  • Never use workspace-write or danger-full-access.
  • Never use --dangerously-bypass-approvals-and-sandbox.

Fallback (rare)

If the MCP server is unavailable (plugin disabled, server crashed), see ../references/commands.md for the Bash equivalent. Requires dangerouslyDisableSandbox: true because Codex writes its own session state.

常见问题

Codebase Analysis AI 技能有什么作用?

Codebase analysis via the Codex MCP server with a read-only sandbox. Trigger when user needs architecture overview ("analyze this codebase with Codex", "have Codex map dependencies"), onboarding to unfamiliar code, understanding legacy systems, or identifying technical debt.

为什么在 TypingMind 中使用 Codebase Analysis?

因为您只需安装一次,就能搭配任何模型使用。Codebase Analysis 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型,甚至可以在聊天中途切换模型,而不会影响技能正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Codebase Analysis?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/robbyt/claude-skills/tree/main/plugins/codex/skills/codebase-analysis。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Codebase Analysis?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Codebase Analysis 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以搭配 Codebase Analysis 使用,包括 GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等,都可在 TypingMind 中使用您自己的 API 密钥接入。

Codebase Analysis AI 技能免费吗?

该技能源自 robbyt 在 GitHub 上发布的项目。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇