lp-enhance
Skill8 starsChanged 5 months agoMITView on GitHub
AI-improve your AGENTS.md based on codebase analysis. Fills in architecture, conventions, guardrails, and suggests path-scoped rules and MCP servers. TRIGGER when: user runs /lp-enhance, asks to "improve AGENTS.md", "fill in architecture", or after major refactors. DO NOT TRIGGER when: user is editing AGENTS.md manually, doing normal coding, or running doctor.
- Reads credentials
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/architecture.mdcCursor rule
- .cursor/rules/conventions.mdcCursor rule
- .cursor/rules/doctor.mdcCursor rule
- .cursor/rules/hooks.mdcCursor rule
- .cursor/rules/memory.mdcCursor rule
- .cursor/rules/verification.mdcCursor rule
- .cursor/rules/workflow.mdcCursor rule
- lp-enhanceSkill
- lp-migrate-memorySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. About 0 are common, 16 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Read AGENTS.md and the project's codebase, then update AGENTS.md to fill in missing or incomplete sections.
- Distinctive: line 17
Read AGENTS.md (if it exists)
- Very specific: line 18
Read .cursor/rules/*.mdc (existing rules and their frontmatter)
- Very specific: line 19
Read .cursor/hooks.json and the scripts it references under .cursor/hooks/
- Very specific: line 20
Read .cursor/mcp.json (configured MCP servers, if any)
- Distinctive: line 21
Read .cursorignore (if it exists)
- Very specific: line 23
Read package.json / go.mod / pyproject.toml for stack detection
- Very specific: line 24
Check for monorepo indicators (workspaces, pnpm-workspace.yaml, nx.json, lerna.json)
- Distinctive: line 36
## Key Decisions: - only decisions that affect how the agent works in this codebase
- Very specific: line 38
If any section would exceed 8 bullets, plan a .cursor/rules/ file for the overflow.
- Very specific: line 46
Create or update .cursor/rules/ files for overflow content
- Distinctive: line 49
Verify line count is under 200
- Distinctive: line 52
Don't remove existing content, only add or improve
- Distinctive: line 54
Use bullet points, not paragraphs
- Very specific: line 58
Run claude-launchpad doctor --harness cursor to check the score improved
- Very specific: line 70
Check for monorepo indicators: workspaces in package.json, pnpm-workspace.yaml, nx.json, lerna.json.
- Distinctive: line 71
Check for docs/, tests/, scripts/ as separate scopes.
- Distinctive: line 83
Keep route handlers under 30 lines
- Distinctive: line 96
If path-scoped rules already exist, don't overwrite them
- Distinctive: line 104
If you see project-specific patterns that deserve hooks, suggest them
- Distinctive: line 106
If no sessionStart hook injects TASKS.md, suggest one
- Very specific: line 107
DO NOT modify hooks.json directly.
- Distinctive: line 111
Read .cursorignore and check if the patterns make sense for the detected stack:
- Distinctive: line 124
Test fixtures or seed data (might be needed for context)
- Distinctive: line 126
If .cursorignore is missing entirely, create one with sensible defaults for the detected stack.
- Distinctive: line 127
If it exists but has gaps, print suggested additions.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
<!-- lp-cursor-enhance-version: 1 -->lp-enhance - AI-powered AGENTS.md improver
Read AGENTS.md and the project's codebase, then update AGENTS.md to fill in missing or incomplete sections.
Phase 1: Research
- Read AGENTS.md (if it exists)
- Read .cursor/rules/*.mdc (existing rules and their frontmatter)
- Read .cursor/hooks.json and the scripts it references under .cursor/hooks/
- Read .cursor/mcp.json (configured MCP servers, if any)
- Read .cursorignore (if it exists)
- Scan src/ directory structure (top-level dirs, key files)
- Read package.json / go.mod / pyproject.toml for stack detection
- Check for monorepo indicators (workspaces, pnpm-workspace.yaml, nx.json, lerna.json)
Done when: you have a mental model of the stack, architecture, and existing config.
Phase 2: Plan
Count current AGENTS.md actionable lines. Budget is 200 lines max. Plan which sections to add or improve:
- ## Stack - detect language, framework, package manager
- ## Architecture - 3-5 bullets describing codebase shape
- ## Conventions - max 8 key patterns. Overflow to .cursor/rules/conventions.mdc
- ## Off-Limits - max 8 guardrails specific to this project
- ## Key Decisions - only decisions that affect how the agent works in this codebase
If any section would exceed 8 bullets, plan a .cursor/rules/ file for the overflow.
Done when: you know exactly what to add/change and the line count stays under 200.
Phase 3: Execute
Edit AGENTS.md with the planned changes. Then:
- Create or update .cursor/rules/ files for overflow content
- Generate path-scoped rules if the project has distinct areas (see below)
- Review .cursorignore and print suggestions (see below)
- Verify line count is under 200
Rules:
- Don't remove existing content, only add or improve
- Be specific to THIS project, not generic advice
- Use bullet points, not paragraphs
Phase 4: Verify
- Run
claude-launchpad doctor --harness cursorto check the score improved - Print suggested hooks (exact JSON) for .cursor/hooks.json but don't modify it
- Print suggested MCP servers for .cursor/mcp.json if external services detected (Postgres, Redis, Stripe, etc.)
Done when: doctor score is equal or higher and suggestions are printed.
Path-scoped rules generation
Scan the project structure and generate focused .cursor/rules/*.mdc files with globs frontmatter. These load ONLY when the agent works on matching files, saving context tokens.
How to detect areas:
- List top-level directories under src/ (or equivalent). Each distinct area (api, components, lib, tests) is a candidate.
- Check for monorepo indicators: workspaces in package.json, pnpm-workspace.yaml, nx.json, lerna.json. Each workspace is a candidate.
- Check for docs/, tests/, scripts/ as separate scopes.
For each detected area, create an .mdc rules file with this format:
description: API rules globs: "src/api/**" alwaysApply: false
API Rules
- Validate all request input with zod schemas
- Return typed error responses, never throw raw errors
- Keep route handlers under 30 lines
Stack-specific patterns to include:
- Next.js app/: "Use Server Components by default, add 'use client' only when needed"
- API routes / src/api/: "Validate input at boundaries, typed error responses"
- React components: "Colocate components near usage, props interface above component"
- Tests: "One assertion per test when possible, descriptive test names"
- Database / prisma/ / drizzle/: "Never write raw SQL, use the ORM, migrations required"
- Docs: "No em dashes, max 3 sentences per paragraph, code examples required"
When NOT to generate:
- Small projects with < 5 source files (one conventions.mdc is enough)
- Projects where all code is in one flat directory
- If path-scoped rules already exist, don't overwrite them
Monorepo handling:
- Each package gets its own rules file: .cursor/rules/packages-
<name>.mdc with globs scoped to that package
Hook review
Review .cursor/hooks.json:
- If you see project-specific patterns that deserve hooks, suggest them
- Security hooks (env-read, destructive-shell) should stay failClosed: true
- If no sessionStart hook injects TASKS.md, suggest one
- DO NOT modify hooks.json directly. Print exact JSON to add.
.cursorignore review
Read .cursorignore and check if the patterns make sense for the detected stack:
Always flag:
- Missing node_modules/ (JS/TS projects)
- Missing pycache/ or .venv/ (Python projects)
- Missing target/ (Rust/Java projects)
- Missing .env / .env.* patterns
- Missing lock files (pnpm-lock.yaml, package-lock.json, yarn.lock, etc.)
- Missing coverage/ directory
- Large generated files that waste context (*.min.js, *.map, migrations/)
Never flag:
- Patterns the user clearly added intentionally
- Test fixtures or seed data (might be needed for context)
If .cursorignore is missing entirely, create one with sensible defaults for the detected stack. If it exists but has gaps, print suggested additions. Do NOT modify it directly.
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
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.

