agentleFS
chenyinrusichenyinrusi/dsh-engineering-skills/skills/repo-analysis/SKILL.md

repo-analysis

Skill1 starsChanged 3 months agoMITView on GitHub

Cross-repository architecture audit and pattern absorption methodology. Use when analyzing external repos to extract design patterns, map them onto YOUR system''s architecture, and produce design documents with gap analysis and optional fix code. Covers 5 phases: repo scan, pattern extraction, mapping, value judgment, and structured output. 适用于外部仓库调研、架构审计、模式对比、设计文档产出与修复代码。

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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:

    Every judgment MUST be backed by source path and line number.

    line 79
  2. Distinctive:

    Write one design document per absorbed pattern, using your repo's design-doc convention.

    line 127
  3. Distinctive:

    If code changes are included:

    line 131
  4. Distinctive:

    When the input is multiple repos:

    line 159

≈ “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

Repo Analysis — Cross-Repository Architecture Audit & Pattern Absorption

Extract design patterns from external repositories, map them onto your own system's architecture, and produce a gap analysis with optional fix code. Core principle:

Don't copy implementations. Extract patterns → derive principles → design your own implementation.


Phase 1 — Repo scan (15–30 min/repo)

1.1 Fast structural assessment

For each external repo answer 5 questions without going deep:

DimensionKey question
PositioningWhat problem does it solve? One-sentence core value
ScaleCode volume (files/lines), language stack, dependency complexity
Core abstractionWhat new concepts does it introduce? (RLM, Harness, Skill, Evidence Graph...)
Architecture patternMonolith / microservices / plugin / Kernel+Extension?
Maturityprototype / early-stage / production-ready? stars, maintenance activity

1.2 Output

One structured summary per repo (≤ 500 words):

## {Repo Name}
- **Positioning**: one sentence
- **Core abstractions**: {2-3 key concepts}
- **Architecture pattern**: {pattern name, with key directory tree}
- **Worth attention**: {yes/no, one-sentence reason}
- **Risks**: {license, dependencies, maturity}

Phase 2 — Pattern extraction (cross-repo comparison)

2.1 Recognition dimensions

Classify each repo's patterns against a generic agent-system primitive taxonomy:

PrimitiveWhat to look forExternal examples
IntentHow intent is expressed (natural language / structured / DSL)structured problem definition; spec generation
ContextContext management (prompt injection / RAG / persistent REPL / knowledge graph)RLM + persistent REPL; code graph
PolicyConstraint enforcement (RBAC / approval gates / cost quotas / constitution)quality gates; governance layer
ExecutionAgent runtime (tool use / sub-agents / sandbox / task queue)Kernel+Extension; sub-agent recursion
EvidenceVerification mechanisms (test gates / data diff / audit logs / approval chains)CI evidence; evidence gates
EvaluationQuality assessment (metric-driven / LLM-as-judge / human review)critique loops; metric ratchets
LearningContinuous improvement (memory distillation / skill extraction / refine loops)continual harness; interpretable memory

2.2 Traps to avoid

  • Don't be misled by names: a project called "Agent Framework" may have its core value in its evidence model, not its runtime
  • Don't classify whole repos: the same repo can inspire multiple primitives (a repo = Context + Execution + Learning)
  • Distinguish "what it does" from "its design principles": the pattern may be Kernel+Extension, but the principle is "keep kernel small, everything else plugin" — the principle matters more than the implementation

Phase 3 — Mapping to your system

3.1 Gap classification

For every identified pattern use a three-level marker:

MarkerMeaningCondition
✅ Implementedyour system already has an equivalentsource path + functional comparison
⚠️ Partially implementedbaseline exists but a key dimension is missingpoint out what exists + what is missing
❌ Not implementeda real gapno equivalent in your system

Every judgment MUST be backed by source path and line number.

3.2 Mapping template

### Pattern: {Pattern Name} (source: {Repo})

**Current status**: {✅/⚠️/❌}
**Existing implementation** (if any):
  - `path/to/file.py:L{line}` — {functional description}
**Missing dimensions**:
  1. {missing item 1}
  2. {missing item 2}
**Conflict/overlap risk**:
  - overlaps with existing {module}: {conflict / complementary / independent}
  - duplicates an existing module or ticket? {yes / no / partial}

Phase 4 — Value judgment (absorb or not)

4.1 Decision matrix

For every ⚠️ or ❌ pattern:

DimensionWeightAssessment question
Architecture fithighDoes it fit your system's Work Model (Intent→Plan→Execute→Evidence→Validate→Approve)?
IrreplaceabilityhighIf absent, would it become a critical weakness?
Implementation costmediumHow many new modules? How much existing code changes?
Maintenance costmediumLong-term complexity? New external dependencies?
Overlap with existing moduleshighDoes an existing module already do 80%? (cross-directory check, not just same dir)
Phase fitmediumWhich roadmap phase does it belong to (reliable workflow / intelligence / continual agent)?

4.2 Decision outcomes

  • Absorb: architecture fit + irreplaceable → enter design phase
  • Stage: valuable but not in the current phase → write a staged note, "wait for phase X"
  • Reference: inspiring but not worth implementing → record in the knowledge base
  • Skip: overlaps, conflicts, or cost far exceeds value → record the reason and skip

Phase 5 — Output

5.1 Design document

Write one design document per absorbed pattern, using your repo's design-doc convention. Required sections: motivation, external reference, current-status mapping, design, change impact, risks & verification, phase ownership.

5.2 Fix code

If code changes are included:

  • one-off scripts (audit, migration, verification) as standalone .py files with an if __name__ == "__main__": entry
  • patch-level changes via a patch tool rather than new files
  • code must be self-contained; use print() not a logging framework for one-off scripts

Hard constraints

Must do

  1. Every judgment carries source evidence — no speculation; every ✅/⚠️/❌ has a file path + line
  2. Cross-domain audit — before judging, check whether an existing module (including outside the same directory) already does 80%
  3. Separate principle from implementation — the document's first half discusses the pattern (principle), the second half the concrete implementation plan
  4. Structured output — design docs are designs, not production code; don't modify production source while designing

Must not do

  1. Do not execute the external repo's code — read, analyze, compare only
  2. Do not judge without looking at your own source — "it probably doesn't exist" is not evidence
  3. Do not ignore overlap — when an existing implementation is found, first evaluate enhancing it before building new
  4. Do not stop at positioning narrative — "our system is an X" is a story, not a technical design. Technical design must answer "why must these primitives live together"

Multi-repo batch flow

When the input is multiple repos:

Phase 1 (parallel)      each repo scanned independently, structured summaries
    ↓
Phase 2 (cross)         all repos compared, common patterns identified
    ↓
Phase 3 (per pattern)   each pattern mapped against your system
    ↓
Phase 4 (aggregate)     all gaps judged together, prioritized
    ↓
Phase 5 (output)        merged into 1-3 design docs grouped by primitive, not by repo

Multi-repo output differs from single-repo: a single repo yields one design doc; a batch (5+) yields docs merged by primitive — e.g. one doc covering every repo's findings on the Execution primitive.

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.