metacoding 1.0.0 → 1.1.1

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +79 -42
  2. package/LICENSE +1 -1
  3. package/lib/commands/init.d.ts.map +1 -1
  4. package/lib/commands/init.js +1 -1
  5. package/lib/commands/init.js.map +1 -1
  6. package/lib/services/template-manager.d.ts +4 -1
  7. package/lib/services/template-manager.d.ts.map +1 -1
  8. package/lib/services/template-manager.js +129 -10
  9. package/lib/services/template-manager.js.map +1 -1
  10. package/lib/services/vscode.js +1 -1
  11. package/lib/services/vscode.js.map +1 -1
  12. package/package.json +12 -4
  13. package/templates/general/code-review.instructions.md +265 -0
  14. package/templates/general/{files/copilot-instructions.md.template → copilot-instructions.md} +97 -140
  15. package/templates/{python/files → general}/docs-update.instructions.md +45 -32
  16. package/templates/general/release.instructions.md +242 -0
  17. package/templates/general/test-runner.instructions.md +188 -0
  18. package/templates/node/nodejs.coding.instructions.md +249 -0
  19. package/templates/node/nodejs.docs.instructions.md +234 -0
  20. package/templates/node/nodejs.testing.instructions.md +373 -0
  21. package/templates/python/python.coding.instructions.md +339 -0
  22. package/templates/python/python.docs.instructions.md +1147 -0
  23. package/templates/python/python.testing.instructions.md +1074 -0
  24. package/templates/react/react.coding.instructions.md +695 -0
  25. package/templates/react/react.docs.instructions.md +427 -0
  26. package/templates/react/react.testing.instructions.md +193 -0
  27. package/templates/react/test-runner.instructions.md +135 -0
  28. package/templates/typescript/template.json +16 -0
  29. package/templates/typescript/typescript.coding.instructions.md +368 -0
  30. package/templates/typescript/typescript.docs.instructions.md +734 -0
  31. package/templates/typescript/typescript.testing.instructions.md +740 -0
  32. package/templates/general/files/code-review.instructions.md +0 -111
  33. package/templates/general/files/docs-update.instructions.md +0 -203
  34. package/templates/general/files/release.instructions.md +0 -72
  35. package/templates/general/files/test-runner.instructions.md +0 -107
  36. package/templates/node/files/code-review.instructions.md +0 -222
  37. package/templates/node/files/copilot-instructions.md.template +0 -391
  38. package/templates/node/files/docs-update.instructions.md +0 -203
  39. package/templates/node/files/release.instructions.md +0 -72
  40. package/templates/node/files/test-runner.instructions.md +0 -108
  41. package/templates/python/files/code-review.instructions.md +0 -215
  42. package/templates/python/files/copilot-instructions.md.template +0 -418
  43. package/templates/python/files/release.instructions.md +0 -72
  44. package/templates/python/files/test-runner.instructions.md +0 -108
  45. package/templates/react/files/code-review.instructions.md +0 -160
  46. package/templates/react/files/copilot-instructions.md.template +0 -472
  47. package/templates/react/files/docs-update.instructions.md +0 -203
  48. package/templates/react/files/release.instructions.md +0 -72
  49. package/templates/react/files/test-runner.instructions.md +0 -108
