Support regex selectors for preset commands, templates, and scripts
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
調査の方向性
Start with preset manifest validation, the resolver, and command registration, composition, reconciliation, and cleanup paths described in the issue. Run the existing preset tests and inspect specify preset info; done means exact-name behavior remains intact, regex selectors validate and match concrete resources correctly, diagnostics show matches, and reconciliation covers integration and preset changes.
索引モデルが issue の本文から書いたものです。
説明
Description
Preset manifests currently require a separate provides.templates entry for every command, template, or script that a preset augments. This creates substantial repetition when the same cross-cutting guidance should apply to several resources.
For example, applying the same implementation guidance to speckit.plan, speckit.tasks, and speckit.implement currently requires three entries that differ only by name.
Add support for regex selectors by allowing the existing name field to use a regex: prefix.
Proposed syntax
provides:
templates:
- type: command
name: 'regex:^speckit\.(plan|tasks|implement)$'
file: commands/workflow-guidance.md
strategy: append
- type: template
name: 'regex:.*-template$'
file: templates/common-policy.md
strategy: prepend
- type: script
name: 'regex:^check-.*$'
file: scripts/check-wrapper.sh
strategy: wrap
Existing exact-name declarations remain unchanged:
provides:
templates:
- type: command
name: speckit.plan
file: commands/plan-guidance.md
strategy: append
Matching semantics
- A
namebeginning withregex:is interpreted as a regular expression. - Matching uses full-name matching semantics rather than substring search.
- The expression operates on the logical resource name, not its path, filename, or extension.
- Regex declarations match only concrete resource names available from lower layers in the resolution stack:
- lower-priority presets
- installed and enabled extensions
- Spec Kit core
- Regex declarations do not match other regex declarations.
- Matching is recalculated whenever the relevant preset, extension, or integration state changes.
- A regex that currently matches no resources produces a warning rather than failing installation.
- Invalid regular expressions fail preset validation with a clear error.
Supported strategies
Existing composition restrictions continue to apply:
| Resource type | Supported strategies |
|---|---|
| Command | replace, prepend, append, wrap |
| Template | replace, prepend, append, wrap |
| Script | replace, wrap |
Each matched resource behaves as though the preset contained a separate exact-name entry using the same file and strategy.
Resolution behavior
For templates and scripts, the resolver can test regex declarations while resolving a requested concrete resource name.
Commands require expansion into concrete command names before registration because commands are materialized into the active integration's command or skill directory. Expanded command names should then use the existing registration, composition, reconciliation, and cleanup paths.
Preset diagnostics should display both the selector and its concrete matches. For example:
regex:^speckit\.(plan|tasks|implement)$
- speckit.plan
- speckit.tasks
- speckit.implement
Acceptance criteria
- Exact-name preset entries retain their current behavior.
-
regex:selectors are supported for commands, templates, and scripts. - Regex matching uses logical resource names and full-match semantics.
- Invalid expressions are rejected during manifest validation.
- An unmatched expression produces an actionable warning.
- Command selectors are expanded and materialized for the active integration.
- Command matches are reconciled when presets or extensions are added, removed, enabled, disabled, or reprioritized.
- Command matches are reconciled when the active integration changes.
- Template and script selectors participate in normal runtime resolution.
- Existing strategy restrictions remain enforced.
- Regex declarations cannot recursively match other regex declarations.
-
specify preset infoand resolution diagnostics show the concrete resources matched by each selector. - Tests cover matching against core, extension, and lower-priority preset resources.
- Tests cover invalid, unmatched, and overlapping selectors.
- Existing preset tests and collection count are preserved.
Motivation
This enables concise cross-cutting presets for concerns such as:
- security and compliance guidance
- language or framework conventions
- organization-wide workflow policy
- shared command instructions
- common template sections
- script wrappers
The feature preserves the existing preset composition model while removing the need to enumerate every affected resource separately.
Out of scope
- Matching filesystem paths or extensions
- Structural Markdown section merging
- Capturing groups or substitutions in output filenames
- Regex selectors that create new resource names
- Regex declarations matching other regex declarations
- 主要言語
- Python
- スター
- 138k
- フォーク
- 12.4k
- 平均マージ
- 3日 4時間
- マージ済み PR(30日)
- 154
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/spec-kit のほかの issue
-
enhancement needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
enhancement needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
enhancement needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
enhancement needs-triage triage-can-wait
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
github/spec-kit の issue をすべて見る
似ている issue
-
essnmx good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
[Feature] 奇物选择添加优先级 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
syfoud/Simulated_Scepter#174 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Giskard-AI/giskard-oss#2840 · コメント 1 件 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success オープンarea: repo bug perceived difficulty: 2
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
yeti-platform/yeti#1380 ·