.claude/skills/code-first-draft/SKILL.md
Initial feature implementation
npx skillsauth add pisithrps/yapzee code-first-draftInstall 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.
Example: "Build the user preferences feature from outputs/prds/preferences.md"
Output: Code in your codebase + summary saved to outputs/prototypes/[feature]-first-draft.md
Time: 1-3 hours depending on feature complexity
Connect to codebase and build initial implementation of a feature. Single-pass development with manual iteration.
/code-first-draft - Build feature from PRD/code-first-draft [prd-name] - Build specific PRD/code-first-draft --explore-only - Just explore codebase, don't write code yetCheck first:
outputs/prds/ - PRD for requirementscontext-library/technical/codebase-overview.md - Cached codebase context.git directory, source files)Detect codebase:
# Check if in codebase directory
ls -la | grep ".git"
If not in codebase:
gh repo clone)Explore codebase:
# Detect framework
ls package.json || ls requirements.txt || ls Gemfile || ls go.mod
# Find key directories
find . -type d -name "components" -o -name "src" -o -name "app" | head -10
# Understand structure
tree -L 2 -I 'node_modules|__pycache__|.git'
Save context:
Create context-library/technical/codebase-overview.md:
# Codebase Overview
**Framework:** [React/Django/Rails/etc]
**Key directories:**
- `/src/components/` - UI components
- `/src/api/` - API routes
- `/src/services/` - Business logic
**Patterns:**
- [Pattern observed]
**Tech stack:**
- [Languages, frameworks, libraries]
Read PRD and extract:
Map to code:
Before writing code, create plan:
# Implementation Plan: [Feature]
## Files to Create
- `src/components/NewFeature.tsx` - Main component
- `src/api/feature.ts` - API routes
- `tests/feature.test.ts` - Unit tests
## Files to Modify
- `src/components/Dashboard.tsx` - Add new feature entry point
- `src/api/index.ts` - Register new routes
- `src/types/index.ts` - Add type definitions
## API Endpoints
- `POST /api/feature` - Create new item
- `GET /api/feature/:id` - Fetch item
- `PUT /api/feature/:id` - Update item
## Database Changes
- Add `features` table with columns: id, user_id, data, created_at
## Testing Approach
- Unit tests for components
- Integration tests for API
- E2E test for happy path
Ask user for approval: "This is my plan. Approve before I write code?"
Write code following:
Add inline comments for:
Create tests:
Save to outputs/prototypes/[feature]-first-draft.md:
# First Draft Implementation: [Feature]
**Date:** [Date]
**PRD:** [Link]
## What Was Built
**Files created:** [X]
**Files modified:** [Y]
**Tests added:** [Z]
## Implementation Approach
[Brief description of technical approach]
## Testing
**Coverage:** [%]
**Tests passing:** [Y/N]
**Manual testing needed:** [What to test]
## Known Issues / TODOs
- [ ] [Issue 1]
- [ ] [TODO 1]
## Next Steps
- Run tests
- Manual QA
- For complex features: Consider `/ralph-wiggum` for autonomous iteration
If no codebase is detected (no .git directory, no package.json, no source files in the workspace), switch to Prototype Mode automatically.
Before choosing the prototype tech stack, check context-library/business-info-template.md for the company's actual technology:
Check for:
If tech stack is found: Match the prototype to the company's stack so engineering can more easily adopt it.
If no tech stack found: Use sensible defaults (React + TypeScript + Tailwind for UI, FastAPI for backend, Next.js for full-stack) and note: "No company tech stack found in context. Using industry-standard defaults. Engineering should adapt to your actual stack."
What changes:
README.md with setup instructions (npm install && npm run dev or equivalent)// Reference prototype - not production code. Share with engineering as a starting point.Output: Save all files to outputs/prototypes/[feature]-reference-impl/
When presenting to PM:
"No codebase detected, so I built a standalone reference prototype using [stack]. This is not production code -- share it with engineering as a starting point for the real implementation. They should adapt it to your actual codebase patterns, auth system, and infrastructure."
For UI features, include basic accessibility in all generated code:
Required accessibility patterns:
<nav>, <main>, <section>, <button>)outline)aria-describedbyCheck stakeholder profiles for additional accessibility requirements (e.g., WCAG AAA, specific assistive technology support).
In code comments:
// a11y: Label describes the action for screen readers
<button aria-label="Save user preferences">Save</button>
// a11y: Error message linked to input for screen readers
<input aria-describedby="email-error" />
<span id="email-error" role="alert">Please enter a valid email</span>
Generate tests using the detected testing framework. If no testing framework is detected, default to the standard for the stack (Jest for React/Node, Pytest for Python, Vitest for Vite-based projects).
Minimum test coverage:
Target: 80% coverage of new code. Always include test data fixtures.
Test file naming:
[feature].test.ts for unit tests[feature].integration.test.ts for integration tests__fixtures__/[feature]-data.ts for test dataIn the summary document, report:
## Testing
**Framework:** [Jest/Vitest/Pytest]
**Tests written:** [X] unit, [Y] integration, [Z] edge case
**Coverage:** [%] (of new code)
**All passing:** [Yes/No]
**Manual testing needed:** [List specific flows to test manually]
Before:
/prd-draft - Define feature/prototype - Validate UX firstAfter:
/ralph-wiggum - If needs autonomous iteration/launch-checklist - Prepare for launch/create-tickets - Track remaining workRelated:
/prd-review-panel - Get engineering reviewBefore delivering the first draft, verify:
outputs/prototypes/[feature]-first-draft.md, not outputs/development/If any check fails, fix it before delivering. A first draft with failing tests or missing accessibility is not ready to share.
development
Product strategy docs using 7-component framework
tools
Review week's progress, meetings, learnings
tools
Set next week's priorities
development
Turn user interviews into actionable insights. Advanced synthesis techniques and frameworks.