npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

codebase-dna-guardian

v1.0.0

Published

A Claude Code skill that extracts and enforces a codebase's tribal knowledge — naming conventions, architectural patterns, error handling strategies, and dependency choices.

Downloads

129

Readme

🧬 Codebase DNA Guardian

A Claude Code skill that extracts and enforces a codebase's tribal knowledge.

npm version License: MIT Claude Code

DNA Guardian Overview

Every mature codebase has unwritten rules — naming conventions, error handling patterns, import styles, architectural decisions — that only experienced team members know. New developers (and AI assistants) violate these rules not out of incompetence, but because nobody wrote them down.

DNA Guardian captures those rules as a machine-readable profile and enforces them continuously.


✨ What it does

| Command | Description | |---------|-------------| | /dna-scan | Scan the codebase and extract conventions as a DNA profile | | /dna-check [path] | Audit files against the DNA profile | | /dna-refactor [path] | Auto-fix convention violations | | /dna-report | Generate a project-wide health dashboard | | /dna-preview | Render an interactive HTML visual report | | /dna-onboard | Generate a new-developer briefing from the DNA | | /dna-diff | Show how conventions have evolved since last scan | | /dna-guard [branch] | Pre-merge gate — block HARD violations |


🚀 Installation

Via npm (Claude Code skill registry)

npm install -g codebase-dna-guardian

Manual install

Clone this repo and add to your Claude Code skills directory:

git clone https://github.com/mturac/codebase-dna-guardian
# Then add to your Claude Code skills directory

📖 Quick Start

# 1. Scan your project
/dna-scan

# 2. Check a file before merging
/dna-check src/services/payment.ts

# 3. See the health dashboard
/dna-report

# 4. Visual interactive report
/dna-preview

# 5. Guard a PR
/dna-guard feature/payment-refactor

After running /dna-scan, Claude Code will automatically consult the DNA before generating any new code in your project — no extra commands needed.


🏗 How it works

1. Scan (15–20 files, not the whole codebase)

The scanner is surgical — it samples strategically:

  • Config files (tsconfig, eslint, pyproject.toml, etc.)
  • Entry points (main.ts, app.ts, server.py)
  • One vertical slice of a typical feature (route → service → repository → test)
  • Error handling samples
  • Shared utilities
  • Test files

From these ~20 files it extracts patterns across 8 categories: Naming, Architecture, Error Handling, Testing, Imports, Dependencies, API Contracts, Async Patterns.

2. Severity tiers

Every rule has one of three tiers:

| Tier | Behaviour | |------|-----------| | 🔴 HARD | Stop before generating violating code. Explain. Ask to confirm. | | 🟡 SOFT | Generate compliant code + add a brief footnote. | | 🟢 PREF | Silently apply. No mention. |

3. Passive Guardian Mode

Once a .claude/dna.md exists, Claude Code reads it before every code generation — you don't have to invoke the skill explicitly. The DNA is always active.


📁 DNA Profile Format

The scan writes to .claude/dna.md (single project) or .claude/dna/ (monorepo):

.claude/
  dna/
    root.md          ← shared rules
    frontend.md      ← service-specific overrides
    backend.md       ← service-specific overrides
    cross-service.md ← auto-generated divergence map
  dna-history.md     ← audit trail of all changes

📊 Visual Dashboard

The scripts/ directory contains a React dashboard component that renders an interactive health report:

cd scripts && npm install && npm run dev

Or use /dna-preview inside Claude Code — it will bundle and serve the dashboard automatically.

Features:

  • Animated consistency score ring
  • Per-service consistency bars
  • Rules browser with violation locations
  • Zombie dependency tracker
  • Architectural drift zones
  • DNA evolution sparkline

🧩 Monorepo Support

DNA Guardian handles multi-service projects natively:

Wave 1: Root scan (shared config, CI, shared utils)
Wave 2: Per-service scan (one vertical slice per service)
Wave 3: Cross-comparison (diff patterns across services)
Wave 4: Classification (intentional divergence vs drift)

Services are detected by workspace config (pnpm-workspace.yaml, package.json workspaces, lerna.json, nx.json, turbo.json) or by presence of multiple manifests at depth 2.


🔒 Severity Examples

HARD — stops code generation

🧬 DNA-A2 (HARD): This project uses the Repository pattern — controllers
call services, services call repositories, repositories talk to the DB.
Direct DB access in a controller would break the architectural layering.

I'll create a repository method and wire it through the service layer instead.

SOFT — footnote only

Note: Named as `payment-service.ts` following DNA-N1 (kebab-case file naming).

PREF — silent

Uses dayjs instead of moment because DNA-D2 says so. No mention.


🤝 Contributing

See CONTRIBUTING.md. PRs welcome.


📜 License

MIT © Mehmet Turac