jun-claude-code 0.0.15 → 0.0.16
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/init-context.js
CHANGED
|
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.initContext = initContext;
|
|
40
40
|
const fs = __importStar(require("fs"));
|
|
41
41
|
const path = __importStar(require("path"));
|
|
42
|
+
const readline = __importStar(require("readline"));
|
|
42
43
|
const chalk_1 = __importDefault(require("chalk"));
|
|
43
44
|
/**
|
|
44
45
|
* Get the templates/project directory path (from package installation)
|
|
@@ -46,6 +47,22 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
46
47
|
function getTemplatesDir() {
|
|
47
48
|
return path.resolve(__dirname, '..', 'templates', 'project');
|
|
48
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Prompt user for confirmation using readline
|
|
52
|
+
*/
|
|
53
|
+
function askConfirmation(question) {
|
|
54
|
+
const rl = readline.createInterface({
|
|
55
|
+
input: process.stdin,
|
|
56
|
+
output: process.stdout,
|
|
57
|
+
});
|
|
58
|
+
return new Promise((resolve) => {
|
|
59
|
+
rl.question(question, (answer) => {
|
|
60
|
+
rl.close();
|
|
61
|
+
const normalized = answer.toLowerCase().trim();
|
|
62
|
+
resolve(normalized === 'y' || normalized === 'yes');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
49
66
|
/**
|
|
50
67
|
* Initialize context auto-generation with GitHub Actions
|
|
51
68
|
*/
|
|
@@ -57,7 +74,14 @@ async function initContext() {
|
|
|
57
74
|
const workflowDest = path.join(cwd, '.github', 'workflows', 'context-gen.yml');
|
|
58
75
|
fs.mkdirSync(path.dirname(workflowDest), { recursive: true });
|
|
59
76
|
if (fs.existsSync(workflowDest)) {
|
|
60
|
-
|
|
77
|
+
const shouldOverwrite = await askConfirmation(chalk_1.default.yellow(' ⚠ .github/workflows/context-gen.yml already exists. Overwrite? (y/N): '));
|
|
78
|
+
if (shouldOverwrite) {
|
|
79
|
+
fs.copyFileSync(templateSrc, workflowDest);
|
|
80
|
+
console.log(chalk_1.default.green(' ✓ Replaced .github/workflows/context-gen.yml'));
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
console.log(chalk_1.default.gray(' Skipped: .github/workflows/context-gen.yml'));
|
|
84
|
+
}
|
|
61
85
|
}
|
|
62
86
|
else {
|
|
63
87
|
fs.copyFileSync(templateSrc, workflowDest);
|
|
@@ -68,7 +92,14 @@ async function initContext() {
|
|
|
68
92
|
const agentDest = path.join(cwd, '.claude', 'agents', 'context-generator.md');
|
|
69
93
|
fs.mkdirSync(path.dirname(agentDest), { recursive: true });
|
|
70
94
|
if (fs.existsSync(agentDest)) {
|
|
71
|
-
|
|
95
|
+
const shouldOverwrite = await askConfirmation(chalk_1.default.yellow(' ⚠ .claude/agents/context-generator.md already exists. Overwrite? (y/N): '));
|
|
96
|
+
if (shouldOverwrite) {
|
|
97
|
+
fs.copyFileSync(agentSrc, agentDest);
|
|
98
|
+
console.log(chalk_1.default.green(' ✓ Replaced .claude/agents/context-generator.md'));
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
console.log(chalk_1.default.gray(' Skipped: .claude/agents/context-generator.md'));
|
|
102
|
+
}
|
|
72
103
|
}
|
|
73
104
|
else {
|
|
74
105
|
fs.copyFileSync(agentSrc, agentDest);
|
|
@@ -79,7 +110,14 @@ async function initContext() {
|
|
|
79
110
|
const skillDest = path.join(cwd, '.claude', 'skills', 'ContextGeneration', 'SKILL.md');
|
|
80
111
|
fs.mkdirSync(path.dirname(skillDest), { recursive: true });
|
|
81
112
|
if (fs.existsSync(skillDest)) {
|
|
82
|
-
|
|
113
|
+
const shouldOverwrite = await askConfirmation(chalk_1.default.yellow(' ⚠ .claude/skills/ContextGeneration/SKILL.md already exists. Overwrite? (y/N): '));
|
|
114
|
+
if (shouldOverwrite) {
|
|
115
|
+
fs.copyFileSync(skillSrc, skillDest);
|
|
116
|
+
console.log(chalk_1.default.green(' ✓ Replaced .claude/skills/ContextGeneration/SKILL.md'));
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
console.log(chalk_1.default.gray(' Skipped: .claude/skills/ContextGeneration/SKILL.md'));
|
|
120
|
+
}
|
|
83
121
|
}
|
|
84
122
|
else {
|
|
85
123
|
fs.copyFileSync(skillSrc, skillDest);
|
package/package.json
CHANGED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# .claude/hooks/skill-forced-subagent.sh
|
|
4
|
+
# Subagent용 Skill 평가 프로토콜 - SubagentStart hook
|
|
5
|
+
# Subagent가 작업 시작 전 관련 Skills를 평가하고 활성화하도록 유도
|
|
6
|
+
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
8
|
+
CLAUDE_DIR="$(dirname "$SCRIPT_DIR")"
|
|
9
|
+
GLOBAL_CLAUDE_DIR="$HOME/.claude"
|
|
10
|
+
PROJECT_CLAUDE_DIR="$(pwd)/.claude"
|
|
11
|
+
|
|
12
|
+
echo "✅ [Hook] Subagent Skill 평가 프로토콜 실행됨"
|
|
13
|
+
|
|
14
|
+
cat << 'EOF'
|
|
15
|
+
MANDATORY SKILL EVALUATION PROTOCOL (Subagent)
|
|
16
|
+
|
|
17
|
+
작업을 시작하기 전에 아래 단계를 완료하세요:
|
|
18
|
+
|
|
19
|
+
<phase name="Skill 평가">
|
|
20
|
+
|
|
21
|
+
## Skill 평가
|
|
22
|
+
|
|
23
|
+
Step 1 - Skill 평가: 각 Skill에 대해 다음을 명시하세요:
|
|
24
|
+
- Skill 이름
|
|
25
|
+
- YES 또는 NO (이 작업에 해당 Skill이 필요한가?)
|
|
26
|
+
- 한 줄 이유
|
|
27
|
+
|
|
28
|
+
Step 2 - Skill 활성화: YES로 표시된 모든 Skill의 SKILL.md를 읽으세요.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### 사용 가능한 Skills (자동 탐색됨)
|
|
33
|
+
|
|
34
|
+
</phase>
|
|
35
|
+
EOF
|
|
36
|
+
|
|
37
|
+
# skills 폴더에서 SKILL.md 파일들의 frontmatter 자동 탐색
|
|
38
|
+
# 프로젝트 .claude/ 와 ~/.claude/ 양쪽에서 탐색 (프로젝트 우선, 중복 제거)
|
|
39
|
+
SEEN_SKILLS=""
|
|
40
|
+
for search_dir in "$PROJECT_CLAUDE_DIR" "$GLOBAL_CLAUDE_DIR"; do
|
|
41
|
+
if [ -d "$search_dir/skills" ]; then
|
|
42
|
+
for skill_dir in "$search_dir/skills"/*/; do
|
|
43
|
+
if [ -d "$skill_dir" ]; then
|
|
44
|
+
skill_name=$(basename "$skill_dir")
|
|
45
|
+
skill_file="$skill_dir/SKILL.md"
|
|
46
|
+
|
|
47
|
+
# 이미 탐색된 Skill은 건너뜀
|
|
48
|
+
case "$SEEN_SKILLS" in
|
|
49
|
+
*"|${skill_name}|"*) continue ;;
|
|
50
|
+
esac
|
|
51
|
+
SEEN_SKILLS="${SEEN_SKILLS}|${skill_name}|"
|
|
52
|
+
|
|
53
|
+
if [ -f "$skill_file" ]; then
|
|
54
|
+
# 출처 표시
|
|
55
|
+
if [ "$search_dir" = "$PROJECT_CLAUDE_DIR" ]; then
|
|
56
|
+
display_path=".claude/skills/$skill_name/SKILL.md"
|
|
57
|
+
else
|
|
58
|
+
display_path="~/.claude/skills/$skill_name/SKILL.md"
|
|
59
|
+
fi
|
|
60
|
+
echo "**[$skill_name]** \`$display_path\`"
|
|
61
|
+
echo '```yaml'
|
|
62
|
+
head -6 "$skill_file"
|
|
63
|
+
echo '```'
|
|
64
|
+
echo ""
|
|
65
|
+
fi
|
|
66
|
+
fi
|
|
67
|
+
done
|
|
68
|
+
fi
|
|
69
|
+
done
|
|
70
|
+
|
|
71
|
+
cat << 'EOF'
|
|
72
|
+
|
|
73
|
+
<phase name="구현">
|
|
74
|
+
|
|
75
|
+
## 구현
|
|
76
|
+
|
|
77
|
+
Step 3 - 구현: 관련 Skill을 확인한 후 작업을 시작하세요.
|
|
78
|
+
|
|
79
|
+
Skill의 규칙과 체크리스트를 준수하며 작업을 수행하세요.
|
|
80
|
+
|
|
81
|
+
</phase>
|
|
82
|
+
EOF
|