Skip to content

Fix preset skill description precedence#2538

Open
WOLIKIMCHENG wants to merge 2 commits into
github:mainfrom
WOLIKIMCHENG:fix-preset-skill-description
Open

Fix preset skill description precedence#2538
WOLIKIMCHENG wants to merge 2 commits into
github:mainfrom
WOLIKIMCHENG:fix-preset-skill-description

Conversation

@WOLIKIMCHENG
Copy link
Copy Markdown
Contributor

Summary

  • Preserve preset command frontmatter descriptions when registering preset-generated skills
  • Add a regression test for a speckit.taskstoissues core command override

Fixes #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 -q
  • UV_CACHE_DIR=/tmp/uv-cache-spec-kit uv run pytest tests/test_presets.py::TestPresetSkills -q
  • git diff --check -- src/specify_cli/presets.py tests/test_presets.py

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 description and only fall back to SKILL_DESCRIPTIONS when no description is provided.
  • Add a regression test ensuring a preset override of speckit.taskstoissues keeps 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

Comment on lines 1316 to 1320
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}",
)
Copy link
Copy Markdown
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback

@WOLIKIMCHENG
Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: preset --ai-skills propagation ignores override description for core command taskstoissues

3 participants