codebase-analysis skill
아키텍처 개요, 기술 스택, 주요 파일 및 실행 가능한 개선 권장 사항을 포함한 구조화된 코드베이스 분석 보고서를 생성합니다.
- GitHub 스타
- 45
- 파일
- 3
- 마지막 커밋
- 2026년 5월 31일
- 라이선스
- MIT
- 허용된 도구
- 15
codebase-analysis skill은 무엇을 하나요?
codebase-analysis은(는) agent skill입니다. 아키텍처 개요, 기술 스택, 주요 파일 및 실행 가능한 개선 권장 사항을 포함한 구조화된 코드베이스 분석 보고서를 생성합니다.
skill의 SKILL.md에서 생성된 요약입니다.
codebase-analysis skill 정보
복잡한 프로젝트를 파악하려는 개발자는 이 SKILL을 사용하여 아키텍처, 기술 스택 및 주요 파일을 다루는 구조화된 보고서를 생성할 수 있습니다. 이 기능은 전문 explorer 및 synthesizer agent를 사용하여 코드베이스를 매핑하는 심층 분석부터 시작하는 3단계 워크플로우를 자동화합니다. 프로세스에는 반복적인 요청 시 시간을 절약하기 위해 exploration-cache에서 캐시된 결과를 확인하는 단계가 포함됩니다.
분석이 완료되면 관계 매핑을 위한 Mermaid 다이어그램과 기술 요약이 포함된 상세 보고서를 생성합니다. 사용자는 이러한 분석 결과를 markdown 파일로 저장하거나, README.md 또는 CLAUDE.md와 같은 프로젝트 문서를 업데이트하거나, 대화 컨텍스트에 요약본을 유지하도록 선택할 수 있습니다. 또한 기술적 리스크를 식별하고 실행 가능한 권장 사항을 순위별로 제공하여, 사용자가 자동화된 계획 및 조사 도구를 통해 심각도가 높은 문제를 즉시 해결할 수 있도록 돕습니다.
agent가 수행할 수 있는 작업
- 1프로젝트 아키텍처 매핑관계도를 포함하여 코드베이스가 어떻게 구성되어 있는지에 대한 포괄적인 개요를 생성합니다.
- 2기술적 리스크 감사리포지토리 내의 복잡도가 높은 지점과 기술적 리스크를 식별합니다.
- 3프로젝트 문서 업데이트새로운 아키텍처 인사이트를 기존 README 또는 AGENTS 파일에 자동으로 반영합니다.
- 4기술적 개선 실행특정 권장 사항을 처리하고 식별된 코드베이스 문제를 해결합니다.
skill의 SKILL.md를 기반으로 작성되었습니다. 모든 사용 사례는 해당 문서의 인용구와 대조 확인되었습니다.
codebase-analysis skill 설치 방법
각 명령은 skill 폴더를 클라이언트의 skills 디렉터리에 복사합니다. 클라이언트를 재시작하거나 새 세션을 시작하여 로드하세요.플러그인에 codebase-analysis skill 설치
/plugin marketplace add sequenzia/agent-alchemy /plugin install agent-alchemy-core-tools@agent-alchemy
Claude Code에 codebase-analysis skill 설치
~/.claude/skills/codebase-analysis/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/core-tools/skills/codebase-analysis ~/.claude/skills/codebase-analysisClaude Code (project)에 codebase-analysis skill 설치
.claude/skills/codebase-analysis/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/core-tools/skills/codebase-analysis .claude/skills/codebase-analysisCodex에 codebase-analysis skill 설치
~/.agents/skills/codebase-analysis/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/core-tools/skills/codebase-analysis ~/.agents/skills/codebase-analysisGemini CLI에 codebase-analysis skill 설치
~/.gemini/skills/codebase-analysis/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/core-tools/skills/codebase-analysis ~/.gemini/skills/codebase-analysisClaude.ai에 codebase-analysis skill 설치
npx degit sequenzia/agent-alchemy/claude/core-tools/skills/codebase-analysis codebase-analysis && zip -r codebase-analysis.zip codebase-analysis # claude.ai → Customize → Skills → + → Create skill → Upload a skill → codebase-analysis.zip
SKILL.md
GitHub에서 보기Codebase Analysis Workflow
Execute a structured 3-phase codebase analysis workflow to gather insights.
CRITICAL: Complete ALL 3 phases. The workflow is not complete until Phase 3: Post-Analysis Actions is finished. After completing each phase, immediately proceed to the next phase without waiting for user prompts.
Phase Overview
- Deep Analysis — Explore and synthesize codebase findings via deep-analysis skill
- Reporting — Present structured analysis to the user
- Post-Analysis Actions — Save, document, or retain analysis insights
Phase 1: Deep Analysis
Goal: Explore the codebase and synthesize findings.
-
Determine analysis context:
- If
$ARGUMENTSis provided, use it as the analysis context - If no arguments, set context to "general codebase understanding"
- If
-
Check for cached results:
- Check if
.claude/sessions/exploration-cache/manifest.mdexists - If found, read the manifest and verify:
codebase_pathmatches the current working directory, andtimestampis within the configured cache TTL (default 24 hours) - If cache is valid, use
AskUserQuestion:- Use cached results (show the formatted cache date) — Read cached synthesis from
.claude/sessions/exploration-cache/synthesis.mdand recon fromrecon_summary.md. SetCACHE_HIT = trueandCACHE_TIMESTAMPto the cache's timestamp. Skip step 3 and proceed directly to step 4. - Run fresh analysis — Remove the cache manifest file, set
CACHE_HIT = false, and proceed to step 3
- Use cached results (show the formatted cache date) — Read cached synthesis from
- If no valid cache: set
CACHE_HIT = falseand proceed to step 3
- Check if
-
Run deep-analysis workflow:
- Read
${CLAUDE_PLUGIN_ROOT}/skills/deep-analysis/SKILL.mdand follow its workflow - Pass the analysis context from step 1
- This handles reconnaissance, team planning, approval (auto-approved when skill-invoked), team creation, parallel exploration (code-explorer agents), and synthesis (code-synthesizer agent)
- After completion, set
CACHE_TIMESTAMP = null(fresh results, no prior cache)
- Read
-
Verify results and capture metadata:
- Ensure the synthesis covers the analysis context adequately
- If critical gaps remain, use Glob/Grep to fill them directly
- Record analysis metadata for Phase 2 reporting: whether results were cached (
CACHE_HIT), cache timestamp if applicable (CACHE_TIMESTAMP), and the number of explorer agents used (from the deep-analysis team plan, or 0 if cached)
Phase 2: Reporting
Goal: Present a structured analysis to the user.
-
Load diagram guidance:
- Read
${CLAUDE_PLUGIN_ROOT}/skills/technical-diagrams/SKILL.md - Use Mermaid diagrams in the Architecture Overview and Relationship Map sections
- Read
-
Load report template:
- Read
${CLAUDE_PLUGIN_ROOT}/skills/codebase-analysis/references/report-template.md - Use it to structure the presentation
- Read
-
Present the analysis: Structure the report with these sections:
- Executive Summary — Lead with the most important finding
- Architecture Overview — How the codebase is structured
- Tech Stack — Core technologies, frameworks, and tools detected
- Critical Files — The 5-10 most important files with details
- Patterns & Conventions — Recurring patterns and coding conventions
- Relationship Map — How components connect to each other
- Challenges & Risks — Technical risks and complexity hotspots
- Recommendations — Actionable next steps, each citing the challenge it addresses
- Analysis Methodology — Agents used, cache status, scope, and duration
-
IMPORTANT: Proceed immediately to Phase 3. Do NOT stop here. Do NOT wait for user input. The report is presented, but the workflow requires Post-Analysis Actions. Continue directly to Phase 3 now.
Phase 3: Post-Analysis Actions
Goal: Let the user save, document, or retain analysis insights from the report through a multi-step interactive flow.
Step 1: Select actions
Use AskUserQuestion with multiSelect: true to present all available actions:
- Save Codebase Analysis Report — Write the structured report to a markdown file
- Save a custom report — Generate a report tailored to your specific goals (you'll provide instructions next)
- Update project documentation — Add/update README.md, CLAUDE.md, or AGENTS.md with analysis insights
- Keep a condensed summary in memory — Retain a quick-reference summary in conversation context
If the user selects no actions, the workflow is complete. Thank the user and end.
Step 2: Execute selected actions
Process selected actions in the following fixed order. Complete all sub-steps for each action before moving to the next.
Action: Save Codebase Analysis Report
Step 2a-1: Prompt for file location
- Check if an
internal/docs/directory exists in the project root- If yes, suggest default path:
internal/docs/codebase-analysis-report-{YYYY-MM-DD}.md - If no, suggest default path:
codebase-analysis-report-{YYYY-MM-DD}.mdin the project root
- If yes, suggest default path:
- Use
AskUserQuestionto let the user confirm or customize the file path
Step 2a-2: Generate and save the report
- Use the report template already loaded in Phase 2 Step 1
- Generate the full structured report using the Phase 2 analysis findings and the template structure
- Write the report to the confirmed path using the Write tool
- Confirm the file was saved
Action: Save Custom Report
Step 2b-1: Gather report requirements
- Use
AskUserQuestionto ask the user to describe the goals and requirements for their custom report — what it should focus on, what questions it should answer, and any format preferences
Step 2b-2: Prompt for file location
- Check if an
internal/docs/directory exists in the project root- If yes, suggest default path:
internal/docs/custom-report-{YYYY-MM-DD}.md - If no, suggest default path:
custom-report-{YYYY-MM-DD}.mdin the project root
- If yes, suggest default path:
- Use
AskUserQuestionto let the user confirm or customize the file path
Step 2b-3: Generate and save the custom report
- Generate a report shaped by the user's requirements from Step 2b-1, drawing from the Phase 2 analysis data — this is a repackaging of existing findings, not a re-analysis
- Write the report to the confirmed path using the Write tool
- Confirm the file was saved
Action: Update Project Documentation
Step 2c-1: Select documentation files and gather directions
Use AskUserQuestion with multiSelect: true:
- README.md — Add architecture, structure, and tech stack information
- CLAUDE.md — Add patterns, conventions, critical files, and architectural decisions
- AGENTS.md — Add agent descriptions, capabilities, and coordination patterns
Then use a single AskUserQuestion to gather update directions for all selected files: "What content from the analysis should be added or updated? Provide general directions or specific sections to focus on (applies across all selected files, or specify per-file directions)."
Step 2c-2: Generate and approve documentation drafts
For each selected file, read the existing file and generate a draft based on the user's directions and Phase 2 analysis data:
- README.md: Read existing file at project root. If no README.md exists, skip and inform the user. Draft updates focusing on architecture, project structure, and tech stack.
- CLAUDE.md: Read existing file at project root. If none exists, ask if one should be created (if declined, skip). Draft updates focusing on patterns, conventions, critical files, and architectural decisions.
- AGENTS.md: Read existing file at project root (create new if none exists). Draft content focusing on agent inventory (name, model, purpose), capabilities and tool access, coordination patterns, skill-agent mappings, and model tiering rationale.
Present all drafts together in a single output, clearly labeled by file. Then use AskUserQuestion:
- Apply all — Apply all drafted updates
- Modify — Specify which file(s) to revise and what to change (max 3 revision cycles, then must Apply or Skip)
- Skip all — Skip all documentation updates
If approved, apply updates using Edit tool (existing files) or Write tool (new files).
Action: Keep Insights in Memory
- Present a condensed Codebase Quick Reference inline in the conversation:
- Architecture — 1-2 sentence summary of how the codebase is structured
- Key Files — 3-5 most critical files with one-line descriptions
- Conventions — Important patterns and naming conventions
- Tech Stack — Core technologies and frameworks
- Watch Out For — Top risks or complexity hotspots
- No file is written — this summary stays in conversation context for reference during the session
Step 3: Actionable Insights Follow-up
Condition: This step always executes after Step 2 completes. The Phase 2 analysis is available in conversation context regardless of whether a report file was saved.
Use AskUserQuestion to ask:
- Address actionable insights — Fix challenges and implement recommendations from the report
- Skip — No further action needed
If the user selects "Skip", proceed to Step 4.
If the user selects "Address actionable insights":
Step 3a: Extract actionable items from the report
Parse the Phase 2 report (in conversation context) to extract items from:
- Challenges & Risks table rows — title from Challenge column, severity from Severity column, description from Impact column
- Recommendations section — each numbered item with an (addresses: {Challenge name}) citation; inherit the cited challenge's severity (High/Medium/Low). If no citation is present, default to Medium.
- Other findings with concrete fixes — default to Low severity
If no actionable items are found, inform the user and skip to Step 4.
Step 3b: Present severity-ranked item list
- Load reference template from
${CLAUDE_PLUGIN_ROOT}/skills/codebase-analysis/references/actionable-insights-template.md - Present items sorted High → Medium → Low, each showing:
- Title
- Severity (High / Medium / Low)
- Source section (Challenges & Risks, Recommendations, or Other)
- Brief description
- Use
AskUserQuestionwithmultiSelect: truefor the user to select which items to address - If no items selected, skip to Step 4
Step 3c: Process each selected item in priority order (High → Medium → Low)
For each item:
-
Assess complexity:
- Simple — Single file, clear fix, localized change
- Complex — Multi-file, architectural impact, requires investigation
-
Plan the fix:
- Simple: Read the target file, propose changes directly
- Complex (architectural): Launch
agent-alchemy-core-tools:code-architectagent with context: the item title, severity, description, the relevant report section text (copy the specific Challenges/Recommendations entry), and any files or components mentioned. The agent designs the fix and returns a proposal. - Complex (needs investigation): Launch
agent-alchemy-core-tools:code-exploreragent with context: the item title, description, suspected files/components, and what needs investigation. The agent explores and returns findings for you to formulate a fix proposal. - If an agent launch fails, fall back to direct investigation using Read/Glob/Grep and propose a simpler fix based on available information.
-
Present proposal: Show files to modify, specific changes, and rationale
-
User approval via
AskUserQuestion:- Apply — Execute changes with Edit/Write tools, confirm success
- Skip — Record the skip, move to next item
- Modify — User describes adjustments, re-propose the fix (max 3 revision cycles, then must Apply or Skip)
Step 3d: Summarize results
Present a summary covering:
- Items addressed (with list of files modified per item)
- Items skipped
- Total files modified table
Step 4: Complete the workflow
Summarize which actions were executed and confirm the workflow is complete.
Error Handling
General
If any phase fails:
- Explain what went wrong
- Ask the user how to proceed:
- Retry the phase
- Skip to next phase (with partial results)
- Abort the workflow
Documentation Update Failures (Step 2c)
If an Edit or Write call fails when applying documentation updates:
- Retry the operation once
- If still failing, present the drafted content to the user inline and suggest they apply it manually
- Continue with the remaining selected files
Agent Launch Failures (Step 3c)
If a code-architect or code-explorer agent fails during actionable insight processing:
- Fall back to direct investigation using Read, Glob, and Grep
- Propose a simpler fix based on available information
- If the item is too complex to address without agent assistance, inform the user and offer to skip
Agent Coordination
Exploration and synthesis agent coordination is handled by the deep-analysis skill in Phase 1, which uses Agent Teams with hub-and-spoke coordination. Deep-analysis performs reconnaissance, composes a team plan (auto-approved when invoked by another skill), assembles the team, and manages the exploration/synthesis lifecycle. See that skill for team setup, approval flow, agent model tiers, and failure handling details.
Additional Resources
- For report structure, see references/report-template.md
- For actionable insights format, see references/actionable-insights-template.md
이 스킬의 파일
3codebase-analysis skill 질문
Claude Code에 codebase-analysis skill을 어떻게 설치하나요?
npx degit sequenzia/agent-alchemy/claude/core-tools/skills/codebase-analysis ~/.claude/skills/codebase-analysis를 실행합니다. Claude Code는 ~/.claude/skills(모든 프로젝트) 또는 .claude/skills(한 프로젝트)에서 skills를 로드하며, 설명이 작업과 일치할 때 skill을 사용합니다.
codebase-analysis skill을 사용할 수 있는 클라이언트는 무엇인가요?
Agent Skills 형식을 읽는 모든 클라이언트(Claude Code, Codex, Gemini CLI, claude.ai(ZIP으로 업로드))가 사용할 수 있습니다. skill 내 스크립트는 클라이언트가 코드 실행을 허용하는 경우에만 실행됩니다.
시각적 다이어그램을 지원하나요?
네, Mermaid 다이어그램을 사용하여 아키텍처 개요와 컴포넌트 관계도를 시각화합니다.
분석 중 발견된 사항을 바로 조치할 수 있나요?
네, 워크플로우에 실행 가능한 인사이트를 처리하는 후속 단계가 포함되어 있어, 심각도에 따라 문제를 해결하고 권장 사항을 구현할 수 있습니다.