@@ -1,111 +0,0 @@
1
- ---
2
- description: 'Automated code review checklist'
3
- applyTo: '**'
4
- ---
5
-
6
- # Code Review Focus Areas
7
-
8
- ## Functionality Assessment
9
-
10
- - **Requirements Compliance:** Does the code meet the specified requirements?
11
- - **Edge Cases:** Are edge cases properly handled?
12
- - **Error Scenarios:** How does the code behave with invalid inputs?
13
- - **Business Logic:** Is the business logic correctly implemented?
14
- - **Integration Points:** Do integrations with other components work correctly?
15
-
16
- ## Code Quality and Readability
17
-
18
- - **Naming Conventions:** Are variables, functions, and classes named clearly?
19
- - **Code Structure:** Is the code well-organized and logically structured?
20
- - **Function Size:** Are functions focused and reasonably sized (< 50 lines)?
21
- - **Complexity:** Is the code unnecessarily complex or could it be simplified?
22
- - **Comments:** Are comments helpful and explain "why" not "what"?
23
- - **Consistency:** Does the code follow established project patterns?
24
-
25
- ## Performance Considerations
26
-
27
- - **Algorithm Efficiency:** Are appropriate algorithms and data structures used?
28
- - **Memory Usage:** Are there potential memory leaks or excessive memory usage?
29
- - **Database Queries:** Are database queries optimized and avoid N+1 problems?
30
- - **Async Operations:** Are async operations used appropriately for I/O?
31
- - **Caching:** Are caching opportunities identified and implemented correctly?
32
- - **Resource Management:** Are resources properly acquired and released?
33
-
34
- ## Security Review
35
-
36
- - **Input Validation:** Are all inputs properly validated and sanitized?
37
- - **Authentication:** Are authentication checks in place where needed?
38
- - **Authorization:** Are authorization checks appropriate for the functionality?
39
- - **Data Exposure:** Is sensitive data properly protected?
40
- - **Injection Attacks:** Are SQL injection and other injection attacks prevented?
41
- - **Encryption:** Is sensitive data encrypted appropriately?
42
-
43
- ## Testing and Testability
44
-
45
- - **Test Coverage:** Are there sufficient tests for the new functionality?
46
- - **Test Quality:** Are tests meaningful and test the right things?
47
- - **Testability:** Is the code structured to be easily testable?
48
- - **Mocking:** Are external dependencies properly mocked in tests?
49
- - **Integration Tests:** Are integration points covered by appropriate tests?
50
- - **Regression Protection:** Do tests protect against known regression issues?
51
-
52
- ## Error Handling and Logging
53
-
54
- - **Exception Handling:** Are exceptions handled appropriately?
55
- - **Error Messages:** Are error messages helpful for debugging?
56
- - **Logging:** Is appropriate logging in place for debugging and monitoring?
57
- - **Graceful Degradation:** Does the system handle failures gracefully?
58
- - **Recovery:** Are there appropriate recovery mechanisms?
59
-
60
- ## Documentation and Maintenance
61
-
62
- - **Code Documentation:** Is the code self-documenting or properly commented?
63
- - **API Documentation:** Are public APIs documented with JSDoc?
64
- - **Breaking Changes:** Are breaking changes clearly identified and documented?
65
- - **Migration Guides:** Are migration paths provided for breaking changes?
66
- - **Changelog Updates:** Are user-facing changes documented in changelog?
67
-
68
- ## Standards Compliance
69
-
70
- - **Coding Standards:** Does the code follow project coding standards?
71
- - **Architectural Patterns:** Are established architectural patterns followed?
72
- - **Dependency Management:** Are new dependencies justified and properly managed?
73
- - **Configuration:** Are configuration changes handled appropriately?
74
- - **Version Compatibility:** Is backwards compatibility maintained where required?
75
-
76
- ## Common Anti-Patterns to Flag
77
-
78
- - **Deep Nesting:** Excessive if/else or try/catch nesting
79
- - **God Objects:** Classes or functions with too many responsibilities
80
- - **Magic Numbers:** Hardcoded values without explanation
81
- - **Copy-Paste Code:** Duplicated code that should be refactored
82
- - **Tight Coupling:** Components that are too dependent on each other
83
- - **Memory Leaks:** Objects not properly cleaned up
84
- - **Temporary File Pollution:** Leaving debug files, temp outputs, or experimental code in repository
85
- - **Blocking Operations:** Synchronous operations that could block the main thread
86
-
87
- ## Review Process Guidelines
88
-
89
- - **Constructive Feedback:** Provide specific, actionable feedback
90
- - **Explain Reasoning:** Explain why changes are needed
91
- - **Suggest Alternatives:** Offer alternative approaches when applicable
92
- - **Acknowledge Good Work:** Recognize well-written code and good practices
93
- - **Focus on Code:** Keep feedback focused on code, not personal
94
- - **Prioritize Issues:** Distinguish between critical issues and suggestions
95
-
96
- ## Automated Checks to Verify
97
-
98
- - **Linting:** Code passes linting rules
99
- - **Formatting:** Code follows formatting standards
100
- - **Type Checking:** TypeScript compilation succeeds without errors
101
- - **Tests:** All tests pass including new and existing ones
102
- - **Build:** Code builds successfully
103
- - **Security Scans:** Automated security scans pass
104
-
105
- ## File and Repository Hygiene
106
-
107
- - **Temporary Files:** Are all temporary files, debug outputs, and experimental code removed?
108
- - **File Organization:** Are files placed in appropriate directories according to project structure?
109
- - **Cleanup Verification:** Has development session cleanup been performed before commit?
110
- - **Test Fixtures:** Are temporary test files moved to appropriate `/test/fixtures/` location?
111
- - **Repository State:** Is the repository in a clean state without orphaned files?
@@ -1,203 +0,0 @@
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 (adapt to your project):** CORE, API, UI, DB, AUTH, UTIL, CONFIG, 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
@@ -1,72 +0,0 @@
1
- ---
2
- description: "Step-by-step release process automation"
3
- applyTo: "package.json"
4
- ---
5
-
6
- # Release Process Checklist
7
-
8
- ## Pre-Release Validation
9
- 1. **Test Suite:** Verify all tests pass: `npm test`
10
- 2. **Build Verification:** Ensure clean build without errors: `npm run build`
11
- 3. **Linting:** Check code quality standards: `npm run lint`
12
- 4. **Dependencies:** Review and update dependencies if needed
13
- 5. **Security Audit:** Run security audit: `npm audit`
14
-
15
- ## Version Management
16
- 1. **Semantic Versioning:** Update version in package.json following SemVer:
17
- - **MAJOR:** Breaking changes (X.0.0)
18
- - **MINOR:** New features, backward compatible (0.X.0)
19
- - **PATCH:** Bug fixes, backward compatible (0.0.X)
20
- 2. **Version Consistency:** Ensure version matches across all relevant files
21
- 3. **Breaking Changes:** Document breaking changes prominently in changelog
22
-
23
- ## Documentation Updates
24
- 1. **README.md Updates:**
25
- - Update version badges to match package.json version
26
- - Refresh installation instructions if needed
27
- - Update feature descriptions for new capabilities
28
- - Verify all links and examples work correctly
29
- 2. **API Documentation:** Update API docs for any interface changes
30
-
31
- ## Changelog Management
32
- 1. **Add New Entry:** Create new section in CHANGELOG.md with:
33
- - Release version number (matching package.json)
34
- - Release date in YYYY-MM-DD format
35
- - Grouped changes by category:
36
- - **Added:** New features
37
- - **Changed:** Changes in existing functionality
38
- - **Deprecated:** Soon-to-be removed features
39
- - **Removed:** Now removed features
40
- - **Fixed:** Bug fixes
41
- - **Security:** Security vulnerability fixes
42
- 2. **Entry Guidelines:**
43
- - Keep entries brief but descriptive (1-2 lines per change)
44
- - Focus on user impact rather than technical implementation
45
- - Reference issue/PR numbers when applicable: `(#123)`
46
- - Highlight breaking changes with ⚠️ or **BREAKING:**
47
-
48
- ## Git Operations
49
- 1. **Commit Changes:** Stage all release-related changes
50
- 2. **Commit Message:** Use format: `chore: bump version to vX.Y.Z`
51
- 3. **Create Tag:** Tag the commit with version number: `git tag vX.Y.Z`
52
- 4. **Push Changes:** Push commits and tags: `git push && git push --tags`
53
-
54
- ## GitHub Release
55
- 1. **Create Release:** Create GitHub release with tag matching package.json version
56
- 2. **Release Title:** Use format: `vX.Y.Z - [Brief description]`
57
- 3. **Release Notes:**
58
- - Copy relevant sections from CHANGELOG.md
59
- - Include installation instructions
60
- - Highlight major changes and breaking changes
61
- - Thank contributors if applicable
62
-
63
- ## Post-Release Verification
64
- 1. **Package Registry:** Verify package published correctly (if applicable)
65
- 2. **Installation Test:** Test installation from registry in clean environment
66
- 3. **Documentation Links:** Ensure all documentation links work correctly
67
- 4. **Monitor Issues:** Watch for any immediate issues reported by users
68
-
69
- ## Rollback Plan
70
- - **Git Revert:** Know how to revert problematic releases
71
- - **Package Unpublish:** Understand package registry policies for unpublishing
72
- - **Communication:** Prepare communication strategy for critical issues
@@ -1,107 +0,0 @@
1
- ---
2
- description: 'Instructions for running and maintaining tests'
3
- applyTo: 'test/**/*.ts'
4
- ---
5
-
6
- # Test Execution Guidelines
7
-
8
- ## Pre-Commit Testing
9
-
10
- - Run all tests before committing changes: `npm test`
11
- - Ensure tests pass in both development and CI environments
12
- - Fix failing tests before proceeding with commits
13
- - Run specific test suites for targeted changes when appropriate
14
-
15
- ## Test Development Standards
16
-
17
- - **New Features:** Ensure all new features have corresponding unit tests
18
- - **Test Coverage:** Aim for high coverage of critical functionality paths
19
- - **Test Documentation:** Follow table format in `test/test-documentation.md` for all test cases
20
- - **Test Organization:** Group related tests in describe blocks with clear hierarchy
21
-
22
- ## Test Case Documentation Format
23
-
24
- All test cases must be documented using the standardized table format:
25
-
26
- ```markdown
27
- | Test Case ID | Description | Type | Status |
28
- | :------------ | :------------------------------------------ | :--- | :-------- |
29
- | AREA-TYPE-001 | Brief but descriptive test case description | Unit | Completed |
30
- ```
31
-
32
- ## Test Case Naming Conventions
33
-
34
- ### Test Case ID Format: `[AREA]-[TYPE]-[NUMBER]`
35
-
36
- **Area Prefixes (adapt to your project):**
37
-
38
- - `CORE` - Core application logic tests
39
- - `API` - API/Service layer tests
40
- - `UI` - User interface component tests
41
- - `DB` - Database/Data layer tests
42
- - `AUTH` - Authentication/Authorization tests
43
- - `UTIL` - Utility function tests
44
- - `CONFIG` - Configuration management tests
45
- - `DOC` - Documentation Quality tests
46
- - `E2E` - End-to-End workflow tests
47
- - `INT` - Integration tests
48
-
49
- **Type Suffixes:**
50
-
51
- - `UNIT` - Unit tests
52
- - `INT` - Integration tests
53
- - `E2E` - End-to-end tests
54
-
55
- **Examples:**
56
-
57
- - `CORE-UNIT-001` - First unit test for Core Logic
58
- - `API-UNIT-001` - First unit test for API Layer
59
- - `DB-INT-001` - First integration test for Database
60
- - `E2E-WF-001` - First end-to-end workflow test
61
-
62
- ### Test Method Naming
63
-
64
- - Format: `methodName_scenario_expectedOutcome`
65
- - Example: `getUserById_userExists_returnsUserObject`
66
- - Use camelCase for all test method names
67
-
68
- ## Test Data Management
69
-
70
- - **Fixtures:** Update test fixtures when data structures change
71
- - **Realistic Data:** Use realistic data in integration tests to catch real-world issues
72
- - **Mock Strategy:** Mock external dependencies in unit tests for isolation
73
- - **Test Database:** Use separate test database/environment for integration tests
74
- - **Temporary File Cleanup:** Clean up all temporary test files, debug outputs, and mock data after test execution
75
- - **Fixture Organization:** Move reusable test data to `/test/fixtures/` directory for proper organization
76
-
77
- ## Test File Hygiene
78
-
79
- - **No Orphaned Files:** Remove temporary test files created during debugging or development
80
- - **Debug Output Cleanup:** Remove console.log statements and debug files before committing
81
- - **Test Artifact Management:** Ensure test screenshots, logs, and reports are properly managed or cleaned up
82
- - **Resource Management:** Properly dispose of file handles, database connections, and other test resources
83
-
84
- ## Test Types and Patterns
85
-
86
- - **Unit Tests:** Test individual functions, methods, and components in isolation
87
- - **Integration Tests:** Test feature workflows and component interactions
88
- - **End-to-End Tests:** Test complete user scenarios and workflows
89
- - **Regression Tests:** Add tests for previously fixed bugs to prevent recurrence
90
-
91
- ## Performance Testing
92
-
93
- - **Test Execution Speed:** Keep unit tests fast (under 100ms each when possible)
94
- - **Parallel Execution:** Structure tests to run safely in parallel
95
- - **Resource Cleanup:** Ensure proper cleanup of test resources and temporary data
96
- - **Memory Management:** Monitor and prevent memory leaks in long-running test suites
97
-
98
- ## Test Maintenance
99
-
100
- - **Regular Review:** Periodically review and refactor outdated tests
101
- - **Documentation:** Document complex test scenarios and their purposes
102
- - **Continuous Updates:** Update tests when requirements or APIs change
103
- - **Test Quality:** Apply the same code quality standards to test code as production code
104
- - **Update test-documentation.md:** Add new test cases to the appropriate table section
105
- - **Status Tracking:** Update test status as development progresses
106
- - **Table Format:** Maintain consistent table formatting and column alignment
107
- - **ID Assignment:** Assign sequential IDs within each area (AREA-TYPE-001, AREA-TYPE-002, etc.)