-
Notifications
You must be signed in to change notification settings - Fork 10.3k
feat: make agent-context extension a full opt-in #3097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mnriem
wants to merge
25
commits into
github:main
Choose a base branch
from
mnriem:mnriem-agent-context-optin-spec
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
104b28e
docs: add Spec Kit spec for agent-context full opt-in
mnriem a867179
docs: add Spec Kit plan artifacts for agent-context full opt-in
mnriem e6b07a3
docs: correct Constitution Check against ratified v1.0.0
mnriem cdabb7e
docs: refresh plan artifacts against synced upstream/main
mnriem 7f03cdd
docs: add Spec Kit tasks for agent-context full opt-in
mnriem 96b50e9
feat!: remove agent-context lifecycle from the Specify CLI
mnriem 7f83b97
feat(agent-context): self-seed context file from the active integration
mnriem cedefe3
test+docs: update suite and docs for agent-context opt-in
mnriem 56ee0df
fix(agent-context): warn on self-seed failure, correct docs, speed up…
mnriem 4f51e37
feat(agent-context): ship self-owned per-agent context-file defaults
mnriem 55dda37
feat!: remove all agent-context state from the Specify CLI
mnriem d8014dd
test: drop context_file coverage and guard against CLI reintroduction
mnriem 114379f
docs: reflect full removal of agent-context state from the CLI
mnriem f64dc36
docs: align SDD artifacts with full context_file removal
mnriem 2737616
docs: scrub stale context-file mentions from CLI docstrings
mnriem 11bf1d3
test+docs: harden agent-context test helper and fix stale docs
mnriem a1ea61f
chore: remove gitignored SDD artifacts from specs/
mnriem 97cecb3
Merge remote-tracking branch 'upstream/main' into mnriem-agent-contex…
mnriem d165fd6
chore: keep CHANGELOG.md identical to upstream
mnriem af96691
fix: preserve Cursor .mdc frontmatter in agent-context updater scripts
mnriem b8e4ff8
test: scope CLI-free guard to agent-context-specific symbols
mnriem 132ef0a
fix: harden agent-context bash self-seed against malformed init JSON
mnriem a544033
fix: correct PowerShell hyphenated key lookup and regex replace count
mnriem 74a09ef
fix: make bash .mdc frontmatter guard case-insensitive
mnriem daf9b12
docs: document separator-agnostic agent-context update invocation
mnriem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
specs/001-agent-context-full-optin/checklists/requirements.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Specification Quality Checklist: Agent-Context Extension Full Opt-In | ||
|
|
||
| **Purpose**: Validate specification completeness and quality before proceeding to planning | ||
| **Created**: 2026-06-22 | ||
| **Feature**: [spec.md](../spec.md) | ||
|
|
||
| ## Content Quality | ||
|
|
||
| - [x] No implementation details (languages, frameworks, APIs) | ||
| - [x] Focused on user value and business needs | ||
| - [x] Written for non-technical stakeholders | ||
| - [x] All mandatory sections completed | ||
|
|
||
| ## Requirement Completeness | ||
|
|
||
| - [x] No [NEEDS CLARIFICATION] markers remain | ||
| - [x] Requirements are testable and unambiguous | ||
| - [x] Success criteria are measurable | ||
| - [x] Success criteria are technology-agnostic (no implementation details) | ||
| - [x] All acceptance scenarios are defined | ||
| - [x] Edge cases are identified | ||
| - [x] Scope is clearly bounded | ||
| - [x] Dependencies and assumptions identified | ||
|
|
||
| ## Feature Readiness | ||
|
|
||
| - [x] All functional requirements have clear acceptance criteria | ||
| - [x] User scenarios cover primary flows | ||
| - [x] Feature meets measurable outcomes defined in Success Criteria | ||
| - [x] No implementation details leak into specification | ||
|
|
||
| ## Notes | ||
|
|
||
| - Items marked incomplete require spec updates before `/speckit.clarify` or `/speckit.plan`. | ||
| - The spec intentionally keeps file/symbol-level removals out of the requirements; those belong to the planning phase. FR-007 and the Assumptions section bound the one genuine design choice (keep `context_file` as inert metadata vs. remove it entirely) so planning can decide without reopening scope. |
91 changes: 91 additions & 0 deletions
91
specs/001-agent-context-full-optin/contracts/cli-behavior.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| # Phase 1 Contracts: CLI Behavioral Contracts | ||
|
|
||
| **Feature**: 001-agent-context-full-optin | **Date**: 2026-06-22 | ||
|
|
||
| This is a CLI tool, so the externally observable "contract" is the behavior of `specify` commands with respect to agent context files and the extension config. Each contract below is a testable assertion that the implementation and test suite must satisfy. | ||
|
|
||
| ## C1: `specify init` — extension absent/not selected | ||
|
|
||
| **Given** a user runs `specify init` with an integration and does not select the `agent-context` extension | ||
| **When** initialization and integration setup complete | ||
| **Then**: | ||
| - No managed Spec Kit section is created in the agent context file by the CLI. | ||
| - `.specify/extensions/agent-context/agent-context-config.yml` is not created or written by the CLI. | ||
| - No deprecation message is printed. | ||
|
|
||
| *Maps to*: FR-001, FR-002, FR-005, FR-006 · SC-001, SC-003 | ||
|
|
||
| ## C2: `specify init` — extension selected (opt-in) | ||
|
|
||
| **Given** a user runs `specify init` and opts into the `agent-context` extension | ||
| **When** initialization completes | ||
| **Then**: | ||
| - The extension is installed via the normal extension mechanism. | ||
| - Any seeding of `agent-context-config.yml` is performed by the extension's own install logic, not by CLI agent-context helpers. | ||
| - Running the extension's update command produces a correct managed section. | ||
|
|
||
| *Maps to*: FR-004, FR-005 · SC-005 | ||
|
|
||
| ## C3: Integration setup never writes the context section | ||
|
|
||
| **Given** any integration's `setup()` runs (regardless of extension state) | ||
| **When** command files are installed | ||
| **Then**: | ||
| - `__CONTEXT_FILE__` placeholders in rendered templates are substituted from the integration's declared `context_file` metadata. | ||
| - No call creates, updates, or removes a managed section in the agent context file. | ||
|
mnriem marked this conversation as resolved.
Outdated
|
||
|
|
||
| *Maps to*: FR-001, FR-003, FR-007 | ||
|
|
||
| ## C4: Integration teardown/uninstall never touches the context file or ext config | ||
|
|
||
| **Given** an integration is uninstalled or switched | ||
| **When** the operation completes | ||
| **Then**: | ||
| - The CLI does not remove or rewrite any managed section. | ||
| - The CLI does not clear or rewrite `agent-context-config.yml`. | ||
|
|
||
| *Maps to*: FR-001, FR-002 | ||
|
|
||
| ## C5: No agent-context logic remains in the base/init/switch layers | ||
|
|
||
| **Given** the Specify CLI source after this feature | ||
| **When** inspected (e.g. by grep/CI check) | ||
| **Then** there are zero references to: | ||
| - `upsert_context_section`, `remove_context_section` | ||
| - `_agent_context_extension_enabled`, `_resolve_context_markers` | ||
| - `_resolve_context_files`, and any extension-config-reading branch of `_resolve_context_file_values` / `_format_context_file_values` | ||
| - the plural `context_files` config-key consumption | ||
| - `_AGENT_CTX_EXT_CONFIG`, `_load_agent_context_config`, `_save_agent_context_config`, `_update_agent_context_config_file` | ||
| - the v0.12.0 deprecation string | ||
|
|
||
| (outside the `extensions/agent-context/` directory and this `specs/` artifact). | ||
|
|
||
| *Maps to*: FR-002, FR-003, FR-006 · SC-002, SC-003 | ||
|
|
||
| ## C6: Backward compatibility | ||
|
|
||
| **Given** a project created by a previous Spec Kit version (already has a managed section and/or `agent-context-config.yml`) | ||
| **When** the user runs `specify init`, an integration switch, or an uninstall | ||
| **Then** the commands complete without error and leave the pre-existing files intact (unmanaged by the CLI). | ||
|
|
||
| *Maps to*: FR-008 · SC-006 | ||
|
|
||
| ## C7: Extension remains self-contained | ||
|
|
||
| **Given** the `extensions/agent-context/` directory | ||
| **When** the extension's update command/script runs in an opt-in project | ||
| **Then** it reads its own `agent-context-config.yml` and updates the context file independently of any CLI agent-context code. | ||
|
|
||
| *Maps to*: FR-004 · SC-005 | ||
|
|
||
| ## Contract Test Matrix | ||
|
|
||
| | Contract | Test location (target) | Type | | ||
| |----------|------------------------|------| | ||
| | C1 | `tests/integrations/` + init tests | integration | | ||
| | C2 | `tests/extensions/test_extension_agent_context.py` | integration | | ||
| | C3 | `tests/integrations/test_integration_base_*.py` | unit | | ||
| | C4 | `tests/integrations/` switch/uninstall tests | unit/integration | | ||
| | C5 | new static/grep guard test (or CI check) | static | | ||
| | C6 | new backward-compat test | integration | | ||
| | C7 | `tests/extensions/test_extension_agent_context.py` (layout/script) | integration | | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.