Skip to content

Commit 031798a

Browse files
Yash-Chindamclaude
andcommitted
feat(extensions): add bundled github extension for taskstoissues (github#4421)
Stage 1 of moving GitHub issue tracking out of core: add a bundled, opt-in `github` extension that provides `speckit.github.taskstoissues`. The core `speckit.taskstoissues` command is untouched and no alias claims its name, so the two coexist while stage 2 (deprecate) and stage 3 (remove) are still ahead. `github` is the GitHub-platform domain, alongside `git` for local VCS workflow, so later platform work (milestone grouping, github#4370) has a home without spawning a second narrow extension. The extension owns its feature-resolution script in all three runtimes rather than reaching into core `check-prerequisites` via `../../scripts/`. That keeps the plain `scripts:` frontmatter spelling correct — it renders to `.specify/extensions/github/scripts/...`, which the extension actually ships — and leaves nothing recoupled to core internals that stage 3 will remove. `resolve-tasks` is a trimmed twin of `check-prerequisites`: it resolves the project root and active feature, requires tasks.md, and lists the design docs beside it, without core's plan.md/spec.md gating and without persisting feature.json. Tests cover the bundled layout, catalog and wheel packaging, manifest validation, install/uninstall, the hook contract, and — the failure mode that a verbatim copy of the core command would have shipped — that the rendered `{SCRIPT}` path resolves to a file that exists, in both command mode and skills mode. Co-Authored-By: Claude Opus 5 <[email protected]>
1 parent b9e7389 commit 031798a

12 files changed

Lines changed: 1223 additions & 1 deletion

File tree

‎docs/installation.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ After initialization, you should see the following commands available in your co
147147
- `/speckit.checklist` - Generate quality checklists
148148
- `/speckit.constitution` - Create or update project principles
149149
- `/speckit.converge` - Assess codebase against artifacts and append remaining tasks
150-
- `/speckit.taskstoissues` - Convert tasks to issues
150+
- `/speckit.taskstoissues` - Convert tasks to issues (moving to the bundled `github` extension as
151+
`/speckit.github.taskstoissues`; install it with `specify extension add github`)
151152

152153
Scripts are installed into a variant subdirectory matching the chosen script type:
153154

‎extensions/catalog.json‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@
6262
"workflow",
6363
"core"
6464
]
65+
},
66+
"github": {
67+
"name": "GitHub Integration",
68+
"id": "github",
69+
"version": "1.0.0",
70+
"description": "GitHub platform integration for Spec Kit - create GitHub issues from a feature's task list",
71+
"author": "spec-kit-core",
72+
"repository": "https://github.com/github/spec-kit",
73+
"bundled": true,
74+
"tags": [
75+
"github",
76+
"issues",
77+
"integration"
78+
]
6579
}
6680
}
6781
}

