Generates boilerplate code following loaded rules. Creates new components, modules, APIs, and features that automatically comply with your coding standards. Extracts patterns from rules and applies them consistently.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Generates boilerplate code following loaded rules. Creates new components, modules, APIs, and features that automatically comply with your coding standards. Extracts patterns from rules and applies them consistently.
allowed-tools
read, write, glob, search, codebase_search
version
2
best_practices
["Identify target framework from manifest.yaml","Extract patterns from relevant rule files","Generate complete file structure (types, tests, etc.)","Follow project naming conventions","Include proper imports and exports"]
Rule-Aware Scaffolder - Creates new code that automatically adheres to your project's coding standards.
- Creating new React/Vue/Angular components
- Adding new API endpoints or routes
- Setting up new modules or packages
- Generating test files for existing code
- Creating data models or database schemas
- Bootstrapping feature directories
Step 1: Load Rule Index
Load the rule index to discover relevant rules dynamically:
@.claude/context/rule-index.json
Step 2: Identify Target Framework and Query Index
Determine which technologies apply based on what you're scaffolding:
// E2E test (per cypress-e2e-testing-*.mdc)describe('User Flow', () => {
// Setup before tests (per cypress best practices)beforeEach(() => {
// Reset state and seed data
cy.task('db:seed')
cy.visit('/')
})
// Critical user flow (per cypress-e2e-testing guidelines)it('allows user to sign up, login, and view profile', () => {
// Use data-testid selectors (per cypress best practices)
cy.get('[data-testid="signup-link"]').click()
// Fill signup form
cy.get('[data-testid="email-input"]').type('test@example.com')
cy.get('[data-testid="password-input"]').type('SecurePass123!')
cy.get('[data-testid="name-input"]').type('Test User')
cy.get('[data-testid="signup-submit"]').click()
// Verify redirect to dashboard
cy.url().should('include', '/dashboard')
// Navigate to profile
cy.get('[data-testid="profile-link"]').click()
// Verify profile data
cy.get('[data-testid="profile-name"]').should('contain', 'Test User')
cy.get('[data-testid="profile-email"]').should('contain', 'test@example.com')
})
// API mocking example (per cypress-api-testing guidelines)it('handles API errors gracefully', () => {
// Mock API failure
cy.intercept('GET', '/api/users/*', {
statusCode: 500,
body: { error: 'Internal server error' },
}).as('getUserError')
cy.visit('/profile')
// Wait for mocked request
cy.wait('@getUserError')
// Verify error handling
cy.get('[data-testid="error-message"]')
.should('be.visible')
.and('contain', 'Failed to load profile')
// Verify retry option
cy.get('[data-testid="retry-button"]').should('be.visible')
})
})
</code_example>
<usage_example>
Quick Commands:
# Generate a Server Component
/scaffold component MyComponent
# Generate a Client Component
/scaffold client-component MyInteractiveWidget
# Generate an API route
/scaffold api resource-name
# Generate a FastAPI router
/scaffold fastapi-route resource-name
# Generate test for existing file
/scaffold test path/to/component
# Generate E2E test
/scaffold e2e-test flow-name
# Generate with specific rules
/scaffold component MyComponent --rules nextjs,typescript
# Generate in specific location
/scaffold component MyComponent --path src/features/auth
# List available scaffold templates
/scaffold --list