Back to skills
SKILL.md
Smart Routing
ASecurity--- name: smart-routing description: Intelligently route files, requests, and tasks to appropriate handlers ---
- 33 stars
- 0 votes
- 0 copies
- 2 views
- Added February 10, 2026
Works with
Security analysis
100/100npx -y skills add lovedragonball/power-ranger-toolkit --skill smart-routing --agent claude-codeAre you the author of Smart Routing?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/lovedragonball-smart-routing)# π€οΈ Smart Routing Skill
---
name: smart-routing
description: Intelligently route files, requests, and tasks to appropriate handlers
---
## π― Purpose
Automatically determine the best location, handler, or approach for files, requests, and tasks.
## π When to Use
- Creating new files
- Organizing codebase
- Routing API requests
- Assigning tasks to agents
## ποΈ File Routing
### By File Type
| Extension | Location | Purpose |
|-----------|----------|---------|
| `.tsx`, `.jsx` | `src/components/` | React components |
| `.ts`, `.js` | `src/utils/` | Utility functions |
| `.css`, `.scss` | `src/styles/` | Stylesheets |
| `.test.ts` | Same dir as source | Tests |
| `.md` | `docs/` | Documentation |
| `.json` | `config/` or root | Configuration |
### By Purpose
| Purpose | Location |
|---------|----------|
| Page component | `src/pages/` or `app/` |
| Shared component | `src/components/` |
| API route | `src/api/` or `app/api/` |
| Hook | `src/hooks/` |
| Context | `src/contexts/` |
| Type definitions | `src/types/` |
| Constants | `src/constants/` |
## π Request Routing
### API Patterns
```javascript
// RESTful routing
GET /api/users β List users
GET /api/users/:id β Get user
POST /api/users β Create user
PUT /api/users/:id β Update user
DELETE /api/users/:id β Delete user
```
### Route Naming
```javascript
// Naming conventions
/api/v1/resource // Versioned API
/api/resource/:id/subresource // Nested resource
/api/resource?filter=value // Query params
```
## π€ Task Routing
### To Appropriate Skill
| Task Type | Route To |
|-----------|----------|
| Bug fix | `debugging` |
| New feature | `code-generation` |
| UI work | `design-mastery` |
| Testing | `testing` |
| Deployment | `deployment` |
| Security | `security-audit` |
### By Complexity
| Complexity | Approach |
|------------|----------|
| Simple | Direct implementation |
| Medium | Plan then implement |
| Complex | Design doc β Review β Implement |
## π Project Structure Templates
### Web App (Vite/React)
```
src/
βββ components/ β UI components
βββ pages/ β Page components
βββ hooks/ β Custom hooks
βββ utils/ β Helper functions
βββ services/ β API calls
βββ stores/ β State management
βββ types/ β TypeScript types
βββ assets/ β Static assets
```
### Next.js App Router
```
app/
βββ (auth)/ β Auth routes group
βββ api/ β API routes
βββ dashboard/ β Dashboard pages
βββ layout.tsx β Root layout
βββ page.tsx β Home page
```
## π§ Routing Logic
```javascript
function routeFile(filename, purpose) {
// By extension
if (filename.endsWith('.test.ts')) {
return 'alongside source';
}
// By purpose
const routes = {
'component': 'src/components/',
'page': 'src/pages/',
'hook': 'src/hooks/',
'util': 'src/utils/',
'type': 'src/types/',
'api': 'src/api/'
};
return routes[purpose] || 'src/';
}
```
## π‘ Best Practices
1. **Consistent naming**: Use same pattern throughout
2. **Group by feature**: When project grows
3. **Flat when possible**: Avoid deep nesting
4. **Co-locate related**: Tests near source
5. **Clear boundaries**: Separate concerns
## π Related Skills
- `project-setup` - Initial structure
- `refactoring` - Reorganize existing code
- `documentation` - Document routing decisions
Attribution
Comments
Loading commentsβ¦