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

@prata.ma/anvil

v6.0.2

Published

Readme

@prata.ma/anvil

User-facing Anvil library and CLI facade for governed workspaces.

Overview

@prata.ma/anvil is the main package boundary for Anvil itself. It owns the anvil.yaml manifest contract, schema-backed validation, governed project and global sync behavior, catalog block resolution, manifest-native skill operations, lock handling, Forge and Smith helper exports, and the anvil / anv CLI surface that exposes those capabilities.

Within the workspace, this package is the top-level Anvil boundary for user-facing governance behavior plus shared Forge and Smith helper exports. Consumers should depend on @prata.ma/anvil for manifest loading, sync orchestration, schema access, the supported CLI, and the supported root helper exports instead of reaching into internal command modules or block-deployment helpers directly.

Release remains Changesets-based. The repo now uses generated package fragments at @state/releases/changelog.md, optional global intent at @state/releases/global.md, one curated repo-level summary at @state/releases/active.md, and one archived copy under @state/releases/history/ after publish.

Installation

Install the package from npm when using Anvil outside this monorepo.

npm

{
  "dependencies": {
    "@prata.ma/anvil": "^0.0.0"
  }
}

Usage

@prata.ma/anvil supports both library-style usage and the packaged CLI surface.

Library

import {
  anvilSync,
  getAnvilSchemaPath,
  loadAnvilManifest,
  validateAnvilManifest,
} from '@prata.ma/anvil'

const loadedManifest = loadAnvilManifest(process.cwd())

if (!loadedManifest) {
  throw new Error('No anvil.yaml found')
}

const validation = validateAnvilManifest(loadedManifest.manifest)
if (!validation.valid) {
  throw new Error(validation.issues.map(issue => issue.message).join('; '))
}

console.log(getAnvilSchemaPath())
await anvilSync(loadedManifest)

CLI

anvil status # Show workspace status
anvil issue list # List HQ Rhythm issues
anvil issue create --title "Add issue subcommands" --kind Feature --workspace Anvil --problem "Manual issue handling" --intent "Add a first CLI slice"
anvil issue update ISS-7 --level Beat --stage Beat/Execute
anvil manifest validate # Validate anvil.yaml
anvil skill find typescript # Search skills.sh without changing workspace state
anvil skill add antfu/skills --skill pnpm # Declare and sync one skill
anvil skill remove pnpm --yes # Remove the declaration and reconcile managed outputs
anvil skill list # Show declarations, ownership, revisions, and deployment status
anvil skill check # Check deployment drift and available upstream updates
anvil skill update antfu:pnpm # Update one standalone skill within its declared constraint
anvil skill create my-skill # Scaffold authored content without deploying it
anvil sync # Run governed project sync
anvil sync --only skill,mcp # Reconcile selected content kinds
anvil sync --global # Run standalone global sync
anvil sync --prune # Remove undeclared tool-target content, then sync
anvil release check # Validate release readiness
anvil release prepare # Apply versioning and scaffold @state/releases/active.md
anvil release publish # Publish packages and finalize the repo release
anvil release status # Show current release status
anvil hub query "status" # Query configured hub context
anv # Launch the interactive shortcut when running in a TTY

Patterns

The package is typically used in one of two ways:

  • as a library facade for manifest parsing, root resolution, recipe loading, and sync orchestration
  • as the anvil CLI for workspace-facing command flows such as catalog, hub, issue, manifest, plugin, release, skill, status, and sync

Internally, package command modules route shared prompt, spinner, and log behavior through src/lib/cli.ts and its ux facade instead of importing @clack/prompts ad hoc at each call site.

API

@prata.ma/anvil exposes a documented library surface and two CLI binaries.

Exports

  • @prata.ma/anvil - root library facade
  • @prata.ma/anvil/changelog - packaged Changesets changelog module for repos with a known <owner>/<repo> slug
  • @prata.ma/anvil/manifest - manifest loading, parsing, validation, and root-resolution helpers
  • @prata.ma/anvil/schema - packaged anvil.yaml JSON schema
  • root exports from src/index.ts, including manifest helpers, recipe helpers, sync helpers, Forge product-discovery helpers, Smith layout helpers, and getAnvilPackageStatus()

Commands

The package ships two binaries:

  • anvil - standard CLI entrypoint
  • anv - shorthand launcher entrypoint

Top-level CLI command areas currently include catalog, hub, issue, manifest, plugin, release, skill, status, and sync.

Issues

anvil issue list
anvil issue list --workspace Anvil --query rhythm
anvil issue create --title "Add issue subcommands" --kind Feature --workspace Anvil --problem "Manual issue handling" --intent "Add a first CLI slice"
anvil issue update ISS-7 --level Beat --stage Beat/Execute
anvil issue update 356c08fe-bfbd-804a-b156-f90b4ddc56fc --kind Feature --problem "Normalize this row"

