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

@spellguard-ai/claude-code-plugin

v0.0.1

Published

Claude Code plugin for Spellguard agent credential management

Downloads

339

Readme

@spellguard-ai/openclaw-plugin

Spellguard managed-agent control-plane plugin. Runs inside the managed agent's Claude Code environment (provisioned via the managed-provisioning flow) and enforces credential scope, detects git-mutating operations, emits observations

  • policy decisions to the Spellguard backend, and handles the one-shot bootstrap-nonce claim flow on first boot.

Published to npm as @spellguard-ai/openclaw-plugin (REQ-009). Installed automatically by the cloud-init bootstrap script — manual installation is also supported for developer environments.

Entry points

| Export | Description | |--------|-------------| | runSpellguardSetup | /spellguard-setup skill — bootstraps device token via WebSocket handshake, writes config | | runSessionStart | SessionStart hook — validates scoped token, writes git credential helper env file | | runMonitorTick | Monitor hook — polls token status every 30 min, refreshes scope cache, clears env on revocation | | runPreToolUse | PreToolUse runtime entry (CR-011) — status-check probe (block on revoked/401/410) then scope-filtered observation emission | | emitPreToolUseObservation | Observation-only helper — detects git-mutating Bash commands and emits observations (bypasses the status probe; used by tests and legacy callers) | | observeGitOperation | Core pipeline: canonicalize remote → scope check → build event → emit/queue | | detectGitOperation | Stateless helper: maps (toolName, args[])'push' \| 'branch_create' \| 'pr_open' \| null |

SessionStart hook

Runs at the start of every Claude Code session. Checks the scoped token against GET /v1/credentials/status. On valid or near_expiry, writes the SPELLGUARD_GIT_ASKPASS env var so git operations use the credential helper. On revoked or expired, clears the env file and exits with an error message. Fails closed on SSH remotes (no HTTPS credential injection possible).

Monitor polling cadence

runMonitorTick is designed to be called on a 30-minute timer. It:

  1. Calls GET /v1/credentials/status.
  2. If status is revoked or expired, clears the env file.
  3. If the scope cache is stale (>30 min old), fetches fresh scope from GET /v1/credentials/scope and writes it to ~/.config/spellguard/observation-scope.json.

/spellguard-setup flow

  1. Generates a 256-bit random nonce.
  2. Opens a WebSocket to wss://api.spellguard.dev/bootstrap?nonce=<nonce>.
  3. Prints a dashboard URL for the user to complete OAuth.
  4. Awaits a bootstrap frame containing device_token, scoped_token, scoped_token_id, agent_id, and scope_summary.
  5. Writes config to ~/.config/spellguard/config.json (mode 0600).

Cross-plan touch-points

This package is the client-side contract for several backend and e2e tests:

| Test ID | Plan | Plugin entry point | |---------|------|--------------------| | IT-001 | Plan 02 (backend) | runSpellguardSetup — WebSocket bootstrap → write config | | ET-001 | Plan 02 (e2e) | runSpellguardSetuprunSessionStartobserveGitOperation round-trip | | ET-002 | Plan 02 (e2e) | Two isolated XDG_CONFIG_HOME instances, both calling runSessionStart then observeGitOperation | | ET-003 | Plan 02 (e2e) | runSessionStart after server-side scoped-token revocation | | IT-006 | Plan 04 (plugin) | runSessionStart happy path | | IT-007 | Plan 04 (plugin) | runSessionStart SSH refusal | | IT-008 | Plan 04 (plugin) | runMonitorTick revocation | | IT-021 | Plan 04 (plugin) | runMonitorTick scope cache refresh |

GitHub App permissions (CR3-M11)

The required GitHub App permission set lives in src/lib/github-app-permissions.ts as the GITHUB_APP_REQUIRED_PERMISSIONS constant. It mirrors PRD REQ-001:

| Resource | Access | |----------|--------| | contents | write | | pull_requests | write | | issues | write | | metadata | read | | members | read | | administration | read |

This constant is metadata only. The App's effective permissions live at github.com under the App settings page and must be updated manually there to match. Changing the constant does NOT change runtime behavior.

The static-audit tests tests/unit/github-mvp/plugin-app-manifest-permissions.test.ts and tests/integration/github-mvp/neg-audit-source-grep.test.ts (case CR3-M11) lock the constant to the PRD spec to catch future drift.

(Pre-bd7738d2, this lived as .claude-plugin/plugin.json#gitHubApp.permissions, but Claude Code's modern manifest schema doesn't allow extension fields.)

Reference