source-driven
This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.
Source-Driven Development
Never rely on training data for API usage. Read the actual source of truth.
Pre-loaded context
- Dependencies: !
cat package.json | grep -E '"dependencies"|"devDependencies"' -A 50 | head -60
Workflow
1. Identify Dependencies
- Read
package.json(or equivalent manifest) for exact versions - Note the exact version of each library involved in the task
2. Fetch Official Docs
For each dependency involved:
- Find the correct docs URL for that specific version (not "latest")
- Fetch the relevant API page using WebFetch
- Extract: function signatures, required params, return types, breaking changes
If docs are unavailable or ambiguous, read the library source in node_modules/.
3. Implement from Docs
- Use only APIs confirmed in fetched docs
- Match function signatures exactly (param order, types, defaults)
- If a doc page confirms the API: proceed
- If you cannot verify an API: mark it
// UNVERIFIED: could not confirm in docs for v{version}
4. Cite Sources
Add a brief comment on non-obvious API usage:
// Ref: https://docs.example.com/v3/api#method
Only cite when the usage is surprising or version-specific. Don't over-comment obvious calls.
Anti-Rationalization
| Excuse | Rebuttal |
|---|---|
| "I know this API from training data" | Training data may be outdated or wrong. Check the version. |
| "The docs are too slow to fetch" | One fetch now prevents hours debugging a hallucinated API later. |
| "It's a minor utility, no need to check" | Minor utilities have breaking changes between versions too. |
| "I'll verify later" | Unverified code compounds. Verify now or mark UNVERIFIED. |
Rules
- NEVER guess API signatures — fetch or read source
- NEVER assume "latest" docs match the installed version
- Always mark unverified claims with
// UNVERIFIED - Prefer
node_modules/source over training knowledge when docs unavailable - Don't cite every line — only non-obvious or version-sensitive usage
Error Handling
- Docs URL returns 404 → try GitHub repo README, then
node_modules/source - Version not found in docs → use closest version docs + mark
// UNVERIFIED: docs for v{closest}, installed v{actual} - WebFetch blocked/unavailable → read
node_modules/{pkg}/README.mdor type definitions
More from helderberto/skills
explain-code
Explains code with visual diagrams and analogies. Use when explaining how code works, teaching about a codebase, or when the user asks "how does this work?" Don't use for modifying code, fixing bugs, or generating new implementations.
45ship
Commit and push changes using atomic commits. Use when user asks to "ship", "commit and push", or requests committing and pushing changes. Don't use for creating pull requests or reviewing changes before committing.
45refactor-plan
Create structured refactoring plans. Use when user wants to plan a refactor, needs a refactoring strategy, or mentions breaking down large changes into small commits. Don't use for implementing code changes directly, small one-line fixes, or renaming a single variable.
44safe-repo
Check for sensitive data in repository. Use when user asks to "check for sensitive data", "/safe-repo", or wants to verify no company/credential data is in the repository. Don't use for general code review, adding .gitignore entries, or scanning non-git directories.
41lint
Run linting and formatting checks. Use when user asks to "run linter", "/lint", "check linting", "fix lint errors", or requests code linting/formatting. Don't use for running tests, type-checking only, or projects without a lint script in package.json.
40tdd
Guides test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants test-first development, or requests TDD workflow. Don't use for writing tests after implementation, adding tests to existing untested code, or one-off test fixes.
40