aw-spec-cli 0.1.7 → 0.1.9
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.
- package/assets/.appweaver/DESIGN-FORMAT.md +200 -0
- package/assets/.appweaver/ORCH-DIALECT.md +156 -0
- package/assets/.appweaver/RULE-PARTITION.md +175 -0
- package/assets/.appweaver/STACK-PROFILES.md +461 -0
- package/assets/.appweaver/ai-rules.md +180 -0
- package/assets/.appweaver/domain.json +1 -0
- package/assets/.appweaver/extensions/.registry +19 -0
- package/assets/.appweaver/extensions/agent-context/README.md +57 -0
- package/assets/.appweaver/extensions/agent-context/agent-context-config.yml +4 -0
- package/assets/.appweaver/extensions/agent-context/commands/aw-spec.agent-context.update.md +26 -0
- package/assets/.appweaver/extensions/agent-context/extension.yml +37 -0
- package/assets/.appweaver/extensions/agent-context/scripts/bash/update-agent-context.sh +201 -0
- package/assets/.appweaver/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +237 -0
- package/assets/.appweaver/extensions.yml +16 -0
- package/assets/.appweaver/feature.json +3 -0
- package/assets/.appweaver/init-options.json +9 -0
- package/assets/.appweaver/integration.json +15 -0
- package/assets/.appweaver/integrations/aw-spec.manifest.json +9 -0
- package/assets/.appweaver/interpreter/run-skill.py +1176 -0
- package/assets/.appweaver/memory/constitution.md +50 -0
- package/assets/.appweaver/orchestrator/.smoke-out/smoke.md +6 -0
- package/assets/.appweaver/orchestrator/AGENT-PROFILE.md +94 -0
- package/assets/.appweaver/orchestrator/README.md +300 -0
- package/assets/.appweaver/orchestrator/adapters/claude_agent_sdk.py +74 -0
- package/assets/.appweaver/orchestrator/adapters/google_antigravity.py +74 -0
- package/assets/.appweaver/orchestrator/modules/delta-design.orch.yaml +105 -0
- package/assets/.appweaver/orchestrator/modules/delta-spec.orch.yaml +101 -0
- package/assets/.appweaver/orchestrator/modules/domain-select.orch.yaml +90 -0
- package/assets/.appweaver/orchestrator/modules/lane-gate.orch.yaml +126 -0
- package/assets/.appweaver/orchestrator/modules/tech-select.orch.yaml +123 -0
- package/assets/.appweaver/orchestrator/orchestrator.py +1721 -0
- package/assets/.appweaver/orchestrator/rev-templates/ai-rules.reference.md +40 -0
- package/assets/.appweaver/orchestrator/rev-templates/delta-design-template.skeleton.md +101 -0
- package/assets/.appweaver/orchestrator/rev-templates/design-template.skeleton.md +245 -0
- package/assets/.appweaver/orchestrator/rev-templates/domain-constitution.skeleton.md +63 -0
- package/assets/.appweaver/orchestrator/rev-templates/domain-requirements.skeleton.md +48 -0
- package/assets/.appweaver/orchestrator/rev-templates/domain-rule-bindings.skeleton.md +59 -0
- package/assets/.appweaver/orchestrator/rev-templates/domain-rule-file.skeleton.md +39 -0
- package/assets/.appweaver/orchestrator/rev-templates/frontend-rule-file.skeleton.md +63 -0
- package/assets/.appweaver/orchestrator/rev-templates/tech-rule-bindings.skeleton.md +116 -0
- package/assets/.appweaver/orchestrator/rev-templates/technical-constitution.skeleton.md +106 -0
- package/assets/.appweaver/orchestrator/rev-templates/technical-rule-file.skeleton.md +54 -0
- package/assets/.appweaver/orchestrator/rev-templates/ui-constitution.skeleton.md +125 -0
- package/assets/.appweaver/orchestrator/rev-templates/ui-delta-design-template.skeleton.md +123 -0
- package/assets/.appweaver/orchestrator/rev-templates/ui-design-template.skeleton.md +294 -0
- package/assets/.appweaver/orchestrator/workflows/_smoke.orch.yaml +160 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-add-component.orch.yaml +270 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-adopt.orch.yaml +934 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +251 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +265 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +437 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-build.orch.yaml +197 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-characterize.orch.yaml +475 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-close-delta.orch.yaml +181 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-constitution.orch.yaml +727 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml +100 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +69 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-deploy.orch.yaml +85 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-design-ui.orch.yaml +386 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-design.orch.yaml +382 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +462 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-foundation.orch.yaml +265 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +253 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-implement-ui.orch.yaml +267 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-implement.orch.yaml +287 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-inventory.orch.yaml +238 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-onboard.orch.yaml +1822 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-parity.orch.yaml +293 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-run.orch.yaml +194 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-select-domain.orch.yaml +83 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-select-feature.orch.yaml +128 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-select-stack.orch.yaml +296 -0
- package/assets/.appweaver/orchestrator/workflows/aw-spec-specify.orch.yaml +439 -0
- package/assets/.appweaver/scripts/bash/aw-inventory.sh +17 -0
- package/assets/.appweaver/scripts/bash/aw-parity.sh +13 -0
- package/assets/.appweaver/scripts/bash/aw-rev-constitution.sh +13 -0
- package/assets/.appweaver/scripts/bash/aw-spec-actions.sh +2626 -0
- package/assets/.appweaver/scripts/bash/aw-xref.sh +15 -0
- package/assets/.appweaver/scripts/bash/common.sh +533 -0
- package/assets/.appweaver/scripts/powershell/aw-inventory.ps1 +17 -0
- package/assets/.appweaver/scripts/powershell/aw-parity.ps1 +13 -0
- package/assets/.appweaver/scripts/powershell/aw-rev-constitution.ps1 +13 -0
- package/assets/.appweaver/scripts/powershell/aw-spec-actions.ps1 +2232 -0
- package/assets/.appweaver/scripts/powershell/aw-xref.ps1 +15 -0
- package/assets/.appweaver/scripts/python/aw-component-catalog.py +121 -0
- package/assets/.appweaver/scripts/python/aw-inventory.py +1180 -0
- package/assets/.appweaver/scripts/python/aw-parity.py +380 -0
- package/assets/.appweaver/scripts/python/aw-rev-constitution.py +329 -0
- package/assets/.appweaver/scripts/python/aw-stack.py +1251 -0
- package/assets/.appweaver/scripts/python/aw-xref.py +1330 -0
- package/assets/.appweaver/scripts/python/validate_okf.py +352 -0
- package/assets/.appweaver/stack-profiles/angular.json +16 -0
- package/assets/.appweaver/stack-profiles/blazor-wasm.json +17 -0
- package/assets/.appweaver/stack-profiles/dotnet-webapi.json +15 -0
- package/assets/.appweaver/stack-profiles/go-chi.json +14 -0
- package/assets/.appweaver/stack-profiles/java-spring.json +16 -0
- package/assets/.appweaver/stack-profiles/nextjs.json +16 -0
- package/assets/.appweaver/stack-profiles/node-express.json +15 -0
- package/assets/.appweaver/stack-profiles/python-fastapi.json +16 -0
- package/assets/.appweaver/stack-profiles/react-vite.json +17 -0
- package/assets/.appweaver/stack-profiles/sveltekit.json +16 -0
- package/assets/.appweaver/stack-profiles/vue-vite.json +17 -0
- package/assets/.appweaver/stacks.json +3 -0
- package/assets/.appweaver/templates/constitution-domain-template.md +116 -0
- package/assets/.appweaver/templates/constitution-technical-template.md +108 -0
- package/assets/.appweaver/templates/constitution-ui-template.md +116 -0
- package/assets/.appweaver/templates/delta-design-template.md +69 -0
- package/assets/.appweaver/templates/delta-spec-template.md +63 -0
- package/assets/.appweaver/templates/design-template.md +383 -0
- package/assets/.appweaver/templates/okf-concept-template.md +114 -0
- package/assets/.appweaver/templates/parity-manifest-template.json +49 -0
- package/assets/.appweaver/templates/source-map-template.md +85 -0
- package/assets/.appweaver/templates/spec-template.md +309 -0
- package/assets/.appweaver/templates/ui-design-template.md +273 -0
- package/assets/foundations/dotnet/ModularMonolith/ModularMonolith.Reference.pack.txt +25248 -0
- package/assets/foundations/dotnet/ModularMonolith/ModularMonolith.pack.txt +5726 -0
- package/assets/foundations/dotnet/ModularMonolith/pack-foundation.ps1 +145 -0
- package/assets/foundations/dotnet/ModularMonolith/pack-foundation.sh +196 -0
- package/assets/foundations/dotnet/ModularMonolith/pack-reference-foundation.ps1 +157 -0
- package/assets/foundations/dotnet/ModularMonolith/pack-reference-foundation.sh +209 -0
- package/assets/foundations/dotnet/ModularMonolith/unpack-foundation.ps1 +126 -0
- package/assets/foundations/dotnet/ModularMonolith/unpack-foundation.sh +217 -0
- package/assets/foundations/dotnet/ModularMonolith/unpack-reference-foundation.ps1 +129 -0
- package/assets/foundations/dotnet/ModularMonolith/unpack-reference-foundation.sh +218 -0
- package/assets/foundations/dotnet/VerticalSlice/VerticalSlice.Reference.pack.txt +19318 -0
- package/assets/foundations/dotnet/VerticalSlice/VerticalSlice.pack.txt +2833 -0
- package/assets/foundations/dotnet/VerticalSlice/pack-foundation.ps1 +145 -0
- package/assets/foundations/dotnet/VerticalSlice/pack-foundation.sh +196 -0
- package/assets/foundations/dotnet/VerticalSlice/pack-reference-foundation.ps1 +157 -0
- package/assets/foundations/dotnet/VerticalSlice/pack-reference-foundation.sh +209 -0
- package/assets/foundations/dotnet/VerticalSlice/unpack-foundation.ps1 +126 -0
- package/assets/foundations/dotnet/VerticalSlice/unpack-foundation.sh +217 -0
- package/assets/foundations/dotnet/VerticalSlice/unpack-reference-foundation.ps1 +129 -0
- package/assets/foundations/dotnet/VerticalSlice/unpack-reference-foundation.sh +218 -0
- package/assets/foundations/dotnet/components/Email/README.md +119 -0
- package/assets/foundations/dotnet/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +84 -0
- package/assets/foundations/dotnet/components/Email/integration.md +300 -0
- package/assets/foundations/dotnet/components/Jobs/README.md +113 -0
- package/assets/foundations/dotnet/components/Jobs/integration.md +259 -0
- package/assets/foundations/dotnet/components/QrGenerator/README.md +85 -0
- package/assets/foundations/dotnet/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +57 -0
- package/assets/foundations/dotnet/components/QrGenerator/integration.md +230 -0
- package/assets/foundations/dotnet/components/README.md +74 -0
- package/assets/guardrails/README.md +222 -0
- package/assets/guardrails/domain/healthcare/ai-rules.domain.md +34 -0
- package/assets/guardrails/domain/healthcare/api-versioning.domain.md +17 -0
- package/assets/guardrails/domain/healthcare/auditing.domain.md +97 -0
- package/assets/guardrails/domain/healthcare/authorization.domain.md +26 -0
- package/assets/guardrails/domain/healthcare/clinical-terms.md +20 -0
- package/assets/guardrails/domain/healthcare/coding-standards.domain.md +26 -0
- package/assets/guardrails/domain/healthcare/consent.md +19 -0
- package/assets/guardrails/domain/healthcare/cqrs.domain.md +12 -0
- package/assets/guardrails/domain/healthcare/data-classification.domain.md +28 -0
- package/assets/guardrails/domain/healthcare/dependency-policy.domain.md +11 -0
- package/assets/guardrails/domain/healthcare/dicom.md +15 -0
- package/assets/guardrails/domain/healthcare/domain-constitution.md +119 -0
- package/assets/guardrails/domain/healthcare/domain-driven-design.domain.md +28 -0
- package/assets/guardrails/domain/healthcare/eventing.domain.md +18 -0
- package/assets/guardrails/domain/healthcare/fhir.md +36 -0
- package/assets/guardrails/domain/healthcare/folder-structure.domain.md +25 -0
- package/assets/guardrails/domain/healthcare/hipaa.md +34 -0
- package/assets/guardrails/domain/healthcare/hl7.md +15 -0
- package/assets/guardrails/domain/healthcare/ihe-conformance.md +31 -0
- package/assets/guardrails/domain/healthcare/integration-terms.md +21 -0
- package/assets/guardrails/domain/healthcare/persistence.domain.md +20 -0
- package/assets/guardrails/domain/healthcare/terminology.md +30 -0
- package/assets/guardrails/domain/healthcare/testing.domain.md +15 -0
- package/assets/guardrails/domain/healthcare/ux/accessibility-standards.md +36 -0
- package/assets/guardrails/domain/healthcare/ux/content-design.md +32 -0
- package/assets/guardrails/domain/healthcare/ux/interaction-states.md +44 -0
- package/assets/guardrails/domain/healthcare/ux/journey-mapping.md +40 -0
- package/assets/guardrails/domain/healthcare/vertical-slices.domain.md +18 -0
- package/assets/guardrails/domain/healthcare/zero-trust.domain.md +12 -0
- package/assets/guardrails/domain/pharma/ai-rules.domain.md +32 -0
- package/assets/guardrails/domain/pharma/api-versioning.domain.md +20 -0
- package/assets/guardrails/domain/pharma/atc.md +22 -0
- package/assets/guardrails/domain/pharma/auditing.domain.md +90 -0
- package/assets/guardrails/domain/pharma/authorization.domain.md +25 -0
- package/assets/guardrails/domain/pharma/coding-standards.domain.md +28 -0
- package/assets/guardrails/domain/pharma/cqrs.domain.md +16 -0
- package/assets/guardrails/domain/pharma/data-classification.domain.md +24 -0
- package/assets/guardrails/domain/pharma/data-provenance.md +21 -0
- package/assets/guardrails/domain/pharma/dependency-policy.domain.md +11 -0
- package/assets/guardrails/domain/pharma/domain-constitution.md +113 -0
- package/assets/guardrails/domain/pharma/domain-driven-design.domain.md +36 -0
- package/assets/guardrails/domain/pharma/domain-requirements.sample.md +103 -0
- package/assets/guardrails/domain/pharma/eventing.domain.md +18 -0
- package/assets/guardrails/domain/pharma/fhir.md +31 -0
- package/assets/guardrails/domain/pharma/folder-structure.domain.md +26 -0
- package/assets/guardrails/domain/pharma/hl7.md +17 -0
- package/assets/guardrails/domain/pharma/idmp.md +26 -0
- package/assets/guardrails/domain/pharma/integration-terms.md +21 -0
- package/assets/guardrails/domain/pharma/ndc.md +28 -0
- package/assets/guardrails/domain/pharma/persistence.domain.md +23 -0
- package/assets/guardrails/domain/pharma/pharma-terms.md +27 -0
- package/assets/guardrails/domain/pharma/product-lifecycle.domain.md +30 -0
- package/assets/guardrails/domain/pharma/regulatory-compliance.md +19 -0
- package/assets/guardrails/domain/pharma/terminology.md +32 -0
- package/assets/guardrails/domain/pharma/testing.domain.md +19 -0
- package/assets/guardrails/domain/pharma/vertical-slices.domain.md +17 -0
- package/assets/guardrails/domain/pharma/zero-trust.domain.md +12 -0
- package/assets/guardrails/projects/dotnet-default-project/domain/domain-requirements.md +58 -0
- package/assets/guardrails/projects/dotnet-default-project/domain-rule-bindings.md +113 -0
- package/assets/guardrails/projects/dotnet-default-project/frontend/ui-requirements.md +43 -0
- package/assets/guardrails/projects/dotnet-default-project/service/technical-requirements.md +40 -0
- package/assets/guardrails/projects/dotnet-default-project/tech-rule-bindings.md +263 -0
- package/assets/guardrails/requirement-spec.txt +27 -0
- package/assets/guardrails/technology/dotnet-webapi/PACKAGING.md +184 -0
- package/assets/guardrails/technology/dotnet-webapi/api-versioning.md +44 -0
- package/assets/guardrails/technology/dotnet-webapi/auditing.md +96 -0
- package/assets/guardrails/technology/dotnet-webapi/authorization-matrix.md +14 -0
- package/assets/guardrails/technology/dotnet-webapi/authorization.md +39 -0
- package/assets/guardrails/technology/dotnet-webapi/clean-architecture.md +54 -0
- package/assets/guardrails/technology/dotnet-webapi/coding-standards.md +87 -0
- package/assets/guardrails/technology/dotnet-webapi/cqrs.md +63 -0
- package/assets/guardrails/technology/dotnet-webapi/data-classification.md +38 -0
- package/assets/guardrails/technology/dotnet-webapi/dependency-policy.md +40 -0
- package/assets/guardrails/technology/dotnet-webapi/domain-driven-design.md +91 -0
- package/assets/guardrails/technology/dotnet-webapi/eventing.md +57 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/api-versioning.md +75 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/auditing.md +84 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/authorization.md +68 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/clean-architecture.md +37 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/cqrs.md +97 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/domain-driven-design.md +141 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/eventing.md +46 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/persistence.md +207 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/vertical-slices.md +151 -0
- package/assets/guardrails/technology/dotnet-webapi/examples/zero-trust.md +48 -0
- package/assets/guardrails/technology/dotnet-webapi/folder-structure.md +61 -0
- package/assets/guardrails/technology/dotnet-webapi/modular-monolith.md +47 -0
- package/assets/guardrails/technology/dotnet-webapi/persistence.md +82 -0
- package/assets/guardrails/technology/dotnet-webapi/technology-constitution.md +162 -0
- package/assets/guardrails/technology/dotnet-webapi/testing.md +55 -0
- package/assets/guardrails/technology/dotnet-webapi/vertical-slices.md +70 -0
- package/assets/guardrails/technology/dotnet-webapi/zero-trust.md +48 -0
- package/assets/guardrails/technology/java-spring/README.md +62 -0
- package/assets/guardrails/technology/nextjs/accessibility-implementation.md +56 -0
- package/assets/guardrails/technology/nextjs/api-client.md +56 -0
- package/assets/guardrails/technology/nextjs/api-integration.dotnet-webapi.md +174 -0
- package/assets/guardrails/technology/nextjs/api-integration.java-spring.md +203 -0
- package/assets/guardrails/technology/nextjs/auth-session.md +68 -0
- package/assets/guardrails/technology/nextjs/client-security.md +69 -0
- package/assets/guardrails/technology/nextjs/component-architecture.md +60 -0
- package/assets/guardrails/technology/nextjs/component-conventions.md +58 -0
- package/assets/guardrails/technology/nextjs/design-system.md +60 -0
- package/assets/guardrails/technology/nextjs/error-handling.md +72 -0
- package/assets/guardrails/technology/nextjs/forms-and-validation.md +75 -0
- package/assets/guardrails/technology/nextjs/frontend-testing.md +94 -0
- package/assets/guardrails/technology/nextjs/i18n.md +57 -0
- package/assets/guardrails/technology/nextjs/observability.md +67 -0
- package/assets/guardrails/technology/nextjs/performance-budgets.md +66 -0
- package/assets/guardrails/technology/nextjs/routing-navigation.md +52 -0
- package/assets/guardrails/technology/nextjs/state-management.md +70 -0
- package/assets/guardrails/technology/nextjs/ui-constitution.md +166 -0
- package/dist/commands/init.js +2 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/utils/copy-assets.js +8 -8
- package/dist/utils/copy-assets.js.map +1 -1
- package/package.json +1 -1
- package/assets/docs/pharma-constitution.my-ref.md +0 -86
|
@@ -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
|
+
"aw-spec.agent-context.update"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"registered_skills": [],
|
|
16
|
+
"installed_at": "2026-06-10T07:39:02.078494+00:00"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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: `<!-- AW-SPEC START -->` / `<!-- AW-SPEC END -->`).
|
|
6
|
+
|
|
7
|
+
## Why an extension?
|
|
8
|
+
|
|
9
|
+
Not every AW-Spec user wants AW-Spec 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` — AW-Spec will then never create or modify the agent context file.
|
|
12
|
+
- **Customize the markers** by editing `.appweaver/extensions/agent-context/agent-context-config.yml` — both the Python layer and the bundled scripts honor the same `context_markers` value.
|
|
13
|
+
- **Refresh on demand** with `/aw-spec.agent-context.update`, or automatically through the hooks declared in `extension.yml` (`after_specify`, `after_plan`).
|
|
14
|
+
|
|
15
|
+
## Commands
|
|
16
|
+
|
|
17
|
+
| Command | Description |
|
|
18
|
+
|---------|-------------|
|
|
19
|
+
| `aw-spec.agent-context.update` | Refresh the managed section in the agent context file with the current plan path. |
|
|
20
|
+
|
|
21
|
+
## Configuration
|
|
22
|
+
|
|
23
|
+
All configuration flows through the extension's own config file at
|
|
24
|
+
`.appweaver/extensions/agent-context/agent-context-config.yml`:
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
# Path to the coding agent context file managed by this extension
|
|
28
|
+
context_file: CLAUDE.md
|
|
29
|
+
|
|
30
|
+
# Delimiters for the managed AW-Spec section
|
|
31
|
+
context_markers:
|
|
32
|
+
start: "<!-- AW-SPEC START -->"
|
|
33
|
+
end: "<!-- AW-SPEC END -->"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- `context_file` — the project-relative path to the coding agent context file, written by `specify init` and `specify integration install`.
|
|
37
|
+
- `context_markers.start` / `.end` — the delimiters around the managed section. Edit these to use custom markers.
|
|
38
|
+
|
|
39
|
+
## Requirements
|
|
40
|
+
|
|
41
|
+
The bundled update scripts require **Python 3** with **PyYAML** for YAML/upsert processing (PowerShell can also use `ConvertFrom-Yaml` when available).
|
|
42
|
+
|
|
43
|
+
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 AW-Spec. To resolve, run:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install pyyaml
|
|
47
|
+
# or target the specific interpreter AW-Spec uses:
|
|
48
|
+
/path/to/aw-spec-python -m pip install pyyaml
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Disable
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
specify extension disable agent-context
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
When disabled, AW-Spec skips context file creation, updates, and removal (the gates are inside `upsert_context_section()` and `remove_context_section()`).
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Refresh the managed AW-Spec section in the coding agent context file"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Update Coding Agent Context
|
|
6
|
+
|
|
7
|
+
Refresh the managed AW-Spec 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
|
+
`.appweaver/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_markers.start` / `.end` — the delimiters surrounding the managed section. Defaults to `<!-- AW-SPEC START -->` and `<!-- AW-SPEC END -->` when the field is missing.
|
|
16
|
+
|
|
17
|
+
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`).
|
|
18
|
+
|
|
19
|
+
If `context_file` is empty or the file cannot be located, the command reports nothing to do and exits successfully.
|
|
20
|
+
|
|
21
|
+
## Execution
|
|
22
|
+
|
|
23
|
+
- **Bash**: `.appweaver/extensions/agent-context/scripts/bash/update-agent-context.sh [plan_path]`
|
|
24
|
+
- **PowerShell**: `.appweaver/extensions/agent-context/scripts/powershell/update-agent-context.ps1 [plan_path]`
|
|
25
|
+
|
|
26
|
+
When `plan_path` is omitted, the script auto-detects the most recently modified `specs/*/plan.md`.
|
|
@@ -0,0 +1,37 @@
|
|
|
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: aw-spec-core
|
|
9
|
+
repository: https://github.com/github/aw-spec
|
|
10
|
+
license: MIT
|
|
11
|
+
|
|
12
|
+
requires:
|
|
13
|
+
aw-spec_version: ">=0.2.0"
|
|
14
|
+
|
|
15
|
+
provides:
|
|
16
|
+
commands:
|
|
17
|
+
- name: aw-spec.agent-context.update
|
|
18
|
+
file: commands/aw-spec.agent-context.update.md
|
|
19
|
+
description: "Refresh the managed AW-Spec section in the coding agent context file"
|
|
20
|
+
|
|
21
|
+
# NO auto-wired hooks — this extension is ON-DEMAND only
|
|
22
|
+
# (/aw-spec.agent-context.update). It previously declared after_specify + after_plan,
|
|
23
|
+
# and installing it re-wrote both into .appweaver/extensions.yml. Both were stale:
|
|
24
|
+
# • after_plan — no workflow dispatches that phase; the plan/tasks tier was
|
|
25
|
+
# retired by the spec-anchored redesign.
|
|
26
|
+
# • after_specify — the updater targets `specs/*/plan.md`, which nothing produces,
|
|
27
|
+
# so every specify (greenfield forward loop AND brownfield CR
|
|
28
|
+
# loop, which both enter at specify) offered a hook that could
|
|
29
|
+
# not do its job.
|
|
30
|
+
# Restore a hook here once the updater is retargeted at spec.md / design.md — that
|
|
31
|
+
# retarget is the open work, not the hook wiring.
|
|
32
|
+
hooks: {}
|
|
33
|
+
|
|
34
|
+
tags:
|
|
35
|
+
- "agent"
|
|
36
|
+
- "context"
|
|
37
|
+
- "core"
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# update-agent-context.sh
|
|
3
|
+
#
|
|
4
|
+
# Refresh the managed AW-Spec section in the coding agent's context file
|
|
5
|
+
# (e.g. CLAUDE.md, .github/copilot-instructions.md, AGENTS.md).
|
|
6
|
+
#
|
|
7
|
+
# Reads `context_file` and `context_markers.{start,end}` from the
|
|
8
|
+
# agent-context extension config:
|
|
9
|
+
# .appweaver/extensions/agent-context/agent-context-config.yml
|
|
10
|
+
#
|
|
11
|
+
# Usage: update-agent-context.sh [plan_path]
|
|
12
|
+
#
|
|
13
|
+
# When `plan_path` is omitted, the script picks the most recently modified
|
|
14
|
+
# `specs/*/plan.md` if any exist, otherwise emits the section without a
|
|
15
|
+
# concrete plan path.
|
|
16
|
+
|
|
17
|
+
set -euo pipefail
|
|
18
|
+
|
|
19
|
+
PROJECT_ROOT="$(pwd)"
|
|
20
|
+
EXT_CONFIG="$PROJECT_ROOT/.appweaver/extensions/agent-context/agent-context-config.yml"
|
|
21
|
+
DEFAULT_START="<!-- AW-SPEC START -->"
|
|
22
|
+
DEFAULT_END="<!-- AW-SPEC END -->"
|
|
23
|
+
|
|
24
|
+
if [[ ! -f "$EXT_CONFIG" ]]; then
|
|
25
|
+
echo "agent-context: $EXT_CONFIG not found; nothing to do." >&2
|
|
26
|
+
exit 0
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Locate a suitable Python interpreter (python3, then python).
|
|
30
|
+
_python=""
|
|
31
|
+
if command -v python3 >/dev/null 2>&1; then
|
|
32
|
+
_python="python3"
|
|
33
|
+
elif command -v python >/dev/null 2>&1 && python --version 2>&1 | grep -q "^Python 3"; then
|
|
34
|
+
_python="python"
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
if [[ -z "$_python" ]]; then
|
|
38
|
+
echo "agent-context: Python 3 not found on PATH; skipping update." >&2
|
|
39
|
+
exit 0
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
# Parse extension config once; emit three newline-separated fields:
|
|
43
|
+
# context_file, context_markers.start, context_markers.end
|
|
44
|
+
if ! _raw_opts="$("$_python" - "$EXT_CONFIG" <<'PY'
|
|
45
|
+
import sys
|
|
46
|
+
try:
|
|
47
|
+
import yaml
|
|
48
|
+
except ImportError:
|
|
49
|
+
print(
|
|
50
|
+
"agent-context: PyYAML is required to parse extension config but is not available "
|
|
51
|
+
"in the current Python environment.\n"
|
|
52
|
+
" To resolve: pip install pyyaml (or install it into the environment used by python3).\n"
|
|
53
|
+
" Context file will not be updated until PyYAML is importable.",
|
|
54
|
+
file=sys.stderr,
|
|
55
|
+
)
|
|
56
|
+
sys.exit(2)
|
|
57
|
+
try:
|
|
58
|
+
with open(sys.argv[1], "r", encoding="utf-8") as fh:
|
|
59
|
+
data = yaml.safe_load(fh)
|
|
60
|
+
except Exception as exc:
|
|
61
|
+
print(
|
|
62
|
+
f"agent-context: unable to parse {sys.argv[1]} ({exc}); cannot update context.",
|
|
63
|
+
file=sys.stderr,
|
|
64
|
+
)
|
|
65
|
+
sys.exit(2)
|
|
66
|
+
if not isinstance(data, dict):
|
|
67
|
+
data = {}
|
|
68
|
+
def get_str(obj, *keys):
|
|
69
|
+
node = obj
|
|
70
|
+
for k in keys:
|
|
71
|
+
if isinstance(node, dict) and k in node:
|
|
72
|
+
node = node[k]
|
|
73
|
+
else:
|
|
74
|
+
return ""
|
|
75
|
+
return node if isinstance(node, str) else ""
|
|
76
|
+
print(get_str(data, "context_file"))
|
|
77
|
+
print(get_str(data, "context_markers", "start"))
|
|
78
|
+
print(get_str(data, "context_markers", "end"))
|
|
79
|
+
PY
|
|
80
|
+
)"; then
|
|
81
|
+
echo "agent-context: skipping update (see above for details)." >&2
|
|
82
|
+
exit 0
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
_opts_lines=()
|
|
86
|
+
while IFS= read -r _line || [[ -n "$_line" ]]; do
|
|
87
|
+
_opts_lines+=("$_line")
|
|
88
|
+
done < <(printf '%s\n' "$_raw_opts")
|
|
89
|
+
if (( ${#_opts_lines[@]} < 3 )); then
|
|
90
|
+
echo "agent-context: malformed config parser output; expected 3 lines (context_file, marker_start, marker_end), got ${#_opts_lines[@]}; skipping update." >&2
|
|
91
|
+
exit 0
|
|
92
|
+
fi
|
|
93
|
+
CONTEXT_FILE="${_opts_lines[0]}"
|
|
94
|
+
MARKER_START="${_opts_lines[1]}"
|
|
95
|
+
MARKER_END="${_opts_lines[2]}"
|
|
96
|
+
|
|
97
|
+
if [[ -z "$CONTEXT_FILE" ]]; then
|
|
98
|
+
echo "agent-context: context_file not set in extension config; nothing to do." >&2
|
|
99
|
+
exit 0
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
# Reject absolute paths, backslash separators, and '..' path segments in context_file
|
|
103
|
+
if [[ "$CONTEXT_FILE" == /* ]] || [[ "$CONTEXT_FILE" =~ ^[A-Za-z]: ]]; then
|
|
104
|
+
echo "agent-context: context_file must be a project-relative path; got '$CONTEXT_FILE'." >&2
|
|
105
|
+
exit 1
|
|
106
|
+
fi
|
|
107
|
+
if [[ "$CONTEXT_FILE" == *\\* ]]; then
|
|
108
|
+
echo "agent-context: context_file must not contain backslash separators; got '$CONTEXT_FILE'." >&2
|
|
109
|
+
exit 1
|
|
110
|
+
fi
|
|
111
|
+
IFS='/' read -ra _cf_parts <<< "$CONTEXT_FILE"
|
|
112
|
+
for _seg in "${_cf_parts[@]}"; do
|
|
113
|
+
if [[ "$_seg" == ".." ]]; then
|
|
114
|
+
echo "agent-context: context_file must not contain '..' path segments; got '$CONTEXT_FILE'." >&2
|
|
115
|
+
exit 1
|
|
116
|
+
fi
|
|
117
|
+
done
|
|
118
|
+
unset _cf_parts _seg
|
|
119
|
+
|
|
120
|
+
[[ -z "$MARKER_START" ]] && MARKER_START="$DEFAULT_START"
|
|
121
|
+
[[ -z "$MARKER_END" ]] && MARKER_END="$DEFAULT_END"
|
|
122
|
+
|
|
123
|
+
PLAN_PATH="${1:-}"
|
|
124
|
+
if [[ -z "$PLAN_PATH" ]]; then
|
|
125
|
+
# Pick the most recently modified plan.md two levels deep
|
|
126
|
+
# (specs/<Aggregate>/<Feature>/plan.md).
|
|
127
|
+
# Use find + sort by modification time to avoid ls/head fragility with
|
|
128
|
+
# spaces in paths or SIGPIPE from pipefail.
|
|
129
|
+
_plan_abs="$("$_python" - "$PROJECT_ROOT" <<'PY'
|
|
130
|
+
import sys, os
|
|
131
|
+
from pathlib import Path
|
|
132
|
+
specs = Path(sys.argv[1]) / "specs"
|
|
133
|
+
plans = sorted(
|
|
134
|
+
specs.glob("*/plan.md"),
|
|
135
|
+
key=lambda p: p.stat().st_mtime,
|
|
136
|
+
reverse=True,
|
|
137
|
+
)
|
|
138
|
+
print(plans[0] if plans else "")
|
|
139
|
+
PY
|
|
140
|
+
)"
|
|
141
|
+
if [[ -n "$_plan_abs" ]]; then
|
|
142
|
+
PLAN_PATH="${_plan_abs#"$PROJECT_ROOT/"}"
|
|
143
|
+
fi
|
|
144
|
+
fi
|
|
145
|
+
|
|
146
|
+
CTX_PATH="$PROJECT_ROOT/$CONTEXT_FILE"
|
|
147
|
+
mkdir -p "$(dirname "$CTX_PATH")"
|
|
148
|
+
|
|
149
|
+
# Build the managed section
|
|
150
|
+
TMP_SECTION="$(mktemp)"
|
|
151
|
+
trap 'rm -f "$TMP_SECTION"' EXIT
|
|
152
|
+
{
|
|
153
|
+
echo "$MARKER_START"
|
|
154
|
+
echo "For additional context about technologies to be used, project structure,"
|
|
155
|
+
echo "shell commands, and other important information, read the current plan"
|
|
156
|
+
if [[ -n "$PLAN_PATH" ]]; then
|
|
157
|
+
echo "at $PLAN_PATH"
|
|
158
|
+
fi
|
|
159
|
+
echo "$MARKER_END"
|
|
160
|
+
} > "$TMP_SECTION"
|
|
161
|
+
|
|
162
|
+
"$_python" - "$CTX_PATH" "$MARKER_START" "$MARKER_END" "$TMP_SECTION" <<'PY'
|
|
163
|
+
import sys, os
|
|
164
|
+
ctx_path, start, end, section_path = sys.argv[1:5]
|
|
165
|
+
with open(section_path, "r", encoding="utf-8") as fh:
|
|
166
|
+
section = fh.read().rstrip("\n") + "\n"
|
|
167
|
+
|
|
168
|
+
if os.path.exists(ctx_path):
|
|
169
|
+
with open(ctx_path, "r", encoding="utf-8-sig") as fh:
|
|
170
|
+
content = fh.read()
|
|
171
|
+
s = content.find(start)
|
|
172
|
+
e = content.find(end, s if s != -1 else 0)
|
|
173
|
+
if s != -1 and e != -1 and e > s:
|
|
174
|
+
end_of_marker = e + len(end)
|
|
175
|
+
if end_of_marker < len(content) and content[end_of_marker] == "\r":
|
|
176
|
+
end_of_marker += 1
|
|
177
|
+
if end_of_marker < len(content) and content[end_of_marker] == "\n":
|
|
178
|
+
end_of_marker += 1
|
|
179
|
+
new_content = content[:s] + section + content[end_of_marker:]
|
|
180
|
+
elif s != -1:
|
|
181
|
+
new_content = content[:s] + section
|
|
182
|
+
elif e != -1:
|
|
183
|
+
end_of_marker = e + len(end)
|
|
184
|
+
if end_of_marker < len(content) and content[end_of_marker] == "\r":
|
|
185
|
+
end_of_marker += 1
|
|
186
|
+
if end_of_marker < len(content) and content[end_of_marker] == "\n":
|
|
187
|
+
end_of_marker += 1
|
|
188
|
+
new_content = section + content[end_of_marker:]
|
|
189
|
+
else:
|
|
190
|
+
if content and not content.endswith("\n"):
|
|
191
|
+
content += "\n"
|
|
192
|
+
new_content = (content + "\n" + section) if content else section
|
|
193
|
+
else:
|
|
194
|
+
new_content = section
|
|
195
|
+
|
|
196
|
+
new_content = new_content.replace("\r\n", "\n").replace("\r", "\n")
|
|
197
|
+
with open(ctx_path, "wb") as fh:
|
|
198
|
+
fh.write(new_content.encode("utf-8"))
|
|
199
|
+
PY
|
|
200
|
+
|
|
201
|
+
echo "agent-context: updated $CONTEXT_FILE"
|
package/assets/.appweaver/extensions/agent-context/scripts/powershell/update-agent-context.ps1
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
#!/usr/bin/env pwsh
|
|
2
|
+
# update-agent-context.ps1
|
|
3
|
+
#
|
|
4
|
+
# Refresh the managed AW-Spec section in the coding agent's context file
|
|
5
|
+
# (e.g. CLAUDE.md, .github/copilot-instructions.md, AGENTS.md).
|
|
6
|
+
#
|
|
7
|
+
# Reads `context_file` and `context_markers.{start,end}` from the
|
|
8
|
+
# agent-context extension config:
|
|
9
|
+
# .appweaver/extensions/agent-context/agent-context-config.yml
|
|
10
|
+
#
|
|
11
|
+
# Usage: update-agent-context.ps1 [plan_path]
|
|
12
|
+
|
|
13
|
+
[CmdletBinding()]
|
|
14
|
+
param(
|
|
15
|
+
[Parameter(Position = 0)]
|
|
16
|
+
[string]$PlanPath
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
function Get-ConfigValue {
|
|
20
|
+
param(
|
|
21
|
+
[AllowNull()][object]$Object,
|
|
22
|
+
[Parameter(Mandatory = $true)][string]$Key
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
if ($null -eq $Object) {
|
|
26
|
+
return $null
|
|
27
|
+
}
|
|
28
|
+
if ($Object -is [System.Collections.IDictionary]) {
|
|
29
|
+
return $Object[$Key]
|
|
30
|
+
}
|
|
31
|
+
$prop = $Object.PSObject.Properties[$Key]
|
|
32
|
+
if ($prop) {
|
|
33
|
+
return $prop.Value
|
|
34
|
+
}
|
|
35
|
+
return $null
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function Test-ConfigObject {
|
|
39
|
+
param(
|
|
40
|
+
[AllowNull()][object]$Object
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
if ($null -eq $Object) {
|
|
44
|
+
return $false
|
|
45
|
+
}
|
|
46
|
+
if ($Object -is [System.Collections.IDictionary]) {
|
|
47
|
+
return $true
|
|
48
|
+
}
|
|
49
|
+
if ($Object -is [System.Management.Automation.PSCustomObject]) {
|
|
50
|
+
return $true
|
|
51
|
+
}
|
|
52
|
+
return $false
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
$ErrorActionPreference = 'Stop'
|
|
56
|
+
$DefaultStart = '<!-- AW-SPEC START -->'
|
|
57
|
+
$DefaultEnd = '<!-- AW-SPEC END -->'
|
|
58
|
+
$ProjectRoot = (Get-Location).Path
|
|
59
|
+
$ExtConfig = Join-Path $ProjectRoot '.appweaver/extensions/agent-context/agent-context-config.yml'
|
|
60
|
+
|
|
61
|
+
if (-not (Test-Path -LiteralPath $ExtConfig)) {
|
|
62
|
+
Write-Warning "agent-context: $ExtConfig not found; nothing to do."
|
|
63
|
+
exit 0
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
$Options = $null
|
|
67
|
+
if (Get-Command ConvertFrom-Yaml -ErrorAction SilentlyContinue) {
|
|
68
|
+
try {
|
|
69
|
+
$Options = Get-Content -LiteralPath $ExtConfig -Raw | ConvertFrom-Yaml -ErrorAction Stop
|
|
70
|
+
} catch {
|
|
71
|
+
# fall through to Python fallback
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if ($null -eq $Options) {
|
|
76
|
+
# ConvertFrom-Yaml unavailable or failed; fall back to Python+PyYAML.
|
|
77
|
+
$pythonCmd = $null
|
|
78
|
+
foreach ($candidate in @('python3', 'python')) {
|
|
79
|
+
if (Get-Command $candidate -ErrorAction SilentlyContinue) {
|
|
80
|
+
# Verify it is Python 3
|
|
81
|
+
$verOut = & $candidate --version 2>&1
|
|
82
|
+
if ($verOut -match 'Python 3') {
|
|
83
|
+
$pythonCmd = $candidate
|
|
84
|
+
break
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if ($pythonCmd) {
|
|
90
|
+
try {
|
|
91
|
+
$jsonOut = & $pythonCmd -c @'
|
|
92
|
+
import json
|
|
93
|
+
import sys
|
|
94
|
+
try:
|
|
95
|
+
import yaml
|
|
96
|
+
except ImportError:
|
|
97
|
+
print(
|
|
98
|
+
"agent-context: PyYAML is required to parse extension config; cannot update context.",
|
|
99
|
+
file=sys.stderr,
|
|
100
|
+
)
|
|
101
|
+
sys.exit(2)
|
|
102
|
+
|
|
103
|
+
try:
|
|
104
|
+
with open(sys.argv[1], "r", encoding="utf-8") as fh:
|
|
105
|
+
data = yaml.safe_load(fh)
|
|
106
|
+
except Exception as exc:
|
|
107
|
+
print(
|
|
108
|
+
f"agent-context: unable to parse {sys.argv[1]} ({exc}); cannot update context.",
|
|
109
|
+
file=sys.stderr,
|
|
110
|
+
)
|
|
111
|
+
sys.exit(2)
|
|
112
|
+
|
|
113
|
+
if not isinstance(data, dict):
|
|
114
|
+
data = {}
|
|
115
|
+
|
|
116
|
+
print(json.dumps(data))
|
|
117
|
+
'@ $ExtConfig
|
|
118
|
+
if ($LASTEXITCODE -eq 0 -and $jsonOut) {
|
|
119
|
+
$Options = $jsonOut | ConvertFrom-Json -ErrorAction Stop
|
|
120
|
+
}
|
|
121
|
+
} catch {
|
|
122
|
+
$Options = $null
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (-not $Options) {
|
|
127
|
+
Write-Warning "agent-context: unable to parse $ExtConfig; skipping update."
|
|
128
|
+
exit 0
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (-not (Test-ConfigObject -Object $Options)) {
|
|
133
|
+
Write-Warning "agent-context: $ExtConfig must contain a YAML mapping; skipping update."
|
|
134
|
+
exit 0
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
$ContextFile = Get-ConfigValue -Object $Options -Key 'context_file'
|
|
138
|
+
if (-not $ContextFile) {
|
|
139
|
+
Write-Warning 'agent-context: context_file not set in extension config; nothing to do.'
|
|
140
|
+
exit 0
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
# Reject absolute paths and '..' path segments in context_file
|
|
144
|
+
if ([System.IO.Path]::IsPathRooted($ContextFile)) {
|
|
145
|
+
Write-Warning "agent-context: context_file must be a project-relative path; got '$ContextFile'."
|
|
146
|
+
exit 1
|
|
147
|
+
}
|
|
148
|
+
$cfSegments = $ContextFile -split '[/\\]'
|
|
149
|
+
if ($cfSegments -contains '..') {
|
|
150
|
+
Write-Warning "agent-context: context_file must not contain '..' path segments; got '$ContextFile'."
|
|
151
|
+
exit 1
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
$MarkerStart = $DefaultStart
|
|
155
|
+
$MarkerEnd = $DefaultEnd
|
|
156
|
+
$cm = Get-ConfigValue -Object $Options -Key 'context_markers'
|
|
157
|
+
if ($cm) {
|
|
158
|
+
$cmStart = Get-ConfigValue -Object $cm -Key 'start'
|
|
159
|
+
if ($cmStart -is [string] -and $cmStart) {
|
|
160
|
+
$MarkerStart = $cmStart
|
|
161
|
+
}
|
|
162
|
+
$cmEnd = Get-ConfigValue -Object $cm -Key 'end'
|
|
163
|
+
if ($cmEnd -is [string] -and $cmEnd) {
|
|
164
|
+
$MarkerEnd = $cmEnd
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (-not $PlanPath) {
|
|
169
|
+
# Discover plan.md two levels deep under the spec root
|
|
170
|
+
# (specs/<Aggregate>/<Feature>/plan.md). Wrap in try/catch so access
|
|
171
|
+
# errors under $ErrorActionPreference = 'Stop' don't abort the script.
|
|
172
|
+
try {
|
|
173
|
+
$specsDir = Join-Path $ProjectRoot 'specs'
|
|
174
|
+
$candidate = Get-ChildItem -Path $specsDir -Directory -ErrorAction SilentlyContinue |
|
|
175
|
+
ForEach-Object { Get-Item -LiteralPath (Join-Path $_.FullName 'plan.md') -ErrorAction SilentlyContinue } |
|
|
176
|
+
Where-Object { $_ } |
|
|
177
|
+
Sort-Object LastWriteTime -Descending |
|
|
178
|
+
Select-Object -First 1
|
|
179
|
+
if ($candidate) {
|
|
180
|
+
$PlanPath = [System.IO.Path]::GetRelativePath($ProjectRoot, $candidate.FullName).Replace('\','/')
|
|
181
|
+
}
|
|
182
|
+
} catch {
|
|
183
|
+
# Non-fatal: continue without a plan path.
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
$CtxPath = Join-Path $ProjectRoot $ContextFile
|
|
188
|
+
$CtxDir = Split-Path -Parent $CtxPath
|
|
189
|
+
if ($CtxDir -and -not (Test-Path -LiteralPath $CtxDir)) {
|
|
190
|
+
New-Item -ItemType Directory -Path $CtxDir -Force | Out-Null
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
$lines = @($MarkerStart,
|
|
194
|
+
'For additional context about technologies to be used, project structure,',
|
|
195
|
+
'shell commands, and other important information, read the current plan')
|
|
196
|
+
if ($PlanPath) {
|
|
197
|
+
$lines += "at $PlanPath"
|
|
198
|
+
}
|
|
199
|
+
$lines += $MarkerEnd
|
|
200
|
+
$Section = ($lines -join "`n") + "`n"
|
|
201
|
+
|
|
202
|
+
if (Test-Path -LiteralPath $CtxPath) {
|
|
203
|
+
$rawBytes = [System.IO.File]::ReadAllBytes($CtxPath)
|
|
204
|
+
# Strip UTF-8 BOM if present
|
|
205
|
+
if ($rawBytes.Length -ge 3 -and $rawBytes[0] -eq 0xEF -and $rawBytes[1] -eq 0xBB -and $rawBytes[2] -eq 0xBF) {
|
|
206
|
+
$content = [System.Text.Encoding]::UTF8.GetString($rawBytes, 3, $rawBytes.Length - 3)
|
|
207
|
+
} else {
|
|
208
|
+
$content = [System.Text.Encoding]::UTF8.GetString($rawBytes)
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
$s = $content.IndexOf($MarkerStart)
|
|
212
|
+
$e = if ($s -ge 0) { $content.IndexOf($MarkerEnd, $s) } else { $content.IndexOf($MarkerEnd) }
|
|
213
|
+
|
|
214
|
+
if ($s -ge 0 -and $e -ge 0 -and $e -gt $s) {
|
|
215
|
+
$endOfMarker = $e + $MarkerEnd.Length
|
|
216
|
+
if ($endOfMarker -lt $content.Length -and $content[$endOfMarker] -eq "`r") { $endOfMarker++ }
|
|
217
|
+
if ($endOfMarker -lt $content.Length -and $content[$endOfMarker] -eq "`n") { $endOfMarker++ }
|
|
218
|
+
$newContent = $content.Substring(0, $s) + $Section + $content.Substring($endOfMarker)
|
|
219
|
+
} elseif ($s -ge 0) {
|
|
220
|
+
$newContent = $content.Substring(0, $s) + $Section
|
|
221
|
+
} elseif ($e -ge 0) {
|
|
222
|
+
$endOfMarker = $e + $MarkerEnd.Length
|
|
223
|
+
if ($endOfMarker -lt $content.Length -and $content[$endOfMarker] -eq "`r") { $endOfMarker++ }
|
|
224
|
+
if ($endOfMarker -lt $content.Length -and $content[$endOfMarker] -eq "`n") { $endOfMarker++ }
|
|
225
|
+
$newContent = $Section + $content.Substring($endOfMarker)
|
|
226
|
+
} else {
|
|
227
|
+
if ($content -and -not $content.EndsWith("`n")) { $content += "`n" }
|
|
228
|
+
if ($content) { $newContent = $content + "`n" + $Section } else { $newContent = $Section }
|
|
229
|
+
}
|
|
230
|
+
} else {
|
|
231
|
+
$newContent = $Section
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
$newContent = $newContent.Replace("`r`n", "`n").Replace("`r", "`n")
|
|
235
|
+
[System.IO.File]::WriteAllText($CtxPath, $newContent, (New-Object System.Text.UTF8Encoding($false)))
|
|
236
|
+
|
|
237
|
+
Write-Host "agent-context: updated $ContextFile"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Installed extensions + the hook wiring the pipeline dispatches.
|
|
2
|
+
#
|
|
3
|
+
# `installed:` keeps agent-context available as an ON-DEMAND extension
|
|
4
|
+
# (/aw-spec.agent-context.update); it is simply no longer wired into any pipeline
|
|
5
|
+
# phase. It was hooked on after_specify and after_plan, and BOTH were stale:
|
|
6
|
+
# • after_plan — no workflow dispatches that phase at all; the plan/tasks tier
|
|
7
|
+
# was retired by the spec-anchored redesign.
|
|
8
|
+
# • after_specify — the updater targets `specs/*/plan.md`, which nothing produces
|
|
9
|
+
# any more, so every specify in BOTH the greenfield loop and the
|
|
10
|
+
# brownfield CR loop offered a hook that could not do its job.
|
|
11
|
+
# Re-wire it here once the updater is retargeted at spec.md / design.md.
|
|
12
|
+
installed:
|
|
13
|
+
- agent-context
|
|
14
|
+
settings:
|
|
15
|
+
auto_execute_hooks: true
|
|
16
|
+
hooks: {}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.10.1",
|
|
3
|
+
"integration_state_schema": 1,
|
|
4
|
+
"installed_integrations": [
|
|
5
|
+
"claude"
|
|
6
|
+
],
|
|
7
|
+
"integration_settings": {
|
|
8
|
+
"claude": {
|
|
9
|
+
"script": "sh",
|
|
10
|
+
"invoke_separator": "-"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"integration": "claude",
|
|
14
|
+
"default_integration": "claude"
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"integration": "aw-spec",
|
|
3
|
+
"version": "0.10.1",
|
|
4
|
+
"installed_at": "2026-06-10T07:39:01.950069+00:00",
|
|
5
|
+
"files": {
|
|
6
|
+
".appweaver/scripts/bash/common.sh": "21cc21dd88c36e632fd052eca435c0e7ab262acaff632667dec87ff8b794ef43",
|
|
7
|
+
".appweaver/templates/spec-template.md": "3945437fc35cd30a5b2bf7beea680337c3516826d3efa5a6b92c4a7eca1ba28e"
|
|
8
|
+
}
|
|
9
|
+
}
|