Skip to content

fix(codex): native skills fallback refresh + legacy prompt suppression#1930

Open
RbBtSn0w wants to merge 8 commits intogithub:mainfrom
RbBtSn0w:fix/skills-frontmatter-sync
Open

fix(codex): native skills fallback refresh + legacy prompt suppression#1930
RbBtSn0w wants to merge 8 commits intogithub:mainfrom
RbBtSn0w:fix/skills-frontmatter-sync

Conversation

@RbBtSn0w
Copy link
Contributor

@RbBtSn0w RbBtSn0w commented Mar 21, 2026

Background

This is a follow-up fix after the previous skills/frontmatter work was already merged.

In local debugging and re-init scenarios (specify init --here --ai codex --ai-skills), two issues were observed:

  1. Older release assets can still contain legacy Codex prompt layout (.codex/prompts), which should not appear in skills mode.
  2. For native-skills agents (Codex/Kimi), when bundled skills are not usable and fallback conversion is required, existing SKILL.md files were not refreshed due to additive-only behavior.

Why this change

The goal is to make Codex/Kimi skills-mode initialization resilient without broad behavioral changes:

  • Keep current default behavior for non-native flows.
  • Only adjust the native fallback path where stale/missing bundled skills cause functional issues.

What changed

  1. Skip legacy Codex prompt directory in skills mode
  • In download_and_extract_template(...), add skip_legacy_codex_prompts.
  • When ai=codex and --ai-skills is enabled, do not materialize .codex from the downloaded archive.
  1. Native fallback compatibility
  • For native-skills agents, if bundled skills are not detected, call install_ai_skills(...) as fallback instead of failing immediately.
  • Keep explicit failure if both bundled skills and fallback conversion are unavailable.
  1. Minimal-impact overwrite policy
  • Add overwrite_existing: bool = False to install_ai_skills(...).
  • Preserve default additive behavior globally.
  • Enable overwrite only in native fallback branch (overwrite_existing=True) so fallback can refresh stale native SKILL.md files.

Why this is minimal impact

  • No global overwrite behavior change.
  • No behavior change for non-native agents.
  • Existing additive semantics remain the default API contract.
  • Scope is limited to Codex/Kimi fallback path and legacy Codex prompt suppression in skills mode.

Tests

  • Updated native-fallback tests to assert fallback invocation and overwrite flag usage.
  • Added coverage for overwrite-enabled replacement of existing SKILL.md.

Validation run:

  • uv run pytest tests/test_ai_skills.py -q -> 89 passed

Copilot AI review requested due to automatic review settings March 21, 2026 04:50
@RbBtSn0w RbBtSn0w force-pushed the fix/skills-frontmatter-sync branch from 39e3690 to 3793b45 Compare March 21, 2026 04:53
@RbBtSn0w RbBtSn0w requested a review from mnriem as a code owner March 21, 2026 04:53
Copy link
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 tightens Codex skills-mode initialization by avoiding legacy .codex prompt extraction and making native-skills agents (Codex/Kimi) attempt an install_ai_skills() fallback when bundled skills are missing, with updated tests and documentation to reflect the skills-based Codex layout.

Changes:

  • Add skip_legacy_codex_prompts support to template extraction and enable it for codex + --ai-skills.
  • For native-skills agents, attempt install_ai_skills() fallback when bundled skills are missing; keep a clear error when both bundled skills and fallback fail.
  • Update tests, docs, and release-package skill generators to align SKILL.md frontmatter.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/specify_cli/__init__.py Adds legacy .codex skip/removal during extraction and implements native-skills fallback behavior in init.
tests/test_ai_skills.py Updates Codex native-skills tests to assert fallback is attempted and non-speckit skill dirs trigger fallback.
src/specify_cli/agents.py Adds a technical-debt note documenting expected SKILL.md frontmatter schema alignment.
AGENTS.md Updates Codex directory documentation to .agents/skills/ and adjusts directory conventions section.
.github/workflows/scripts/create-release-packages.sh Adds compatibility and metadata fields to generated SKILL.md frontmatter.
.github/workflows/scripts/create-release-packages.ps1 Mirrors the SKILL.md frontmatter additions for PowerShell packaging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RbBtSn0w RbBtSn0w changed the title fix: codex ai-skills fallback + prevent legacy .codex prompts fix(codex): native skills fallback refresh + legacy prompt suppression Mar 21, 2026
Copilot AI review requested due to automatic review settings March 21, 2026 05:14
Copy link
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 21, 2026 05:26
Copy link
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

RbBtSn0w

This comment was marked as resolved.

RbBtSn0w

This comment was marked as outdated.

Copy link
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants