Fix preset skill description precedence#2538
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a precedence bug in preset-generated SKILL.md creation so that when a preset overrides a core command, the propagated skill description comes from the preset command’s frontmatter (instead of being overwritten by the hardcoded SKILL_DESCRIPTIONS fallback). It also adds a regression test to prevent the speckit.taskstoissues override case from breaking again.
Changes:
- Update preset skill registration to prefer command frontmatter
descriptionand only fall back toSKILL_DESCRIPTIONSwhen no description is provided. - Add a regression test ensuring a preset override of
speckit.taskstoissueskeeps the preset command description in the generated skill file.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/presets.py |
Adjusts description selection logic during preset skill registration to respect preset command frontmatter precedence. |
tests/test_presets.py |
Adds a regression test covering core command override skill description precedence for taskstoissues. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
| original_desc = frontmatter.get("description", "") | ||
| enhanced_desc = SKILL_DESCRIPTIONS.get( | ||
| enhanced_desc = original_desc or SKILL_DESCRIPTIONS.get( | ||
| short_name, | ||
| original_desc or f"Spec-kit workflow command: {short_name}", | ||
| f"Spec-kit workflow command: {short_name}", | ||
| ) |
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback
|
Thanks for the review — I updated the restore/reconcile paths so they preserve command frontmatter descriptions before falling back to SKILL_DESCRIPTIONS, and added regression coverage for both cases. |
Summary
speckit.taskstoissuescore command overrideFixes #2528
Tests
UV_CACHE_DIR=/tmp/uv-cache-spec-kit uv run pytest tests/test_presets.py::TestPresetSkills::test_core_command_override_skill_uses_preset_command_description -qUV_CACHE_DIR=/tmp/uv-cache-spec-kit uv run pytest tests/test_presets.py::TestPresetSkills -qgit diff --check -- src/specify_cli/presets.py tests/test_presets.py