Repository navigation
Closed
Labels
Description
Summary
Add guidance to prevent Claude from building custom solutions when well-tested packages exist, and ensure /exec actively checks npm before implementing utilities.
Problem
Claude sometimes builds custom implementations for common problems:
- Date formatting/parsing
- Validation schemas
- HTTP clients with retry logic
- State management utilities
- Form handling
These custom solutions are often:
- Less tested than established packages
- Missing edge cases the packages handle
- More code to maintain
- Slower to implement
Proposed Solution
1. Exec Skill Enhancement
Add to /exec skill workflow:
## Before Implementation
For common utility tasks (dates, validation, HTTP, forms, state management):
1. **Search first**: Run `npm search <relevant-term>` to find candidates
2. **Evaluate options**: Check maintenance status, bundle size, weekly downloads
3. **Prefer established packages** over 50+ line custom implementations
Package selection criteria:
- Prefer packages with >10k weekly downloads
- Prefer packages updated within last 6 months
- Prefer permissive licenses (MIT, Apache-2.0, BSD)
- Check bundle size impact (avoid 500kb for one function)
- Avoid packages with commercial/unclear licenses without user approval2. CLAUDE.md Guidance
Add to project CLAUDE.md template:
## Package Preference
Before implementing utilities for common tasks, check if a well-maintained
package exists. Prefer established packages over custom implementations for:
- Date/time handling (date-fns, dayjs)
- Validation (zod, yup)
- HTTP requests (ky, got)
- Form state (react-hook-form)
- State management (zustand, jotai)
Custom implementation is appropriate when:
- The package is abandoned or has security issues
- Only a tiny subset of functionality is needed (< 20 lines)
- Project constraints prohibit new dependencies
- User explicitly requests custom solution3. Complexity Trigger
In /exec, if implementation plan includes creating a utility that would exceed 50 lines for a "solved problem" domain, pause and verify no suitable package exists.
Acceptance Criteria
-
/execskill includes "search npm first" step for utility tasks - Exec guidance includes package evaluation criteria (downloads, license, size)
- CLAUDE.md template includes package preference section
- Exec warns before building 50+ line utilities for common domains
Related
- feat: Lightweight sanity checks for common anti-patterns in /qa #92 - QA sanity checks will audit new dependencies added during exec
Activity
admarble commentedon Jan 21, 2026
Plan Review
Refined Acceptance Criteria
/execincludes "search npm first" stepImplementation Plan
Single file change:
.claude/skills/exec/skill.mdVerification Criteria
Effort Estimate
Implementation Readiness
Status: READY
🤖 Generated with Claude Code
feat(#90): add package preference guidance to exec skill
admarble commentedon Jan 21, 2026
Implementation Complete
AC Coverage
/execincludes "search npm first" stepFiles Changed
.claude/skills/exec/skill.md(+42 lines)Test Results
npm test: 566 passed, 1 skipped ✅PR
PR #160: #160
Next Steps
/qa 90to review and merge🤖 Generated with Claude Code
admarble commentedon Jan 21, 2026
QA Review for Issue #90
AC Coverage
/execskill includes "search npm first" stepCLAUDE.md template→ Exec skill has package preferenceWarns before 50+ lines→ Documents when custom is OKCoverage: 4/4 AC items fully met
Quality Metrics
any)Test Coverage Analysis
.claude/skills/exec/SKILL.mdCoverage: N/A - No source code changes (documentation only)
Critical paths without tests: None
Code Review
Strengths:
Issues:
Suggestions:
npm viewcommand'sdownloadsfield isn't in standard npm output (would need npm API), but intent is clearAnti-Pattern Detection
Dependency Audit: N/A - No dependency changes
Code Patterns: N/A - Documentation only
Self-Evaluation
Verdict: READY_FOR_MERGE
All AC items are met. The change is minimal, focused, and follows existing patterns in the skill file. No code changes, no test coverage concerns.
Documentation
Next Steps
/docsneeded (internal skill change)🤖 Generated with Claude Code
feat(#90): add package preference guidance to exec skill (#160)