Skip to content

Commit 8f43ab1

Browse files
Digi-Boclaude
andcommitted
fix(kimi): use .kimi/skills/<name>/SKILL.md structure for Kimi Code CLI
Kimi Code CLI uses a skills system, not flat command files: - Skills live in .kimi/skills/<name>/SKILL.md (project-level) - Invoked with /skill:<name> (e.g. /skill:speckit.specify) - Each skill is a directory containing SKILL.md with YAML frontmatter Changes: - AGENT_CONFIG["kimi"]["commands_subdir"] = "skills" (was "commands") - create-release-packages.sh: new create_kimi_skills() function creates skill directories with SKILL.md from real template content - Bump version to 0.1.14.2 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e1d7542 commit 8f43ab1

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

.github/workflows/scripts/create-release-packages.sh

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,52 @@ Execute the add-dir workflow with arguments: $ARGUMENTS
6868
EOF
6969
}
7070

71+
# Create Kimi Code skills in .kimi/skills/<name>/SKILL.md format.
72+
# Kimi CLI discovers skills as directories containing a SKILL.md file,
73+
# invoked with /skill:<name> (e.g. /skill:speckit.specify).
74+
create_kimi_skills() {
75+
local skills_dir="$1"
76+
77+
local commands=(constitution specify clarify plan tasks analyze checklist implement taskstoissues)
78+
for cmd in "${commands[@]}"; do
79+
local skill_name="speckit.${cmd}"
80+
local skill_dir="${skills_dir}/${skill_name}"
81+
mkdir -p "$skill_dir"
82+
83+
# Extract description from template frontmatter if available, else use a default
84+
local src="$COMMANDS_TEMPLATES_DIR/${cmd}.md"
85+
local description="Spec Kit: ${cmd} workflow"
86+
if [[ -f "$src" ]]; then
87+
local fm_desc
88+
fm_desc=$(grep -m1 '^description:' "$src" | sed 's/^description:[[:space:]]*//' | tr -d '"' || true)
89+
[[ -n "$fm_desc" ]] && description="$fm_desc"
90+
fi
91+
92+
# Write SKILL.md with Kimi frontmatter + template content
93+
{
94+
printf -- '---\n'
95+
printf 'name: "%s"\n' "$skill_name"
96+
printf 'description: "%s"\n' "$description"
97+
printf -- '---\n\n'
98+
if [[ -f "$src" ]]; then
99+
# Strip existing frontmatter from template and append the body
100+
awk '/^---/{p++; if(p==2){found=1; next}} found' "$src"
101+
fi
102+
} > "$skill_dir/SKILL.md"
103+
done
104+
105+
# add-dir skill
106+
mkdir -p "${skills_dir}/add-dir"
107+
cat > "${skills_dir}/add-dir/SKILL.md" << 'EOF'
108+
---
109+
name: "add-dir"
110+
description: "Add a directory to the Spec Kit project structure"
111+
---
112+
113+
Execute the add-dir workflow with arguments: $ARGUMENTS
114+
EOF
115+
}
116+
71117
# Generate toml command files for agents that use that format (gemini, qwen).
72118
generate_toml_commands() {
73119
local agent="$1"
@@ -219,8 +265,8 @@ create_package() {
219265
generate_commands vibe md "$ARGUMENTS" "$base_dir/.vibe/prompts" "$script"
220266
;;
221267
kimi)
222-
mkdir -p "$base_dir/.kimi/commands"
223-
copy_real_md_commands "$base_dir/.kimi/commands"
268+
mkdir -p "$base_dir/.kimi/skills"
269+
create_kimi_skills "$base_dir/.kimi/skills"
224270
;;
225271
generic)
226272
mkdir -p "$base_dir/.speckit/commands"

src/specify_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def _format_rate_limit_error(status_code: int, headers: httpx.Headers, url: str)
268268
"kimi": {
269269
"name": "Kimi Code",
270270
"folder": ".kimi/",
271-
"commands_subdir": "commands",
271+
"commands_subdir": "skills", # Kimi uses /skill:<name> with .kimi/skills/<name>/SKILL.md
272272
"install_url": "https://code.kimi.com/",
273273
"requires_cli": True,
274274
},

0 commit comments

Comments
 (0)