Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计提醒

codebase-research代码库研究

Agent Skill

codebase-research 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

282

周安装

12

GitHub Stars

25

下载量

99
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:codebase-research(代码库研究)
来源仓库:https://github.com/noobygains/godmode
仓库路径:skills/codebase-research
安装命令:
npx skills add https://github.com/noobygains/godmode --skill codebase-research
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/noobygains/godmode --skill codebase-research

简介

codebase-research 奉行“先搜索现有代码再编写新代码”的铁律,杜绝重复造轮子。

  • 核心原则:发现已有实现时必须完全匹配其约定,禁止引入第二种做法。
  • 适用于任何新建功能前的权威参考检索,确保风格与模式一致性。
  • 需持续遍历相似文件直至穷尽,保证搜索覆盖率不低于 95% 才停止探查。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Codebase Research

Overview

Before writing new code in an existing project, understand what already exists inside it. The codebase itself is the most authoritative reference for how things should be built. Every project accumulates conventions, patterns, and implicit standards that new code must respect.

Core principle: Search the current codebase before coding. Find similar files, functions, and patterns. Match existing conventions exactly. Never introduce a second way of doing something when a first way already exists.

No exceptions. No workarounds. No shortcuts.

The Prime Directive

NO NEW CODE WITHOUT UNDERSTANDING THE EXISTING CODE FIRST

If you have not searched the current codebase for prior implementations of the same pattern, you are risking inconsistency. Found nothing similar? Document what you searched. Then build, establishing the convention deliberately.

No excuses:

  • Do not "just start coding and check conventions later"
  • Do not assume your preferred pattern is the project's pattern
  • Do not introduce new libraries when the project already uses an equivalent
  • Do not create a new file structure that contradicts the existing one
  • "I know the best way to do this" is irrelevant if the project already does it a different way consistently

When to Use

Mandatory when:

  • Adding a new feature to an existing codebase
  • Creating a new file, component, module, or service
  • Implementing a pattern that likely exists elsewhere in the project
  • Writing tests for existing functionality
  • Adding error handling, logging, or validation logic

Particularly valuable when:

  • The project has established architectural patterns (MVC, hexagonal, etc.)
  • There are existing files similar to what you need to create
  • The codebase has custom utilities, helpers, or shared modules
  • The project uses specific naming conventions or code organization rules
  • There are existing tests that demonstrate the expected testing approach

The Entry Protocol

digraph codebase_research_gate {
    rankdir=TB;
    start [label="Task: Write new code\nin existing project", shape=doublecircle];
    search [label="SEARCH\ncurrent codebase for\nsimilar implementations", shape=box];
    found [label="Similar patterns found?", shape=diamond];
    analyze [label="ANALYZE\nConventions, structure,\nnaming, error handling", shape=box];
    template [label="Use as template?\n(follow the pattern)", shape=diamond];
    follow [label="FOLLOW\nMatch the existing pattern\nexactly", shape=box style=filled fillcolor=lightgreen];
    adapt [label="ADAPT\nUse the convention\nwith modifications", shape=box style=filled fillcolor=lightyellow];
    establish [label="ESTABLISH\nNo precedent exists;\ncreate a deliberate\nnew convention", shape=box];
    document [label="Document search results\nand decision rationale", shape=box];

    start -> search;
    search -> found;
    found -> analyze [label="yes"];
    found -> document [label="no"];
    document -> establish;
    analyze -> template;
    template -> follow [label="yes - close match"];
    template -> adapt [label="partially - same idea\ndifferent details"];
}

BEFORE writing new code in an existing project:

  1. SEARCH -- Query the codebase for similar files, functions, patterns, and conventions
  2. ANALYZE -- Study how existing code handles the same concerns
  3. MATCH -- Align your new code with established conventions
  4. ONLY THEN -- Begin writing

Search Methodology

What to Search For

When about to create something new, search the codebase for each of these:

Search TargetWhyHow
Similar filesFind the template to followGlob for files with similar names or in similar directories
Similar functionsMatch function signatures and patternsGrep for functions that do analogous work
Imports and dependenciesUse what the project already usesGrep for import statements to find established libraries
Error handlingMatch the project's error patternsGrep for try/catch, Result types, error classes
Naming conventionsUse the same casing and terminologyRead adjacent files, check for camelCase vs snake_case vs kebab-case
File organizationPlace new files where they belongList directory structures, find where similar code lives
Test patternsWrite tests the way the project writes testsFind test files for similar modules, match their structure
Configuration patternsMatch config approachesSearch for.env usage, config files, constants

Search Techniques

Structured search sequence -- Follow this order for thorough coverage:

1. DIRECTORY SCAN: List files in the relevant directories
   -> Understand the project's file organization

2. SIMILAR FILE SEARCH: Glob for files with similar names or purposes
   -> Find the closest existing template for what you need to build

3. PATTERN GREP: Search for specific patterns you plan to use
   -> Confirm the project's approach to that pattern

4. IMPORT ANALYSIS: Check what libraries and utilities are already imported
   -> Use existing dependencies rather than introducing new ones

5. TEST FILE REVIEW: Find tests for similar functionality
   -> Match the testing approach, assertion style, and setup patterns

Minimum threshold before writing new code: Review at least 2 similar files in the codebase.

Convention Matching

The Consistency Principle

When the codebase does something one way, you do it the same way. Personal preference is irrelevant. Project consistency outweighs individual opinion.

DimensionMatch Exactly
NamingVariable names, function names, file names, class names
StructureFile layout, directory organization, module boundaries
PatternsHow the project handles state, errors, async, validation
StyleFormatting, comment style, documentation approach
DependenciesUse the project's existing libraries, not alternatives
TestingTest framework, assertion library, setup/teardown approach
Error handlingThrow vs return, error types, error messages

