claudegoodies
Command

composables

From davila7

Create Vue composables for $ARGUMENTS following project conventions.

Install

/composables

Facts

Status
Actively maintained
Last commit

Source preview

The instructions Claude Code reads when this command runs.

# Vue Composables

Create Vue composables for $ARGUMENTS following project conventions.

## Task

Create or optimize Vue composables based on the requirements:

1. **Analyze existing composables**: Check project for existing composable patterns, naming conventions, and file organization
2. **Examine Vue setup**: Verify Vue 3 Composition API usage and TypeScript configuration
3. **Identify composable type**: Determine the composable category:
   - State management (reactive data, computed properties)
   - API/HTTP operations (data fetching, mutations)
   - DOM interactions (event listeners, element refs)
   - Utility functions (validation, formatting, storage)
   - Lifecycle management (cleanup, watchers)
4. **Check dependencies**: Review existing composables to avoid duplication
5. **Implement composable**: Create composable with proper TypeScript types and reactivity
6. **Add lifecycle management**: Include proper cleanup with onUnmounted when needed
7. **Create tests**: Write comprehensive unit tests for composable logic
8. **Add documentation**: Include JSDoc comments and usage examples

## Implementation Requirements

- Follow project's TypeScript conventions and interfaces
- Use appropriate Vue reactivity APIs (ref, reactive, computed, watch)
- Include proper error handling and loading states
- Add cleanup for side effects (event listeners, timers, subscriptions)
- Make co
View full source on GitHub →

Other slash commands