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

ctx-prompt-cli

v1.12.0

Published

Context-aware CLI tool for prompt generation

Readme

CTX CLI - Context-Aware Prompt Generation Tool

A powerful command-line interface tool for managing context-aware prompts, rules, and change tracking in development projects. CTX CLI helps developers maintain consistent prompt structures with standardized rules and category-specific guidelines.

🚀 Core Functionality

  • Project Initialization: Set up a new project with predefined standard rules and categories.
  • Rule Management: Create and organize rules by categories for consistent prompt generation.
  • Prompt Generation: Generate context-aware prompts that combine standard and category-specific rules.
  • Change Tracking: Log and track changes made during development with prompt association.
  • History Management: View and filter change history by categories.
  • History Clearing: Reset change history while preserving configuration.

📋 Standard Rules

Every project comes with built-in standard rules:

  1. Change Logging: Automatically reminds to log changes after task completion (144 char limit).
  2. Task Comprehension: Ensures task requirements are understood and summarized (512 char limit).
  3. Change Review: Reviews recent changes to avoid repetition and ensure correctness.

🏷️ Default Categories

  • General: Universal tasks and guidelines.
  • UI: User interface and frontend-related tasks.
  • Logic: Backend logic and business rules.
  • Testing: Testing strategies and implementation.

Installation

Global Installation

npm install -g ctx-cli

Local Installation

npm install --save-dev ctx-cli

Usage

Initialize a New Project

ctx init

Creates a ctx.json configuration file with:

  • Standard rules
  • Default categories
  • Empty arrays for custom rules, prompts, and changes

Create New Rules

ctx new rules

Interactive prompts to:

  • Enter rule description
  • Select existing category or create new one
  • Automatically prevents duplicate rules

Generate New Prompts

ctx new prompt

Creates context-aware prompts by:

  • Selecting a category
  • Entering task description
  • Automatically combining standard rules with category-specific rules
  • Generating formatted prompt text

Log Changes

ctx new change

Track development progress by:

  • Selecting associated prompt
  • Describing the change made
  • Automatically timestamping and categorizing

View Change History

# View all recent changes (last 5)
ctx history

# Filter by category
ctx history --UI
ctx history --Logic
ctx history --Testing

Clear Change History

ctx history clear

Removes all change history while preserving:

  • Standard rules
  • Custom rules
  • Categories
  • Prompts

Configuration File Structure

The ctx.json file structure:

{
  "standardRules": [
    {
      "id": "standard-1",
      "description": "After completing the task, use the CLI command `new change` to log a description of what you did, limited to 144 characters."
    }
  ],
  "categories": ["General", "UI", "Logic", "Testing"],
  "rules": [
    {
      "id": "uuid",
      "description": "Custom rule description",
      "category": "UI"
    }
  ],
  "prompts": [
    {
      "id": "uuid",
      "category": "UI",
      "task": "Create responsive navbar",
      "createdAt": "2024-01-01T00:00:00.000Z",
      "rules": ["standard-1", "standard-2", "ui-rule-1"],
      "promptText": "Task: Create responsive navbar\n\nRules:\n- Standard rule 1\n- UI specific rule"
    }
  ],
  "changes": [
    {
      "id": "uuid",
      "promptId": "prompt-uuid",
      "category": "UI",
      "timestamp": "2024-01-01T00:00:00.000Z",
      "description": "Implemented responsive navbar with mobile breakpoints"
    }
  ]
}

Error Handling

The CLI provides clear error messages for common scenarios:

  • Missing ctx.json: Prompts to run ctx init first.
  • No prompts available: Suggests creating a prompt before logging changes.
  • Invalid categories: Lists available categories
  • Duplicate rules: Prevents creation of duplicate rule descriptions.
  • File operation errors: Detailed error messages for debugging.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

support me

If you find this tool helpful, please consider supporting me: