From adlc-react-frontend
Spec-driven development separates PLANNING from IMPLEMENTATION. This skill defines how to create implementation specifications that enable reliable, predictable React component development.
npx claudepluginhub sumanpapanaboina1983/adlc-accelerator-kit-pluginsThis skill uses the workspace's default tool permissions.
Spec-driven development separates PLANNING from IMPLEMENTATION. This skill defines how to create implementation specifications that enable reliable, predictable React component development.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides MCP server integration in Claude Code plugins via .mcp.json or plugin.json configs for stdio, SSE, HTTP types, enabling external services as tools.
Spec-driven development separates PLANNING from IMPLEMENTATION. This skill defines how to create implementation specifications that enable reliable, predictable React component development.
# Implementation Specification
## Task Type
NEW_FEATURE | BUG_FIX | ENHANCEMENT
## Summary
One paragraph describing the deliverable.
## Requirements
Numbered list of what must be achieved.
## Design Reference
(For NEW_FEATURE with Figma)
- Extracted colors, typography, spacing
- Component states
## Existing Code Analysis
(Required for BUG_FIX and ENHANCEMENT)
- Files analyzed with line references
- Current behavior description
- Patterns to follow
## Implementation Plan
### Phase 1: Test Specification (RED)
Exact test code to write.
### Phase 2: Implementation (GREEN)
File-by-file checklist of changes.
### Phase 3: Verification
Commands to run and expected results.
## Accessibility Checklist
Specific a11y requirements for this component.
## Acceptance Criteria Mapping
Table linking requirements → tests → implementation.
Focus on:
Figma Extraction Process:
mcp__figma__get_filemcp__figma__get_nodeDo NOT:
Critical: Must analyze existing code before planning fix.
Reproduce understanding
Code analysis
Fix design
Critical: Must deeply understand existing code before extending.
Existing code inventory
Extension design
Test design
it('should [expectedBehavior] when [condition]', async () => {
// Given - setup
render(<Component {...props} />);
// When - action
await userEvent.click(screen.getByRole('button'));
// Then - assertions
expect(screen.getByText('Result')).toBeInTheDocument();
});
getByRole - accessible queriesgetByLabelText - form elementsgetByText - visible textgetByTestId - last resort onlyBAD (too vague):
- Write tests for the button
GOOD (specific):
- Test: should render button with correct text
- Given: Button component with label="Submit"
- When: Rendered
- Then: Button with role="button" and text "Submit" visible
- Test: should call onClick when clicked
- Given: Button with onClick handler
- When: User clicks button
- Then: onClick called once
#### File: `src/components/Button.tsx`
- [ ] Define interface: `interface ButtonProps { ... }`
- [ ] Create functional component with props destructuring
- [ ] Add className with Tailwind: `bg-blue-500 hover:bg-blue-600 ...`
- [ ] Add ARIA: `aria-label`, `aria-disabled` if needed
- [ ] Handle onClick with proper typing
- [ ] Export as default
List implementation tasks in logical order:
Always include exact commands:
### Phase 3: Verification
```bash
# 1. TypeScript check
npx tsc --noEmit
# 2. Run specific tests
npm test -- Button.test.tsx --run
# 3. Run all tests
npm test -- --run
# 4. Run with coverage
npm test -- --coverage --run
# Expected: >80% coverage on new code
# 5. Lint check
npm run lint
# 6. Build check
npm run build
## Accessibility Planning
Every component spec MUST include:
```markdown
## Accessibility Checklist
### Semantic HTML
- [ ] Use `<button>` not `<div onClick>`
- [ ] Use `<a>` for navigation
- [ ] Use heading hierarchy correctly
### ARIA
- [ ] `aria-label` for icon-only buttons
- [ ] `aria-expanded` for toggles
- [ ] `aria-describedby` for complex elements
### Keyboard
- [ ] Tab navigation works
- [ ] Enter/Space activates buttons
- [ ] Escape closes modals
- [ ] Focus trap in modals
### Visual
- [ ] Focus indicator visible
- [ ] Color contrast 4.5:1 minimum
- [ ] Don't rely on color alone
| Mistake | Impact | Prevention |
|---|---|---|
| Skipping code analysis for bugs | Wrong fix | Always read existing code first |
| Vague test descriptions | Tests miss cases | Use Given/When/Then |
| Missing accessibility | Inaccessible UI | Include a11y checklist always |
| Ignoring existing patterns | Inconsistent code | Document patterns before planning |
| Not extracting from Figma | Design mismatch | Use Figma MCP tools |
Before finalizing a plan, verify: