red64-cli 0.1.0 → 0.2.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/dist/cli/parseArgs.d.ts.map +1 -1
- package/dist/cli/parseArgs.js +5 -0
- package/dist/cli/parseArgs.js.map +1 -1
- package/dist/components/init/CompleteStep.d.ts.map +1 -1
- package/dist/components/init/CompleteStep.js +2 -2
- package/dist/components/init/CompleteStep.js.map +1 -1
- package/dist/components/init/TestCheckStep.d.ts +16 -0
- package/dist/components/init/TestCheckStep.d.ts.map +1 -0
- package/dist/components/init/TestCheckStep.js +120 -0
- package/dist/components/init/TestCheckStep.js.map +1 -0
- package/dist/components/init/index.d.ts +1 -0
- package/dist/components/init/index.d.ts.map +1 -1
- package/dist/components/init/index.js +1 -0
- package/dist/components/init/index.js.map +1 -1
- package/dist/components/init/types.d.ts +9 -0
- package/dist/components/init/types.d.ts.map +1 -1
- package/dist/components/screens/InitScreen.d.ts.map +1 -1
- package/dist/components/screens/InitScreen.js +69 -6
- package/dist/components/screens/InitScreen.js.map +1 -1
- package/dist/components/screens/StartScreen.d.ts.map +1 -1
- package/dist/components/screens/StartScreen.js +89 -3
- package/dist/components/screens/StartScreen.js.map +1 -1
- package/dist/services/ConfigService.d.ts +1 -0
- package/dist/services/ConfigService.d.ts.map +1 -1
- package/dist/services/ConfigService.js.map +1 -1
- package/dist/services/ProjectDetector.d.ts +28 -0
- package/dist/services/ProjectDetector.d.ts.map +1 -0
- package/dist/services/ProjectDetector.js +236 -0
- package/dist/services/ProjectDetector.js.map +1 -0
- package/dist/services/TestRunner.d.ts +46 -0
- package/dist/services/TestRunner.d.ts.map +1 -0
- package/dist/services/TestRunner.js +85 -0
- package/dist/services/TestRunner.js.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +2 -0
- package/dist/services/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/framework/agents/claude/.claude/agents/red64/spec-impl.md +131 -2
- package/framework/agents/claude/.claude/commands/red64/spec-impl.md +24 -0
- package/framework/agents/codex/.codex/agents/red64/spec-impl.md +131 -2
- package/framework/agents/codex/.codex/commands/red64/spec-impl.md +24 -0
- package/framework/stacks/generic/feedback.md +80 -0
- package/framework/stacks/nextjs/accessibility.md +437 -0
- package/framework/stacks/nextjs/api.md +431 -0
- package/framework/stacks/nextjs/coding-style.md +282 -0
- package/framework/stacks/nextjs/commenting.md +226 -0
- package/framework/stacks/nextjs/components.md +411 -0
- package/framework/stacks/nextjs/conventions.md +333 -0
- package/framework/stacks/nextjs/css.md +310 -0
- package/framework/stacks/nextjs/error-handling.md +442 -0
- package/framework/stacks/nextjs/feedback.md +124 -0
- package/framework/stacks/nextjs/migrations.md +332 -0
- package/framework/stacks/nextjs/models.md +362 -0
- package/framework/stacks/nextjs/queries.md +410 -0
- package/framework/stacks/nextjs/responsive.md +338 -0
- package/framework/stacks/nextjs/tech-stack.md +177 -0
- package/framework/stacks/nextjs/test-writing.md +475 -0
- package/framework/stacks/nextjs/validation.md +467 -0
- package/framework/stacks/python/api.md +468 -0
- package/framework/stacks/python/authentication.md +342 -0
- package/framework/stacks/python/code-quality.md +283 -0
- package/framework/stacks/python/code-refactoring.md +315 -0
- package/framework/stacks/python/coding-style.md +462 -0
- package/framework/stacks/python/conventions.md +399 -0
- package/framework/stacks/python/error-handling.md +512 -0
- package/framework/stacks/python/feedback.md +92 -0
- package/framework/stacks/python/implement-ai-llm.md +468 -0
- package/framework/stacks/python/migrations.md +388 -0
- package/framework/stacks/python/models.md +399 -0
- package/framework/stacks/python/python.md +232 -0
- package/framework/stacks/python/queries.md +451 -0
- package/framework/stacks/python/structure.md +245 -58
- package/framework/stacks/python/tech.md +92 -35
- package/framework/stacks/python/testing.md +380 -0
- package/framework/stacks/python/validation.md +471 -0
- package/framework/stacks/rails/authentication.md +176 -0
- package/framework/stacks/rails/code-quality.md +287 -0
- package/framework/stacks/rails/code-refactoring.md +299 -0
- package/framework/stacks/rails/feedback.md +130 -0
- package/framework/stacks/rails/implement-ai-llm-with-rubyllm.md +342 -0
- package/framework/stacks/rails/rails.md +301 -0
- package/framework/stacks/rails/rails8-best-practices.md +498 -0
- package/framework/stacks/rails/rails8-css.md +573 -0
- package/framework/stacks/rails/structure.md +140 -0
- package/framework/stacks/rails/tech.md +108 -0
- package/framework/stacks/react/code-quality.md +521 -0
- package/framework/stacks/react/components.md +625 -0
- package/framework/stacks/react/data-fetching.md +586 -0
- package/framework/stacks/react/feedback.md +110 -0
- package/framework/stacks/react/forms.md +694 -0
- package/framework/stacks/react/performance.md +640 -0
- package/framework/stacks/react/product.md +22 -9
- package/framework/stacks/react/state-management.md +472 -0
- package/framework/stacks/react/structure.md +351 -44
- package/framework/stacks/react/tech.md +219 -30
- package/framework/stacks/react/testing.md +690 -0
- package/package.json +1 -1
- package/framework/stacks/node/product.md +0 -27
- package/framework/stacks/node/structure.md +0 -82
- package/framework/stacks/node/tech.md +0 -63
|
@@ -4,62 +4,251 @@
|
|
|
4
4
|
|
|
5
5
|
## Architecture
|
|
6
6
|
|
|
7
|
-
Component-based architecture with unidirectional data flow. React components handle UI rendering while hooks manage state and side effects.
|
|
7
|
+
Component-based architecture with unidirectional data flow. React components handle UI rendering while hooks manage state and side effects. Server state is separated from client state using dedicated libraries.
|
|
8
|
+
|
|
9
|
+
---
|
|
8
10
|
|
|
9
11
|
## Core Technologies
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
| Category | Choice | Rationale |
|
|
14
|
+
|----------|--------|-----------|
|
|
15
|
+
| **Language** | TypeScript 5.x (strict) | Type safety, better DX, catch errors at compile time |
|
|
16
|
+
| **Framework** | React 18+ | Concurrent rendering, automatic batching, Suspense |
|
|
17
|
+
| **Runtime** | Node.js 20+ (dev), Browser (prod) | Modern ESM support, native fetch |
|
|
18
|
+
| **Build Tool** | Vite 5+ | Fastest HMR, native ESM, optimized production builds |
|
|
19
|
+
| **Package Manager** | pnpm | Fast, disk-efficient, strict dependency resolution |
|
|
20
|
+
|
|
21
|
+
---
|
|
15
22
|
|
|
16
23
|
## Key Libraries
|
|
17
24
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
### State Management
|
|
26
|
+
| Library | Use Case |
|
|
27
|
+
|---------|----------|
|
|
28
|
+
| **Zustand** | Client state (UI state, user preferences) |
|
|
29
|
+
| **TanStack Query** | Server state (API data, caching, sync) |
|
|
30
|
+
| **React Context** | Dependency injection (theme, auth context) |
|
|
31
|
+
|
|
32
|
+
### Data Fetching
|
|
33
|
+
| Library | Use Case |
|
|
34
|
+
|---------|----------|
|
|
35
|
+
| **TanStack Query** | Server state, caching, background refetch |
|
|
36
|
+
| **ky** / **fetch** | HTTP client (ky for better DX, native fetch for simplicity) |
|
|
37
|
+
| **zod** | Runtime validation of API responses |
|
|
38
|
+
|
|
39
|
+
### Routing
|
|
40
|
+
| Library | Use Case |
|
|
41
|
+
|---------|----------|
|
|
42
|
+
| **React Router 6+** | Client-side routing, nested routes, loaders |
|
|
43
|
+
| **TanStack Router** | Type-safe routing (alternative) |
|
|
44
|
+
|
|
45
|
+
### Forms
|
|
46
|
+
| Library | Use Case |
|
|
47
|
+
|---------|----------|
|
|
48
|
+
| **React Hook Form** | Performant forms, minimal re-renders |
|
|
49
|
+
| **Zod** | Schema validation, type inference |
|
|
50
|
+
| **@hookform/resolvers** | Zod integration with RHF |
|
|
51
|
+
|
|
52
|
+
### Styling
|
|
53
|
+
| Library | Use Case |
|
|
54
|
+
|---------|----------|
|
|
55
|
+
| **Tailwind CSS 3+** | Utility-first, design system, purged production CSS |
|
|
56
|
+
| **tailwind-merge** | Conditional class merging without conflicts |
|
|
57
|
+
| **clsx** | Conditional classNames |
|
|
58
|
+
|
|
59
|
+
### UI Components
|
|
60
|
+
| Library | Use Case |
|
|
61
|
+
|---------|----------|
|
|
62
|
+
| **Radix UI** | Unstyled, accessible primitives |
|
|
63
|
+
| **shadcn/ui** | Copy-paste components built on Radix |
|
|
64
|
+
| **Lucide React** | Icon library |
|
|
65
|
+
|
|
66
|
+
---
|
|
22
67
|
|
|
23
68
|
## Development Standards
|
|
24
69
|
|
|
25
|
-
###
|
|
70
|
+
### TypeScript Configuration
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"compilerOptions": {
|
|
75
|
+
"target": "ES2022",
|
|
76
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
77
|
+
"module": "ESNext",
|
|
78
|
+
"moduleResolution": "bundler",
|
|
79
|
+
"strict": true,
|
|
80
|
+
"noUncheckedIndexedAccess": true,
|
|
81
|
+
"noImplicitOverride": true,
|
|
82
|
+
"noUnusedLocals": true,
|
|
83
|
+
"noUnusedParameters": true,
|
|
84
|
+
"exactOptionalPropertyTypes": true,
|
|
85
|
+
"forceConsistentCasingInFileNames": true,
|
|
86
|
+
"skipLibCheck": true,
|
|
87
|
+
"jsx": "react-jsx",
|
|
88
|
+
"baseUrl": ".",
|
|
89
|
+
"paths": {
|
|
90
|
+
"@/*": ["./src/*"]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Type Safety Rules
|
|
26
97
|
- TypeScript strict mode enabled
|
|
27
|
-
- No `any` types except for third-party library edge cases
|
|
98
|
+
- No `any` types except for third-party library edge cases (use `unknown` instead)
|
|
28
99
|
- Explicit return types for exported functions
|
|
29
|
-
-
|
|
100
|
+
- Prefer `interface` over `type` for object shapes (better error messages, extendable)
|
|
101
|
+
- Use discriminated unions for state machines
|
|
102
|
+
- Validate external data with Zod at runtime
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Code Quality
|
|
107
|
+
|
|
108
|
+
| Tool | Purpose |
|
|
109
|
+
|------|---------|
|
|
110
|
+
| **ESLint** | Linting with React and TypeScript rules |
|
|
111
|
+
| **Prettier** | Code formatting (single source of truth) |
|
|
112
|
+
| **Husky** | Git hooks for pre-commit checks |
|
|
113
|
+
| **lint-staged** | Run checks only on staged files |
|
|
114
|
+
|
|
115
|
+
### ESLint Configuration
|
|
116
|
+
|
|
117
|
+
```javascript
|
|
118
|
+
// eslint.config.js (flat config)
|
|
119
|
+
import js from '@eslint/js';
|
|
120
|
+
import typescript from '@typescript-eslint/eslint-plugin';
|
|
121
|
+
import tsParser from '@typescript-eslint/parser';
|
|
122
|
+
import react from 'eslint-plugin-react';
|
|
123
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
124
|
+
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
125
|
+
|
|
126
|
+
export default [
|
|
127
|
+
js.configs.recommended,
|
|
128
|
+
{
|
|
129
|
+
files: ['**/*.{ts,tsx}'],
|
|
130
|
+
languageOptions: {
|
|
131
|
+
parser: tsParser,
|
|
132
|
+
parserOptions: { project: './tsconfig.json' },
|
|
133
|
+
},
|
|
134
|
+
plugins: {
|
|
135
|
+
'@typescript-eslint': typescript,
|
|
136
|
+
'react': react,
|
|
137
|
+
'react-hooks': reactHooks,
|
|
138
|
+
'jsx-a11y': jsxA11y,
|
|
139
|
+
},
|
|
140
|
+
rules: {
|
|
141
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
142
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
143
|
+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
144
|
+
'@typescript-eslint/no-explicit-any': 'error',
|
|
145
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Testing
|
|
30
154
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
155
|
+
| Tool | Purpose |
|
|
156
|
+
|------|---------|
|
|
157
|
+
| **Vitest** | Unit and integration tests (native Vite integration, fastest) |
|
|
158
|
+
| **React Testing Library** | Component testing (user-centric) |
|
|
159
|
+
| **MSW** | API mocking (Mock Service Worker) |
|
|
160
|
+
| **Playwright** | End-to-end testing |
|
|
161
|
+
| **@testing-library/user-event** | Realistic user interactions |
|
|
35
162
|
|
|
36
|
-
###
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
|
|
163
|
+
### Coverage Requirements
|
|
164
|
+
- Minimum 80% coverage for business logic (hooks, utils)
|
|
165
|
+
- Critical user flows must have E2E tests
|
|
166
|
+
- Components tested for user interactions, not implementation details
|
|
167
|
+
|
|
168
|
+
---
|
|
41
169
|
|
|
42
170
|
## Development Environment
|
|
43
171
|
|
|
44
172
|
### Required Tools
|
|
45
173
|
- Node.js 20+
|
|
46
|
-
-
|
|
47
|
-
- VS Code with
|
|
174
|
+
- pnpm 8+ (or npm/yarn)
|
|
175
|
+
- VS Code with extensions:
|
|
176
|
+
- ESLint
|
|
177
|
+
- Prettier
|
|
178
|
+
- Tailwind CSS IntelliSense
|
|
179
|
+
- TypeScript Vue Plugin (Volar) for better TS support
|
|
48
180
|
|
|
49
181
|
### Common Commands
|
|
182
|
+
|
|
50
183
|
```bash
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
54
|
-
#
|
|
184
|
+
# Development
|
|
185
|
+
pnpm dev # Start dev server with HMR
|
|
186
|
+
pnpm build # Production build
|
|
187
|
+
pnpm preview # Preview production build
|
|
188
|
+
|
|
189
|
+
# Testing
|
|
190
|
+
pnpm test # Run Vitest in watch mode
|
|
191
|
+
pnpm test:run # Run tests once
|
|
192
|
+
pnpm test:coverage # Run with coverage report
|
|
193
|
+
pnpm test:e2e # Run Playwright E2E tests
|
|
194
|
+
|
|
195
|
+
# Code Quality
|
|
196
|
+
pnpm lint # ESLint check
|
|
197
|
+
pnpm lint:fix # Auto-fix ESLint issues
|
|
198
|
+
pnpm format # Prettier format
|
|
199
|
+
pnpm typecheck # TypeScript type checking
|
|
55
200
|
```
|
|
56
201
|
|
|
202
|
+
---
|
|
203
|
+
|
|
57
204
|
## Key Technical Decisions
|
|
58
205
|
|
|
206
|
+
### Component Patterns
|
|
59
207
|
- **Functional Components**: Always use functional components with hooks
|
|
60
|
-
- **Custom Hooks**: Extract reusable logic into custom hooks
|
|
208
|
+
- **Custom Hooks**: Extract reusable logic into custom hooks (prefix with `use`)
|
|
61
209
|
- **Composition**: Prefer composition over inheritance
|
|
62
|
-
- **
|
|
210
|
+
- **Render Props / HOCs**: Avoid unless library requires it
|
|
211
|
+
|
|
212
|
+
### State Patterns
|
|
213
|
+
- **Server vs Client State**: Separate concerns using TanStack Query (server) and Zustand (client)
|
|
214
|
+
- **Immutability**: Never mutate state directly; use immer if complex updates needed
|
|
215
|
+
- **Colocation**: Keep state as close to where it's used as possible
|
|
216
|
+
- **Lift State Up**: Only when multiple components need the same state
|
|
217
|
+
|
|
218
|
+
### Performance Defaults
|
|
219
|
+
- **Code Splitting**: Use `React.lazy()` for route-level splitting
|
|
220
|
+
- **Memoization**: Use `useMemo`/`useCallback` only when profiler shows need
|
|
221
|
+
- **Virtualization**: Use `@tanstack/react-virtual` for long lists (1000+ items)
|
|
222
|
+
|
|
223
|
+
### Error Handling
|
|
224
|
+
- **Error Boundaries**: Wrap feature sections, not individual components
|
|
225
|
+
- **API Errors**: Handle with TanStack Query's built-in error states
|
|
226
|
+
- **Form Errors**: Inline validation with React Hook Form + Zod
|
|
63
227
|
|
|
64
228
|
---
|
|
65
|
-
|
|
229
|
+
|
|
230
|
+
## Project Initialization
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Create new project with Vite
|
|
234
|
+
pnpm create vite@latest my-app --template react-ts
|
|
235
|
+
cd my-app
|
|
236
|
+
|
|
237
|
+
# Install core dependencies
|
|
238
|
+
pnpm add @tanstack/react-query zustand react-router-dom zod react-hook-form @hookform/resolvers
|
|
239
|
+
|
|
240
|
+
# Install UI dependencies
|
|
241
|
+
pnpm add tailwindcss postcss autoprefixer clsx tailwind-merge lucide-react
|
|
242
|
+
pnpm add -D @radix-ui/react-* # Add specific primitives as needed
|
|
243
|
+
|
|
244
|
+
# Install dev dependencies
|
|
245
|
+
pnpm add -D vitest @testing-library/react @testing-library/jest-dom @testing-library/user-event
|
|
246
|
+
pnpm add -D msw playwright @playwright/test
|
|
247
|
+
pnpm add -D eslint prettier eslint-plugin-react-hooks eslint-plugin-jsx-a11y
|
|
248
|
+
pnpm add -D @typescript-eslint/parser @typescript-eslint/eslint-plugin
|
|
249
|
+
pnpm add -D husky lint-staged
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
_Document standards and patterns, not every dependency. Keep this current as the stack evolves._
|