deps-audit-patterns

deps-audit-patterns is a command for Claude Code from thapaliyabikendra/ai-artifacts. It costs 0 tokens per session (3,373 once invoked), scanned A, original, Apache-2.0.

A reference of patterns and code for auditing project dependencies, which are external packages a project relies on. It includes discovery for package files used by JavaScript, Python, Ruby, Java, Go, Rust, and .NET projects.

In plain words
What is it for?
Use it when building or reviewing a dependency-audit command that discovers packages from files such as package.json, requirements.txt, pom.xml, go.mod, or .csproj files.
Why use it?
It provides a common way to find dependencies across projects that use different package managers and file formats.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python scripts/check_license_compliance.py.

Good fit Use it when building or reviewing a dependency-audit command that discovers packages from files such as package.json, requirements.txt, pom.xml, go.mod, or .csproj files.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/thapaliyabikendra/ai-artifacts
agentmods
npx agentmods add commands/thapaliyabikendra/ai-artifacts/deps-audit-patterns

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for deps-audit-patterns

README.md
[![agentmods](https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/deps-audit-patterns/github.svg)](https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/deps-audit-patterns)
Your own site
<a href="https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/deps-audit-patterns"><img src="https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/deps-audit-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for deps-audit-patterns

Your own site · 80×15
<a href="https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/deps-audit-patterns"><img src="https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/deps-audit-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,373 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03373
Opus 5 $0.00000 $0.01687
Sonnet 5 $0.00000 $0.00675
Haiku 4.5 $0.00000 $0.00337

Measured 9d ago against content hash c5b9ef3f7be2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

deps-audit-patterns scanned grade A with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Sends data to an external URLlowData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

response = requests.post( 'https://registry.npmjs.org/-/npm/v1/security/advisories/bulk',

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

response = requests.post(
.claude/commands/references/deps-audit-patterns.md · 497 lines

How it starts

The opening of the file, as written. The whole thing — 497 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Dependency Audit Patterns Reference

Patterns and code for the /refactor:deps-audit command.

Dependency Discovery

from pathlib import Path
import json
import toml

class DependencyDiscovery:
    def __init__(self, project_path):
        self.project_path = Path(project_path)
        self.dependency_files = {
            'npm': ['package.json', 'package-lock.json', 'yarn.lock'],
            'python': ['requirements.txt', 'Pipfile', 'pyproject.toml', 'poetry.lock'],
            'ruby': ['Gemfile', 'Gemfile.lock'],
            'java': ['pom.xml', 'build.gradle'],
            'go': ['go.mod', 'go.sum'],
            'rust': ['Cargo.toml', 'Cargo.lock'],
            'dotnet': ['*.csproj', 'packages.config']
        }

    def discover_all_dependencies(self):
        """Discover all dependencies across different package managers"""
        dependencies = {}

        if (self.project_path / 'package.json').exists():
            dependencies['npm'] = self._parse_npm_dependencies()
        if (self.project_path / 'requirements.txt').exists():
            dependencies['python'] = self._parse_requirements_txt()
        if (self.project_path / 'go.mod').exists():
            dependencies['go'] = self._parse_go_mod()

        return dependencies

    def _parse_npm_dependencies(self):
        """Parse NPM package.json and lock files"""
        with open(self.project_path / 'package.json', 'r') as f:
            package_json = json.load(f)

        deps = {}
        for dep_type in ['dependencies', 'devDependencies', 'peerDependencies']:
            if dep_type in package_json:
                for name, version in package_json[dep_type].items():
                    deps[name] = {
                        'version': version,
                        'type': dep_type,
                        'direct': True
                    }
        return deps

Vulnerability Scanning

import requests

class VulnerabilityScanner:
    def __init__(self):
        self.vulnerability_apis = {
            'npm': 'https://registry.npmjs.org/-/npm/v1/security/advisories/bulk',
            'pypi': 'https://pypi.org/pypi/{package}/json',
            'maven': 'https://ossindex.sonatype.org/api/v3/component-report'
        }

    def scan_vulnerabilities(self, dependencies):
        """Scan dependencies for known vulnerabilities"""
        vulnerabilities = []

        for package_name, package_info in dependencies.items():
            vulns = self._check_package_vulnerabilities(
                package_name,
                package_info['version'],
                package_info.get('ecosystem', 'npm')
            )
            if vulns:
                vulnerabilities.extend(vulns)

        return self._analyze_vulnerabilities(vulnerabilities)

    def _check_npm_vulnerabilities(self, name, version):
        """Check NPM package vulnerabilities"""
        response = requests.post(
            'https://registry.npmjs.org/-/npm/v1/security/advisories/bulk',
            json={name: [version]}
        )

        vulnerabilities = []
        if response.status_code == 200:
            data = response.json()
            if name in data:
                for advisory in data[name]:
                    vulnerabilities.append({
                        'package': name,
                        'version': version,
                        'severity': advisory['severity'],
                        'title': advisory['title'],
                        'cve': advisory.get('cves', []),
                        'patched_versions': advisory['patched_versions']
                    })
        return vulnerabilities

Read the full file on GitHub · 497 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 497 lines · 0 tokens per session scan A c5b9ef3f7be2

Subscribe to this mod's changes

deps-audit-patterns is a command published in the GitHub repository thapaliyabikendra/ai-artifacts (24 stars, last pushed 5mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,373 tokens. A static security scan graded it A with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.