AP

app-architecture

Provides architectural guidance for the GROWI application, focusing on feature-based organization and Next.js/Express patterns.

Install

mkdir -p .claude/skills/app-architecture && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4205" && unzip -o skill.zip -d .claude/skills/app-architecture && rm skill.zip

Installs to .claude/skills/app-architecture

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

GROWI main application (apps/app) architecture, directory structure, and design patterns. Auto-invoked when working in apps/app.
128 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Organize code by business features in the apps/app directory
  • Define interfaces for new features in a dedicated directory
  • Implement server-side logic within feature modules
  • Implement client-side logic within feature modules
  • Export public APIs for feature modules
  • Manage UI state with Jotai and server data with SWR

How it works

The skill describes a feature-based architecture for a full-stack Next.js application, guiding code organization into feature modules with separate server and client components, and specifying state management tools.

Inputs & outputs

You give it
New feature requirements or existing legacy code for refactoring
You get back
Structured feature modules with separated server and client logic, or migrated legacy code

When to use app-architecture

  • Create a new feature module
  • Understand where to place new server routes
  • Locate client components and Jotai states
  • Reference architecture for refactoring legacy code

About this skill

App Architecture (apps/app)

The main GROWI application is a full-stack Next.js application with Express.js backend and MongoDB database.

For technology stack details, see the global tech-stack skill.

Directory Structure

apps/app/src/
├── pages/                 # Next.js Pages Router (*.page.tsx)
├── features/             # Feature modules (recommended for new code)
│   └── {feature-name}/
│       ├── index.ts      # Public exports
│       ├── interfaces/   # TypeScript types
│       ├── server/       # models/, routes/, services/
│       └── client/       # components/, states/, hooks/
├── server/               # Express server (legacy)
│   ├── models/           # Mongoose models
│   ├── routes/apiv3/     # RESTful API v3
│   └── services/         # Business logic
├── components/           # React components (legacy)
├── states/               # Jotai atoms
└── stores-universal/     # SWR hooks

Feature-Based Architecture

Organize code by business feature rather than by technical layer:

❌ Layer-based (old):          ✅ Feature-based (new):
├── models/User.ts             ├── features/user/
├── routes/user.ts             │   ├── server/models/User.ts
├── components/UserList.tsx    │   ├── server/routes/user.ts
                               │   └── client/components/UserList.tsx

Creating a New Feature

  1. Create features/{feature-name}/
  2. Define interfaces in interfaces/
  3. Implement server logic in server/ (models, routes, services)
  4. Implement client logic in client/ (components, hooks, states)
  5. Export public API through index.ts

Entry Points

  • Server: server/app.ts - Express + Next.js initialization
  • Client: pages/_app.page.tsx - Jotai + SWR providers
  • Wiki Pages: pages/[[...path]]/index.page.tsx - Catch-all route (SSR)

API Design (RESTful API v3)

Routes in server/routes/apiv3/ with OpenAPI specs:

/**
 * @openapi
 * /api/v3/pages/{id}:
 *   get:
 *     summary: Get page by ID
 */
router.get('/pages/:id', async (req, res) => {
  const page = await PageService.findById(req.params.id);
  res.json(page);
});

State Management

  • Jotai: UI state (modals, forms) in states/
  • SWR: Server data (pages, users) in stores-universal/

For detailed patterns, see app-specific-patterns skill.

Design Principles

  1. Feature Isolation: New features self-contained in features/
  2. Server-Client Separation: Prevent server code bundled into client
  3. API-First: Define OpenAPI specs before implementation
  4. Type-Driven: Define interfaces before implementation
  5. Progressive Migration: Gradually move legacy code to features/

Legacy Migration

Legacy directories (components/, server/models/, client/) should be gradually migrated to features/:

  • New features → features/
  • Bug fixes → Can stay in legacy
  • Refactoring → Move to features/

Summary

  1. New features: features/{feature-name}/ structure
  2. Server-client separation: Keep separate
  3. API-first: OpenAPI specs for API v3
  4. State: Jotai (UI) + SWR (server data)
  5. Progressive migration: No rush for stable legacy code

Limitations

  • Legacy directories should be gradually migrated to features/
  • Bug fixes can remain in legacy code

How it compares

This skill promotes a feature-based code organization over a layer-based approach, enhancing modularity and maintainability for the GROWI application.

Compared to similar skills

app-architecture side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
app-architecture (this skill)46moNo flagsIntermediate
senior-fullstack357moReviewIntermediate
app-builder166moNo flagsBeginner
templates46moNo flagsBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry