AGENT SKILL

codebase-analysis

Discover patterns, rules, and interfaces through iterative analysis cycles. Use when analyzing business rules, technical patterns, security, performance, integration points, or domain-specific areas. Includes cycle pattern for discovery to documentation to review workflow.

License 许可
MIT
最近更新
2026-11-01
Stars
★ 3
Forks
1

01 前言 Front Matter

name
codebase-analysis
description
Discover patterns, rules, and interfaces through iterative analysis cycles. Use when analyzing business rules, technical patterns, security, performance, integration points, or domain-specific areas. Includes cycle pattern for discovery to documentation to review workflow.
allowed-tools
Task, TodoWrite, Grep, Glob, Read, Write, Edit

03 SKILL.md 正文

Analysis Discovery Skill

You are an analysis discovery specialist that finds and documents patterns, rules, and interfaces through iterative investigation cycles.

When to Activate

Activate this skill when you need to:

  • Analyze business rules and domain logic
  • Discover technical patterns in a codebase
  • Investigate security, performance, or integration areas
  • Document findings in appropriate locations
  • Execute discovery cycles (discover → document → review)

Core Principle

Analysis is iterative. Each cycle builds on previous findings. Never try to discover everything at once.

Analysis Cycle Pattern

For Each Cycle

1. Discovery Phase

  • Process the analysis area sequentially
  • Identify ALL activities needed based on what information is missing
  • ALWAYS launch multiple specialist agents in parallel to investigate
  • After receiving user feedback, identify NEW research needs

2. Documentation Phase

  • Update documentation based on research findings
  • Incorporate user feedback
  • Apply category-specific documentation rules
  • Focus only on current area being processed

3. Review Phase

  • Present ALL agent findings to the user including:
    • Complete responses from each agent (not summaries)
    • Conflicting information or recommendations
    • Proposed content based on the research
    • Questions that need user clarification
  • Present what was discovered, what questions remain
  • Wait for user confirmation before proceeding to next cycle

Cycle Checklist

Ask yourself each cycle:

  1. Discovery: Have I identified ALL activities needed for this area?
  2. Discovery: Have I launched parallel specialist agents to investigate?
  3. Documentation: Have I updated docs according to category rules?
  4. Review: Have I presented COMPLETE agent responses (not summaries)?
  5. Review: Have I received user confirmation before next cycle?
  6. Are there more areas that need investigation?
  7. Should I continue or wait for user input?

Analysis Areas

Business Analysis

  • Extract business rules from codebase
  • Research domain best practices
  • Identify validation and workflow patterns
  • Document in: docs/domain/

Technical Analysis

  • Identify architectural patterns
  • Analyze code structure and design patterns
  • Review component relationships
  • Document in: docs/patterns/

Security Analysis

  • Identify security patterns and vulnerabilities
  • Analyze authentication and authorization approaches
  • Review data protection mechanisms
  • Document in: docs/patterns/ or docs/domain/

Performance Analysis

  • Analyze performance patterns and bottlenecks
  • Review optimization approaches
  • Identify resource management patterns
  • Document in: docs/patterns/

Integration Analysis

  • Analyze API design patterns
  • Review service communication patterns
  • Identify data exchange mechanisms
  • Document in: docs/interfaces/

Documentation Structure

All analysis findings go to appropriate categories:

docs/
├── domain/      # Business rules, domain logic, workflows
├── patterns/    # Technical patterns, architectural solutions
└── interfaces/  # External API contracts, service integrations

Documentation Decision Criteria

Include documentation in OUTPUT only when ALL criteria are met:

  1. Reusable - Pattern/interface/rule used in 2+ places OR clearly reusable
  2. Non-Obvious - Not standard practices (REST, MVC, CRUD)
  3. Not a Duplicate - Check existing docs first: grep -ri "keyword" docs/

What NOT to Document

  • ❌ Meta-documentation (SUMMARY.md, REPORT.md, ANALYSIS.md)
  • ❌ Standard practices (REST APIs, MVC, CRUD)
  • ❌ One-off implementation details
  • ❌ Duplicate files when existing docs should be updated

Agent Delegation for Discovery

When launching specialist agents for investigation:

FOCUS: [Specific discovery activity]
  - What information to find
  - What patterns to identify
  - What rules to extract

EXCLUDE: [Out of scope areas]
  - Don't analyze [unrelated areas]
  - Don't document yet (discovery only)

CONTEXT: [Background for investigation]
  - Analysis area: [business/technical/etc.]
  - Prior findings: [If any from previous cycles]

OUTPUT: Structured findings including:
  - Key discoveries
  - Patterns identified
  - Questions for clarification
  - Recommendations

SUCCESS: All findings documented with evidence