anvil issue is the first HQ-focused issue operator slice in this package:

  • it reads the live Notion HQ root from hub.document.rootId in anvil.yaml
  • it manages the shared Issues database using Rhythm/HQ field mapping instead of treating Notion as raw freeform CRUD
  • list is the read/search surface for v1, with --query plus explicit lifecycle filters
  • update accepts either a canonical HQ id such as ISS-7 or a Notion page id
  • existing partial intake rows remain visible and can be normalized through update

Workspace

anvil status
anvil sync
anvil sync --global
anvil sync --prune
anvil sync --only skill,mcp
anvil sync --only mcp --global
anvil sync --only skill --dry-run --json
anvil sync --verbose

Bare sync selects all kinds. --only accepts comma-separated singular names: rule, reference, command, skill, agent, plugin, and mcp. It limits staging, deployment, managed cleanup, reporting, and lock changes. Unselected content is retained. Rules and references can regenerate root instructions; commands include command-derived Codex skills. Partial block deployment does not claim a whole-block refresh and reports related block content that remains unaligned.

--dry-run previews selected declared/authored inventory and prune targets without changing workspace files or resolving remote sources. MCP previews also use the normal target preflight checks. It is not a byte-level diff for every generated artifact. --json includes phase timings and counts; --verbose shows them in human-readable runs. Source timing is included in staging. Git clone/fetch counts and copied/unchanged skill-file counts distinguish network work from deployment work.

Sync deploys resolved content; it does not check whether a newer Git-backed skill revision exists:

| Source state | Sync behavior | | -------------------------------------------------- | ------------------------------------------------------------ | | New declaration | Resolve once, deploy, and record the commit. | | Recorded revision and cached objects | Restore that revision without fetching upstream. | | Recorded revision but missing cached objects | Retrieve the exact revision; fail if it cannot be retrieved. | | Legacy lock entry without usable revision evidence | Resolve once and report the migration. |

Local/catalog sources use current local or installed package content. Remote plugin declarations also retain their recorded resolution during sync. Skill updates are explicit; this release does not introduce a public block-update command.

MCP Deployment

Block content/ai.jsonc is merged first; the configured authored AI root's ai.jsonc overrides it.

| Tool | Project target | Global target | | -------- | -------------------- | ----------------------------- | | Claude | .mcp.json | ~/.claude.json | | OpenCode | opencode.jsonc | XDG OpenCode opencode.jsonc | | Cursor | .cursor/mcp.json | ~/.cursor/mcp.json | | Codex | .codex/config.toml | ~/.codex/config.toml |

Sync creates missing targets, preserves unrelated settings and servers, and removes obsolete owned entries, including when the desired server set becomes empty. JSONC comments and text outside Codex's managed block are retained. Ownership hashes live in .anvil/mcp-ownership.json; keep this generated record for safe reconciliation. Anvil preflights all MCP targets before writing them. Conflicting unmanaged or modified managed values stop sync rather than being overwritten. Equivalent legacy entries can be adopted; historical entries without ownership evidence are not broadly deleted.

Claude uses HTTP/stdio configuration, OpenCode uses V2 mcp.servers, and Codex uses scalar command, separate args, and second-based timeout fields. Credentials remain environment references where supported. Codex cannot represent arbitrary environment interpolation in URLs, commands, mixed header strings, or renamed environment variables; unsupported mappings fail before MCP writes. Anvil writes configuration only: tool trust, OAuth sign-in, and connection health remain tool-managed.

Skills

anvil skill find [query] [--owner <owner>] [--json]
anvil skill add <source> [--skill <name[,name]> | --all] [--global] [--json]
anvil skill remove [name...] [--all] [--global] [--yes] [--json]
anvil skill list [--global] [--json]
anvil skill check [name-or-ref] [--global] [--json]
anvil skill update <name-or-ref> [--global] [--json]
anvil skill update --all [--global] [--json]
anvil skill create <name> [--description <text>] [--global] [--json]

The skill commands are a manifest-native convenience layer:

  • find searches skills.sh and never changes local workspace state
  • add resolves selected skills, records deterministic provider-backed declarations in anvil.yaml, validates the manifest, and invokes skill-only sync; existing resolutions are retained
  • remove deletes selected manifest declarations and invokes skill-only sync while preserving unmanaged and authored skills
  • list is local and read-only; it identifies standalone, block-owned, authored, overridden, and unmanaged skills
  • check always examines deployment drift and upstream updates; it does not change manifests, locks, staging, or deployed output, but may update shared source caches
  • update resolves newer allowed revisions for the selected standalone declarations, then deploys skills without advancing unrelated resolutions
  • create writes a scaffold beneath the configured AI root's skills/ directory, refuses existing paths, and does not deploy it
  • project scope is the default; --global targets the standalone manifest under ~/.config/anvil/
  • Git-backed declarations store exact repository-relative skill paths, while catalog-backed declarations keep their existing boolean install form

