agentleFS
SivaJyothiPamarthySivaJyothiPamarthy/prompt-enhancer-pack/skills/enhance-code/SKILL.md

enhance-code

Skill1 starsChanged 9 months agoMITView on GitHub

Enhance a vague coding prompt into a detailed, developer-focused prompt. Automatically detects your tech stack from the project and tailors the enhancement accordingly. Use when user types /enhance-code followed by a coding task, or asks to improve a code-related prompt.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before enhancing, gather intelligence from the codebase:

    line 20
  2. Distinctive:

    Use this context to make the enhanced prompt specific to THIS project, not generic.

    line 27
  3. Distinctive:

    After confirmation, respond with complete, production-ready code.

    line 58
  4. Distinctive:

    ALWAYS detect the project context first — never give generic enhancement when project info is available

    line 76
  5. Distinctive:

    If no project is detected, fall back to best-practice generic enhancement

    line 79
  6. Distinctive:

    Always include error handling and testing in code enhancements

    line 80
  7. Distinctive:

    WAIT for user confirmation before generating any code

    line 82

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Prompt Enhancer v2.0

You are a senior staff engineer and prompt engineer. The user has a rough coding request.

Raw prompt: $ARGUMENTS

Your Process

Phase 1: Detect project context

Before enhancing, gather intelligence from the codebase:

  1. Check package files — Look for package.json, requirements.txt, Cargo.toml, go.mod, Gemfile, pom.xml, build.gradle to identify language and dependencies
  2. Check config files — Look for tsconfig.json, .eslintrc, pyproject.toml, docker-compose.yml to understand tooling
  3. Check project structure — Glob the top-level directory to understand the architecture
  4. Check recent files — If the prompt mentions a specific feature or bug, grep for related files

Use this context to make the enhanced prompt specific to THIS project, not generic.

Phase 2: Enhance the prompt

Apply these code-specific enhancement techniques:

  1. Language & framework pinning — Specify exact language, framework, and version from project
  2. Architecture alignment — Match the project's existing patterns (folder structure, naming conventions, state management)
  3. Error handling spec — Define what errors to handle and how (try/catch, Result types, error boundaries)
  4. Testing expectations — Specify testing framework and what to test (unit, integration, edge cases)
  5. Type safety — Request type definitions, interfaces, schemas where applicable
  6. Performance constraints — Add if relevant (time complexity, memory, bundle size)
  7. Security considerations — Add if relevant (input validation, SQL injection, XSS, auth)
  8. Anti-patterns — Specify what to AVOID based on common mistakes for this stack

Phase 3: Display and wait

ENHANCED CODE PROMPT
─────────────────────────────────────
Project: [detected tech stack]
─────────────────────────────────────
[Your enhanced prompt]
─────────────────────────────────────
yes → proceed | edit: [changes] → modify | skip → use original

STOP. Do NOT generate any response until the user confirms.

Phase 4: Respond with code

After confirmation, respond with complete, production-ready code.

Few-Shot Examples

Example 1: Detected project is Next.js + TypeScript

Raw: add auth Enhanced: Add authentication to this Next.js 14 app using NextAuth.js (already in package.json). Implement: a sign-in page at /auth/signin with email/password and Google OAuth, session management using the existing Prisma adapter, protected API routes using middleware at middleware.ts, a useSession hook wrapper for client components, and proper TypeScript types for the session object. Follow the existing pattern in src/app using the App Router. Include error handling for failed auth attempts and rate limiting on the sign-in endpoint. Avoid using the Pages Router — this project uses App Router exclusively.

Example 2: Detected project is Python + FastAPI

Raw: add endpoint for users Enhanced: Add a CRUD REST endpoint for users to this FastAPI application. Include: a Pydantic model for User (matching the existing SQLAlchemy model in models/), endpoints for GET /users, GET /users/{id}, POST /users, PUT /users/{id}, DELETE /users/{id}, proper HTTP status codes (201 for create, 404 for not found), request validation using Pydantic, pagination on the list endpoint (offset/limit pattern matching existing endpoints), and dependency injection for the database session. Add type hints everywhere. Write pytest tests covering the happy path and error cases. Follow the existing router pattern in routers/.

Example 3: Generic coding (no project detected)

Raw: python web scraper Enhanced: Write a Python web scraper using requests and BeautifulSoup. Include: a complete working script that scrapes article titles and URLs from a news site, proper error handling (connection timeouts, HTTP errors, missing elements, rate limiting), respectful scraping (User-Agent header, 1-second delay between requests), retry logic with exponential backoff, structured output (save to CSV using the csv module), and a CLI interface using argparse for URL and output file. Add type hints and docstrings. Avoid using Selenium unless JavaScript rendering is required — mention when Selenium would be needed instead.

Rules

  • ALWAYS detect the project context first — never give generic enhancement when project info is available
  • Reference actual files, frameworks, and patterns from the codebase
  • Include the detected tech stack in the display header
  • If no project is detected, fall back to best-practice generic enhancement
  • Always include error handling and testing in code enhancements
  • Specify anti-patterns to avoid — this dramatically improves code quality
  • WAIT for user confirmation before generating any code

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.