‎extensions/github/README.md‎

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# GitHub Integration Extension
2+
3+
This bundled, **opt-in** extension is the home for Spec Kit's GitHub *platform* functionality. Today it provides one command, `speckit.github.taskstoissues`, which turns a feature's `tasks.md` into dependency-ordered GitHub issues.
4+
5+
> NOTE: `git` and `github` are deliberately separate domains. The [`git` extension](../git/README.md) owns local version-control workflow (feature branches, commits, remote detection); this extension owns interactions with the GitHub platform itself.
6+
7+
## Why an extension?
8+
9+
Creating GitHub issues is provider-specific project management, not part of the provider-neutral Spec-Driven Development lifecycle. Keeping it in a dedicated, opt-in extension lets users:
10+
11+
- **Choose whether to install it at all** — `specify init` does **not** install it.
12+
- **Use a different issue tracker** without having to work around a GitHub-specific core command.
13+
- **Depend on a stable, namespaced command** from other extensions.
14+
15+
## Installation
16+
17+
From the root of an initialized Spec Kit project:
18+
19+
```bash
20+
specify extension add github
21+
```
22+
23+
## Removal
24+
25+
```bash
26+
specify extension remove github
27+
28+
# Or keep it installed but inert
29+
specify extension disable github
30+
specify extension enable github
31+
```
32+
33+
## Commands
34+
35+
| Command | Description |
36+
| ------------------------------ | -------------------------------------------------------------------- |
37+
| `speckit.github.taskstoissues` | Convert tasks from `tasks.md` into dependency-ordered GitHub issues. |
38+
39+
> NOTE: The command ID above is canonical. Invoke it using the syntax for your integration: `/speckit.github.taskstoissues` for dot-command integrations; `/speckit-github-taskstoissues` for hyphen/skills integrations (including Forge and Cline); `$speckit-github-taskstoissues` for Codex or ZCode in skills mode; or `/skill:speckit-github-taskstoissues` for Kimi.
40+
41+
### What the command does
42+
43+
1. Resolves the active feature and loads its `tasks.md` (via this extension's own `resolve-tasks` script — see [Scripts](#scripts)).
44+
2. Reads the Git remote and **stops unless it points at GitHub**.
45+
3. Lists existing repository issues — open *and* closed — and matches their titles against the task IDs in `tasks.md` (`\bT\d{3,}\b`, so four-digit and longer IDs are handled).
46+
4. Creates issues titled `T001: <description>` only for task IDs that do not already have one, in the repository identified by the remote.
47+
48+
## Hooks
49+
50+
This extension consumes the existing `before_taskstoissues` and `after_taskstoissues` hook points, which are read from `.specify/extensions.yml` at run time. The hook keys are unchanged from the core command, so hooks registered by other extensions — for example the `git` extension's auto-commit hooks — keep firing exactly as before.
51+
52+
## Requirements
53+
54+
- A Git remote pointing at GitHub.
55+
- The **GitHub MCP server** available to your coding agent, providing the `list_issues` and `issue_write` tools.
56+
57+
> NOTE: Agents without MCP support (for example the Pi Coding Agent out of the box) cannot run this command as intended.
58+
59+
## Scripts
60+
61+
The extension ships its own feature-resolution script in all three supported runtimes, so it is self-contained and does not reach into core:
62+
63+
| Runtime | Script |
64+
| ---------- | ---------------------------------------- |
65+
| Bash | `scripts/bash/resolve-tasks.sh` |
66+
| PowerShell | `scripts/powershell/resolve-tasks.ps1` |
67+
| Python | `scripts/python/resolve_tasks.py` |
68+
69+
Once installed they live under `.specify/extensions/github/scripts/`. The script is a trimmed twin of core's `check-prerequisites`: it resolves the project root and active feature directory, requires `tasks.md`, and reports the design docs alongside it. It performs none of core's `plan.md`/`spec.md` gating, and it never writes `.specify/feature.json`.
70+
71+
## Migrating from the core `taskstoissues` command
72+
73+
Spec Kit is moving GitHub issue tracking out of core in three stages:
74+
75+
1. **Now** — this extension is available, and the core `/speckit.taskstoissues` command remains available and unchanged. Nothing breaks if you do nothing.
76+
2. **Next** — the core command is deprecated once the replacement has been available for a release.
77+
3. **Later** — the core command is removed in a minor release.
78+
79+
To migrate, install the extension and use the namespaced command instead:
80+
81+
```bash
82+
specify extension add github
83+
```
84+
85+
| Before | After |
86+
| ------------------------- | --------------------------------- |
87+
| `/speckit.taskstoissues` | `/speckit.github.taskstoissues` |
88+
89+
Behavior is unchanged: the same remote validation, the same deduplication across open and closed issues, the same issue titles, and the same hook contract. This extension does **not** register `speckit.taskstoissues` as an alias, so the two commands coexist without shadowing each other while the core command still exists.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
description: Convert existing tasks into actionable, dependency-ordered GitHub issues for the feature based on available design artifacts.
3+
tools: ['github/github-mcp-server/list_issues', 'github/github-mcp-server/issue_write']
4+
scripts:
5+
sh: scripts/bash/resolve-tasks.sh --json
6+
ps: scripts/powershell/resolve-tasks.ps1 -Json
7+
py: scripts/python/resolve_tasks.py --json
8+
---
9+
10+
## User Input
11+
12+
```text
13+
$ARGUMENTS
14+
```
15+
16+
You **MUST** consider the user input before proceeding (if not empty).
17+
18+
## Pre-Execution Checks
19+
20+
**Check for extension hooks (before tasks-to-issues conversion)**:
21+
- Check if `.specify/extensions.yml` exists in the project root.
22+
- If it exists, read it and look for entries under the `hooks.before_taskstoissues` key
23+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
24+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
25+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
26+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
27+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
28+
- For each executable hook, output the following based on its `optional` flag:
29+
- **Optional hook** (`optional: true`):
30+
```
31+
## Extension Hooks
32+
33+
**Optional Pre-Hook**: {extension}
34+
Command: `/{command}`
35+
Description: {description}
36+
37+
Prompt: {prompt}
38+
To execute: `/{command}`
39+
```
40+
- **Mandatory hook** (`optional: false`):
41+
```
42+
## Extension Hooks
43+
44+
**Automatic Pre-Hook**: {extension}
45+
Executing: `/{command}`
46+
EXECUTE_COMMAND: {command}
47+
48+
Wait for the result of the hook command before proceeding to the Outline.
49+
```
50+
After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal `{command}` id shown above, e.g. a skills-mode agent runs it as `/skill:speckit-...` or `$speckit-...`). Emitting the block alone does not run the hook.
51+
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
52+
53+
## Outline
54+
55+
1. Run `{SCRIPT}` from repo root and parse FEATURE_DIR, TASKS and the AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
56+
1. **IF EXISTS**: Load `/memory/constitution.md` for project principles and governance constraints.
57+
1. From the executed script, extract the path to **tasks** (the `TASKS` value).
58+
1. Get the Git remote by running:
59+
60+
```bash
61+
git config --get remote.origin.url
62+
```
63+
64+
> [!CAUTION]
65+
> ONLY PROCEED TO NEXT STEPS IF THE REMOTE IS A GITHUB URL
66+
67+
1. **Fetch existing issues for deduplication**: Before creating anything, build the set of task IDs you are about to process from `tasks.md` (each is a `T` followed by **at least** three digits, e.g. `T001` — `__SPECKIT_COMMAND_CONVERGE__` assigns new IDs with `T{M+1:03d}`, which is a floor rather than a cap, so once a file has more than 999 tasks the IDs are four digits or longer). Then use the GitHub MCP server's `list_issues` tool to look for issues that already cover those IDs. Do not pass a `state` value, since omitting it makes the tool return both open and closed issues. Request `perPage: 100` to keep the number of calls down, and since the tool uses cursor-based pagination, request pages with the `after` parameter (using the `endCursor` from the previous response). For each issue title, match it against the task ID pattern `\bT\d{3,}\b` (the `{3,}` accepts four-digit and longer IDs — with `\d{3}` a title containing `T1000` would not match at all, because the trailing `\b` cannot fall between two digits, so that task would be silently neither deduplicated nor created; word boundaries still stop a token like `ST001` from matching, and force the whole digit run to be consumed so `T100` can never match inside `T1000`; this also recognises titles written as `T001 ...`, `T001: ...` or `[T001] ...`) and, when it matches one of your task IDs, mark that ID as already having an issue. Stop paginating as soon as every task ID has been matched, or when there are no more pages, so you do not keep fetching the whole repository's issue history once all task IDs are accounted for. This bounds the number of calls on repos with large issue histories and still prevents duplicates when the command is re-run after `tasks.md` is regenerated or the skill is re-invoked.
68+
1. For each task in the list, use the GitHub MCP server to create a new issue in the repository that is representative of the Git remote. Task lines in `tasks.md` start with a markdown checkbox, so first strip the leading `- [ ]` (and any `[P]` / `[US#]` markers) to recover the task ID and its description. Create the issue with a single canonical title of the form `T001: <description>`, with the ID written once followed by the task description (for example, the line `- [ ] T001 Create project structure` becomes the title `T001: Create project structure`).
69+
- **Skip** any task whose ID is already present in the set of existing issues from the previous step, and report it (for example, `T001 already has an issue, skipping`).
70+
- Only create issues for tasks that do not yet have a matching issue.
71+
72+
> [!CAUTION]
73+
> UNDER NO CIRCUMSTANCES EVER CREATE ISSUES IN REPOSITORIES THAT DO NOT MATCH THE REMOTE URL
74+
75+
## Post-Execution Checks
76+
77+
**Check for extension hooks (after tasks-to-issues conversion)**:
78+
Check if `.specify/extensions.yml` exists in the project root.
79+
- If it exists, read it and look for entries under the `hooks.after_taskstoissues` key
80+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
81+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
82+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
83+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
84+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
85+
- For each executable hook, output the following based on its `optional` flag:
86+
- **Optional hook** (`optional: true`):
87+
```
88+
## Extension Hooks
89+
90+
**Optional Hook**: {extension}
91+
Command: `/{command}`
92+
Description: {description}
93+
94+
Prompt: {prompt}
95+
To execute: `/{command}`
96+
```
97+
- **Mandatory hook** (`optional: false`):
98+
```
99+
## Extension Hooks
100+
101+
**Automatic Hook**: {extension}
102+
Executing: `/{command}`
103+
EXECUTE_COMMAND: {command}
104+
```
105+
After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal `{command}` id shown above, e.g. a skills-mode agent runs it as `/skill:speckit-...` or `$speckit-...`). Emitting the block alone does not run the hook.
106+
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently

‎extensions/github/extension.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
schema_version: "1.0"
2+
3+
extension:
4+
id: github
5+
name: "GitHub Integration"
6+
version: "1.0.0"
7+
description: "GitHub platform integration for Spec Kit - create GitHub issues from a feature's task list"
8+
author: spec-kit-core
9+
repository: https://github.com/github/spec-kit
10+
license: MIT
11+
12+
requires:
13+
speckit_version: ">=0.2.0"
14+
tools:
15+
- name: git
16+
required: false
17+
18+
provides:
19+
commands:
20+
- name: speckit.github.taskstoissues
21+
file: commands/speckit.github.taskstoissues.md
22+
description: "Convert tasks from tasks.md into dependency-ordered GitHub issues"
23+
24+
tags:
25+
- "github"
26+
- "issues"
27+
- "integration"

0 commit comments

Comments
 (0)