spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

[Bug]: PR #1776 alias validation breaks all community extensions — alias pattern not documented

Open c05m1x opened this issue 8 months ago • 15 comments

Bug Description

Environment

  • specify CLI version: 0.4.3

Problem

After the alias validation introduced in #1776, every community extension that uses shorthand aliases fails to install:

specify extension add docguard → Validation Error: Invalid alias 'docguard.guard': must follow pattern 'speckit.{extension}.{command}'

specify extension add sync → Validation Error: Invalid alias 'speckit.drift': must follow pattern 'speckit.{extension}.{command}'

All community extensions fail. This is a regression introduced by #1776.

Impact

  • All community extensions with aliases are broken
  • No working workaround exists (local file paths rejected, localhost HTTP returns 400)
  • Extension authors were not notified of the breaking change before it shipped

Expected behaviour

Either:

  1. Aliases should be validated with a looser rule (or not validated at all), OR
  2. Extension authors should have been notified before the breaking change shipped, with a migration guide

Suggested fix

  • Add alias validation rules to the Extension Publishing Guide / RFC so authors know what is required
  • Notify community extension authors of the new requirements
  • Consider a grace period or warning instead of hard failure for alias violations

Steps to Reproduce

specify extension add verify --from https://github.com/ismaelJimenez/spec-kit-verify/archive/refs/tags/v1.0.1.zip

Expected Behavior

Extension installed

Actual Behavior

specify extension add verify --from https://github.com/ismaelJimenez/spec-kit-verify/archive/refs/tags/v1.0.1.zip
Warning: Installing from external URL.
Only install extensions from sources you trust.

Downloading from https://github.com/ismaelJimenez/spec-kit-verify/archive/refs/tags/v1.0.1.zip...

Validation Error: Invalid alias 'speckit.verify': must follow pattern 'speckit.{extension}.{command}'

Specify CLI Version

0.4.3

AI Agent

Claude Code

Operating System

macOS 15.7.5

Python Version

Python 3.14.3

Error Logs


Additional Context

No response

c05m1x avatar Mar 29 '26 21:03 c05m1x

@mbachorik Can you have a look? Probably should make it so aliases registration is:

  1. Is the alias already registered, yes, fail
  2. Is the alias squating on /speckit, yes, fail
  3. Is the alias squating on registered commands, yes, fail (maybe 2 and 3 can be combined)
  4. Otherwise, ok

Is that sufficient?

mnriem avatar Mar 30 '26 18:03 mnriem

@c05m1x Please use 0.4.2 for now. We will get this addressed.

mnriem avatar Mar 30 '26 18:03 mnriem

@mbachorik Can you have a look? Probably should make it so aliases registration is:

  1. Is the alias already registered, yes, fail
  2. Is the alias squating on /speckit, yes, fail
  3. Is the alias squating on registered commands, yes, fail (maybe 2 and 3 can be combined)
  4. Otherwise, ok

Is that sufficient?

IMO yes.

there's not better fix I can think off. w/o the check, the extension silently overwrites already registered commands (i've hit that) and that's imo much worse problem as it damages installation.

i'll check if i can do suggested fix quickly.

mbachorik avatar Mar 30 '26 19:03 mbachorik

nitpick: i believe the regression comes from #1994 and not from #1776.

mbachorik avatar Mar 30 '26 21:03 mbachorik

@mbachorik Thank you for looking at it. I think the aliases should be allowed to use the 2 dotted variant to be honest. The only 2 dotted variant that should not be allowed is speckit.command. Thoughts?

mnriem avatar Mar 30 '26 21:03 mnriem

@mbachorik Thank you for looking at it. I think the aliases should be allowed to use the 2 dotted variant to be honest. The only 2 dotted variant that should not be allowed is speckit.command. Thoughts?

my gut feeling is that extensions should use 3 part alias, and 2 part should be reserved for core speckit only (ie if maintainer/community decides to add a command to core framework, it might be already taken by extension).

i have built our system around speckit with extensions and 3-parts looks lean - you quickly know what's where.

my fix suggests to auto-correct 2-part alias from extension into 3-part alias, so it never overwrites core speckit command.

(or maybe i misunderstood, already after midnight here, srry)

mbachorik avatar Mar 30 '26 22:03 mbachorik

No worries. I was thinking more along the lines of

  1. /speckit.constitution (not allowed as an alias)
  2. /myext.mycommand (allowed as an alias)

Does that make sense?

mnriem avatar Mar 30 '26 22:03 mnriem

@c05m1x Please use 0.4.2 for now. We will get this addressed.

I've reverted to 0.4.0 when I realised that version is not affected (that's the version I'm using on my other laptop)

c05m1x avatar Mar 31 '26 15:03 c05m1x

@mnriem your call. we could do this:

Format Role Example

speckit.command Core commands only speckit.plan, speckit.verify (future core) speckit.myext.command Extension primary commands speckit.verify.run myext.command Extension aliases verify.run, docguard.guard

Auto-correction for aliases:

speckit.verify -> verify.verify (strip speckit. prefix, warn) docguard.guard -> already valid, pass through speckit.verify.run used as an alias -> verify.run (strip speckit., warn)

mbachorik avatar Mar 31 '26 20:03 mbachorik

@c05m1x Thoughts?

mnriem avatar Mar 31 '26 21:03 mnriem

@c05m1x Thoughts?

@mnriem thank you for the update on the alias validation logic.

To ensure clear separation between the core framework and community contributions, my proposal is a standard for command alias patterns. I believe we should reserve one-dot command aliases (e.g., /speckit.verify) exclusively for the core framework.

For extensions, we should adopt one of the following patterns to prevent namespace collisions and maintain consistency:

Two-dot command aliases: /speckit.extension-name.command

Alternative one-dot aliases: /extension-name.command (if independent of the speckit namespace)

Adopting this structure would clarify which commands are part of the base Spec Kit and which are provided by the ecosystem, while also making documented patterns easier for community developers to follow.

I guess that was the gist of the above conversation, right? (admittedly, I did not read attentively)

c05m1x avatar Apr 02 '26 15:04 c05m1x

@c05m1x That is indeed the intent. You captured it. Feel free to create a PR documenting this in the extensions documentation

mnriem avatar Apr 02 '26 15:04 mnriem

@mnriem , @c05m1x i have the PR more/less ready with the above suggested change so do not bother creating PR. i'll find some time over the easter to get it finished.

mbachorik avatar Apr 02 '26 21:04 mbachorik

@mnriem I guess this issue can be closed? /cc @mbachorik

c05m1x avatar Apr 22 '26 11:04 c05m1x

Yes, closing as fixed

mnriem avatar Apr 22 '26 12:04 mnriem