mirror of
https://github.com/github/spec-kit.git
synced 2026-07-06 14:01:01 +08:00
fix: add user-invocable: true to skill frontmatter (#2077)
Skills were missing this field, causing them to be treated as "managed" instead of user-invocable via /speckit-* commands.
This commit is contained in:
@@ -275,7 +275,9 @@ class CommandRegistrar:
|
||||
},
|
||||
}
|
||||
if agent_name == "claude":
|
||||
# Claude skills should only run when explicitly invoked.
|
||||
# Claude skills should be user-invocable (accessible via /command)
|
||||
# and only run when explicitly invoked (not auto-triggered by the model).
|
||||
skill_frontmatter["user-invocable"] = True
|
||||
skill_frontmatter["disable-model-invocation"] = True
|
||||
return skill_frontmatter
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ class TestClaudeIntegration:
|
||||
parts = content.split("---", 2)
|
||||
parsed = yaml.safe_load(parts[1])
|
||||
assert parsed["name"] == "speckit-plan"
|
||||
assert parsed["user-invocable"] is True
|
||||
assert parsed["disable-model-invocation"] is True
|
||||
assert parsed["metadata"]["source"] == "templates/commands/plan.md"
|
||||
|
||||
@@ -176,7 +177,9 @@ class TestClaudeIntegration:
|
||||
|
||||
skill_file = project / ".claude" / "skills" / "speckit-plan" / "SKILL.md"
|
||||
assert skill_file.exists()
|
||||
assert "disable-model-invocation: true" in skill_file.read_text(encoding="utf-8")
|
||||
skill_content = skill_file.read_text(encoding="utf-8")
|
||||
assert "user-invocable: true" in skill_content
|
||||
assert "disable-model-invocation: true" in skill_content
|
||||
|
||||
init_options = json.loads(
|
||||
(project / ".specify" / "init-options.json").read_text(encoding="utf-8")
|
||||
@@ -276,6 +279,7 @@ class TestClaudeIntegration:
|
||||
content = skill_file.read_text(encoding="utf-8")
|
||||
assert "preset:claude-skill-command" in content
|
||||
assert "name: speckit-research" in content
|
||||
assert "user-invocable: true" in content
|
||||
assert "disable-model-invocation: true" in content
|
||||
|
||||
metadata = manager.registry.get("claude-skill-command")
|
||||
|
||||
Reference in New Issue
Block a user