@su-record/vibe 2.5.10 → 2.5.11
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/CLAUDE.md +448 -348
- package/LICENSE +21 -21
- package/README.md +262 -262
- package/agents/architect-low.md +41 -0
- package/agents/architect-medium.md +59 -0
- package/agents/architect.md +80 -0
- package/agents/build-error-resolver.md +115 -115
- package/agents/compounder.md +261 -261
- package/agents/diagrammer.md +178 -178
- package/agents/e2e-tester.md +266 -266
- package/agents/explorer-low.md +42 -0
- package/agents/explorer-medium.md +59 -0
- package/agents/explorer.md +48 -48
- package/agents/implementer-low.md +43 -0
- package/agents/implementer-medium.md +52 -0
- package/agents/implementer.md +54 -54
- package/agents/refactor-cleaner.md +143 -143
- package/agents/research/best-practices-agent.md +189 -189
- package/agents/research/codebase-patterns-agent.md +147 -147
- package/agents/research/framework-docs-agent.md +178 -178
- package/agents/research/security-advisory-agent.md +203 -203
- package/agents/review/architecture-reviewer.md +107 -107
- package/agents/review/complexity-reviewer.md +116 -116
- package/agents/review/data-integrity-reviewer.md +88 -88
- package/agents/review/git-history-reviewer.md +103 -103
- package/agents/review/performance-reviewer.md +86 -86
- package/agents/review/python-reviewer.md +150 -150
- package/agents/review/rails-reviewer.md +139 -139
- package/agents/review/react-reviewer.md +144 -144
- package/agents/review/security-reviewer.md +80 -80
- package/agents/review/simplicity-reviewer.md +140 -140
- package/agents/review/test-coverage-reviewer.md +116 -116
- package/agents/review/typescript-reviewer.md +127 -127
- package/agents/searcher.md +54 -54
- package/agents/simplifier.md +120 -120
- package/agents/tester.md +49 -49
- package/agents/ui-previewer.md +129 -129
- package/commands/vibe.analyze.md +356 -356
- package/commands/vibe.reason.md +329 -329
- package/commands/vibe.review.md +326 -326
- package/commands/vibe.run.md +1051 -1031
- package/commands/vibe.spec.md +1058 -1058
- package/commands/vibe.utils.md +296 -296
- package/commands/vibe.verify.md +375 -375
- package/dist/cli/collaborator.js +52 -52
- package/dist/cli/detect.js +32 -32
- package/dist/cli/index.js +102 -102
- package/dist/cli/llm.js +144 -144
- package/dist/lib/DeepInit.d.ts +62 -0
- package/dist/lib/DeepInit.d.ts.map +1 -0
- package/dist/lib/DeepInit.js +247 -0
- package/dist/lib/DeepInit.js.map +1 -0
- package/dist/lib/IterationTracker.d.ts +81 -0
- package/dist/lib/IterationTracker.d.ts.map +1 -0
- package/dist/lib/IterationTracker.js +190 -0
- package/dist/lib/IterationTracker.js.map +1 -0
- package/dist/lib/ModelRouter.d.ts +50 -0
- package/dist/lib/ModelRouter.d.ts.map +1 -0
- package/dist/lib/ModelRouter.js +218 -0
- package/dist/lib/ModelRouter.js.map +1 -0
- package/dist/lib/OrchestrateWorkflow.d.ts +90 -0
- package/dist/lib/OrchestrateWorkflow.d.ts.map +1 -0
- package/dist/lib/OrchestrateWorkflow.js +261 -0
- package/dist/lib/OrchestrateWorkflow.js.map +1 -0
- package/dist/lib/PythonParser.js +108 -108
- package/dist/lib/SkillFrontmatter.d.ts +64 -0
- package/dist/lib/SkillFrontmatter.d.ts.map +1 -0
- package/dist/lib/SkillFrontmatter.js +221 -0
- package/dist/lib/SkillFrontmatter.js.map +1 -0
- package/dist/lib/SkillQualityGate.d.ts +40 -0
- package/dist/lib/SkillQualityGate.d.ts.map +1 -0
- package/dist/lib/SkillQualityGate.js +218 -0
- package/dist/lib/SkillQualityGate.js.map +1 -0
- package/dist/lib/UltraQA.d.ts +70 -0
- package/dist/lib/UltraQA.d.ts.map +1 -0
- package/dist/lib/UltraQA.js +234 -0
- package/dist/lib/UltraQA.js.map +1 -0
- package/dist/lib/gpt-api.js +4 -4
- package/dist/lib/memory/KnowledgeGraph.js +4 -4
- package/dist/lib/memory/MemorySearch.js +20 -20
- package/dist/lib/memory/MemoryStorage.js +64 -64
- package/dist/tools/convention/analyzeComplexity.test.js +115 -115
- package/dist/tools/convention/validateCodeQuality.test.js +104 -104
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +12 -0
- package/dist/tools/index.js.map +1 -1
- package/hooks/hooks.json +222 -204
- package/hooks/scripts/code-check.js +22 -22
- package/hooks/scripts/code-review.js +22 -22
- package/hooks/scripts/complexity.js +22 -22
- package/hooks/scripts/compound.js +23 -23
- package/hooks/scripts/context-save.js +33 -33
- package/hooks/scripts/hud-multiline.js +264 -0
- package/hooks/scripts/hud-status.js +293 -0
- package/hooks/scripts/keyword-detector.js +216 -0
- package/hooks/scripts/llm-orchestrate.js +171 -171
- package/hooks/scripts/post-edit.js +97 -97
- package/hooks/scripts/post-tool-verify.js +212 -0
- package/hooks/scripts/pre-tool-guard.js +127 -0
- package/hooks/scripts/recall.js +22 -22
- package/hooks/scripts/session-start.js +30 -30
- package/hooks/scripts/skill-injector.js +193 -0
- package/hooks/scripts/utils.js +97 -97
- package/languages/csharp-unity.md +515 -515
- package/languages/gdscript-godot.md +470 -470
- package/languages/ruby-rails.md +489 -489
- package/languages/typescript-angular.md +433 -433
- package/languages/typescript-astro.md +416 -416
- package/languages/typescript-electron.md +406 -406
- package/languages/typescript-nestjs.md +524 -524
- package/languages/typescript-svelte.md +407 -407
- package/languages/typescript-tauri.md +365 -365
- package/package.json +83 -83
- package/skills/context7-usage.md +102 -102
- package/skills/git-worktree.md +181 -181
- package/skills/parallel-research.md +77 -77
- package/skills/priority-todos.md +239 -239
- package/skills/tool-fallback.md +190 -190
- package/skills/vibe-capabilities.md +161 -161
- package/vibe/constitution.md +227 -227
- package/vibe/rules/core/communication-guide.md +98 -98
- package/vibe/rules/core/development-philosophy.md +52 -52
- package/vibe/rules/core/quick-start.md +102 -102
- package/vibe/rules/quality/bdd-contract-testing.md +393 -393
- package/vibe/rules/quality/checklist.md +276 -276
- package/vibe/rules/quality/testing-strategy.md +440 -440
- package/vibe/rules/standards/anti-patterns.md +541 -541
- package/vibe/rules/standards/code-structure.md +291 -291
- package/vibe/rules/standards/complexity-metrics.md +313 -313
- package/vibe/rules/standards/naming-conventions.md +198 -198
- package/vibe/setup.sh +31 -31
- package/vibe/templates/constitution-template.md +252 -252
- package/vibe/templates/contract-backend-template.md +526 -526
- package/vibe/templates/contract-frontend-template.md +599 -599
- package/vibe/templates/feature-template.md +96 -96
- package/vibe/templates/spec-template.md +221 -221
- package/dist/cli/mcp.d.ts +0 -49
- package/dist/cli/mcp.d.ts.map +0 -1
- package/dist/cli/mcp.js +0 -169
- package/dist/cli/mcp.js.map +0 -1
- package/dist/lib/gemini-mcp.d.ts +0 -10
- package/dist/lib/gemini-mcp.d.ts.map +0 -1
- package/dist/lib/gemini-mcp.js +0 -353
- package/dist/lib/gemini-mcp.js.map +0 -1
- package/dist/lib/gpt-mcp.d.ts +0 -10
- package/dist/lib/gpt-mcp.d.ts.map +0 -1
- package/dist/lib/gpt-mcp.js +0 -352
- package/dist/lib/gpt-mcp.js.map +0 -1
- package/dist/tools/analytics/getUsageAnalytics.d.ts +0 -10
- package/dist/tools/analytics/getUsageAnalytics.d.ts.map +0 -1
- package/dist/tools/analytics/getUsageAnalytics.js +0 -246
- package/dist/tools/analytics/getUsageAnalytics.js.map +0 -1
- package/dist/tools/analytics/index.d.ts +0 -5
- package/dist/tools/analytics/index.d.ts.map +0 -1
- package/dist/tools/analytics/index.js +0 -5
- package/dist/tools/analytics/index.js.map +0 -1
- package/dist/tools/convention/getCodingGuide.d.ts +0 -7
- package/dist/tools/convention/getCodingGuide.d.ts.map +0 -1
- package/dist/tools/convention/getCodingGuide.js +0 -69
- package/dist/tools/convention/getCodingGuide.js.map +0 -1
- package/dist/tools/planning/analyzeRequirements.d.ts +0 -9
- package/dist/tools/planning/analyzeRequirements.d.ts.map +0 -1
- package/dist/tools/planning/analyzeRequirements.js +0 -171
- package/dist/tools/planning/analyzeRequirements.js.map +0 -1
- package/dist/tools/planning/createUserStories.d.ts +0 -9
- package/dist/tools/planning/createUserStories.d.ts.map +0 -1
- package/dist/tools/planning/createUserStories.js +0 -124
- package/dist/tools/planning/createUserStories.js.map +0 -1
- package/dist/tools/planning/featureRoadmap.d.ts +0 -10
- package/dist/tools/planning/featureRoadmap.d.ts.map +0 -1
- package/dist/tools/planning/featureRoadmap.js +0 -207
- package/dist/tools/planning/featureRoadmap.js.map +0 -1
- package/dist/tools/planning/generatePrd.d.ts +0 -11
- package/dist/tools/planning/generatePrd.d.ts.map +0 -1
- package/dist/tools/planning/generatePrd.js +0 -161
- package/dist/tools/planning/generatePrd.js.map +0 -1
- package/dist/tools/planning/index.d.ts +0 -8
- package/dist/tools/planning/index.d.ts.map +0 -1
- package/dist/tools/planning/index.js +0 -8
- package/dist/tools/planning/index.js.map +0 -1
- package/dist/tools/prompt/analyzePrompt.d.ts +0 -7
- package/dist/tools/prompt/analyzePrompt.d.ts.map +0 -1
- package/dist/tools/prompt/analyzePrompt.js +0 -150
- package/dist/tools/prompt/analyzePrompt.js.map +0 -1
- package/dist/tools/prompt/enhancePrompt.d.ts +0 -8
- package/dist/tools/prompt/enhancePrompt.d.ts.map +0 -1
- package/dist/tools/prompt/enhancePrompt.js +0 -110
- package/dist/tools/prompt/enhancePrompt.js.map +0 -1
- package/dist/tools/prompt/enhancePromptGemini.d.ts +0 -8
- package/dist/tools/prompt/enhancePromptGemini.d.ts.map +0 -1
- package/dist/tools/prompt/enhancePromptGemini.js +0 -332
- package/dist/tools/prompt/enhancePromptGemini.js.map +0 -1
- package/dist/tools/prompt/index.d.ts +0 -7
- package/dist/tools/prompt/index.d.ts.map +0 -1
- package/dist/tools/prompt/index.js +0 -7
- package/dist/tools/prompt/index.js.map +0 -1
- package/dist/tools/reasoning/applyReasoningFramework.d.ts +0 -8
- package/dist/tools/reasoning/applyReasoningFramework.d.ts.map +0 -1
- package/dist/tools/reasoning/applyReasoningFramework.js +0 -266
- package/dist/tools/reasoning/applyReasoningFramework.js.map +0 -1
- package/dist/tools/reasoning/index.d.ts +0 -5
- package/dist/tools/reasoning/index.d.ts.map +0 -1
- package/dist/tools/reasoning/index.js +0 -5
- package/dist/tools/reasoning/index.js.map +0 -1
- package/dist/tools/thinking/analyzeProblem.d.ts +0 -7
- package/dist/tools/thinking/analyzeProblem.d.ts.map +0 -1
- package/dist/tools/thinking/analyzeProblem.js +0 -55
- package/dist/tools/thinking/analyzeProblem.js.map +0 -1
- package/dist/tools/thinking/breakDownProblem.d.ts +0 -8
- package/dist/tools/thinking/breakDownProblem.d.ts.map +0 -1
- package/dist/tools/thinking/breakDownProblem.js +0 -145
- package/dist/tools/thinking/breakDownProblem.js.map +0 -1
- package/dist/tools/thinking/createThinkingChain.d.ts +0 -7
- package/dist/tools/thinking/createThinkingChain.d.ts.map +0 -1
- package/dist/tools/thinking/createThinkingChain.js +0 -44
- package/dist/tools/thinking/createThinkingChain.js.map +0 -1
- package/dist/tools/thinking/formatAsPlan.d.ts +0 -9
- package/dist/tools/thinking/formatAsPlan.d.ts.map +0 -1
- package/dist/tools/thinking/formatAsPlan.js +0 -78
- package/dist/tools/thinking/formatAsPlan.js.map +0 -1
- package/dist/tools/thinking/index.d.ts +0 -10
- package/dist/tools/thinking/index.d.ts.map +0 -1
- package/dist/tools/thinking/index.js +0 -10
- package/dist/tools/thinking/index.js.map +0 -1
- package/dist/tools/thinking/stepByStepAnalysis.d.ts +0 -8
- package/dist/tools/thinking/stepByStepAnalysis.d.ts.map +0 -1
- package/dist/tools/thinking/stepByStepAnalysis.js +0 -63
- package/dist/tools/thinking/stepByStepAnalysis.js.map +0 -1
- package/dist/tools/thinking/thinkAloudProcess.d.ts +0 -8
- package/dist/tools/thinking/thinkAloudProcess.d.ts.map +0 -1
- package/dist/tools/thinking/thinkAloudProcess.js +0 -80
- package/dist/tools/thinking/thinkAloudProcess.js.map +0 -1
package/dist/lib/PythonParser.js
CHANGED
|
@@ -35,114 +35,114 @@ function getPythonCommand() {
|
|
|
35
35
|
const PYTHON_CMD = getPythonCommand();
|
|
36
36
|
export class PythonParser {
|
|
37
37
|
static cleanupRegistered = false;
|
|
38
|
-
static pythonScript = `
|
|
39
|
-
import ast
|
|
40
|
-
import sys
|
|
41
|
-
import json
|
|
42
|
-
|
|
43
|
-
def analyze_code(code):
|
|
44
|
-
try:
|
|
45
|
-
tree = ast.parse(code)
|
|
46
|
-
symbols = []
|
|
47
|
-
|
|
48
|
-
for node in ast.walk(tree):
|
|
49
|
-
if isinstance(node, ast.FunctionDef):
|
|
50
|
-
symbols.append({
|
|
51
|
-
'name': node.name,
|
|
52
|
-
'kind': 'function',
|
|
53
|
-
'line': node.lineno,
|
|
54
|
-
'column': node.col_offset,
|
|
55
|
-
'endLine': node.end_lineno,
|
|
56
|
-
'docstring': ast.get_docstring(node)
|
|
57
|
-
})
|
|
58
|
-
elif isinstance(node, ast.ClassDef):
|
|
59
|
-
symbols.append({
|
|
60
|
-
'name': node.name,
|
|
61
|
-
'kind': 'class',
|
|
62
|
-
'line': node.lineno,
|
|
63
|
-
'column': node.col_offset,
|
|
64
|
-
'endLine': node.end_lineno,
|
|
65
|
-
'docstring': ast.get_docstring(node)
|
|
66
|
-
})
|
|
67
|
-
elif isinstance(node, ast.Assign):
|
|
68
|
-
for target in node.targets:
|
|
69
|
-
if isinstance(target, ast.Name):
|
|
70
|
-
symbols.append({
|
|
71
|
-
'name': target.id,
|
|
72
|
-
'kind': 'variable',
|
|
73
|
-
'line': node.lineno,
|
|
74
|
-
'column': node.col_offset
|
|
75
|
-
})
|
|
76
|
-
elif isinstance(node, ast.Import) or isinstance(node, ast.ImportFrom):
|
|
77
|
-
for alias in node.names:
|
|
78
|
-
symbols.append({
|
|
79
|
-
'name': alias.name,
|
|
80
|
-
'kind': 'import',
|
|
81
|
-
'line': node.lineno,
|
|
82
|
-
'column': node.col_offset
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
return {'success': True, 'symbols': symbols}
|
|
86
|
-
except SyntaxError as e:
|
|
87
|
-
return {'success': False, 'error': str(e)}
|
|
88
|
-
except Exception as e:
|
|
89
|
-
return {'success': False, 'error': str(e)}
|
|
90
|
-
|
|
91
|
-
def calculate_complexity(code):
|
|
92
|
-
try:
|
|
93
|
-
tree = ast.parse(code)
|
|
94
|
-
|
|
95
|
-
def cyclomatic_complexity(node):
|
|
96
|
-
complexity = 1
|
|
97
|
-
for child in ast.walk(node):
|
|
98
|
-
if isinstance(child, (ast.If, ast.For, ast.While, ast.And, ast.Or, ast.ExceptHandler)):
|
|
99
|
-
complexity += 1
|
|
100
|
-
elif isinstance(child, ast.BoolOp):
|
|
101
|
-
complexity += len(child.values) - 1
|
|
102
|
-
return complexity
|
|
103
|
-
|
|
104
|
-
functions = []
|
|
105
|
-
classes = []
|
|
106
|
-
total_complexity = 1
|
|
107
|
-
|
|
108
|
-
for node in ast.walk(tree):
|
|
109
|
-
if isinstance(node, ast.FunctionDef):
|
|
110
|
-
func_complexity = cyclomatic_complexity(node)
|
|
111
|
-
functions.append({
|
|
112
|
-
'name': node.name,
|
|
113
|
-
'complexity': func_complexity,
|
|
114
|
-
'line': node.lineno
|
|
115
|
-
})
|
|
116
|
-
total_complexity += func_complexity
|
|
117
|
-
elif isinstance(node, ast.ClassDef):
|
|
118
|
-
method_count = sum(1 for n in node.body if isinstance(n, ast.FunctionDef))
|
|
119
|
-
classes.append({
|
|
120
|
-
'name': node.name,
|
|
121
|
-
'methods': method_count,
|
|
122
|
-
'line': node.lineno
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
return {
|
|
126
|
-
'success': True,
|
|
127
|
-
'cyclomaticComplexity': total_complexity,
|
|
128
|
-
'functions': functions,
|
|
129
|
-
'classes': classes
|
|
130
|
-
}
|
|
131
|
-
except Exception as e:
|
|
132
|
-
return {'success': False, 'error': str(e)}
|
|
133
|
-
|
|
134
|
-
if __name__ == '__main__':
|
|
135
|
-
code = sys.stdin.read()
|
|
136
|
-
action = sys.argv[1] if len(sys.argv) > 1 else 'symbols'
|
|
137
|
-
|
|
138
|
-
if action == 'symbols':
|
|
139
|
-
result = analyze_code(code)
|
|
140
|
-
elif action == 'complexity':
|
|
141
|
-
result = calculate_complexity(code)
|
|
142
|
-
else:
|
|
143
|
-
result = {'success': False, 'error': 'Unknown action'}
|
|
144
|
-
|
|
145
|
-
print(json.dumps(result))
|
|
38
|
+
static pythonScript = `
|
|
39
|
+
import ast
|
|
40
|
+
import sys
|
|
41
|
+
import json
|
|
42
|
+
|
|
43
|
+
def analyze_code(code):
|
|
44
|
+
try:
|
|
45
|
+
tree = ast.parse(code)
|
|
46
|
+
symbols = []
|
|
47
|
+
|
|
48
|
+
for node in ast.walk(tree):
|
|
49
|
+
if isinstance(node, ast.FunctionDef):
|
|
50
|
+
symbols.append({
|
|
51
|
+
'name': node.name,
|
|
52
|
+
'kind': 'function',
|
|
53
|
+
'line': node.lineno,
|
|
54
|
+
'column': node.col_offset,
|
|
55
|
+
'endLine': node.end_lineno,
|
|
56
|
+
'docstring': ast.get_docstring(node)
|
|
57
|
+
})
|
|
58
|
+
elif isinstance(node, ast.ClassDef):
|
|
59
|
+
symbols.append({
|
|
60
|
+
'name': node.name,
|
|
61
|
+
'kind': 'class',
|
|
62
|
+
'line': node.lineno,
|
|
63
|
+
'column': node.col_offset,
|
|
64
|
+
'endLine': node.end_lineno,
|
|
65
|
+
'docstring': ast.get_docstring(node)
|
|
66
|
+
})
|
|
67
|
+
elif isinstance(node, ast.Assign):
|
|
68
|
+
for target in node.targets:
|
|
69
|
+
if isinstance(target, ast.Name):
|
|
70
|
+
symbols.append({
|
|
71
|
+
'name': target.id,
|
|
72
|
+
'kind': 'variable',
|
|
73
|
+
'line': node.lineno,
|
|
74
|
+
'column': node.col_offset
|
|
75
|
+
})
|
|
76
|
+
elif isinstance(node, ast.Import) or isinstance(node, ast.ImportFrom):
|
|
77
|
+
for alias in node.names:
|
|
78
|
+
symbols.append({
|
|
79
|
+
'name': alias.name,
|
|
80
|
+
'kind': 'import',
|
|
81
|
+
'line': node.lineno,
|
|
82
|
+
'column': node.col_offset
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
return {'success': True, 'symbols': symbols}
|
|
86
|
+
except SyntaxError as e:
|
|
87
|
+
return {'success': False, 'error': str(e)}
|
|
88
|
+
except Exception as e:
|
|
89
|
+
return {'success': False, 'error': str(e)}
|
|
90
|
+
|
|
91
|
+
def calculate_complexity(code):
|
|
92
|
+
try:
|
|
93
|
+
tree = ast.parse(code)
|
|
94
|
+
|
|
95
|
+
def cyclomatic_complexity(node):
|
|
96
|
+
complexity = 1
|
|
97
|
+
for child in ast.walk(node):
|
|
98
|
+
if isinstance(child, (ast.If, ast.For, ast.While, ast.And, ast.Or, ast.ExceptHandler)):
|
|
99
|
+
complexity += 1
|
|
100
|
+
elif isinstance(child, ast.BoolOp):
|
|
101
|
+
complexity += len(child.values) - 1
|
|
102
|
+
return complexity
|
|
103
|
+
|
|
104
|
+
functions = []
|
|
105
|
+
classes = []
|
|
106
|
+
total_complexity = 1
|
|
107
|
+
|
|
108
|
+
for node in ast.walk(tree):
|
|
109
|
+
if isinstance(node, ast.FunctionDef):
|
|
110
|
+
func_complexity = cyclomatic_complexity(node)
|
|
111
|
+
functions.append({
|
|
112
|
+
'name': node.name,
|
|
113
|
+
'complexity': func_complexity,
|
|
114
|
+
'line': node.lineno
|
|
115
|
+
})
|
|
116
|
+
total_complexity += func_complexity
|
|
117
|
+
elif isinstance(node, ast.ClassDef):
|
|
118
|
+
method_count = sum(1 for n in node.body if isinstance(n, ast.FunctionDef))
|
|
119
|
+
classes.append({
|
|
120
|
+
'name': node.name,
|
|
121
|
+
'methods': method_count,
|
|
122
|
+
'line': node.lineno
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
'success': True,
|
|
127
|
+
'cyclomaticComplexity': total_complexity,
|
|
128
|
+
'functions': functions,
|
|
129
|
+
'classes': classes
|
|
130
|
+
}
|
|
131
|
+
except Exception as e:
|
|
132
|
+
return {'success': False, 'error': str(e)}
|
|
133
|
+
|
|
134
|
+
if __name__ == '__main__':
|
|
135
|
+
code = sys.stdin.read()
|
|
136
|
+
action = sys.argv[1] if len(sys.argv) > 1 else 'symbols'
|
|
137
|
+
|
|
138
|
+
if action == 'symbols':
|
|
139
|
+
result = analyze_code(code)
|
|
140
|
+
elif action == 'complexity':
|
|
141
|
+
result = calculate_complexity(code)
|
|
142
|
+
else:
|
|
143
|
+
result = {'success': False, 'error': 'Unknown action'}
|
|
144
|
+
|
|
145
|
+
print(json.dumps(result))
|
|
146
146
|
`;
|
|
147
147
|
// Singleton Python script path to avoid recreating it
|
|
148
148
|
static scriptPath = null;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Frontmatter System
|
|
3
|
+
* YAML metadata for declarative skill configuration
|
|
4
|
+
*
|
|
5
|
+
* Inspired by oh-my-claudecode's skill metadata system
|
|
6
|
+
*/
|
|
7
|
+
export interface SkillMetadata {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
model?: 'haiku' | 'sonnet' | 'opus';
|
|
11
|
+
agent?: string;
|
|
12
|
+
argumentHint?: string;
|
|
13
|
+
userInvocable?: boolean;
|
|
14
|
+
subtask?: boolean;
|
|
15
|
+
allowedTools?: string[];
|
|
16
|
+
triggers?: string[];
|
|
17
|
+
priority?: number;
|
|
18
|
+
mcpConfig?: McpConfig;
|
|
19
|
+
}
|
|
20
|
+
export interface McpConfig {
|
|
21
|
+
servers?: string[];
|
|
22
|
+
tools?: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface ParsedSkill {
|
|
25
|
+
metadata: SkillMetadata;
|
|
26
|
+
template: string;
|
|
27
|
+
raw: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parse YAML frontmatter from skill file
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseSkillFrontmatter(content: string): ParsedSkill | null;
|
|
33
|
+
/**
|
|
34
|
+
* Generate skill frontmatter
|
|
35
|
+
*/
|
|
36
|
+
export declare function generateSkillFrontmatter(metadata: SkillMetadata): string;
|
|
37
|
+
/**
|
|
38
|
+
* Create full skill file content
|
|
39
|
+
*/
|
|
40
|
+
export declare function createSkillFile(metadata: SkillMetadata, template: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Validate skill metadata
|
|
43
|
+
*/
|
|
44
|
+
export declare function validateSkillMetadata(metadata: Partial<SkillMetadata>): {
|
|
45
|
+
valid: boolean;
|
|
46
|
+
errors: string[];
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Merge skill metadata with defaults
|
|
50
|
+
*/
|
|
51
|
+
export declare function mergeWithDefaults(metadata: Partial<SkillMetadata>): SkillMetadata;
|
|
52
|
+
/**
|
|
53
|
+
* Extract triggers from skill template
|
|
54
|
+
*/
|
|
55
|
+
export declare function extractTriggersFromTemplate(template: string): string[];
|
|
56
|
+
/**
|
|
57
|
+
* Substitute template variables
|
|
58
|
+
*/
|
|
59
|
+
export declare function substituteTemplateVars(template: string, vars: Record<string, string>): string;
|
|
60
|
+
/**
|
|
61
|
+
* Example skill template
|
|
62
|
+
*/
|
|
63
|
+
export declare const SKILL_TEMPLATE_EXAMPLE = "---\nname: example-skill\ndescription: \"An example skill demonstrating the frontmatter system\"\nmodel: sonnet\nagent: implementer\nargument-hint: \"task description\"\nuser-invocable: true\ntriggers: [example, demo, test]\npriority: 50\n---\n\n# Example Skill\n\nThis skill demonstrates the frontmatter metadata system.\n\n## Arguments\n\n$ARGUMENTS\n\n## Process\n\n1. Parse the arguments\n2. Execute the task\n3. Return the result\n\n## Output\n\nProvide a clear summary of what was done.\n";
|
|
64
|
+
//# sourceMappingURL=SkillFrontmatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkillFrontmatter.d.ts","sourceRoot":"","sources":["../../src/lib/SkillFrontmatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IACpC,KAAK,CAAC,EAAE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AAE,MAAM,CAAC,GAC3B,MAAM,CAUR;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,mfA4BlC,CAAC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Frontmatter System
|
|
3
|
+
* YAML metadata for declarative skill configuration
|
|
4
|
+
*
|
|
5
|
+
* Inspired by oh-my-claudecode's skill metadata system
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Parse YAML frontmatter from skill file
|
|
9
|
+
*/
|
|
10
|
+
export function parseSkillFrontmatter(content) {
|
|
11
|
+
// Check for frontmatter delimiter
|
|
12
|
+
if (!content.startsWith('---')) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
// Find end of frontmatter
|
|
16
|
+
const endIndex = content.indexOf('---', 3);
|
|
17
|
+
if (endIndex === -1) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const frontmatter = content.slice(3, endIndex).trim();
|
|
21
|
+
const template = content.slice(endIndex + 3).trim();
|
|
22
|
+
// Parse YAML (simple implementation)
|
|
23
|
+
const metadata = parseSimpleYaml(frontmatter);
|
|
24
|
+
if (!metadata.name) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
metadata: metadata,
|
|
29
|
+
template,
|
|
30
|
+
raw: content,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Simple YAML parser for frontmatter
|
|
35
|
+
*/
|
|
36
|
+
function parseSimpleYaml(yaml) {
|
|
37
|
+
const result = {};
|
|
38
|
+
const lines = yaml.split('\n');
|
|
39
|
+
for (const line of lines) {
|
|
40
|
+
const trimmed = line.trim();
|
|
41
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
42
|
+
continue;
|
|
43
|
+
const colonIndex = trimmed.indexOf(':');
|
|
44
|
+
if (colonIndex === -1)
|
|
45
|
+
continue;
|
|
46
|
+
const key = trimmed.slice(0, colonIndex).trim();
|
|
47
|
+
let value = trimmed.slice(colonIndex + 1).trim();
|
|
48
|
+
// Handle different value types
|
|
49
|
+
if (value === 'true')
|
|
50
|
+
value = true;
|
|
51
|
+
else if (value === 'false')
|
|
52
|
+
value = false;
|
|
53
|
+
else if (/^\d+$/.test(value))
|
|
54
|
+
value = parseInt(value, 10);
|
|
55
|
+
else if (value.startsWith('[') && value.endsWith(']')) {
|
|
56
|
+
// Parse simple array
|
|
57
|
+
value = value
|
|
58
|
+
.slice(1, -1)
|
|
59
|
+
.split(',')
|
|
60
|
+
.map(v => v.trim().replace(/^["']|["']$/g, ''))
|
|
61
|
+
.filter(Boolean);
|
|
62
|
+
}
|
|
63
|
+
else if (value.startsWith('"') || value.startsWith("'")) {
|
|
64
|
+
// Remove quotes
|
|
65
|
+
value = value.slice(1, -1);
|
|
66
|
+
}
|
|
67
|
+
// Convert kebab-case to camelCase
|
|
68
|
+
const camelKey = key.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
69
|
+
result[camelKey] = value;
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Generate skill frontmatter
|
|
75
|
+
*/
|
|
76
|
+
export function generateSkillFrontmatter(metadata) {
|
|
77
|
+
const lines = ['---'];
|
|
78
|
+
lines.push(`name: ${metadata.name}`);
|
|
79
|
+
lines.push(`description: "${metadata.description}"`);
|
|
80
|
+
if (metadata.model) {
|
|
81
|
+
lines.push(`model: ${metadata.model}`);
|
|
82
|
+
}
|
|
83
|
+
if (metadata.agent) {
|
|
84
|
+
lines.push(`agent: ${metadata.agent}`);
|
|
85
|
+
}
|
|
86
|
+
if (metadata.argumentHint) {
|
|
87
|
+
lines.push(`argument-hint: "${metadata.argumentHint}"`);
|
|
88
|
+
}
|
|
89
|
+
if (metadata.userInvocable !== undefined) {
|
|
90
|
+
lines.push(`user-invocable: ${metadata.userInvocable}`);
|
|
91
|
+
}
|
|
92
|
+
if (metadata.subtask !== undefined) {
|
|
93
|
+
lines.push(`subtask: ${metadata.subtask}`);
|
|
94
|
+
}
|
|
95
|
+
if (metadata.allowedTools && metadata.allowedTools.length > 0) {
|
|
96
|
+
lines.push(`allowed-tools: [${metadata.allowedTools.join(', ')}]`);
|
|
97
|
+
}
|
|
98
|
+
if (metadata.triggers && metadata.triggers.length > 0) {
|
|
99
|
+
lines.push(`triggers: [${metadata.triggers.join(', ')}]`);
|
|
100
|
+
}
|
|
101
|
+
if (metadata.priority !== undefined) {
|
|
102
|
+
lines.push(`priority: ${metadata.priority}`);
|
|
103
|
+
}
|
|
104
|
+
lines.push('---');
|
|
105
|
+
return lines.join('\n');
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Create full skill file content
|
|
109
|
+
*/
|
|
110
|
+
export function createSkillFile(metadata, template) {
|
|
111
|
+
const frontmatter = generateSkillFrontmatter(metadata);
|
|
112
|
+
return `${frontmatter}\n\n${template}`;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Validate skill metadata
|
|
116
|
+
*/
|
|
117
|
+
export function validateSkillMetadata(metadata) {
|
|
118
|
+
const errors = [];
|
|
119
|
+
if (!metadata.name) {
|
|
120
|
+
errors.push('Missing required field: name');
|
|
121
|
+
}
|
|
122
|
+
if (!metadata.description) {
|
|
123
|
+
errors.push('Missing required field: description');
|
|
124
|
+
}
|
|
125
|
+
if (metadata.model && !['haiku', 'sonnet', 'opus'].includes(metadata.model)) {
|
|
126
|
+
errors.push(`Invalid model: ${metadata.model}. Must be haiku, sonnet, or opus`);
|
|
127
|
+
}
|
|
128
|
+
if (metadata.priority !== undefined && (metadata.priority < 0 || metadata.priority > 100)) {
|
|
129
|
+
errors.push('Priority must be between 0 and 100');
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
valid: errors.length === 0,
|
|
133
|
+
errors,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Merge skill metadata with defaults
|
|
138
|
+
*/
|
|
139
|
+
export function mergeWithDefaults(metadata) {
|
|
140
|
+
return {
|
|
141
|
+
name: metadata.name || 'unnamed-skill',
|
|
142
|
+
description: metadata.description || 'No description',
|
|
143
|
+
model: metadata.model,
|
|
144
|
+
agent: metadata.agent,
|
|
145
|
+
argumentHint: metadata.argumentHint,
|
|
146
|
+
userInvocable: metadata.userInvocable ?? true,
|
|
147
|
+
subtask: metadata.subtask ?? false,
|
|
148
|
+
allowedTools: metadata.allowedTools,
|
|
149
|
+
triggers: metadata.triggers,
|
|
150
|
+
priority: metadata.priority ?? 50,
|
|
151
|
+
mcpConfig: metadata.mcpConfig,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Extract triggers from skill template
|
|
156
|
+
*/
|
|
157
|
+
export function extractTriggersFromTemplate(template) {
|
|
158
|
+
const triggers = [];
|
|
159
|
+
// Look for keyword patterns in template
|
|
160
|
+
const keywordPatterns = [
|
|
161
|
+
/\bwhen\s+(\w+)/gi,
|
|
162
|
+
/\bif\s+(\w+)/gi,
|
|
163
|
+
/\b(\w+)\s+detected/gi,
|
|
164
|
+
/trigger:\s*(\w+)/gi,
|
|
165
|
+
];
|
|
166
|
+
for (const pattern of keywordPatterns) {
|
|
167
|
+
let match;
|
|
168
|
+
while ((match = pattern.exec(template)) !== null) {
|
|
169
|
+
const keyword = match[1].toLowerCase();
|
|
170
|
+
if (keyword.length > 2 && !triggers.includes(keyword)) {
|
|
171
|
+
triggers.push(keyword);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return triggers;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Substitute template variables
|
|
179
|
+
*/
|
|
180
|
+
export function substituteTemplateVars(template, vars) {
|
|
181
|
+
let result = template;
|
|
182
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
183
|
+
// Support both {{VAR}} and $VAR patterns
|
|
184
|
+
result = result.replace(new RegExp(`\\{\\{${key}\\}\\}`, 'g'), value);
|
|
185
|
+
result = result.replace(new RegExp(`\\$${key}\\b`, 'g'), value);
|
|
186
|
+
}
|
|
187
|
+
return result;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Example skill template
|
|
191
|
+
*/
|
|
192
|
+
export const SKILL_TEMPLATE_EXAMPLE = `---
|
|
193
|
+
name: example-skill
|
|
194
|
+
description: "An example skill demonstrating the frontmatter system"
|
|
195
|
+
model: sonnet
|
|
196
|
+
agent: implementer
|
|
197
|
+
argument-hint: "task description"
|
|
198
|
+
user-invocable: true
|
|
199
|
+
triggers: [example, demo, test]
|
|
200
|
+
priority: 50
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
# Example Skill
|
|
204
|
+
|
|
205
|
+
This skill demonstrates the frontmatter metadata system.
|
|
206
|
+
|
|
207
|
+
## Arguments
|
|
208
|
+
|
|
209
|
+
$ARGUMENTS
|
|
210
|
+
|
|
211
|
+
## Process
|
|
212
|
+
|
|
213
|
+
1. Parse the arguments
|
|
214
|
+
2. Execute the task
|
|
215
|
+
3. Return the result
|
|
216
|
+
|
|
217
|
+
## Output
|
|
218
|
+
|
|
219
|
+
Provide a clear summary of what was done.
|
|
220
|
+
`;
|
|
221
|
+
//# sourceMappingURL=SkillFrontmatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkillFrontmatter.js","sourceRoot":"","sources":["../../src/lib/SkillFrontmatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2BH;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,kCAAkC;IAClC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC3C,IAAI,QAAQ,KAAK,CAAC,CAAC,EA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B,IAAI,MAAM,GAAG,QAAQ,CAAC;IAEtB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,yCAAyC;QACzC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,SAAS,GAAG,QAAQ,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QACtE,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,KAAK,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BrC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Quality Gate
|
|
3
|
+
* 저장할 메모리/스킬의 품질을 검증
|
|
4
|
+
*
|
|
5
|
+
* Inspired by oh-my-claudecode's Mnemosyne/Learner skill extraction
|
|
6
|
+
*/
|
|
7
|
+
export interface QualityCheckResult {
|
|
8
|
+
isValid: boolean;
|
|
9
|
+
score: number;
|
|
10
|
+
issues: string[];
|
|
11
|
+
suggestions: string[];
|
|
12
|
+
category: 'principle' | 'discovery' | 'decision' | 'code' | 'generic';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 메모리/스킬 품질 검증
|
|
16
|
+
*/
|
|
17
|
+
export declare function validateSkillQuality(key: string, value: string, category?: string): QualityCheckResult;
|
|
18
|
+
/**
|
|
19
|
+
* 원칙 형태로 변환 도우미
|
|
20
|
+
*/
|
|
21
|
+
export declare function suggestPrincipleFormat(value: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* 스킬 분류
|
|
24
|
+
*/
|
|
25
|
+
export declare function classifySkill(value: string): {
|
|
26
|
+
type: 'principle' | 'discovery' | 'decision' | 'reference' | 'generic';
|
|
27
|
+
confidence: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* 저장 전 검증 래퍼
|
|
31
|
+
*/
|
|
32
|
+
export declare function validateBeforeSave(key: string, value: string, options?: {
|
|
33
|
+
bypassValidation?: boolean;
|
|
34
|
+
minScore?: number;
|
|
35
|
+
}): {
|
|
36
|
+
canSave: boolean;
|
|
37
|
+
result: QualityCheckResult;
|
|
38
|
+
formattedFeedback: string;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=SkillQualityGate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkillQualityGate.d.ts","sourceRoot":"","sources":["../../src/lib/SkillQualityGate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;CACvE;AAoDD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB,kBAAkB,CAyFpB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAiB5D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG;IAC5C,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;IACvE,UAAU,EAAE,MAAM,CAAC;CACpB,CAsCA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CA6B7E"}
|