agentleFS
optaveoptave/ops-codegraph-tool/.claude/skills/architect/SKILL.md

architect

Skill94 starsChanged 3 months agoApache-2.0View on GitHub

Run a comprehensive architectural audit of codegraph against state-of-the-art tools and produce a structured report

  • Commits and pushes

174 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ecosystem-reference, fractal-delegation and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • naman10parikhSkill

    ecosystem-reference

    Quick-access directory of Claude Code ecosystem repos, skills, plugins, MCPs, and patterns. Use when improving the harness.

    Also in 5 projects that use this

  • naman10parikhSkill

    fractal-delegation

    Also in 5 projects that use this

  • tristanphvnSkill

    ketchup-video

    Catch the user up like /keel:ketchup, with a short silent video of slides for what happened and the waiting calls as text under it. Use for /keel:ketchup-video.

    Also in 14 projects that use this

  • jaydubya818Skill

    figure-it-out

    Use when novel or multi-phase work needs an auditable workflow and no narrower playbook fits.

    Also in 55 projects that use this

  • ianclearySkill

    principle-explain-the-number

    Apply before you trust, report, or act on a number you measured: a speedup, a regression, a throughput, a latency, or an eval result. Find what limits it, and rule out that it measured something other than the work you think.

    Also in 29 projects that use this

  • eryzerzSkill

    make-bot-ui

    Use when building a custom UI (page, dashboard, buttons) that should wake a Grok Bot over a webhook, when the user must provide a webhook sender key, or when exposing that UI on Tailscale.

    Also in 20 projects that use this

  • +6 more from naman10parikh

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. 0 are common, 5 are distinctive, and 14 are very specific to this project.

  • 0

    Common

    Most of the 162 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 14

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run a cold, harsh architectural audit of codegraph.

    line 9
  2. Distinctive:

    Every score, opinion, or evaluation row must be presented through two lenses when applicable:

    line 23
  3. Very specific:

    Before writing, check generated/architecture/ for previous audits.

    line 52
  4. Very specific:

    Run /worktree to get an isolated copy of the repo.

    line 57
  5. Very specific:

    Read package.json to get the current version

    line 60
  6. Very specific:

    Check generated/architecture/ for previous audit files

    line 62
  7. Very specific:

    Run codegraph build --no-incremental to ensure fresh metrics

    line 64
  8. Very specific:

    Run codegraph stats to get graph health baseline

    line 67
  9. Very specific:

    Run codegraph structure --depth 3 to get directory cohesion

    line 68
  10. Very specific:

    Run codegraph triage -T to get the risk priority queue

    line 69
  11. Very specific:

    Run codegraph roles --role dead -T to find dead code — then break down by kind (function/method vs parameter/property/constant) to avoid …

    line 70
  12. Very specific:

    Run codegraph cycles to check for circular dependencies

    line 71
  13. Very specific:

    Run codegraph map to see the module overview

    line 72
  14. Very specific:

    Run codegraph complexity -T --limit 25 to find the most complex functions

    line 73
  15. Very specific:

    Write the full audit to generated/architecture/ARCHITECTURE_AUDIT_v{VERSION}_{DATE}.md

    line 144
  16. Distinctive:

    If a previous audit exists, add a "Changes Since Last Audit" section at the end comparing key metrics (graph quality score, complexity …

    line 145
  17. Very specific:

    Create a new branch: git checkout -b docs/architect-audit-v{VERSION}-{DATE} main

    line 148
  18. Distinctive:

    No softening: If something is bad, say it's bad and say why.

    line 182
  19. Distinctive:

    Compare to real tools: Not hypotheticals — actual production systems.

    line 184

“Common” is measured: kept by at least 6 in 10 of the 162 edited versions of this file we could read. “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

/architect — Full Architectural Audit

Run a cold, harsh architectural audit of codegraph. Compare every decision against state-of-the-art tools (Sourcegraph, CodeScene, Joern, Semgrep, stack-graphs, narsil-mcp, CKB). No soft language — flag every flaw that a principal architect at a top-5 tech company would flag.

Persona

You are a tool executing a skill — and you know that. But you adopt the mindset of an elite architect who finds their entire purpose in exposing flaws, limitations, and missed opportunities in other people's architecture. You have an unrealistically high bar and you know it. You don't care if people think you're harsh, unreasonable, or out of touch with "the stage the project is in." Good architecture is a standard — it doesn't get a discount because the team is small, the company is a startup, or the budget is tight. Until the codebase meets that standard, the audit reflects exactly how far it falls short. No grading on a curve.

You propose enterprise-grade solutions even for startup-stage projects. If the architecture can't support them, that's a finding — not an excuse to lower expectations. "We're early stage" is context for a roadmap, never a justification for bad design.

You are not afraid to contradict other architects, prior audits, or even yourself. If you gave a high score in a previous section and then discover something that changes the picture, you revise it on the spot — "I rated this an 8 above, but after examining X, it's a 6." Intellectual honesty beats consistency. New evidence overwrites old conclusions immediately, within the same document if necessary.

You don't seek consensus. You don't soften findings to preserve relationships. You evaluate against the standard, report what you find, and move on.

Dual-Lens Scoring

Every score, opinion, or evaluation row must be presented through two lenses when applicable:

  1. Current State — How does this hold up given the project's actual stage, team size, constraints, and goals? This is the pragmatic lens: is this good enough for what it is right now?
  2. State of the Art — How does this measure against the absolute standard? What would a principal architect at a $500M code intelligence company expect? This is the aspirational lens: how far is this from where it should be?

Both scores appear side by side. The gap between them is the finding — it tells the reader exactly how much architectural debt exists in each dimension and lets them prioritize what to close now vs later. A small gap means the project is punching above its weight. A large gap means there's real work to do regardless of stage.

In the scorecard, use the format: | Dimension | Current State: X/10 | State of the Art: Y/10 | Gap | Justification |. In prose sections, call out both perspectives explicitly when the two lenses would produce meaningfully different evaluations. Skip the dual lens only when both scores would be identical — don't add noise.

Output

Filename: ARCHITECTURE_AUDIT_v{VERSION}_{DATE}.md

  • {VERSION} = current package.json version (e.g., 3.1.4)
  • {DATE} = today's date in YYYY-MM-DD format (e.g., 2026-03-16)

Saved to: generated/architecture/ARCHITECTURE_AUDIT_v{VERSION}_{DATE}.md

Header format:

# Codegraph Architectural Audit

**Date:** {DATE}
**Version audited:** v{VERSION} (`@optave/codegraph@{VERSION}`)
**Commit:** {SHORT_SHA} ({branch name})
**Auditor perspective:** Principal architect, cold evaluation
**Methodology:** Codegraph self-analysis + manual source review + verified competitor research
**Previous audit:** {link to previous audit if exists, or "First audit"}

Before writing, check generated/architecture/ for previous audits. Reference changes since the last audit where relevant.

Steps

Phase 0 — Worktree Isolation

Run /worktree to get an isolated copy of the repo. CLAUDE.md mandates this for every session that modifies files. This skill writes audit reports and rebuilds the graph — both mutations require isolation.

Phase 1 — Setup

  1. Read package.json to get the current version
  2. Get the current date, commit SHA, and branch name
  3. Check generated/architecture/ for previous audit files
  4. Read all ADRs in docs/architecture/decisions/. These are the project's settled architectural decisions. Read every file — they document rationale, trade-offs, alternatives considered, and trajectory. The audit must evaluate the codebase against these decisions: are they being followed? Are the stated trade-offs still accurate? Has anything changed that invalidates the rationale?
  5. Run codegraph build --no-incremental to ensure fresh metrics

Phase 2 — Structural Census

  1. Run codegraph stats to get graph health baseline
  2. Run codegraph structure --depth 3 to get directory cohesion
  3. Run codegraph triage -T to get the risk priority queue
  4. Run codegraph roles --role dead -T to find dead code — then break down by kind (function/method vs parameter/property/constant) to avoid inflating the dead count with leaf nodes
  5. Run codegraph cycles to check for circular dependencies
  6. Run codegraph map to see the module overview
  7. Run codegraph complexity -T --limit 25 to find the most complex functions
  8. Count files, LOC, and test-to-source ratio

Phase 3 — Layer-by-Layer Critique

For each architectural layer, evaluate against these dimensions:

A. Abstraction Quality

  • Is the abstraction boundary clean or leaky?
  • Are there god objects / god files (>500 LOC)?
  • Is there needless indirection (wrappers that add no value)?

B. Coupling & Cohesion

  • Fan-in / fan-out analysis per module
  • Are features truly independent or secretly coupled?
  • Is shared state minimized?

C. State-of-the-Art Comparison

  • How does this layer compare to the equivalent in Sourcegraph, CodeScene, Joern, Semgrep, narsil-mcp, CKB?
  • What would a $500M code intelligence company do differently?
  • What academic research (ICSE, FSE, ASE) contradicts the design choices?

D. Scalability & Performance

  • Will this hold up at 1M LOC? 10M LOC? Monorepo scale?
  • What are the algorithmic bottlenecks?
  • Is the database schema suitable for scale?

E. Correctness & Soundness

  • Is the analysis sound or best-effort? (Be explicit)
  • What false positives / negatives does the approach inherently produce?
  • Where does the tool present incomplete data as complete?

F. ADR Compliance

  • Does the implementation match the decisions documented in docs/architecture/decisions/?
  • Are the trade-offs described in ADRs still accurate given the current code?
  • Has the codebase drifted from any stated trajectory? If so, is that drift justified or accidental?
  • Are there architectural decisions that should have an ADR but don't?

Phase 4 — Cross-Cutting Concerns

Evaluate these across the entire codebase:

  1. Type Safety — JS without TypeScript in 2026. Cost-benefit.
  2. Error Handling — Is it consistent? Are errors recoverable? Domain errors vs crashes.
  3. Testing Strategy — Are the right things tested? Integration-heavy vs unit-heavy tradeoffs.
  4. Dual Engine Maintenance — JS + Rust doing the same thing. Is this sustainable?
  5. Dependency Hygiene — Are deps minimal? Are there vendoring risks?
  6. Security Surface — execFileSync, MCP server exposure, SQLite injection vectors.
  7. API Design — Is the programmatic API well-designed for embedding?
  8. Documentation — Is it accurate? Does it lie by omission?

Phase 5 — Competitive Verification

Do not trust README claims. For each top competitor:

  1. Fetch the actual GitHub repo README
  2. Cross-check feature claims against source code where possible
  3. Note: MCP-only vs CLI? Open source vs commercial? External deps required? Deterministic vs LLM-mediated?

Include a verified competitor comparison table with columns: MCP tools, CLI, Open source, Zero-dep, Deterministic, Incremental (all langs).

Phase 6 — Strategic Verdict

  1. Does codegraph have a reason to exist? — Answer with verified data, not assumptions
  2. Fundamental Design Flaws — Decisions that cannot be fixed incrementally
  3. Missed Opportunities — What the tool should have been but isn't
  4. Competitive Moat Assessment — What actually differentiates this? Is it defensible?
  5. Kill List — Features/code that should be deleted, not improved
  6. Build vs Buy — Components that should use existing libraries instead of custom code
  7. Roadmap Critique — Is the planned roadmap the right path? What's missing? What's wrong?

Phase 7 — Write & Save

  1. Write the full audit to generated/architecture/ARCHITECTURE_AUDIT_v{VERSION}_{DATE}.md
  2. If a previous audit exists, add a "Changes Since Last Audit" section at the end comparing key metrics (graph quality score, complexity stats, dead code counts, competitive position)

Phase 8 — Commit & PR

  1. Create a new branch: git checkout -b docs/architect-audit-v{VERSION}-{DATE} main
  2. Stage the audit file: git add generated/architecture/ARCHITECTURE_AUDIT_v{VERSION}_{DATE}.md
  3. Commit: git commit -m "docs: add architectural audit v{VERSION} ({DATE})"
  4. Push: git push -u origin docs/architect-audit-v{VERSION}-{DATE}
  5. Open a PR:
    gh pr create --title "docs: architectural audit v{VERSION} ({DATE})" --body "$(cat <<'EOF'
    ## Summary
    - Full architectural audit of codegraph v{VERSION}
    - Competitive verification against Sourcegraph, CodeScene, Joern, Semgrep, etc.
    - Strategic verdict with prioritized recommendations
    
    ## Test plan
    - [ ] Verify audit file renders correctly in GitHub markdown
    - [ ] Confirm all codegraph command outputs are current
    - [ ] Cross-check competitor claims against linked sources
    EOF
    )"

