Skip to content

fix(presets): recompose surviving skills when a lower preset layer is removed - #5013

Open
yxshee wants to merge 44 commits into
github:mainfrom
yxshee:fix/preset-remove-stale-composed-skill
Open

yxshee wants to merge 44 commits into
github:mainfrom
yxshee:fix/preset-remove-stale-composed-skill

Conversation

@yxshee

@yxshee yxshee commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Removing a preset used as a base or middle layer of another preset's prepend, append, or wrap composition can leave the removed instructions in SKILL.md. Removal originally revisited only destinations owned by the retiring preset, while the composed output belongs to the surviving preset.

The original reproduction installs alpha as a replacement for speckit.specify and beta as an appended layer. After removing alpha, the resolver drops ALPHA BODY, but the original baseline's Claude skill still contains it. This PR refreshes the surviving preset's recorded skill destinations and native-skill aliases from the remaining composition.

Reconciliation uses each output's owner and registration records. Historical agents compose only layers registered for their destination; native extension command records and inferred legacy preset skill records participate in that filtering. A replace-only survivor remains independent of lower layers. Owned output is retired when no base remains; unreadable surviving layers and output without the expected ownership marker are preserved. Install/activation also restores recorded outputs when a new base makes them composable again.

Native command cleanup preserves outputs successfully written by a surviving preset after another preset's partial registration failure. Both command-style and skill-style ownership markers are recognized. An explicit marker for the retiring preset takes precedence over a command-prefix match, so a survivor literally named preset cannot claim preset:<retiring-id> and leave removed instructions behind.

Existing file permissions are preserved when refreshing an existing skill. Legacy extension skill records remain flat lists without agent ownership: nonempty flat records and extensions without registration metadata retain their existing fallback behavior. Legacy preset inference retains its active-agent fallback for names whose owner cannot be recovered.

Testing

Latest local verification on macOS arm64, Python 3.13.14:

  • .venv/bin/specify --help: passes.
  • tests/specify_cli/presets/test_manager_skills.py: 136 passed.
  • PATH="$PWD/.venv/bin:$PATH" COLUMNS=1000 LC_ALL=en_US.UTF-8 .venv/bin/python -m pytest -n auto: 14,571 passed, 446 skipped, 73 warnings.
  • Ruff 0.15.0 (check src tests) and git diff --check: pass.

The follow-up regressions use real preset/extension installation and removal APIs in temporary projects:

  • A Codex-only extension must not enter Claude's historical skill or alias. The negative case fails on a5429b36; the Claude-registered control passes. Both pass with the filter, and stashing its production change reproduces the failure.
  • A legacy flat preset record must not bypass historical-agent filtering. Core-fallback and no-fallback cases fail on 59a10c1, pass with inference, and fail with that production change stashed; modern-record controls pass throughout.
  • A base skills-phase failure must not let command cleanup delete a surviving preset's native skill. Failure-injection tests fail on 5f1fc6be for active and historical destinations, pass with the ownership check, and fail with that production change stashed.
  • After an injected skill-registry write failure, a survivor named preset must not retain the removed preset's skill. This fails on 1bcd341f; the ordinary-name control passes. Both pass with the marker check, and stashing that change reproduces the failure.

The unchanged shell, documentation, dependency, and extension checks were validated for the preceding 59a10c1 follow-up: shellcheck at error severity, workflow Bash portability guard, documentation glob check, Markdownlint, hashed-requirements pip-audit, dependency-input check, and extension version guard all passed. Subsequent commits change only the preset skill manager and its tests.

The full suite needs this checkout's venv on PATH for shell/PyYAML tests and a wide COLUMNS value for existing literal-output assertions. No unrelated code or tests were changed to obtain the passing result. Native Linux/Windows and the CI Python-version matrix were not run locally. The previous remote head's workflows require maintainer approval. These results validate the existing PR and its follow-ups; they are not a fresh reproduction of the original issue on today's default branch.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance

AI disclosure: Earlier work on this PR was disclosed as Claude Code (Claude Opus 5.5, max reasoning, autonomous mode). The current follow-ups and this description were prepared on behalf of @yxshee by Codex (GPT-6, autonomous mode; exact model variant and reasoning settings are not exposed). Codex reproduced the reported functional cases, generated the fixes and regression tests, ran the reported automated checks, and prepared the review text. No human line-by-line review or manual execution is claimed. The human contributor remains the sole Git author.

… removed

Removing a preset that is the base (or a middle layer) of another preset's
prepend/append/wrap composition left the removed preset's content in the
active agent's SKILL.md (Claude, Codex, Copilot with --skills, ...), while
command-file agents such as Gemini were recomposed onto the new stack.

The composed skill is owned by the surviving preset at the top of the
chain, so _unregister_skills() restores nothing for the removed preset,
and _reconcile_skills() only revisited the active skills directory when
that restore had touched it. The recomposed .composed/<cmd>.md that
_reconcile_composed_commands() writes was therefore never rendered into
the skill, and `specify preset resolve` disagreed with what the agent ran.

After a removal, also reconcile active-directory skills for commands whose
winning layer composes, as long as the skill still carries the winning
preset's source marker. A hand-edited skill is left alone, matching the
existing protection for non-owned skills during removal.

Assisted-by: Claude Code (model: Claude Opus 5.5, autonomous)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yxshee
yxshee requested a review from mnriem as a code owner October 17, 2026 19:15
@mnriem mnriem added the triage-must-have Verdict: high-value, important work for Spec Kit — do first label Oct 18, 2026
@mnriem
mnriem requested a max review from Copilot October 19, 2026 13:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Removal can overwrite a user-owned legacy skill despite the ownership filter.

1 open issue
What changed in this PR

Updates Spec Kit preset removal so surviving composed skills reflect the remaining preset layers.

Changes:

  • Re-renders active composed skills that retain the winning preset’s ownership marker.
  • Adds regression coverage for base/middle removal and preservation of non-owned skills.

Validation used an isolated ownership check; project tests were not run.

AI disclosure: GitHub Copilot (model: unknown, autonomous) generated this review for the requesting reviewer.