Common Convention Signals

LOOK FOR these indicators of established conventions:

- Linter/formatter config (.eslintrc, .prettierrc, rustfmt.toml, etc.)
  -> These are explicit rules. Follow them exactly.

- Shared utility files (utils/, helpers/, lib/, common/)
  -> These are the project's building blocks. Use them.

- Base classes or interfaces (BaseController, AbstractService)
  -> These define the inheritance/composition pattern. Extend them.

- Barrel files (index.ts, __init__.py, mod.rs)
  -> These define the export pattern. Add to them.

- Test helpers (test/helpers/, fixtures/, factories/)
  -> These are the testing infrastructure. Build on them.

Analysis Checklist

When you find similar code in the codebase, extract answers to these questions:

1. FILE PLACEMENT: Where does this type of file live?
   -> Same directory? Nested by feature? Grouped by type?

2. FILE NAMING: What naming pattern does the file follow?
   -> ComponentName.tsx? component-name.ts? component_name.py?

3. EXPORTS: How are things exported?
   -> Default export? Named exports? Re-exported from barrel?

4. FUNCTION SIGNATURES: What do similar function signatures look like?
   -> Parameter ordering, return types, async vs sync

5. ERROR HANDLING: How does this part of the codebase handle errors?
   -> Try/catch? Result types? Error callbacks? Thrown exceptions?

6. LOGGING: Does the project have a logging pattern?
   -> Logger instance? Console methods? Structured logging?

7. VALIDATION: How does the project validate input?
   -> Zod? Joi? Manual checks? Type guards?

8. STATE MANAGEMENT: How is state handled?
   -> Redux? Zustand? Context? Signals? Local state?

9. TESTING APPROACH: What do tests for similar code look like?
   -> Unit tests? Integration? What assertion library?

10. DOCUMENTATION: Are there JSDoc comments, docstrings, or inline docs?
    -> Match the existing documentation density and style.

When No Precedent Exists

Sometimes you are genuinely building something the codebase has never done before. In that case:

  1. Confirm absence -- Search at least 3 different ways to be sure no precedent exists
  2. Check adjacent projects -- If this is a monorepo, check sibling packages
  3. Consult external sources -- Use godmode:github-search to find patterns from public repositories
  4. Establish deliberately -- When creating a new convention, make it consistent with the spirit of the existing codebase
  5. Document the decision -- Note why a new pattern was introduced

Integration with Other Skills

During Intent Discovery

When godmode:intent-discovery is exploring the project landscape:

  1. Search the codebase for existing implementations related to the proposed feature
  2. Report conventions that the new feature must follow
  3. Identify reusable code -- utilities, components, and services that already solve part of the problem

During Implementation

When writing code after design approval:

  1. Find the template file -- the closest existing file to what you need to create
  2. Copy the structure -- match the template's organization exactly
  3. Swap the specifics -- replace domain details while preserving the pattern
  4. Verify consistency -- compare your new file against the template to catch deviations

Cognitive Traps

RationalizationTruth
"My approach is cleaner than what the project uses"Consistency across a project is worth more than local perfection. Two patterns are worse than one adequate pattern.
"I will refactor the existing code to match my style"Refactoring is a separate task. Match the existing style now. Propose a refactor later if warranted.
"The project does not have a pattern for this"Did you search thoroughly? Check 3+ similar files. If truly no precedent, establish one deliberately.
"I do not need to check -- this is a new module"New modules still live inside the existing project. They must respect its conventions.
"The existing pattern is outdated"Outdated but consistent is better than modern but inconsistent. Propose a migration, do not create a fork.
"Checking conventions slows me down"Writing code that fails review or introduces inconsistency slows you down more.
"It is just a small utility function"Small utilities are the most reused code. Getting their pattern wrong affects everything that depends on them.

Guardrails

Prohibited actions:

  • Writing new code without searching the codebase for similar implementations
  • Introducing a new library when the project already uses an equivalent
  • Creating a file structure that contradicts the existing organization
  • Using a naming convention different from the project's established one
  • Skipping test pattern matching ("I will write tests my way")

Required actions:

  • Search the codebase for at least 2 similar files before writing new code
  • Match the naming conventions of the surrounding code exactly
  • Use existing shared utilities and helpers instead of creating duplicates
  • Follow the established testing patterns for the project
  • Document your findings when no precedent exists in the codebase

Quick Reference

SEARCH -> ANALYZE -> MATCH -> BUILD

Search: Find 2+ similar files, grep for patterns, check imports
Analyze: Extract conventions for naming, structure, error handling, testing
Match: Align your new code with every convention you found
Build: Write code that looks like it belongs in the project

Integration

Invoked during:

  • godmode:intent-discovery -- Search codebase during "Survey project landscape" phase
  • godmode:reference-engine -- Routed here for internal code pattern research
  • godmode:task-planning -- Verify conventions before each implementation task
  • godmode:quality-enforcement -- Consistency checks against codebase patterns

Complementary skills:

  • godmode:github-search -- For searching EXTERNAL repositories, GitHub, and package registries for open-source implementations, libraries, and patterns to study or adopt
  • godmode:pattern-matching -- Deeper pattern analysis within the codebase
  • godmode:specification-first -- Feeds codebase conventions into formal specifications
  • godmode:project-bootstrap -- When starting a new project (no existing codebase to research)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.93%
按下载量换算36

Claude

29.22%
按下载量换算29

Cursor

18.69%
按下载量换算19

Gemini CLI

9.73%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills