@su-record/vibe 0.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.
Files changed (88) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +448 -0
  3. package/agents/backend-python-expert.md +453 -0
  4. package/agents/database-postgres-expert.md +538 -0
  5. package/agents/frontend-flutter-expert.md +487 -0
  6. package/agents/frontend-react-expert.md +424 -0
  7. package/agents/quality-reviewer.md +542 -0
  8. package/agents/specification-agent.md +505 -0
  9. package/bin/sutory +332 -0
  10. package/bin/vibe +338 -0
  11. package/mcp/dist/__tests__/complexity.test.js +126 -0
  12. package/mcp/dist/__tests__/memory.test.js +120 -0
  13. package/mcp/dist/__tests__/python-dart-complexity.test.js +146 -0
  14. package/mcp/dist/index.js +230 -0
  15. package/mcp/dist/lib/ContextCompressor.js +305 -0
  16. package/mcp/dist/lib/MemoryManager.js +334 -0
  17. package/mcp/dist/lib/ProjectCache.js +126 -0
  18. package/mcp/dist/lib/PythonParser.js +241 -0
  19. package/mcp/dist/tools/browser/browserPool.js +76 -0
  20. package/mcp/dist/tools/browser/browserUtils.js +135 -0
  21. package/mcp/dist/tools/browser/inspectNetworkRequests.js +140 -0
  22. package/mcp/dist/tools/browser/monitorConsoleLogs.js +97 -0
  23. package/mcp/dist/tools/convention/analyzeComplexity.js +248 -0
  24. package/mcp/dist/tools/convention/applyQualityRules.js +102 -0
  25. package/mcp/dist/tools/convention/checkCouplingCohesion.js +233 -0
  26. package/mcp/dist/tools/convention/complexityMetrics.js +133 -0
  27. package/mcp/dist/tools/convention/dartComplexity.js +117 -0
  28. package/mcp/dist/tools/convention/getCodingGuide.js +64 -0
  29. package/mcp/dist/tools/convention/languageDetector.js +50 -0
  30. package/mcp/dist/tools/convention/pythonComplexity.js +109 -0
  31. package/mcp/dist/tools/convention/suggestImprovements.js +257 -0
  32. package/mcp/dist/tools/convention/validateCodeQuality.js +177 -0
  33. package/mcp/dist/tools/memory/autoSaveContext.js +79 -0
  34. package/mcp/dist/tools/memory/database.js +123 -0
  35. package/mcp/dist/tools/memory/deleteMemory.js +39 -0
  36. package/mcp/dist/tools/memory/listMemories.js +38 -0
  37. package/mcp/dist/tools/memory/memoryConfig.js +27 -0
  38. package/mcp/dist/tools/memory/memorySQLite.js +138 -0
  39. package/mcp/dist/tools/memory/memoryUtils.js +34 -0
  40. package/mcp/dist/tools/memory/migrate.js +113 -0
  41. package/mcp/dist/tools/memory/prioritizeMemory.js +109 -0
  42. package/mcp/dist/tools/memory/recallMemory.js +40 -0
  43. package/mcp/dist/tools/memory/restoreSessionContext.js +69 -0
  44. package/mcp/dist/tools/memory/saveMemory.js +34 -0
  45. package/mcp/dist/tools/memory/searchMemories.js +37 -0
  46. package/mcp/dist/tools/memory/startSession.js +100 -0
  47. package/mcp/dist/tools/memory/updateMemory.js +46 -0
  48. package/mcp/dist/tools/planning/analyzeRequirements.js +166 -0
  49. package/mcp/dist/tools/planning/createUserStories.js +119 -0
  50. package/mcp/dist/tools/planning/featureRoadmap.js +202 -0
  51. package/mcp/dist/tools/planning/generatePrd.js +156 -0
  52. package/mcp/dist/tools/prompt/analyzePrompt.js +145 -0
  53. package/mcp/dist/tools/prompt/enhancePrompt.js +105 -0
  54. package/mcp/dist/tools/semantic/findReferences.js +195 -0
  55. package/mcp/dist/tools/semantic/findSymbol.js +200 -0
  56. package/mcp/dist/tools/thinking/analyzeProblem.js +50 -0
  57. package/mcp/dist/tools/thinking/breakDownProblem.js +140 -0
  58. package/mcp/dist/tools/thinking/createThinkingChain.js +39 -0
  59. package/mcp/dist/tools/thinking/formatAsPlan.js +73 -0
  60. package/mcp/dist/tools/thinking/stepByStepAnalysis.js +58 -0
  61. package/mcp/dist/tools/thinking/thinkAloudProcess.js +75 -0
  62. package/mcp/dist/tools/time/getCurrentTime.js +61 -0
  63. package/mcp/dist/tools/ui/previewUiAscii.js +232 -0
  64. package/mcp/dist/types/tool.js +2 -0
  65. package/mcp/package.json +53 -0
  66. package/package.json +49 -0
  67. package/scripts/install-mcp.js +48 -0
  68. package/scripts/install.sh +70 -0
  69. package/skills/core/communication-guide.md +104 -0
  70. package/skills/core/development-philosophy.md +53 -0
  71. package/skills/core/quick-start.md +121 -0
  72. package/skills/languages/dart-flutter.md +509 -0
  73. package/skills/languages/python-fastapi.md +386 -0
  74. package/skills/languages/typescript-nextjs.md +441 -0
  75. package/skills/languages/typescript-react-native.md +446 -0
  76. package/skills/languages/typescript-react.md +525 -0
  77. package/skills/quality/checklist.md +276 -0
  78. package/skills/quality/testing-strategy.md +437 -0
  79. package/skills/standards/anti-patterns.md +369 -0
  80. package/skills/standards/code-structure.md +291 -0
  81. package/skills/standards/complexity-metrics.md +312 -0
  82. package/skills/standards/naming-conventions.md +198 -0
  83. package/skills/tools/mcp-hi-ai-guide.md +665 -0
  84. package/skills/tools/mcp-workflow.md +51 -0
  85. package/templates/constitution-template.md +193 -0
  86. package/templates/plan-template.md +237 -0
  87. package/templates/spec-template.md +142 -0
  88. package/templates/tasks-template.md +132 -0
