Skip to content
simienPublic

About

A versioned, validated and audited prompt library, with a small router that finds the right prompt by name or keyword.

Topics

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

CtxRtr - Contextual Prompt Router

Personal project - A prompt library kept under the same discipline as code: versioned, validated and audited, with a small router that finds the right prompt by name or keyword.

License: MIT


◆ What is CtxRtr?

CtxRtr started in mid 2025 as a Contextual Prompt Router built on a 2015 MacBook Pro, alongside the scripts that kept that machine healthy enough to build on. The router and its prompt library are what remain in active use. The machine-maintenance scripts are kept, unmaintained, in archive/.

  • Routing by name or keyword - ./ops/run-prompt.sh "diagnose ci" finds diagnose-ci-failure-v1.0.0.md without the exact filename. It matches configured aliases, filenames and the words in them; it does not read plain sentences.
  • Version Management - Semantic versions, with the latest version selected automatically and older ones archived
  • Validation & Auditing - validate-prompts.sh, audit-prompts.sh and analyze-prompts.sh check template compliance, metadata and versions before a prompt ships
  • Prompt Chaining - Run several prompts in sequence with --chain

▶ Quick Start

Requires macOS (the router copies prompts with pbcopy), bash, jq and python3.

git clone https://github.com/simien/CtxRtr.git
cd CtxRtr
./tests/quick-test.sh --non-interactive

Prompt Router

# Route by keyword; the prompt lands on your clipboard
./ops/run-prompt.sh "diagnose ci"
./ops/run-prompt.sh "find bugs"

# Print instead of copying
./ops/run-prompt.sh --dry-run "create todo"

# List every prompt, or search by term
./ops/run-prompt.sh --list
./ops/run-prompt.sh --search docker

# Chain prompts in sequence
./ops/run-prompt.sh --chain diagnose-ci generate-git-commit-message

# Version management, analytics and validation
./scripts/audit-prompts.sh --dry-run
./scripts/analyze-prompts.sh
./scripts/validate-prompts.sh

Release Checks

./scripts/pre-release-sanitizer.sh --dry-run
./scripts/create-release.sh

■ Contextual Prompt Router: PromptOps in Detail

Prompts treated like code: versioned, validated, audited and measured

Prompt Router Features

  • Alias and keyword matching - Configured aliases first, then filenames, then the words of the input
  • Context Injection - Dynamic file inclusion with {{include:path/to/file}}
  • Version Management - Automatic latest-version selection with semantic versioning
  • Quality Control - Validation and analytics
  • Automated Version Management - Outdated-version detection and archiving

Sample Prompt Analytics

Illustrative snapshot: captured 2025-07-28, kept here to show what analyze-prompts.sh reports. Run it yourself for current numbers

■ Prompt Structure Analysis
==========================
Total prompts: 24 (active)
Archived prompts: 1 (properly managed)
Total categories: 5

Prompts by category:
  code-analysis               5 (20%)
  documentation-generation    5 (20%)
  meta-prompts                3 (12%)
  system-optimization         5 (20%)
  workflow-management         6 (25%)

[#] See prompts/README.md for the prompt system documentation

[#] See docs/guides/prompt-system-overview.md for the full architecture


☐ Available Scripts

Contextual Prompt Router (PromptOps)

  • ./ops/run-prompt.sh - Prompt router with chaining support
  • ./scripts/validate-prompts.sh - Template compliance and metadata validation
  • ./scripts/analyze-prompts.sh - Usage pattern and complexity analytics
  • ./scripts/audit-prompts.sh - Outdated-version detection and archiving

Repository Management

  • ./scripts/pre-release-sanitizer.sh - Scans for personal information before a release
  • ./scripts/create-release.sh - Release management
  • ./scripts/enforce-organization-standards.sh - Directory and README standards
  • ./scripts/sync-ide-settings.sh - Copies this project's IDE settings into Cursor or VS Code (changes your editor settings)

[#] See ops/README.md and scripts/README.md for details


■ Documentation


■ Contributing

This is an experimental personal project, and contributions are welcome. See the Contributing Guidelines.

■ Security

If you discover a security vulnerability, please report it privately. See the Security Policy.

■ License

This project is licensed under the MIT License. See the LICENSE file.


■ Contact Information

Maintainer: simien Issues and questions: GitHub Issues Security reports: see SECURITY.md

■ Project Structure

  • prompts/ - Versioned, validated, audited prompt library
  • ops/ - The router: run-prompt.sh, its libraries in lib/ and helpers in utils/
  • config/ - Router configuration and project settings
  • scripts/ - Prompt validation and analytics, release and repository tools
  • tests/ - Repository-only test suite
  • docs/ - Guides and standards
  • security/ - Security policies and audit reports
  • archive/ - Retired 2015 MacBook maintenance tooling, kept as a record
  • examples/ - Usage examples
  • .github/ - GitHub workflows and templates

About

A versioned, validated and audited prompt library, with a small router that finds the right prompt by name or keyword.

Topics

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages