mirror of
https://github.com/github/spec-kit.git
synced 2026-07-03 20:36:23 +08:00
* Initial plan * Extract agent context updates into bundled agent-context extension * Potential fix for pull request finding 'Unused import' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Unused import' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * fix: address review comments on agent-context extension - bash: parse init-options.json with a single python3 invocation instead of three separate read_json_field calls, for parity with the PowerShell ConvertFrom-Json approach and to avoid divergent error semantics - bash: use parameter expansion to strip PROJECT_ROOT prefix from plan path instead of sed interpolation, avoiding special-character fragility - powershell: limit Get-ChildItem to -Depth 1 so plan.md discovery matches the bash glob specs/*/plan.md (one level deep) — fixes cross-platform inconsistency with nested plan.md files - powershell: replace Substring+Length relative-path with [System.IO.Path]::GetRelativePath for robustness across case/PSDrive differences - __init__.py: move agent-context extension install to after save_init_options so init-options.json is present when hooks run - __init__.py: seed context_markers in init-options only when context_file is truthy; avoids noise for integrations without a context file - integrations/base.py: narrow blanket except Exception in _resolve_context_markers to ImportError / (OSError, ValueError) so unexpected bugs surface instead of being silently swallowed * fix: gate context_markers in _update_init_options_for_integration on context_file Apply the same gating logic used during `specify init`: only write context_markers to init-options.json when the integration actually has a context_file set. When switching to an integration without a context file the stale markers are removed, keeping the two init paths consistent. * fix: move context_file/context_markers from init-options.json to agent-context extension config * Potential fix for pull request finding 'Unused global variable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * fix: clarify local import comment in agents.py * Fix remaining agent-context review findings * Fix follow-up agent-context review issues * Address review feedback: narrow except, improve PyYAML messaging, surface config-written note * Fix double-space in PyYAML install hint message * Potential fix for pull request finding 'Empty except' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Empty except' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Address latest agent-context review feedback * Harden bash config parse output handling * Clarify ImportError-only fallback comment * Apply review feedback: drop dead try/except, guard ext-config creation, explicit ConvertFrom-Yaml check * Remove redundant $Options = $null in PS1 catch block * Add constitution directives, deprecation warning, agent-context auto-install, and init flow fix - Add constitution-loading directive to specify, clarify, tasks, checklist, taskstoissues commands - Add deprecation warning (v0.12.0) in upsert_context_section() - Auto-install agent-context extension during specify init - Move context_file from init-options.json to agent-context extension config - Add tests: deprecation warning, corrupt config, constitution directives - Update file inventories across all integration tests * Address review: fix init ordering, test coverage, and hermes inventory - Move agent-context extension install after init-options.json is saved so skill registration can read ai_skills + integration key - Write extension config after install (avoids template overwriting context_file) - Fix test_defaults_when_markers_field_missing to truly test missing markers key - Update hermes tests to allow extension-installed agent-context skill * Address review: chmod ordering, preserve markers, PS1 Python check, YAML key order - Move ensure_executable_scripts after agent-context extension install so extension scripts get execute bits set - Use preserve_markers=True on reinit to keep user-customized markers - Add Python 3 version check in PowerShell fallback (matching bash behavior) - Add sort_keys=False to yaml.safe_dump for stable config output * Address review: path traversal guards and docstring fix - Reject absolute paths and '..' segments in context_file in both bash and PowerShell scripts to prevent writes outside the project root - Fix docstring in _update_init_options_for_integration to accurately describe marker preservation behavior * Address review: strict enabled check, docstring, segment-level path traversal - Use 'is not False' for enabled check so only literal False disables - Update upsert_context_section docstring to mention disabled-extension return - Fix path traversal guards to check actual path segments, not substrings (allows filenames like 'notes..md' while rejecting '../' traversal) * Address review: UnicodeError handling, missing extension warning - Add UnicodeError to exception tuples in _load_agent_context_config and _resolve_context_markers so garbled UTF-8 config files fall back to defaults - Emit error (with reinstall command) instead of silent skip when bundled agent-context extension is not found during init * Address review: bash backslash traversal guard, wheel packaging - Reject backslash separators and Windows drive-letter paths in bash context_file validation (prevents traversal on Git-Bash/Windows) - Add extensions/agent-context to pyproject.toml force-include so the bundled extension is included in wheel builds * Address review: write extension config before init-options.json - Reorder writes in _update_init_options_for_integration so the agent-context extension config is updated first; if it fails, init-options.json remains consistent with the previous state --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Manfred Riem <15701806+mnriem@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
101 lines
4.0 KiB
Markdown
101 lines
4.0 KiB
Markdown
---
|
|
description: Convert existing tasks into actionable, dependency-ordered GitHub issues for the feature based on available design artifacts.
|
|
tools: ['github/github-mcp-server/issue_write']
|
|
scripts:
|
|
sh: scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks
|
|
ps: scripts/powershell/check-prerequisites.ps1 -Json -RequireTasks -IncludeTasks
|
|
---
|
|
|
|
## User Input
|
|
|
|
```text
|
|
$ARGUMENTS
|
|
```
|
|
|
|
You **MUST** consider the user input before proceeding (if not empty).
|
|
|
|
## Pre-Execution Checks
|
|
|
|
**Check for extension hooks (before tasks-to-issues conversion)**:
|
|
- Check if `.specify/extensions.yml` exists in the project root.
|
|
- If it exists, read it and look for entries under the `hooks.before_taskstoissues` key
|
|
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
|
|
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
|
|
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
|
|
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
|
|
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
|
|
- For each executable hook, output the following based on its `optional` flag:
|
|
- **Optional hook** (`optional: true`):
|
|
```
|
|
## Extension Hooks
|
|
|
|
**Optional Pre-Hook**: {extension}
|
|
Command: `/{command}`
|
|
Description: {description}
|
|
|
|
Prompt: {prompt}
|
|
To execute: `/{command}`
|
|
```
|
|
- **Mandatory hook** (`optional: false`):
|
|
```
|
|
## Extension Hooks
|
|
|
|
**Automatic Pre-Hook**: {extension}
|
|
Executing: `/{command}`
|
|
EXECUTE_COMMAND: {command}
|
|
|
|
Wait for the result of the hook command before proceeding to the Outline.
|
|
```
|
|
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
|
|
|
|
## Outline
|
|
|
|
1. Run `{SCRIPT}` from repo root and parse FEATURE_DIR and 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").
|
|
1. **IF EXISTS**: Load `/memory/constitution.md` for project principles and governance constraints.
|
|
1. From the executed script, extract the path to **tasks**.
|
|
1. Get the Git remote by running:
|
|
|
|
```bash
|
|
git config --get remote.origin.url
|
|
```
|
|
|
|
> [!CAUTION]
|
|
> ONLY PROCEED TO NEXT STEPS IF THE REMOTE IS A GITHUB URL
|
|
|
|
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.
|
|
|
|
> [!CAUTION]
|
|
> UNDER NO CIRCUMSTANCES EVER CREATE ISSUES IN REPOSITORIES THAT DO NOT MATCH THE REMOTE URL
|
|
|
|
## Post-Execution Checks
|
|
|
|
**Check for extension hooks (after tasks-to-issues conversion)**:
|
|
Check if `.specify/extensions.yml` exists in the project root.
|
|
- If it exists, read it and look for entries under the `hooks.after_taskstoissues` key
|
|
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
|
|
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
|
|
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
|
|
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
|
|
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
|
|
- For each executable hook, output the following based on its `optional` flag:
|
|
- **Optional hook** (`optional: true`):
|
|
```
|
|
## Extension Hooks
|
|
|
|
**Optional Hook**: {extension}
|
|
Command: `/{command}`
|
|
Description: {description}
|
|
|
|
Prompt: {prompt}
|
|
To execute: `/{command}`
|
|
```
|
|
- **Mandatory hook** (`optional: false`):
|
|
```
|
|
## Extension Hooks
|
|
|
|
**Automatic Hook**: {extension}
|
|
Executing: `/{command}`
|
|
EXECUTE_COMMAND: {command}
|
|
```
|
|
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
|