Back to Skills

dashboard-create-screen

verified

Create a new screen in the Multi-site Dashboard with automatic route registration

View on GitHub

Repository
Verified Org

Automattic/wp-calypso
12.6kstars

.claude/skills/dashboard-create-screen/SKILL.md

Last Verified

January 16, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/Automattic/wp-calypso/blob/b81186e65d5cfb528db3d2f1a5f2d43d2789e94e/.claude/skills/dashboard-create-screen/SKILL.md -a claude-code --skill dashboard-create-screen

Installation paths:

Claude
.claude/skills/dashboard-create-screen/
Powered by add-skill CLI

Instructions

# Dashboard Create Screen Skill

Creates new screens in `client/dashboard` with automatic route discovery and registration.

## Step 1: Discover Available Routes

First, find all router files and extract available routes.

### Find Router Files

Use Glob to discover router files:
```
client/dashboard/app/router/*.tsx
client/dashboard/app/router/*.ts
```

### Extract Routes from Each File

For each router file, use Grep to extract route information.

**Find exported route constants:**
```regex
export\s+const\s+(\w+Route)\s*=\s*createRoute
```

**Extract parent relationships:**
```regex
getParentRoute:\s*\(\)\s*=>\s*(\w+Route)
```

**Extract path segments:**
```regex
path:\s*['"]([^'"]+)['"]
```

**Extract component import paths:**
```regex
import\(\s*['"]([^'"]+)['"]\s*\)
```

### Build Route Information

For each discovered route, record:
- Route variable name (e.g., `siteBackupsRoute`)
- Parent route name (e.g., `siteRoute`)
- Path segment (e.g., `'backups'`)
- Source file path
- Component directory (derived from import path)

## Step 2: Discover Navigation Menus (After Route Selection)

Menu discovery happens after the user selects a parent route. Find menus relative to the route's location.

### Determine Menu Search Path

Based on the selected parent route's import path, determine where to search for menus:

1. Extract the component directory from the parent route's lazy import
   - Example: `import('../../sites/backups')` → search in `client/dashboard/sites/`
   - Example: `import('../../me/profile')` → search in `client/dashboard/me/`

2. Use Glob to find menu files in that area:
   ```
   client/dashboard/{area}/**/*-menu/index.tsx
   ```

3. Also check the app-level menu for top-level routes:
   ```
   client/dashboard/app/*-menu/index.tsx
   ```

### Extract Menu Information

For each discovered menu file, use Grep to find:

**Existing menu items pattern:**
```regex
<ResponsiveMenu\.Item\s+to=
```

**Route references in menu:**
```regex
to=\{?\s*[`'"/]([^`'

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
6514 chars