@meltstudio/meltctl 1.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/dist/commands/project/init.d.ts +6 -0
- package/dist/commands/project/init.js +665 -0
- package/dist/commands/project/update.d.ts +1 -0
- package/dist/commands/project/update.js +15 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +22 -0
- package/package.json +65 -0
- package/templates/cursor-commands/melt-debug.md +43 -0
- package/templates/cursor-commands/melt-implement.md +43 -0
- package/templates/cursor-commands/melt-plan.md +49 -0
- package/templates/cursor-commands/melt-review.md +43 -0
- package/templates/cursor-commands/plan.md +49 -0
|
@@ -0,0 +1,665 @@
|
|
|
1
|
+
import { intro, outro, select, confirm, spinner } from '@clack/prompts';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
4
|
+
import { join, dirname } from 'path';
|
|
5
|
+
import { platform } from 'os';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
const SHELL_CHOICES = {
|
|
8
|
+
sh: 'POSIX Shell (bash/zsh)',
|
|
9
|
+
ps: 'PowerShell',
|
|
10
|
+
};
|
|
11
|
+
export async function initCommand(options = {}) {
|
|
12
|
+
intro(chalk.blue('🚀 Melt Project - Initialize'));
|
|
13
|
+
const currentDir = process.cwd();
|
|
14
|
+
// Check if directories already exist
|
|
15
|
+
const cursorDir = join(currentDir, '.cursor', 'commands');
|
|
16
|
+
const meltDir = join(currentDir, '.melt');
|
|
17
|
+
const existingPaths = [];
|
|
18
|
+
if (existsSync(cursorDir))
|
|
19
|
+
existingPaths.push('.cursor/commands/');
|
|
20
|
+
if (existsSync(meltDir))
|
|
21
|
+
existingPaths.push('.melt/');
|
|
22
|
+
if (existingPaths.length > 0 && !options.force) {
|
|
23
|
+
console.log(chalk.yellow('⚠️ The following directories already exist:'));
|
|
24
|
+
existingPaths.forEach(path => console.log(` • ${path}`));
|
|
25
|
+
console.log();
|
|
26
|
+
const shouldContinue = await confirm({
|
|
27
|
+
message: 'Do you want to continue? This may overwrite existing files.',
|
|
28
|
+
});
|
|
29
|
+
if (!shouldContinue) {
|
|
30
|
+
outro(chalk.gray('Operation cancelled.'));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// Shell selection (explicit, auto-detect, or interactive)
|
|
35
|
+
let selectedShell;
|
|
36
|
+
if (options.shell) {
|
|
37
|
+
selectedShell = options.shell;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Auto-detect based on platform
|
|
41
|
+
const defaultShell = platform() === 'win32' ? 'ps' : 'sh';
|
|
42
|
+
// Interactive selection with default
|
|
43
|
+
selectedShell = (await select({
|
|
44
|
+
message: 'Choose script type:',
|
|
45
|
+
options: [
|
|
46
|
+
{ value: 'sh', label: SHELL_CHOICES.sh, hint: defaultShell === 'sh' ? 'default' : '' },
|
|
47
|
+
{ value: 'ps', label: SHELL_CHOICES.ps, hint: defaultShell === 'ps' ? 'default' : '' },
|
|
48
|
+
],
|
|
49
|
+
initialValue: defaultShell,
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
console.log(chalk.cyan(`Selected shell: ${SHELL_CHOICES[selectedShell]}`));
|
|
53
|
+
console.log();
|
|
54
|
+
const s = spinner();
|
|
55
|
+
s.start('Setting up Melt development workspace...');
|
|
56
|
+
try {
|
|
57
|
+
// Create directory structures
|
|
58
|
+
createDirectoryStructure(currentDir, selectedShell);
|
|
59
|
+
// Copy templates
|
|
60
|
+
await copyTemplates(currentDir, selectedShell);
|
|
61
|
+
// Create version file
|
|
62
|
+
createVersionFile(meltDir);
|
|
63
|
+
s.stop('✅ Workspace setup complete!');
|
|
64
|
+
console.log();
|
|
65
|
+
console.log(chalk.green('🎉 Melt development workspace initialized!'));
|
|
66
|
+
console.log();
|
|
67
|
+
console.log('Created directories:');
|
|
68
|
+
console.log(` • ${chalk.cyan('.cursor/commands/')}`);
|
|
69
|
+
console.log(` • ${chalk.cyan('.melt/memory/')}`);
|
|
70
|
+
console.log(` • ${chalk.cyan('.melt/outputs/plans/')}`);
|
|
71
|
+
console.log(` • ${chalk.cyan('.melt/outputs/implementations/')}`);
|
|
72
|
+
console.log(` • ${chalk.cyan('.melt/outputs/reviews/')}`);
|
|
73
|
+
console.log(` • ${chalk.cyan('.melt/scripts/' + selectedShell + '/')}`);
|
|
74
|
+
console.log(` • ${chalk.cyan('.melt/templates/')}`);
|
|
75
|
+
console.log();
|
|
76
|
+
console.log('Next steps:');
|
|
77
|
+
console.log(' 1. Start using Cursor commands:');
|
|
78
|
+
console.log(` • ${chalk.cyan('/melt-implement')} - Execute implementation with Melt standards`);
|
|
79
|
+
console.log(` • ${chalk.cyan('/melt-plan')} - Create implementation plans`);
|
|
80
|
+
console.log(` • ${chalk.cyan('/melt-review')} - Review code with domain architecture`);
|
|
81
|
+
console.log(` • ${chalk.cyan('/melt-debug')} - Debug issues systematically`);
|
|
82
|
+
console.log(' 2. Customize templates in .melt/templates/');
|
|
83
|
+
console.log(` 3. Use utility scripts in .melt/scripts/${selectedShell}/`);
|
|
84
|
+
outro(chalk.green('Happy coding with Melt! 🚀'));
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
s.stop('❌ Setup failed');
|
|
88
|
+
console.error(chalk.red('Error during setup:'), error);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function createDirectoryStructure(baseDir, shell) {
|
|
93
|
+
const dirs = [
|
|
94
|
+
'.cursor/commands',
|
|
95
|
+
'.melt/memory',
|
|
96
|
+
'.melt/outputs/plans',
|
|
97
|
+
'.melt/outputs/implementations',
|
|
98
|
+
'.melt/outputs/reviews',
|
|
99
|
+
`.melt/scripts/${shell}`,
|
|
100
|
+
'.melt/templates',
|
|
101
|
+
];
|
|
102
|
+
dirs.forEach(dir => {
|
|
103
|
+
const fullPath = join(baseDir, dir);
|
|
104
|
+
mkdirSync(fullPath, { recursive: true });
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
async function copyTemplates(baseDir, shell) {
|
|
108
|
+
// For now, we'll create basic templates inline
|
|
109
|
+
// TODO: Copy from bundled templates directory
|
|
110
|
+
const cursorCommands = {
|
|
111
|
+
'melt-plan.md': getPlanTemplate(),
|
|
112
|
+
'melt-test-plan.md': getTestPlanTemplate(),
|
|
113
|
+
'melt-docs.md': getDocsTemplate(),
|
|
114
|
+
'melt-implement.md': getImplementTemplate(),
|
|
115
|
+
'melt-pr.md': getPrTemplate(),
|
|
116
|
+
'melt-review.md': getReviewTemplate(),
|
|
117
|
+
'melt-complete.md': getCompleteTemplate(),
|
|
118
|
+
'melt-debug.md': getDebugTemplate(),
|
|
119
|
+
};
|
|
120
|
+
for (const [filename, content] of Object.entries(cursorCommands)) {
|
|
121
|
+
const filePath = join(baseDir, '.cursor', 'commands', filename);
|
|
122
|
+
writeFileSync(filePath, content, 'utf8');
|
|
123
|
+
}
|
|
124
|
+
// Create initial context file
|
|
125
|
+
const contextPath = join(baseDir, '.melt', 'memory', 'context.md');
|
|
126
|
+
writeFileSync(contextPath, getInitialContext(), 'utf8');
|
|
127
|
+
// Create basic shell utility (cross-platform)
|
|
128
|
+
const scriptExt = shell === 'ps' ? 'ps1' : 'sh';
|
|
129
|
+
const scriptPath = join(baseDir, '.melt', 'scripts', shell, `common.${scriptExt}`);
|
|
130
|
+
const scriptContent = shell === 'ps' ? getPowerShellCommon() : getBashCommon();
|
|
131
|
+
writeFileSync(scriptPath, scriptContent, 'utf8');
|
|
132
|
+
}
|
|
133
|
+
function createVersionFile(meltDir) {
|
|
134
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
135
|
+
const __dirname = dirname(__filename);
|
|
136
|
+
const packageJson = JSON.parse(readFileSync(join(__dirname, '../../package.json'), 'utf8'));
|
|
137
|
+
const versionData = {
|
|
138
|
+
cliVersion: packageJson.version,
|
|
139
|
+
initialized: new Date().toISOString(),
|
|
140
|
+
lastUpdate: new Date().toISOString(),
|
|
141
|
+
};
|
|
142
|
+
const versionPath = join(meltDir, 'version.json');
|
|
143
|
+
writeFileSync(versionPath, JSON.stringify(versionData, null, 2), 'utf8');
|
|
144
|
+
}
|
|
145
|
+
// Template content functions
|
|
146
|
+
function getImplementTemplate() {
|
|
147
|
+
return `---
|
|
148
|
+
description: Execute implementation using Melt development standards and domain-driven architecture
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
You are implementing a feature following Melt's domain-driven development process. Follow these steps:
|
|
152
|
+
|
|
153
|
+
1. **Load Context**:
|
|
154
|
+
- Read \`.melt/memory/context.md\` for project context and requirements
|
|
155
|
+
- Check \`.melt/outputs/plans/\` for any existing implementation plans
|
|
156
|
+
- Review relevant domain structure in \`src/domains/\` if it exists
|
|
157
|
+
|
|
158
|
+
2. **Architecture Compliance**:
|
|
159
|
+
- Follow React 2025 standards (functional components, hooks, TypeScript strict)
|
|
160
|
+
- Use domain-driven design with clear separation of concerns
|
|
161
|
+
- Implement server components by default, client components when needed
|
|
162
|
+
- Use Zod for all data validation
|
|
163
|
+
- Follow Tailwind CSS for styling
|
|
164
|
+
|
|
165
|
+
3. **Implementation Process**:
|
|
166
|
+
- Create/update domain structures under \`src/domains/[domain]/\`
|
|
167
|
+
- Implement components in \`src/domains/[domain]/components/\`
|
|
168
|
+
- Add business logic in \`src/domains/[domain]/hooks/\` and \`src/domains/[domain]/services/\`
|
|
169
|
+
- Create types in \`src/domains/[domain]/types/\`
|
|
170
|
+
- Add tests in \`src/domains/[domain]/__tests__/\`
|
|
171
|
+
|
|
172
|
+
4. **Quality Standards**:
|
|
173
|
+
- Ensure 80% test coverage minimum
|
|
174
|
+
- Use TypeScript strict mode
|
|
175
|
+
- Add proper JSDoc documentation
|
|
176
|
+
- Follow atomic commit principles
|
|
177
|
+
- No debugging code in commits
|
|
178
|
+
|
|
179
|
+
5. **Documentation**:
|
|
180
|
+
- Update \`.melt/memory/context.md\` with implementation details
|
|
181
|
+
- Save implementation notes to \`.melt/outputs/implementations/[timestamp].md\`
|
|
182
|
+
- Update relevant README files if needed
|
|
183
|
+
|
|
184
|
+
6. **Testing**:
|
|
185
|
+
- Write unit tests for all business logic
|
|
186
|
+
- Add integration tests for complex workflows
|
|
187
|
+
- Ensure all tests pass before completing
|
|
188
|
+
|
|
189
|
+
Remember: Focus on clean, maintainable code that follows our established patterns and domain boundaries.`;
|
|
190
|
+
}
|
|
191
|
+
function getPlanTemplate() {
|
|
192
|
+
return `---
|
|
193
|
+
description: Create implementation plan following Melt's domain-driven architecture standards
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
Create a comprehensive implementation plan for the requested feature. Follow these steps:
|
|
197
|
+
|
|
198
|
+
1. **Analyze Requirements**:
|
|
199
|
+
- Read \`.melt/memory/context.md\` for project context and constraints
|
|
200
|
+
- Identify the target domain(s) this feature belongs to
|
|
201
|
+
- Determine integration points with existing domains
|
|
202
|
+
|
|
203
|
+
2. **Architecture Planning**:
|
|
204
|
+
- Design domain structure following our patterns:
|
|
205
|
+
\`\`\`
|
|
206
|
+
src/domains/[domain]/
|
|
207
|
+
├── components/ # React components
|
|
208
|
+
├── hooks/ # Custom hooks for business logic
|
|
209
|
+
├── services/ # API calls and external integrations
|
|
210
|
+
├── types/ # TypeScript types and Zod schemas
|
|
211
|
+
├── utils/ # Domain-specific utilities
|
|
212
|
+
└── __tests__/ # Domain tests
|
|
213
|
+
\`\`\`
|
|
214
|
+
- Plan component hierarchy and state management
|
|
215
|
+
- Design data flow and API integration points
|
|
216
|
+
|
|
217
|
+
3. **Technical Decisions**:
|
|
218
|
+
- Choose appropriate React patterns (server vs client components)
|
|
219
|
+
- Plan Zod schemas for data validation
|
|
220
|
+
- Design TypeScript interfaces and types
|
|
221
|
+
- Plan testing strategy (unit, integration, e2e)
|
|
222
|
+
|
|
223
|
+
4. **Implementation Strategy**:
|
|
224
|
+
- Break down into atomic, testable units
|
|
225
|
+
- Identify dependencies and execution order
|
|
226
|
+
- Plan for error handling and edge cases
|
|
227
|
+
- Consider accessibility and performance requirements
|
|
228
|
+
|
|
229
|
+
5. **Create Detailed Plan**:
|
|
230
|
+
- List specific files to create/modify
|
|
231
|
+
- Define component interfaces and props
|
|
232
|
+
- Specify API endpoints and data contracts
|
|
233
|
+
- Plan test cases and coverage targets
|
|
234
|
+
|
|
235
|
+
6. **Save Planning Output**:
|
|
236
|
+
- Save comprehensive plan to \`.melt/outputs/plans/[timestamp]-plan.md\`
|
|
237
|
+
- Update \`.melt/memory/context.md\` with planning decisions
|
|
238
|
+
- Create task breakdown for implementation
|
|
239
|
+
|
|
240
|
+
Focus on maintainable, testable code that follows our domain-driven architecture principles.`;
|
|
241
|
+
}
|
|
242
|
+
function getReviewTemplate() {
|
|
243
|
+
return `---
|
|
244
|
+
description: Review code following Melt's quality standards and architecture compliance
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
Perform a comprehensive code review following Melt's standards:
|
|
248
|
+
|
|
249
|
+
1. **Architecture Review**:
|
|
250
|
+
- Verify domain-driven design compliance
|
|
251
|
+
- Check proper separation of concerns
|
|
252
|
+
- Validate component placement within domain structure
|
|
253
|
+
- Review data flow and state management patterns
|
|
254
|
+
|
|
255
|
+
2. **Code Quality**:
|
|
256
|
+
- TypeScript strict mode compliance
|
|
257
|
+
- Proper error handling and edge cases
|
|
258
|
+
- Performance considerations (memo, useMemo, useCallback)
|
|
259
|
+
- Accessibility compliance (ARIA, semantic HTML)
|
|
260
|
+
|
|
261
|
+
3. **Testing Coverage**:
|
|
262
|
+
- Unit tests for business logic (80% minimum)
|
|
263
|
+
- Integration tests for complex workflows
|
|
264
|
+
- Test quality and maintainability
|
|
265
|
+
- Mock strategies and test isolation
|
|
266
|
+
|
|
267
|
+
4. **Documentation**:
|
|
268
|
+
- JSDoc comments for public APIs
|
|
269
|
+
- README updates for new features
|
|
270
|
+
- Architecture decision records when applicable
|
|
271
|
+
- Code comments for complex business logic
|
|
272
|
+
|
|
273
|
+
5. **Security & Best Practices**:
|
|
274
|
+
- Input validation with Zod schemas
|
|
275
|
+
- XSS prevention in dynamic content
|
|
276
|
+
- Proper authentication/authorization patterns
|
|
277
|
+
- Environment variable usage
|
|
278
|
+
|
|
279
|
+
6. **Review Output**:
|
|
280
|
+
- Document findings in \`.melt/outputs/reviews/[timestamp]-review.md\`
|
|
281
|
+
- Categorize issues by severity (critical, major, minor)
|
|
282
|
+
- Provide specific recommendations and examples
|
|
283
|
+
- Update \`.melt/memory/context.md\` with lessons learned
|
|
284
|
+
|
|
285
|
+
Focus on constructive feedback that improves code quality and team knowledge.`;
|
|
286
|
+
}
|
|
287
|
+
function getDebugTemplate() {
|
|
288
|
+
return `---
|
|
289
|
+
description: Debug issues using systematic approach and Melt development patterns
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
Debug the issue systematically following our structured approach:
|
|
293
|
+
|
|
294
|
+
1. **Issue Analysis**:
|
|
295
|
+
- Document the problem clearly in \`.melt/memory/context.md\`
|
|
296
|
+
- Identify affected domains and components
|
|
297
|
+
- Gather error messages, stack traces, and reproduction steps
|
|
298
|
+
- Check recent changes in \`.melt/outputs/implementations/\`
|
|
299
|
+
|
|
300
|
+
2. **Domain-Specific Debugging**:
|
|
301
|
+
- Review component hierarchy and props flow
|
|
302
|
+
- Check custom hooks for state management issues
|
|
303
|
+
- Validate service layer API calls and data transformation
|
|
304
|
+
- Examine TypeScript types and Zod schema validation
|
|
305
|
+
|
|
306
|
+
3. **Tool-Assisted Debugging**:
|
|
307
|
+
- Use React DevTools for component inspection
|
|
308
|
+
- Leverage TypeScript compiler for type checking
|
|
309
|
+
- Check browser console for runtime errors
|
|
310
|
+
- Use network tab for API debugging
|
|
311
|
+
|
|
312
|
+
4. **Testing & Validation**:
|
|
313
|
+
- Run existing tests to identify regression
|
|
314
|
+
- Write minimal reproduction test case
|
|
315
|
+
- Check test coverage for the affected area
|
|
316
|
+
- Validate fix with comprehensive testing
|
|
317
|
+
|
|
318
|
+
5. **Root Cause Analysis**:
|
|
319
|
+
- Document the underlying cause
|
|
320
|
+
- Identify if it's architectural, implementation, or configuration
|
|
321
|
+
- Check if similar issues exist elsewhere
|
|
322
|
+
- Plan preventive measures
|
|
323
|
+
|
|
324
|
+
6. **Resolution Documentation**:
|
|
325
|
+
- Save debug session to \`.melt/outputs/implementations/[timestamp]-debug.md\`
|
|
326
|
+
- Update context with lessons learned
|
|
327
|
+
- Document any architectural improvements needed
|
|
328
|
+
- Share findings with team if applicable
|
|
329
|
+
|
|
330
|
+
Remember: Focus on understanding the problem deeply before implementing solutions.`;
|
|
331
|
+
}
|
|
332
|
+
function getInitialContext() {
|
|
333
|
+
return `# Project Context
|
|
334
|
+
|
|
335
|
+
## Project Overview
|
|
336
|
+
This project uses Melt's development standards with domain-driven architecture.
|
|
337
|
+
|
|
338
|
+
## Architecture Principles
|
|
339
|
+
- **Domain-Driven Design**: Code organized by business domains
|
|
340
|
+
- **React 2025 Standards**: Functional components, hooks, TypeScript strict
|
|
341
|
+
- **Type Safety**: Zod schemas for runtime validation
|
|
342
|
+
- **Testing**: 80% coverage minimum with comprehensive test strategies
|
|
343
|
+
|
|
344
|
+
## Development Workflow
|
|
345
|
+
1. **Plan**: Create implementation plans in \`.melt/outputs/plans/\`
|
|
346
|
+
2. **Implement**: Follow domain architecture patterns
|
|
347
|
+
3. **Review**: Ensure quality and compliance
|
|
348
|
+
4. **Debug**: Systematic problem-solving approach
|
|
349
|
+
|
|
350
|
+
## Current Status
|
|
351
|
+
- Initialized: ${new Date().toISOString()}
|
|
352
|
+
- Last Updated: ${new Date().toISOString()}
|
|
353
|
+
|
|
354
|
+
## Notes
|
|
355
|
+
Update this file as the project evolves to maintain context for AI assistants and team members.
|
|
356
|
+
`;
|
|
357
|
+
}
|
|
358
|
+
function getBashCommon() {
|
|
359
|
+
return `#!/usr/bin/env bash
|
|
360
|
+
# Common utilities for Melt development workflow
|
|
361
|
+
|
|
362
|
+
# Get project root directory
|
|
363
|
+
get_project_root() {
|
|
364
|
+
git rev-parse --show-toplevel 2>/dev/null || pwd
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
# Get current timestamp for file naming
|
|
368
|
+
get_timestamp() {
|
|
369
|
+
date '+%Y%m%d-%H%M%S'
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
# Check if .melt directory exists
|
|
373
|
+
check_melt_workspace() {
|
|
374
|
+
if [[ ! -d ".melt" ]]; then
|
|
375
|
+
echo "ERROR: .melt workspace not found. Run 'meltctl project init' first."
|
|
376
|
+
exit 1
|
|
377
|
+
fi
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
# Create output file with timestamp
|
|
381
|
+
create_output_file() {
|
|
382
|
+
local category="$1"
|
|
383
|
+
local name="$2"
|
|
384
|
+
local timestamp=$(get_timestamp)
|
|
385
|
+
local filename="\${timestamp}-\${name}.md"
|
|
386
|
+
local filepath=".melt/outputs/\${category}/\${filename}"
|
|
387
|
+
|
|
388
|
+
mkdir -p ".melt/outputs/\${category}"
|
|
389
|
+
echo "$filepath"
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
# Update context file with new information
|
|
393
|
+
update_context() {
|
|
394
|
+
local message="$1"
|
|
395
|
+
local timestamp=$(date -Iseconds)
|
|
396
|
+
|
|
397
|
+
echo "## Update: $timestamp" >> .melt/memory/context.md
|
|
398
|
+
echo "$message" >> .melt/memory/context.md
|
|
399
|
+
echo "" >> .melt/memory/context.md
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
echo "Melt development utilities loaded."
|
|
403
|
+
`;
|
|
404
|
+
}
|
|
405
|
+
function getPowerShellCommon() {
|
|
406
|
+
return `#!/usr/bin/env pwsh
|
|
407
|
+
# Common utilities for Melt development workflow
|
|
408
|
+
|
|
409
|
+
function Get-ProjectRoot {
|
|
410
|
+
try {
|
|
411
|
+
git rev-parse --show-toplevel
|
|
412
|
+
}
|
|
413
|
+
catch {
|
|
414
|
+
Get-Location
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
function Get-Timestamp {
|
|
419
|
+
Get-Date -Format "yyyyMMdd-HHmmss"
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
function Test-MeltWorkspace {
|
|
423
|
+
if (-not (Test-Path ".melt" -PathType Container)) {
|
|
424
|
+
Write-Error "ERROR: .melt workspace not found. Run 'meltctl project init' first."
|
|
425
|
+
exit 1
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
function New-OutputFile {
|
|
430
|
+
param(
|
|
431
|
+
[string]$Category,
|
|
432
|
+
[string]$Name
|
|
433
|
+
)
|
|
434
|
+
|
|
435
|
+
$timestamp = Get-Timestamp
|
|
436
|
+
$filename = "$timestamp-$Name.md"
|
|
437
|
+
$filepath = ".melt/outputs/$Category/$filename"
|
|
438
|
+
|
|
439
|
+
New-Item -Path ".melt/outputs/$Category" -ItemType Directory -Force | Out-Null
|
|
440
|
+
return $filepath
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
function Update-Context {
|
|
444
|
+
param([string]$Message)
|
|
445
|
+
|
|
446
|
+
$timestamp = Get-Date -Format "yyyy-MM-ddTHH:mm:ssK"
|
|
447
|
+
|
|
448
|
+
Add-Content -Path ".melt/memory/context.md" -Value "## Update: $timestamp"
|
|
449
|
+
Add-Content -Path ".melt/memory/context.md" -Value $Message
|
|
450
|
+
Add-Content -Path ".melt/memory/context.md" -Value ""
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
Write-Output "Melt development utilities loaded."
|
|
454
|
+
`;
|
|
455
|
+
}
|
|
456
|
+
function getTestPlanTemplate() {
|
|
457
|
+
return `---
|
|
458
|
+
description: Generate comprehensive test strategy and test files based on implementation plan
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
Create a comprehensive testing strategy and generate test files following Melt's testing standards:
|
|
462
|
+
|
|
463
|
+
1. **Load Implementation Context**:
|
|
464
|
+
- Read \`.melt/outputs/plans/\` for the current implementation plan
|
|
465
|
+
- Review \`.melt/memory/context.md\` for project testing patterns
|
|
466
|
+
- Analyze existing test files in \`src/domains/[domain]/__tests__/\`
|
|
467
|
+
|
|
468
|
+
2. **Test Strategy Design**:
|
|
469
|
+
- **Unit Tests**: Test individual components, hooks, and utilities
|
|
470
|
+
- **Integration Tests**: Test component interactions and data flow
|
|
471
|
+
- **API Tests**: Test service layer and external integrations
|
|
472
|
+
- **Accessibility Tests**: Ensure WCAG compliance
|
|
473
|
+
- **Performance Tests**: Validate rendering and interaction performance
|
|
474
|
+
|
|
475
|
+
3. **Test File Generation**:
|
|
476
|
+
- Create test files following domain structure:
|
|
477
|
+
\`\`\`
|
|
478
|
+
src/domains/[domain]/__tests__/
|
|
479
|
+
├── components/ # Component tests
|
|
480
|
+
├── hooks/ # Hook tests
|
|
481
|
+
├── services/ # Service/API tests
|
|
482
|
+
└── utils/ # Utility function tests
|
|
483
|
+
\`\`\`
|
|
484
|
+
- Use React Testing Library for component tests
|
|
485
|
+
- Use @testing-library/react-hooks for hook tests
|
|
486
|
+
- Mock external dependencies appropriately
|
|
487
|
+
|
|
488
|
+
4. **Testing Patterns**:
|
|
489
|
+
- Follow TDD approach - write tests before implementation
|
|
490
|
+
- Test behavior, not implementation details
|
|
491
|
+
- Use meaningful test descriptions and organize with describe blocks
|
|
492
|
+
- Include edge cases and error scenarios
|
|
493
|
+
- Ensure accessibility testing with @testing-library/jest-dom
|
|
494
|
+
|
|
495
|
+
5. **Test Coverage Strategy**:
|
|
496
|
+
- Target 80% minimum coverage for new code
|
|
497
|
+
- Focus on critical business logic and user flows
|
|
498
|
+
- Test error handling and edge cases
|
|
499
|
+
- Validate prop types and component contracts
|
|
500
|
+
|
|
501
|
+
6. **Save Test Plan**:
|
|
502
|
+
- Document test strategy in \`.melt/outputs/plans/[timestamp]-test-plan.md\`
|
|
503
|
+
- Create test files in appropriate domain directories
|
|
504
|
+
- Update \`.melt/memory/context.md\` with testing decisions
|
|
505
|
+
|
|
506
|
+
Focus on creating comprehensive, maintainable tests that validate both functionality and user experience.`;
|
|
507
|
+
}
|
|
508
|
+
function getDocsTemplate() {
|
|
509
|
+
return `---
|
|
510
|
+
description: Update project documentation and README based on implementation changes
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
Update project documentation to reflect implementation changes and maintain accuracy:
|
|
514
|
+
|
|
515
|
+
1. **Analyze Changes**:
|
|
516
|
+
- Review recent implementation in \`.melt/outputs/implementations/\`
|
|
517
|
+
- Check \`.melt/outputs/plans/\` for planned changes
|
|
518
|
+
- Identify new features, APIs, or architectural changes
|
|
519
|
+
- Review \`.melt/memory/context.md\` for context
|
|
520
|
+
|
|
521
|
+
2. **Documentation Updates**:
|
|
522
|
+
- **README.md**: Update installation, usage, and examples
|
|
523
|
+
- **API Documentation**: Document new endpoints or changed interfaces
|
|
524
|
+
- **Component Documentation**: Add JSDoc comments and usage examples
|
|
525
|
+
- **Architecture Docs**: Update domain structure if changed
|
|
526
|
+
- **Deployment Docs**: Update if new environment variables or configs added
|
|
527
|
+
|
|
528
|
+
3. **Documentation Patterns**:
|
|
529
|
+
- Use clear, concise language focused on developers
|
|
530
|
+
- Include code examples for new features
|
|
531
|
+
- Document breaking changes and migration steps
|
|
532
|
+
- Add troubleshooting sections for common issues
|
|
533
|
+
- Include links to relevant domain documentation
|
|
534
|
+
|
|
535
|
+
4. **Code Documentation**:
|
|
536
|
+
- Add/update JSDoc comments for public APIs
|
|
537
|
+
- Document complex business logic with inline comments
|
|
538
|
+
- Update TypeScript interfaces with proper descriptions
|
|
539
|
+
- Ensure prop types are documented for components
|
|
540
|
+
|
|
541
|
+
5. **Validation**:
|
|
542
|
+
- Verify all links work correctly
|
|
543
|
+
- Test code examples to ensure they're accurate
|
|
544
|
+
- Check that documentation matches actual implementation
|
|
545
|
+
- Ensure consistent formatting and style
|
|
546
|
+
|
|
547
|
+
6. **Save Documentation Updates**:
|
|
548
|
+
- Update relevant documentation files
|
|
549
|
+
- Save documentation notes to \`.melt/outputs/implementations/[timestamp]-docs.md\`
|
|
550
|
+
- Update \`.melt/memory/context.md\` with documentation decisions
|
|
551
|
+
|
|
552
|
+
Focus on keeping documentation current, accurate, and developer-focused.`;
|
|
553
|
+
}
|
|
554
|
+
function getPrTemplate() {
|
|
555
|
+
return `---
|
|
556
|
+
description: Create comprehensive pull request with proper description and metadata
|
|
557
|
+
---
|
|
558
|
+
|
|
559
|
+
Create a detailed pull request following Melt's standards for code review and deployment:
|
|
560
|
+
|
|
561
|
+
1. **Gather Context**:
|
|
562
|
+
- Read \`.melt/outputs/plans/\` for implementation plan details
|
|
563
|
+
- Review \`.melt/outputs/implementations/\` for implementation notes
|
|
564
|
+
- Check \`.melt/memory/context.md\` for project context
|
|
565
|
+
- Identify related Linear story and RFC references
|
|
566
|
+
|
|
567
|
+
2. **PR Description Structure**:
|
|
568
|
+
- **Summary**: Brief description of what was implemented
|
|
569
|
+
- **Changes**: Bulleted list of specific changes made
|
|
570
|
+
- **Testing**: How the changes were tested (unit, integration, manual)
|
|
571
|
+
- **Screenshots**: For UI changes, include before/after images
|
|
572
|
+
- **Linear Story**: Link to Linear story and requirements
|
|
573
|
+
- **RFC Reference**: Link to relevant RFC section if applicable
|
|
574
|
+
|
|
575
|
+
3. **PR Metadata**:
|
|
576
|
+
- Add appropriate labels (feature, bugfix, docs, etc.)
|
|
577
|
+
- Assign reviewers based on affected domains
|
|
578
|
+
- Set milestone if applicable
|
|
579
|
+
- Link to related issues or PRs
|
|
580
|
+
|
|
581
|
+
4. **Code Review Preparation**:
|
|
582
|
+
- Ensure all tests pass
|
|
583
|
+
- Run linting and type checking
|
|
584
|
+
- Verify accessibility compliance
|
|
585
|
+
- Check performance impact
|
|
586
|
+
- Validate security considerations
|
|
587
|
+
|
|
588
|
+
5. **Deployment Readiness**:
|
|
589
|
+
- Document any environment variable changes
|
|
590
|
+
- Note database migration requirements
|
|
591
|
+
- Include feature flag configurations
|
|
592
|
+
- Specify rollback procedures if needed
|
|
593
|
+
|
|
594
|
+
6. **Quality Checklist**:
|
|
595
|
+
- [ ] Code follows domain architecture patterns
|
|
596
|
+
- [ ] Tests have adequate coverage (80%+)
|
|
597
|
+
- [ ] Documentation updated
|
|
598
|
+
- [ ] No debugging code committed
|
|
599
|
+
- [ ] TypeScript strict mode compliance
|
|
600
|
+
- [ ] Performance considerations addressed
|
|
601
|
+
|
|
602
|
+
7. **Save PR Information**:
|
|
603
|
+
- Create PR with comprehensive description
|
|
604
|
+
- Save PR details to \`.melt/outputs/implementations/[timestamp]-pr.md\`
|
|
605
|
+
- Update \`.melt/memory/context.md\` with PR status
|
|
606
|
+
|
|
607
|
+
Focus on clear communication and thorough preparation for efficient code review.`;
|
|
608
|
+
}
|
|
609
|
+
function getCompleteTemplate() {
|
|
610
|
+
return `---
|
|
611
|
+
description: Complete story implementation, handle deployment, and update Linear status
|
|
612
|
+
---
|
|
613
|
+
|
|
614
|
+
Complete the story implementation and handle all post-development tasks:
|
|
615
|
+
|
|
616
|
+
1. **Verify Completion**:
|
|
617
|
+
- Read \`.melt/outputs/plans/\` to check all planned tasks completed
|
|
618
|
+
- Review \`.melt/outputs/implementations/\` for implementation status
|
|
619
|
+
- Ensure all tests pass and coverage targets met
|
|
620
|
+
- Verify documentation is updated and accurate
|
|
621
|
+
|
|
622
|
+
2. **Linear Story Update**:
|
|
623
|
+
- Update Linear story status to "Ready for Review" or "Complete"
|
|
624
|
+
- Add implementation notes and links to PR
|
|
625
|
+
- Update story with actual effort vs. estimated effort
|
|
626
|
+
- Link any follow-up stories or technical debt identified
|
|
627
|
+
|
|
628
|
+
3. **Deployment Process**:
|
|
629
|
+
- Verify PR is approved and merged
|
|
630
|
+
- Monitor deployment pipeline for success
|
|
631
|
+
- Validate feature works in staging/production
|
|
632
|
+
- Check monitoring and logging for any issues
|
|
633
|
+
|
|
634
|
+
4. **Feature Validation**:
|
|
635
|
+
- Test feature functionality end-to-end
|
|
636
|
+
- Verify acceptance criteria are fully met
|
|
637
|
+
- Check performance metrics if applicable
|
|
638
|
+
- Validate accessibility compliance
|
|
639
|
+
|
|
640
|
+
5. **Documentation & Handoff**:
|
|
641
|
+
- Ensure user-facing documentation is updated
|
|
642
|
+
- Share feature with stakeholders if needed
|
|
643
|
+
- Document any lessons learned or technical debt
|
|
644
|
+
- Update architectural decision records if applicable
|
|
645
|
+
|
|
646
|
+
6. **Cleanup Tasks**:
|
|
647
|
+
- Remove feature flags if no longer needed
|
|
648
|
+
- Archive implementation planning materials
|
|
649
|
+
- Update project roadmap or backlog
|
|
650
|
+
- Share knowledge with team members
|
|
651
|
+
|
|
652
|
+
7. **Post-Completion Analysis**:
|
|
653
|
+
- Document actual vs. estimated effort
|
|
654
|
+
- Note any process improvements identified
|
|
655
|
+
- Record architectural patterns that worked well
|
|
656
|
+
- Identify any technical debt for future sprints
|
|
657
|
+
|
|
658
|
+
8. **Save Completion Records**:
|
|
659
|
+
- Update Linear story with final status and notes
|
|
660
|
+
- Save completion summary to \`.melt/outputs/implementations/[timestamp]-complete.md\`
|
|
661
|
+
- Update \`.melt/memory/context.md\` with completion details
|
|
662
|
+
- Archive relevant planning and implementation files
|
|
663
|
+
|
|
664
|
+
Focus on thorough validation and knowledge capture for continuous improvement.`;
|
|
665
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function updateCommand(): Promise<void>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { intro, outro } from '@clack/prompts';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
export async function updateCommand() {
|
|
4
|
+
intro(chalk.blue('🔄 Melt Project - Update'));
|
|
5
|
+
console.log(chalk.yellow('⏳ Coming soon!'));
|
|
6
|
+
console.log();
|
|
7
|
+
console.log('This command will:');
|
|
8
|
+
console.log('• Check for CLI package updates');
|
|
9
|
+
console.log('• Update .cursor/commands/ with latest prompts');
|
|
10
|
+
console.log('• Migrate .melt/ workspace if needed');
|
|
11
|
+
console.log('• Handle version compatibility');
|
|
12
|
+
console.log();
|
|
13
|
+
console.log(chalk.gray('Usage: meltctl project update'));
|
|
14
|
+
outro(chalk.green('Stay tuned for the full implementation!'));
|
|
15
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from '@commander-js/extra-typings';
|
|
3
|
+
import { initCommand } from './commands/project/init.js';
|
|
4
|
+
import { updateCommand } from './commands/project/update.js';
|
|
5
|
+
const program = new Command();
|
|
6
|
+
program
|
|
7
|
+
.name('meltctl')
|
|
8
|
+
.description('CLI tool for Melt development process automation')
|
|
9
|
+
.version('0.1.0');
|
|
10
|
+
// Project management commands
|
|
11
|
+
const projectCommand = program
|
|
12
|
+
.command('project')
|
|
13
|
+
.description('Project setup and management commands');
|
|
14
|
+
projectCommand
|
|
15
|
+
.command('init')
|
|
16
|
+
.description('Initialize project with Melt development tools')
|
|
17
|
+
.action(initCommand);
|
|
18
|
+
projectCommand
|
|
19
|
+
.command('update')
|
|
20
|
+
.description('Update project configurations to latest version')
|
|
21
|
+
.action(updateCommand);
|
|
22
|
+
program.parse(process.argv);
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@meltstudio/meltctl",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "CLI tool for Melt development process automation - initialize and update project configurations",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"meltctl": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/**/*",
|
|
12
|
+
"templates/**/*",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"registry": "https://registry.npmjs.org/",
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"dev": "tsx watch src/index.ts",
|
|
23
|
+
"start": "node dist/index.js",
|
|
24
|
+
"clean": "rm -rf dist",
|
|
25
|
+
"lint": "eslint src/**/*.ts",
|
|
26
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
27
|
+
"type-check": "tsc --noEmit",
|
|
28
|
+
"format": "prettier --write src/**/*.ts",
|
|
29
|
+
"format:check": "prettier --check src/**/*.ts",
|
|
30
|
+
"prepublishOnly": "yarn build"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"cli",
|
|
34
|
+
"development-tools",
|
|
35
|
+
"cursor",
|
|
36
|
+
"ai-development",
|
|
37
|
+
"melt",
|
|
38
|
+
"automation"
|
|
39
|
+
],
|
|
40
|
+
"author": "Melt Studio",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@clack/prompts": "^0.9.0",
|
|
44
|
+
"commander": "^12.1.0",
|
|
45
|
+
"@commander-js/extra-typings": "^12.1.0",
|
|
46
|
+
"chalk": "^5.4.1",
|
|
47
|
+
"ora": "^8.2.0",
|
|
48
|
+
"fs-extra": "^11.2.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/fs-extra": "^11.0.4",
|
|
52
|
+
"@types/node": "^24.0.10",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "^8.19.0",
|
|
54
|
+
"@typescript-eslint/parser": "^8.19.0",
|
|
55
|
+
"eslint": "^9.17.0",
|
|
56
|
+
"eslint-config-prettier": "^9.1.0",
|
|
57
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
58
|
+
"prettier": "^3.4.2",
|
|
59
|
+
"tsx": "^4.19.5",
|
|
60
|
+
"typescript": "^5.7.3"
|
|
61
|
+
},
|
|
62
|
+
"engines": {
|
|
63
|
+
"node": ">=22.0.0"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Debug issues using systematic approach and Melt development patterns
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Debug the issue systematically following our structured approach:
|
|
6
|
+
|
|
7
|
+
1. **Issue Analysis**:
|
|
8
|
+
- Document the problem clearly in `.melt/memory/context.md`
|
|
9
|
+
- Identify affected domains and components
|
|
10
|
+
- Gather error messages, stack traces, and reproduction steps
|
|
11
|
+
- Check recent changes in `.melt/outputs/implementations/`
|
|
12
|
+
|
|
13
|
+
2. **Domain-Specific Debugging**:
|
|
14
|
+
- Review component hierarchy and props flow
|
|
15
|
+
- Check custom hooks for state management issues
|
|
16
|
+
- Validate service layer API calls and data transformation
|
|
17
|
+
- Examine TypeScript types and Zod schema validation
|
|
18
|
+
|
|
19
|
+
3. **Tool-Assisted Debugging**:
|
|
20
|
+
- Use React DevTools for component inspection
|
|
21
|
+
- Leverage TypeScript compiler for type checking
|
|
22
|
+
- Check browser console for runtime errors
|
|
23
|
+
- Use network tab for API debugging
|
|
24
|
+
|
|
25
|
+
4. **Testing & Validation**:
|
|
26
|
+
- Run existing tests to identify regression
|
|
27
|
+
- Write minimal reproduction test case
|
|
28
|
+
- Check test coverage for the affected area
|
|
29
|
+
- Validate fix with comprehensive testing
|
|
30
|
+
|
|
31
|
+
5. **Root Cause Analysis**:
|
|
32
|
+
- Document the underlying cause
|
|
33
|
+
- Identify if it's architectural, implementation, or configuration
|
|
34
|
+
- Check if similar issues exist elsewhere
|
|
35
|
+
- Plan preventive measures
|
|
36
|
+
|
|
37
|
+
6. **Resolution Documentation**:
|
|
38
|
+
- Save debug session to `.melt/outputs/implementations/[timestamp]-debug.md`
|
|
39
|
+
- Update context with lessons learned
|
|
40
|
+
- Document any architectural improvements needed
|
|
41
|
+
- Share findings with team if applicable
|
|
42
|
+
|
|
43
|
+
Remember: Focus on understanding the problem deeply before implementing solutions.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Execute implementation using Melt development standards and domain-driven architecture
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
You are implementing a feature following Melt's domain-driven development process. Follow these steps:
|
|
6
|
+
|
|
7
|
+
1. **Load Context**:
|
|
8
|
+
- Read `.melt/memory/context.md` for project context and requirements
|
|
9
|
+
- Check `.melt/outputs/plans/` for any existing implementation plans
|
|
10
|
+
- Review relevant domain structure in `src/domains/` if it exists
|
|
11
|
+
|
|
12
|
+
2. **Architecture Compliance**:
|
|
13
|
+
- Follow React 2025 standards (functional components, hooks, TypeScript strict)
|
|
14
|
+
- Use domain-driven design with clear separation of concerns
|
|
15
|
+
- Implement server components by default, client components when needed
|
|
16
|
+
- Use Zod for all data validation
|
|
17
|
+
- Follow Tailwind CSS for styling
|
|
18
|
+
|
|
19
|
+
3. **Implementation Process**:
|
|
20
|
+
- Create/update domain structures under `src/domains/[domain]/`
|
|
21
|
+
- Implement components in `src/domains/[domain]/components/`
|
|
22
|
+
- Add business logic in `src/domains/[domain]/hooks/` and `src/domains/[domain]/services/`
|
|
23
|
+
- Create types in `src/domains/[domain]/types/`
|
|
24
|
+
- Add tests in `src/domains/[domain]/__tests__/`
|
|
25
|
+
|
|
26
|
+
4. **Quality Standards**:
|
|
27
|
+
- Ensure 80% test coverage minimum
|
|
28
|
+
- Use TypeScript strict mode
|
|
29
|
+
- Add proper JSDoc documentation
|
|
30
|
+
- Follow atomic commit principles
|
|
31
|
+
- No debugging code in commits
|
|
32
|
+
|
|
33
|
+
5. **Documentation**:
|
|
34
|
+
- Update `.melt/memory/context.md` with implementation details
|
|
35
|
+
- Save implementation notes to `.melt/outputs/implementations/[timestamp].md`
|
|
36
|
+
- Update relevant README files if needed
|
|
37
|
+
|
|
38
|
+
6. **Testing**:
|
|
39
|
+
- Write unit tests for all business logic
|
|
40
|
+
- Add integration tests for complex workflows
|
|
41
|
+
- Ensure all tests pass before completing
|
|
42
|
+
|
|
43
|
+
Remember: Focus on clean, maintainable code that follows our established patterns and domain boundaries.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create implementation plan following Melt's domain-driven architecture standards
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Create a comprehensive implementation plan for the requested feature. Follow these steps:
|
|
6
|
+
|
|
7
|
+
1. **Analyze Requirements**:
|
|
8
|
+
- Read `.melt/memory/context.md` for project context and constraints
|
|
9
|
+
- Identify the target domain(s) this feature belongs to
|
|
10
|
+
- Determine integration points with existing domains
|
|
11
|
+
|
|
12
|
+
2. **Architecture Planning**:
|
|
13
|
+
- Design domain structure following our patterns:
|
|
14
|
+
```
|
|
15
|
+
src/domains/[domain]/
|
|
16
|
+
├── components/ # React components
|
|
17
|
+
├── hooks/ # Custom hooks for business logic
|
|
18
|
+
├── services/ # API calls and external integrations
|
|
19
|
+
├── types/ # TypeScript types and Zod schemas
|
|
20
|
+
├── utils/ # Domain-specific utilities
|
|
21
|
+
└── __tests__/ # Domain tests
|
|
22
|
+
```
|
|
23
|
+
- Plan component hierarchy and state management
|
|
24
|
+
- Design data flow and API integration points
|
|
25
|
+
|
|
26
|
+
3. **Technical Decisions**:
|
|
27
|
+
- Choose appropriate React patterns (server vs client components)
|
|
28
|
+
- Plan Zod schemas for data validation
|
|
29
|
+
- Design TypeScript interfaces and types
|
|
30
|
+
- Plan testing strategy (unit, integration, e2e)
|
|
31
|
+
|
|
32
|
+
4. **Implementation Strategy**:
|
|
33
|
+
- Break down into atomic, testable units
|
|
34
|
+
- Identify dependencies and execution order
|
|
35
|
+
- Plan for error handling and edge cases
|
|
36
|
+
- Consider accessibility and performance requirements
|
|
37
|
+
|
|
38
|
+
5. **Create Detailed Plan**:
|
|
39
|
+
- List specific files to create/modify
|
|
40
|
+
- Define component interfaces and props
|
|
41
|
+
- Specify API endpoints and data contracts
|
|
42
|
+
- Plan test cases and coverage targets
|
|
43
|
+
|
|
44
|
+
6. **Save Planning Output**:
|
|
45
|
+
- Save comprehensive plan to `.melt/outputs/plans/[timestamp]-plan.md`
|
|
46
|
+
- Update `.melt/memory/context.md` with planning decisions
|
|
47
|
+
- Create task breakdown for implementation
|
|
48
|
+
|
|
49
|
+
Focus on maintainable, testable code that follows our domain-driven architecture principles.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Review code following Melt's quality standards and architecture compliance
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Perform a comprehensive code review following Melt's standards:
|
|
6
|
+
|
|
7
|
+
1. **Architecture Review**:
|
|
8
|
+
- Verify domain-driven design compliance
|
|
9
|
+
- Check proper separation of concerns
|
|
10
|
+
- Validate component placement within domain structure
|
|
11
|
+
- Review data flow and state management patterns
|
|
12
|
+
|
|
13
|
+
2. **Code Quality**:
|
|
14
|
+
- TypeScript strict mode compliance
|
|
15
|
+
- Proper error handling and edge cases
|
|
16
|
+
- Performance considerations (memo, useMemo, useCallback)
|
|
17
|
+
- Accessibility compliance (ARIA, semantic HTML)
|
|
18
|
+
|
|
19
|
+
3. **Testing Coverage**:
|
|
20
|
+
- Unit tests for business logic (80% minimum)
|
|
21
|
+
- Integration tests for complex workflows
|
|
22
|
+
- Test quality and maintainability
|
|
23
|
+
- Mock strategies and test isolation
|
|
24
|
+
|
|
25
|
+
4. **Documentation**:
|
|
26
|
+
- JSDoc comments for public APIs
|
|
27
|
+
- README updates for new features
|
|
28
|
+
- Architecture decision records when applicable
|
|
29
|
+
- Code comments for complex business logic
|
|
30
|
+
|
|
31
|
+
5. **Security & Best Practices**:
|
|
32
|
+
- Input validation with Zod schemas
|
|
33
|
+
- XSS prevention in dynamic content
|
|
34
|
+
- Proper authentication/authorization patterns
|
|
35
|
+
- Environment variable usage
|
|
36
|
+
|
|
37
|
+
6. **Review Output**:
|
|
38
|
+
- Document findings in `.melt/outputs/reviews/[timestamp]-review.md`
|
|
39
|
+
- Categorize issues by severity (critical, major, minor)
|
|
40
|
+
- Provide specific recommendations and examples
|
|
41
|
+
- Update `.melt/memory/context.md` with lessons learned
|
|
42
|
+
|
|
43
|
+
Focus on constructive feedback that improves code quality and team knowledge.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create implementation plan following Melt's domain-driven architecture standards
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Create a comprehensive implementation plan for the requested feature. Follow these steps:
|
|
6
|
+
|
|
7
|
+
1. **Analyze Requirements**:
|
|
8
|
+
- Read `.melt/memory/context.md` for project context and constraints
|
|
9
|
+
- Identify the target domain(s) this feature belongs to
|
|
10
|
+
- Determine integration points with existing domains
|
|
11
|
+
|
|
12
|
+
2. **Architecture Planning**:
|
|
13
|
+
- Design domain structure following our patterns:
|
|
14
|
+
```
|
|
15
|
+
src/domains/[domain]/
|
|
16
|
+
├── components/ # React components
|
|
17
|
+
├── hooks/ # Custom hooks for business logic
|
|
18
|
+
├── services/ # API calls and external integrations
|
|
19
|
+
├── types/ # TypeScript types and Zod schemas
|
|
20
|
+
├── utils/ # Domain-specific utilities
|
|
21
|
+
└── __tests__/ # Domain tests
|
|
22
|
+
```
|
|
23
|
+
- Plan component hierarchy and state management
|
|
24
|
+
- Design data flow and API integration points
|
|
25
|
+
|
|
26
|
+
3. **Technical Decisions**:
|
|
27
|
+
- Choose appropriate React patterns (server vs client components)
|
|
28
|
+
- Plan Zod schemas for data validation
|
|
29
|
+
- Design TypeScript interfaces and types
|
|
30
|
+
- Plan testing strategy (unit, integration, e2e)
|
|
31
|
+
|
|
32
|
+
4. **Implementation Strategy**:
|
|
33
|
+
- Break down into atomic, testable units
|
|
34
|
+
- Identify dependencies and execution order
|
|
35
|
+
- Plan for error handling and edge cases
|
|
36
|
+
- Consider accessibility and performance requirements
|
|
37
|
+
|
|
38
|
+
5. **Create Detailed Plan**:
|
|
39
|
+
- List specific files to create/modify
|
|
40
|
+
- Define component interfaces and props
|
|
41
|
+
- Specify API endpoints and data contracts
|
|
42
|
+
- Plan test cases and coverage targets
|
|
43
|
+
|
|
44
|
+
6. **Save Planning Output**:
|
|
45
|
+
- Save comprehensive plan to `.melt/outputs/plans/[timestamp]-plan.md`
|
|
46
|
+
- Update `.melt/memory/context.md` with planning decisions
|
|
47
|
+
- Create task breakdown for implementation
|
|
48
|
+
|
|
49
|
+
Focus on maintainable, testable code that follows our domain-driven architecture principles.
|