agentleFS
gootfgootf/software-agent-sop/analyze-architecture/SKILL.md

analyze-architecture

Skill2 starsChanged 2 months agoMITView on GitHub

Deeply analyze codebase architecture and dependencies. Use when understanding system design, finding patterns, or mapping how components interact.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use Glob to find all files related to the target:

    line 54
  2. Distinctive:

    Read the most important files:

    line 64
  3. Distinctive:

    Use Grep to find:

    line 77
  4. Distinctive:

    Import statements for the target

    line 78
  5. Distinctive:

    Create a dependency graph showing relationships.

    line 82
  6. Distinctive:

    Use when you need deep investigation without disrupting current work

    line 162

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Analyze Codebase Architecture

Perform deep architectural analysis of the target component or feature (per the user's request) without cluttering the main context.

Analysis Goals

Investigate and document:

  1. Component Structure
    • How is the target organized?
    • What are the main modules/files?
    • What patterns are being used?
  2. Dependencies & Relationships
    • What does the target depend on?
    • What depends on the target?
    • Are there circular dependencies?
    • Are dependencies appropriately layered?
  3. Data Flow
    • How does data flow through the target?
    • What are the inputs and outputs?
    • Where is state managed?
    • Are there side effects?
  4. Design Patterns
    • What architectural patterns are used?
    • Are patterns applied consistently?
    • Are there anti-patterns present?
  5. Potential Issues
    • Tight coupling between components?
    • Missing abstractions or too many abstractions?
    • Code duplication?
    • Complexity hotspots?

Investigation Steps

Step 1: Map the Territory

Use Glob to find all files related to the target:

# Find main component files
# Find tests
# Find documentation
# Find configuration

Step 2: Understand Key Files

Read the most important files:

  • Entry points
  • Core business logic
  • Public APIs
  • Type definitions

For each file, note:

  • Purpose and responsibilities
  • Key functions/classes
  • Exports and imports

Step 3: Trace Dependencies

Use Grep to find:

  • Import statements for the target
  • References to key functions
  • Test coverage

Create a dependency graph showing relationships.

Step 4: Analyze Patterns

Look for:

  • Consistent patterns (good)
  • Pattern violations (investigate why)
  • Missing patterns (opportunities)
  • Overused patterns (complexity)

Step 5: Generate Report

Output Format

Provide a comprehensive report:

Overview

  • What is the target?
  • What problem does it solve?
  • Where does it fit in the larger system?

Architecture Diagram

[ASCII diagram showing component structure]

Component A
├── Sub-component B
├── Sub-component C
└── Sub-component D
    ├── Module E
    └── Module F

Key Components

For each major component:

  • Purpose: What it does
  • Location: File paths
  • Dependencies: What it uses
  • Dependents: What uses it
  • Complexity: Lines of code, cyclomatic complexity if notable

Data Flow

Input → [Component A] → [Component B] → Output
          ↓
      [Side Effect]

Patterns Observed

  • Pattern 1: Where it's used and why
  • Pattern 2: Implementation details

Issues & Recommendations

Issues

  1. Issue description
    • Impact: High/Medium/Low
    • Location: file.ts:123
    • Recommendation: Specific action

Opportunities

  1. Improvement description
    • Benefit: What would improve
    • Approach: How to implement

Metrics

  • Total files: X
  • Total lines: Y
  • Test coverage: Z%
  • Key dependencies: List

Notes

  • This skill runs in a forked context to avoid cluttering your main conversation
  • It can read many files without impacting your working context
  • Results are summarized and returned to you when analysis completes
  • Use when you need deep investigation without disrupting current work

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.