File Description
tests/​specify_cli/​presets/​test_manager_skills.py Adds composition-removal and preservation tests.
src/​specify_cli/​presets/​_manager_skills.py Adds ownership-based reconciliation for surviving composed skills.

Review effort: Max

When both the modern (speckit-specify) and legacy (speckit.specify)
skill directories exist, the active-directory recomposition added for
lower-layer removal selected the command because the modern skill kept
the winning preset's marker, and _register_skills() then rewrote both
directories, overwriting a user-owned legacy skill.

Give _register_skills() an optional only_skill_names filter and pass the
directory's managed names on removal, so only names that are still
preset-owned are written. Install and rescaffold calls pass None and
keep writing every existing directory, as before.

Assisted-by: Claude Code (model: Claude Opus 5.5, autonomous)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yxshee

yxshee commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Review round 1, posted on behalf of @yxshee.

Addressed the Copilot finding that removal recomposition could overwrite a user-owned legacy skill (commit 8c0328f):

  • _register_skills() gains an optional only_skill_names filter; removal passes the directory's managed names for the active directory. Install and rescaffold behavior is unchanged.
  • New regression test_remove_base_preset_preserves_user_owned_legacy_skill: fails on the previous head (1239cbe), passes now.
  • tests/specify_cli/presets, tests/integrations, tests/specify_cli/integrations, tests/specify_cli/extensions, tests/specify_cli/bundles, tests/test_presets.py, tests/test_extension_skills.py: 6096 passed, 9 skipped. uvx ruff@0.15.0 check src tests: clean.

AI disclosure: written and pushed by Claude Code (model: Claude Opus 5.5, max reasoning effort, autonomous agent mode); the code, test and this comment are AI-generated.

🤖 Addressed by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Removing the sole composition base still re-renders cached instructions from the removed preset.

1 open issue
1 resolved since last review

Review effort: Max

@mnriem

mnriem commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

@mnriem mnriem added the author-awaiting Waiting on author response label Oct 19, 2026
When the removed preset was the only replace base of a composing
command, with no core or extension fallback, resolution returns None.
Command-file agents unregister that command, but the survivor's stale
.composed/<cmd>.md stayed behind, and the removal recomposition rendered
it back into the skill, so the removed preset's instructions stayed
active.

Track composing winners whose stack no longer resolves, delete their
stale composed cache, and on removal delete the active skill only while
it still carries the winning preset's source marker. Hand-edited skills
are kept, matching the existing ownership protection.

Assisted-by: Claude Code (model: Claude Opus 5.5, autonomous)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yxshee

yxshee commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Review round 2, posted on behalf of @yxshee.

Addressed the Copilot finding about removing a command's only base with no core or extension fallback (commit 57bdfc9):

  • The stale .composed/<cmd>.md of a composing winner whose stack no longer resolves is deleted, so it can't be rendered back into a skill.
  • On removal, the active skill for that command is deleted only while it still carries the winner's source marker; hand-edited skills are kept.
  • New tests: test_remove_sole_base_preset_retires_stale_composed_skill (fails on the previous head, passes now) and test_remove_sole_base_preset_keeps_hand_edited_skill.
  • Preset, integration, extension and bundle suites: 6098 passed, 9 skipped. uvx ruff@0.15.0 check src tests: clean.

AI disclosure: posted on behalf of @yxshee by Claude Code (model: Claude Opus 5.5, max reasoning effort, autonomous agent mode); the fix, tests and this reply are AI-generated.

🤖 Addressed by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Cache cleanup can delete external files, and removed preset instructions can remain runnable.

3 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Handle aliases during preset retirement and recomposition

src/​specify_cli/​presets/​_manager_skills.py:465

This loop checks only the primary command's modern and legacy names, not its manifest aliases. On Codex, an appending preset can declare speckit.alt as an alias of speckit.custom; removing its only base retires speckit-custom but leaves speckit-alt/SKILL.md runnable with the removed instructions. agents.py:934–1015 renders aliases separately, using <id>:<file> source markers, so the preset:<id> check also misses their ownership. Include the winning template's aliases and their actual ownership markers in recomposition and retirement, preserve user-owned files, and add a native-skill alias regression.

AI disclosure: GitHub Copilot (model: unknown, autonomous mode) generated this feedback for the requesting reviewer.

1 resolved since last review

Review effort: Max

Round-3 review of the no-base removal fix:

- Delete a cache only when no path component below the project root is a
  symlink, so a symlinked .composed directory can't redirect the
  deletion to a file outside the project.
- Drop every surviving preset's .composed/<cmd>.md for an uncomposable
  command, not only the winner's: a middle preset's stale cache could be
  rendered back into the skill by a later rescaffold.
- Delete through the journal-aware unlink helper, as the cache writes
  already do, so a failing integration lifecycle can restore the cache.

Assisted-by: Claude Code (model: Claude Opus 5.5, autonomous)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mnriem

mnriem commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

@yxshee

yxshee commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Review round 3, posted on behalf of @yxshee.

Addressed the three Copilot findings on stale composed-cache deletion (commit c184e1a):

  • Deletion skips any cache reached through a symlinked path component below the project root.
  • All surviving presets' caches for an uncomposable command are dropped, so a rescaffold can't render the removed base back.
  • Deletion uses the journal-aware unlink helper, like the cache writes.
  • Three new tests, each failing on the previous head. Preset, integration, extension and bundle suites: 6101 passed, 9 skipped. uvx ruff@0.15.0 check src tests: clean.

AI disclosure: posted on behalf of @yxshee by Claude Code (model: Claude Opus 5.5, max reasoning effort, autonomous agent mode); the fix, tests and this reply are AI-generated.

🤖 Addressed by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Destructive cleanup spans multiple lifecycle paths and still has unresolved safety and correctness issues.

1 open issue
3 previously missed issues

In code that hasn't changed since last review

Medium severity Invalidate stale caches for disabled presets

src/​specify_cli/​presets/​_manager_skills.py:208

