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.zipInstalls 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.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
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
- Create
features/{feature-name}/ - Define interfaces in
interfaces/ - Implement server logic in
server/(models, routes, services) - Implement client logic in
client/(components, hooks, states) - 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
- Feature Isolation: New features self-contained in
features/ - Server-Client Separation: Prevent server code bundled into client
- API-First: Define OpenAPI specs before implementation
- Type-Driven: Define interfaces before implementation
- 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
- New features:
features/{feature-name}/structure - Server-client separation: Keep separate
- API-first: OpenAPI specs for API v3
- State: Jotai (UI) + SWR (server data)
- 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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| app-architecture (this skill) | 4 | 6mo | No flags | Intermediate |
| senior-fullstack | 35 | 7mo | Review | Intermediate |
| app-builder | 16 | 6mo | No flags | Beginner |
| templates | 4 | 6mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by growilabs
View all by growilabs →You might also like
senior-fullstack
davila7
Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects, analyzing code quality, implementing design patterns, or setting up development workflows.
app-builder
davila7
Main application building orchestrator. Creates full-stack applications from natural language requests. Determines project type, selects tech stack, coordinates agents.
templates
davila7
Project scaffolding templates for new applications. Use when creating new projects from scratch. Contains 12 templates for various tech stacks.
nx-generate
nrwl
Generate code using nx generators. USE WHEN scaffolding code or transforming existing code - for example creating libraries or applications, or anything else that is boilerplate code or automates repetitive tasks. ALWAYS use this first when generating code with Nx instead of calling MCP tools or running nx generate immediately.
effect-patterns-project-setup--execution
PaulJPhilp
Effect-TS patterns for Project Setup Execution. Use when working with project setup execution in Effect-TS applications.
monorepo-structure
dadbodgeoff
Set up a Turborepo + pnpm monorepo for sharing code between frontend, backend, and workers. One repo, multiple packages, shared types, parallel builds.