@@ -0,0 +1,202 @@
1
+ // Planning tool - completely independent
2
+ export const featureRoadmapDefinition = {
3
+ name: 'feature_roadmap',
4
+ description: '๋กœ๋“œ๋งต|์ผ์ •|๊ณ„ํšํ‘œ|roadmap|timeline|project plan|development schedule - Generate development roadmap',
5
+ inputSchema: {
6
+ type: 'object',
7
+ properties: {
8
+ projectName: { type: 'string', description: 'Name of the project' },
9
+ features: { type: 'string', description: 'List of features to include in roadmap' },
10
+ timeframe: { type: 'string', description: 'Project timeframe', enum: ['3-months', '6-months', '12-months', 'custom'] },
11
+ approach: { type: 'string', description: 'Development approach', enum: ['mvp-first', 'phased-rollout', 'big-bang'], default: 'mvp-first' },
12
+ teamSize: { type: 'number', description: 'Development team size' }
13
+ },
14
+ required: ['projectName', 'features']
15
+ },
16
+ annotations: {
17
+ title: 'Feature Roadmap',
18
+ audience: ['user', 'assistant']
19
+ }
20
+ };
21
+ export async function featureRoadmap(args) {
22
+ const { projectName, features, timeframe = '6-months', approach = 'mvp-first', teamSize = 3 } = args;
23
+ // Parse features
24
+ const featureList = features.split(/[,\n]/).map(f => f.trim()).filter(f => f.length > 0);
25
+ // Define phases based on approach
26
+ let phaseNames = [];
27
+ if (approach === 'mvp-first') {
28
+ phaseNames = ['MVP Foundation', 'Core Features', 'Advanced Features', 'Optimization & Scaling'];
29
+ }
30
+ else if (approach === 'phased-rollout') {
31
+ phaseNames = ['Phase 1: Core', 'Phase 2: Enhancement', 'Phase 3: Expansion', 'Phase 4: Innovation'];
32
+ }
33
+ else {
34
+ phaseNames = ['Planning & Setup', 'Development Sprint', 'Integration & Testing', 'Launch & Monitoring'];
35
+ }
36
+ // Calculate phase durations
37
+ const totalMonths = timeframe === '3-months' ? 3 : timeframe === '6-months' ? 6 : timeframe === '12-months' ? 12 : 6;
38
+ const monthsPerPhase = Math.ceil(totalMonths / phaseNames.length);
39
+ // Categorize features by priority and complexity
40
+ const roadmapItems = featureList.map((feature, index) => {
41
+ const itemId = `F-${String(index + 1).padStart(3, '0')}`;
42
+ // Determine priority
43
+ let priority = 'medium';
44
+ if (feature.toLowerCase().includes('critical') || feature.toLowerCase().includes('core') || feature.toLowerCase().includes('essential')) {
45
+ priority = 'high';
46
+ }
47
+ else if (feature.toLowerCase().includes('enhancement') || feature.toLowerCase().includes('nice') || feature.toLowerCase().includes('optional')) {
48
+ priority = 'low';
49
+ }
50
+ // Determine phase based on priority and approach
51
+ let phase = phaseNames[1]; // Default to second phase
52
+ if (priority === 'high' || feature.toLowerCase().includes('mvp') || feature.toLowerCase().includes('basic')) {
53
+ phase = phaseNames[0];
54
+ }
55
+ else if (priority === 'low' || feature.toLowerCase().includes('advanced') || feature.toLowerCase().includes('future')) {
56
+ phase = phaseNames[Math.min(2, phaseNames.length - 1)];
57
+ }
58
+ // Estimate duration
59
+ let estimatedDuration = '2-3 weeks';
60
+ if (feature.length > 100 || feature.toLowerCase().includes('complex') || feature.toLowerCase().includes('integration')) {
61
+ estimatedDuration = '4-6 weeks';
62
+ }
63
+ else if (feature.length < 50 || feature.toLowerCase().includes('simple')) {
64
+ estimatedDuration = '1-2 weeks';
65
+ }
66
+ // Generate deliverables
67
+ const deliverables = [
68
+ `${feature} implementation`,
69
+ `Unit and integration tests`,
70
+ `Documentation and user guides`,
71
+ `Code review and quality assurance`
72
+ ];
73
+ // Generate success criteria
74
+ const successCriteria = [
75
+ `Feature functions as specified`,
76
+ `Meets performance requirements`,
77
+ `Passes all test cases`,
78
+ `User acceptance criteria met`
79
+ ];
80
+ // Identify potential risks
81
+ const risks = [];
82
+ if (feature.toLowerCase().includes('external') || feature.toLowerCase().includes('third-party')) {
83
+ risks.push('External dependency risk');
84
+ }
85
+ if (feature.toLowerCase().includes('performance') || feature.toLowerCase().includes('scalability')) {
86
+ risks.push('Performance optimization complexity');
87
+ }
88
+ if (feature.toLowerCase().includes('security') || feature.toLowerCase().includes('authentication')) {
89
+ risks.push('Security implementation complexity');
90
+ }
91
+ if (risks.length === 0) {
92
+ risks.push('Standard development risks');
93
+ }
94
+ return {
95
+ id: itemId,
96
+ title: feature.length > 50 ? feature.substring(0, 47) + '...' : feature,
97
+ description: feature,
98
+ phase,
99
+ priority,
100
+ estimatedDuration,
101
+ dependencies: [],
102
+ deliverables,
103
+ successCriteria,
104
+ risks
105
+ };
106
+ });
107
+ // Group features by phase
108
+ const phases = phaseNames.map((phaseName, index) => {
109
+ const phaseFeatures = roadmapItems.filter(item => item.phase === phaseName);
110
+ const phaseGoals = [];
111
+ if (index === 0) {
112
+ phaseGoals.push('Establish core functionality', 'Validate core assumptions', 'Build foundation for future features');
113
+ }
114
+ else if (index === 1) {
115
+ phaseGoals.push('Enhance user experience', 'Add key differentiating features', 'Improve system reliability');
116
+ }
117
+ else if (index === 2) {
118
+ phaseGoals.push('Scale system capabilities', 'Add advanced features', 'Optimize performance');
119
+ }
120
+ else {
121
+ phaseGoals.push('Continuous improvement', 'Innovation and experimentation', 'Long-term sustainability');
122
+ }
123
+ const milestones = [
124
+ `${phaseName} features delivered`,
125
+ `Quality assurance completed`,
126
+ `User feedback incorporated`,
127
+ `Metrics and KPIs reviewed`
128
+ ];
129
+ return {
130
+ name: phaseName,
131
+ duration: `${monthsPerPhase} month${monthsPerPhase > 1 ? 's' : ''}`,
132
+ goals: phaseGoals,
133
+ features: phaseFeatures,
134
+ milestones
135
+ };
136
+ });
137
+ const roadmap = {
138
+ action: 'feature_roadmap',
139
+ project: projectName,
140
+ timeframe,
141
+ approach,
142
+ teamSize,
143
+ phases,
144
+ summary: {
145
+ totalFeatures: roadmapItems.length,
146
+ totalDuration: `${totalMonths} months`,
147
+ highPriorityFeatures: roadmapItems.filter(f => f.priority === 'high').length,
148
+ mediumPriorityFeatures: roadmapItems.filter(f => f.priority === 'medium').length,
149
+ lowPriorityFeatures: roadmapItems.filter(f => f.priority === 'low').length
150
+ },
151
+ recommendations: [
152
+ 'Review and validate priorities with stakeholders',
153
+ 'Set up regular milestone reviews and adjustments',
154
+ 'Plan for buffer time between phases for testing',
155
+ 'Consider team capacity and external dependencies',
156
+ 'Establish clear success metrics for each phase'
157
+ ],
158
+ status: 'success'
159
+ };
160
+ // Format output
161
+ let formattedOutput = `# ${projectName} - Feature Roadmap\n\n`;
162
+ formattedOutput += `**Timeframe:** ${timeframe} \n`;
163
+ formattedOutput += `**Approach:** ${approach} \n`;
164
+ formattedOutput += `**Team Size:** ${teamSize} developers \n`;
165
+ formattedOutput += `**Total Features:** ${roadmap.summary.totalFeatures}\n\n`;
166
+ formattedOutput += `## Overview\n`;
167
+ formattedOutput += `- **High Priority:** ${roadmap.summary.highPriorityFeatures} features\n`;
168
+ formattedOutput += `- **Medium Priority:** ${roadmap.summary.mediumPriorityFeatures} features\n`;
169
+ formattedOutput += `- **Low Priority:** ${roadmap.summary.lowPriorityFeatures} features\n\n`;
170
+ phases.forEach((phase, index) => {
171
+ formattedOutput += `## ${phase.name}\n`;
172
+ formattedOutput += `**Duration:** ${phase.duration} \n`;
173
+ formattedOutput += `**Features:** ${phase.features.length}\n\n`;
174
+ formattedOutput += `### Goals\n`;
175
+ phase.goals.forEach(goal => {
176
+ formattedOutput += `- ${goal}\n`;
177
+ });
178
+ formattedOutput += '\n';
179
+ if (phase.features.length > 0) {
180
+ formattedOutput += `### Features\n`;
181
+ phase.features.forEach(feature => {
182
+ formattedOutput += `**${feature.id}:** ${feature.title} (${feature.priority.toUpperCase()}) \n`;
183
+ formattedOutput += `*Duration:* ${feature.estimatedDuration} \n`;
184
+ formattedOutput += `*Key Risks:* ${feature.risks.join(', ')}\n\n`;
185
+ });
186
+ }
187
+ formattedOutput += `### Milestones\n`;
188
+ phase.milestones.forEach(milestone => {
189
+ formattedOutput += `- ${milestone}\n`;
190
+ });
191
+ if (index < phases.length - 1) {
192
+ formattedOutput += '\n---\n\n';
193
+ }
194
+ });
195
+ formattedOutput += `\n## Recommendations\n`;
196
+ roadmap.recommendations.forEach(rec => {
197
+ formattedOutput += `- ${rec}\n`;
198
+ });
199
+ return {
200
+ content: [{ type: 'text', text: formattedOutput }]
201
+ };
202
+ }
@@ -0,0 +1,156 @@
1
+ // Planning tool - completely independent
2
+ export const generatePrdDefinition = {
3
+ name: 'generate_prd',
4
+ description: 'PRD|์š”๊ตฌ์‚ฌํ•ญ ๋ฌธ์„œ|์ œํ’ˆ ์š”๊ตฌ์‚ฌํ•ญ|product requirements|requirements document|spec document - Generate Product Requirements Document',
5
+ inputSchema: {
6
+ type: 'object',
7
+ properties: {
8
+ productName: { type: 'string', description: 'Name of the product/feature' },
9
+ productVision: { type: 'string', description: 'High-level vision and goals' },
10
+ targetAudience: { type: 'string', description: 'Target users and stakeholders' },
11
+ businessObjectives: { type: 'string', description: 'Business goals and success metrics' },
12
+ functionalRequirements: { type: 'string', description: 'Key features and functionality' },
13
+ constraints: { type: 'string', description: 'Technical/business constraints' }
14
+ },
15
+ required: ['productName', 'productVision']
16
+ },
17
+ annotations: {
18
+ title: 'Generate PRD',
19
+ audience: ['user', 'assistant']
20
+ }
21
+ };
22
+ export async function generatePrd(args) {
23
+ const { productName, productVision, targetAudience = 'General users', businessObjectives = 'Improve user experience and business value', functionalRequirements = 'Core functionality to be defined', constraints = 'Standard technical and budget constraints' } = args;
24
+ const prd = {
25
+ action: 'generate_prd',
26
+ product: productName,
27
+ document: {
28
+ title: `Product Requirements Document: ${productName}`,
29
+ version: '1.0',
30
+ date: new Date().toISOString().split('T')[0],
31
+ sections: {
32
+ executiveSummary: {
33
+ title: 'Executive Summary',
34
+ content: `${productName} is designed to ${productVision}. This document outlines the requirements, scope, and implementation strategy for delivering value to ${targetAudience}.`
35
+ },
36
+ productOverview: {
37
+ title: 'Product Overview',
38
+ vision: productVision,
39
+ objectives: businessObjectives,
40
+ targetUsers: targetAudience,
41
+ successMetrics: [
42
+ 'User adoption rate',
43
+ 'Feature usage metrics',
44
+ 'User satisfaction score',
45
+ 'Business impact measurement'
46
+ ]
47
+ },
48
+ functionalRequirements: {
49
+ title: 'Functional Requirements',
50
+ description: functionalRequirements,
51
+ coreFeatures: [
52
+ 'User authentication and management',
53
+ 'Core functionality implementation',
54
+ 'Data processing and storage',
55
+ 'User interface and experience',
56
+ 'Integration capabilities'
57
+ ],
58
+ userFlows: [
59
+ 'User onboarding process',
60
+ 'Main feature usage flow',
61
+ 'Error handling and recovery',
62
+ 'Administrative functions'
63
+ ]
64
+ },
65
+ nonFunctionalRequirements: {
66
+ title: 'Non-Functional Requirements',
67
+ performance: 'Fast response times (<2s), high availability (99.9%)',
68
+ security: 'Data encryption, secure authentication, privacy compliance',
69
+ scalability: 'Support growing user base and data volume',
70
+ usability: 'Intuitive interface, accessibility standards',
71
+ compatibility: 'Cross-platform support, browser compatibility'
72
+ },
73
+ constraints: {
74
+ title: 'Constraints and Assumptions',
75
+ technical: constraints,
76
+ timeline: 'Development timeline to be defined based on scope',
77
+ budget: 'Budget allocation for development and infrastructure',
78
+ resources: 'Team capacity and skill requirements'
79
+ },
80
+ implementationPlan: {
81
+ title: 'Implementation Strategy',
82
+ phases: [
83
+ 'Phase 1: Core functionality development',
84
+ 'Phase 2: Advanced features and integrations',
85
+ 'Phase 3: Performance optimization and scaling',
86
+ 'Phase 4: Launch and post-launch improvements'
87
+ ],
88
+ riskMitigation: [
89
+ 'Technical risk assessment and mitigation',
90
+ 'Resource and timeline risk management',
91
+ 'Market and user acceptance risks',
92
+ 'Compliance and security considerations'
93
+ ]
94
+ }
95
+ }
96
+ },
97
+ recommendations: [
98
+ 'Conduct user research to validate assumptions',
99
+ 'Create detailed wireframes and prototypes',
100
+ 'Define detailed acceptance criteria for each feature',
101
+ 'Set up monitoring and analytics for success metrics',
102
+ 'Plan for iterative development and feedback loops'
103
+ ],
104
+ status: 'success'
105
+ };
106
+ const formattedPrd = `# ${prd.document.title}
107
+
108
+ **Version:** ${prd.document.version}
109
+ **Date:** ${prd.document.date}
110
+
111
+ ## ${prd.document.sections.executiveSummary.title}
112
+ ${prd.document.sections.executiveSummary.content}
113
+
114
+ ## ${prd.document.sections.productOverview.title}
115
+ **Vision:** ${prd.document.sections.productOverview.vision}
116
+ **Objectives:** ${prd.document.sections.productOverview.objectives}
117
+ **Target Users:** ${prd.document.sections.productOverview.targetUsers}
118
+
119
+ **Success Metrics:**
120
+ ${prd.document.sections.productOverview.successMetrics.map(metric => `- ${metric}`).join('\n')}
121
+
122
+ ## ${prd.document.sections.functionalRequirements.title}
123
+ ${prd.document.sections.functionalRequirements.description}
124
+
125
+ **Core Features:**
126
+ ${prd.document.sections.functionalRequirements.coreFeatures.map(feature => `- ${feature}`).join('\n')}
127
+
128
+ **User Flows:**
129
+ ${prd.document.sections.functionalRequirements.userFlows.map(flow => `- ${flow}`).join('\n')}
130
+
131
+ ## ${prd.document.sections.nonFunctionalRequirements.title}
132
+ - **Performance:** ${prd.document.sections.nonFunctionalRequirements.performance}
133
+ - **Security:** ${prd.document.sections.nonFunctionalRequirements.security}
134
+ - **Scalability:** ${prd.document.sections.nonFunctionalRequirements.scalability}
135
+ - **Usability:** ${prd.document.sections.nonFunctionalRequirements.usability}
136
+ - **Compatibility:** ${prd.document.sections.nonFunctionalRequirements.compatibility}
137
+
138
+ ## ${prd.document.sections.constraints.title}
139
+ - **Technical:** ${prd.document.sections.constraints.technical}
140
+ - **Timeline:** ${prd.document.sections.constraints.timeline}
141
+ - **Budget:** ${prd.document.sections.constraints.budget}
142
+ - **Resources:** ${prd.document.sections.constraints.resources}
143
+
144
+ ## ${prd.document.sections.implementationPlan.title}
145
+ **Development Phases:**
146
+ ${prd.document.sections.implementationPlan.phases.map(phase => `- ${phase}`).join('\n')}
147
+
148
+ **Risk Mitigation:**
149
+ ${prd.document.sections.implementationPlan.riskMitigation.map(risk => `- ${risk}`).join('\n')}
150
+
151
+ ## Recommendations
152
+ ${prd.recommendations.map(rec => `- ${rec}`).join('\n')}`;
153
+ return {
154
+ content: [{ type: 'text', text: formattedPrd }]
155
+ };
156
+ }
@@ -0,0 +1,145 @@
1
+ // Prompt analysis tool - completely independent
2
+ export const analyzePromptDefinition = {
3
+ name: 'analyze_prompt',
4
+ description: 'ํ”„๋กฌํ”„ํŠธ ๋ถ„์„|ํ‰๊ฐ€|์ ์ˆ˜|์–ผ๋งˆ๋‚˜ ์ข‹์€์ง€|analyze prompt|rate this|score|how good|prompt quality - Analyze prompt quality',
5
+ inputSchema: {
6
+ type: 'object',
7
+ properties: {
8
+ prompt: { type: 'string', description: 'Prompt to analyze' },
9
+ criteria: {
10
+ type: 'array',
11
+ items: { type: 'string' },
12
+ description: 'Specific criteria to evaluate (default: all)'
13
+ }
14
+ },
15
+ required: ['prompt']
16
+ },
17
+ annotations: {
18
+ title: 'Analyze Prompt',
19
+ audience: ['user', 'assistant']
20
+ }
21
+ };
22
+ export async function analyzePrompt(args) {
23
+ const { prompt, criteria = ['clarity', 'specificity', 'context', 'structure'] } = args;
24
+ // Initialize scores with explicit types
25
+ const scores = {};
26
+ const feedback = {};
27
+ // Analyze clarity (0-10)
28
+ if (criteria.includes('clarity')) {
29
+ let clarityScore = 5.0;
30
+ const clarityFeedback = [];
31
+ if (prompt.length < 20) {
32
+ clarityScore -= 2.0;
33
+ clarityFeedback.push('ํ”„๋กฌํ”„ํŠธ๊ฐ€ ๋„ˆ๋ฌด ์งง์Šต๋‹ˆ๋‹ค');
34
+ }
35
+ if (prompt.includes('?') || /\b(ํ•ด์ฃผ์„ธ์š”|๋ถ€ํƒ|์š”์ฒญ)\b/.test(prompt)) {
36
+ clarityScore += 2.0;
37
+ clarityFeedback.push('๋ช…ํ™•ํ•œ ์š”์ฒญ ํ˜•ํƒœ โœ“');
38
+ }
39
+ if (prompt.split(',').length > 5 || prompt.split('.').length > 10) {
40
+ clarityScore -= 1.0;
41
+ clarityFeedback.push('๋ฌธ์žฅ์ด ๋„ˆ๋ฌด ๋ณต์žกํ•ฉ๋‹ˆ๋‹ค');
42
+ }
43
+ scores.clarity = Math.max(0, Math.min(10, clarityScore));
44
+ feedback.clarity = clarityFeedback;
45
+ }
46
+ // Analyze specificity (0-10)
47
+ if (criteria.includes('specificity')) {
48
+ let specificityScore = 5.0;
49
+ const specificityFeedback = [];
50
+ const specificKeywords = ['๊ตฌ์ฒด์ ', '์ •ํ™•ํžˆ', '์˜ˆ์‹œ', '์˜ˆ๋ฅผ ๋“ค์–ด'];
51
+ const hasSpecificWords = specificKeywords.some(word => prompt.includes(word));
52
+ if (hasSpecificWords) {
53
+ specificityScore += 2.0;
54
+ specificityFeedback.push('๊ตฌ์ฒด์ ์ธ ํ‘œํ˜„ ์‚ฌ์šฉ โœ“');
55
+ }
56
+ const techTerms = /\b(JavaScript|Python|React|Node\.js|API|๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค)\b/i;
57
+ if (techTerms.test(prompt)) {
58
+ specificityScore += 2.0;
59
+ specificityFeedback.push('๊ธฐ์ˆ  ์šฉ์–ด ํฌํ•จ โœ“');
60
+ }
61
+ if (!prompt.match(/\d+/) && prompt.length > 50) {
62
+ specificityScore -= 1.0;
63
+ specificityFeedback.push('์ˆ˜์น˜๋‚˜ ๊ตฌ์ฒด์  ๋ฐ์ดํ„ฐ ๋ถ€์กฑ');
64
+ }
65
+ scores.specificity = Math.max(0, Math.min(10, specificityScore));
66
+ feedback.specificity = specificityFeedback;
67
+ }
68
+ // Analyze context (0-10)
69
+ if (criteria.includes('context')) {
70
+ let contextScore = 5.0;
71
+ const contextFeedback = [];
72
+ const contextKeywords = ['๋ฐฐ๊ฒฝ', '๋ชฉ์ ', '์ด์œ ', '์ƒํ™ฉ', 'ํ˜„์žฌ', '๋ฌธ์ œ'];
73
+ const contextCount = contextKeywords.filter(word => prompt.includes(word)).length;
74
+ contextScore += contextCount * 1.5;
75
+ if (contextCount > 0) {
76
+ contextFeedback.push(`๋ฐฐ๊ฒฝ ์ •๋ณด ํฌํ•จ (${contextCount}๊ฐœ ํ‚ค์›Œ๋“œ) โœ“`);
77
+ }
78
+ else {
79
+ contextFeedback.push('๋ฐฐ๊ฒฝ ์ •๋ณด ๋ถ€์กฑ');
80
+ }
81
+ if (prompt.split('\n').length > 2) {
82
+ contextScore += 1.0;
83
+ contextFeedback.push('๊ตฌ์กฐํ™”๋œ ์„ค๋ช… โœ“');
84
+ }
85
+ scores.context = Math.max(0, Math.min(10, contextScore));
86
+ feedback.context = contextFeedback;
87
+ }
88
+ // Analyze structure (0-10)
89
+ if (criteria.includes('structure')) {
90
+ let structureScore = 5.0;
91
+ const structureFeedback = [];
92
+ if (prompt.includes('\n')) {
93
+ structureScore += 2.0;
94
+ structureFeedback.push('์ค„๋ฐ”๊ฟˆ ์‚ฌ์šฉ โœ“');
95
+ }
96
+ if (/[1-9]\.|[-โ€ข]/.test(prompt)) {
97
+ structureScore += 2.0;
98
+ structureFeedback.push('๋ชฉ๋ก ํ˜•์‹ ์‚ฌ์šฉ โœ“');
99
+ }
100
+ if (prompt.includes('**') || prompt.includes('##')) {
101
+ structureScore += 1.0;
102
+ structureFeedback.push('๋งˆํฌ๋‹ค์šด ํ˜•์‹ ์‚ฌ์šฉ โœ“');
103
+ }
104
+ scores.structure = Math.max(0, Math.min(10, structureScore));
105
+ feedback.structure = structureFeedback;
106
+ }
107
+ // Calculate total score
108
+ const totalScore = Object.values(scores).reduce((a, b) => a + b, 0) / Object.keys(scores).length;
109
+ // Generate recommendations
110
+ const recommendations = [];
111
+ if (scores.clarity < 6) {
112
+ recommendations.push('๐Ÿ’ก ์งˆ๋ฌธ์ด๋‚˜ ์š”์ฒญ์„ ๋” ๋ช…ํ™•ํ•˜๊ฒŒ ํ‘œํ˜„ํ•˜์„ธ์š”');
113
+ }
114
+ if (scores.specificity < 6) {
115
+ recommendations.push('๐Ÿ’ก ๊ตฌ์ฒด์ ์ธ ์˜ˆ์‹œ๋‚˜ ๊ธฐ์ˆ  ์‚ฌ์–‘์„ ์ถ”๊ฐ€ํ•˜์„ธ์š”');
116
+ }
117
+ if (scores.context < 6) {
118
+ recommendations.push('๐Ÿ’ก ์ž‘์—…์˜ ๋ฐฐ๊ฒฝ๊ณผ ๋ชฉ์ ์„ ์„ค๋ช…ํ•˜์„ธ์š”');
119
+ }
120
+ if (scores.structure < 6) {
121
+ recommendations.push('๐Ÿ’ก ๋ฒˆํ˜ธ๋‚˜ ๋ถˆ๋ฆฟ ํฌ์ธํŠธ๋กœ ๊ตฌ์กฐํ™”ํ•˜์„ธ์š”');
122
+ }
123
+ // Identify strengths and weaknesses
124
+ const strengths = Object.entries(scores)
125
+ .filter(([_, score]) => score >= 7)
126
+ .map(([category, score]) => `โœจ ${category}: ์šฐ์ˆ˜ํ•จ (${score.toFixed(1)}/10)`);
127
+ const weaknesses = Object.entries(scores)
128
+ .filter(([_, score]) => score < 5)
129
+ .map(([category, score]) => `โš ๏ธ ${category}: ๊ฐœ์„  ํ•„์š” (${score.toFixed(1)}/10)`);
130
+ const analysis = {
131
+ action: 'analyze_prompt',
132
+ prompt,
133
+ totalScore: parseFloat(totalScore.toFixed(1)),
134
+ scores: Object.fromEntries(Object.entries(scores).map(([k, v]) => [k, parseFloat(v.toFixed(1))])),
135
+ feedback,
136
+ strengths,
137
+ weaknesses,
138
+ recommendations,
139
+ grade: totalScore >= 8 ? 'A' : totalScore >= 6 ? 'B' : totalScore >= 4 ? 'C' : 'D',
140
+ status: 'success'
141
+ };
142
+ return {
143
+ content: [{ type: 'text', text: `Score: ${analysis.totalScore}/10 (Grade: ${analysis.grade})\n\nScores:\n${Object.entries(analysis.scores).map(([k, v]) => `- ${k}: ${v}/10`).join('\n')}\n\nStrengths:\n${analysis.strengths.length > 0 ? analysis.strengths.join('\n') : 'None identified'}\n\nWeaknesses:\n${analysis.weaknesses.length > 0 ? analysis.weaknesses.join('\n') : 'None identified'}\n\nRecommendations:\n${analysis.recommendations.map(r => `- ${r}`).join('\n')}` }]
144
+ };
145
+ }
@@ -0,0 +1,105 @@
1
+ // Prompt enhancement tool - completely independent
2
+ export const enhancePromptDefinition = {
3
+ name: 'enhance_prompt',
4
+ description: '๊ตฌ์ฒด์ ์œผ๋กœ|์ž์„ธํžˆ|๋ช…ํ™•ํ•˜๊ฒŒ|๋” ๊ตฌ์ฒด์ ์œผ๋กœ|be specific|more detail|clarify|elaborate|vague - Transform vague requests',
5
+ inputSchema: {
6
+ type: 'object',
7
+ properties: {
8
+ prompt: { type: 'string', description: 'Original prompt to enhance' },
9
+ context: { type: 'string', description: 'Additional context or project information' },
10
+ enhancement_type: {
11
+ type: 'string',
12
+ enum: ['clarity', 'specificity', 'context', 'all'],
13
+ description: 'Type of enhancement (default: all)'
14
+ }
15
+ },
16
+ required: ['prompt']
17
+ },
18
+ annotations: {
19
+ title: 'Enhance Prompt',
20
+ audience: ['user', 'assistant']
21
+ }
22
+ };
23
+ export async function enhancePrompt(args) {
24
+ const { prompt, context = '', enhancement_type = 'all' } = args;
25
+ // Enhancement logic
26
+ const enhancements = {
27
+ clarity: [],
28
+ specificity: [],
29
+ context: [],
30
+ structure: []
31
+ };
32
+ // Analyze original prompt
33
+ const promptLength = prompt.length;
34
+ const hasQuestion = prompt.includes('?');
35
+ const hasSpecificTerms = /\b(๊ตฌํ˜„|๊ฐœ๋ฐœ|์ˆ˜์ •|๋ถ„์„|๋””๋ฒ„๊ทธ|๋ฆฌํŒฉํ† ๋ง)\b/i.test(prompt);
36
+ // Apply enhancements based on type
37
+ if (enhancement_type === 'clarity' || enhancement_type === 'all') {
38
+ if (promptLength < 20) {
39
+ enhancements.clarity.push('๋” ๊ตฌ์ฒด์ ์ธ ์„ค๋ช… ์ถ”๊ฐ€');
40
+ }
41
+ if (!hasQuestion && !hasSpecificTerms) {
42
+ enhancements.clarity.push('๋ช…ํ™•ํ•œ ์š”์ฒญ์ด๋‚˜ ์งˆ๋ฌธ ํ˜•ํƒœ๋กœ ๋ณ€ํ™˜');
43
+ }
44
+ }
45
+ if (enhancement_type === 'specificity' || enhancement_type === 'all') {
46
+ if (!prompt.match(/\b(์–ธ์–ด|ํ”„๋ ˆ์ž„์›Œํฌ|๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ|๋ฒ„์ „)\b/)) {
47
+ enhancements.specificity.push('๊ธฐ์ˆ  ์Šคํƒ ๋ช…์‹œ');
48
+ }
49
+ if (!prompt.match(/\b(์ž…๋ ฅ|์ถœ๋ ฅ|๊ฒฐ๊ณผ|ํ˜•์‹)\b/)) {
50
+ enhancements.specificity.push('์˜ˆ์ƒ ์ž…์ถœ๋ ฅ ์ •์˜');
51
+ }
52
+ }
53
+ if (enhancement_type === 'context' || enhancement_type === 'all') {
54
+ if (!prompt.match(/\b(๋ชฉ์ |์ด์œ |๋ฐฐ๊ฒฝ|์ƒํ™ฉ)\b/)) {
55
+ enhancements.context.push('์ž‘์—… ๋ชฉ์ ๊ณผ ๋ฐฐ๊ฒฝ ์ถ”๊ฐ€');
56
+ }
57
+ if (context) {
58
+ enhancements.context.push('์ œ๊ณต๋œ ์ปจํ…์ŠคํŠธ ํ†ตํ•ฉ');
59
+ }
60
+ }
61
+ // Generate enhanced prompt
62
+ let enhancedPrompt = prompt;
63
+ // Build enhanced version
64
+ const components = [];
65
+ // Add objective
66
+ components.push(`**๋ชฉํ‘œ**: ${prompt}`);
67
+ // Add context if provided
68
+ if (context) {
69
+ components.push(`**๋ฐฐ๊ฒฝ**: ${context}`);
70
+ }
71
+ // Add specific requirements based on analysis
72
+ const requirements = [];
73
+ if (enhancements.specificity.includes('๊ธฐ์ˆ  ์Šคํƒ ๋ช…์‹œ')) {
74
+ requirements.push('- ์‚ฌ์šฉํ•  ์–ธ์–ด/ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ๋ช…์‹œํ•ด์ฃผ์„ธ์š”');
75
+ }
76
+ if (enhancements.specificity.includes('์˜ˆ์ƒ ์ž…์ถœ๋ ฅ ์ •์˜')) {
77
+ requirements.push('- ์˜ˆ์ƒ๋˜๋Š” ์ž…๋ ฅ๊ณผ ์ถœ๋ ฅ ํ˜•์‹์„ ์„ค๋ช…ํ•ด์ฃผ์„ธ์š”');
78
+ }
79
+ if (requirements.length > 0) {
80
+ components.push(`**์š”๊ตฌ์‚ฌํ•ญ**:\n${requirements.join('\n')}`);
81
+ }
82
+ // Add quality considerations
83
+ const quality = [
84
+ '- ์—๋Ÿฌ ์ฒ˜๋ฆฌ ํฌํ•จ',
85
+ '- ํ…Œ์ŠคํŠธ ๊ฐ€๋Šฅํ•œ ๊ตฌ์กฐ',
86
+ '- ํ™•์žฅ ๊ฐ€๋Šฅํ•œ ์„ค๊ณ„'
87
+ ];
88
+ components.push(`**ํ’ˆ์งˆ ๊ธฐ์ค€**:\n${quality.join('\n')}`);
89
+ enhancedPrompt = components.join('\n\n');
90
+ const result = {
91
+ action: 'enhance_prompt',
92
+ original: prompt,
93
+ enhanced: enhancedPrompt,
94
+ enhancements,
95
+ improvements: [
96
+ enhancements.clarity.length > 0 ? `๋ช…ํ™•์„ฑ ๊ฐœ์„  (${enhancements.clarity.length}๊ฐœ)` : null,
97
+ enhancements.specificity.length > 0 ? `๊ตฌ์ฒด์„ฑ ์ถ”๊ฐ€ (${enhancements.specificity.length}๊ฐœ)` : null,
98
+ enhancements.context.length > 0 ? `๋งฅ๋ฝ ๋ณด๊ฐ• (${enhancements.context.length}๊ฐœ)` : null
99
+ ].filter(Boolean),
100
+ status: 'success'
101
+ };
102
+ return {
103
+ content: [{ type: 'text', text: `Original: ${prompt}\n\nEnhanced:\n${enhancedPrompt}\n\nImprovements: ${result.improvements.join(', ')}` }]
104
+ };
105
+ }