[Feature]: Skill resources for presets (copy-mode aware composition and preset-owned resources)

Aberta
#5,382 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python
Domínio
tooling

Direção de pesquisa

Start with presets/_resolver.py at PresetResolver.resolve_content and compare its path rewriting with the copy-mode handling from #5366. Then read extensions/_skill_resources.py and the extension resource lifecycle tests to trace validation, copying, registry ownership, and removal. Done means the acceptance criteria define stacked resource ownership and preset removal behavior, with matching tests for composition and resource lifecycle.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

triage-can-wait

Problem Statement

#5366 lets extension commands declare resources that are copied into their generated agent skills ("copy mode"; skill bodies are not path-rewritten). Presets are not covered:

  1. Composition: when a preset overrides a copy-mode extension command with append/prepend/wrap, PresetResolver.resolve_content (presets/_resolver.py ~l.789) still applies rewrite_extension_paths to the extension base layer. The composed skill therefore references .specify/extensions/<id>/... instead of the copied skill-relative resources. It still resolves, but is inconsistent with copy mode.
  2. Preset-owned resources: presets that override or provide skills cannot bundle their own resources (references, templates, scripts) into the skill directory.

Proposed Solution

  • Make preset composition copy-mode aware for skill outputs: when the winning base layer is a copy-mode extension command and the output is a skill, do not rewrite its paths. Command/template consumers keep today's rewriting.
  • Add an optional resources list to preset command/template entries in preset.yml (same pattern dialect as extension resources), copied into the preset's skill output with hash-tracked ownership in the preset registry, reusing the extension resource helper (extensions/_skill_resources.py).

Alternatives Considered

  • Keep presets on extension-local paths only (today's behaviour): works, but preset authors cannot ship skill-relative files.
  • Only fix composition (item 1) and defer preset-owned resources.

Component

Presets / skills rendering

AI Agent (if applicable)

All SKILL.md-based integrations

Use Cases

  • A team preset appends review rules to an extension skill and ships its own references/team-rules.md.
  • A preset wraps a copy-mode extension command and the composed skill should keep skill-relative references.

Acceptance Criteria

  • Composed skill bodies over a copy-mode extension base are not path-rewritten; non-skill outputs unchanged.
  • Preset resources are validated like extension resources and copied as regular files.
  • Ownership defined for path conflicts between an extension and one or more presets writing the same skill directory (who wins, who owns, what happens on preset removal and priority changes).
  • Defined behaviour for stacked layers (append/prepend/wrap): whose resources are copied.
  • On preset remove, preset-owned resources are removed and the extension's resources/skill are restored.
  • Tests mirror the extension resource lifecycle tests.

Additional Context

Deferred out of #5366 by design; that change only restores extension copy-mode skills (with resources) after preset remove.

AI Disclosure

Drafted with the pi coding agent (orchestrator model: Claude Opus 5.5 via GitHub Copilot; implementation/review subagents: GPT-6.1-terra, GPT-6-astra), human-supervised by the filer. Reproductions were run locally by the agent and reviewed by the filer before filing.

Linguagem predominante
Python
Estrelas
149k
Forks
13.4k
Merge médio
1d 5h
PRs com merge (30d)
223

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de github/spec-kit

Todas as issues de github/spec-kit

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.