Use anvil skill update <ref> or --all to advance standalone skills. Branch declarations follow the branch when explicitly updated; tags and full commit SHA declarations remain pinned. A commit recorded in the lock is a resolution, not a user pin. Block-owned skills report their owning block and cannot be independently updated. --all reports block-owned exclusions instead of silently updating a whole block. check returns exit status 1 for drift, available updates, incomplete block alignment, or unknown results; failed upstream checks never claim that a skill is current.

Add saves the declaration before deployment. If sync fails, the manifest remains saved; fix the cause and rerun sync. Failed updates retain the previous resolved lock, but generated staging or output may already have changed: cross-file rollback is not promised. Sync can restore the prior locked Git content. Unmanaged same-name skill directories cause a conflict rather than being replaced.

Git-backed sync uses repository leases through refresh, sparse checkout, and copying. skill add releases its discovery lease before nested sync. Incomplete new clones never become live caches; verified invalid owned caches are quarantined and rebuilt once. Busy Git caches, invalid legacy caches, and unknown or abandoned lease locks stop with their exact recovery path. Verify that the owning Anvil process and all associated Git processes have stopped before moving only that cache or lock aside. Do not delete the whole Anvil cache or change a valid branch declaration to work around a cache error.

Skill deployment excludes .git and node_modules, including for repository-root skills. Relative asset symlinks and executable file modes are preserved and participate in unchanged-content checks. SKILL.md must be a regular file with YAML frontmatter; Git-backed staging/checks do not execute alternate frontmatter engines.

Release

anvil release check
anvil release prepare
anvil release publish
anvil release status

The normal release workflow is Changesets-based:

  • pnpm changeset authors the intended package version changes
  • when a repo uses the packaged custom changelog surface, configure .changeset/config.json with @prata.ma/anvil/changelog plus a known GitHub repo slug
  • anvil release check validates release readiness through Turbo-backed package and block-package tasks
  • anvil release prepare applies version bumps, updates package changelogs, generates @state/releases/changelog.md, and scaffolds @state/releases/active.md
  • review @state/releases/global.md, @state/releases/changelog.md, and compose @state/releases/active.md, especially ## Highlights and ## Changelog
  • commit the prepared release changes
  • anvil release publish publishes public packages, creates the coordinated GitHub Release from @state/releases/active.md, archives it to @state/releases/history/, and deletes active.md, global.md, and changelog.md

Repo-only releases are also supported by default:

  • if anvil release prepare finds no package version changes, it still writes @state/releases/changelog.md and scaffolds @state/releases/active.md as a repo-only release summary
  • anvil release publish skips package publishing for that case and still finalizes the coordinated repo tag and GitHub Release

Manifest

anvil manifest validate

Plugins

anvil plugin add <source>
anvil plugin list
anvil plugin remove <name>

Catalog And Hub

anvil catalog review
anvil catalog block check .
anvil catalog block sync .
anvil catalog block apply .
anvil hub pull
anvil hub query <text>
anvil hub status
anvil hub sync --product
anvil hub sync --state
anvil hub sync --system

