@su-record/vibe 2.4.23 → 2.4.24
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/settings.local.json +1 -5
- package/CLAUDE.md +6 -0
- package/hooks/hooks.json +16 -16
- package/hooks/scripts/code-quality-hook.mjs +17 -0
- package/hooks/scripts/complexity-hook.mjs +17 -0
- package/hooks/scripts/context-save-hook.mjs +29 -0
- package/hooks/scripts/gemini-code-hook.mjs +28 -0
- package/hooks/scripts/gemini-hook.mjs +26 -0
- package/hooks/scripts/gemini-uiux-hook.mjs +28 -0
- package/hooks/scripts/gpt-architect-hook.mjs +28 -0
- package/hooks/scripts/gpt-debug-hook.mjs +28 -0
- package/hooks/scripts/gpt-hook.mjs +26 -0
- package/hooks/scripts/memory-list-hook.mjs +18 -0
- package/hooks/scripts/memory-save-hook.mjs +19 -0
- package/hooks/scripts/post-tool-use-hook.mjs +17 -0
- package/hooks/scripts/session-start-hook.mjs +26 -0
- package/package.json +1 -1
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"permissions": {
|
|
3
3
|
"allow": [
|
|
4
|
-
"Bash(
|
|
5
|
-
"Bash(timeout 10 node -e \"const {execSync}=require\\(''child_process''\\);const V=process.platform===''win32''?''file:///''+process.env.APPDATA.replace\\(/\\\\\\\\/g,''/''\\)+''/npm/node_modules/@su-record/vibe/dist/lib/gpt-api.js'':''file://''+execSync\\(''npm root -g'',{encoding:''utf-8''}\\).trim\\(\\)+''/@su-record/vibe/dist/lib/gpt-api.js'';let d='''';process.stdin.on\\(''data'',c=>d+=c\\);process.stdin.on\\(''end'',\\(\\)=>{const q=JSON.parse\\(d\\).prompt.replace\\(/gpt.*?\\(물어|질문|한테|분석\\)[^가-힣]*/i,''''\\).trim\\(\\);import\\(V\\).then\\(g=>g.quickAsk\\(q\\)\\).then\\(r=>console.log\\(''GPT-5.2 응답: ''+r\\)\\).catch\\(e=>console.log\\(''[GPT] Error:'',e.message\\)\\)}\\)\")",
|
|
6
|
-
"Bash(echo:*)",
|
|
7
|
-
"Bash(# Check if there were any hook errors in past sessions grep -rn \"\"hook.*error\\\\|error.*hook\"\" ~/.claude/debug/*.txt)",
|
|
8
|
-
"Bash(set +H)"
|
|
4
|
+
"Bash(# Test heredoc style for hooks\nnode --input-type=module <<'EOF'\nimport { execSync } from 'child_process';\nconst root = execSync\\('npm root -g', {encoding:'utf-8'}\\).trim\\(\\);\nconst B = 'file://' + root + '/@su-record/vibe/dist/lib/gpt-api.js';\nconst m = await import\\(B\\);\nconst r = await m.quickAsk\\('서울 날씨'\\);\nconsole.log\\('GPT-5.2 응답:', r\\);\nEOF\necho \"\"Exit: $?\"\")"
|
|
9
5
|
]
|
|
10
6
|
}
|
|
11
7
|
}
|
package/CLAUDE.md
CHANGED
|
@@ -37,6 +37,12 @@ SPEC 주도 AI 코딩 프레임워크 (Claude Code 전용)
|
|
|
37
37
|
- `@ts-ignore` 금지 → 타입 문제 근본 해결
|
|
38
38
|
- 모든 함수에 반환 타입 명시
|
|
39
39
|
|
|
40
|
+
### TypeScript 규칙
|
|
41
|
+
- `any` 타입 사용 금지 → `unknown` + 타입 가드 사용
|
|
42
|
+
- `as any` 캐스팅 금지 → 적절한 인터페이스 정의
|
|
43
|
+
- `@ts-ignore` 금지 → 타입 문제 근본 해결
|
|
44
|
+
- 모든 함수에 반환 타입 명시
|
|
45
|
+
|
|
40
46
|
### 에러 처리 필수
|
|
41
47
|
- try-catch 또는 error state 필수
|
|
42
48
|
- 로딩 상태 처리
|
package/hooks/hooks.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"hooks": [
|
|
11
11
|
{
|
|
12
12
|
"type": "command",
|
|
13
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
13
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();spawn('node',[r+'/@su-record/vibe/hooks/scripts/session-start-hook.mjs'],{stdio:'inherit'}).on('close',c=>process.exit(c))\""
|
|
14
14
|
}
|
|
15
15
|
]
|
|
16
16
|
}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"hooks": [
|
|
33
33
|
{
|
|
34
34
|
"type": "command",
|
|
35
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
35
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();spawn('node',[r+'/@su-record/vibe/hooks/scripts/post-tool-use-hook.mjs'],{stdio:'inherit'}).on('close',c=>process.exit(c))\""
|
|
36
36
|
}
|
|
37
37
|
]
|
|
38
38
|
}
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"hooks": [
|
|
62
62
|
{
|
|
63
63
|
"type": "command",
|
|
64
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
64
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();spawn('node',[r+'/@su-record/vibe/hooks/scripts/memory-save-hook.mjs'],{stdio:'inherit'}).on('close',c=>process.exit(c))\""
|
|
65
65
|
}
|
|
66
66
|
]
|
|
67
67
|
},
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"hooks": [
|
|
71
71
|
{
|
|
72
72
|
"type": "command",
|
|
73
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
73
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();spawn('node',[r+'/@su-record/vibe/hooks/scripts/code-quality-hook.mjs'],{stdio:'inherit'}).on('close',c=>process.exit(c))\""
|
|
74
74
|
}
|
|
75
75
|
]
|
|
76
76
|
},
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"hooks": [
|
|
89
89
|
{
|
|
90
90
|
"type": "command",
|
|
91
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
91
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();spawn('node',[r+'/@su-record/vibe/hooks/scripts/complexity-hook.mjs'],{stdio:'inherit'}).on('close',c=>process.exit(c))\""
|
|
92
92
|
}
|
|
93
93
|
]
|
|
94
94
|
},
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"hooks": [
|
|
98
98
|
{
|
|
99
99
|
"type": "command",
|
|
100
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
100
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();spawn('node',[r+'/@su-record/vibe/hooks/scripts/memory-list-hook.mjs'],{stdio:'inherit'}).on('close',c=>process.exit(c))\""
|
|
101
101
|
}
|
|
102
102
|
]
|
|
103
103
|
},
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"hooks": [
|
|
107
107
|
{
|
|
108
108
|
"type": "command",
|
|
109
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
109
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();const p=spawn('node',[r+'/@su-record/vibe/hooks/scripts/gpt-architect-hook.mjs'],{stdio:['pipe','inherit','inherit']});process.stdin.pipe(p.stdin);p.on('close',c=>process.exit(c))\"",
|
|
110
110
|
"statusMessage": "GPT analyzing architecture..."
|
|
111
111
|
}
|
|
112
112
|
]
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"hooks": [
|
|
117
117
|
{
|
|
118
118
|
"type": "command",
|
|
119
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
119
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();const p=spawn('node',[r+'/@su-record/vibe/hooks/scripts/gemini-uiux-hook.mjs'],{stdio:['pipe','inherit','inherit']});process.stdin.pipe(p.stdin);p.on('close',c=>process.exit(c))\"",
|
|
120
120
|
"statusMessage": "Gemini reviewing UI/UX..."
|
|
121
121
|
}
|
|
122
122
|
]
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"hooks": [
|
|
127
127
|
{
|
|
128
128
|
"type": "command",
|
|
129
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
129
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();const p=spawn('node',[r+'/@su-record/vibe/hooks/scripts/gpt-hook.mjs'],{stdio:['pipe','inherit','inherit']});process.stdin.pipe(p.stdin);p.on('close',c=>process.exit(c))\"",
|
|
130
130
|
"statusMessage": "Asking GPT-5.2..."
|
|
131
131
|
}
|
|
132
132
|
]
|
|
@@ -136,8 +136,8 @@
|
|
|
136
136
|
"hooks": [
|
|
137
137
|
{
|
|
138
138
|
"type": "command",
|
|
139
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
140
|
-
"statusMessage": "Asking Gemini
|
|
139
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();const p=spawn('node',[r+'/@su-record/vibe/hooks/scripts/gemini-hook.mjs'],{stdio:['pipe','inherit','inherit']});process.stdin.pipe(p.stdin);p.on('close',c=>process.exit(c))\"",
|
|
140
|
+
"statusMessage": "Asking Gemini-3..."
|
|
141
141
|
}
|
|
142
142
|
]
|
|
143
143
|
},
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"hooks": [
|
|
147
147
|
{
|
|
148
148
|
"type": "command",
|
|
149
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
149
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();const p=spawn('node',[r+'/@su-record/vibe/hooks/scripts/gpt-debug-hook.mjs'],{stdio:['pipe','inherit','inherit']});process.stdin.pipe(p.stdin);p.on('close',c=>process.exit(c))\"",
|
|
150
150
|
"statusMessage": "GPT debugging..."
|
|
151
151
|
}
|
|
152
152
|
]
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"hooks": [
|
|
157
157
|
{
|
|
158
158
|
"type": "command",
|
|
159
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
159
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();const p=spawn('node',[r+'/@su-record/vibe/hooks/scripts/gemini-code-hook.mjs'],{stdio:['pipe','inherit','inherit']});process.stdin.pipe(p.stdin);p.on('close',c=>process.exit(c))\"",
|
|
160
160
|
"statusMessage": "Gemini analyzing code..."
|
|
161
161
|
}
|
|
162
162
|
]
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
"hooks": [
|
|
169
169
|
{
|
|
170
170
|
"type": "command",
|
|
171
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
171
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();spawn('node',[r+'/@su-record/vibe/hooks/scripts/context-save-hook.mjs','80'],{stdio:'inherit'}).on('close',c=>process.exit(c))\""
|
|
172
172
|
}
|
|
173
173
|
]
|
|
174
174
|
},
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"hooks": [
|
|
178
178
|
{
|
|
179
179
|
"type": "command",
|
|
180
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
180
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();spawn('node',[r+'/@su-record/vibe/hooks/scripts/context-save-hook.mjs','90'],{stdio:'inherit'}).on('close',c=>process.exit(c))\""
|
|
181
181
|
}
|
|
182
182
|
]
|
|
183
183
|
},
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"hooks": [
|
|
187
187
|
{
|
|
188
188
|
"type": "command",
|
|
189
|
-
"command": "node -e \"const {execSync}=require('child_process');const
|
|
189
|
+
"command": "node -e \"const {execSync,spawn}=require('child_process');const r=execSync('npm root -g',{encoding:'utf-8'}).trim();spawn('node',[r+'/@su-record/vibe/hooks/scripts/context-save-hook.mjs','95'],{stdio:'inherit'}).on('close',c=>process.exit(c))\""
|
|
190
190
|
}
|
|
191
191
|
]
|
|
192
192
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const m = await import("file://" + resolve(__dirname, "../../dist/tools/convention/index.js"));
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const projectPath = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
10
|
+
const r = await m.validateCodeQuality({
|
|
11
|
+
targetPath: ".",
|
|
12
|
+
projectPath
|
|
13
|
+
});
|
|
14
|
+
console.log("[CODE REVIEW]", r.content[0].text.split("\n").slice(0, 5).join(" | "));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
console.log("[CODE REVIEW] Error:", e.message);
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const m = await import("file://" + resolve(__dirname, "../../dist/tools/convention/index.js"));
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const projectPath = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
10
|
+
const r = await m.analyzeComplexity({
|
|
11
|
+
targetPath: ".",
|
|
12
|
+
projectPath
|
|
13
|
+
});
|
|
14
|
+
console.log("[COMPLEXITY]", r.content[0].text.split("\n").slice(0, 5).join(" | "));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
console.log("[COMPLEXITY] Error:", e.message);
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const m = await import("file://" + resolve(__dirname, "../../dist/tools/memory/index.js"));
|
|
7
|
+
|
|
8
|
+
// Get urgency from args: node context-save-hook.mjs 80|90|95
|
|
9
|
+
const urgencyLevel = process.argv[2] || "80";
|
|
10
|
+
const urgencyMap = {
|
|
11
|
+
"80": { urgency: "medium", summary: "Context at 80% - auto checkpoint" },
|
|
12
|
+
"90": { urgency: "high", summary: "Context at 90% - save before overflow" },
|
|
13
|
+
"95": { urgency: "critical", summary: "Context at 95% - CRITICAL save before session end" }
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const config = urgencyMap[urgencyLevel] || urgencyMap["80"];
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const projectPath = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
20
|
+
const r = await m.autoSaveContext({
|
|
21
|
+
urgency: config.urgency,
|
|
22
|
+
contextType: "progress",
|
|
23
|
+
summary: config.summary,
|
|
24
|
+
projectPath
|
|
25
|
+
});
|
|
26
|
+
console.log(`[CONTEXT ${urgencyLevel}%]`, r.content[0].text);
|
|
27
|
+
} catch (e) {
|
|
28
|
+
// Silent fail for context save
|
|
29
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
// Read stdin
|
|
6
|
+
let data = "";
|
|
7
|
+
for await (const chunk of process.stdin) {
|
|
8
|
+
data += chunk;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const m = await import("file://" + resolve(__dirname, "../../dist/lib/gemini-api.js"));
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const json = JSON.parse(data || "{}");
|
|
16
|
+
const prompt = json.prompt || "";
|
|
17
|
+
if (prompt) {
|
|
18
|
+
const r = await m.chat({
|
|
19
|
+
messages: [{role: "user", content: prompt}],
|
|
20
|
+
systemPrompt: "You are a code analysis expert. Review and analyze the code."
|
|
21
|
+
});
|
|
22
|
+
console.log("Gemini-3 응답:", r.content);
|
|
23
|
+
} else {
|
|
24
|
+
console.log("[Gemini] No prompt");
|
|
25
|
+
}
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.log("[Gemini] Error:", e.message);
|
|
28
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
// Read stdin
|
|
6
|
+
let data = "";
|
|
7
|
+
for await (const chunk of process.stdin) {
|
|
8
|
+
data += chunk;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const m = await import("file://" + resolve(__dirname, "../../dist/lib/gemini-api.js"));
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const json = JSON.parse(data || "{}");
|
|
16
|
+
const prompt = json.prompt || "";
|
|
17
|
+
const q = prompt.replace(/(gemini|제미나이).*?(물어|질문|한테|분석)[^가-힣]*/i, "").trim();
|
|
18
|
+
if (q) {
|
|
19
|
+
const r = await m.quickAsk(q);
|
|
20
|
+
console.log("Gemini-3 응답:", r);
|
|
21
|
+
} else {
|
|
22
|
+
console.log("[Gemini] No query extracted");
|
|
23
|
+
}
|
|
24
|
+
} catch (e) {
|
|
25
|
+
console.log("[Gemini] Error:", e.message);
|
|
26
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
// Read stdin
|
|
6
|
+
let data = "";
|
|
7
|
+
for await (const chunk of process.stdin) {
|
|
8
|
+
data += chunk;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const m = await import("file://" + resolve(__dirname, "../../dist/lib/gemini-api.js"));
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const json = JSON.parse(data || "{}");
|
|
16
|
+
const prompt = json.prompt || "";
|
|
17
|
+
if (prompt) {
|
|
18
|
+
const r = await m.chat({
|
|
19
|
+
messages: [{role: "user", content: prompt}],
|
|
20
|
+
systemPrompt: "You are a UI/UX expert. Analyze and provide feedback."
|
|
21
|
+
});
|
|
22
|
+
console.log("Gemini-3 응답:", r.content);
|
|
23
|
+
} else {
|
|
24
|
+
console.log("[Gemini] No prompt");
|
|
25
|
+
}
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.log("[Gemini] Error:", e.message);
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
// Read stdin
|
|
6
|
+
let data = "";
|
|
7
|
+
for await (const chunk of process.stdin) {
|
|
8
|
+
data += chunk;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const m = await import("file://" + resolve(__dirname, "../../dist/lib/gpt-api.js"));
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const json = JSON.parse(data || "{}");
|
|
16
|
+
const prompt = json.prompt || "";
|
|
17
|
+
if (prompt) {
|
|
18
|
+
const r = await m.chat({
|
|
19
|
+
messages: [{role: "user", content: prompt}],
|
|
20
|
+
systemPrompt: "You are a software architect. Analyze and review the architecture."
|
|
21
|
+
});
|
|
22
|
+
console.log("GPT-5.2 응답:", r.content);
|
|
23
|
+
} else {
|
|
24
|
+
console.log("[GPT] No prompt");
|
|
25
|
+
}
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.log("[GPT] Error:", e.message);
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
// Read stdin
|
|
6
|
+
let data = "";
|
|
7
|
+
for await (const chunk of process.stdin) {
|
|
8
|
+
data += chunk;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const m = await import("file://" + resolve(__dirname, "../../dist/lib/gpt-api.js"));
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const json = JSON.parse(data || "{}");
|
|
16
|
+
const prompt = json.prompt || "";
|
|
17
|
+
if (prompt) {
|
|
18
|
+
const r = await m.chat({
|
|
19
|
+
messages: [{role: "user", content: prompt}],
|
|
20
|
+
systemPrompt: "You are a debugging expert. Help find and fix bugs."
|
|
21
|
+
});
|
|
22
|
+
console.log("GPT-5.2 응답:", r.content);
|
|
23
|
+
} else {
|
|
24
|
+
console.log("[GPT] No prompt");
|
|
25
|
+
}
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.log("[GPT] Error:", e.message);
|
|
28
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
// Read stdin
|
|
6
|
+
let data = "";
|
|
7
|
+
for await (const chunk of process.stdin) {
|
|
8
|
+
data += chunk;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const m = await import("file://" + resolve(__dirname, "../../dist/lib/gpt-api.js"));
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const json = JSON.parse(data || "{}");
|
|
16
|
+
const prompt = json.prompt || "";
|
|
17
|
+
const q = prompt.replace(/gpt.*?(물어|질문|한테|분석)[^가-힣]*/i, "").trim();
|
|
18
|
+
if (q) {
|
|
19
|
+
const r = await m.quickAsk(q);
|
|
20
|
+
console.log("GPT-5.2 응답:", r);
|
|
21
|
+
} else {
|
|
22
|
+
console.log("[GPT] No query extracted");
|
|
23
|
+
}
|
|
24
|
+
} catch (e) {
|
|
25
|
+
console.log("[GPT] Error:", e.message);
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const m = await import("file://" + resolve(__dirname, "../../dist/tools/memory/index.js"));
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const projectPath = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
10
|
+
const r = await m.listMemories({
|
|
11
|
+
limit: 10,
|
|
12
|
+
projectPath
|
|
13
|
+
});
|
|
14
|
+
const lines = r.content[0].text.split("\n").slice(0, 7).join(" | ");
|
|
15
|
+
console.log("[RECALL]", lines);
|
|
16
|
+
} catch (e) {
|
|
17
|
+
console.log("[RECALL] Use recallMemory tool");
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const m = await import("file://" + resolve(__dirname, "../../dist/tools/memory/index.js"));
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const projectPath = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
10
|
+
const r = await m.saveMemory({
|
|
11
|
+
content: "Bug fix or issue resolution completed",
|
|
12
|
+
category: "solution",
|
|
13
|
+
tags: ["bug-fix", "resolved"],
|
|
14
|
+
projectPath
|
|
15
|
+
});
|
|
16
|
+
console.log("[COMPOUND]", r.content[0].text);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
console.log("[COMPOUND] Error:", e.message);
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const m = await import("file://" + resolve(__dirname, "../../dist/tools/convention/index.js"));
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const projectPath = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
10
|
+
const r = await m.validateCodeQuality({
|
|
11
|
+
targetPath: ".",
|
|
12
|
+
projectPath
|
|
13
|
+
});
|
|
14
|
+
console.log("[CODE CHECK]", r.content[0].text.split("\n").slice(0, 3).join(" | "));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
console.log("[AUTO-CONTINUE] Code written. Continue.");
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const B = "file://" + resolve(__dirname, "../../dist/tools") + "/";
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const projectPath = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
10
|
+
const [memoryModule, timeModule] = await Promise.all([
|
|
11
|
+
import(B + "memory/index.js"),
|
|
12
|
+
import(B + "time/index.js")
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
const [session, time, memories] = await Promise.all([
|
|
16
|
+
memoryModule.startSession({ projectPath }),
|
|
17
|
+
timeModule.getCurrentTime({ format: "human", timezone: "Asia/Seoul" }),
|
|
18
|
+
memoryModule.listMemories({ limit: 5, projectPath })
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
console.log(session.content[0].text);
|
|
22
|
+
console.log("\n" + time.content[0].text);
|
|
23
|
+
console.log("\n[Recent Memories]\n" + memories.content[0].text);
|
|
24
|
+
} catch (e) {
|
|
25
|
+
console.log("[Session] Error:", e.message);
|
|
26
|
+
}
|