ruby_reactor 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/skills/speckit-agent-context-update/SKILL.md +32 -0
  3. data/.claude/skills/speckit-analyze/SKILL.md +262 -0
  4. data/.claude/skills/speckit-checklist/SKILL.md +374 -0
  5. data/.claude/skills/speckit-clarify/SKILL.md +286 -0
  6. data/.claude/skills/speckit-constitution/SKILL.md +157 -0
  7. data/.claude/skills/speckit-converge/SKILL.md +277 -0
  8. data/.claude/skills/speckit-implement/SKILL.md +224 -0
  9. data/.claude/skills/speckit-plan/SKILL.md +171 -0
  10. data/.claude/skills/speckit-specify/SKILL.md +346 -0
  11. data/.claude/skills/speckit-tasks/SKILL.md +215 -0
  12. data/.claude/skills/speckit-taskstoissues/SKILL.md +110 -0
  13. data/.release-please-manifest.json +1 -1
  14. data/.specify/extensions/.registry +19 -0
  15. data/.specify/extensions/agent-context/README.md +66 -0
  16. data/.specify/extensions/agent-context/agent-context-config.yml +5 -0
  17. data/.specify/extensions/agent-context/commands/speckit.agent-context.update.md +27 -0
  18. data/.specify/extensions/agent-context/extension.yml +34 -0
  19. data/.specify/extensions/agent-context/scripts/bash/update-agent-context.sh +282 -0
  20. data/.specify/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +353 -0
  21. data/.specify/extensions.yml +23 -0
  22. data/.specify/feature.json +3 -0
  23. data/.specify/init-options.json +9 -0
  24. data/.specify/integration.json +15 -0
  25. data/.specify/integrations/claude.manifest.json +17 -0
  26. data/.specify/integrations/speckit.manifest.json +17 -0
  27. data/.specify/memory/constitution.md +134 -0
  28. data/.specify/scripts/bash/check-prerequisites.sh +189 -0
  29. data/.specify/scripts/bash/common.sh +619 -0
  30. data/.specify/scripts/bash/create-new-feature.sh +299 -0
  31. data/.specify/scripts/bash/setup-plan.sh +84 -0
  32. data/.specify/scripts/bash/setup-tasks.sh +91 -0
  33. data/.specify/templates/checklist-template.md +40 -0
  34. data/.specify/templates/constitution-template.md +50 -0
  35. data/.specify/templates/plan-template.md +113 -0
  36. data/.specify/templates/spec-template.md +131 -0
  37. data/.specify/templates/tasks-template.md +252 -0
  38. data/.specify/workflows/speckit/workflow.yml +77 -0
  39. data/.specify/workflows/workflow-registry.json +13 -0
  40. data/CHANGELOG.md +14 -0
  41. data/README.md +146 -65
  42. data/lib/ruby_reactor/adapters/active_job/compat.rb +24 -0
  43. data/lib/ruby_reactor/adapters/active_job/map_collector_worker.rb +19 -0
  44. data/lib/ruby_reactor/adapters/active_job/map_element_worker.rb +19 -0
  45. data/lib/ruby_reactor/adapters/active_job/router.rb +91 -0
  46. data/lib/ruby_reactor/adapters/active_job/sweeper_worker.rb +16 -0
  47. data/lib/ruby_reactor/adapters/active_job/worker.rb +24 -0
  48. data/lib/ruby_reactor/adapters/sidekiq/map_collector_worker.rb +15 -0
  49. data/lib/ruby_reactor/adapters/sidekiq/map_element_worker.rb +15 -0
  50. data/lib/ruby_reactor/adapters/sidekiq/router.rb +91 -0
  51. data/lib/ruby_reactor/adapters/sidekiq/sweeper_worker.rb +19 -0
  52. data/lib/ruby_reactor/adapters/sidekiq/worker.rb +25 -0
  53. data/lib/ruby_reactor/configuration.rb +24 -4
  54. data/lib/ruby_reactor/dsl/template_helpers.rb +7 -1
  55. data/lib/ruby_reactor/map/element_executor.rb +1 -1
  56. data/lib/ruby_reactor/rspec/active_job_helpers.rb +52 -0
  57. data/lib/ruby_reactor/rspec/async_test_helpers.rb +41 -0
  58. data/lib/ruby_reactor/rspec/sidekiq_helpers.rb +3 -3
  59. data/lib/ruby_reactor/rspec/test_subject.rb +11 -7
  60. data/lib/ruby_reactor/rspec.rb +4 -0
  61. data/lib/ruby_reactor/step.rb +4 -0
  62. data/lib/ruby_reactor/sweeper_job.rb +70 -0
  63. data/lib/ruby_reactor/version.rb +1 -1
  64. data/lib/ruby_reactor/worker.rb +226 -0
  65. data/lib/ruby_reactor.rb +40 -1
  66. data/specs/active_job.md +259 -0
  67. metadata +54 -6
  68. data/lib/ruby_reactor/sidekiq_adapter.rb +0 -87
  69. data/lib/ruby_reactor/sidekiq_workers/map_collector_worker.rb +0 -13
  70. data/lib/ruby_reactor/sidekiq_workers/map_element_worker.rb +0 -13
  71. data/lib/ruby_reactor/sidekiq_workers/sweeper_worker.rb +0 -73
  72. data/lib/ruby_reactor/sidekiq_workers/worker.rb +0 -222
