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

skhaall-codeguard

v0.2.2

Published

MCP server — analyse de code TypeScript/Prisma, graphe de dependances, impact analysis pour Claude Code

Readme

CodeGuard

Serveur MCP qui analyse le code TypeScript/Prisma d'un projet, construit un graphe de dependances, et protege contre les modifications dangereuses et les regressions silencieuses.

Ecosysteme : TypeScript, JavaScript, Prisma

Ce que ca fait

Protection en temps reel (hooks automatiques)

  • Guard — avant chaque modification : risques, historique git, fonctions modifiees recemment, couverture tests, hotspot detection
  • Check — apres chaque modification : imports casses, signatures changees, code mort, incoherence de patterns

Analyse du projet

  • Impact analysis — "je modifie ce fichier, qu'est-ce qui casse ?"
  • Health — score de sante global du projet (A-F, scoring adaptatif)
  • Schema check — coherence Prisma ↔ DTOs backend ↔ types frontend
  • Route guard — coherence routes frontend ↔ backend
  • Regression map — quelles pages/routes retester apres un changement
  • Graph — diagramme Mermaid du graphe de dependances
  • Search — "qui utilise cette fonction/type/hook ?"

Detection de problemes

  • Whatsnew — resume des changements depuis le dernier reindex (debut de session)
  • Silent catch — detection des catches silencieux (catch vides, return sans log, setState default)

Prerequis

  • Node.js >= 20
  • Claude Code (pour les hooks MCP)

Installation

npm install -g skhaall-codeguard

Les commandes peuvent etre lancees dans un terminal classique ou dans Claude Code avec le prefixe ! (ex: ! npm install -g skhaall-codeguard).

Ou depuis les sources :

git clone https://github.com/Skhaaall/codeguard.git
cd codeguard && npm install && npm run build

Configuration

1. Serveur MCP (connecte CodeGuard a Claude Code)

Ajouter dans le .mcp.json a la racine du projet :

{
  "mcpServers": {
    "codeguard": {
      "command": "node",
      "args": ["/chemin/vers/codeguard/dist/index.js"]
    }
  }
}

2. Hooks automatiques (guard + check a chaque modification)

codeguard-setup setup

Ca installe deux hooks dans ~/.claude/settings.local.json :

  • guard — se lance automatiquement AVANT chaque Edit/Write dans Claude Code
  • check — se lance automatiquement APRES chaque Edit/Write dans Claude Code

Pour les retirer :

codeguard-setup unsetup

3. Indexer le projet

A la racine du projet :

codeguard-cli init

Ca cree un dossier .codeguard/ avec l'index du projet (ajouter .codeguard/ au .gitignore).

Utilisation

CLI

codeguard-cli init [project-root]              # Indexer le projet
codeguard-cli status [project-root]            # Etat de l'index
codeguard-cli health [project-root]            # Score de sante (A-F)
codeguard-cli impact <fichier> [project-root]  # Analyse d'impact
codeguard-cli regression <fichier> [project-root]  # Pages a retester
codeguard-cli graph [fichier] [project-root]   # Diagramme Mermaid
codeguard-cli schema [project-root]            # Coherence Prisma ↔ TS
codeguard-cli routes [project-root]            # Coherence routes F↔B
codeguard-cli whatsnew [since]                 # Changements recents
codeguard-cli silent_catch [severity]          # Catches silencieux
codeguard-cli changelog [project-root]         # Diff depuis le snapshot

Outils MCP (15)

| Outil | Description | Quand | |---|---|---| | impact | Fichiers impactes si on modifie un fichier | Avant modification | | guard | Risques, historique git, hotspot, couverture tests, go/no-go | Avant modification | | check | Imports casses, signatures changees, code mort, patterns | Apres modification | | health | Score A-F, imports casses, cycles, orphelins | A la demande | | schema_check | Coherence Prisma ↔ DTOs ↔ types frontend | Apres modif schema | | route_guard | Coherence routes frontend ↔ backend | A la demande | | search | Recherche fonctions, types, hooks, routes | A la demande | | dependencies | Graphe d'un fichier (importe / importe par) | A la demande | | reindex | Re-indexer le projet (complet ou incremental) | Debut de session | | status | Date, nombre de fichiers, fraicheur de l'index | A la demande | | regression_map | Pages et routes a retester apres modification | Avant deploy | | graph | Diagramme Mermaid (complet ou focus sur un fichier) | A la demande | | whatsnew | Resume des changements depuis le dernier reindex | Debut de session | | silent_catch | Detection des catches silencieux dans le projet | Audit / review | | changelog | Diff lisible entre ancien et nouvel index | A la demande |

Langages supportes

| Langage | Parser | Profondeur | |---|---|---| | TypeScript/TSX | ts-morph | Complet (types, generics, routes Next.js/NestJS) | | JavaScript/JSX | ts-morph | Imports, exports, fonctions, classes | | Prisma | Parser custom | Modeles, champs, relations, enums |

Path aliases TypeScript (@/src/) et barrel exports (from './dir'dir/index.ts) sont geres automatiquement via la lecture du tsconfig.json.

Stack

  • TypeScript strict
  • ts-morph — parsing profond TypeScript
  • @modelcontextprotocol/sdk — protocole MCP standard (stdio)
  • Index JSON cache dans .codeguard/
  • Zero dependance lourde (pas de Docker, pas de base de donnees)

Securite

  • Path traversal bloque (les chemins doivent rester dans le projet)
  • Validation des inputs MCP a runtime
  • Limites DoS (stdin 1 Mo, index 50 Mo)
  • Liens symboliques ignores
  • CodeGuard lit le code source mais ne le modifie JAMAIS

Licence

MIT