plugins/developer-toolkit/skills/debug/reproduction-builder/SKILL.md
Use this skill when creating bug reproductions. Activate when the user needs to create a minimal reproduction case, report a bug with steps to reproduce, isolate a bug to specific conditions, or help others understand how to trigger an issue.
npx skillsauth add latestaiagents/agent-skills reproduction-builderInstall 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.
Create minimal, reliable reproduction cases for bugs.
A minimal reproduction (repro) is:
## Bug Symptom
**What I expected:**
When I click "Submit", the form should save and show a success message.
**What actually happened:**
The page refreshes but nothing is saved. No error in UI.
**Error in console (if any):**
TypeError: Cannot read properties of undefined (reading 'id') at saveForm (form.js:45)
Ask these questions:
## Trigger Conditions
**Always happens when:**
- [ ] Form field "email" is empty
- [ ] User is not logged in
- [ ] Data was previously saved
**Sometimes happens when:**
- [ ] Network is slow
- [ ] Multiple tabs open
- [ ] After being idle for a while
**Never happens when:**
- [ ] All fields filled
- [ ] Fresh browser session
Remove things one at a time until you find the minimum needed.
// Original code with bug
async function saveForm(data: FormData) {
const validated = await validateForm(data);
const enriched = await enrichWithUserData(validated);
const formatted = formatForAPI(enriched);
const response = await api.post('/forms', formatted);
await updateLocalCache(response);
showSuccessMessage();
analytics.track('form_saved');
return response;
}
// Isolated - which step fails?
async function saveFormDebug(data: FormData) {
console.log('1. Input:', data);
const validated = await validateForm(data);
console.log('2. Validated:', validated);
const enriched = await enrichWithUserData(validated);
console.log('3. Enriched:', enriched); // Bug here: enriched.user is undefined
const formatted = formatForAPI(enriched);
console.log('4. Formatted:', formatted);
// ... rest
}
// Minimal reproduction
// Run with: npx ts-node repro.ts
interface User {
id: string;
name: string;
}
interface FormData {
user?: User;
email: string;
}
function formatForAPI(data: FormData) {
// BUG: Crashes when user is undefined
return {
userId: data.user.id, // <- TypeError here
email: data.email
};
}
// Reproduction case
const buggyData: FormData = {
email: '[email protected]'
// user is undefined
};
formatForAPI(buggyData); // Throws!
## Bug Report
**Environment:**
- Node.js: v20.x
- Package: [email protected]
- OS: macOS 14
**Minimal Reproduction:**
```javascript
// Save as repro.js and run: node repro.js
const { buggyFunction } = require('example-lib');
// This should work but throws
const result = buggyFunction({
input: 'valid input',
options: { flag: true }
});
console.log(result);
Expected: Returns processed result Actual: Throws TypeError
Steps:
### For React
```jsx
// CodeSandbox/StackBlitz link preferred
// Or minimal component:
import { useState } from 'react';
import { BuggyComponent } from 'library';
export default function Repro() {
const [data, setData] = useState(null);
// Bug: Component crashes when data is null
return (
<div>
<button onClick={() => setData({ value: 1 })}>
Load Data
</button>
{/* Crashes before clicking button */}
<BuggyComponent data={data} />
</div>
);
}
# Minimal curl reproduction
curl -X POST https://api.example.com/endpoint \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"field": "value",
"nested": {
"trigger": true
}
}'
# Expected: 200 OK with response
# Actual: 500 Internal Server Error
-- Reproduction schema
CREATE TABLE repro_users (
id SERIAL PRIMARY KEY,
email VARCHAR(255),
created_at TIMESTAMP DEFAULT NOW()
);
-- Sample data that triggers bug
INSERT INTO repro_users (email) VALUES
('[email protected]'),
(NULL), -- This row triggers the bug
('[email protected]');
-- Query that fails
SELECT * FROM repro_users
WHERE email LIKE '%@%'; -- Fails on NULL row
For bugs that don't happen every time:
// Stress test reproduction
async function reproduceRaceCondition() {
let failures = 0;
const attempts = 1000;
for (let i = 0; i < attempts; i++) {
try {
await buggyAsyncOperation();
} catch (error) {
failures++;
console.log(`Failed on attempt ${i}:`, error.message);
}
}
console.log(`Failed ${failures}/${attempts} times (${(failures/attempts*100).toFixed(1)}%)`);
}
reproduceRaceCondition();
// From reproduction
function formatForAPI(data: FormData) {
return { userId: data.user.id }; // Bug
}
const buggyData = { email: '[email protected]' };
formatForAPI(buggyData); // Throws
// To test
describe('formatForAPI', () => {
it('handles missing user gracefully', () => {
const data = { email: '[email protected]' };
// Current behavior (bug)
expect(() => formatForAPI(data)).toThrow();
// After fix, should be:
// expect(formatForAPI(data)).toEqual({ userId: null, email: '[email protected]' });
});
});
Help me create a minimal reproduction for this bug:
**Symptoms:**
[Describe what's happening]
**Error:**
[Paste error message/stack trace]
**Code involved:**
[Paste relevant code]
Please:
1. Identify the minimum code needed
2. Create a standalone repro file
3. Suggest what data triggers the bug
4. Explain why the bug occurs
development
Test skills for correct activation, content quality, and regression — both automated checks (frontmatter validity, lint) and manual verification (query-suite activation testing). Covers CI integration and how to catch skill regressions before users do. Use this skill when adding skills to a repo, setting up CI for a skill library, or debugging "the skill exists but doesn't work". Activate when: test skills, validate skills, skill CI, skill linting, skill activation test, skill regression.
documentation
Write the YAML frontmatter for a SKILL.md file so it activates reliably — name, description, and activation keywords that the model matches against. Covers length, tone, and the most common frontmatter mistakes. Use this skill when authoring a new skill, fixing a skill that isn't auto-activating, or reviewing skills for publication. Activate when: SKILL.md frontmatter, skill description, skill activation, skill YAML, write a skill, author a skill.
development
Design skills that fire at the right moment — neither over-eager (noise) nor under-eager (silent). Covers activation specificity, trigger phrases, disambiguation between overlapping skills, and debugging activation. Use this skill when multiple skills could fire on the same query, a skill never fires, or a skill fires too often. Activate when: skill won't activate, skill over-activates, overlapping skills, skill triggers, skill selection, skill disambiguation.
development
Structure SKILL.md content so the model reads just enough — concise summary up front, progressively deeper detail, examples on demand. Covers section ordering, length budgets, when to split into multiple skills. Use this skill when writing or refactoring a skill body, one skill has grown too long, or a skill is wordy but not useful. Activate when: SKILL.md structure, skill content, skill too long, split skill, progressive disclosure, skill body.