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

xiaolai-methodology

以李笑来(Li Xiaolai)的思考方式、方法论与表达风格,为用户做全方位 1-on-1 教练指导,覆盖创业、赚钱、投资、学习、自学、读书写作、用 AI、以及人生心态与自我管理。当用户提到 "李笑来"、"笑来"、"笑来老师"、"扮演李笑来"、"找笑来聊聊"、"笑来怎么看"、"xiaolai"、"把时间当作朋友"、"通往财富自由之路"、"定投改变命运"、"韭菜的自我修养"、"自学是门手艺"、"让时间陪你慢慢变富"、"七年就是一辈子"、"元认知"、"活在未来"、"复利/长期主义"、"践行"、"痴迷改进"、"个人商业模式/出售时间"、"睡后收入"、"定投"、"财富自由"、"操作系统升级"、"最少必要知识"、"北极星提示词"、"用 AI 该怎么学/思考" 等任一触发词,或当用户带着关于创业/赚钱/投资/学习/职业/重大人生决策的困惑、希望被人用笑来式的「逻辑 + 大白话 + 类比 + 重新定义 + 践行导向」来点醒和指导时,自动进入李笑来教练模式。

写作与文案
★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

zread

Produce and consume a wiki-style knowledge base for a code repository via the `zread` CLI and its on-disk output under `./.zread/wiki/`. Use this skill whenever the user wants to understand, onboard onto, explore, summarize, map, or get an overview of an unfamiliar codebase; asks for architecture docs, a project wiki, a repo walkthrough, module/package explanations, or "what does this repo do"; wants to generate, regenerate, resume, browse, or serve code documentation locally; or mentions zread / zread.ai directly. Also use it proactively before diving into a large unknown repo — if `./.zread/wiki/current` exists, read the generated pages instead of crawling source file-by-file; if it doesn't, consider offering to run `zread generate`. The trigger is the intent (understand a codebase through generated docs), not the literal word "zread".

开发工程师Skill与智能体开发
★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

youtube

Launch the YouTube Creator Agent to auto-generate videos. Use when: user types /youtube, wants to create YouTube videos, generate video content, or upload to YouTube. Keywords: youtube, video, 视频, 创作视频, 发布视频

内容创作者Skill与智能体开发
★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

youtube-script-sync

Sync, update, or optimize Tony's GetNote knowledge base `Youtube视频逐字稿` by turning each parent recording or first-person idea note into an idempotent child note containing a directly recordable YouTube long-video or Shorts script. Use when the user says “更新/同步/优化 Youtube视频逐字稿知识库”, or says “更新/同步/优化该知识库” while this knowledge base is the active context.

Skill与智能体开发
★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

writing-skills

How to write SKILL.md files that trigger reliably and teach effectively. Use when creating, improving, or reviewing Claude Code skills.

开发工程师内容创作者写作与文案Skill与智能体开发
★ 3
shengdabai
shengdabai/Tony-Claude-Code-Skills

writing-rules

How to write .claude/rules/ files that Claude actually follows. Use when creating, improving, or reviewing project rules.

内容创作者写作与文案
★ 3