architect-nextjs

Establish the architecture for Next.js 15+ applications using the Scope Rule and Screaming Architecture. Use this skill when (1) Setting up a new project, (2) Deciding component placement (local vs shared), (3) Refactoring codebases, or (4) implementing Server Actions, layouts, and route groups.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "architect-nextjs" with this command: npx skills add ivantsxx/my-next-skills/ivantsxx-my-next-skills-architect-nextjs

Scope Rule Architect (Next.js 15+)

This skill establishes the architectural foundation for scalable Next.js applications by enforcing strict Scope Rules and Screaming Architecture.

Core Principles

1. The Scope Rule (Absolute Law)

"Scope determines structure."

  • Local Scope: Code used by 1 feature → MUST stay local (e.g., (user)/profile/_components).
  • Shared Scope: Code used by 2+ features → MUST go to src/shared/.
  • No Exceptions: Do not pollute shared with single-use components.

2. Screaming Architecture

Directory structures must immediately declare what the application does.

  • Use Route Groups (feature) for top-level modules.
  • Avoid generic folders like containers or views at the top level.

3. Next.js 15 Standards

  • App Router Only: No pages/ directory.
  • Server-First: Components are Server Components by default.
  • Data Access: Fetch directly in Server Components or via Server Actions.

Decision Framework

When placing files, follow this decision tree:

  1. Count Usage:

    • Used by 1 Feature: Place in app/(feature)/_components/.
    • Used by 2+ Features: Place in src/shared/components/.
  2. Determine Type:

    • Server Component: Default. Used for static content and initial data fetching.
    • Client Component: Use ONLY for useState, useEffect, or event listeners.
    • Server Action: Use for mutations and form handling. Place in _actions/name.ts.

Implementation Guides

Project Structure

For the standard directory layout, reference the Project Structure Template.
Use this reference when setting up new folders or verifying where a specific file should reside.

Component Templates

For code patterns ensuring best practices, reference the Component Templates.
This includes:

  • Server Components with Suspense and data fetching.
  • Client Components isolated for interactivity.
  • Server Actions properly typed and validated.

Quality Checklist

Before finalizing a structure or file creation:

  1. Scope: Is this used in >1 feature? If no, move to _components.
  2. Server: Is "use client" absolutely necessary? Can it be pushed down the tree?
  3. Screaming: Does the folder name describe what it does (e.g., (invoices) vs pages)?
  4. Colocation: Are specific hooks/types/styles next to the consuming component?

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated
Coding

clawhub-rate-limited-publisher

Queue and publish local skills to ClawHub with a strict 5-per-hour cap using the local clawhub CLI and host scheduler.

Archived SourceRecently Updated