Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计异常

codebase-context代码库上下文

Agent Skill

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

总安装

376

周安装

16

GitHub Stars

公开资料未说明

下载量

132
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/zcy22606/codebase-context --skill codebase-context

简介

codebase-context 自动生成 AI 友好的项目上下文文件,加速智能编码工具的理解过程。

  • 适用于多平台协作(如 Claude Code、Cursor)中统一项目认知基线的需求场景。
  • 支持快速模式与详细模式切换,平衡时效性与信息密度。
  • 必须拥有目标仓库的文件读取权限,且执行过程可能调用 shell 命令进行结构探测。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Project AI Init

Analyze a project codebase from scratch and generate agent-friendly context files, enabling all AI coding tools (Claude Code, Kiro, Cursor, GitHub Copilot, Codex, OpenCode, Trae) to quickly understand the project and produce high-quality work.

Execution Modes

When the Skill starts, first select an execution mode. Use the userInput tool to present clickable options. Choose the best fit based on time budget and project needs:

{
  "question": "🚀 Select execution mode:",
  "options": [
    {
      "title": "⚡ Quick Mode (~5 min)",
      "description": "Generate CLAUDE.md only — make AI usable immediately. Best for: quick trial, personal projects, time-constrained"
    },
    {
      "title": "📋 Standard Mode (~30 min)",
      "description": "Generate CLAUDE.md + architecture docs + tech stack docs + AI tool configs. Best for: team projects, multi-tool support",
      "recommended": true
    },
    {
      "title": "🔬 Full Mode (~1-2 hours)",
      "description": "Deep analysis of every module/page, generate complete documentation. Best for: large projects, precise context needed"
    }
  ]
}

Mode Comparison

⚡ Quick📋 Standard🔬 Full
Estimated Time~5 min~30 min~1-2 hours
Generated ContentCLAUDE.md onlyCLAUDE.md + docs/ + AI tool configsAll + per-module/page docs
Best ForQuick trial, personal projectsTeam projects, multi-tool supportLarge projects, precise context
Deep AnalysisLists modules/pages✅ Interactive deep-dive
Tool-Specific Configs
Validation Phase✅ (optional)✅ (optional)

Mode × Phase Execution Matrix

Phase⚡ Quick📋 Standard🔬 Full
0 Mode & Language Selection
1 Basic Info Collection
1.5 Resource Discovery
2 Interactive Discovery✅ (lite)
3 Schema + API Analysis
4 Backend Module Deep Analysis❌ (list only)✅ (interactive)
5 Frontend Page Analysis❌ (list only)✅ (interactive)
6 Generate Common Files✅ (CLAUDE.md only)✅ (all)✅ (all + module/page docs)
7 Tool-Specific Configs
8 Output Summary
9 Validation Phase✅ (optional)✅ (optional)
💡 Recommendation: If the user is unsure, suggest 📋 Standard Mode — but always wait for explicit user confirmation. Never auto-select.

Quick Start

  1. Select execution mode: Choose ⚡ Quick / 📋 Standard / 🔬 Full based on time budget
  2. Select output language: Choose the language for generated files
  3. Determine project type: Scan directory structure, identify frontend/backend/fullstack/monorepo
  4. Collect basic info: Read config files, extract tech stack
  5. Confirm team tools: Ask which AI tools the team uses (Claude Code / Kiro / Cursor / GitHub Copilot / Codex / OpenCode / Trae)
  6. Deep analysis: Analyze backend by module, frontend by page route (Standard lists only, Full dives deep)
  7. Generate common files: CLAUDE.md + module docs + page docs + architecture docs + tech stack docs + PR/Issue templates (Quick generates CLAUDE.md only)
  8. Generate tool-specific configs: Generate dedicated rule/steering/rules files for each AI tool (Quick skips this)
  9. Human review: Sections marked TODO need team input

Core Principles

  • 90% of AI code quality depends on the context it receives
  • Treat frontend and backend differently: backend focuses on module responsibilities/business rules/state machines; frontend focuses on page routes/component trees/interaction flows
  • Shared layer is globally visible: utility methods, shared components, API conventions go into CLAUDE.md
  • One analysis benefits all AI tools (standard Markdown, not tied to any specific tool)
  • After human review, commit to repo as shared AI context infrastructure for the team

Interactive Discovery

Before analysis, confirm the following:

Project basics:

  • What kind of project is this? (Web app, API service, CLI tool, library)
  • Primary language and framework?
  • Team size? (Solo, small team, large team)

Business context:

  • Who are the users? What problem does it solve?
  • What are the core business flows?
  • Which modules/pages are the most complex?

