achira-wf 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.achira/ARCHITECTURE.md +296 -0
- package/.achira/core/agents/backend-specialist.md +263 -0
- package/.achira/core/agents/code-archaeologist.md +106 -0
- package/.achira/core/agents/database-architect.md +226 -0
- package/.achira/core/agents/debugger.md +225 -0
- package/.achira/core/agents/devops-engineer.md +242 -0
- package/.achira/core/agents/documentation-writer.md +104 -0
- package/.achira/core/agents/explorer-agent.md +73 -0
- package/.achira/core/agents/frontend-specialist.md +593 -0
- package/.achira/core/agents/game-developer.md +162 -0
- package/.achira/core/agents/mobile-developer.md +377 -0
- package/.achira/core/agents/orchestrator.md +416 -0
- package/.achira/core/agents/penetration-tester.md +188 -0
- package/.achira/core/agents/performance-optimizer.md +187 -0
- package/.achira/core/agents/product-manager.md +112 -0
- package/.achira/core/agents/product-owner.md +95 -0
- package/.achira/core/agents/project-planner.md +413 -0
- package/.achira/core/agents/qa-automation-engineer.md +103 -0
- package/.achira/core/agents/security-auditor.md +170 -0
- package/.achira/core/agents/seo-specialist.md +111 -0
- package/.achira/core/agents/test-engineer.md +158 -0
- package/.achira/core/mcp_config.json +24 -0
- package/.achira/core/shared/ui-ux-pro-max/data/charts.csv +26 -0
- package/.achira/core/shared/ui-ux-pro-max/data/colors.csv +97 -0
- package/.achira/core/shared/ui-ux-pro-max/data/icons.csv +101 -0
- package/.achira/core/shared/ui-ux-pro-max/data/landing.csv +31 -0
- package/.achira/core/shared/ui-ux-pro-max/data/products.csv +97 -0
- package/.achira/core/shared/ui-ux-pro-max/data/prompts.csv +24 -0
- package/.achira/core/shared/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.achira/core/shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.achira/core/shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.achira/core/shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.achira/core/shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.achira/core/shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.achira/core/shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.achira/core/shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.achira/core/shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.achira/core/shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.achira/core/shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.achira/core/shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.achira/core/shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.achira/core/shared/ui-ux-pro-max/data/styles.csv +59 -0
- package/.achira/core/shared/ui-ux-pro-max/data/typography.csv +58 -0
- package/.achira/core/shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.achira/core/shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.achira/core/shared/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.achira/core/shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
- package/.achira/core/shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
- package/.achira/core/shared/ui-ux-pro-max/scripts/__pycache__/generate_theme.cpython-314.pyc +0 -0
- package/.achira/core/shared/ui-ux-pro-max/scripts/core.py +258 -0
- package/.achira/core/shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.achira/core/shared/ui-ux-pro-max/scripts/generate_theme.py +99 -0
- package/.achira/core/shared/ui-ux-pro-max/scripts/search.py +106 -0
- package/.achira/core/skills/api-patterns/SKILL.md +81 -0
- package/.achira/core/skills/api-patterns/api-style.md +42 -0
- package/.achira/core/skills/api-patterns/auth.md +24 -0
- package/.achira/core/skills/api-patterns/documentation.md +26 -0
- package/.achira/core/skills/api-patterns/graphql.md +41 -0
- package/.achira/core/skills/api-patterns/rate-limiting.md +31 -0
- package/.achira/core/skills/api-patterns/response.md +37 -0
- package/.achira/core/skills/api-patterns/rest.md +40 -0
- package/.achira/core/skills/api-patterns/scripts/api_validator.py +211 -0
- package/.achira/core/skills/api-patterns/security-testing.md +122 -0
- package/.achira/core/skills/api-patterns/trpc.md +41 -0
- package/.achira/core/skills/api-patterns/versioning.md +22 -0
- package/.achira/core/skills/app-builder/SKILL.md +98 -0
- package/.achira/core/skills/app-builder/agent-coordination.md +71 -0
- package/.achira/core/skills/app-builder/feature-building.md +53 -0
- package/.achira/core/skills/app-builder/project-detection.md +34 -0
- package/.achira/core/skills/app-builder/scaffolding.md +118 -0
- package/.achira/core/skills/app-builder/tech-stack.md +40 -0
- package/.achira/core/skills/app-builder/templates/SKILL.md +39 -0
- package/.achira/core/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.achira/core/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.achira/core/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.achira/core/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.achira/core/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.achira/core/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.achira/core/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.achira/core/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/.achira/core/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/.achira/core/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/.achira/core/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/.achira/core/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/.achira/core/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/.achira/core/skills/architecture/SKILL.md +55 -0
- package/.achira/core/skills/architecture/context-discovery.md +43 -0
- package/.achira/core/skills/architecture/examples.md +94 -0
- package/.achira/core/skills/architecture/pattern-selection.md +68 -0
- package/.achira/core/skills/architecture/patterns-reference.md +50 -0
- package/.achira/core/skills/architecture/trade-off-analysis.md +77 -0
- package/.achira/core/skills/bash-linux/SKILL.md +199 -0
- package/.achira/core/skills/behavioral-modes/SKILL.md +242 -0
- package/.achira/core/skills/brainstorming/SKILL.md +163 -0
- package/.achira/core/skills/brainstorming/dynamic-questioning.md +350 -0
- package/.achira/core/skills/clean-code/SKILL.md +201 -0
- package/.achira/core/skills/code-review-checklist/SKILL.md +109 -0
- package/.achira/core/skills/database-design/SKILL.md +52 -0
- package/.achira/core/skills/database-design/database-selection.md +43 -0
- package/.achira/core/skills/database-design/indexing.md +39 -0
- package/.achira/core/skills/database-design/migrations.md +48 -0
- package/.achira/core/skills/database-design/optimization.md +36 -0
- package/.achira/core/skills/database-design/orm-selection.md +30 -0
- package/.achira/core/skills/database-design/schema-design.md +56 -0
- package/.achira/core/skills/database-design/scripts/schema_validator.py +172 -0
- package/.achira/core/skills/deployment-procedures/SKILL.md +241 -0
- package/.achira/core/skills/doc.md +177 -0
- package/.achira/core/skills/documentation-templates/SKILL.md +194 -0
- package/.achira/core/skills/frontend-design/SKILL.md +418 -0
- package/.achira/core/skills/frontend-design/animation-guide.md +331 -0
- package/.achira/core/skills/frontend-design/color-system.md +311 -0
- package/.achira/core/skills/frontend-design/decision-trees.md +418 -0
- package/.achira/core/skills/frontend-design/motion-graphics.md +306 -0
- package/.achira/core/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/.achira/core/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/.achira/core/skills/frontend-design/typography-system.md +345 -0
- package/.achira/core/skills/frontend-design/ux-psychology.md +1116 -0
- package/.achira/core/skills/frontend-design/visual-effects.md +383 -0
- package/.achira/core/skills/game-development/2d-games/SKILL.md +119 -0
- package/.achira/core/skills/game-development/3d-games/SKILL.md +135 -0
- package/.achira/core/skills/game-development/SKILL.md +167 -0
- package/.achira/core/skills/game-development/game-art/SKILL.md +185 -0
- package/.achira/core/skills/game-development/game-audio/SKILL.md +190 -0
- package/.achira/core/skills/game-development/game-design/SKILL.md +129 -0
- package/.achira/core/skills/game-development/mobile-games/SKILL.md +108 -0
- package/.achira/core/skills/game-development/multiplayer/SKILL.md +132 -0
- package/.achira/core/skills/game-development/pc-games/SKILL.md +144 -0
- package/.achira/core/skills/game-development/vr-ar/SKILL.md +123 -0
- package/.achira/core/skills/game-development/web-games/SKILL.md +150 -0
- package/.achira/core/skills/geo-fundamentals/SKILL.md +156 -0
- package/.achira/core/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/.achira/core/skills/i18n-localization/SKILL.md +154 -0
- package/.achira/core/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/.achira/core/skills/intelligent-routing/SKILL.md +335 -0
- package/.achira/core/skills/lint-and-validate/SKILL.md +45 -0
- package/.achira/core/skills/lint-and-validate/scripts/lint_runner.py +184 -0
- package/.achira/core/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/.achira/core/skills/mcp-builder/SKILL.md +176 -0
- package/.achira/core/skills/mobile-design/SKILL.md +394 -0
- package/.achira/core/skills/mobile-design/decision-trees.md +516 -0
- package/.achira/core/skills/mobile-design/mobile-backend.md +491 -0
- package/.achira/core/skills/mobile-design/mobile-color-system.md +420 -0
- package/.achira/core/skills/mobile-design/mobile-debugging.md +122 -0
- package/.achira/core/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/.achira/core/skills/mobile-design/mobile-navigation.md +458 -0
- package/.achira/core/skills/mobile-design/mobile-performance.md +767 -0
- package/.achira/core/skills/mobile-design/mobile-testing.md +356 -0
- package/.achira/core/skills/mobile-design/mobile-typography.md +433 -0
- package/.achira/core/skills/mobile-design/platform-android.md +666 -0
- package/.achira/core/skills/mobile-design/platform-ios.md +561 -0
- package/.achira/core/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/.achira/core/skills/mobile-design/touch-psychology.md +537 -0
- package/.achira/core/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
- package/.achira/core/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/.achira/core/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/.achira/core/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/.achira/core/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/.achira/core/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/.achira/core/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/.achira/core/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/.achira/core/skills/nextjs-react-expert/SKILL.md +286 -0
- package/.achira/core/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/.achira/core/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/.achira/core/skills/nodejs-best-practices/SKILL.md +333 -0
- package/.achira/core/skills/parallel-agents/SKILL.md +175 -0
- package/.achira/core/skills/performance-profiling/SKILL.md +143 -0
- package/.achira/core/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/.achira/core/skills/plan-writing/SKILL.md +152 -0
- package/.achira/core/skills/powershell-windows/SKILL.md +167 -0
- package/.achira/core/skills/project-setup/SKILL.md +291 -0
- package/.achira/core/skills/python-patterns/SKILL.md +441 -0
- package/.achira/core/skills/red-team-tactics/SKILL.md +199 -0
- package/.achira/core/skills/rust-pro/SKILL.md +176 -0
- package/.achira/core/skills/seo-fundamentals/SKILL.md +129 -0
- package/.achira/core/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/.achira/core/skills/server-management/SKILL.md +161 -0
- package/.achira/core/skills/systematic-debugging/SKILL.md +109 -0
- package/.achira/core/skills/tailwind-patterns/SKILL.md +269 -0
- package/.achira/core/skills/tdd-workflow/SKILL.md +149 -0
- package/.achira/core/skills/testing-patterns/SKILL.md +178 -0
- package/.achira/core/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/.achira/core/skills/vulnerability-scanner/SKILL.md +276 -0
- package/.achira/core/skills/vulnerability-scanner/checklists.md +121 -0
- package/.achira/core/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/.achira/core/skills/web-design-guidelines/SKILL.md +57 -0
- package/.achira/core/skills/webapp-testing/SKILL.md +187 -0
- package/.achira/core/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/.achira/rules/GEMINI.md +273 -0
- package/.achira/scripts/__pycache__/checklist.cpython-314.pyc +0 -0
- package/.achira/scripts/__pycache__/shared_utils.cpython-314.pyc +0 -0
- package/.achira/scripts/__pycache__/verify_all.cpython-314.pyc +0 -0
- package/.achira/scripts/auto_preview.py +148 -0
- package/.achira/scripts/checklist.py +193 -0
- package/.achira/scripts/session_manager.py +120 -0
- package/.achira/scripts/shared_utils.py +64 -0
- package/.achira/scripts/verify_all.py +304 -0
- package/.achira/workflows/brainstorm.md +113 -0
- package/.achira/workflows/create.md +59 -0
- package/.achira/workflows/debug.md +103 -0
- package/.achira/workflows/deploy.md +176 -0
- package/.achira/workflows/enhance.md +63 -0
- package/.achira/workflows/html+js+css.md +363 -0
- package/.achira/workflows/next.js.md +316 -0
- package/.achira/workflows/orchestrate.md +237 -0
- package/.achira/workflows/plan.md +89 -0
- package/.achira/workflows/preview.md +81 -0
- package/.achira/workflows/react+vite.md +280 -0
- package/.achira/workflows/registry.json +35 -0
- package/.achira/workflows/status.md +86 -0
- package/.achira/workflows/test.md +144 -0
- package/.achira/workflows/ui-ux-pro-max.md +296 -0
- package/.agent/workflows/brainstorm.md +113 -0
- package/.agent/workflows/create.md +59 -0
- package/.agent/workflows/debug.md +103 -0
- package/.agent/workflows/deploy.md +176 -0
- package/.agent/workflows/enhance.md +63 -0
- package/.agent/workflows/html+js+css.md +363 -0
- package/.agent/workflows/next.js.md +316 -0
- package/.agent/workflows/orchestrate.md +237 -0
- package/.agent/workflows/plan.md +89 -0
- package/.agent/workflows/preview.md +81 -0
- package/.agent/workflows/react+vite.md +280 -0
- package/.agent/workflows/status.md +86 -0
- package/.agent/workflows/test.md +144 -0
- package/.agent/workflows/ui-ux-pro-max.md +296 -0
- package/LICENSE +21 -0
- package/README.md +110 -0
- package/cli.js +293 -0
- package/package.json +48 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-setup
|
|
3
|
+
description: Universal architecture standards for all Achira web projects — covers html+js+css, react+vite, and next.js workflows.
|
|
4
|
+
version: 3.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 🏗️ Achira Project Standards
|
|
8
|
+
|
|
9
|
+
This skill is the **single source of truth** for how all Achira projects are structured. It applies to every workflow — `/html+js+css`, `/react+vite`, and `/next.js`.
|
|
10
|
+
|
|
11
|
+
**Read this before creating, moving, naming, or deleting any file.**
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 🗺️ Workflow Map
|
|
16
|
+
|
|
17
|
+
| Slash Command | Tech Stack | Ideal Use Case |
|
|
18
|
+
| -------------- | ----------------------- | --------------------------------------- |
|
|
19
|
+
| `/html+js+css` | Vanilla HTML + CSS + JS | Multi-page sites, lightweight, no-build |
|
|
20
|
+
| `/react+vite` | React + Vite + Router | SPAs, highly interactive client apps |
|
|
21
|
+
| `/next.js` | Next.js App Router + TS | Full-stack, SSR, SEO-heavy, SaaS |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 🌍 Universal Core Rules
|
|
26
|
+
|
|
27
|
+
These rules apply strictly across **all** workflows:
|
|
28
|
+
|
|
29
|
+
1. **No Inline Styles.** All CSS lives in dedicated `.css` files.
|
|
30
|
+
2. **No Inline Scripts.** All JS/TS lives in dedicated script or module files.
|
|
31
|
+
3. **Co-location is King.** One CSS file and one Test file per component/page. Naming mirrors the root file.
|
|
32
|
+
4. **CSS Variables Only.** Never hard-code colors, fonts, or spacing (`rem`/`px`) values.
|
|
33
|
+
5. **One-Way Logic Flow.** `View → Hook/Script → Service → API`. Never skip layers.
|
|
34
|
+
6. **Strict Env Handling.** Environment variables go in `.env`. Never access `process.env` or `import.meta.env` directly in components. Route them through a central `config.js` or `constants.ts` (ideally validated with Zod).
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 1️⃣ `/html+js+css` — Vanilla Structure
|
|
39
|
+
|
|
40
|
+
For lightweight, zero-build or minimal-build static sites.
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
project/
|
|
44
|
+
├── public/ # Static assets (images, fonts, favicon)
|
|
45
|
+
├── src/
|
|
46
|
+
│ ├── pages/ # HTML entry points — one file per page
|
|
47
|
+
│ ├── styles/
|
|
48
|
+
│ │ ├── globals.css # Reset + CSS variables ONLY
|
|
49
|
+
│ │ ├── layout.css # Structural utilities (.container, .grid)
|
|
50
|
+
│ │ └── index.css # Page-specific styles
|
|
51
|
+
│ ├── scripts/
|
|
52
|
+
│ │ ├── main.js # Entry point (DOMContentLoaded)
|
|
53
|
+
│ │ └── utils.js # Pure helpers: qs(), initApp()
|
|
54
|
+
│ └── components/ # Reusable HTML snippets loaded via JS
|
|
55
|
+
├── jsconfig.json # IntelliSense + checkJs
|
|
56
|
+
└── README.md
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Workflow Rules:
|
|
60
|
+
|
|
61
|
+
- `globals.css` holds `:root` variables. Never put page-specific styles here.
|
|
62
|
+
- All `<script>` tags must use `type="module"`.
|
|
63
|
+
- No anonymous inline event listeners. Delegate to named functions in `utils.js` or specific feature modules.
|
|
64
|
+
- Use `vite` as the dev server (replaces `live-server` for HMR + build support).
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 2️⃣ `/react+vite` — React SPA Structure
|
|
69
|
+
|
|
70
|
+
For rich, client-side rendered single-page applications.
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
src/
|
|
74
|
+
├── pages/Home/ # Route-level view
|
|
75
|
+
│ ├── Home.jsx
|
|
76
|
+
│ ├── Home.css # Co-located CSS
|
|
77
|
+
│ └── Home.test.jsx # Co-located tests
|
|
78
|
+
├── components/Navbar/ # Reusable UI components
|
|
79
|
+
├── layouts/ # Page wrappers (e.g., MainLayout, AuthLayout)
|
|
80
|
+
├── services/ # API logic ONLY (axios/fetch calls, no React)
|
|
81
|
+
├── hooks/ # Custom hooks (manage state, call services)
|
|
82
|
+
├── utils/ # Pure JS helpers (no React, no side-effects)
|
|
83
|
+
├── globals/
|
|
84
|
+
│ ├── variables.css # CSS custom properties
|
|
85
|
+
│ ├── reset.css # Modern CSS reset
|
|
86
|
+
│ ├── globals.css # @imports reset + variables
|
|
87
|
+
│ └── config.js # env mappings (APP_NAME, API_URL)
|
|
88
|
+
├── test/
|
|
89
|
+
│ └── setup.js # Testing library setup
|
|
90
|
+
├── router.jsx # createBrowserRouter logic
|
|
91
|
+
└── main.jsx # ReactDOM.render entry point
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Workflow Rules:
|
|
95
|
+
|
|
96
|
+
- Use `@/` absolute imports everywhere. No `../../` directory climbing. Requires `jsconfig.json` in the project root.
|
|
97
|
+
- Components **own** their CSS and Tests. They live side-by-side in the component folder.
|
|
98
|
+
- `services/` is the only layer permitted to call `axios` or `fetch`.
|
|
99
|
+
- **Testing:** Use `vitest` + `@testing-library/react`. Co-locate `.test.jsx` files next to their components.
|
|
100
|
+
- **Linting:** ESLint + Prettier are configured via `.eslintrc.cjs` and `.prettierrc`.
|
|
101
|
+
- **State Management:** Use local state (`useState`) by default. Use Context for theme/auth. Use global stores (Zustand) only when prop-drilling exceeds 3 levels.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 3️⃣ `/next.js` — App Router Full-Stack Structure
|
|
106
|
+
|
|
107
|
+
For enterprise-grade, Server-Side Rendered (SSR) applications.
|
|
108
|
+
|
|
109
|
+
```text
|
|
110
|
+
src/
|
|
111
|
+
├── app/ # Routing layer ONLY
|
|
112
|
+
│ ├── layout.tsx # Root layout
|
|
113
|
+
│ ├── page.tsx # Home route
|
|
114
|
+
│ ├── globals.css # Reset + global variables
|
|
115
|
+
│ ├── (marketing)/ # Route groups (public)
|
|
116
|
+
│ ├── (dashboard)/ # Route groups (protected)
|
|
117
|
+
│ └── api/ # Route Handlers (Edge/Serverless APIs)
|
|
118
|
+
├── components/
|
|
119
|
+
│ ├── ui/ # Dumb primitives (Button, Input, Modal)
|
|
120
|
+
│ └── layout/ # Smart layout pieces (Navbar, Sidebar)
|
|
121
|
+
├── features/auth/ # Domain-driven feature groupings
|
|
122
|
+
│ ├── components/
|
|
123
|
+
│ ├── hooks/
|
|
124
|
+
│ ├── actions.ts # Server Actions (Mutations)
|
|
125
|
+
│ ├── service.ts # Data Fetching (Queries)
|
|
126
|
+
│ └── types.ts
|
|
127
|
+
├── lib/ # Shared pure utilities
|
|
128
|
+
│ ├── fetcher.ts
|
|
129
|
+
│ ├── env.ts # Zod validated env variables
|
|
130
|
+
│ └── constants.ts
|
|
131
|
+
├── hooks/ # Global cross-feature hooks
|
|
132
|
+
├── store/ # Global state (Zustand)
|
|
133
|
+
└── types/ # Global TS interfaces/enums
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Workflow Rules:
|
|
137
|
+
|
|
138
|
+
- `app/` is for routing. No business logic in `page.tsx`. Delegate to features.
|
|
139
|
+
- Default to **Server Components**. Add `"use client"` only at the lowest possible leaf node.
|
|
140
|
+
- Data Mutations use **Server Actions** (`actions.ts`). Data Fetching uses Next.js native `fetch` inside `service.ts` or Server Components.
|
|
141
|
+
- **Features** (`features/`) must be strictly self-contained. A feature should not import from another feature's internal folders.
|
|
142
|
+
- **Environment variables** must be validated with Zod in `lib/env.ts`.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 🏷️ Naming Conventions
|
|
147
|
+
|
|
148
|
+
| Item | Convention | Example |
|
|
149
|
+
| :------------------- | :------------------------ | :--------------------------- |
|
|
150
|
+
| Page / Component | PascalCase | `ProductList.jsx` |
|
|
151
|
+
| CSS / Test file | PascalCase (mirrors file) | `ProductList.css` |
|
|
152
|
+
| Hook file | camelCase, use prefix | `useAuth.ts` |
|
|
153
|
+
| Service / Util / Lib | camelCase | `apiClient.js`, `fetcher.ts` |
|
|
154
|
+
| Feature folder | camelCase | `features/auth/` |
|
|
155
|
+
| CSS class | kebab-case | `.product-list` |
|
|
156
|
+
| CSS Custom Property | `--kebab-case` | `--color-primary` |
|
|
157
|
+
| Next.js App routes | lowercase, specific names | `page.tsx`, `layout.tsx` |
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## 🎨 Global CSS Token Standard
|
|
162
|
+
|
|
163
|
+
All workflows share the same CSS variable architecture. Define these in your root CSS file. Do not use magic numbers or hardcoded hex codes.
|
|
164
|
+
|
|
165
|
+
```css
|
|
166
|
+
:root {
|
|
167
|
+
/* Colors */
|
|
168
|
+
--color-primary: #6366f1;
|
|
169
|
+
--color-bg: #ffffff;
|
|
170
|
+
--color-text: #111827;
|
|
171
|
+
--color-subtle: #6b7280;
|
|
172
|
+
|
|
173
|
+
/* Typography */
|
|
174
|
+
--font-sans: system-ui, -apple-system, sans-serif;
|
|
175
|
+
|
|
176
|
+
/* Spacing & Radii */
|
|
177
|
+
--spacing-md: 1rem;
|
|
178
|
+
--radius-sm: 0.375rem;
|
|
179
|
+
|
|
180
|
+
/* Animation */
|
|
181
|
+
--transition-default: all 0.2s ease-in-out;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@media (prefers-color-scheme: dark) {
|
|
185
|
+
:root {
|
|
186
|
+
--color-bg: #0f172a;
|
|
187
|
+
--color-text: #f8fafc;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 🔀 Git & Commit Standards
|
|
195
|
+
|
|
196
|
+
All projects use **Conventional Commits** for clear, parseable commit history.
|
|
197
|
+
|
|
198
|
+
### Commit Format
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
<type>(<scope>): <short description>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Types
|
|
205
|
+
|
|
206
|
+
| Type | When to Use |
|
|
207
|
+
| :--------- | :----------------------------------------- |
|
|
208
|
+
| `feat` | New feature or capability |
|
|
209
|
+
| `fix` | Bug fix |
|
|
210
|
+
| `refactor` | Code restructuring without behavior change |
|
|
211
|
+
| `style` | CSS / formatting (no logic changes) |
|
|
212
|
+
| `docs` | Documentation updates |
|
|
213
|
+
| `chore` | Tooling, config, dependency updates |
|
|
214
|
+
| `test` | Adding or modifying tests |
|
|
215
|
+
|
|
216
|
+
### Rules
|
|
217
|
+
|
|
218
|
+
- Write in **imperative mood**: `feat: add user search`, not `feat: added user search`.
|
|
219
|
+
- Scope is optional but encouraged: `fix(auth): handle expired tokens`.
|
|
220
|
+
- Keep the subject line under 72 characters.
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## ♿ Accessibility (a11y) Rules
|
|
225
|
+
|
|
226
|
+
Every Achira project must meet baseline accessibility standards:
|
|
227
|
+
|
|
228
|
+
1. **Semantic HTML First.** Use `<button>` for actions, `<a>` for navigation, `<nav>`, `<main>`, `<section>`, `<article>` for structure. Never use `<div onClick>` as a button substitute.
|
|
229
|
+
2. **Alt Text on All Images.** Every `<img>` must have a meaningful `alt` attribute. Decorative images use `alt=""`.
|
|
230
|
+
3. **ARIA Labels.** Interactive elements without visible text must have `aria-label` or `aria-labelledby`.
|
|
231
|
+
4. **Color Contrast.** Maintain a minimum contrast ratio of **4.5:1** for normal text and **3:1** for large text (WCAG AA).
|
|
232
|
+
5. **Keyboard Navigation.** All interactive elements must be reachable and operable via keyboard (Tab, Enter, Escape).
|
|
233
|
+
6. **Focus Indicators.** Never remove `outline` on focused elements without providing a visible alternative.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## ⚡ Performance Guidelines
|
|
238
|
+
|
|
239
|
+
1. **Lazy Load Images.** Use `loading="lazy"` on all below-the-fold `<img>` tags.
|
|
240
|
+
2. **Code Splitting (React / Next.js).** Use `React.lazy()` + `Suspense` for route-level splitting in React. Next.js handles this automatically via the App Router.
|
|
241
|
+
3. **Memoize Expensive Computations.** Use `useMemo` for complex calculations and `useCallback` for stable function references passed as props.
|
|
242
|
+
4. **Minimize Re-renders.** Lift state down, not up. Only the component that owns the state should re-render.
|
|
243
|
+
5. **Optimize Fonts.** Use `font-display: swap` and limit font weights/styles. Prefer system fonts or WOFF2 format.
|
|
244
|
+
6. **Avoid Layout Shifts.** Always set explicit `width` and `height` on images and media to prevent CLS.
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## 🛠️ Developer Experience (DX)
|
|
249
|
+
|
|
250
|
+
### Recommended VS Code Setup
|
|
251
|
+
|
|
252
|
+
Add a `.vscode/settings.json` to each project for consistent DX across team members:
|
|
253
|
+
|
|
254
|
+
```json
|
|
255
|
+
{
|
|
256
|
+
"editor.formatOnSave": true,
|
|
257
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
258
|
+
"editor.codeActionsOnSave": {
|
|
259
|
+
"source.fixAll.eslint": "explicit"
|
|
260
|
+
},
|
|
261
|
+
"files.associations": {
|
|
262
|
+
"*.css": "css"
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Recommended Extensions
|
|
268
|
+
|
|
269
|
+
| Extension | Purpose |
|
|
270
|
+
| :-------------- | :-------------------------------- |
|
|
271
|
+
| ESLint | Lint JS/JSX/TS |
|
|
272
|
+
| Prettier | Auto-format on save |
|
|
273
|
+
| CSS Peek | Navigate to CSS class definitions |
|
|
274
|
+
| Auto Rename Tag | Sync HTML/JSX tag renames |
|
|
275
|
+
| Error Lens | Inline display of errors |
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## 🚦 Universal Do / Don't
|
|
280
|
+
|
|
281
|
+
| ✅ DO | ❌ DON'T |
|
|
282
|
+
| :--------------------------------------------------------- | :------------------------------------------------------ |
|
|
283
|
+
| Co-locate CSS and Test files next to their components | Scatter styles/tests across random global folders |
|
|
284
|
+
| Use CSS variables (`var(--token)`) for styling | Hard-code `#6366f1` or `16px` inside a component CSS |
|
|
285
|
+
| Use absolute paths (`@/components/...`) | Use relative paths deeper than one level (`../../../`) |
|
|
286
|
+
| Keep Pages thin; delegate business logic to hooks/features | Write API calls or heavy logic directly inside a View |
|
|
287
|
+
| Route env variables through a central, typed config file | Access `import.meta.env` / `process.env` directly in UI |
|
|
288
|
+
| Enforce strict Single Responsibility per hook/function | Mix unrelated state/logic into a massive "God hook" |
|
|
289
|
+
| Separate Server Actions/API calls from UI presentation | Mix database queries directly into client components |
|
|
290
|
+
| Use semantic HTML and ARIA attributes | Use `<div>` for everything and ignore keyboard access |
|
|
291
|
+
| Use Conventional Commits for every commit | Write vague commits like "fix stuff" or "update" |
|