Prompt-Sync

π οΈ Package-manager-style CLI for trusted AI prompts & rules
Think "npm for AI prompts" β install, version-lock and audit prompt packs locally without public registries.
β¨ Why Prompt-Sync?
Modern developer agents (Cursor, Claude, Copilot, β¦) rely on markdown prompts and rule files sprinkled across repos and laptops. Copy-pasting them leads to drift, duplication, and security blind-spots. Prompt-Sync applies proven package-management principles so teams can:
- π¦ Install prompt packs from ordinary Git repositories
- π Version-lock & reproduce installs in CI via a lock-file
- π΅οΈ Audit every prompt change in pull-requests
- π€ Render the same logical prompt for multiple agents automatically
- π Stay offline-friendly β zero outbound traffic by default
β‘ Status: MVP (v0.1) - Core functionality implemented and tested. See docs/tasks/prompt-sync-mvp-prd.md for the full Product Requirements Document.
π Table of Contents
π Quick Start
# 1. Install the CLI
go install github.com/kovyrin/prompt-sync/cmd/prompt-sync@latest
# 2. Initialize a new project
prompt-sync init # generates Promptsfile & .gitignore block
# 3. Add a prompt pack (replace with your trusted source)
prompt-sync add github.com/your-org/ai-prompts
# 4. Install and render prompts for Cursor & Claude
prompt-sync install # deterministic, uses Promptsfile.lock
Running in CI? Use the non-interactive wrapper:
prompt-sync ci-install # alias for `install --yes --strict`
Tip: All commands honour CI=true and exit non-zero when user input would be required.
π Core Concepts
- Prompt Pack β Git-versioned directory of markdown prompts plus YAML metadata
- Adapter β Plug-in that renders a pack into agent-specific files (e.g., Cursor rules, Claude slash-commands)
- Scope / Trust Level β
org β project β personal; higher scopes shadow lower ones
- Promptsfile β Declarative manifest committed to the repo (similar to
package.json)
- Promptsfile.lock β Auto-generated file pinning commit SHAs and file hashes (similar to
package-lock.json)
π οΈ CLI Overview (v0.1)
prompt-sync init β Scaffold Promptsfile, local config, and managed .gitignore entries
prompt-sync install [--agents=cursor,claude] [--strict] β Resolve packs, render via adapters, and update the lock file
prompt-sync add <source/pack[@ref]> β Add a new pack to the manifest and lock file
prompt-sync update [<pack>] β Pull latest commits on tracked branches
prompt-sync remove <pack> β Remove a pack and clean rendered files
prompt-sync list [--outdated] [--files] β Show installed packs and versions
prompt-sync verify β Re-render in CI and fail on drift
Run any command with --help for detailed flags.
ποΈ Configuration Files
project-root/
βββ Promptsfile # committed β trusted sources & selected packs
βββ Promptsfile.lock # committed β resolved SHAs & hashes
βββ Promptsfile.local # git-ignored β per-developer overrides
βββ ~/.prompt-sync/config.yaml # user-level defaults
Example minimal Promptsfile:
version: 1
sources:
- name: my-org
repo: git@github.com:my-org/ai-prompts.git
rulesets:
- my-org/coding-standards
- my-org/git-workflow@v1.0
π‘οΈ Security Model
- Trusted Sources Only β Repos must be allow-listed in a
sources: block; unknown remotes cause an error (or prompt with --allow-unknown).
- Zero Credential Storage β Prompt-Sync defers to your existing Git SSH keys / tokens.
- Security Levels β Each prompt can declare
security: low|medium|high; CI can block risky prompts in --strict mode.
- Deterministic Builds β The lock file pins both commit SHAs and file hashes; drift detection fails CI.
ποΈ Roadmap
The MVP (v0.1) delivers the core package-management flow, Cursor & Claude adapters, and CI verification. Planned next milestones include:
- Copilot & Codeium adapters
- Offline / air-gapped registry mirroring
- Advanced conflict-resolution UI
Track progress in the project roadmap.
π€ Contributing
Pull-requests and issues are welcome! Please:
- Open an issue to discuss major changes before implementing.
- Ensure
make test and make lint pass locally.
- Follow the existing code style and patterns.
- Add tests for new functionality.
Development Setup
# Clone the repository
git clone https://github.com/kovyrin/prompt-sync.git
cd prompt-sync
# Run tests
make test
# Run linter
make lint
# Build binary
make build
# Test locally
./bin/prompt-sync --help
β οΈ Disclaimer
This project was developed with the assistance of AI agents. While we strive for quality and reliability, this comes with inherent risks including potential bugs, security vulnerabilities, or unexpected behavior. Use at your own discretion and thoroughly test in your environment before production use.
We recommend:
- Review the code before using in production
- Test thoroughly with your specific use cases
- Keep backups of important prompt files
- Stay updated with releases and security advisories
π License
Distributed under the MIT License. See LICENSE for details.
Maintainer
Oleksiy Kovyrin β oleksiy@kovyrin.net