Existing conventions:

  • Does the team have coding style guides?
  • Any API design conventions?
  • Any "unwritten rules" the AI should know?

AI tool usage:

  • Which AI coding tools does the team use?
  • Tool-specific config files will be generated for each selected tool

Use the userInput tool to present tool selection with toggleable options:

{
  "question": "🔧 Select AI coding tools your team uses. Configs will be generated for selected tools.\n\n(The current tool is pre-selected. Toggle additional tools your team needs.)",
  "options": [
    {
      "title": "Select tools to configure",
      "subOptionsLabel": "AI Coding Tools",
      "subOptions": [
        { "title": "Claude Code", "description": ".claude/rules/, commands/, settings.json, .claudeignore" },
        { "title": "Kiro", "description": ".kiro/steering/ rule files (always-load + conditional-load)" },
        { "title": "Cursor", "description": ".cursor/rules/ .mdc files with glob path matching" },
        { "title": "GitHub Copilot", "description": ".github/copilot-instructions.md single-file instructions" },
        { "title": "Codex", "description": "AGENTS.md instruction files (root + per-directory)" },
        { "title": "OpenCode", "description": ".opencode/instructions.md project instructions" },
        { "title": "Trae", "description": ".trae/rules/ rule files with YAML frontmatter" }
      ]
    }
  ]
}

Configuration Decision Tree

Start — Scan directory structure
│
├─ 1. Has packages/ or apps/ directory
│  └─ Monorepo → List sub-projects, user selects, analyze each (re-run detection per sub-project)
│
├─ 2. Root directory .md files > 50%, no src/ or app/ directory
│  └─ Docs/Knowledge Base → Run document structure analysis (directory hierarchy + naming conventions + navigation files)
│
├─ 3. Has bin/ directory, or package.json has bin field, or CLI entry file exists (cli.ts/cli.py/main.go)
│  └─ CLI Tool → Run command structure analysis (entry point + subcommands + argument definitions)
│
├─ 4. Has src/index.* entry + package.json has main/exports field, no page directory
│  └─ Library/SDK → Run API surface analysis (public interfaces + type definitions + example code)
│
├─ 5. Has Dockerfile + service entry (e.g. main.ts/app.py/main.go), no frontend page directory
│  └─ Microservice → Run service interface analysis (routes + health checks + config management + inter-service communication)
│
├─ 5.5 Has IaC config files (.tf, cdk.json, Pulumi.yaml, ansible.cfg, main.bicep, Chart.yaml, CloudFormation template)
│  └─ Infrastructure → Detect single/multi-project structure, run IaC analysis per project
│     ├─ Single project → Analyze directly (modules, workspaces, resources)
│     └─ Multi-project → List projects, analyze each independently, map shared modules
│
├─ 7. Has app/ or pages/ page directory, no service/controller layer
│  └─ Frontend Only → Run frontend analysis (page routes + shared layer)
│
├─ 8. Has service/controller layer, no page directory
│  └─ Backend Only → Run backend analysis (feature modules)
│
├─ 9. Has both page directory and service/controller layer
│  └─ Fullstack → Run both frontend + backend analysis
│
└─ 10. None of the above match
   └─ Generic Project → Use basic analysis strategy
💡 Priority note: Match from top to bottom by number, stop on first match. Monorepo has highest priority (sub-projects are recursively detected), docs/knowledge base is second (to avoid misclassification).

See references/non-web-project-analysis.md for detailed analysis strategies for non-web project types.

Generated Configurations

Common Files (Shared Across All Tools)

FilePurposeWhen Generated
CLAUDE.mdAgent rule file (includes shared layer)Always
docs/architecture.mdArchitecture overview + module/page indexRecommended
docs/modules/{name}.mdBackend module business logic docsBackend/fullstack projects, one per module
docs/pages/{name}.mdFrontend page business logic docsFrontend/fullstack projects, one per page
docs/tech-stack.mdTech stack & coding standardsRecommended
.github/PULL_REQUEST_TEMPLATE.mdPR templateRecommended
.github/ISSUE_TEMPLATE/Issue templatesOptional

AI Tool-Specific Configurations

ToolGenerated FilesDescription
Claude Code.claude/rules/, .claude/commands/, .claude/settings.json, .claudeignorePath-level rules + slash commands + permission config + file ignore rules
Kiro.kiro/steering/product.md, tech.md, structure.md, conventions.md, api.md, frontend.mdSteering rule files, supports always-load and conditional-load
Cursor.cursor/rules/project.mdc, frontend.mdc, backend.mdc, testing.mdc.mdc rule files with glob path matching
GitHub Copilot.github/copilot-instructions.mdSingle-file global instructions (condensed)
CodexAGENTS.md (root), per-directory AGENTS.mdOpenAI Codex instruction files, supports hierarchical inheritance, subdirectory rules override root rules
OpenCode.opencode/instructions.mdProject-level instruction file, pure Markdown format
Trae.trae/rules/project.md, frontend.md, backend.mdRule files with YAML frontmatter controlling load conditions

See references/tool-specific-configs.md.

Workflow

Phase 0: Mode & Language Selection (mandatory, never skip)

Mandatory interaction: Under all circumstances, you must present the following options and wait for the user's explicit reply before proceeding. Never auto-select a default mode. Never decide for the user based on project characteristics.

Use the userInput tool to present clickable mode options:

{
  "question": "🚀 Select execution mode:",
  "options": [
    {
      "title": "⚡ Quick Mode (~5 min)",
      "description": "Generate CLAUDE.md only — make AI usable immediately. Best for: quick trial, personal projects, time-constrained"
    },
    {
      "title": "📋 Standard Mode (~30 min)",
      "description": "Generate CLAUDE.md + architecture docs + tech stack docs + AI tool configs. Best for: team projects, multi-tool support",
      "recommended": true
    },
    {
      "title": "🔬 Full Mode (~1-2 hours)",
      "description": "Deep analysis of every module/page, generate complete documentation. Best for: large projects, precise context needed"
    }
  ]
}

After user selects an option, record the mode selection.

Then use the userInput tool to present clickable language options:

{
  "question": "🌐 Select output language for generated files:",
  "options": [
    {
      "title": "English",
      "description": "Generate all output files in English"
    },
    {
      "title": "中文 (Chinese)",
      "description": "Generate all output files in Chinese"
    },
    {
      "title": "日本語 (Japanese)",
      "description": "Generate all output files in Japanese"
    },
    {
      "title": "Auto-detect",
      "description": "Follow the project's primary language"
    }
  ]
}
💡 This language selection affects only the generated output files (CLAUDE.md, docs/, steering, etc.). The Skill instructions themselves remain in English.

After user confirms both selections, proceed to Phase 1.

Phase 1: Basic Info Collection ⚡📋🔬

Read project config files and extract tech stack info:

FileExtracted Info
package.jsonProject name, scripts, dependencies, framework detection
pyproject.toml / requirements.txtPython dependencies
go.mod / Cargo.tomlGo/Rust dependencies
tsconfig.jsonTypeScript configuration
.eslintrc* / .prettierrc*Code style rules
README.mdProject description, business context
.env.exampleEnvironment variable list (read names only, never read values)

Phase 1.5: Resource Discovery ⚡📋🔬

Before generating any files, check whether AI config files already exist in the target project. Based on detection results, the user can choose to incrementally update, skip existing files, or regenerate everything.

This Phase runs in all modes (⚡ Quick / 📋 Standard / 🔬 Full).

1. Check Existing Config Files

Scan whether the following files/directories already exist in the target project:

PathTypeDescription
CLAUDE.mdFileUniversal agent rule file
.claude/rules/DirectoryClaude Code path-level rules
.claude/commands/DirectoryClaude Code slash commands
.claude/settings.jsonFileClaude Code permission config
.claudeignoreFileClaude Code ignore file
.kiro/steering/DirectoryKiro steering rule files
.cursor/rules/DirectoryCursor rule files
.github/copilot-instructions.mdFileGitHub Copilot global instructions
AGENTS.mdFileCodex root-level instructions
.opencode/instructions.mdFileOpenCode project instructions
.trae/rules/DirectoryTrae rule files
docs/architecture.mdFileArchitecture doc
docs/modules/DirectoryBackend module docs
docs/pages/DirectoryFrontend page docs
docs/tech-stack.mdFileTech stack doc

For existing files, read content and record file size (word count); for existing directories, record file count and file name list.

2. Present Discovery Results

Show the user what was found:

🔍 Detected existing AI configurations:

✅ CLAUDE.md (1,234 words)
✅ .kiro/steering/ (4 files: product.md, tech.md, structure.md, conventions.md)
✅ docs/architecture.md (856 words)
❌ .claude/rules/ (not found)
❌ .claude/commands/ (not found)
❌ .claude/settings.json (not found)
❌ .claudeignore (not found)
❌ .cursor/rules/ (not found)
❌ .github/copilot-instructions.md (not found)
❌ AGENTS.md (not found)
❌ .opencode/instructions.md (not found)
❌ .trae/rules/ (not found)
❌ docs/modules/ (not found)
❌ docs/pages/ (not found)
❌ docs/tech-stack.md (not found)
If no config files exist at all, skip the user choice step and proceed directly to Phase 2.

