plugins/powerups/skills/best-practices/SKILL.md
Use for any code change — bug fix, small feature, refactor, or improvement. Ensures TDD, clarifying questions, codebase investigation, DRY, proper branching/worktrees, UI skills, and doc updates. PDD invokes this automatically for large features.
npx skillsauth add jackyliang/powerups best-practicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The baseline discipline for every code change, no matter how small. A bug fix, a refactor, a small feature — all of them follow these practices. The plan-driven-development skill invokes this automatically for large multi-milestone features, but you should use this directly for smaller work.
Always. Every code change should follow these practices. If the work is large enough for milestones and a plan file, use plan-driven-development instead (which includes everything here plus planning infrastructure).
If this is a new user-facing feature (not a bug fix, refactor, or internal change), run powerups:user-research FIRST — before branching or writing code. It produces a short discovery brief (problem statement, jobs-to-be-done, core flow, decision matrix) so you build the right thing, not just build the thing right. Skip it for mechanical changes (rename, restyle, bugfix) or when the requester already specified exact behavior.
(plan-driven-development and give-me-five already invoke user-research at the right moment — this pointer is for standalone feature work that doesn't go through either.)
Before writing any code, create a new branch.
git checkout -b feature/name
Never commit directly to main. No exceptions.
Before writing code, understand what already exists. Spawn an Explore subagent to check:
All investigation happens in subagents to protect main context. The subagent returns a concise summary, not raw file contents.
Subagent prompt template:
"Investigate the codebase for [feature/problem]. Check: (1) does similar code already exist, (2) do existing services or third-party deps already handle this, (3) what patterns are used for similar features. Return a concise summary under 30 lines."
When working with 3rd party APIs or libraries: Use WebSearch to look up the latest official documentation before writing any integration code. Your training data may be outdated — APIs change, deprecate endpoints, rename parameters, and introduce new best practices. A quick search confirms you're using the current API surface, not a stale version from memory.
Do NOT rely on training knowledge alone for 3rd party API calls. Even if you "know" the API, verify it — the cost of a search is trivial compared to debugging a broken integration from a deprecated endpoint.
Before modifying any existing function, API, database schema, or shared utility, run 3 parallel subagents to exhaustively scan everything that depends on it. This prevents incomplete changes that break existing code.
This is mandatory whenever you are:
Run all 3 scans in parallel as general-purpose subagents, each with this prompt shape:
"I'm modifying [function/module/table]. Find EVERY [scan target] across the entire codebase. For each: file path, line number, exact usage, whether it needs updating."
What to do with the results:
This is NOT the same as practice #2 (Investigate Before Building). Practice #2 asks "does similar code exist?" to avoid reinventing. This practice asks "what will break when I change this?" to avoid incomplete changes.
Use AskUserQuestion to clarify before building. Don't guess at requirements, scope, or approach.
Ask about:
Rules:
Write failing tests first, then implement. No exceptions. Use the test-driven-development skill.
The cycle:
No mocks. Tests hit real infrastructure.
Before implementing anything, search for existing code that does the same or similar thing. Spawn an Explore subagent to look:
"Search the codebase for existing implementations of [what you're about to build]. Check utils, services, helpers, and similar features. Return file paths and a one-line summary of what each does."
If similar code exists:
If you find duplication after writing code:
Three similar lines of code is better than a premature abstraction — but three similar functions should be consolidated.
Use registry patterns for similar operations with different configurations — a dict mapping keys to functions/configs beats a chain of if/else blocks.
Do NOT implement backward compatibility or legacy methods unless explicitly asked.
# removed comments, no _unused variablesIf the change involves any user-facing text or UI, use the simple-design-principles skill. This covers:
If the change involves any frontend/UI work, use the frontend-design skill. This applies to:
If the change involves API endpoints (new or modified), use the self-documenting-apis skill. This ensures:
Field(description=...)Auto-generated docs (/docs, /redoc) should be the only API reference — no separate doc file to maintain.
After the code is complete and tests pass, run the update-docs skill to sync all documentation:
Don't skip this. Stale docs cause more damage than missing docs.
After the code is working and tests pass, run /simplify to review changed code for reuse, quality, and efficiency. This catches:
Fix issues found, then proceed to docs and lint.
Run the project's linter before committing:
ruff check / ruff formatnpm run lint0. User-research (if new user-facing feature — run powerups:user-research first)
1. Branch (never main)
2. Investigate (subagent — what exists? WebSearch — latest 3rd party API docs)
3. Impact scan (3 parallel subagents — what will break?)
4. Ask (clarify requirements with user)
5. TDD (red → green → refactor)
6. DRY (search before building, extract duplicates)
7. No backward compat (unless explicitly asked)
8. Simple-design-principles (if UI/copy work)
9. Frontend-design skill (if UI work)
10. Self-documenting APIs (if API work)
11. Update docs (run /update-docs)
12. Simplify (run /simplify after implementation)
13. Lint (before committing)
| Don't | Do |
|-------|-----|
| Jump into building a new user-facing feature | Run user-research first — confirm you're building the right thing |
| Commit to main | Create a branch first |
| Start coding without checking what exists | Spawn Explore subagent first |
| Change a function without scanning for all callers | Run 3 parallel impact scan subagents first |
| Assume only the obvious files are affected | The scan always finds surprising callers — cron jobs, background tasks, shared utilities |
| Guess what the user wants | Ask with AskUserQuestion |
| Write tests after implementation | Write failing tests first (TDD) |
| Copy-paste similar code | Extract shared utility |
| Build custom infrastructure when a dependency handles it | Check third-party capabilities first |
| Assume your training data has the latest 3rd party API | WebSearch the official docs before writing integration code |
| Default to the easier approach | Present options, recommend the better one |
| Keep old code "just in case" | Delete it — no backward compat by default |
| Add backward compat shims without asking | Ask the user first — usually not needed |
| Write UI copy with technical jargon | Use simple-design-principles skill |
| Skip docs because "it's a small change" | Run /update-docs — small changes cause drift too |
| Write UI code without frontend-design skill | Always use it for user-facing changes |
| Maintain a separate api-reference.md | Use self-documenting-apis — code is the docs |
| Return raw dicts from API endpoints | Define typed response models |
development
Run PM-grade discovery before building any user-facing feature — problem statement, jobs-to-be-done, core flow, decision matrix. Output is a short brief with open decisions surfaced as explicit questions. Invoked by plan-driven-development and give-me-five.
testing
Ultra-short replies — answer a quick question, draft a short text/social post, or draft a short email. No preamble, no offers to elaborate, drafts under 480 characters (280 for X), never em-dashes.
development
Reconcile shipped code with the plan in both directions — additive drift (unplanned work that landed) and subtractive drift (dead files, stale TODOs, completed deferred items). Run as part of PDD's post-completion audit, before /simplify.
data-ai
Generate 5 meaningfully distinct UI/UX variants of the same screen in parallel (one subagent each), reachable via ?style=1...5, so the user can compare and pick. Calling again on a chosen style refines within that direction.