Configuration

  • anvil.yaml is the primary workspace manifest consumed by the package.
  • @prata.ma/anvil/schema and getAnvilSchemaPath() expose the schema contract for that manifest.
  • anvil issue currently relies on hub.document.provider: notion plus the live HQ hub.document.rootId to discover the shared Issues, Workspaces, Products, and optional Instances tables.
  • anvilSync() materializes governed content into .anvil/ and generated compatibility outputs.
  • anvil skill add/remove changes only catalogs and skills in the selected manifest, preserving unrelated comments and structure before invoking skill-only sync.
  • anvil skill find uses the skills.sh directory as read-only discovery and does not treat marketplace or filesystem state as workspace authority.
  • Active and finalized repo release summaries live under @state/releases/.
  • Catalog agents are now authored as one markdown file at content/agents/<name>.md, staged into .anvil/agents, and rendered into tool-specific agent targets for OpenCode, Claude, Cursor, and Codex.
  • The CLI anvil sync command owns the final enriched project lock snapshot after external manifest-backed skills and plugins are resolved.
  • Project sync deploys the State session bundle from .anvil/plugins/ to .opencode/plugins/ and records its ownership hash in .opencode/plugins/.anvil-managed.json. If the global OpenCode plugins/session.js is byte-identical, project sync reports the global provider and removes only its unchanged managed project copy to avoid duplicate plugin IDs. A different global bundle, a modified managed project plugin, or an unmanaged project conflict stops deployment. Sync preserves unrelated plugins. The local catalog requires a prior State block build; the published catalog carries its bundled session.js.
  • Run project sync after adding or removing the global State plugin. Project sync restores the local copy when the global copy is absent; global sync does not scan or change other repos.
  • OpenCode MCP sync writes declared servers under V2 mcp.servers in project or global opencode.jsonc; it preserves unrelated JSONC comments and settings. V2 loads both AGENTS.md and configured instructions. In compiled-rule mode, avoid an extra glob for rules already included in AGENTS.md.
  • OpenCode commands accept opencode.subagent and the legacy opencode.subtask input. Sync emits native subagent; conflicting alias values are rejected instead of silently changing delegation.
  • anvil sync --global routes the same sync command through the standalone global Anvil root under ~/.config/anvil/.
  • Global sync merges managed .anvil/ skills and commands with repo-authored .ai/ skills and commands, with authored content taking precedence when names or command ids overlap.
  • anvil sync --prune removes undeclared content from selected tool-target kinds after one grouped confirmation prompt, and aborts if that prompt is declined or cancelled. Codex command-derived skill cleanup belongs to command selection, not ordinary skill selection. Dry-run never prunes.
  • Project and global anvil-lock.yaml files are managed sync snapshots for provenance and ownership diagnostics, while deployed metadata.anvil markers remain the authoritative cleanup signal.
  • Project and global sync now print the same Deployed, Skipped, and Undeclared summary surface, with conservative cleanup still preserving unmanaged deployed items.
  • Lock snapshots now include deterministic instruction-budget metrics: top-level summary plus per-entry lines, chars, and tokens for managed agents, rules, commands, references, skills, and block rollups.
  • Root-generated lock entries use synthetic managed refs such as anvil:root-agents and anvil:root-agents-override instead of filename-shaped keys.

Development

Use the package-local scripts while working in @packages/anvil, and keep user-facing behavior routed through the documented facade and command layers instead of scattering it across unrelated packages.

This package participates in the repo's Changesets, npm publish, and GitHub Release automation through canonical Turbo tasks. anvil release check orchestrates package build, lint, test, and test:type tasks plus block package lint and test tasks so repeated release checks can reuse Turbo cache.

Commands

pnpm --filter @prata.ma/anvil build
pnpm --filter @prata.ma/anvil lint
pnpm --filter @prata.ma/anvil test
pnpm --filter @prata.ma/anvil test:type
pnpm anvil release check

Testing

Vitest covers manifest parsing, selected-kind preservation, MCP ownership and project/global output, read-only skill inspection, scaffolding, exact-revision restoration, grouped updates, pinned sources, shared-cache isolation across workspaces, failure recovery, and the existing facade command surfaces. Git lifecycle proofs use temporary local upstreams, not public services.

Conventions

  • Keep the CLI layer thin: command modules should delegate real behavior into importable library code.
  • Keep shared command UX behavior centralized in src/lib/cli.ts through the internal ux facade.
  • Preserve @prata.ma/anvil as the supported root package for workspace governance plus public Forge and Smith helper exports.
  • Keep manifest and sync behavior deterministic because generated governance outputs depend on it.
  • Treat internal command modules and src/lib/* helpers as implementation details unless they are explicitly exported.
  • Keep lock snapshots and deployed markers aligned, but do not let lock state reclaim primary cleanup authority from metadata.anvil.
  • Keep lock summaries aggregated from leaf instruction-bearing entries so block rollups do not double count the same content.
  • Keep anvilSync() focused on managed deployment work; let the CLI sync command own the final project lock snapshot when external declarations are involved.

Status

This package is active and central to the current workspace model.

Maturity

@prata.ma/anvil is active for workspace dogfooding and public-package preparation.

Scope

The package supports manifest loading and validation, schema access, selective project/global sync, the skill lifecycle commands, block deployment, catalog tooling, plugin management, live HQ issue management, Forge and Smith helpers, and the main Anvil CLI facade.

Notes

  • This package is published as @prata.ma/anvil, and release validation now runs through Turbo-backed canonical tasks consumed by anvil release check.
  • The supported library surface is limited to the documented exports; deep imports into src/commands/* or src/lib/* should not be treated as stable public API.
  • scripts/postbuild.mjs is part of the package contract because it copies .mjs outputs to .js and stages catalog assets into build output after tsdown completes.