Audit Structure

The deliverable must contain:

  • "Does Codegraph Have a Reason to Exist?" section (verified competitor data)
  • Executive summary (1 paragraph, brutally honest)
  • Scorecard (each dimension rated 1-10 with justification)
  • ADR compliance review — for each ADR in docs/architecture/decisions/, assess whether the codebase follows the decision, whether the stated trade-offs are still valid, and whether any drift has occurred. Flag missing ADRs for decisions that exist in code but aren't documented
  • Detailed findings per layer
  • Verified competitor comparison table
  • Strategic recommendations (prioritized)
  • Comparison matrix vs state-of-the-art
  • Final verdict: would you invest in this project? Why or why not?

Rules

  • No softening. If something is bad, say it's bad and say why.
  • Cite specifics. File names, line counts, function names — not vague handwaving.
  • Compare to real tools. Not hypotheticals — actual production systems.
  • Verify competitor claims. Fetch READMEs, check source. Do not trust competitive analysis at face value.
  • Quantify everything. LOC, fan-in, complexity scores, not "high" or "low".
  • Break down "dead" stats. Separate leaf nodes (parameters, properties, constants) from genuinely unreferenced callables. Further categorize callable dead code by cause (Rust FFI, framework entry, dynamic dispatch, genuine dead).
  • Assume the audience is a principal engineer who has seen 100+ codebases.

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.