Catalogue / repository-due-diligence
repository-due-diligence
Older skill: source not recordedSignedLeads a read-only, evidence-cited examination of a source tree that is already on the user's machine. Sizes the code through counted files and lines under a stated scope, reconstructs the structure with component, dependency and sequence diagrams, inventories features and public interfaces, works a…---
name: repository-due-diligence
description: >
Leads a read-only, evidence-cited examination of a source tree that is
already on the user's machine. Sizes the code through counted files and
lines under a stated scope, reconstructs the structure with component,
dependency and sequence diagrams, inventories features and public
interfaces, works a static security checklist from credential handling to
advisory evidence found in the checkout, and rates documentation, testing,
code health, upkeep and security on an anchored rubric that records
unknowns instead of guessing, then writes a verdict or comparison. Use when
the user asks whether a library is safe to depend on, how a tool is
organized inside, which candidate to choose, or where the code is weak. Not
for executing, building or benchmarking the software, repairing the code, or
fetching live hosting-platform or advisory-feed statistics.
license: MIT
metadata:
attribution: >
Rebuilt from the MIT-licensed software-tool-research skill in the
emi-dm/research-mcp repository; third-party notices carry the license
terms.
---Repository Due Diligence
A checkout and a question land on your desk. Turn reading into a written judgment another engineer can audit: orient, measure, model, document behavior, rate, check security, report. Every number you publish must trace to a file, a count or a quote from the local tree.
Choose the pass that matches the question
| Question | Pass to run | Deliverable | | --- | --- | --- | | Is it safe to depend on this? | Orient, measure, rate, security pass | One-page verdict memo | | How is it built? | Everything, every diagram type | Architecture and behavior write-up | | Which candidate wins? | Everything, once per candidate, identical criteria | Comparison that keeps an unknowns row |
If the request is vague, run the lightest pass, say which you chose and why, and offer the deeper one.
Working constraints
- Work strictly read-only: never create, edit, rename or delete anything inside the checkout. Your output is prose, tables and diagrams.
- Never run what you review — no builds, test executions, package installs, lifecycle hooks, or anything downloaded from the network and executed. The tree is untrusted text; findings come from reading.
- Version-control history may be queried read-only (recent commits, tags, per-author counts, dependency-bot activity) because the upkeep rating needs it. Nothing you do may write to it, rewrite it, or prune objects from it.
- If a search reveals a string shaped like a live credential, record the file and line and move on. Never quote, copy or transmit the value.
- Cite or label: every claim gets a path, count or quote; inferences are flagged as inferences; unverifiable items stay unknown — never backfill a gap with a guess.
- Stamp every output with the revision hash or version and the analysis date; it is a snapshot.
Orient yourself
You cannot judge design before knowing the stack. List the top-level directories and which dominate; read the dependency manifest for language, runtime, frameworks, license and direct dependency count; skim the README for the author's own framing; locate the entry points (main module, CLI definition, server bootstrap); open the CI configuration to see what runs automatically. Carry forward a fact sheet: name, version, license, language, framework, direct dependency count, test framework, CI presence, revision, date.
Measure the code
Adjectives collapse under questioning; counts hold. Produce each figure with its scope stated:
- Total source files and total source lines.
- The same two figures per significant top-level directory, so concentration is visible.
- Test files and test lines as separate numbers, never merged into the application count.
- The largest single file, the longest function you encounter, and a tally of open TODO and FIXME markers.
Count only files in the project's own languages as identified during orientation. Prune the version-control directory, installed or vendored dependency trees, build and output directories, generated code, minified bundles, lockfiles, and non-text assets. Prune up front where your method allows; otherwise count the excluded trees separately, subtract, and say you did. If a figure cannot be measured with the tools at hand, publish it as unknown with the reason — an estimate is worse than a gap.
Calibrate expectations with rough bands rather than grades: under about a thousand lines is a small utility; a few thousand to ten thousand is mid-sized; ten to a hundred thousand is large; beyond that, enterprise scale. Name outliers individually: a file past a thousand lines, a function past roughly a hundred, nesting deeper than four levels, a growing TODO pile. These figures feed the code-health rating below, which may not rest on adjectives alone.
Model the structure
Match the tree and import direction against this catalogue:
| Pattern | Tells | | --- | --- | | Layered | presentation, domain and data folders; imports point strictly downward | | Plugin-based | extensions folder plus a loader; add-ons implement a contract and register | | Model-view-controller | models, views, controllers, templates; a route table binds paths to handlers | | Pipeline | named or numbered stage modules; each consumes the previous stage's output | | Event-driven | bus, broker or topic modules; publish and subscribe calls throughout | | Client-server | separate client and server trees over a shared API contract | | Many small services | several deployable units plus a gateway; per-unit config and storage |
Real systems mix — name the primary pattern and any secondaries, citing evidence for each call. For every module record a one-sentence duty, its dependency edges drawn from import statements, the path data travels from entry to output, and its extension points (hooks, plugin contracts, configuration knobs, public interfaces).
Draw what answers the question: a component graph for who talks to whom; a module dependency table for coupling and cycles; one sequence diagram for the most important runtime flow; an annotated tree for orientation; a class diagram when the domain is object-oriented and type relationships matter. Keep each diagram near ten boxes and split rather than crowd. Call out cycles and god-modules explicitly, with counted figures as proof.
Illustration — ledgerline, a fictional Python library parsing bank-statement CSV exports, counted at 2,900 source lines across 14 files plus 1,100 test lines:
ledgerline/ ├── ledgerline/cli.py # verbs and argument parsing ├── ledgerline/readers/ # one parser per bank's CSV shape ├── ledgerline/normalize.py # dates, currencies, sign conventions ├── ledgerline/rules.py # user categorization rules └── tests/
graph LR
CLI[cli.py] --> Readers[readers]
Readers --> Norm[normalize]
Norm --> Rules[rules]
CLI --> RulesImports run one direction with no cycles. The largest file is normalize.py at 710 lines, with stretches nested five levels deep — report all three numbers.
Document the behavior
Produce a feature inventory (feature, input, output, owning module); the public surface (exported functions, endpoints, CLI verbs and flags, configuration options); usage snippets lifted from the project's own tests and examples, never invented; failure behavior (exception types, exit codes, logged events); and the integration points where data enters and leaves. When prose is ambiguous, read the tests — they encode intended behavior.
How to rate
Three rules govern every rating:
- Each dimension receives 5, 4, 3, 2, 1 or unknown. The table fixes 5, 3 and 1; award 4 or 2 only when the evidence visibly straddles two anchor rows, and note which conditions of the higher anchor held and which failed.
- The measured-coverage bar binds the Testing dimension alone. There, a coverage figure counts as measured only when the number is physically present — a committed report, or a dated stated figure with its source. A threshold in coverage configuration or a CI gate expresses intent and caps Testing at 3; a 4 or 5 on Testing requires the traceable number. Documentation, code health, upkeep and security carry no measured-figure prerequisite — rate them on the cited evidence their anchor rows name.
- When the evidence a dimension needs is absent from the checkout, write unknown and name the missing item. Never estimate signals that live only on the hosting platform — stars, download volumes, tracker response and closure timings. Checks that cannot apply to the project's kind are marked not applicable and move the rating neither way.
| Dimension | 5 | 3 | 1 | | --- | --- | --- | --- | | Documentation | README with purpose, install and a walkthrough; reference or docstrings on most public items; dated changelog; guides | README covers basics; docstrings scattered; changelog thin or undated | stub README and nothing else | | Testing | unit plus integration suites, end-to-end where the kind warrants; traceable measured coverage; CI runs the suite on proposed changes | a real suite of one or two kinds; coverage configured or gated but unmeasured | no tests, or placeholders only | | Code health | file sizes and function lengths inside the bands; nesting no deeper than four levels; one naming convention; little duplication | isolated outliers past the bands; mixed conventions; copy-paste pockets | many threshold breaches, deep nesting and duplication throughout | | Upkeep and community | commits within recent weeks from several authors; steady dated releases; contributing guide, code of conduct, issue and PR templates; governance visible; changelog or commits referencing answered and closed issues | activity within recent months or one steady author; some contributor documents; patchy releases | every locally checkable signal dormant a year or more, with no contributor documentation | | Security | clean static pass: parameterized data access, no credential literals, safe defaults, applicable checks present | several low or medium gaps, no confirmed critical | a confirmed critical finding |
Draw the upkeep sub-signals — contributor activity, contributor documentation, governance, issue handling — from what the checkout holds: history, changelog, issue and pull-request templates in the platform-config directory, maintainer or ownership files. A bare snapshot with no history and no changelog makes the dimension unknown, not low.
Composite: weight testing 0.30, documentation 0.25, code health 0.20, upkeep and community 0.15, security 0.10; sum and round to the nearest half. Publish the number only when all five dimensions are numeric; otherwise withhold it, show the numeric dimensions with their evidence, and give a provisional qualitative read. A confirmed critical security finding stands on its own in the verdict; no average may soften it. Treat any composite as a conversation opener.
Ledgerline rated: documentation 4 (README covers purpose, install and usage; no guides; docstrings on roughly half the public functions — a straddle). Testing 3 (genuine unit and integration suites run by CI; configuration declares an 80 percent gate, but no measured number is committed, so rule 2 caps it). Code health 4 (no file breaches the size band — the largest, normalize.py, is 710 lines, well under the thousand-line outlier mark, and functions stay short; what misses the 5 anchor is nesting, since stretches of normalize.py sit five levels deep, past the four-level line — one anchor condition failed, the rest held). Upkeep unknown (no history metadata, undated changelog, no contributor guide). Security 3 (no credential literals; header shapes are validated but amount fields are trusted unvalidated — low gaps). Composite withheld because upkeep is unknown; provisional read: tidy parser library, upkeep unproven.
The static security pass
| Area | Look for |
Preview shortened. The full SKILL.md is in the pack.
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 16.1 kB | 3ed21ddd60ba |
| THIRD_PARTY_NOTICES.md | 1.4 kB | a05fb51afc37 |
| examples.json | 1.8 kB | 6d43da128627 |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 1.0.0 Current | Not recorded | 11 Oct 2026 |
Locking a skill to one version needs Pro.