cloudwerk-routing

SKILL.md

Cloudwerk Routing

File-based routing conventions for Cloudwerk. The app/ directory structure maps directly to URL patterns, with special filenames determining behavior.

When to Apply

Reference these guidelines when:

  • Creating new pages or API routes in a Cloudwerk app
  • Adding layouts that wrap multiple pages
  • Implementing middleware for auth, rate limiting, or request processing
  • Using dynamic route segments ([id], [...slug])
  • Loading data with loader() or handling mutations with action()
  • Adding error or not-found boundaries

Rule Categories by Priority

Priority Category Impact Prefix
1 Route Files CRITICAL files-
2 Dynamic Parameters HIGH params-
3 Data Loading HIGH data-

Quick Reference

1. Route Files (CRITICAL)

  • files-page-component - page.tsx conventions for rendering UI
  • files-api-route - route.ts conventions for API endpoints
  • files-layout - layout.tsx conventions for shared UI wrappers
  • files-middleware - middleware.ts conventions for request processing
  • files-error-boundary - error.tsx conventions for error handling
  • files-not-found-boundary - not-found.tsx conventions for 404 pages

2. Dynamic Parameters (HIGH)

  • params-dynamic-segments - [id] syntax for single dynamic segments
  • params-catch-all - [...slug] syntax for catch-all routes
  • params-route-groups - (group) syntax for layout grouping without URL impact

3. Data Loading (HIGH)

  • data-loader - loader() function for server-side data fetching
  • data-action - action() function for form submissions and mutations
  • data-error-control-flow - NotFoundError/RedirectError for flow control
  • data-context-api - getContext(), get(), set() for request-scoped data

How to Use

Read individual rule files for detailed explanations and code examples:

rules/files-page-component.md
rules/data-loader.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references
Weekly Installs
6
First Seen
Feb 22, 2026
Installed on
opencode6
claude-code6
github-copilot6
codex6
kimi-cli6
gemini-cli6