presets_by_priority excludes disabled presets (_registry.py:227), so their stale caches survive this cleanup. With a replace base beneath two append presets, disable the middle preset and then remove the sole base: the middle cache still contains the removed instructions. Re-enabling it and rescaffolding can render that cache before reconciliation deletes it; rescaffold reconciliation does not retire the newly written skill. Invalidate caches for all installed presets, including disabled ones, and extend the three-layer regression to cover disabling and re-enabling the middle layer.

AI disclosure: GitHub Copilot (model: unknown, autonomous mode) generated and verified this feedback for the requesting reviewer.

Medium severity Preserve output when surviving layers cannot be read

src/​specify_cli/​presets/​_manager_skills.py:211

resolve_content() also returns None when a surviving layer cannot be read or decoded (_resolver.py:780–783,865–871). Treating every None as a missing base deletes the last valid cache and owned skill even though a replace base still exists. A dependency-free execution with a non-UTF-8 base confirmed both deletions. Only retire output when the stack has no replace layer; preserve existing output on read failures, as test_unregister_skills_in_dir_unreadable_core_template_skips already requires for restoration. Add a composed-stack regression for this case.

AI disclosure: GitHub Copilot (model: unknown, autonomous mode) generated and verified this feedback for the requesting reviewer.

Medium severity Journal skill-directory removals during force replacement

src/​specify_cli/​presets/​_manager_skills.py:434

This rmtree() bypasses the lifecycle file-change journal. Force replacement calls remove() from _manager.py:408; when that runs under an active journal, a later failure cannot restore this deleted skill, although cache deletion is observed. design/integration.md, “Storage, loading, and lifecycle,” requires preset replacements and generated artifacts to participate in the journal. Wrap this removal like the other skill deletions at lines 1377–1381 and 1644–1648, and extend the observer regression to check the skill-directory removal too.

AI disclosure: GitHub Copilot (model: unknown, autonomous mode) generated and verified this feedback for the requesting reviewer.

3 resolved since last review

Review effort: Max

…lures

Round-4 review of the no-base removal fix:

- Skip registry keys (and command names) that are not a single plain
  path segment, so a malformed key such as "../../../outside" cannot
  steer cache cleanup outside the project.
- Invalidate stale caches for every installed preset, disabled ones
  included: re-enabling a disabled composer and rescaffolding could
  otherwise render its stale cache back.
- Retire output only when the stack has no replace layer left.
  resolve_content() also returns None when a surviving layer can't be
  read; that keeps the existing cache and skill instead of deleting them.
- Journal the stale skill-directory removal like the other skill
  deletions, so a failing lifecycle can restore it.

Assisted-by: Claude Code (model: Claude Opus 5.5, autonomous)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mnriem

mnriem commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

@yxshee

yxshee commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Review round 4, posted on behalf of @yxshee.

Addressed the new finding and the three previously missed ones (commit b9a2c35):

  • Traversing registry keys: cleanup accepts only plain single-segment preset ids and command names.
  • Disabled presets: stale caches are invalidated for every installed preset, so re-enabling and rescaffolding can't render the removed base back.
  • Read failures: output is retired only when no replace layer remains; an unreadable surviving base keeps the existing cache and skill.
  • Journal: the stale skill-directory removal is wrapped in before_file_change/after_file_change like the other skill deletions.
  • Regressions: test_stale_cache_cleanup_ignores_traversing_registry_key, test_remove_sole_base_drops_disabled_preset_cache, test_unreadable_surviving_base_keeps_composed_output, and the journal test now also checks the skill directory; each fails on the previous head.
  • Preset, integration, extension and bundle suites: 6104 passed, 9 skipped. uvx ruff@0.15.0 check src tests: clean.

AI disclosure: posted on behalf of @yxshee by Claude Code (model: Claude Opus 5.5, max reasoning effort, autonomous agent mode); the fix, tests and this reply are AI-generated.

🤖 Addressed by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

File-deleting reconciliation spans multiple lifecycle paths, with unresolved safety and ownership gaps requiring changes and human review.

1 open issue
3 previously missed issues

In code that hasn't changed since last review

Medium severity Limit historical-directory reconciliation to managed skill names

src/​specify_cli/​presets/​_manager_skills.py:395

The new name filter protects only the active directory. The historical-directory branch below still calls _register_skills() without only_skill_names, so it writes every existing modern/legacy sibling. If removal restored only speckit-specify in an inactive agent's directory and preserved a user-owned speckit.specify beside it, reconciliation overwrites that preserved file with the surviving preset's content. Pass managed_names to the targeted call too, and add a regression with mixed ownership in a non-active agent directory.

AI disclosure: GitHub Copilot (model: unknown, autonomous) generated this feedback for the requesting reviewer.

Medium severity Retire stale skills during activation and rescaffolding

src/​specify_cli/​presets/​_manager_skills.py:453

This retirement only runs during removal, but activation and rescaffolding call _reconcile_skills() without extra_skills_dirs. After removing a custom command's only base while Codex is active, a previously written Claude skill can retain the removed body when Claude is reactivated: registration has no base/cache, and this deletion is skipped. The same problem occurs when the sole composer was disabled during removal; re-enabling it lets registration render its stale cache before reconciliation deletes only the cache. Move ownership-checked retirement outside the removal-only guard, and add regressions for both flows.

AI disclosure: GitHub Copilot (model: unknown, autonomous) generated this feedback for the requesting reviewer.

Medium severity Handle native-skill aliases during recomposition and retirement

src/​specify_cli/​presets/​_manager_skills.py:520

Native-skill aliases still retain removed instructions. CommandRegistrar.register_commands() renders a separate skill for each manifest alias (agents.py:934–1015), but this ownership scan and _register_skills() consider only the primary command's modern/legacy names. For an appending preset with alias speckit.shortcut, removing its base refreshes the primary skill but leaves speckit-shortcut/SKILL.md stale. Include aliases in recomposition and retirement, and recognize their registrar-generated source markers (<preset-id>:<source-file>), which differ from the primary skill's preset:<id> marker. Add a native-skill alias regression.

AI disclosure: GitHub Copilot (model: unknown, autonomous) generated this feedback for the requesting reviewer.