3. User Chooses Handling Strategy

When existing config files are detected, ask the user:

Choose handling strategy:

1️⃣ Incremental Update — merge new analysis into existing files
   ✅ Preserves manually edited content
   ✅ Adds missing sections
   ✅ Updates outdated info (e.g. dependency versions)
   ⚠️ Requires human review of merge results

2️⃣ Skip Existing — only generate files that don't exist (default)
   ✅ Does not modify any existing files
   ✅ Safest option
   ⚠️ Existing files may lack newly analyzed info

3️⃣ Regenerate All — back up existing files, then regenerate from scratch
   ✅ Get the latest, most complete configs
   ⚠️ Overwrites manually edited content (existing files backed up to .ai-init-backup/)

Execution logic per option:

  • Incremental Update: Perform section-level merge on existing files (preserve user edits, add missing sections, update outdated info); generate missing files normally
  • Skip Existing: Keep current behavior — don't touch existing files, only generate missing ones
  • Regenerate All: Back up existing files to .ai-init-backup/{timestamp}/, then generate everything from scratch
💡 The user can also choose different strategies for different files (e.g. "incrementally update CLAUDE.md, regenerate the rest").

See references/incremental-update-strategy.md for detailed merge rules, conflict handling, and backup strategy.

Phase 2: Directory Structure Analysis + Project Type Detection ⚡📋🔬

Scan root directory and first-level subdirectories, identify architecture patterns and determine project type.

Quick Mode: Use lite interaction, reduce confirmation questions, quickly determine project type.

See references/directory-patterns.md.

Phase 3: Code Style Sampling 📋🔬

Quick Mode skips this Phase.

Randomly read 3-5 source files from the primary language (excluding tests and configs) to infer coding conventions.

See references/code-style-sampling.md.

Phase 4: Backend Module Deep Analysis 🔬 (backend/fullstack projects only)

Quick Mode skips this Phase. 📋 Standard Mode: List module names only, no deep-dive. 🔬 Full Mode: Interactive per-module deep analysis.
  1. Infer business module list from service/controller/model directories
  2. Present module list to user, ask which to analyze in depth (Full Mode)
  3. Read core files per module, extract business rules, state machines, flows, dependencies (Full Mode)
  4. Split complex modules (service > 800 lines or 3+ sub-domains) into multiple docs (Full Mode)

See references/backend-analysis.md.

🏗️ Infrastructure projects: Phase 4 is replaced by IaC-specific analysis: single/multi-project detection → per-project module parsing → workspace detection → resource inventory extraction → optional cloud CLI query. See infrastructure-analysis.md.

Phase 5: Frontend Page Route & Component Analysis 🔬 (frontend/fullstack projects only)

Quick Mode skips this Phase. 📋 Standard Mode: List page routes only, no deep-dive. 🔬 Full Mode: Interactive per-page deep analysis.
  1. Infer page route tree from route directories
  2. Present page list to user, ask which to analyze in depth (Full Mode)
  3. Read entry files and sub-components per page, extract component tree, state management, interaction flows (Full Mode)
  4. Scan shared layer: UI components, business components, utility methods, API layer, global state (Full Mode)
  5. Split complex pages (5+ independent functional areas) into multiple docs (Full Mode)

See references/frontend-analysis.md.

Phase 6: Generate Context Files ⚡📋🔬

Quick Mode: Generate CLAUDE.md only, skip docs/, PR/Issue templates, etc. 📋 Standard Mode: Generate CLAUDE.md + docs/ + PR/Issue templates. 🔬 Full Mode: Generate everything, including per-module/per-page detailed docs.
🌐 Language: Generate all output content in the language selected by the user in Phase 0.

1. CLAUDE.md (always generated)

Contains: Tech Stack, Project Structure, Commands, Code Conventions, Architecture Decisions, Important Context (module/page overview + key business rules), Common Utilities & Shared Components, API Layer Conventions, Do NOT, Environment Variables.

See assets/CLAUDE.md.template.

2. docs/architecture.md (recommended)

Contains: System architecture diagram, backend module index, frontend page index, Data Flow, Database Schema, API Structure, External Services.

See assets/architecture.md.template.

3. docs/modules/{name}.md (backend module docs)

One doc per backend module, containing: responsibilities, core files, entities, state machines, business rules, flows, dependencies, third-party integrations, error handling, common pitfalls.

See assets/module.md.template.

