Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions extensions/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,18 @@
"schema_version": "1.0",
"updated_at": "2026-02-03T00:00:00Z",
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

updated_at was not bumped even though the catalog contents changed. Please update the root updated_at timestamp to reflect this modification (and keep it in sync with any per-extension updated_at fields if you add them).

Suggested change
"updated_at": "2026-02-03T00:00:00Z",
"updated_at": "2026-03-05T00:00:00Z",

Copilot uses AI. Check for mistakes.
"catalog_url": "https://raw.githubusercontent.com/github/spec-kit/main/extensions/catalog.json",
"extensions": {}
}
"extensions": {
"selftest": {
"name": "Spec Kit Self-Test Utility",
"version": "1.0.0",
"description": "Verifies catalog extensions by programmatically walking through the discovery, installation, and registration lifecycle.",
"author": "spec-kit-core",
"repository": "https://github.com/github/spec-kit",
"tags": [
"testing",
"core",
"utility"
]
}
Comment on lines +6 to +17
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

catalog.json entries are missing required catalog fields. Per the documented catalog schema and the installer implementation, each extension must include at least id and download_url; otherwise specify extension add selftest will fail with "has no download URL".

Copilot uses AI. Check for mistakes.
}
}
62 changes: 62 additions & 0 deletions extensions/selftest/commands/selftest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
description: "Validate the lifecycle of an extension from the catalog."
---

# Extension Self-Test: `$ARGUMENTS`

This command drives a self-test simulating the developer experience with the `$ARGUMENTS` extension.

## Goal

Validate the end-to-end lifecycle (discovery, installation, registration) for the extension: `$ARGUMENTS`.
If `$ARGUMENTS` is empty, you must tell the user to provide an extension name, for example: `/speckit.selftest.run linear`.

## Steps

### Step 1: Catalog Discovery Validation

Check if the extension exists in the Spec Kit catalog.
Execute this command and verify that `$ARGUMENTS` appears in the results. If the command fails or returns no results, fail the test.

```bash
specify extension search "$ARGUMENTS"
```

### Step 2: Simulate Installation

Simulate adding the extension to the current workspace configuration.

```bash
specify extension add "$ARGUMENTS"
```
Comment on lines +25 to +31
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

Step 2 is labeled as a "Simulate Installation" but specify extension add performs a real install and will also fail if the extension is already installed (the CLI requires removing first). Update the wording and add guidance for running in a clean state (e.g., remove/disable first or use a temp workspace) so the self-test doesn’t produce false failures or leave unwanted config changes behind.

Copilot uses AI. Check for mistakes.

### Step 3: Registration Verification

Once the `add` command completes, verify the installation by checking the project configuration.
Use terminal tools (like `cat`) to verify that the following file contains an enabled record for `$ARGUMENTS`.

```bash
cat .specify/extensions.yml
```

### Step 4: Verification Report

Analyze the standard output of the three steps.
Generate a terminal-style test output format detailing the results of discovery, installation, and registration. Return this directly to the user.

Example output format:
```text
============================= test session starts ==============================
collected 3 items

test_selftest_discovery.py::test_catalog_search [PASS/FAIL]
Details: [Provide execution result of specify extension search]

test_selftest_installation.py::test_extension_add [PASS/FAIL]
Details: [Provide execution result of specify extension add]

test_selftest_registration.py::test_config_verification [PASS/FAIL]
Details: [Provide execution result of reading .specify/extensions.yml]

============================== [X] passed in ... ==============================
```
16 changes: 16 additions & 0 deletions extensions/selftest/extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
schema_version: "1.0"
extension:
id: selftest
name: Spec Kit Self-Test Utility
Comment on lines +1 to +4
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

PR title/description focus on adding an experimental test sandbox under tests/extension-commands, but the actual changes in this PR appear to only add the selftest extension and update extensions/catalog.json. Please either include the promised test sandbox changes or update the PR metadata to match the implemented scope.

Copilot uses AI. Check for mistakes.
version: 1.0.0
description: Verifies catalog extensions by programmatically walking through the discovery, installation, and registration lifecycle.
author: spec-kit-core
repository: https://github.com/github/spec-kit
license: MIT
requires:
speckit_version: ">=0.1.0"
provides:
commands:
- name: speckit.selftest.run
file: commands/selftest.md
description: Validate the lifecycle of an extension from the catalog.