1 resolved since last review

Review effort: Max

@mnriem

mnriem commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

…ed write

Two items from the review of f47e7aa.

- With preserve_mode, _write_shared_text kept an existing file's
  permission bits but still gave a new file a fixed 0644. Removing the
  winning preset deletes its skill, and the next winner's skill is a new
  file there, so a skill that was 0600 under umask 077 came back as
  0644. A new file now gets its mode from the process umask: the temp
  file is created exclusively with 0666, as _stage_workflow_file does,
  so the umask is never read or changed. Callers that do not pass
  preserve_mode keep 0644.

- _reconcile_skills ran the active directory, the other directories,
  the survivor refreshes and the alias pass in sequence, and the first
  exception ended all of it. One SKILL.md that could not be written on
  removal left the removed preset's text in the other directories and
  in every alias. Attempt each destination on its own, and each alias
  in the alias pass, then raise the first failure so the caller warns
  as before.

Assisted-by: Claude Code (model: Claude Mythos 5.2, autonomous)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because interacting ownership, alias-normalization, and agent-mode edge cases can leave removed preset instructions installed or delete unrelated skills.

1 open issue

Review effort: Max (adaptive)

@mnriem

mnriem commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

Removing a preset deletes its skill when no core or extension command
backs it, and reconciliation then writes the next winner's skill as a
new file. A skill the user had made private (0600) came back with the
umask default, 0644 under umask 022, although nothing but its content
was meant to change.

Take the permission bits of the removed preset's SKILL.md files before
they are deleted and hand them to the writers that reconciliation uses,
so a file written where one was deleted takes its bits. The content is
still written into a 0600 temp file first. Skills created later are
unaffected: the bits are passed for that one removal only.

Assisted-by: Claude Code (model: Claude Mythos 5.2, autonomous)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Interacting ownership and alias-lifecycle edge cases require human assessment because they can delete valid skills or leave removed instructions active without warning.

1 open issue

Review effort: Max (adaptive)

@yxshee

yxshee commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Three commits since my last note: f47e7aa (Nov 16), a358c7f (Nov 17) and 0b07d68 (today). Thanks for running the workflows; they were green on f47e7aa and a358c7f.

Preserve file permissions during atomic writes (discussion_r4495631107). This is the one item the reviews list as open. I had kept deferring it, and that was wrong; it is now handled in a358c7f and 0b07d68:

  • A new SKILL.md or .composed entry gets its mode from the process umask instead of a fixed 0644. With preserve_mode, _write_shared_text creates the temp file exclusively with 0666, as _stage_workflow_file does, so the umask is never read or changed. Callers that do not pass preserve_mode still get 0644.
  • An existing file keeps its bits, as before.
  • When the winning preset is removed and no core or extension command backs the skill, the skill is deleted and the next winner's skill is written as a new file. A skill made private (0600) came back as 0644 under umask 022. Removal now records the bits of the removed preset's SKILL.md files before deleting them, and the file written in that place takes them. The content still goes through a 0600 temp file.

New tests: test_skill_rewritten_for_next_winner_honors_umask, test_shared_writer_creates_new_file_under_umask_with_preserve_mode and test_private_skill_stays_private_when_next_winner_takes_over (active and historical directory). Each failed on the commit before its fix (0644 instead of 0600).

A failed write skipped the rest of the cleanup (a358c7f; the review summary on f47e7aa names "error-handling risks" that skip reconciliation work). _reconcile_skills ran the active directory, the other directories, the survivor refreshes and the alias pass in sequence, and the first exception ended all of it. One SKILL.md that could not be written on removal left the removed preset's text in the other directories and in every alias. Each destination is now attempted on its own, and each alias in the alias pass, and the first failure is raised at the end, so the "Post-removal reconciliation failed" warning is unchanged.

New test: test_failed_write_in_one_destination_does_not_skip_the_others, with a failing primary skill or alias in the active or a historical directory. Three of the four cases failed on f47e7aa.

Survivor skill left by command registration (f47e7aa; from the review summary on 977a329). If a composer's skills phase fails while an agent is activated, its primary skill is the one command registration wrote, and only registered_commands records it. Removing the base refreshed or retired the alias but left the removed preset's text in that primary skill. _surviving_owned_skills now also reads a native skill agent's registered_commands for the primary command and accepts the marker command registration writes for the command's own file.

New test: test_remove_base_refreshes_survivor_skill_left_by_command_registration, for the active and a historical directory, each with and without a core fallback. All four cases failed on 977a329.

The summary on a358c7f names ownership, alias-normalization and agent-mode edge cases without a scenario or an inline comment. I tried two commands whose names normalize to one skill directory (speckit.custom.short and speckit.custom-short, in different presets): removal does not delete the other preset's skill. I have no failing case for that summary.

@mnriem the last three reviews have no inline findings, and each summary asks for human assessment. If a smaller change would be easier to review, I can split this PR.

Verification on 0b07d68 (Linux, Python 3.13):

  • uv run pytest tests/specify_cli tests/test_presets.py tests/test_extensions.py tests/integrations tests/integration tests/extensions: 10413 passed, 165 skipped
  • uvx ruff@0.15.0 check src tests: clean
  • Merges cleanly with current main

AI disclosure: Claude Code (Claude Mythos 5.2) worked autonomously on these three rounds. It wrote the fixes, the tests and this summary, and ran the checks above. yxshee reviews the PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved alias ownership and registrar bugs can overwrite surviving aliases or leave removed instructions behind, while cache-write failures can go unreported.

7 open issues

Review effort: Max (adaptive)

