AI prompt middleware — upgrades vague developer prompts into production-quality instructions before sending to coding agents.
Instead of sending build login page directly to Claude/Codex/OpenCode:
- Scans your project (stack, frameworks, folder structure)
- Analyzes your intent
- Finds relevant existing files for context
- Rewrites the prompt with structure, best practices, and project awareness
- Sends the enhanced prompt to the AI
Same effort. Dramatically better output.
- Node.js 20+
- At least one AI coding tool: Claude Code, OpenCode, or Codex CLI
npx @0xdevabir/enhance@latest "build a login page"Runs directly without installing anything globally. Great for trying it out or if you hit permission errors.
npm install -g @0xdevabir/enhancePermission error (EACCES)? Fix npm's global prefix first, then retry:
mkdir -p ~/.npm-global npm config set prefix '~/.npm-global' echo 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.zshrc source ~/.zshrc npm install -g @0xdevabir/enhance
enhance setupDetects which AI coding tools you have installed and automatically adds the /enhance slash command to each one.
Enhance — Setup
Detected: Claude Code, OpenCode
Not found: Codex CLI
✓ Claude Code → ~/.claude/commands/enhance.md
✓ OpenCode → ~/.opencode/commands/enhance.md
Ready. In any project, type:
/enhance build a login page
/enhance fix the auth bug
/enhance refactor the user service
Options:
enhance setup --force # overwrite existing installations
enhance setup --all # install for all tools even if not detectedOpen Claude Code, OpenCode, or Codex CLI in any project and type:
/enhance build a login page with email and password
/enhance build a login page with email and password
/enhance fix the auth bug
/enhance create a payment form with Stripe
/enhance refactor the user service to use dependency injection
/enhance add dark mode support
Requires API key:
export ANTHROPIC_API_KEY=sk-ant-...# Basic — scans project, enhances prompt, calls Claude
enhance "build a login page"
# Dry run — see the enhanced prompt without calling AI
enhance "fix the auth bug" --dry-run
# Show enhanced prompt AND call AI
enhance "create dashboard component" --print-prompt
# See detected stack and intent
enhance "refactor user service" --verbose
# Use a different provider
enhance "add payment form" --provider codexCreate .enhancerc.json in your project root to customize behavior per-project:
{
"provider": "claude",
"model": "claude-sonnet-4-6",
"maxContextTokens": 3000,
"customInstructions": "Always use React Query. Prefer named exports."
}| Key | Default | Description |
|---|---|---|
provider |
claude |
AI provider: claude, codex, opencode |
model |
claude-sonnet-4-6 |
Model ID |
maxContextTokens |
3000 |
Max characters of project files to include |
customInstructions |
— | Extra instructions always injected into every prompt |
Requires ANTHROPIC_API_KEY. Get one at console.anthropic.com.
export ANTHROPIC_API_KEY=sk-ant-...
enhance "build login page"npm install -g @openai/codex
enhance "build login page" --provider codexnpm install -g opencode
enhance "build login page" --provider opencode| Category | Detected |
|---|---|
| Frameworks | Next.js, React, Vue, Svelte, Nuxt, Remix, Astro, Express, Fastify, Hono, NestJS |
| Styling | TailwindCSS, shadcn/ui, Material UI, Chakra UI, Ant Design |
| ORMs | Prisma, Drizzle, TypeORM, Mongoose |
| Testing | Vitest, Jest, Playwright, Cypress |
| Language | TypeScript vs JavaScript |
| Router | Next.js App Router vs Pages Router |
| Package manager | npm, yarn, pnpm, bun |
Input:
enhance "build login page"
Enhanced prompt sent to AI:
You are working inside a Next.js TypeScript project.
## Project Stack
- Language: TypeScript
- Frameworks: Next.js, React, TailwindCSS, shadcn/ui
- UI Library: shadcn/ui
- ORM: Prisma
- Next.js Router: App Router
## Task
Create: build login page
## Requirements
- Use TypeScript throughout — no `any`, prefer `unknown` with type guards
- Use Server Components by default — only add "use client" when needed
- Follow App Router conventions: page.tsx, layout.tsx, route.ts
- Use `next/navigation` for navigation
- Use Tailwind classes — no custom CSS unless unavoidable
- Use shadcn/ui components over building from scratch
- Never store plain text passwords — use bcrypt or argon2
- Use httpOnly, secure cookies for session tokens — never localStorage
- Validate and sanitize all auth inputs server-side
- Consider rate limiting on login/signup endpoints
- ...
git clone https://github.com/0xdevabir/agent-enhance.git
cd agent-enhance
npm install
# Run without building
npm run dev -- "build login page" --dry-run
# Run tests
npm test
# Build
npm run buildMIT