4. docs/pages/{name}.md (frontend page docs)

One doc per frontend page, containing: responsibilities, route, component tree, state management, data fetching, interaction flows, shared component dependencies, common pitfalls.

See assets/page.md.template.

5. docs/tech-stack.md (recommended)

See assets/tech-stack.md.template.

6. PR/Issue Templates (recommended)

See assets/pr-template.md and assets/issue-templates/.

Phase 7: Generate AI Tool-Specific Configs 📋🔬

Quick Mode skips this Phase.
Mandatory interaction: Before generating any tool-specific configs, you MUST present the tool selection interface below and wait for the user's explicit confirmation. Never skip this step. Never auto-select all tools.

Step 1: Detect current running environment. Identify which AI coding tool is currently executing this Skill (e.g., if running inside Kiro, the current tool is "Kiro"; if running inside Cursor, the current tool is "Cursor"). Only the detected current tool should be pre-selected by default.

Step 2: Present tool selection. Use the userInput tool with the following parameters:

{
  "question": "🔧 Select AI coding tools your team uses. Configs will be generated for selected tools.\n\n(The current tool is pre-selected. Toggle additional tools your team needs.)",
  "options": [
    {
      "title": "Select tools to configure",
      "subOptionsLabel": "AI Coding Tools",
      "subOptions": [
        { "title": "Claude Code", "description": ".claude/rules/, commands/, settings.json, .claudeignore" },
        { "title": "Kiro", "description": ".kiro/steering/ rule files (always-load + conditional-load)" },
        { "title": "Cursor", "description": ".cursor/rules/ .mdc files with glob path matching" },
        { "title": "GitHub Copilot", "description": ".github/copilot-instructions.md single-file instructions" },
        { "title": "Codex", "description": "AGENTS.md instruction files (root + per-directory)" },
        { "title": "OpenCode", "description": ".opencode/instructions.md project instructions" },
        { "title": "Trae", "description": ".trae/rules/ rule files with YAML frontmatter" }
      ]
    }
  ]
}

Step 3: Process user selection.

  • Parse the user's response to determine which tools were selected.
  • If no tools were selected: Prompt the user that at least one tool must be selected before continuing. Re-present the tool selection interface.
  • If one or more tools were selected: Record the selected tool list and proceed to generate configs only for the selected tools.

Step 4: Generate configs. Based on the confirmed selection, split and generate tool-specific config files from CLAUDE.md and analysis results. Only generate configs for tools the user selected — skip all unselected tools.

🌐 Language: Generate all tool-specific config content in the language selected by the user in Phase 0.

Claude Code (if team uses it)

Generate the complete Claude Code configuration system, including path-level rules, slash commands, permission config, and file ignore rules.

1. .claude/rules/ — Path-Level Rules

Split from CLAUDE.md to generate path-level rule files:

  • frontend.md — Frontend components, shared components, state management rules
  • backend.md — Backend API, error handling, database rules
  • testing.md — Test organization, naming, pattern rules

See assets/claude-rules/.

2. .claude/commands/ — Slash Commands

Generate Claude Code slash commands. Each .md file auto-registers as a /command-name command.

Generation steps:

  1. Copy assets/claude-commands/commit.md.template.claude/commands/commit.md
  2. Copy assets/claude-commands/review.md.template.claude/commands/review.md
  3. Customize:

- Read package.json scripts, integrate common script commands into commit/review workflows - Monorepo projects: add scope suggestion list (sub-package names) to commit.md - If project has specific commit conventions (e.g. JIRA ticket prefix), add to commit.md conventions section

  1. Suggest user add custom commands as needed (e.g. deploy.md, migrate.md)

Generated files:

  • commit.md — Git commit workflow (analyze git diff --staged → generate Conventional Commits message → execute commit)
  • review.md — Code review workflow (code quality → security → performance → test coverage → project conventions, output by 🔴🟡🟢 severity)

See assets/claude-commands/.

3. .claude/settings.json — Permission Config

Generate Claude Code permission config controlling what AI can and cannot do.

Generation steps:

  1. Start from assets/claude-settings.json.template
  2. Detect package manager (npm/pnpm/yarn/bun), replace command prefixes
  3. Read package.json scripts, add project-defined scripts to allow list
  4. Detect project toolchain (Docker → docker compose *, Prisma → npx prisma *, Python → python *)
  5. Security audit: ensure dangerous commands in deny list (rm -rf, npm publish, git push --force, curl|bash, sudo) don't appear in allow list
  6. Output final .claude/settings.json

See assets/claude-settings.json.template.

4. .claudeignore — File Ignore Rules

Generate .claudeignore in project root (alongside .gitignore) to prevent AI from accessing sensitive info or wasting context on irrelevant files.

Generation steps (three-layer overlay):

  1. Layer 1 —.gitignore base: Read project's .gitignore (if exists), reuse its ignore rules
  2. Layer 2 — AI tool default ignore patterns: Load from assets/claudeignore.template (env vars, keys/certs, large binaries, build artifacts, local databases, etc.)
  3. Layer 3 — Project-specific sensitive files: Detected by scan_project.py (.env*, *.pem, *.key, filenames containing secret/credential, etc.)
  4. Merge and deduplicate, ensure .env.example is not ignored (add !.env.example negation rule)
  5. Detect large resource directories (e.g. public/images/, static/assets/), suggest ignoring if large
  6. Output .claudeignore with categorized comments
⚠️ If .claudeignore already exists, skip generation and notify user.

See assets/claudeignore.template.

See references/tool-specific-configs.md for detailed format specifications.

Kiro (if team uses it)

Generate .kiro/steering/ directory with steering files, supporting always-load and conditional-load:

  • product.md — Product overview, business module summary, key business rules (always-load)
  • tech.md — Tech stack, commands, key dependencies (always-load)
  • structure.md — Project structure, architecture decisions, module/page index (always-load)
  • conventions.md — Coding conventions, Do NOT rules (always-load)
  • api.md — API conventions (conditional-load: matches API-related files)
  • frontend.md — Shared components, utility methods, frontend conventions (conditional-load: matches frontend files)

Steering files reference detailed docs via #[[file:docs/modules/xxx.md]], keeping themselves lightweight.

See assets/kiro-steering/.

Cursor (if team uses it)

Generate .cursor/rules/ directory with.mdc rule files supporting glob path matching:

  • project.mdc — Global rules (alwaysApply: true)
  • frontend.mdc — Frontend rules (glob matches **/*.tsx etc.)
  • backend.mdc — Backend rules (glob matches **/services/** etc.)
  • testing.mdc — Testing rules (glob matches **/*.test.* etc.)

See assets/cursor-rules/.

GitHub Copilot (if team uses it)

Generate .github/copilot-instructions.md single-file global instructions, condensed from CLAUDE.md (Copilot has a smaller context window, content must be concise).

See assets/copilot-instructions.md.template.

Codex (if team uses it)

Generate Codex instruction files from CLAUDE.md analysis results.

1. AGENTS.md — Root-Level Instructions

Create a root-level AGENTS.md file containing:

  • Project overview and tech stack summary
  • Global coding conventions and standards
  • Architecture guidelines
  • Key constraints and forbidden patterns

2. Per-Directory AGENTS.md (optional)

If the project has distinct modules (e.g., src/, tests/, docs/), generate subdirectory-level AGENTS.md files:

  • src/AGENTS.md — Source code conventions, import rules, component patterns
  • tests/AGENTS.md — Testing conventions, framework usage, coverage requirements

Hierarchy rule: Subdirectory AGENTS.md rules override/supplement root-level rules. Keep subdirectory files focused on directory-specific concerns.

OpenCode (if team uses it)

Generate OpenCode project instructions from CLAUDE.md analysis results.

1. .opencode/instructions.md — Project Instructions

Create a single project instruction file containing:

  • Project overview and purpose
  • Tech stack and key dependencies
  • Coding conventions and standards
  • Architecture patterns and guidelines
  • Forbidden patterns and common pitfalls

Format: Pure Markdown, single file. Keep concise and focused on actionable instructions.

Trae (if team uses it)

Generate Trae rule files from CLAUDE.md analysis results.

1. .trae/rules/project.md — Global Rules

Create a global rule file with YAML frontmatter:

---
description: "Project-wide coding standards and conventions"
globs: "**/*"
alwaysApply: true
---

Content: Project overview, tech stack, global coding conventions, architecture guidelines.

2. .trae/rules/frontend.md — Frontend Rules (if applicable)

---
description: "Frontend development rules"
globs: "src/components/**,src/pages/**,src/app/**"
alwaysApply: false
---

Content: Component patterns, state management, styling conventions, accessibility rules.

3. .trae/rules/backend.md — Backend Rules (if applicable)

---
description: "Backend development rules"
globs: "src/api/**,src/server/**,src/services/**"
alwaysApply: false
---

Content: API patterns, database conventions, error handling, security rules.

