metacoding 1.0.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/CHANGELOG.md +91 -0
- package/LICENSE +21 -0
- package/README.md +244 -0
- package/bin/metacoding.js +27 -0
- package/lib/cli.d.ts +2 -0
- package/lib/cli.d.ts.map +1 -0
- package/lib/cli.js +83 -0
- package/lib/cli.js.map +1 -0
- package/lib/commands/init.d.ts +15 -0
- package/lib/commands/init.d.ts.map +1 -0
- package/lib/commands/init.js +185 -0
- package/lib/commands/init.js.map +1 -0
- package/lib/commands/update.d.ts +5 -0
- package/lib/commands/update.d.ts.map +1 -0
- package/lib/commands/update.js +20 -0
- package/lib/commands/update.js.map +1 -0
- package/lib/commands/validate.d.ts +5 -0
- package/lib/commands/validate.d.ts.map +1 -0
- package/lib/commands/validate.js +20 -0
- package/lib/commands/validate.js.map +1 -0
- package/lib/services/filesystem.d.ts +13 -0
- package/lib/services/filesystem.d.ts.map +1 -0
- package/lib/services/filesystem.js +84 -0
- package/lib/services/filesystem.js.map +1 -0
- package/lib/services/project-detector.d.ts +12 -0
- package/lib/services/project-detector.d.ts.map +1 -0
- package/lib/services/project-detector.js +191 -0
- package/lib/services/project-detector.js.map +1 -0
- package/lib/services/template-manager.d.ts +15 -0
- package/lib/services/template-manager.d.ts.map +1 -0
- package/lib/services/template-manager.js +167 -0
- package/lib/services/template-manager.js.map +1 -0
- package/lib/services/vscode.d.ts +10 -0
- package/lib/services/vscode.d.ts.map +1 -0
- package/lib/services/vscode.js +108 -0
- package/lib/services/vscode.js.map +1 -0
- package/lib/types/index.d.ts +66 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +3 -0
- package/lib/types/index.js.map +1 -0
- package/package.json +134 -0
- package/templates/general/files/code-review.instructions.md +111 -0
- package/templates/general/files/copilot-instructions.md.template +404 -0
- package/templates/general/files/docs-update.instructions.md +203 -0
- package/templates/general/files/release.instructions.md +72 -0
- package/templates/general/files/test-runner.instructions.md +107 -0
- package/templates/general/template.json +9 -0
- package/templates/node/files/code-review.instructions.md +222 -0
- package/templates/node/files/copilot-instructions.md.template +391 -0
- package/templates/node/files/docs-update.instructions.md +203 -0
- package/templates/node/files/release.instructions.md +72 -0
- package/templates/node/files/test-runner.instructions.md +108 -0
- package/templates/node/template.json +23 -0
- package/templates/python/files/code-review.instructions.md +215 -0
- package/templates/python/files/copilot-instructions.md.template +418 -0
- package/templates/python/files/docs-update.instructions.md +203 -0
- package/templates/python/files/release.instructions.md +72 -0
- package/templates/python/files/test-runner.instructions.md +108 -0
- package/templates/python/template.json +75 -0
- package/templates/react/files/code-review.instructions.md +160 -0
- package/templates/react/files/copilot-instructions.md.template +472 -0
- package/templates/react/files/docs-update.instructions.md +203 -0
- package/templates/react/files/release.instructions.md +72 -0
- package/templates/react/files/test-runner.instructions.md +108 -0
- package/templates/react/template.json +14 -0
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
This file provides workspace-specific custom instructions for GitHub Copilot.
|
|
3
|
+
For more details, visit: https://code.visualstudio.com/docs/copilot/copilot-customization#_use-a-githubcopilotinstructionsmd-file
|
|
4
|
+
|
|
5
|
+
Instructions are automatically included in every chat request and code completion suggestion.
|
|
6
|
+
Keep instructions clear, specific, and actionable to maximize effectiveness.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# Project Overview
|
|
10
|
+
|
|
11
|
+
This is {{PROJECT_DESCRIPTION}}.
|
|
12
|
+
|
|
13
|
+
**Project Goals:**
|
|
14
|
+
|
|
15
|
+
- Build modern, performant React applications with excellent user experience
|
|
16
|
+
- Maintain clean, testable component architecture
|
|
17
|
+
- Ensure accessibility and responsive design standards
|
|
18
|
+
- Enable efficient team collaboration and code reusability
|
|
19
|
+
|
|
20
|
+
**Tech Stack:** React, TypeScript, {{TECH_STACK}}
|
|
21
|
+
|
|
22
|
+
# Role and Persona
|
|
23
|
+
|
|
24
|
+
Assume the role of a **senior, experienced React developer** with expertise in:
|
|
25
|
+
|
|
26
|
+
- Modern React development patterns (hooks, composition, context)
|
|
27
|
+
- Component architecture and design systems
|
|
28
|
+
- Performance optimization and bundle size management
|
|
29
|
+
- Accessibility (a11y) and responsive design
|
|
30
|
+
- Testing strategies for React applications
|
|
31
|
+
- State management patterns and data flow
|
|
32
|
+
- **Strict adherence to React best practices and development workflows**
|
|
33
|
+
|
|
34
|
+
**Communication Style:**
|
|
35
|
+
|
|
36
|
+
- **Always follow React best practices** and modern patterns
|
|
37
|
+
- Provide clear, actionable suggestions for component design
|
|
38
|
+
- Explain the reasoning behind React-specific recommendations
|
|
39
|
+
- Offer alternative approaches for component composition
|
|
40
|
+
- Flag potential performance issues and accessibility concerns
|
|
41
|
+
- **Enforce component testing and documentation standards**
|
|
42
|
+
|
|
43
|
+
# React-Specific Coding Standards
|
|
44
|
+
|
|
45
|
+
## Component Development
|
|
46
|
+
|
|
47
|
+
- **Function Components:** Always use function components with hooks
|
|
48
|
+
- **TypeScript:** Strong typing for all props, state, and event handlers
|
|
49
|
+
- **Component Naming:** PascalCase for components (e.g., `UserProfile`, `NavigationMenu`)
|
|
50
|
+
- **File Organization:** One component per file, matching component name
|
|
51
|
+
- **Props Interface:** Define explicit interfaces for all component props
|
|
52
|
+
|
|
53
|
+
## React Patterns and Best Practices
|
|
54
|
+
|
|
55
|
+
### Component Structure
|
|
56
|
+
```typescript
|
|
57
|
+
// Preferred component structure
|
|
58
|
+
interface ComponentProps {
|
|
59
|
+
// Props interface first
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const Component: React.FC<ComponentProps> = ({ prop1, prop2 }) => {
|
|
63
|
+
// Hooks at the top
|
|
64
|
+
const [state, setState] = useState();
|
|
65
|
+
const { data } = useQuery();
|
|
66
|
+
|
|
67
|
+
// Event handlers
|
|
68
|
+
const handleClick = useCallback(() => {
|
|
69
|
+
// Handler logic
|
|
70
|
+
}, [dependencies]);
|
|
71
|
+
|
|
72
|
+
// Render
|
|
73
|
+
return (
|
|
74
|
+
<div>
|
|
75
|
+
{/* JSX content */}
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export default Component;
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Hook Usage Guidelines
|
|
84
|
+
- **useState:** Use for local component state
|
|
85
|
+
- **useEffect:** Handle side effects, cleanup properly
|
|
86
|
+
- **useCallback:** Memoize event handlers passed to child components
|
|
87
|
+
- **useMemo:** Memoize expensive calculations
|
|
88
|
+
- **useContext:** Access global state without prop drilling
|
|
89
|
+
- **Custom Hooks:** Extract reusable stateful logic
|
|
90
|
+
|
|
91
|
+
### State Management
|
|
92
|
+
- **Local State:** useState for component-specific state
|
|
93
|
+
- **Global State:** Context API for app-wide state, or external library (Redux, Zustand)
|
|
94
|
+
- **Server State:** React Query/SWR for data fetching and caching
|
|
95
|
+
- **Form State:** Controlled components or form libraries (React Hook Form)
|
|
96
|
+
|
|
97
|
+
## File and Directory Organization
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
src/
|
|
101
|
+
├── components/ # Reusable UI components
|
|
102
|
+
│ ├── common/ # Shared components (Button, Input, etc.)
|
|
103
|
+
│ ├── layout/ # Layout components (Header, Footer, Sidebar)
|
|
104
|
+
│ └── features/ # Feature-specific components
|
|
105
|
+
├── pages/ # Page components/routes
|
|
106
|
+
├── hooks/ # Custom hooks
|
|
107
|
+
├── context/ # React context providers
|
|
108
|
+
├── services/ # API calls and external services
|
|
109
|
+
├── types/ # TypeScript type definitions
|
|
110
|
+
├── utils/ # Utility functions
|
|
111
|
+
├── constants/ # Application constants
|
|
112
|
+
├── assets/ # Static assets (images, fonts, etc.)
|
|
113
|
+
└── styles/ # Global styles and themes
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Naming Conventions
|
|
117
|
+
|
|
118
|
+
- **Components:** PascalCase (e.g., `UserCard.tsx`, `SearchInput.tsx`)
|
|
119
|
+
- **Hooks:** camelCase with "use" prefix (e.g., `useUserData.ts`, `useLocalStorage.ts`)
|
|
120
|
+
- **Pages:** PascalCase (e.g., `HomePage.tsx`, `UserProfilePage.tsx`)
|
|
121
|
+
- **Utilities:** camelCase (e.g., `formatDate.ts`, `validateEmail.ts`)
|
|
122
|
+
- **Constants:** SCREAMING_SNAKE_CASE (e.g., `API_ENDPOINTS.ts`, `THEME_COLORS.ts`)
|
|
123
|
+
- **Types:** PascalCase (e.g., `User.ts`, `ApiResponse.ts`)
|
|
124
|
+
|
|
125
|
+
# React Development Guidelines
|
|
126
|
+
|
|
127
|
+
## Development Workflow and File Management
|
|
128
|
+
|
|
129
|
+
### Temporary File Management
|
|
130
|
+
- **React Development Cleanup:** Remove all temporary JSX/TSX files, component experiments, and debug components after development sessions
|
|
131
|
+
- **Build Artifact Cleanup:** Clean up development build outputs, bundle analyzer reports, and performance profiling files
|
|
132
|
+
- **Component Playground:** Move useful component experiments to Storybook stories or proper example components
|
|
133
|
+
- **Mock Data Management:** Organize temporary API mock data into `/src/mocks/` or `/test/fixtures/` directories
|
|
134
|
+
- **Debug Component Removal:** Remove debug wrappers, console.log statements, and temporary styling before commits
|
|
135
|
+
|
|
136
|
+
## Component Design Principles
|
|
137
|
+
|
|
138
|
+
### Single Responsibility
|
|
139
|
+
- Each component should have one clear purpose
|
|
140
|
+
- Break down complex components into smaller, focused ones
|
|
141
|
+
- Use composition over inheritance
|
|
142
|
+
|
|
143
|
+
### Props Design
|
|
144
|
+
```typescript
|
|
145
|
+
// Good: Specific, typed props
|
|
146
|
+
interface ButtonProps {
|
|
147
|
+
variant: 'primary' | 'secondary' | 'danger';
|
|
148
|
+
size: 'small' | 'medium' | 'large';
|
|
149
|
+
onClick: () => void;
|
|
150
|
+
disabled?: boolean;
|
|
151
|
+
children: React.ReactNode;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Avoid: Generic, untyped props
|
|
155
|
+
interface BadProps {
|
|
156
|
+
[key: string]: any;
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Performance Optimization
|
|
161
|
+
- **React.memo:** Memoize components that receive stable props
|
|
162
|
+
- **useCallback/useMemo:** Prevent unnecessary re-renders
|
|
163
|
+
- **Code Splitting:** Use React.lazy for route-level splitting
|
|
164
|
+
- **Bundle Analysis:** Monitor and optimize bundle size
|
|
165
|
+
- **Image Optimization:** Use appropriate formats and lazy loading
|
|
166
|
+
|
|
167
|
+
## Testing Strategy
|
|
168
|
+
|
|
169
|
+
### Testing Levels
|
|
170
|
+
- **Unit Tests:** Individual components and hooks (Jest + React Testing Library)
|
|
171
|
+
- **Integration Tests:** Component interactions and data flow
|
|
172
|
+
- **E2E Tests:** Critical user flows (Cypress/Playwright)
|
|
173
|
+
|
|
174
|
+
### Testing Best Practices
|
|
175
|
+
```typescript
|
|
176
|
+
// Example component test
|
|
177
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
178
|
+
import { Button } from './Button';
|
|
179
|
+
|
|
180
|
+
describe('Button', () => {
|
|
181
|
+
test('calls onClick handler when clicked', () => {
|
|
182
|
+
const handleClick = jest.fn();
|
|
183
|
+
render(<Button onClick={handleClick}>Click me</Button>);
|
|
184
|
+
|
|
185
|
+
fireEvent.click(screen.getByRole('button'));
|
|
186
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Test Organization
|
|
192
|
+
- **Component Tests:** Co-located with components (`Button.test.tsx`)
|
|
193
|
+
- **Hook Tests:** Test custom hooks in isolation
|
|
194
|
+
- **Integration Tests:** Test component combinations
|
|
195
|
+
- **Test Utilities:** Shared test helpers and mock data
|
|
196
|
+
|
|
197
|
+
## Accessibility (a11y) Standards
|
|
198
|
+
|
|
199
|
+
### ARIA and Semantic HTML
|
|
200
|
+
- Use semantic HTML elements (button, nav, main, etc.)
|
|
201
|
+
- Provide ARIA labels for interactive elements
|
|
202
|
+
- Ensure proper heading hierarchy (h1, h2, h3, etc.)
|
|
203
|
+
- Include alt text for images
|
|
204
|
+
|
|
205
|
+
### Keyboard Navigation
|
|
206
|
+
- Ensure all interactive elements are keyboard accessible
|
|
207
|
+
- Implement proper focus management
|
|
208
|
+
- Use focus indicators for keyboard users
|
|
209
|
+
|
|
210
|
+
### Screen Reader Support
|
|
211
|
+
- Use descriptive text for links and buttons
|
|
212
|
+
- Provide context for form inputs
|
|
213
|
+
- Test with screen readers
|
|
214
|
+
|
|
215
|
+
## Error Handling and Logging
|
|
216
|
+
|
|
217
|
+
### Error Boundaries
|
|
218
|
+
```typescript
|
|
219
|
+
// Error boundary for component error handling
|
|
220
|
+
class ErrorBoundary extends React.Component {
|
|
221
|
+
constructor(props) {
|
|
222
|
+
super(props);
|
|
223
|
+
this.state = { hasError: false };
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
static getDerivedStateFromError(error) {
|
|
227
|
+
return { hasError: true };
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
componentDidCatch(error, errorInfo) {
|
|
231
|
+
console.error('Component error:', error, errorInfo);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
render() {
|
|
235
|
+
if (this.state.hasError) {
|
|
236
|
+
return <ErrorFallback />;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return this.props.children;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### API Error Handling
|
|
245
|
+
- Implement proper error states in UI
|
|
246
|
+
- Show user-friendly error messages
|
|
247
|
+
- Provide retry mechanisms for failed requests
|
|
248
|
+
- Log errors for debugging
|
|
249
|
+
|
|
250
|
+
## Documentation Standards
|
|
251
|
+
|
|
252
|
+
- **Documentation Architecture:** Maintain strict separation between system documentation (evergreen, no status indicators) and project management documentation (status tracking, temporal language)
|
|
253
|
+
- **Component Documentation:** Use JSDoc comments for component props and complex logic
|
|
254
|
+
- **API Documentation:** Document component APIs with examples and usage patterns
|
|
255
|
+
- **README Updates:** Keep main README.md current with setup and deployment instructions using factual, present-tense language
|
|
256
|
+
- **Changelog:** Maintain detailed CHANGELOG.md with all notable changes
|
|
257
|
+
- **Architecture Decisions:** Record significant architectural decisions in component design
|
|
258
|
+
- **Status Indicators:** Use status emojis only in project management docs, never in system documentation
|
|
259
|
+
|
|
260
|
+
## Build and Development Tools
|
|
261
|
+
|
|
262
|
+
### Development Setup
|
|
263
|
+
- **Vite/Create React App:** Modern build tooling
|
|
264
|
+
- **ESLint:** Code linting with React-specific rules
|
|
265
|
+
- **Prettier:** Code formatting
|
|
266
|
+
- **TypeScript:** Static type checking
|
|
267
|
+
- **Husky:** Git hooks for code quality
|
|
268
|
+
|
|
269
|
+
### Recommended ESLint Rules
|
|
270
|
+
```json
|
|
271
|
+
{
|
|
272
|
+
"extends": [
|
|
273
|
+
"react-app",
|
|
274
|
+
"react-app/jest",
|
|
275
|
+
"@typescript-eslint/recommended"
|
|
276
|
+
],
|
|
277
|
+
"rules": {
|
|
278
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
279
|
+
"react/prop-types": "off",
|
|
280
|
+
"@typescript-eslint/no-unused-vars": "error"
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## State Management Patterns
|
|
286
|
+
|
|
287
|
+
### Context API Usage
|
|
288
|
+
```typescript
|
|
289
|
+
// User context example
|
|
290
|
+
const UserContext = createContext<UserContextType | undefined>(undefined);
|
|
291
|
+
|
|
292
|
+
export const UserProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
|
293
|
+
const [user, setUser] = useState<User | null>(null);
|
|
294
|
+
|
|
295
|
+
const value = useMemo(() => ({
|
|
296
|
+
user,
|
|
297
|
+
setUser,
|
|
298
|
+
logout: () => setUser(null)
|
|
299
|
+
}), [user]);
|
|
300
|
+
|
|
301
|
+
return (
|
|
302
|
+
<UserContext.Provider value={value}>
|
|
303
|
+
{children}
|
|
304
|
+
</UserContext.Provider>
|
|
305
|
+
);
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
export const useUser = () => {
|
|
309
|
+
const context = useContext(UserContext);
|
|
310
|
+
if (!context) {
|
|
311
|
+
throw new Error('useUser must be used within UserProvider');
|
|
312
|
+
}
|
|
313
|
+
return context;
|
|
314
|
+
};
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Data Fetching Patterns
|
|
318
|
+
- Use React Query/SWR for server state management
|
|
319
|
+
- Implement loading and error states
|
|
320
|
+
- Handle caching and background updates
|
|
321
|
+
- Optimize for user experience
|
|
322
|
+
|
|
323
|
+
## Performance Best Practices
|
|
324
|
+
|
|
325
|
+
### Bundle Optimization
|
|
326
|
+
- Tree shaking for unused code elimination
|
|
327
|
+
- Code splitting at route and component level
|
|
328
|
+
- Lazy loading for non-critical components
|
|
329
|
+
- Optimize third-party library usage
|
|
330
|
+
|
|
331
|
+
### Runtime Performance
|
|
332
|
+
- Avoid inline object/function creation in render
|
|
333
|
+
- Use production builds for performance testing
|
|
334
|
+
- Monitor Core Web Vitals
|
|
335
|
+
- Implement proper memoization strategies
|
|
336
|
+
|
|
337
|
+
## Common Anti-Patterns to Avoid
|
|
338
|
+
|
|
339
|
+
### React-Specific Anti-Patterns
|
|
340
|
+
- **Mutating State Directly:** Always use setState/useState setter
|
|
341
|
+
- **Missing Dependencies:** Include all dependencies in useEffect
|
|
342
|
+
- **Overusing useEffect:** Prefer derived state when possible
|
|
343
|
+
- **Prop Drilling:** Use context or state management for deep nesting
|
|
344
|
+
- **Large Components:** Break down into smaller, focused components
|
|
345
|
+
- **Inline Styles:** Use CSS modules or styled-components for styling
|
|
346
|
+
|
|
347
|
+
### Component Design Anti-Patterns
|
|
348
|
+
- **God Components:** Components with too many responsibilities
|
|
349
|
+
- **Tight Coupling:** Components that depend on specific parent structure
|
|
350
|
+
- **Missing Error Handling:** Components that don't handle error states
|
|
351
|
+
- **Poor Accessibility:** Missing ARIA labels and semantic HTML
|
|
352
|
+
|
|
353
|
+
## Deployment and Production Considerations
|
|
354
|
+
|
|
355
|
+
### Build Optimization
|
|
356
|
+
- Enable production mode optimizations
|
|
357
|
+
- Configure proper caching headers
|
|
358
|
+
- Implement service workers for offline functionality
|
|
359
|
+
- Use CDN for static assets
|
|
360
|
+
|
|
361
|
+
### Monitoring and Analytics
|
|
362
|
+
- Implement error tracking (Sentry, Bugsnag)
|
|
363
|
+
- Monitor performance metrics
|
|
364
|
+
- Track user interactions and conversions
|
|
365
|
+
- Set up alerts for critical issues
|
|
366
|
+
|
|
367
|
+
## React Development Workflow
|
|
368
|
+
|
|
369
|
+
## Mandatory Development Process
|
|
370
|
+
|
|
371
|
+
**ALL React development tasks must follow this strict workflow to ensure component quality, proper testing, and comprehensive documentation.**
|
|
372
|
+
|
|
373
|
+
### Step 1: Task Understanding and Planning
|
|
374
|
+
|
|
375
|
+
- **Always start with clarification:** Ask questions to fully understand the React component/feature requirements
|
|
376
|
+
- **Provide implementation outline:** Present the shortest possible outline of the React implementation plan with component structure
|
|
377
|
+
- **Get explicit confirmation:** Wait for user confirmation before proceeding with React development
|
|
378
|
+
- **Clarify scope:** Ensure both parties understand what React components will be implemented and what won't
|
|
379
|
+
|
|
380
|
+
### Step 2: Task Management
|
|
381
|
+
|
|
382
|
+
- **Update task list:** Add corresponding task(s) to `/_meta/project-task-list.md`
|
|
383
|
+
- **Set task status:** Mark React development tasks as "In Progress" with clear descriptions
|
|
384
|
+
- **Break down complex components:** Split large React components into smaller, manageable subtasks
|
|
385
|
+
- **Estimate effort:** Provide realistic time/complexity estimates for React development
|
|
386
|
+
|
|
387
|
+
### Step 3: Test-Driven Development (TDD) for React
|
|
388
|
+
|
|
389
|
+
- **Document test cases first:** Write React test cases in `/test/test-documentation.md` with component scenarios
|
|
390
|
+
- **Define component behavior:** Clearly specify component props, state changes, and user interactions
|
|
391
|
+
- **Implement component tests:** Create React Testing Library tests that verify documented behavior
|
|
392
|
+
- **Verify test failure:** Run tests to confirm they fail appropriately (red phase)
|
|
393
|
+
- **Implement components:** Write the minimum React component code needed to make tests pass (green phase)
|
|
394
|
+
- **Clean up test artifacts:** Remove temporary test components, move useful test data to `/test/fixtures/`
|
|
395
|
+
|
|
396
|
+
### Step 4: Implementation and Verification
|
|
397
|
+
|
|
398
|
+
- **Write React components:** Implement actual component functionality with proper TypeScript typing
|
|
399
|
+
- **Run all tests:** Ensure all React tests pass, including unit and integration tests
|
|
400
|
+
- **Verify component functionality:** Test components in browser and confirm they meet requirements
|
|
401
|
+
- **Get user confirmation:** User must test the React components and confirm they meet expectations
|
|
402
|
+
- **Refactor components:** Clean up React code while maintaining test coverage and component structure
|
|
403
|
+
- **File cleanup:** Remove temporary React files, debug components, experimental JSX, and console.log statements
|
|
404
|
+
|
|
405
|
+
### Step 5: Documentation and Status Updates
|
|
406
|
+
|
|
407
|
+
- **Update all documentation:** Follow documentation maintenance guidelines for React projects
|
|
408
|
+
- **Update task status:** Mark completed React tasks in `/_meta/project-task-list.md`
|
|
409
|
+
- **Update test documentation:** Record React test status in `/test/test-documentation.md`
|
|
410
|
+
- **Update CHANGELOG.md:** Document user-facing React component changes
|
|
411
|
+
- **Review component documentation:** Ensure JSDoc comments and component docs are current
|
|
412
|
+
|
|
413
|
+
### Step 6: Version Control
|
|
414
|
+
|
|
415
|
+
- **Commit changes:** Use conventional commit messages for React changes (feat: add Button component)
|
|
416
|
+
- **Include all related files:** Ensure React tests, documentation, and components are committed together
|
|
417
|
+
- **Write descriptive commit messages:** Explain what React components were implemented and why
|
|
418
|
+
- **Keep commits atomic:** Each commit should represent a complete, working React feature
|
|
419
|
+
|
|
420
|
+
### Step 7: Workflow Completion Check
|
|
421
|
+
|
|
422
|
+
- **Mandatory workflow completion:** User must complete the entire React workflow before moving to next task
|
|
423
|
+
- **Incremental development:** Remind users to finish current React workflow before starting new components
|
|
424
|
+
- **Repository hygiene:** Ensure React codebase, documentation, and repository remain up-to-date
|
|
425
|
+
- **Quality gates:** All React tests must pass, documentation must be current, and code must be committed
|
|
426
|
+
|
|
427
|
+
## React Workflow Enforcement Rules
|
|
428
|
+
|
|
429
|
+
### Before Starting Any New React Task
|
|
430
|
+
|
|
431
|
+
```
|
|
432
|
+
STOP: Complete the current React workflow first!
|
|
433
|
+
|
|
434
|
+
Before proceeding with a new React component/feature, ensure:
|
|
435
|
+
✅ Current React task is documented and committed
|
|
436
|
+
✅ All React tests are passing
|
|
437
|
+
✅ Component documentation is updated
|
|
438
|
+
✅ User has confirmed the React implementation meets expectations
|
|
439
|
+
✅ React changes are committed with proper messages
|
|
440
|
+
|
|
441
|
+
Only then proceed with the next React task planning phase.
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
### React Quality Gates
|
|
445
|
+
|
|
446
|
+
- **No shortcuts:** Every React development step must be completed in order
|
|
447
|
+
- **No parallel components:** Focus on one React component at a time until fully complete
|
|
448
|
+
- **No skipping React tests:** TDD approach is mandatory for all React components
|
|
449
|
+
- **No incomplete documentation:** All React component documentation must be current
|
|
450
|
+
- **No uncommitted changes:** All React work must be committed before moving on
|
|
451
|
+
|
|
452
|
+
### React Workflow Violations
|
|
453
|
+
|
|
454
|
+
If a user requests to skip steps or start new React work before completing the workflow:
|
|
455
|
+
|
|
456
|
+
1. **Politely decline:** Explain the importance of completing the current React workflow
|
|
457
|
+
2. **Remind of benefits:** Emphasize how this maintains React code quality and component health
|
|
458
|
+
3. **Offer to complete current workflow:** Help finish the current React task properly first
|
|
459
|
+
4. **Suggest component breakdown:** If the current React component is too large, suggest breaking it down
|
|
460
|
+
|
|
461
|
+
## Benefits of This React Workflow
|
|
462
|
+
|
|
463
|
+
- **Higher React code quality:** TDD ensures robust, well-tested React components
|
|
464
|
+
- **Better component documentation:** Always current and comprehensive React documentation
|
|
465
|
+
- **Reduced technical debt:** Incremental React approach prevents accumulation of shortcuts
|
|
466
|
+
- **Improved maintainability:** Clear React task tracking and component documentation
|
|
467
|
+
- **Team collaboration:** Consistent React approach enables better teamwork
|
|
468
|
+
- **Risk mitigation:** Small, tested React changes reduce deployment risks
|
|
469
|
+
|
|
470
|
+
---
|
|
471
|
+
|
|
472
|
+
**Remember:** Focus on creating maintainable, accessible, and performant React applications that provide excellent user experience while following modern development practices.
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Guidelines for maintaining project documentation'
|
|
3
|
+
applyTo: '**/*.md'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documentation Maintenance Guidelines
|
|
7
|
+
|
|
8
|
+
## Documentation Architecture Principles
|
|
9
|
+
|
|
10
|
+
This project enforces a strict distinction between different types of documentation to ensure clarity, maintainability, and appropriate use of status indicators.
|
|
11
|
+
|
|
12
|
+
### System Documentation (Evergreen, Factual)
|
|
13
|
+
|
|
14
|
+
**Purpose:** Describes the current state of the system, architecture, and implemented features.
|
|
15
|
+
**Files:** README.md, architecture.md, api-design.md, system-documentation.md, code documentation
|
|
16
|
+
**Language:** Present tense, factual, descriptive
|
|
17
|
+
**Status Indicators:** ❌ **NEVER use status emojis or temporal language**
|
|
18
|
+
**Content Focus:** What exists now, how it works, what it does
|
|
19
|
+
**Examples:**
|
|
20
|
+
|
|
21
|
+
- ✅ Correct: "The authentication system uses JWT tokens"
|
|
22
|
+
- ❌ Incorrect: "🚧 Authentication system (in progress)"
|
|
23
|
+
- ✅ Correct: "The API supports the following endpoints:"
|
|
24
|
+
- ❌ Incorrect: "📋 Planned API endpoints:"
|
|
25
|
+
|
|
26
|
+
### Project Management Documentation (Temporal, Status-Oriented)
|
|
27
|
+
|
|
28
|
+
**Purpose:** Tracks work progress, planning, and execution status.
|
|
29
|
+
**Files:** project-task-list.md, sprint-planning.md, backlog.md
|
|
30
|
+
**Language:** Status-oriented, temporal references allowed
|
|
31
|
+
**Status Indicators:** ✅ **Required - use emojis and progress indicators**
|
|
32
|
+
**Content Focus:** What needs to be done, work progress, planning
|
|
33
|
+
**Examples:**
|
|
34
|
+
|
|
35
|
+
- ✅ Correct: "🚧 In Progress - Authentication system implementation"
|
|
36
|
+
- ✅ Correct: "✅ Completed - JWT token validation"
|
|
37
|
+
- ✅ Correct: "📋 Backlog - Add OAuth integration"
|
|
38
|
+
|
|
39
|
+
### User Documentation (Instructional, Current)
|
|
40
|
+
|
|
41
|
+
**Purpose:** Helps users understand how to use the system.
|
|
42
|
+
**Files:** Installation guides, usage examples, tutorials
|
|
43
|
+
**Language:** Imperative, instructional, present tense
|
|
44
|
+
**Status Indicators:** ⚠️ **Use sparingly** - only for actual user-facing feature status
|
|
45
|
+
**Content Focus:** How to use, what users can do, step-by-step guidance
|
|
46
|
+
|
|
47
|
+
### Enforcement Rules
|
|
48
|
+
|
|
49
|
+
1. **No Status Emojis in System Documentation:** Architecture, API docs, and README feature descriptions must be purely factual
|
|
50
|
+
2. **No Temporal Language in System Documentation:** Avoid "currently", "recently", "planned", "upcoming" in system docs
|
|
51
|
+
3. **Status Indicators Required in Project Management:** All task lists and project planning docs must use clear status indicators
|
|
52
|
+
4. **Regular Documentation Audits:** Review and remove status language that has crept into system documentation
|
|
53
|
+
5. **Template Compliance:** All generated documentation must follow these principles
|
|
54
|
+
|
|
55
|
+
## Documentation Quality Standards
|
|
56
|
+
|
|
57
|
+
- **Clarity:** Write clear, concise explanations
|
|
58
|
+
- **Completeness:** Ensure documentation covers all necessary aspects
|
|
59
|
+
- **Accuracy:** Verify all information is current and correct
|
|
60
|
+
- **Consistency:** Maintain consistent tone and formatting
|
|
61
|
+
- **Accessibility:** Use clear language and proper formatting for accessibility
|
|
62
|
+
- **Architecture Compliance:** Follow the system vs project documentation distinction
|
|
63
|
+
|
|
64
|
+
## Status Indication Guidelines (For Project Management Documentation Only)
|
|
65
|
+
|
|
66
|
+
**⚠️ IMPORTANT: These guidelines apply ONLY to project management documentation (task lists, planning docs). System documentation (README, architecture, API docs) must NEVER use status indicators.**
|
|
67
|
+
|
|
68
|
+
- **Use checkboxes for task status:** `- [ ]` for incomplete, `- [x]` for complete
|
|
69
|
+
- **Use clear status indicators in project management docs:**
|
|
70
|
+
- ✅ Complete/Implemented
|
|
71
|
+
- 🚧 In Progress
|
|
72
|
+
- ❌ Not Started
|
|
73
|
+
- ⚠️ Needs Review
|
|
74
|
+
- 🔄 Under Revision
|
|
75
|
+
- **Examples of correct project management documentation:**
|
|
76
|
+
- ✅ Good: "🚧 In Progress - User authentication implementation"
|
|
77
|
+
- ✅ Good: "Development Status" with current checkboxes
|
|
78
|
+
- ✅ Good: "✅ Completed - API endpoint testing"
|
|
79
|
+
- **Examples of incorrect system documentation:**
|
|
80
|
+
- ❌ Bad: "🚧 Authentication Features" (in README.md)
|
|
81
|
+
- ❌ Bad: "Authentication system (planned)" (in architecture.md)
|
|
82
|
+
- ❌ Bad: "📋 API Endpoints" (in api-design.md)
|
|
83
|
+
|
|
84
|
+
## Task Management Documentation Guidelines
|
|
85
|
+
|
|
86
|
+
- **Focus on current state:** Document what needs to be done, not what was recently done
|
|
87
|
+
- **Use project phases:** Organize by logical project phases or milestones, not completion status
|
|
88
|
+
- **Move completed work to changelog:** Record completed work in CHANGELOG.md, not in task lists
|
|
89
|
+
- **Keep task lists current:** Update completed items with current status instead of maintaining "completed" sections
|
|
90
|
+
- **Use descriptive section names:** Use functional names like "Core Features", "Infrastructure", "Testing" instead of "Completed Tasks"
|
|
91
|
+
- **Avoid temporal references:** Don't use "Recent", "Latest", "Upcoming" in section headers - they become outdated quickly
|
|
92
|
+
|
|
93
|
+
## README.md Standards (System Documentation)
|
|
94
|
+
|
|
95
|
+
**⚠️ README.md is system documentation - NO status indicators or temporal language allowed**
|
|
96
|
+
|
|
97
|
+
- **Project Overview:** Keep description current with latest capabilities using factual, present-tense language
|
|
98
|
+
- **Installation Instructions:** Verify and update installation steps with clear, current procedures
|
|
99
|
+
- **Usage Examples:** Ensure all code examples are tested and working, describe what they do
|
|
100
|
+
- **Feature Documentation:** Document all major features with examples using factual descriptions
|
|
101
|
+
- **Version Badges:** Keep version badges synchronized with package.json
|
|
102
|
+
- **Links Verification:** Regularly check that all links work correctly
|
|
103
|
+
- **Screenshots/GIFs:** Update visual documentation when UI changes
|
|
104
|
+
- **Avoid Status Language:** Never use "planned", "upcoming", "in progress", or status emojis
|
|
105
|
+
- **Examples:**
|
|
106
|
+
- ✅ Correct: "The CLI provides three commands for project setup"
|
|
107
|
+
- ❌ Incorrect: "🚧 CLI commands (in development)"
|
|
108
|
+
- ✅ Correct: "Authentication uses JWT tokens with refresh capability"
|
|
109
|
+
- ❌ Incorrect: "Authentication system (planned for v2.0)"
|
|
110
|
+
|
|
111
|
+
## CHANGELOG.md Maintenance
|
|
112
|
+
|
|
113
|
+
- **User-Facing Changes:** Document all changes that affect users
|
|
114
|
+
- **Consistent Format:** Follow established changelog format
|
|
115
|
+
- **Categorization:** Group changes appropriately (Added, Changed, Fixed, etc.)
|
|
116
|
+
- **Breaking Changes:** Clearly mark breaking changes
|
|
117
|
+
- **Migration Guides:** Provide migration guidance for breaking changes
|
|
118
|
+
|
|
119
|
+
## Code Documentation
|
|
120
|
+
|
|
121
|
+
- **JSDoc Comments:** Update JSDoc comments when changing public APIs
|
|
122
|
+
- **Inline Comments:** Add comments for complex logic, not obvious code
|
|
123
|
+
- **Function Documentation:** Document parameters, return values, and side effects
|
|
124
|
+
- **Class Documentation:** Explain class purpose, responsibilities, and usage patterns
|
|
125
|
+
- **Type Documentation:** Document complex TypeScript types and interfaces
|
|
126
|
+
|
|
127
|
+
## API Documentation
|
|
128
|
+
|
|
129
|
+
- **Endpoint Documentation:** Keep API endpoint documentation current
|
|
130
|
+
- **Parameter Changes:** Update parameter descriptions for any modifications
|
|
131
|
+
- **Response Examples:** Provide realistic response examples
|
|
132
|
+
- **Error Handling:** Document error responses and status codes
|
|
133
|
+
- **Authentication:** Keep authentication documentation accurate
|
|
134
|
+
|
|
135
|
+
## Architectural Documentation (System Documentation)
|
|
136
|
+
|
|
137
|
+
**⚠️ Architecture docs are system documentation - NO status indicators or temporal language allowed**
|
|
138
|
+
|
|
139
|
+
- **Decision Records:** Record significant architectural decisions in `/meta` folder using factual language
|
|
140
|
+
- **System Overview:** Maintain high-level system architecture documentation describing current implementation
|
|
141
|
+
- **Data Flow:** Document data flow and process workflows as they currently exist
|
|
142
|
+
- **Integration Points:** Document external system integrations that are implemented
|
|
143
|
+
- **Performance Considerations:** Document performance implications of current design decisions
|
|
144
|
+
- **Examples:**
|
|
145
|
+
- ✅ Correct: "The system uses a microservices architecture with three main services"
|
|
146
|
+
- ❌ Incorrect: "🏗️ Microservices architecture (under development)"
|
|
147
|
+
- ✅ Correct: "Data flows through the validation layer before storage"
|
|
148
|
+
- ❌ Incorrect: "Data validation layer (planned implementation)"
|
|
149
|
+
|
|
150
|
+
## Code Examples and Tutorials
|
|
151
|
+
|
|
152
|
+
- **Working Examples:** Ensure all code examples compile and run
|
|
153
|
+
- **Complete Examples:** Provide complete, runnable examples when possible
|
|
154
|
+
- **Progressive Complexity:** Start with simple examples, build to complex ones
|
|
155
|
+
- **Error Handling:** Show proper error handling in examples
|
|
156
|
+
- **Best Practices:** Demonstrate best practices in example code
|
|
157
|
+
|
|
158
|
+
## Test Documentation Standards
|
|
159
|
+
|
|
160
|
+
Follow the standardized table format for all test case documentation:
|
|
161
|
+
|
|
162
|
+
### Required Table Format
|
|
163
|
+
|
|
164
|
+
```markdown
|
|
165
|
+
| Test Case ID | Description | Type | Status |
|
|
166
|
+
| :------------ | :------------------------------------------ | :--- | :-------- |
|
|
167
|
+
| AREA-TYPE-001 | Brief but descriptive test case description | Unit | Completed |
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Test Case ID Conventions
|
|
171
|
+
|
|
172
|
+
- **Format:** `[AREA]-[TYPE]-[NUMBER]`
|
|
173
|
+
- **Area Prefixes (React/Frontend):** COMP, HOOK, PAGE, STORE, API, UTIL, AUTH, FORM, DOC, E2E, INT
|
|
174
|
+
- **Type Suffixes:** UNIT, INT, E2E
|
|
175
|
+
- **Sequential Numbering:** 001, 002, 003, etc.
|
|
176
|
+
|
|
177
|
+
### Table Organization Requirements
|
|
178
|
+
|
|
179
|
+
- **Functional Grouping:** Group test cases by system area/component
|
|
180
|
+
- **Consistent Formatting:** Maintain proper column alignment using pipes
|
|
181
|
+
- **Clear Headers:** Use descriptive section headers (e.g., "Template System", "CLI Commands")
|
|
182
|
+
- **Status Tracking:** Use simple status values: "Completed", "In Progress", "Not Started"
|
|
183
|
+
|
|
184
|
+
### Documentation Testing
|
|
185
|
+
|
|
186
|
+
- **Link Checking:** Regularly verify all links work
|
|
187
|
+
- **Code Testing:** Test all code examples in documentation
|
|
188
|
+
- **Installation Testing:** Verify installation instructions work in clean environment
|
|
189
|
+
- **User Testing:** Occasionally have someone unfamiliar try following docs
|
|
190
|
+
|
|
191
|
+
## Maintenance Schedule
|
|
192
|
+
|
|
193
|
+
- **Regular Review:** Schedule regular documentation review cycles
|
|
194
|
+
- **Release Updates:** Update documentation as part of release process
|
|
195
|
+
- **Issue Tracking:** Track documentation issues and improvements
|
|
196
|
+
- **Community Feedback:** Incorporate user feedback on documentation clarity
|
|
197
|
+
|
|
198
|
+
## Localization Considerations
|
|
199
|
+
|
|
200
|
+
- **Clear English:** Use clear, simple English for international audiences
|
|
201
|
+
- **Cultural Sensitivity:** Avoid culture-specific references
|
|
202
|
+
- **Technical Terms:** Define technical terms when first introduced
|
|
203
|
+
- **Consistent Terminology:** Use consistent terminology throughout
|