@@ -0,0 +1,215 @@
1
+ ---
2
+ name: "speckit-tasks"
3
+ description: "Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts."
4
+ argument-hint: "Optional task generation constraints"
5
+ compatibility: "Requires spec-kit project structure with .specify/ directory"
6
+ metadata:
7
+ author: "github-spec-kit"
8
+ source: "templates/commands/tasks.md"
9
+ user-invocable: true
10
+ disable-model-invocation: false
11
+ ---
12
+
13
+
14
+ ## User Input
15
+
16
+ ```text
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ You **MUST** consider the user input before proceeding (if not empty).
21
+
22
+ ## Pre-Execution Checks
23
+
24
+ **Check for extension hooks (before tasks generation)**:
25
+ - Check if `.specify/extensions.yml` exists in the project root.
26
+ - If it exists, read it and look for entries under the `hooks.before_tasks` key
27
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
28
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
29
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
30
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
31
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
32
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
33
+ - For each executable hook, output the following based on its `optional` flag:
34
+ - **Optional hook** (`optional: true`):
35
+ ```
36
+ ## Extension Hooks
37
+
38
+ **Optional Pre-Hook**: {extension}
39
+ Command: `/{command}`
40
+ Description: {description}
41
+
42
+ Prompt: {prompt}
43
+ To execute: `/{command}`
44
+ ```
45
+ - **Mandatory hook** (`optional: false`):
46
+ ```
47
+ ## Extension Hooks
48
+
49
+ **Automatic Pre-Hook**: {extension}
50
+ Executing: `/{command}`
51
+ EXECUTE_COMMAND: {command}
52
+
53
+ Wait for the result of the hook command before proceeding to the Outline.
54
+ ```
55
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
56
+
57
+ ## Outline
58
+
59
+ 1. **Setup**: Run `.specify/scripts/bash/setup-tasks.sh --json` from repo root and parse FEATURE_DIR, TASKS_TEMPLATE, and AVAILABLE_DOCS list. `FEATURE_DIR` and `TASKS_TEMPLATE` must be absolute paths when provided. `AVAILABLE_DOCS` is a list of document names/relative paths available under `FEATURE_DIR` (for example `research.md` or `contracts/`). 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").
60
+
61
+ 2. **Load design documents**: Read from FEATURE_DIR:
62
+ - **Required**: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)
63
+ - **Optional**: data-model.md (entities), contracts/ (interface contracts), research.md (decisions), quickstart.md (test scenarios)
64
+ - **IF EXISTS**: Load `.specify/memory/constitution.md` for project principles and governance constraints
65
+ - Note: Not all projects have all documents. Generate tasks based on what's available.
66
+
67
+ 3. **Execute task generation workflow**:
68
+ - Load plan.md and extract tech stack, libraries, project structure
69
+ - Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)
70
+ - If data-model.md exists: Extract entities and map to user stories
71
+ - If contracts/ exists: Map interface contracts to user stories
72
+ - If research.md exists: Extract decisions for setup tasks
73
+ - Generate tasks organized by user story (see Task Generation Rules below)
74
+ - Generate dependency graph showing user story completion order
75
+ - Create parallel execution examples per user story
76
+ - Validate task completeness (each user story has all needed tasks, independently testable)
77
+
78
+ 4. **Generate tasks.md**: Read the tasks template from TASKS_TEMPLATE (from the JSON output above) and use it as structure. If TASKS_TEMPLATE is empty, fall back to `.specify/templates/tasks-template.md`. Fill with:
79
+ - Correct feature name from plan.md
80
+ - Phase 1: Setup tasks (project initialization)
81
+ - Phase 2: Foundational tasks (blocking prerequisites for all user stories)
82
+ - Phase 3+: One phase per user story (in priority order from spec.md)
83
+ - Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks
84
+ - Final Phase: Polish & cross-cutting concerns
85
+ - All tasks must follow the strict checklist format (see Task Generation Rules below)
86
+ - Clear file paths for each task
87
+ - Dependencies section showing story completion order
88
+ - Parallel execution examples per story
89
+ - Implementation strategy section (MVP first, incremental delivery)
90
+
91
+ ## Mandatory Post-Execution Hooks
92
+
93
+ **You MUST complete this section before reporting completion to the user.**
94
+
95
+ Check if `.specify/extensions.yml` exists in the project root.
96
+ - If it does not exist, or no hooks are registered under `hooks.after_tasks`, skip to the Completion Report.
97
+ - If it exists, read it and look for entries under the `hooks.after_tasks` key.
98
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue to the Completion Report.
99
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
100
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
101
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
102
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
103
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
104
+ - For each executable hook, output the following based on its `optional` flag:
105
+ - **Mandatory hook** (`optional: false`) — **You MUST emit `EXECUTE_COMMAND:` for each mandatory hook**:
106
+ ```
107
+ ## Extension Hooks
108
+
109
+ **Automatic Hook**: {extension}
110
+ Executing: `/{command}`
111
+ EXECUTE_COMMAND: {command}
112
+ ```
113
+ - **Optional hook** (`optional: true`):
114
+ ```
115
+ ## Extension Hooks
116
+
117
+ **Optional Hook**: {extension}
118
+ Command: `/{command}`
119
+ Description: {description}
120
+
121
+ Prompt: {prompt}
122
+ To execute: `/{command}`
123
+ ```
124
+
125
+ ## Completion Report
126
+
127
+ Output path to generated tasks.md and summary:
128
+ - Total task count
129
+ - Task count per user story
130
+ - Parallel opportunities identified
131
+ - Independent test criteria for each story
132
+ - Suggested MVP scope (typically just User Story 1)
133
+ - Format validation: Confirm ALL tasks follow the checklist format (checkbox, ID, labels, file paths)
134
+
135
+ Context for task generation: $ARGUMENTS
136
+
137
+ The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.
138
+
139
+ ## Task Generation Rules
140
+
141
+ **CRITICAL**: Tasks MUST be organized by user story to enable independent implementation and testing.
142
+
143
+ **Tests are OPTIONAL**: Only generate test tasks if explicitly requested in the feature specification or if user requests TDD approach.
144
+
145
+ ### Checklist Format (REQUIRED)
146
+
147
+ Every task MUST strictly follow this format:
148
+
149
+ ```text
150
+ - [ ] [TaskID] [P?] [Story?] Description with file path
151
+ ```
152
+
153
+ **Format Components**:
154
+
155
+ 1. **Checkbox**: ALWAYS start with `- [ ]` (markdown checkbox)
156
+ 2. **Task ID**: Sequential number (T001, T002, T003...) in execution order
157
+ 3. **[P] marker**: Include ONLY if task is parallelizable (different files, no dependencies on incomplete tasks)
158
+ 4. **[Story] label**: REQUIRED for user story phase tasks only
159
+ - Format: [US1], [US2], [US3], etc. (maps to user stories from spec.md)
160
+ - Setup phase: NO story label
161
+ - Foundational phase: NO story label
162
+ - User Story phases: MUST have story label
163
+ - Polish phase: NO story label
164
+ 5. **Description**: Clear action with exact file path
165
+
166
+ **Examples**:
167
+
168
+ - ✅ CORRECT: `- [ ] T001 Create project structure per implementation plan`
169
+ - ✅ CORRECT: `- [ ] T005 [P] Implement authentication middleware in src/middleware/auth.py`
170
+ - ✅ CORRECT: `- [ ] T012 [P] [US1] Create User model in src/models/user.py`
171
+ - ✅ CORRECT: `- [ ] T014 [US1] Implement UserService in src/services/user_service.py`
172
+ - ❌ WRONG: `- [ ] Create User model` (missing ID and Story label)
173
+ - ❌ WRONG: `T001 [US1] Create model` (missing checkbox)
174
+ - ❌ WRONG: `- [ ] [US1] Create User model` (missing Task ID)
175
+ - ❌ WRONG: `- [ ] T001 [US1] Create model` (missing file path)
176
+
177
+ ### Task Organization
178
+
179
+ 1. **From User Stories (spec.md)** - PRIMARY ORGANIZATION:
180
+ - Each user story (P1, P2, P3...) gets its own phase
181
+ - Map all related components to their story:
182
+ - Models needed for that story
183
+ - Services needed for that story
184
+ - Interfaces/UI needed for that story
185
+ - If tests requested: Tests specific to that story
186
+ - Mark story dependencies (most stories should be independent)
187
+
188
+ 2. **From Contracts**:
189
+ - Map each interface contract → to the user story it serves
190
+ - If tests requested: Each interface contract → contract test task [P] before implementation in that story's phase
191
+
192
+ 3. **From Data Model**:
193
+ - Map each entity to the user story(ies) that need it
194
+ - If entity serves multiple stories: Put in earliest story or Setup phase
195
+ - Relationships → service layer tasks in appropriate story phase
196
+
197
+ 4. **From Setup/Infrastructure**:
198
+ - Shared infrastructure → Setup phase (Phase 1)
199
+ - Foundational/blocking tasks → Foundational phase (Phase 2)
200
+ - Story-specific setup → within that story's phase
201
+
202
+ ### Phase Structure
203
+
204
+ - **Phase 1**: Setup (project initialization)
205
+ - **Phase 2**: Foundational (blocking prerequisites - MUST complete before user stories)
206
+ - **Phase 3+**: User Stories in priority order (P1, P2, P3...)
207
+ - Within each story: Tests (if requested) → Models → Services → Endpoints → Integration
208
+ - Each phase should be a complete, independently testable increment
209
+ - **Final Phase**: Polish & Cross-Cutting Concerns
210
+
211
+ ## Done When
212
+
213
+ - [ ] tasks.md generated with all phases, task IDs, and file paths
214
+ - [ ] Extension hooks dispatched or skipped according to the rules in Mandatory Post-Execution Hooks above
215
+ - [ ] Completion reported to user with task count, story breakdown, and MVP scope
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: "speckit-taskstoissues"
3
+ description: "Convert existing tasks into actionable, dependency-ordered GitHub issues for the feature based on available design artifacts."
4
+ argument-hint: "Optional filter or label for GitHub issues"
5
+ compatibility: "Requires spec-kit project structure with .specify/ directory"
6
+ metadata:
7
+ author: "github-spec-kit"
8
+ source: "templates/commands/taskstoissues.md"
9
+ user-invocable: true
10
+ disable-model-invocation: false
11
+ ---
12
+
13
+
14
+ ## User Input
15
+
16
+ ```text
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ You **MUST** consider the user input before proceeding (if not empty).
21
+
22
+ ## Pre-Execution Checks
23
+
24
+ **Check for extension hooks (before tasks-to-issues conversion)**:
25
+ - Check if `.specify/extensions.yml` exists in the project root.
26
+ - If it exists, read it and look for entries under the `hooks.before_taskstoissues` key
27
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
28
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
29
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
30
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
31
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
32
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
33
+ - For each executable hook, output the following based on its `optional` flag:
34
+ - **Optional hook** (`optional: true`):
35
+ ```
36
+ ## Extension Hooks
37
+
38
+ **Optional Pre-Hook**: {extension}
39
+ Command: `/{command}`
40
+ Description: {description}
41
+
42
+ Prompt: {prompt}
43
+ To execute: `/{command}`
44
+ ```
45
+ - **Mandatory hook** (`optional: false`):
46
+ ```
47
+ ## Extension Hooks
48
+
49
+ **Automatic Pre-Hook**: {extension}
50
+ Executing: `/{command}`
51
+ EXECUTE_COMMAND: {command}
52
+
53
+ Wait for the result of the hook command before proceeding to the Outline.
54
+ ```
55
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
56
+
57
+ ## Outline
58
+
59
+ 1. Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` 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").
60
+ 1. **IF EXISTS**: Load `.specify/memory/constitution.md` for project principles and governance constraints.
61
+ 1. From the executed script, extract the path to **tasks**.
62
+ 1. Get the Git remote by running:
63
+
64
+ ```bash
65
+ git config --get remote.origin.url
66
+ ```
67
+
68
+ > [!CAUTION]
69
+ > ONLY PROCEED TO NEXT STEPS IF THE REMOTE IS A GITHUB URL
70
+
71
+ 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 three digits, e.g. `T001`). 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` (word boundaries so tokens like `ST001` or `T0010` are not matched by mistake; 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.
72
+ 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`).
73
+ - **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`).
74
+ - Only create issues for tasks that do not yet have a matching issue.
75
+
76
+ > [!CAUTION]
77
+ > UNDER NO CIRCUMSTANCES EVER CREATE ISSUES IN REPOSITORIES THAT DO NOT MATCH THE REMOTE URL
78
+
79
+ ## Post-Execution Checks
80
+
81
+ **Check for extension hooks (after tasks-to-issues conversion)**:
82
+ Check if `.specify/extensions.yml` exists in the project root.
83
+ - If it exists, read it and look for entries under the `hooks.after_taskstoissues` key
84
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
85
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
86
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
87
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
88
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
89
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
90
+ - For each executable hook, output the following based on its `optional` flag:
91
+ - **Optional hook** (`optional: true`):
92
+ ```
93
+ ## Extension Hooks
94
+
95
+ **Optional Hook**: {extension}
96
+ Command: `/{command}`
97
+ Description: {description}
98
+
99
+ Prompt: {prompt}
100
+ To execute: `/{command}`
101
+ ```
102
+ - **Mandatory hook** (`optional: false`):
103
+ ```
104
+ ## Extension Hooks
105
+
106
+ **Automatic Hook**: {extension}
107
+ Executing: `/{command}`
108
+ EXECUTE_COMMAND: {command}
109
+ ```
110
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.5.3"
2
+ ".": "0.6.0"
3
3
  }
@@ -0,0 +1,19 @@
1
+ {
2
+ "schema_version": "1.0",
3
+ "extensions": {
4
+ "agent-context": {
5
+ "version": "1.0.0",
6
+ "source": "local",
7
+ "manifest_hash": "sha256:9a1dc02d2d0139bb03860392ecacef79183be2c442feda2f9ccaa4e5907b1e47",
8
+ "enabled": true,
9
+ "priority": 10,
10
+ "registered_commands": {
11
+ "claude": [
12
+ "speckit.agent-context.update"
13
+ ]
14
+ },
15
+ "registered_skills": [],
16
+ "installed_at": "2026-06-23T23:29:12.192089+00:00"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,66 @@
1
+ # Coding Agent Context Extension
2
+
3
+ This bundled extension manages the **coding agent context/instruction file** (e.g. `CLAUDE.md`, `.github/copilot-instructions.md`, `AGENTS.md`, `GEMINI.md`, …) for the active integration.
4
+
5
+ It owns the lifecycle of the managed section delimited by the configurable start/end markers (defaults: `<!-- SPECKIT START -->` / `<!-- SPECKIT END -->`).
6
+
7
+ ## Why an extension?
8
+
9
+ Not every Spec Kit user wants Spec Kit to write into the coding agent's context file. Extracting this behavior into a dedicated extension lets users:
10
+
11
+ - **Opt out** entirely with `specify extension disable agent-context` — Spec Kit will then never create or modify the agent context file.
12
+ - **Customize the markers** by editing `.specify/extensions/agent-context/agent-context-config.yml` — both the Python layer and the bundled scripts honor the same `context_markers` value.
13
+ - **Synchronize multiple agent anchors** by setting `context_files` when a project intentionally uses more than one coding agent context file, such as `AGENTS.md` and `CLAUDE.md`.
14
+ - **Refresh on demand** with `/speckit.agent-context.update`, or automatically through the hooks declared in `extension.yml` (`after_specify`, `after_plan`).
15
+
16
+ ## Commands
17
+
18
+ | Command | Description |
19
+ |---------|-------------|
20
+ | `speckit.agent-context.update` | Refresh the managed section in the agent context file with the current plan path. |
21
+
22
+ ## Configuration
23
+
24
+ All configuration flows through the extension's own config file at
25
+ `.specify/extensions/agent-context/agent-context-config.yml`:
26
+
27
+ ```yaml
28
+ # Path to the coding agent context file managed by this extension
29
+ context_file: CLAUDE.md
30
+
31
+ # Optional list of coding agent context files to manage together.
32
+ # When non-empty, this takes precedence over context_file.
33
+ context_files:
34
+ - AGENTS.md
35
+ - CLAUDE.md
36
+
37
+ # Delimiters for the managed Spec Kit section
38
+ context_markers:
39
+ start: "<!-- SPECKIT START -->"
40
+ end: "<!-- SPECKIT END -->"
41
+ ```
42
+
43
+ - `context_file` — the project-relative path to the coding agent context file, written by `specify init` and `specify integration install`.
44
+ - `context_files` — optional project-relative paths to multiple coding agent context files. When non-empty, the list takes precedence over `context_file`. Absolute paths, backslash separators, and `..` path segments are rejected.
45
+ - `context_markers.start` / `.end` — the delimiters around the managed section. Edit these to use custom markers.
46
+
47
+ ## Requirements
48
+
49
+ The bundled update scripts require **Python 3** with **PyYAML** for YAML/upsert processing (PowerShell can also use `ConvertFrom-Yaml` when available).
50
+
51
+ PyYAML ships with the `specify` CLI and is normally available via the same `python3` interpreter. If a hook reports *"PyYAML is required … not available in the current Python environment"*, it means the system `python3` differs from the one used to install Spec Kit. To resolve, run:
52
+
53
+ ```bash
54
+ pip install pyyaml
55
+ # or target the specific interpreter Spec Kit uses:
56
+ /path/to/speckit-python -m pip install pyyaml
57
+ ```
58
+
59
+ ## Disable
60
+
61
+ ```bash
62
+ specify extension disable agent-context
63
+ ```
64
+
65
+ When disabled, Spec Kit skips context file creation, updates, and removal (the gates are inside `upsert_context_section()` and `remove_context_section()`).
66
+ Disabled projects also ignore stale `context_files` values during command rendering so disabling the extension remains a complete opt-out.
@@ -0,0 +1,5 @@
1
+ context_file: CLAUDE.md
2
+ context_files: []
3
+ context_markers:
4
+ start: <!-- SPECKIT START -->
5
+ end: <!-- SPECKIT END -->
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: "Refresh the managed Spec Kit section in coding agent context file(s)"
3
+ ---
4
+
5
+ # Update Coding Agent Context
6
+
7
+ Refresh the managed Spec Kit section inside the active coding agent's context/instruction file (e.g. `CLAUDE.md`, `.github/copilot-instructions.md`, `AGENTS.md`).
8
+
9
+ ## Behavior
10
+
11
+ The script reads the agent-context extension config at
12
+ `.specify/extensions/agent-context/agent-context-config.yml` to discover:
13
+
14
+ - `context_file` — the path of the coding agent context file to manage.
15
+ - `context_files` — optional project-relative paths for multiple coding agent context files. When non-empty, the script updates each listed file and the list takes precedence over `context_file`.
16
+ - `context_markers.start` / `.end` — the delimiters surrounding the managed section. Defaults to `<!-- SPECKIT START -->` and `<!-- SPECKIT END -->` when the field is missing.
17
+
18
+ It then creates, replaces, or appends the managed block so that the section points at the most recent plan path when one can be discovered (`specs/<feature>/plan.md`).
19
+
20
+ If `context_files` and `context_file` are empty, the command reports nothing to do and exits successfully. Context file paths must stay project-relative; absolute paths, Windows drive paths, backslash separators, and `..` path segments are rejected.
21
+
22
+ ## Execution
23
+
24
+ - **Bash**: `.specify/extensions/agent-context/scripts/bash/update-agent-context.sh [plan_path]`
25
+ - **PowerShell**: `.specify/extensions/agent-context/scripts/powershell/update-agent-context.ps1 [plan_path]`
26
+
27
+ When `plan_path` is omitted, the script auto-detects the most recently modified `specs/*/plan.md`.
@@ -0,0 +1,34 @@
1
+ schema_version: "1.0"
2
+
3
+ extension:
4
+ id: agent-context
5
+ name: "Coding Agent Context"
6
+ version: "1.0.0"
7
+ description: "Manages coding agent context/instruction files (e.g., CLAUDE.md, copilot-instructions.md) with project-specific plan references and configurable markers"
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
+
15
+ provides:
16
+ commands:
17
+ - name: speckit.agent-context.update
18
+ file: commands/speckit.agent-context.update.md
19
+ description: "Refresh the managed Spec Kit section in the coding agent context file"
20
+
21
+ hooks:
22
+ after_specify:
23
+ command: speckit.agent-context.update
24
+ optional: true
25
+ description: "Refresh agent context after specification"
26
+ after_plan:
27
+ command: speckit.agent-context.update
28
+ optional: true
29
+ description: "Refresh agent context after planning"
30
+
31
+ tags:
32
+ - "agent"
33
+ - "context"
34
+ - "core"