Power Add Invoker
Powerful command for setup, comprehensive, application, performance. Includes structured workflows, validation checks, and reusable patterns for performance.
Power Add Invoker
Invoke intelligent addition of new code components, dependencies, configurations, or infrastructure elements into existing projects with automatic integration wiring.
When to Use This Command
Run this command when...
- You need to add a new service, controller, model, or component that integrates with existing architecture
- A new dependency or library needs to be installed and properly configured across the project
- You want to add a new API endpoint with all required layers: route, controller, service, and tests
- Infrastructure elements like database tables, queues, or cache configurations need to be added
- You need to scaffold a new module following the exact patterns already established in the codebase
Quick Start
# .claude/commands/power-add-invoker.md --- name: Power Add Invoker description: Add new components with automatic integration and wiring command: true --- Add to project: $ARGUMENTS 1. Analyze what needs to be added and where it fits 2. Scan existing patterns for naming and structure conventions 3. Create the new element following project conventions 4. Wire it into existing infrastructure (routes, DI, config) 5. Generate corresponding tests
# Invoke the command claude "/power-add-invoker new PaymentService with Stripe integration" # Expected output # > Analyzing project structure... # > Detected patterns: layered architecture, repository pattern, Jest testing # > Creating: # > src/services/PaymentService.ts (service layer) # > src/controllers/PaymentController.ts (API layer) # > src/routes/payment.routes.ts (routing) # > src/repositories/PaymentRepository.ts (data layer) # > src/types/payment.ts (type definitions) # > Wiring: # > Added route registration in src/app.ts # > Added Stripe config to src/config/services.ts # > Tests: # > tests/services/PaymentService.test.ts (8 test cases) # > Addition complete: 5 files created, 2 files modified
Core Concepts
| Concept | Description |
|---|---|
| Pattern Detection | Scans existing code to learn naming, structure, and architectural conventions |
| Full-Stack Scaffolding | Creates all layers needed for the addition: types, service, controller, routes, tests |
| Auto-Wiring | Registers new components in routers, dependency injection containers, and config files |
| Convention Matching | New code matches existing style: error handling, logging, response formatting |
| Integration Testing | Generates tests that verify the new component works within the existing system |
Power Add Pipeline
===================
What to Add --> Analyze Project --> Detect Patterns --> Scaffold
| | | |
Parse request Read structure Learn naming Create files
Identify type Map layers conventions per layer
Find target Find wiring pts Match style Follow patterns
|
Test <-- Wire <---+
| |
Generate Register in
test cases routes, DI,
config
Configuration
| Parameter | Description | Default | Example | Required |
|---|---|---|---|---|
$ARGUMENTS | What to add with context and requirements | none | "new EmailService with SendGrid" | Yes |
layers | Which layers to generate | all detected | "service,controller" | No |
skip_tests | Skip test file generation | false | true | No |
wire_only | Only add wiring for an existing component | false | true | No |
template_source | Specific existing file to use as template | auto-detect | "src/services/UserService.ts" | No |
Best Practices
-
Name components explicitly -- "Add PaymentService" is better than "add payment handling." Clear names let the invoker scaffold files with correct naming from the start.
-
Reference existing components as templates -- Use
template_sourceto point at a well-structured existing service when you want the new addition to exactly match a specific pattern. -
Review auto-wiring changes -- The invoker modifies existing files to register new components. Review these modifications carefully, especially in route files and dependency injection containers.
-
Add one component at a time -- Adding multiple unrelated services in a single invocation can lead to tangled wiring. Add sequentially and verify each integration before proceeding.
-
Check for naming conflicts before adding -- If a PaymentService already exists, the invoker may overwrite or conflict. Search first to ensure the name is available.
Common Issues
Wrong pattern detected: In codebases with mixed architectures, the invoker may scaffold using patterns from a different module. Specify template_source to force the correct pattern.
Auto-wiring misses registration points: Some projects register routes or services in non-standard locations. If the new component is not accessible after creation, manually check the wiring entry points.
Generated tests use unavailable mocking strategy: The test generator follows detected testing patterns, but complex mocking setups may not be fully replicated. Review generated test files and adjust mock configurations as needed.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.