Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (promptpilot-ai) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
๐ง promptpilot-ai
The AI context layer for your codebase
Works with Claude Code ยท Cursor ยท Both
Scan your project once โ AI understands everything โ no more blind file hunting
๐ค The Problem
Every time you ask Claude or Cursor to build something, it starts from zero:
AI: Let me look at your project structure...
AI: Reading package.json...
AI: Reading src/app/...
AI: Reading components/...
AI: Hmm, where is the auth module?That's 8โ12 file reads (~25,000 tokens) just to understand context โ before writing a single line of code.
โ The Solution
Run promptpilot-ai init once. It scans your codebase and writes structured context files that AI tools read automatically.
AI: (reads .claude/context/architecture.md โ knows everything)
AI: Got it. Here's the implementation plan...2โ3 reads. ~6,000 tokens. Straight to the code.
๐ Quick Start
# In your project directory
npx promptpilot-ai@latest initYou'll be asked which AI tool you're using:
? Which AI tool are you using?
โฏ Claude Code
Cursor
BothThat's it. Open your project in Claude or Cursor โ context is loaded automatically.
๐๏ธ What Gets Generated
For Claude Code
your-project/
โโโ CLAUDE.md โ context index (auto-loaded by Claude)
โโโ .claude/
โ โโโ settings.json โ permissions pre-configured
โ โโโ commands/
โ โ โโโ ask.md โ /ask slash command
โ โ โโโ plan.md โ /plan slash command
โ โ โโโ sync.md โ /sync slash command
โ โโโ context/
โ โโโ architecture.md โ project structure
โ โโโ stack.md โ tech stack & commands
โ โโโ patterns.md โ naming & code conventions
โ โโโ modules/
โ โโโ auth.md
โ โโโ components.md
โ โโโ ...
โโโ .git/hooks/post-commit โ auto-sync on commitFor Cursor
your-project/
โโโ .cursor/
โโโ rules/
โโโ architecture.mdc โ always loaded (alwaysApply: true)
โโโ stack.mdc โ always loaded
โโโ patterns.mdc โ always loaded
โโโ modules/
โโโ auth.mdc โ loaded when you open auth files
โโโ components.mdc โ loaded when you open component files
โโโ ...๐ก Cursor's
.mdcrules usealwaysApply: truefor global context and file-glob matching for module-level context โ so you only pay for what's relevant.
๐๏ธ Multi-Repo Workspace (Frontend + Backend)
your-workspace/ โ run init here
backend/ โ NestJS / Express
frontend/ โ Next.js / Reactcd your-workspace
npx promptpilot-ai@latest initpromptpilot-ai auto-detects both repos and generates a bridge map:
## Endpoint Map
| Method | Path | Frontend File | Backend File | Handler |
|--------|-------------|-----------------------------|---------------------------------|-----------|
| GET | /users | src/app/users/page.tsx | src/users/users.controller.ts | findAll() |
| POST | /auth/login | src/app/auth/login/page.tsx | src/auth/auth.controller.ts | login() |Now when you say /ask add a user profile page, AI reads bridge.md, finds the matching endpoint, and implements both frontend and backend in one pass.
๐ Token Savings
| Without promptpilot-ai | With promptpilot-ai | |
|---|---|---|
| File reads per task | 8โ12 | 2โ3 |
| Tokens per task | ~25,000 | ~6,000 |
| Savings | โ | ~70% fewer tokens |
| Multi-repo cross-lookup | Manual, many reads | Auto via bridge.md |
โก Commands
CLI
| Command | Description |
|---|---|
npx promptpilot-ai init |
First-time setup โ scan project and generate context |
npx promptpilot-ai sync |
Re-scan after major restructuring or new modules |
npx promptpilot-ai sync --templates |
Also refresh .claude/commands/*.md slash command templates (use after a promptpilot-ai upgrade) |
Claude Code Slash Commands (after init)
| Command | Description |
|---|---|
/ask <request> |
Natural language โ plan โ execute (cross-repo aware) |
/plan <request> |
Interactive planning โ detects UI vs backend, shows 2โ3 layout approaches as ASCII mockups for you to pick, then delivers the final plan with reusable-component reuse enforced |
/sync |
Trigger a context sync from inside Claude Code |
๐ ๏ธ Supported Stacks
| Category | Supported |
|---|---|
| Frontend | Next.js (App + Pages Router), React (Vite), Vue, Svelte, Astro, Remix |
| Backend | NestJS, Express, Fastify, Hono, Koa |
| Languages | TypeScript, JavaScript |
| Databases | PostgreSQL, MySQL, MongoDB, SQLite |
| ORMs | Prisma, Drizzle, TypeORM |
| Package Managers | pnpm, npm, yarn |
| Testing | Vitest, Jest |
๐ Keeping Context Fresh
| Trigger | What happens |
|---|---|
git commit |
Post-commit hook auto-updates changed modules |
| New module or endpoint | Run npx promptpilot-ai sync manually |
| Major refactor | Run npx promptpilot-ai sync manually |
๐ Staying Updated
promptpilot-ai checks npm once a day (throttled, opt-out via NO_UPDATE_NOTIFIER=1 or CI=1) and surfaces new versions in three places:
| Where | How you see it |
|---|---|
| Terminal | Rounded banner on stderr after any promptpilot-ai command (only in interactive terminals, not pipes/CI) |
| Claude Code | The existing SessionStart hook prints a one-line notice into Claude's context โ Claude mentions it at the start of your first response |
| Cursor | A temporary .cursor/rules/_promptpilot-update.mdc is auto-generated with alwaysApply: true so Cursor surfaces it the next time you chat |
After upgrading the package (npm i -g promptpilot-ai), run:
npx promptpilot-ai sync --templatesThis refreshes the slash command templates in your project, clears the notice file, and resets the cache. Zero runtime dependencies โ version check uses native fetch only.
โ FAQ
Do I need an API key? No. Uses your existing Claude Code plan or Cursor subscription โ no extra API keys.
Does it work without git?
Yes. Without .git, the filesystem is walked directly (skipping node_modules, dist, .next, etc.).
Can I use it with both Claude and Cursor?
Yes โ select "Both" during init. It generates .claude/ and .cursor/rules/ simultaneously.
Is it safe to commit the generated files? Yes, commit them. Teammates get context immediately without running init themselves.
๐ License
MIT