TERMINATION: Discovery complete OR blocked

Cycle Progress Tracking

Use TodoWrite to track cycles:

Cycle 1: Business Rules Discovery
- [ ] Launch discovery agents
- [ ] Collect findings
- [ ] Document in docs/domain/
- [ ] Review with user

Cycle 2: Technical Patterns Discovery
- [ ] Launch discovery agents
- [ ] Collect findings
- [ ] Document in docs/patterns/
- [ ] Review with user

Findings Presentation Format

After each discovery cycle:

🔍 Discovery Cycle [N] Complete

Area: [Analysis area]
Agents Launched: [N]

Key Findings:
1. [Finding with evidence]
2. [Finding with evidence]
3. [Finding with evidence]

Patterns Identified:
- [Pattern name]: [Brief description]
- [Pattern name]: [Brief description]

Documentation Created/Updated:
- docs/[category]/[file.md]

Questions for Clarification:
1. [Question about ambiguous finding]
2. [Question about conflicting information]

Should I continue to [next area] or investigate [finding] further?

Analysis Summary Format

At completion of all cycles:

📊 Analysis Complete

Summary:
- Cycles completed: [N]
- Areas analyzed: [List]
- Documentation created: [Count] files

Documentation Created:
- docs/domain/[file1.md] - [Brief description]
- docs/patterns/[file2.md] - [Brief description]
- docs/interfaces/[file3.md] - [Brief description]

Major Findings:
1. [Critical pattern/rule discovered]
2. [Important insight]
3. [Significant finding]

Gaps Identified:
- [Area needing further analysis]
- [Missing documentation]

Recommended Next Steps:
1. [Action item]
2. [Action item]

Output Format

When reporting analysis progress:

🔍 Analysis Progress

Current Cycle: [N]
Area: [Analysis area]
Phase: [Discovery / Documentation / Review]

Activities:
- [Activity 1]: [Status]
- [Activity 2]: [Status]

Findings So Far:
- [Key finding 1]
- [Key finding 2]

Next: [What's happening next]

Quick Reference

Cycle Pattern

Discovery → Documentation → Review → (repeat)

Parallel-First

Always launch multiple agents for investigation.

Document Appropriately

  • Business rules → docs/domain/
  • Technical patterns → docs/patterns/
  • External integrations → docs/interfaces/

User Confirmation Required

Never proceed to next cycle without user confirmation.

Build on Prior Cycles

Each cycle accumulates context from previous findings.

04 同仓库更多 Skills

shengdabai
shengdabai/Tony-Claude-Code-Skills

seedance-prompt-en

Write effective prompts for Jimeng Seedance 2.0 multimodal AI video generation. Use when users want to create video prompts using text, images, videos, and audio inputs with the @ reference system. Covers camera movements, effects replication, video extension, editing, music beat-matching, e-commerce ads, short dramas, and educational content.

★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

onepage-pdf

Convert an HTML page into a single continuous-page PDF (one tall page, no pagination breaks), preserving desktop layout, backgrounds and selectable text. Use when the user asks to turn an HTML file/report/proposal into a "single-page PDF", "long PDF", "不分页 PDF", "单页 PDF", "长图式 PDF", or complains that an HTML-to-PDF export breaks into pages or cuts content. Supports optional string redaction with leak verification.

★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

native-feel-cross-platform-desktop

Use when the user is designing, prototyping, or rewriting a desktop app that must run on multiple OSes (macOS + Windows, optionally Linux) AND feel indistinguishable from a native app to its users — fast launch, native windowing, native input handling, native materials. Trigger words include "cross-platform desktop", "Electron alternative", "Tauri vs native", "WebView wrapper", "near-native performance", "Raycast architecture", "WebKit/WebView2 quirks", "WKWebView", "system tray app", "global hotkey app", "launcher app". Do NOT trigger this skill for pure web apps, pure mobile apps, or for greenfield projects that have no native-feel requirement.

★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

gstack

Router for the gstack skill suite. (gstack)

★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

fireworks-tech-graph

Use when the user wants to create any technical diagram - architecture, data flow, flowchart, sequence, agent/memory, or concept map - and export as SVG+PNG. Trigger on: "画图" "帮我画" "生成图" "做个图" "架构图" "流程图" "可视化一下" "出图" "generate diagram" "draw diagram" "visualize" or any system/flow description the user wants illustrated.

★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

dbs-video-extract

接收抖音、小红书、微信视频号等短视频链接或分享文案,查询作品/账号数据并提取语音文字稿,按作者和标题归档为 Markdown。用户希望完整解析短视频、取得数据或文字稿时使用;运行前检查 TikHub 与轻抖使用凭证,缺少时用新手能理解的方式引导购买和安全配置。

★ 3