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

gsd-hooks

v0.1.0

Published

Rate-limit resilience, economy mode, and feature workflow for GSD users

Downloads

170

Readme

gsd-hooks

Rate-limit resilience, economy mode, and a lightweight feature workflow for GSD users.

Core value: GSD keeps running without human intervention when it hits rate limits — self-recovering, not crashing.

Prerequisites

  • Node.js ≥ 18
  • gsd-core installed in your project (.planning/ directory)
  • Per-runtime config present where you want hooks wired:
    • Claude Code: ~/.claude/settings.json
    • Gemini CLI: ~/.gemini/settings.json
    • Codex: ~/.codex/ directory

The installer skips runtimes whose config is missing and prints a WARNING — it does not fail the whole install.

Quick install

npx gsd-hooks

Pin a version: npx [email protected]

From a local clone (before or without npm publish): npx . in the repo root.

Re-running the installer is idempotent — already-wired hooks show ALREADY PRESENT in the summary.

Runtime-specific install

| Runtime | Config file | Hooks wired | Restore snapshot | |---------|-------------|-------------|------------------| | Claude Code | ~/.claude/settings.json | Stopgsd-phase-pacer.js; SubagentStopgsd-429-guard.js | ~/.claude/settings-hooks-restore.json | | Gemini CLI | ~/.gemini/settings.json | BeforeAgentgsd-gemini-before.js; AfterAgentgsd-gemini-after.js | ~/.gemini/settings-hooks-restore.json | | Codex | ~/.codex/hooks.json | SubagentStopgsd-codex-429-guard.js (600s timeout) | ~/.codex/hooks-restore.json |

Claude Code only: the installer copies /gsd-feature to ~/.claude/plugins/gsd-feature/ (SKILL.md plus lib/feature-history.js and lib/feature-ship.js). Re-runs refresh these files.

Uninstall / restore

Each runtime writes a restore snapshot before the first hook mutation. To revert, restore the saved hooks block from the snapshot file into the matching settings file.

Economy mode uses a separate per-project restore: .planning/economy-restore.json (not touched by the global installer).

How it works

Economy mode

npx gsd-economy --on
npx gsd-economy --off

Patches .planning/config.json using presets/economy.json (budget model, max_concurrent_agents: 1, disables optional pipeline steps). Creates .planning/economy.lock and saves originals to .planning/economy-restore.json. gsd-core hot-reloads config when the file changes.

429 recovery

On rate-limit signals in the session transcript, hooks:

  1. Activate economy mode automatically
  2. Apply session-scoped cooldown: 60s120s240s (capped)
  3. Log events to .planning/rate-limit-log.json
  4. Track strike count in .planning/rate-limit-backoff.json (resets when session_id / transcript session changes)

| Runtime | Hook event | Script | |---------|------------|--------| | Claude Code | SubagentStop | gsd-429-guard.js | | Gemini CLI | AfterAgent | gsd-gemini-after.js | | Codex | SubagentStop | gsd-codex-429-guard.js |

Gemini BeforeAgent (gsd-gemini-before.js) re-ensures economy mode when .planning/economy.lock exists.

Phase pacing (Claude Code only)

The Stop hook (gsd-phase-pacer.js) adds a delay between GSD phase triggers to reduce burst pressure.

  • Default: 15s via GSD_PHASE_DELAY_SECS environment variable
  • Per-project override: hooks.phase_delay_secs in .planning/config.json (when the key is present, it overrides the env var entirely; 0 disables pacing)
  • Skipped when .planning/economy.lock exists (429 cooldown supersedes pacing)

Configuration reference

| Setting | Location | Description | |---------|----------|-------------| | hooks.phase_delay_secs | .planning/config.json | Integer seconds between phases; overrides env when key present | | GSD_PHASE_DELAY_SECS | Environment | Global default delay (15 when unset/invalid) | | gsd-economy --on / --off | CLI | Manual economy toggle | | GSD_BACKOFF_TEST_MS | Environment | Test-only cooldown override (developers) |

Project artifacts

| File | Purpose | |------|---------| | .planning/economy.lock | Economy mode active signal | | .planning/economy-restore.json | Original config values before economy patch | | .planning/rate-limit-backoff.json | Session strike count for exponential backoff | | .planning/rate-limit-log.json | Timestamped 429 event log |

/gsd-feature

Lightweight discuss → plan → execute+verify workflow without ROADMAP.md.

/gsd-feature "add dark mode toggle"
/gsd-feature "fix login redirect" --economy
/gsd-feature "add export CSV" --ship
  • Artifacts: .planning/features/<slug>/ (CONTEXT.md, PLAN.md, SUMMARY.md)
  • History log: .planning/features/HISTORY.md (date, slug, status, description, PR link)
  • --economy is informational; .planning/economy.lock is the authoritative economy signal
  • --ship creates a GitHub PR only after execute+verify passes; skipped with an explicit reason on failure
  • Skill installs to Claude Code only (~/.claude/plugins/gsd-feature/ including lib/); use Claude sessions for /gsd-feature while Gemini/Codex hooks handle rate-limit resilience

Development

npm test

Runs all hook, installer, feature workflow, and README content tests with Node's built-in test runner.

License

MIT