Agent skill
add-feature
Add new feature with full validation in isolated worktree
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/add-feature
SKILL.md
Add Feature: $ARGUMENTS
Create a complete new feature with component, tests, and integration.
Process
1. Create Isolated Worktree
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
WORKTREE_PATH="../add-feature-$ARGUMENTS-$TIMESTAMP"
git worktree add "$WORKTREE_PATH" -b "feature-$ARGUMENTS-$TIMESTAMP"
cd "$WORKTREE_PATH"
2. Create Feature Files
Generate based on feature name (convert to PascalCase for component):
components/[FeatureName].tsx- Main React component withdata-testidcomponents/[FeatureName].test.tsx- Unit tests (happy path, edge cases, errors)tests/e2e/[feature-name].spec.ts- E2E tests with Playwright- Update
types/index.tsif new types needed
3. Integrate into App
- Import and add component to appropriate page/layout
- Wire up props and event handlers
4. Validate
Run in order, collect all errors:
npm run build
npm run lint
npm test
npm run test:e2e
5. Report and Prompt
On success: Show summary, prompt to merge or keep for review On failure: Categorize errors (build/lint/test), provide remediation steps
6. Cleanup
If merging:
git checkout main
git merge "feature-$ARGUMENTS-$TIMESTAMP"
git worktree remove "$WORKTREE_PATH"
Component Template
'use client';
import { useState } from 'react';
interface FeatureNameProps {
// props
}
export default function FeatureName({}: FeatureNameProps) {
return (
<div data-testid="feature-name">
{/* content */}
</div>
);
}
Test Patterns
- Use
data-testidfor selectors - Test: rendering, user interactions, props, edge cases, accessibility
- Clear localStorage in E2E beforeEach
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?