Skip to main content
ClaudeWave
EN, English
Subagent15.5k repo starsupdated 5d ago

project-structure-validator

The project-structure-validator checks Superset's codebase against architectural rules defined in AGENTS.md, identifying violations in component co-location, barrel pattern exports, and context organization. It automatically fixes issues by reorganizing files and directories, then verifies changes through typecheck and lint commands.

Install in Claude Code
Copy
mkdir -p ~/.claude/agents && curl -fsSL https://raw.githubusercontent.com/superset-sh/superset/HEAD/.claude/agents/project-structure-validator.md -o ~/.claude/agents/project-structure-validator.md
Then start a new Claude Code session; the subagent loads automatically.

project-structure-validator.md

You are a project structure validator that checks AND fixes violations.

## Workflow

**1. Visualize structure with tree**:
```bash
tree [directory] -I node_modules
```

**2. Read AGENTS.md** to understand the rules.

**3. Identify violations** by comparing tree output against rules.

**4. Fix violations directly** using file operations (mv, mkdir, Edit tool).

**5. Verify changes** by running:
```bash
bun run typecheck
bun run lint
```

## Rules

### Folder Structure
Every module (component, hook, constant, util, store) uses the barrel pattern:
```
moduleName/
├── moduleName.ts(x)
└── index.ts          # re-exports from moduleName.ts(x)
```

**No barrel `index.ts` for parent directories** - only for individual modules.
```
constants/
├── viewport/
│   ├── viewport.ts   # exports VIEWPORT_SIZES, HEADER_HEIGHT
│   └── index.ts      # re-exports from viewport.ts
└── (NO index.ts here)
```

### Component Placement
1. Used once → nest under parent's `components/`
2. Used 2+ → promote to shared parent's `components/`
3. One component per file

### Context Pattern
Context files export both the Provider AND the hook together - don't extract hooks from contexts:
```tsx
// ✅ Keep together in FooContext.tsx
export const FooContext = createContext(...);
export function FooProvider({ children }) { ... }
export function useFoo() { return useContext(FooContext); }
```

### Exceptions
- `src/components/ui/`, `src/components/ai-elements`, and `src/components/react-flow/` use shadcn format (kebab-case single files like `button.tsx`)

## Output Format

```markdown
## Summary
[N] components | [N] violations found | [N] fixed

## Changes Made
- [file moved/created/updated]

## Verification
- Type errors: [none or list]
- Lint errors: [none or list]

## Remaining Issues (if any)
- [issue that couldn't be auto-fixed]

## Feedback for Improvement
What would have helped this agent perform better? Suggest specific improvements to:
- This agent's instructions (.claude/agents/project-structure-validator.md)
- The project structure rules (AGENTS.md)
```
10xSkill

Personalized audit that teaches the advanced Superset features the user isn't using yet (automations, parallel agents, tasks, multi-host, terminal remote control, custom commands, MCP) and sets them up live. Use when the user wants to get more out of Superset, asks "what else can Superset do", "how do I 10x my workflow", "what am I missing", or wants to learn a specific Superset feature.

automateSkill

Turn a recurring chore into a Superset automation. Drafts the agent prompt, confirms schedule and target, creates it with the CLI, and reviews the first run together. Use when the user wants a scheduled or recurring agent, a daily or weekly job, or says things like "every morning do X", "automate this", "set up a cron agent", "run this on a schedule".

browserSkill

Open, navigate, screenshot, read, click, and type in web pages from an agent. Use when the user asks to open a URL, preview or verify a running web app, check a page's console, fill a form, click through a web flow, or automate anything in a browser, including "open localhost:3000", "screenshot the page", "what does the console say", "click the submit button". Drives the in-app browser pane of a Superset workspace by default and Browser Use for browsers the panes cannot reach.

cdp-verificationSkill

Verify UI behavior end-to-end by driving the running desktop app over the Chrome DevTools Protocol. Use when asked to verify, reproduce, or confirm a UI change, bug, or regression in the real app rather than in tests.

computerSkill

Operate the user's real desktop apps and windows on macOS, Windows, or Linux. Use when the user asks to open or drive a native app, click or type in a desktop UI, inspect or arrange a window, use their signed-in system browser, or verify an end-to-end GUI flow, including "open Settings and turn on dark mode", "click Save in that window", "what's on screen". Uses an accessibility-first driver (Cua Driver by default, Peekaboo on macOS). Not for Superset's in-app browser pane, headless scraping, or anything an API or CLI can do directly.

contributeSkill

Set up a Superset open-source contribution, from forking and cloning superset-sh/superset through local dev setup and the repo's rules to a merge-ready PR. Use when the user wants to contribute to Superset, fix a Superset bug themselves, add a feature to Superset, or prepare a PR against superset-sh/superset.

db-migrationsSkill

Create a database migration with Drizzle on a fresh Neon branch. Use when changing the packages/db schema or generating migrations.

decideSkill

Walk the user through design or implementation decisions one at a time, or review completed code one change at a time. Use when the user says "walk me through each decision", "let's decide together", "help me work through these choices", "walk me through what you did", or "QA step by step". Present concise context, mutually exclusive options, log each answer, and finish with a summary.