Comment on lines +739 to +740
*,
layers: Optional[List[Dict[str, Any]]] = None,
Comment on lines +3377 to +3378
_write_shared_text(
project_dir, dest, "new\n", preserve_mode=preserve_mode
@mnriem

mnriem commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback. If not applicable, please explain why

Two paths in the alias pass kept an alias on its old composition
without saying so, so after a removal it could go on showing the
removed preset's text with no warning:

- The preset's .composed cache could not be written. The failure is
  now raised with the others once the pass is done, so the caller
  warns that reconciliation failed.
- The alias SKILL.md has other hard links and is deliberately not
  rewritten. It is still left alone, with a warning that names the
  file.

Assisted-by: Claude Code (model: Claude Mythos 5.2, autonomous)
main moved _write_shared_bytes onto atomic_write_bytes (github#5484) and added
resource delivery to the extension skill restore (github#5383).

- shared_infra.py: keep main's writer. preserve_mode and new_file_mode
  now map onto atomic_write_bytes: explicit bits are written exactly,
  and a new file is created with 0666 so the umask applies. This
  branch's own temp-file handling is gone.
- presets/_manager_skills.py: keep main's resource delivery, with
  preserve_mode on the SKILL.md write as before.

Assisted-by: Claude Code (model: Claude Mythos 5.2, autonomous)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

… per file

main now rejects new direct filesystem calls outside FileHelper
(github#5484), and the lint job failed on this branch. The review of 0b07d68
and 8adb423 also named four alias cases.

FileHelper migration:

- FileHelper.file_mode() returns a regular file's permission bits, or
  None when nothing is there, and never follows the leaf.
  _write_shared_text and the snapshot of a removed preset's skill modes
  read the bits through it instead of os.lstat.
- _remove_owned_skills reads SKILL.md through FileHelper.
- The alias composed cache goes through _write_shared_text for a new
  file too; the writer creates it under the umask since 8adb423.

Alias reconciliation:

- An agent in skills mode can share a skills directory while its
  registrar writes command files (Amp and .agents/skills). It was
  picked to render a Codex alias there, looked for it under the dotted
  name, left the real alias stale and could write a .md file into the
  skills directory. A recorded skill agent renders in that case.
- Command cleanup removes an alias under its current name and under the
  dotted name older releases wrote. A survivor owning one of the two
  files kept both. Ownership is now decided per file.
- Two commands of one preset can render one alias from one file, so the
  raw source marker does not say which command it was registered for.
  The alias is left to the command registered last, and is not retired
  while a command that replaces still renders it.
- An alias refresh dropped metadata.version. It now passes the preset
  version, as command registration does.

Tests: resolver tests for the layers argument, and the shared writer's
mode tests move to tests/test_shared_infra_write_mode.py.

Assisted-by: Claude Code (model: Claude Mythos 5.2, autonomous)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Comment on lines +1008 to +1010
if isinstance(meta, dict) and not meta.get("registered_skills"):
commands = meta.get("registered_commands")
if isinstance(commands, dict) and not any(
FileHelper resolves a relative path against its root, not the working
directory. 7edcf26 handed it paths built from the project root, so with
a relative project root the reads looked under the root twice and found
nothing: a stale skill was not retired, a survivor's alias was treated
as unowned and deleted, and a private file's mode was not seen and came
back as the umask default.

Pass the path below the helper's root instead (the skill name under the
skills directory, the shared relative path under the project root).

Tests: four reconciliation scenarios and the shared writer run under a
relative project root. All five failed on 7edcf26 and passed on 8adb423.

Assisted-by: Claude Code (model: Claude Mythos 5.2, autonomous)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

…he bypass

Address remaining Copilot review findings on preset removal reconciliation:

- Require exact retiring-preset marker proof before unlinking an alternate
  alias spelling in _drop_survivor_owned_aliases; preserve unmarked,
  unreadable, or symlinked files.
- Reject leaf SKILL.md symlinks via no-follow FileHelper reads before
  checking ownership in _reconcile_preset_aliases, _surviving_owned_skills,
  and _infer_legacy_skill_provenance.
- Include primary-name (and normalized output-name) matches alongside alias
  declarations in _reconcile_preset_aliases twins matching.
- Fall back to the validated registrar directory for native-skill agents
  when active_skills_dir is None (ai_skills false or absent).
- Infer legacy flat registered_skills provenance with an empty fallback even
  when active_ai is None (missing or unreadable init-options.json).
- Verify command-level ownership (supplying command, normalized-name
  collisions, and shared-file primary/alias collisions) in
  _remove_owned_skills, preserving ambiguous outputs.
- Skip reading obsolete .composed caches in _register_skills when
  content_overrides already supplies the resolved composition.
- Add positive regression tests for extension-filter legacy fallback paths
  (nonempty flat registered_skills and missing command metadata).

Assisted-by: Antigravity (model: Gemini 4 Neon (XHigh), autonomous)
@yxshee

yxshee commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the remaining 8 Copilot review findings from the b3fe60a review in fdda053, and confirmed the 3 earlier findings that are already landed on this branch:

Fixed in fdda053:

  • Require ownership proof before deleting alternate aliases (discussion_r4645186483): _drop_survivor_owned_aliases now requires an exact retiring-preset source marker (preset:<id>, <id>:.composed/<primary>.md, or <id>:<file> from the retiring preset's manifest) before unlinking an alternate alias spelling; unmarked/user-authored, unreadable, and symlinked files are preserved. Regression: test_remove_base_preserves_unowned_alternate_alias_spelling.
  • Reject symlinked skill files before checking ownership (discussion_r4645186534): _reconcile_preset_aliases, _surviving_owned_skills, and _infer_legacy_skill_provenance now read SKILL.md through no-follow FileHelper(skills_dir) before checking metadata.source, rejecting leaf symlinks on both refresh and retirement. Regressions: test_reconcile_preset_aliases_rejects_symlinked_skill_file, test_surviving_owned_skills_rejects_symlinked_primary_skill_file.
  • Include primary-name matches when finding command aliases (discussion_r4645186578): _reconcile_preset_aliases now includes primary-name (and normalized output-name) matches alongside alias declarations in twins, preventing a later replace command's primary skill sharing a source file from being overwritten or deleted after a skills-phase failure. Regression: test_alias_reconcile_preserves_later_replace_primary_sharing_source_file.
  • Fall back to the registrar directory for native skills (discussion_r4645186614): _layers_registered_in, _reconcile_preset_aliases, and _surviving_owned_skills now fall back to _safe_skills_dir_for_agent(agent) for native-skill agents (extension == "/SKILL.md") when active_skills_dir is None (e.g., Codex active with ai_skills false or absent). Regression: test_native_skill_agent_keeps_base_in_shared_dir_when_ai_skills_off.
  • Infer legacy provenance when the active agent is unknown (discussion_r4645186656): _surviving_owned_skills now runs _infer_legacy_skill_provenance with an empty fallback (active_ai or "") even when init-options.json is missing or unreadable. Regression: test_remove_base_reconciles_legacy_flat_survivor_without_active_ai.
  • Verify command-level ownership before deleting skill outputs (discussion_r4645186696): _remove_owned_skills now checks that a preset actually supplies cmd_name and verifies that neither preset:<id> (normalized skill-name collision) nor <id>:<file> (shared-file primary/alias collision) is ambiguous before unlinking. Regressions: test_baseless_composer_preserves_other_presets_colliding_normalized_skill, test_baseless_composer_preserves_same_preset_colliding_normalized_skill, test_baseless_composer_preserves_shared_file_replace_alias_after_rescaffold.
  • Use supplied composition without reading obsolete cache (discussion_r4645186753): _register_skills now checks content_overrides before inspecting or reading source_file/.composed, and reads via FileHelper(preset_dir) when no override is supplied (test_partial_skill_install_failure_rolls_back_persisted_writes updated to write invalid UTF-8 bytes directly instead of patching Path.read_text). Regression: test_historical_owner_refresh_ignores_corrupt_obsolete_composed_cache.
  • Test legacy extension-filter fallback paths (discussion_r4645186800): extended test_historical_skill_uses_only_registered_extension with positive cases for nonempty flat registered_skills, missing registered_commands metadata, and unregistered extensions alongside the registered/unregistered controls.

Already addressed in prior commits on this branch (threads remain open for reviewer confirmation):

  • Preserve file permissions during atomic writes (discussion_r4495631107): handled in a358c7f, 0b07d68, 7edcf26, and b3fe60a; _write_shared_text(..., preserve_mode=True) preserves existing file mode via FileHelper.file_mode and honors umask / new_file_mode for new files (tests/test_shared_infra_write_mode.py, test_skill_rewritten_for_next_winner_honors_umask, test_private_skill_stays_private_when_next_winner_takes_over).
  • Add focused resolver tests for the layers contract (discussion_r4619173307): added in 7edcf26 in tests/specify_cli/presets/test_resolver.py.
  • Move shared-text write coverage to an infrastructure test module (discussion_r4619173394): moved in 7edcf26 and expanded in b3fe60a in tests/test_shared_infra_write_mode.py.

Verification on fdda053 (macOS arm64, Python 3.14.6):

  • Every new bug-repro test failed on b3fe60a before the production changes and passes on fdda053.
  • .venv/bin/specify --help: pass
  • .venv/bin/python .github/scripts/check_file_helper_migration.py --base $(git merge-base upstream/main HEAD) --head HEAD: pass
  • uvx ruff@0.15.0 check src tests and git diff --check: pass
  • LC_ALL=en_US.UTF-8 COLUMNS=1000 .venv/bin/python -m pytest -n auto tests/specify_cli/presets tests/test_presets.py tests/test_extensions.py tests/test_shared_infra_write_mode.py tests/test_file_helper.py tests/integrations -q: 5,655 passed, 86 skipped.

AI disclosure: Posted on behalf of @yxshee by Antigravity (model: Gemini 4 Neon (XHigh), autonomous mode). The agent authored the fixes in fdda053, wrote and ran the regression tests and lint checks listed above, and drafted this comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

…ses, and require unambiguous ownership

Address review feedback on preset removal and skill/alias reconciliation:
- Reconcile both modern and legacy dotted alias spellings independently in
  _reconcile_preset_aliases, refreshing or retiring only owned files.
- Track exact alias outputs deleted during removal (and their pre-deletion
  modes) so registered surviving owners restore them without recreating
  unrelated user-deleted files.
- Handle disabled composing presets explicitly during removal instead of
  shielding stale dependent aliases while preserving independent disabled
  replace outputs.
- Guard manifest loads against PresetValidationError (including
  PresetSectionValidationError) in _drop_survivor_owned_aliases and
  related skill reconciliation helpers.
- Decide shared-alias cleanup per spelling using exact retiring sources
  and actual survivor registrations, preserving unowned/user-stripped
  files and preventing cross-preset marker collisions.
- Keep all affected commands per normalized skill directory in
  _surviving_owned_skills and require unambiguous command ownership
  before refreshing skills.

Assisted-by: Antigravity (model: Gemini 4 Neon (High), autonomous)
@yxshee

yxshee commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the 7 Copilot review findings on fdda053 in 6c7f17e:

  • Reconcile legacy dotted alias spellings independently (discussion_r4661019222): _reconcile_preset_aliases now inspects both modern and legacy dotted spellings independently, refreshing or retiring only outputs carrying the command's ownership marker (via _render_alias_skill_text and _write_shared_text for legacy spellings). Updated test_remove_base_decides_alias_ownership_per_file[dotted] and added test_remove_sole_base_retires_owned_legacy_alias_preserving_user_modern.
  • Restore alias outputs deleted by a retiring higher-priority preset (discussion_r4661019264): _drop_survivor_owned_aliases now records the exact deleted outputs and pre-deletion file modes, passing them through _reconcile_skills to _reconcile_preset_aliases so registered surviving owners (compose or replace) restore only those deleted outputs without recreating unrelated user-deleted files. Regression: test_remove_higher_preset_restores_survivor_alias_without_recreating_user_deleted.
  • Retire dependent aliases owned by disabled composing presets (discussion_r4661019294): _drop_survivor_owned_aliases and _reconcile_preset_aliases now distinguish disabled composing presets whose commands depend on the removed layer from independent disabled replace presets, retiring stale dependent aliases instead of shielding them. Regression: test_remove_base_handles_disabled_preset_shared_alias.
  • Handle invalid section-replacement metadata during removal (discussion_r4661019317): routed manifest lookups in _drop_survivor_owned_aliases and related skill helpers through _safe_get_manifest, catching PresetValidationError (including PresetSectionValidationError) and treating the manifest as unavailable. Regression: test_remove_preset_with_invalid_section_metadata_succeeds_with_survivor.
  • Preserve unowned shared aliases and match survivors by actual registration (discussion_r4661019337): _drop_survivor_owned_aliases now decides cleanup per spelling against exact retiring markers and each survivor's actual registrations in that skills directory, preserving user-stripped/unowned files while still cleaning colliding markers (such as preset preset with file other next to an unrelated survivor named other). Regressions: test_remove_shared_alias_preserves_user_stripped_marker, test_remove_preset_named_preset_cleans_file_named_other_despite_unrelated_survivor.
  • Track all affected commands per normalized skill name (discussion_r4661019360): _surviving_owned_skills now maps each normalized skill name to a list of all affected commands and resolves the owner via its manifest and unambiguous source markers, routing colliding commands through owner_refreshes so reconciliation is order-independent. Regression: test_remove_base_with_colliding_normalized_commands_refreshes_survivor.
  • Require unambiguous command ownership before refreshing skills (discussion_r4661019376): _surviving_owned_skills and _remove_owned_skills now share _unambiguous_command_sources, preserving ambiguous preset:<id> outputs (two commands normalizing to one directory) and ambiguous <id>:<file> outputs (a later replace command aliasing an append command's primary name) even when a core fallback exists. Regressions: test_remove_base_preserves_ambiguous_same_preset_colliding_replace_with_core_fallback, test_remove_base_preserves_shared_raw_file_later_replace_alias_with_core_fallback.

The 4 earlier threads (discussion_r4495631107, discussion_r4619173307, discussion_r4619173394, discussion_r4645186800) were addressed in prior commits on this branch and remain open for reviewer confirmation.

Verification on 6c7f17e (macOS arm64, Python 3.14.6):

  • Every new/updated bug-repro case failed on fdda053 before the fix and passes on 6c7f17e.
  • .venv/bin/specify --help: pass
  • .venv/bin/python .github/scripts/check_file_helper_migration.py --base $(git merge-base upstream/main HEAD) --head HEAD: pass
  • uvx ruff@0.15.0 check src tests and git diff --check: pass
  • LC_ALL=en_US.UTF-8 COLUMNS=1000 .venv/bin/python -m pytest -n auto tests/specify_cli/presets tests/test_presets.py tests/test_extensions.py tests/test_shared_infra_write_mode.py tests/test_file_helper.py tests/integrations -q: 5,667 passed, 86 skipped.

AI disclosure: Posted on behalf of @yxshee by Antigravity (model: Gemini 4 Neon (High), autonomous mode). The agent authored the fixes in 6c7f17e, wrote and ran the regression tests and lint/guard checks listed above, and drafted this comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment on lines +2391 to +2392
with FileHelper(preset_dir) as files:
content = files.read_text(source_rel)
… deps, and tighten native skill ownership

- Isolate skill reconciliation failures per command/skill output in both
  apply_to_dir() and refresh_owner() so an unwritable first output does
  not leave remaining composed skills stale.
- Pass the primary command name separately into _render_alias_skill_text()
  so frontmatter-only strategy: wrap restores substitute {CORE_TEMPLATE}
  from the primary command rather than the alias name.
- Capture actual disabled-composer dependencies before preset removal
  (_collect_disabled_composer_dependencies) so removing a preset above a
  disabled composer or hidden below an intervening replace base preserves
  its still-valid alias in both _drop_survivor_owned_aliases() and
  _reconcile_preset_aliases().
- Exclude the retiring preset's explicit preset:<id> skill marker from
  prefix fallback matching for broken-manifest survivors named 'preset',
  and handle exact marker collisions (e.g. a survivor named 'preset' with
  a source file named '<retiring-id>') by unlinking the ambiguous file
  and restoring the registered survivor from its own command.
- Probe both modern and legacy dotted spellings for registered_commands
  primary skills in _surviving_owned_skills().
- Resolve the active native skills directory independently of the
  optional ai_skills flag (_active_native_skills_dir) for renderer
  selection across _surviving_owned_skills(), _reconcile_preset_aliases(),
  _unregister_skills(), and exact-collision restoration.
- Update test_partial_skill_registration_is_persisted_before_later_failure
  to inject invalid UTF-8 bytes into the installed plan source (matching
  FileHelper reads) and assert plan registration failure alongside
  persisted specify tracking.

Assisted-by: Antigravity (model: Gemini 4 Neon (High), autonomous)
@yxshee

yxshee commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Addressed all eight comments from the latest review round in 56053e2:

  1. Per-output failure isolation (_manager_skills.py:516, 593-594): Isolated skill reconciliation failures per command and skill output in both apply_to_dir() and refresh_owner() so a write error on one skill does not leave remaining writable composed skills stale before reporting the failure.
  2. Frontmatter-only strategy: wrap alias restore (_manager_skills.py:640): Passed primary_command separately to _render_alias_skill_text() so {CORE_TEMPLATE} substitution resolves against the primary command name while keeping the alias for output naming.
  3. Disabled-composer dependency capture (_manager_skills.py:1238, 1560-1572, 1630-1635): Added _collect_disabled_composer_dependencies() before removal in PresetManager.remove() and wired it into both _drop_survivor_owned_aliases() and _reconcile_preset_aliases(), so removing a preset above a disabled composer or hidden below an intervening enabled replace base preserves the disabled composer's valid alias.
  4. Prefix fallback collision for missing/invalid preset manifest (_manager_skills.py:1696): Excluded the retiring pack's explicit preset:<pack_id> skill marker from prefix fallback matching in classify_survivor(), with regression coverage for both missing and invalid survivor manifests.
  5. Exact marker collision restore (_manager_skills.py:1774): Handled exact marker collisions (enabled_own and retiring_own, such as a survivor named preset with source file <retiring-id>) by unlinking the ambiguous file and restoring the registered survivor from its own command during post-removal skill reconciliation.
  6. Legacy dotted primary skill probe after failed skills phase (_manager_skills.py:1943): Probed both modern and supported legacy dotted spellings for registered_commands entries in _surviving_owned_skills() while retaining existing per-command ownership checks.
  7. Active native skills directory for renderer tie-breaking (_manager_skills.py:1954, 842-844): Resolved the active native skill agent's directory independently of ai_skills via _active_native_skills_dir(), so active Codex with ai_skills false or absent refreshes primary and alias outputs recorded under agy with $speckit-* references.
  8. Negative regression test for FileHelper-based skill reads (_manager_skills.py:2392): Updated test_partial_skill_registration_is_persisted_before_later_failure to write invalid UTF-8 bytes into the installed speckit.plan.md source instead of monkeypatching Path.read_text, and asserted that speckit-plan failed registration while speckit-specify remained tracked.

Note on two earlier open test threads: focused resolve_content(..., layers=...) coverage (_resolver.py:764) is in tests/specify_cli/presets/test_resolver.py, and positive regression cases for both legacy extension filter fallbacks (_manager_skills.py:1388) are in tests/specify_cli/presets/test_manager_skills.py (test_historical_skill_uses_only_registered_extension).

Verification: pytest (5681 passed, 86 skipped), ruff@0.15.0 check src tests, check_file_helper_migration.py, specify --help, and git diff --check all passed.

AI disclosure: Antigravity (model: Gemini 4 Neon (High), autonomous) implemented these changes and drafted this comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment on lines +624 to +626
composed = resolver.resolve_content(
cmd_name, "command", layers=owner_layers
)
Comment on lines +895 to +897
active_native_dir = self._active_native_skills_dir(
active_ai, active_skills_dir, registrar.AGENT_CONFIGS
)
include_disabled=True
)
if isinstance(meta, dict) and not meta.get("enabled", True)
]
registrar._ensure_configs()
agent_configs = registrar.AGENT_CONFIGS
except ImportError:
agent_configs = {}
):
result[agent] = names
continue
skills_dir = resolve_dir(agent, True)
Comment on lines +2163 to +2165
retiring_own = (
isinstance(src, str) and src in retiring_sources
)
@yxshee

yxshee commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@mnriem this PR is now 43 commits and about 6,200 added lines after five weeks of review rounds, and each round still finds new edge cases: the review of 56053e2 lists 12 open items, 6 of them new. I do not think it can be reviewed in this form, and I would rather stop growing it.

Proposal: land the original fix on its own, and treat the rest as follow-ups you can take or leave.

  • The original bug still reproduces on main (f61648d). Removing a preset that is the base, or a middle layer, of another preset's append/prepend/wrap command leaves the removed preset's text in the active agent's SKILL.md, while command-file agents are recomposed.
  • The first three commits of this PR fix that and still apply to main. Rebased as one commit and moved onto FileHelper, the change is 253 added and 7 removed lines in two files: 88 added in src/specify_cli/presets/_manager_skills.py and 165 in its test module. It has 6 tests; 4 fail on main and the other 2 guard hand-edited skills.
  • It is on my fork so you can look before deciding: main...yxshee:spec-kit:fix/preset-remove-recompose-skill (a8a9229). I have not opened a PR for it.
  • Left out of the small change: native-skill aliases of composed commands, historical (inactive) agent directories, permission bits of rewritten skills, legacy dotted names and partial registrations. Each can be its own follow-up if you want it.

Verification of the small change on main f61648d (Linux, Python 3.13):

  • uv run pytest tests/specify_cli tests/test_presets.py tests/test_extensions.py tests/integrations tests/integration tests/extensions: 11946 passed, 205 skipped
  • uvx ruff@0.15.0 check src tests: clean
  • python .github/scripts/check_file_helper_migration.py --base main: clean

If you agree, I will open the small PR and close this one. If you would rather keep going here, say so and I will continue with the open Copilot items.


AI disclosure: Claude Code (Claude Mythos 5.2) worked autonomously on this note. It prepared the small change, ran the checks above and wrote this text. yxshee reviews the PR.

@mnriem

mnriem commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

@yxshee I agrre. So if you can create a new PR that just targets the most minimal way to fix with negative and positive tests I will review it with that scope in mind. And then we can iterate on any of the other findings if you want. Thanks!

…tale-composed-skill

# Conflicts:
#	src/specify_cli/shared_infra.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment on lines +217 to +219
if (
all(layer["strategy"] != "replace" for layer in layers)
and resolver.resolve_content(cmd_name, "command") is None
Comment on lines +392 to +393
umask = os.umask(0o022)
os.umask(umask)
# later removal of this same preset orphans the directory
# reconciliation just wrote to on its behalf (#2948).
self._merge_pack_registered_skills(_pack_id, written)

for cmd_name in dir_cmds:
Comment on lines +484 to +485
for skills_dir, agent, owner_id, cmd_name, name in self._surviving_owned_skills(
command_names, presets_by_priority, active_ai, active_skills_dir
Comment on lines +624 to +626
composed = resolver.resolve_content(
cmd_name, "command", layers=owner_layers
)
Comment on lines +895 to +897
active_native_dir = self._active_native_skills_dir(
active_ai, active_skills_dir, registrar.AGENT_CONFIGS
)
Comment on lines +931 to +943
primary_wanted = tmpl.get("name") in wanted
alias_wanted = bool(removed_alias_outputs) and any(
a in wanted for a in tmpl_aliases
)
if not primary_wanted and not alias_wanted:
continue
if tmpl.get("strategy", "replace") == "replace" and not removed_alias_outputs:
# A replace layer's own file did not change unless a
# retiring higher layer just deleted its shared output.
continue
for alias in tmpl_aliases:
if primary_wanted or alias in wanted:
alias_to_tmpl[alias] = (tmpl, primary_wanted)
Comment on lines +1119 to +1121
composed = resolver.resolve_content(
primary, "command", layers=owner_layers
)

This branch has not been deployed

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

Labels

author-awaiting Waiting on author response triage-must-have Verdict: high-value, important work for Spec Kit — do first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants