Application Performance
Purpose
Identify and improve measurable frontend, backend, database, and runtime performance problems.
Project Stack
Next.js, FastAPI, PostgreSQL, Redis, browser tooling.
Operating Principles
- Measure before optimizing.
- Identify the actual bottleneck.
- Do not optimize based solely on intuition.
- Consider network, CPU, memory, database, rendering, and bundle costs.
- Avoid premature caching.
- Use pagination for large collections.
- Watch for N+1 database queries.
- Keep expensive operations out of request paths when asynchronous processing is appropriate.
- Consider cache invalidation explicitly.
- Verify that performance changes actually improve the measured behavior.
Required Workflow
- Define the performance symptom.
- Measure a baseline.
- Locate the bottleneck.
- Implement the smallest targeted optimization.
- Measure again.
- Check correctness and regressions.
- Document meaningful performance assumptions.
Evidence Rules
Use the strongest available evidence in this order:
- Runtime behavior
- Automated test results
- Type checking, linting, and build results
- Installed package/source behavior
- Official framework or library documentation
- Repository configuration
- Static code inspection
- General model knowledge
Never report an assumption as a verified result.
Tool Selection
- Use Filesystem MCP for repository exploration and file inspection.
- Use Context7 for current, version-specific library/framework documentation.
- Use Fetch when official documentation or public web resources need to be retrieved.
- Use Playwright for browser behavior, frontend interaction, forms, authentication flows, and UI verification.
- Use GitHub CLI for repository, branch, pull request, issue, workflow, and CI operations.
- Prefer the smallest tool set that establishes reliable evidence.
Failure Handling
When something fails:
- Reproduce the failure.
- Capture the exact error.
- Identify the failing layer.
- Check whether the failure is environmental, dependency-related, configuration-related, or caused by application code.
- Research uncertain behavior using authoritative sources.
- Apply the smallest appropriate fix.
- Reproduce the original failure again.
- Run regression checks.
- Inspect the final diff.
Do not hide failures by weakening tests, suppressing errors, deleting evidence, or claiming success without verification.
Security
- Never expose secrets.
- Never commit credentials.
- Treat all external input as untrusted.
- Preserve authentication and authorization boundaries.
- Avoid leaking internal implementation details through errors.
- Review security implications whenever the skill touches users, data, credentials, networking, or deployment.
Completion Criteria
A task using this skill is complete only when:
- The requested behavior is implemented.
- Existing project conventions are preserved.
- Relevant static checks pass.
- Relevant tests pass or their absence is explicitly reported.
- Browser verification is performed when the task affects user-facing behavior.
- Security implications have been considered.
- The final diff has been inspected.
- Verified facts are clearly distinguished from assumptions or remaining uncertainty.
1---2name: performance3description: Application Performance4---5# Application Performance67## Purpose89Identify and improve measurable frontend, backend, database, and runtime performance problems.1011## Project Stack1213Next.js, FastAPI, PostgreSQL, Redis, browser tooling.1415## Operating Principles16171. Measure before optimizing.182. Identify the actual bottleneck.193. Do not optimize based solely on intuition.204. Consider network, CPU, memory, database, rendering, and bundle costs.215. Avoid premature caching.226. Use pagination for large collections.237. Watch for N+1 database queries.248. Keep expensive operations out of request paths when asynchronous processing is appropriate.259. Consider cache invalidation explicitly.2610. Verify that performance changes actually improve the measured behavior.2728## Required Workflow29301. Define the performance symptom.312. Measure a baseline.323. Locate the bottleneck.334. Implement the smallest targeted optimization.345. Measure again.356. Check correctness and regressions.367. Document meaningful performance assumptions.3738## Evidence Rules3940Use the strongest available evidence in this order:41421. Runtime behavior432. Automated test results443. Type checking, linting, and build results454. Installed package/source behavior465. Official framework or library documentation476. Repository configuration487. Static code inspection498. General model knowledge5051Never report an assumption as a verified result.5253## Tool Selection5455- Use Filesystem MCP for repository exploration and file inspection.56- Use Context7 for current, version-specific library/framework documentation.57- Use Fetch when official documentation or public web resources need to be retrieved.58- Use Playwright for browser behavior, frontend interaction, forms, authentication flows, and UI verification.59- Use GitHub CLI for repository, branch, pull request, issue, workflow, and CI operations.60- Prefer the smallest tool set that establishes reliable evidence.6162## Failure Handling6364When something fails:65661. Reproduce the failure.672. Capture the exact error.683. Identify the failing layer.694. Check whether the failure is environmental, dependency-related, configuration-related, or caused by application code.705. Research uncertain behavior using authoritative sources.716. Apply the smallest appropriate fix.727. Reproduce the original failure again.738. Run regression checks.749. Inspect the final diff.7576Do not hide failures by weakening tests, suppressing errors, deleting evidence, or claiming success without verification.7778## Security7980- Never expose secrets.81- Never commit credentials.82- Treat all external input as untrusted.83- Preserve authentication and authorization boundaries.84- Avoid leaking internal implementation details through errors.85- Review security implications whenever the skill touches users, data, credentials, networking, or deployment.8687## Completion Criteria8889A task using this skill is complete only when:9091- The requested behavior is implemented.92- Existing project conventions are preserved.93- Relevant static checks pass.94- Relevant tests pass or their absence is explicitly reported.95- Browser verification is performed when the task affects user-facing behavior.96- Security implications have been considered.97- The final diff has been inspected.98- Verified facts are clearly distinguished from assumptions or remaining uncertainty.