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 🙏

© 2025 – Pkg Stats / Ryan Hefner

prompt-helper

v2.1.1

Published

A CLI tool to help you create and manage prompts for AI models.

Readme

Prompt-Helper

Prompt-Helper is a command-line tool for JavaScript and TypeScript projects designed to streamline the process of generating prompts based on your project's files and configuration settings. It automatically scans your project directory, extracts relevant metadata, and generates meaningful prompts to assist in tasks like generating documentation, summaries, or code comments.

⚠️ Limited support for non‑JS/TS files: The tool’s import‑dependency analysis and header management rely on parsing .js/.ts modules. Other file types (e.g., .py, .go, .java) may be scanned but their dependencies will not be resolved, and Depends on: annotations will not appear.

Features

  • File Header Management: Automatically checks and adds file headers. ex: // src/index.ts. This is useful for ensuring AI understands the context of the code.
  • Project Analysis: Collects information from package.json, tsconfig.json, and other common configuration files.
  • Local Dependency Tracking: Analyzes imports and dependencies within your JS/TS project.
  • Directory Structure Visualization: Prints a tree-like structure of your project.
  • Custom Code Snippets: Include specific code files or entire directories via --code flags.
  • Style Injection: Embed a style.md section to enforce code conventions.
  • TODO/FIXME Scanning: Extract inline comments marked for follow-up.
  • Code Complexity Metrics: Adds FTA-based stats like cyclomatic complexity, bugs, and effort.
  • Dependency Graph Output: Include a dependencyGraph section and track unused files.
  • JSON Output: Emit a machine-readable JSON alongside the markdown summary.
  • Customizable Logs: Outputs logs to both console and file.

Installation

Install globally or locally using your package manager of choice:

# npm
npm install -g prompt-helper
npm install prompt-helper

# yarn
yarn global add prompt-helper
yarn add prompt-helper

# pnpm
pnpm add -g prompt-helper
pnpm add prompt-helper

If installed locally, run with the runner for your package manager:

npx prompt-helper          # npm
yarn prompt-helper         # yarn
pnpm prompt-helper         # pnpm

Commands

| Command | Description | |--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------| | prompt-helper | Scan current directory and generate promptHelper.md. | | -d, --dir <path> | Specify a different base directory to scan (defaults to current directory). | | -o, --out <file> | Specify output filename (defaults to promptHelper.md). | | -s, --style <style.md> | Include a style.md file to inject a ## Style: section. | | -c, --code <file/dir> | Include a specific code file or all files in a directory under a ## Code: section. Can be used multiple times. | | -i, --ignore <pattern> | Glob pattern of files/directories to exclude from --code snippets. Can be used multiple times. For recursive matching, use ** (e.g., **/*.test.ts). | | --todos | Scan codebase for TODO: and FIXME: comments. | | --complexity | Analyze complexity metrics (Halstead, cyclomatic, bugs, time, effort). | | --dependency-graph | Collect and output the full dependency graph and unused file list. | | --json | Also write a promptHelper.json alongside the markdown summary. | | --help | Display help and all available options. |

Example Usage

# Basic scan
prompt-helper

# Scan a different folder and output to custom.md
prompt-helper --dir ./my-app --out custom.md

# Inject style guide
prompt-helper --style ./promptHelper/style.md

# Include code snippets from src, but ignore test files and a specific utility
prompt-helper --code src/entry.ts --code src/utils/ --ignore "**/*.test.ts" --ignore "src/utils/old-util.js"

# Ignore a specific directory recursively
prompt-helper --code . --ignore "**/node_modules/**" --ignore "**/dist/**"

# Include TODO comments and complexity analysis
prompt-helper --todos --complexity

# Include full dependency graph and export as JSON
prompt-helper --dependency-graph --json

Example Output

See example.md for a sample output.


Changes

v1.0.0

  • Initial release with basic JS/TS scanning, header management, and dependency tracking.

v2.0.0

  • Major refactor of the codebase to improve maintainability and readability.
  • Breaking change: <root>/promptHelperNotes.md is now <root>/promptHelper/notes.md.
  • Added --style and --code support; refactored features into separate modules.
  • Recursive directory support for --code; improved error handling for ambiguous paths.
  • 🚀 Added support for:
    • --todos and --complexity metrics
    • --dependency-graph collection and unused file detection
    • --json output for machine-friendly workflows

v2.1.0

  • Feature: Added --ignore <pattern> CLI option to exclude files or glob patterns from the code snippets collected by --code. This allows for more fine-grained control over what code is included in the output.
  • Dependency: Added micromatch for glob pattern matching.

Planned Features

  • Full test suite with coverage reporting.
  • Expanded support for non‑JS/TS files (e.g., Python, Go).
  • ~~Include/exclude globs for fine‑grained control.~~ (Partially addressed with --ignore. Further include patterns could be added.)
  • Plugin system for custom metadata collectors.

Development

  1. Clone the repo:

    git clone https://github.com/yourusername/prompt-helper.git
  2. Install dependencies:

    pnpm install
  3. Build:

    pnpm run build
  4. Run locally:

    pnpm start

Contributing

Contributions are welcome! Please:

  1. Fork the repo.
  2. Create a branch for your feature or bugfix.
  3. Send a pull request.

License

This project is licensed under the MIT License. See LICENSE for details.


Acknowledgments

  • Inspired by common project analysis tools.
  • Built with TypeScript, Node.js, and modern best practices.
  • This was Vibecoded with ChatGPT.