Format: Markdown with YAML frontmatter. Supports glob path matching for conditional loading (similar to Cursor's.mdc format).

Phase 8: Output Summary & Review ⚡📋🔬

Output generated file list, tech stack summary, module/page counts, TODO list requiring human input.

Phase 9: Validation Phase 📋🔬 (optional)

Quick Mode skips this Phase. 📋🔬 Standard and Full Mode optionally execute, default is skip.

After Phase 8 output summary, optionally run validation to have AI attempt a simple task to verify generated configs work.

1. Ask User Whether to Validate

Run config validation? AI will attempt a simple task to verify generated configs are effective. (yes/skip)

Default: skip
If user chooses skip or presses enter, skip Phase 9 and finish.

2. Choose Validation Method

Choose validation method:

1️⃣ Script Validation — Run validate_output.py to check file completeness
   Checks CLAUDE.md required sections, TODO markers, Markdown link validity

2️⃣ AI Task Validation — Have AI attempt a simple code task
   Add a simple function in an analyzed module/page, verify AI correctly references docs and follows conventions

3️⃣ Run Both

3. Execute Validation

Script Validation (option 1️⃣ or 3️⃣):

Run the output validation script:

python scripts/validate_output.py

The script checks: CLAUDE.md existence and required sections, TODO marker count, Markdown internal link validity, docs/ directory structure completeness.

AI Task Validation (option 2️⃣ or 3️⃣):

  1. Select one analyzed module/page as validation target
  2. AI attempts a simple code task (e.g. add a utility function to a service, add a helper component to a page)
  3. After the task, check whether AI:

- ✅ Correctly referenced business rules from the relevant module/page doc - ✅ Followed coding conventions from CLAUDE.md Code Conventions - ✅ Respected prohibitions from CLAUDE.md Do NOT - ✅ Used shared utilities/components documented in Common Utilities

4. Output Results and Improvement Suggestions

Summarize validation results by pass/warning/failure:

📋 Validation Results:

✅ AI correctly referenced business rules from module docs
✅ AI followed naming conventions from Code Conventions
⚠️ AI did not reference utility methods from Common Utilities
❌ AI violated a prohibition from Do NOT

Suggested improvements:
- Add usage examples for utility methods in CLAUDE.md Common Utilities section
- Add more specific prohibition scenarios in Do NOT section

If validation reveals config gaps:

  • Point out which config file and section needs improvement
  • Give specific improvement suggestions
  • If issues are severe, suggest manual review

If all validations pass:

🎉 Validation passed! AI can correctly understand project context and follow coding conventions.
Generated config files are ready to commit to the repository.

Output Structure

Fullstack project (team uses Claude Code + Kiro + Cursor + Codex):

project/
├── CLAUDE.md                              ← Universal agent rule file
├── AGENTS.md                              ← Codex root-level instructions
├── docs/
│   ├── architecture.md                    ← Architecture overview + index
│   ├── tech-stack.md                      ← Tech stack doc
│   ├── modules/                           ← Backend module docs
│   │   ├── auth.md
│   │   ├── course.md
│   │   └── payment-core.md
│   └── pages/                             ← Frontend page docs
│       ├── home.md
│       ├── course-detail.md
│       └── dashboard.md
├── .claude/                               ← Claude Code specific
│   ├── settings.json                      ← Permission config (allow/deny)
│   ├── rules/
│   │   ├── frontend.md
│   │   ├── backend.md
│   │   └── testing.md
│   └── commands/
│       ├── commit.md                      ← /commit slash command
│       └── review.md                      ← /review slash command
├── .claudeignore                          ← Claude Code file ignore rules (alongside .gitignore)
├── .kiro/                                 ← Kiro specific
│   └── steering/
│       ├── product.md
│       ├── tech.md
│       ├── structure.md
│       ├── conventions.md
│       ├── api.md                         ← Conditional load
│       └── frontend.md                    ← Conditional load
├── .cursor/                               ← Cursor specific
│   └── rules/
│       ├── project.mdc                    ← alwaysApply
│       ├── frontend.mdc                   ← glob match
│       ├── backend.mdc                    ← glob match
│       └── testing.mdc                    ← glob match
├── .opencode/                             ← OpenCode specific (if used)
│   └── instructions.md                    ← Project-level instructions
├── .trae/                                 ← Trae specific (if used)
│   └── rules/
│       ├── project.md                     ← Global rules (alwaysApply)
│       ├── frontend.md                    ← Frontend rules (glob match)
│       └── backend.md                     ← Backend rules (glob match)
└── .github/
    ├── copilot-instructions.md            ← Copilot specific (if used)
    ├── PULL_REQUEST_TEMPLATE.md
    └── ISSUE_TEMPLATE/

Note: Only generate tool-specific configs for tools the team actually uses.

Safety Rules

  1. Read-only analysis, never modify code — Only generate new files, never modify existing project code
  2. Never read sensitive data.env reads variable names only, never values; never read key files
  3. Mark uncertain parts — Info that cannot be inferred is marked TODO: please fill in, never guess
  4. Never overwrite existing files — If target file exists, skip and notify user
  5. Universal format — Generate standard Markdown, not dependent on any specific AI tool's proprietary format

Reference Materials

ReferenceWhen to Read
directory-patterns.mdDirectory structure recognition & project type detection
non-web-project-analysis.mdNon-web project (docs/knowledge base, CLI tool, library/SDK, microservice) analysis strategies
code-style-sampling.mdCode style sampling strategy
backend-analysis.mdBackend module deep analysis methods
frontend-analysis.mdFrontend page route & component analysis methods
tool-specific-configs.mdAI tool-specific config file generation guide
incremental-update-strategy.mdPhase 1.5 Resource Discovery: incremental update strategy, merge rules, conflict handling, backup strategy
infrastructure-analysis.mdInfrastructure/IaC project analysis: multi-project detection, workspace analysis, cloud CLI resource query

Templates

Common Templates

TemplatePurpose
CLAUDE.md.templateAgent rule file template
architecture.md.templateArchitecture doc template
module.md.templateBackend module doc template
page.md.templateFrontend page doc template
tech-stack.md.templateTech stack doc template
pr-template.mdPR template
issue-templates/Issue templates
infrastructure.md.templateInfrastructure/IaC project doc template

AI Tool-Specific Templates

TemplateToolPurpose
claude-rules/Claude Code.claude/rules/ path-level rule templates
claude-commands/Claude Code.claude/commands/ slash command templates (commit.md, review.md)
claude-settings.json.templateClaude Code.claude/settings.json permission config template
claudeignore.templateClaude Code.claudeignore file ignore rule template
kiro-steering/Kiro.kiro/steering/ steering file templates
cursor-rules/Cursor.cursor/rules/.mdc rule templates
copilot-instructions.md.templateGitHub CopilotGlobal instructions template

Supported Project Types

Project TypeDetection CriteriaAnalysis StrategySupport LevelReference
Next.js / React FullstackHas both page directory and service/controller layerAnalyze frontend + backend simultaneously⭐⭐⭐⭐⭐frontend-analysis.md, backend-analysis.md
Frontend Only (Vite/CRA/Vue)Has app/ or pages/ page directory, no service/controller layerPage routes + shared layer⭐⭐⭐⭐⭐frontend-analysis.md
Node.js Backend (Express/Fastify/NestJS)Has service/controller layer, no page directoryModule analysis⭐⭐⭐⭐⭐backend-analysis.md
Python (Django/FastAPI/Flask)Has service/controller layer, no page directoryBackend analysis⭐⭐⭐⭐backend-analysis.md
Go / RustHas service/controller layer, no page directoryBasic backend analysis⭐⭐⭐backend-analysis.md
MonorepoHas packages/ or apps/ directoryPer-sub-project analysis⭐⭐⭐⭐directory-patterns.md
React NativeHas screens/ directory + React Native dependencyAnalyze by screens⭐⭐⭐⭐frontend-analysis.md
Docs/Knowledge BaseRoot .md files > 50%, no src//app/ directoryDocument structure analysis (directory hierarchy + naming conventions + navigation files + content format)⭐⭐⭐⭐non-web-project-analysis.md
CLI ToolHas bin/ directory or package.json has bin field or CLI entry file existsCommand structure analysis (entry + subcommands + arguments + output format)⭐⭐⭐⭐non-web-project-analysis.md
Library/SDKHas src/index.* entry + package.json has main/exports, no page directoryAPI surface analysis (public interfaces + type definitions + version compatibility + release flow)⭐⭐⭐⭐non-web-project-analysis.md
MicroserviceHas Dockerfile + service entry, no frontend page directoryService interface analysis (routes + health checks + config management + inter-service communication)⭐⭐⭐⭐non-web-project-analysis.md
Infrastructure/IaCHas .tf files, cdk.json, Pulumi.yaml, ansible.cfg, main.bicep, Chart.yaml, or CloudFormation templatesSingle/multi-project structure detection → per-project IaC analysis (modules, workspaces, resources, cloud CLI query)⭐⭐⭐⭐infrastructure-analysis.md, non-web-project-analysis.md

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.69%
按下载量换算46

Claude

31.09%
按下载量换算41

Cursor

21.42%
按下载量换算28

Gemini CLI

10.18%
按下载量换算13

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills