aw-spec-cli 0.1.5 → 0.1.6
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/.agents/agent.json +1 -1
- package/assets/.agents/skills/{aw-spec-orch → appweaver}/SKILL.md +10 -10
- package/assets/.agents/skills/{aw-spec-orch-demo → appweaver-demo}/SKILL.md +9 -9
- package/assets/.claude/agent.json +1 -1
- package/assets/.claude/skills/{aw-spec-orch → appweaver}/SKILL.md +10 -10
- package/assets/.claude/skills/{aw-spec-orch-demo → appweaver-demo}/SKILL.md +9 -9
- package/assets/.kilocode/agent.json +1 -1
- package/assets/.kilocode/workflows/{aw-spec-orch-demo.md → appweaver-demo.md} +9 -9
- package/assets/.kilocode/workflows/{aw-spec-orch.md → appweaver.md} +10 -10
- package/assets/docs/pharma-constitution.my-ref.md +86 -0
- package/dist/utils/paths.js +2 -2
- package/dist/utils/paths.js.map +1 -1
- package/package.json +1 -1
- package/assets/.aw-spec/DESIGN-FORMAT.md +0 -151
- package/assets/.aw-spec/ORCH-DIALECT.md +0 -156
- package/assets/.aw-spec/RULE-PARTITION.md +0 -126
- package/assets/.aw-spec/domain.json +0 -3
- package/assets/.aw-spec/extensions/.registry +0 -19
- package/assets/.aw-spec/extensions/agent-context/README.md +0 -57
- package/assets/.aw-spec/extensions/agent-context/agent-context-config.yml +0 -4
- package/assets/.aw-spec/extensions/agent-context/commands/aw-spec.agent-context.update.md +0 -26
- package/assets/.aw-spec/extensions/agent-context/extension.yml +0 -37
- package/assets/.aw-spec/extensions/agent-context/scripts/bash/update-agent-context.sh +0 -201
- package/assets/.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +0 -237
- package/assets/.aw-spec/extensions.yml +0 -16
- package/assets/.aw-spec/feature.json +0 -3
- package/assets/.aw-spec/init-options.json +0 -9
- package/assets/.aw-spec/integration.json +0 -15
- package/assets/.aw-spec/integrations/aw-spec.manifest.json +0 -9
- package/assets/.aw-spec/interpreter/run-skill.py +0 -1158
- package/assets/.aw-spec/memory/constitution.md +0 -50
- package/assets/.aw-spec/orchestrator/AGENT-PROFILE.md +0 -94
- package/assets/.aw-spec/orchestrator/README.md +0 -300
- package/assets/.aw-spec/orchestrator/adapters/claude_agent_sdk.py +0 -74
- package/assets/.aw-spec/orchestrator/adapters/google_antigravity.py +0 -74
- package/assets/.aw-spec/orchestrator/modules/delta-design.orch.yaml +0 -105
- package/assets/.aw-spec/orchestrator/modules/delta-spec.orch.yaml +0 -79
- package/assets/.aw-spec/orchestrator/modules/domain-select.orch.yaml +0 -81
- package/assets/.aw-spec/orchestrator/modules/tech-select.orch.yaml +0 -75
- package/assets/.aw-spec/orchestrator/orchestrator.py +0 -1721
- package/assets/.aw-spec/orchestrator/rev-templates/ai-rules.reference.md +0 -40
- package/assets/.aw-spec/orchestrator/rev-templates/comandrulemap.skeleton.md +0 -59
- package/assets/.aw-spec/orchestrator/rev-templates/commandtechrulemap.skeleton.md +0 -97
- package/assets/.aw-spec/orchestrator/rev-templates/domain-constitution.skeleton.md +0 -61
- package/assets/.aw-spec/orchestrator/rev-templates/domain-requirements.skeleton.md +0 -48
- package/assets/.aw-spec/orchestrator/rev-templates/domain-rule-file.skeleton.md +0 -39
- package/assets/.aw-spec/orchestrator/rev-templates/technical-constitution.skeleton.md +0 -106
- package/assets/.aw-spec/orchestrator/rev-templates/technical-rule-file.skeleton.md +0 -54
- package/assets/.aw-spec/orchestrator/workflows/_smoke.orch.yaml +0 -160
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-add-component.orch.yaml +0 -244
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-adopt.orch.yaml +0 -775
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +0 -248
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +0 -261
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +0 -425
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-build.orch.yaml +0 -188
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-characterize.orch.yaml +0 -474
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-close-delta.orch.yaml +0 -181
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-constitution.orch.yaml +0 -284
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml +0 -103
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +0 -69
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-deploy.orch.yaml +0 -85
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-design.orch.yaml +0 -382
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +0 -382
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-foundation.orch.yaml +0 -246
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +0 -231
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement.orch.yaml +0 -258
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-inventory.orch.yaml +0 -236
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-onboard.orch.yaml +0 -949
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-parity.orch.yaml +0 -293
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-run.orch.yaml +0 -177
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-domain.orch.yaml +0 -79
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-feature.orch.yaml +0 -128
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-specify.orch.yaml +0 -412
- package/assets/.aw-spec/scripts/bash/aw-inventory.sh +0 -14
- package/assets/.aw-spec/scripts/bash/aw-parity.sh +0 -13
- package/assets/.aw-spec/scripts/bash/aw-rev-constitution.sh +0 -13
- package/assets/.aw-spec/scripts/bash/aw-spec-actions.sh +0 -1899
- package/assets/.aw-spec/scripts/bash/aw-xref.sh +0 -15
- package/assets/.aw-spec/scripts/bash/common.sh +0 -533
- package/assets/.aw-spec/scripts/powershell/aw-inventory.ps1 +0 -14
- package/assets/.aw-spec/scripts/powershell/aw-parity.ps1 +0 -13
- package/assets/.aw-spec/scripts/powershell/aw-rev-constitution.ps1 +0 -13
- package/assets/.aw-spec/scripts/powershell/aw-spec-actions.ps1 +0 -1563
- package/assets/.aw-spec/scripts/powershell/aw-xref.ps1 +0 -15
- package/assets/.aw-spec/scripts/python/aw-inventory.py +0 -683
- package/assets/.aw-spec/scripts/python/aw-parity.py +0 -380
- package/assets/.aw-spec/scripts/python/aw-rev-constitution.py +0 -312
- package/assets/.aw-spec/scripts/python/aw-xref.py +0 -1330
- package/assets/.aw-spec/scripts/python/validate_okf.py +0 -349
- package/assets/.aw-spec/templates/constitution-domain-template.md +0 -75
- package/assets/.aw-spec/templates/constitution-technical-template.md +0 -70
- package/assets/.aw-spec/templates/delta-design-template.md +0 -69
- package/assets/.aw-spec/templates/delta-spec-template.md +0 -60
- package/assets/.aw-spec/templates/design-template.md +0 -383
- package/assets/.aw-spec/templates/okf-concept-template.md +0 -103
- package/assets/.aw-spec/templates/parity-manifest-template.json +0 -49
- package/assets/.aw-spec/templates/source-map-template.md +0 -85
- package/assets/.aw-spec/templates/spec-template.md +0 -252
- package/assets/docs/ModularMonolith/ModularMonolith.Reference.pack.txt +0 -25248
- package/assets/docs/ModularMonolith/ModularMonolith.pack.txt +0 -5726
- package/assets/docs/ModularMonolith/pack-foundation.ps1 +0 -145
- package/assets/docs/ModularMonolith/pack-foundation.sh +0 -196
- package/assets/docs/ModularMonolith/pack-reference-foundation.ps1 +0 -157
- package/assets/docs/ModularMonolith/pack-reference-foundation.sh +0 -209
- package/assets/docs/ModularMonolith/unpack-foundation.ps1 +0 -126
- package/assets/docs/ModularMonolith/unpack-foundation.sh +0 -217
- package/assets/docs/ModularMonolith/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/ModularMonolith/unpack-reference-foundation.sh +0 -218
- package/assets/docs/README.md +0 -106
- package/assets/docs/VerticalSlice/PACKAGING.md +0 -185
- package/assets/docs/VerticalSlice/VerticalSlice.Reference.pack.txt +0 -19318
- package/assets/docs/VerticalSlice/VerticalSlice.pack.txt +0 -2833
- package/assets/docs/VerticalSlice/pack-foundation.ps1 +0 -145
- package/assets/docs/VerticalSlice/pack-foundation.sh +0 -196
- package/assets/docs/VerticalSlice/pack-reference-foundation.ps1 +0 -157
- package/assets/docs/VerticalSlice/pack-reference-foundation.sh +0 -209
- package/assets/docs/VerticalSlice/unpack-foundation.ps1 +0 -126
- package/assets/docs/VerticalSlice/unpack-foundation.sh +0 -217
- package/assets/docs/VerticalSlice/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/VerticalSlice/unpack-reference-foundation.sh +0 -218
- package/assets/docs/architecture/clean-architecture.md +0 -71
- package/assets/docs/architecture/cqrs.md +0 -141
- package/assets/docs/architecture/eventing.md +0 -83
- package/assets/docs/architecture/folder-structure.md +0 -61
- package/assets/docs/architecture/modular-monolith.md +0 -47
- package/assets/docs/architecture/persistence.md +0 -269
- package/assets/docs/architecture/testing.md +0 -55
- package/assets/docs/architecture/vertical-slices.md +0 -201
- package/assets/docs/components/Email/README.md +0 -119
- package/assets/docs/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +0 -84
- package/assets/docs/components/Email/integration.md +0 -300
- package/assets/docs/components/Jobs/README.md +0 -113
- package/assets/docs/components/Jobs/integration.md +0 -259
- package/assets/docs/components/QrGenerator/README.md +0 -85
- package/assets/docs/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +0 -57
- package/assets/docs/components/QrGenerator/integration.md +0 -230
- package/assets/docs/components/README.md +0 -74
- package/assets/docs/domain/domain-driven-design.md +0 -212
- package/assets/docs/domainspecs/healthcare/ai-rules.domain.md +0 -34
- package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +0 -17
- package/assets/docs/domainspecs/healthcare/auditing.domain.md +0 -97
- package/assets/docs/domainspecs/healthcare/authorization.domain.md +0 -26
- package/assets/docs/domainspecs/healthcare/clinical-terms.md +0 -20
- package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +0 -26
- package/assets/docs/domainspecs/healthcare/comandrulemap.md +0 -100
- package/assets/docs/domainspecs/healthcare/commandtechrulemap.md +0 -119
- package/assets/docs/domainspecs/healthcare/consent.md +0 -19
- package/assets/docs/domainspecs/healthcare/cqrs.domain.md +0 -12
- package/assets/docs/domainspecs/healthcare/data-classification.domain.md +0 -28
- package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +0 -11
- package/assets/docs/domainspecs/healthcare/dicom.md +0 -15
- package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +0 -28
- package/assets/docs/domainspecs/healthcare/domain-requirements.md +0 -55
- package/assets/docs/domainspecs/healthcare/eventing.domain.md +0 -18
- package/assets/docs/domainspecs/healthcare/fhir.md +0 -36
- package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +0 -23
- package/assets/docs/domainspecs/healthcare/hipaa.md +0 -34
- package/assets/docs/domainspecs/healthcare/hl7.md +0 -15
- package/assets/docs/domainspecs/healthcare/integration-terms.md +0 -21
- package/assets/docs/domainspecs/healthcare/persistence.domain.md +0 -20
- package/assets/docs/domainspecs/healthcare/terminology.md +0 -30
- package/assets/docs/domainspecs/healthcare/testing.domain.md +0 -15
- package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +0 -18
- package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +0 -12
- package/assets/docs/domainspecs/pharma/ai-rules.domain.md +0 -32
- package/assets/docs/domainspecs/pharma/api-versioning.domain.md +0 -20
- package/assets/docs/domainspecs/pharma/atc.md +0 -22
- package/assets/docs/domainspecs/pharma/auditing.domain.md +0 -90
- package/assets/docs/domainspecs/pharma/authorization.domain.md +0 -25
- package/assets/docs/domainspecs/pharma/coding-standards.domain.md +0 -28
- package/assets/docs/domainspecs/pharma/comandrulemap.md +0 -108
- package/assets/docs/domainspecs/pharma/commandtechrulemap.md +0 -119
- package/assets/docs/domainspecs/pharma/cqrs.domain.md +0 -16
- package/assets/docs/domainspecs/pharma/data-classification.domain.md +0 -24
- package/assets/docs/domainspecs/pharma/data-provenance.md +0 -21
- package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +0 -11
- package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +0 -36
- package/assets/docs/domainspecs/pharma/domain-requirements.md +0 -99
- package/assets/docs/domainspecs/pharma/eventing.domain.md +0 -18
- package/assets/docs/domainspecs/pharma/fhir.md +0 -31
- package/assets/docs/domainspecs/pharma/folder-structure.domain.md +0 -24
- package/assets/docs/domainspecs/pharma/hl7.md +0 -17
- package/assets/docs/domainspecs/pharma/idmp.md +0 -26
- package/assets/docs/domainspecs/pharma/integration-terms.md +0 -21
- package/assets/docs/domainspecs/pharma/ndc.md +0 -28
- package/assets/docs/domainspecs/pharma/persistence.domain.md +0 -23
- package/assets/docs/domainspecs/pharma/pharma-terms.md +0 -27
- package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +0 -30
- package/assets/docs/domainspecs/pharma/regulatory-compliance.md +0 -19
- package/assets/docs/domainspecs/pharma/terminology.md +0 -32
- package/assets/docs/domainspecs/pharma/testing.domain.md +0 -19
- package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +0 -17
- package/assets/docs/domainspecs/pharma/zero-trust.domain.md +0 -12
- package/assets/docs/glossary/ai-rules.md +0 -59
- package/assets/docs/governance/api-versioning.md +0 -99
- package/assets/docs/governance/coding-standards.md +0 -87
- package/assets/docs/governance/dependency-policy.md +0 -40
- package/assets/docs/interop/ihe-conformance.md +0 -31
- package/assets/docs/requirement-spec.txt +0 -27
- package/assets/docs/security/auditing.md +0 -160
- package/assets/docs/security/authorization-matrix.md +0 -14
- package/assets/docs/security/authorization.md +0 -87
- package/assets/docs/security/data-classification.md +0 -38
- package/assets/docs/security/zero-trust.md +0 -76
- package/assets/docs/technology-constitution.md +0 -172
|
@@ -1,201 +0,0 @@
|
|
|
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
|
-
# .aw-spec/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/.aw-spec/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/.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
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
|
-
# .aw-spec/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 '.aw-spec/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"
|
|
@@ -1,16 +0,0 @@
|
|
|
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: {}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"integration": "aw-spec",
|
|
3
|
-
"version": "0.10.1",
|
|
4
|
-
"installed_at": "2026-06-10T07:39:01.950069+00:00",
|
|
5
|
-
"files": {
|
|
6
|
-
".aw-spec/scripts/bash/common.sh": "21cc21dd88c36e632fd052eca435c0e7ab262acaff632667dec87ff8b794ef43",
|
|
7
|
-
".aw-spec/templates/spec-template.md": "3945437fc35cd30a5b2bf7beea680337c3516826d3efa5a6b92c4a7eca1ba28e"
|
|
8
|
-
}
|
|
9
|
-
}
|