aw-spec-cli 0.1.0 → 0.1.2
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/skills/aw-spec-addcomponent/SKILL.md +129 -0
- package/assets/.agents/skills/aw-spec-agent-context-update/SKILL.md +31 -0
- package/assets/.agents/skills/aw-spec-analyze/SKILL.md +296 -0
- package/assets/.agents/skills/aw-spec-checklist/SKILL.md +374 -0
- package/assets/.agents/skills/aw-spec-clarify/SKILL.md +320 -0
- package/assets/.agents/skills/aw-spec-constitution/SKILL.md +194 -0
- package/assets/.agents/skills/aw-spec-fast-implement/SKILL.md +268 -0
- package/assets/.agents/skills/aw-spec-foundation/SKILL.md +358 -0
- package/assets/.agents/skills/aw-spec-implement/SKILL.md +279 -0
- package/assets/.agents/skills/aw-spec-minimal-implementation/SKILL.md +209 -0
- package/assets/.agents/skills/aw-spec-plan/SKILL.md +221 -0
- package/assets/.agents/skills/aw-spec-select-domain/SKILL.md +73 -0
- package/assets/.agents/skills/aw-spec-specify/SKILL.md +382 -0
- package/assets/.agents/skills/aw-spec-tasks/SKILL.md +259 -0
- package/assets/.agents/skills/aw-spec-taskstoissues/SKILL.md +107 -0
- package/assets/.aw-spec/domain.json +3 -0
- package/assets/.aw-spec/extensions/.registry +19 -0
- package/assets/.aw-spec/extensions/agent-context/README.md +57 -0
- package/assets/.aw-spec/extensions/agent-context/agent-context-config.yml +4 -0
- package/assets/.aw-spec/extensions/agent-context/commands/aw-spec.agent-context.update.md +26 -0
- package/assets/.aw-spec/extensions/agent-context/extension.yml +34 -0
- package/assets/.aw-spec/extensions/agent-context/scripts/bash/update-agent-context.sh +201 -0
- package/assets/.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +237 -0
- package/assets/.aw-spec/extensions.yml +23 -0
- package/assets/.aw-spec/feature.json +3 -0
- package/assets/.aw-spec/init-options.json +9 -0
- package/assets/.aw-spec/integration.json +15 -0
- package/assets/.aw-spec/integrations/aw-spec.manifest.json +17 -0
- package/assets/.aw-spec/integrations/claude.manifest.json +17 -0
- package/assets/.aw-spec/memory/constitution.md +50 -0
- package/assets/.aw-spec/scripts/bash/check-prerequisites.sh +189 -0
- package/assets/.aw-spec/scripts/bash/common.sh +582 -0
- package/assets/.aw-spec/scripts/bash/create-new-feature.sh +299 -0
- package/assets/.aw-spec/scripts/bash/setup-plan.sh +84 -0
- package/assets/.aw-spec/scripts/bash/setup-tasks.sh +91 -0
- package/assets/.aw-spec/templates/checklist-template.md +40 -0
- package/assets/.aw-spec/templates/constitution-template.md +57 -0
- package/assets/.aw-spec/templates/plan-template.md +113 -0
- package/assets/.aw-spec/templates/spec-template.md +131 -0
- package/assets/.aw-spec/templates/tasks-template.md +252 -0
- package/assets/.aw-spec/workflows/aw-spec/workflow.yml +77 -0
- package/assets/.aw-spec/workflows/workflow-registry.json +13 -0
- package/assets/.claude/skills/aw-spec-addcomponent/SKILL.md +129 -0
- package/assets/.claude/skills/aw-spec-agent-context-update/SKILL.md +31 -0
- package/assets/.claude/skills/aw-spec-analyze/SKILL.md +296 -0
- package/assets/.claude/skills/aw-spec-checklist/SKILL.md +374 -0
- package/assets/.claude/skills/aw-spec-clarify/SKILL.md +320 -0
- package/assets/.claude/skills/aw-spec-constitution/SKILL.md +194 -0
- package/assets/.claude/skills/aw-spec-fast-implement/SKILL.md +268 -0
- package/assets/.claude/skills/aw-spec-foundation/SKILL.md +358 -0
- package/assets/.claude/skills/aw-spec-implement/SKILL.md +279 -0
- package/assets/.claude/skills/aw-spec-minimal-implementation/SKILL.md +209 -0
- package/assets/.claude/skills/aw-spec-plan/SKILL.md +221 -0
- package/assets/.claude/skills/aw-spec-select-domain/SKILL.md +73 -0
- package/assets/.claude/skills/aw-spec-specify/SKILL.md +382 -0
- package/assets/.claude/skills/aw-spec-tasks/SKILL.md +259 -0
- package/assets/.claude/skills/aw-spec-taskstoissues/SKILL.md +107 -0
- package/assets/.kilocode/rules/specify-rules.md +4 -0
- package/assets/.kilocode/workflows/aw-spec-addcomponent.md +129 -0
- package/assets/.kilocode/workflows/aw-spec-agent-context.update.md +31 -0
- package/assets/.kilocode/workflows/aw-spec-analyze.md +296 -0
- package/assets/.kilocode/workflows/aw-spec-checklist.md +374 -0
- package/assets/.kilocode/workflows/aw-spec-clarify.md +320 -0
- package/assets/.kilocode/workflows/aw-spec-constitution.md +194 -0
- package/assets/.kilocode/workflows/aw-spec-fast-implement.md +263 -0
- package/assets/.kilocode/workflows/aw-spec-foundation.md +358 -0
- package/assets/.kilocode/workflows/aw-spec-implement.md +279 -0
- package/assets/.kilocode/workflows/aw-spec-minimal-implementation.md +204 -0
- package/assets/.kilocode/workflows/aw-spec-plan.md +221 -0
- package/assets/.kilocode/workflows/aw-spec-select-domain.md +73 -0
- package/assets/.kilocode/workflows/aw-spec-specify.md +382 -0
- package/assets/.kilocode/workflows/aw-spec-tasks.md +259 -0
- package/assets/.kilocode/workflows/aw-spec-taskstoissues.md +107 -0
- package/assets/docs/README.md +106 -0
- package/assets/docs/VerticalSlice/PACKAGING.md +185 -0
- package/assets/docs/VerticalSlice/VerticalSlice.pack.txt +2833 -0
- package/assets/docs/VerticalSlice/pack-foundation.ps1 +145 -0
- package/assets/docs/VerticalSlice/pack-foundation.sh +196 -0
- package/assets/docs/VerticalSlice/unpack-foundation.ps1 +126 -0
- package/assets/docs/VerticalSlice/unpack-foundation.sh +217 -0
- package/assets/docs/architecture/clean-architecture.md +71 -0
- package/assets/docs/architecture/cqrs.md +141 -0
- package/assets/docs/architecture/eventing.md +83 -0
- package/assets/docs/architecture/folder-structure.md +61 -0
- package/assets/docs/architecture/modular-monolith.md +47 -0
- package/assets/docs/architecture/persistence.md +269 -0
- package/assets/docs/architecture/testing.md +55 -0
- package/assets/docs/architecture/vertical-slices.md +201 -0
- package/assets/docs/command.txt +295 -0
- package/assets/docs/components/Email/README.md +112 -0
- package/assets/docs/components/Email/integration.md +260 -0
- package/assets/docs/components/Jobs/README.md +113 -0
- package/assets/docs/components/Jobs/integration.md +245 -0
- package/assets/docs/components/QrGenerator/README.md +78 -0
- package/assets/docs/components/QrGenerator/integration.md +185 -0
- package/assets/docs/components/README.md +57 -0
- package/assets/docs/domain/domain-driven-design.md +212 -0
- package/assets/docs/domainspecs/healthcare/ai-rules.domain.md +34 -0
- package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +17 -0
- package/assets/docs/domainspecs/healthcare/auditing.domain.md +29 -0
- package/assets/docs/domainspecs/healthcare/authorization.domain.md +26 -0
- package/assets/docs/domainspecs/healthcare/clinical-terms.md +20 -0
- package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +26 -0
- package/assets/docs/domainspecs/healthcare/comandrulemap.md +119 -0
- package/assets/docs/domainspecs/healthcare/consent.md +19 -0
- package/assets/docs/domainspecs/healthcare/cqrs.domain.md +12 -0
- package/assets/docs/domainspecs/healthcare/data-classification.domain.md +28 -0
- package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +11 -0
- package/assets/docs/domainspecs/healthcare/dicom.md +15 -0
- package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +28 -0
- package/assets/docs/domainspecs/healthcare/domain-requirements.md +55 -0
- package/assets/docs/domainspecs/healthcare/eventing.domain.md +18 -0
- package/assets/docs/domainspecs/healthcare/fhir.md +36 -0
- package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +23 -0
- package/assets/docs/domainspecs/healthcare/hipaa.md +34 -0
- package/assets/docs/domainspecs/healthcare/hl7.md +15 -0
- package/assets/docs/domainspecs/healthcare/integration-terms.md +21 -0
- package/assets/docs/domainspecs/healthcare/persistence.domain.md +20 -0
- package/assets/docs/domainspecs/healthcare/terminology.md +30 -0
- package/assets/docs/domainspecs/healthcare/testing.domain.md +15 -0
- package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +18 -0
- package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +12 -0
- package/assets/docs/domainspecs/pharma/ai-rules.domain.md +32 -0
- package/assets/docs/domainspecs/pharma/api-versioning.domain.md +20 -0
- package/assets/docs/domainspecs/pharma/atc.md +22 -0
- package/assets/docs/domainspecs/pharma/auditing.domain.md +26 -0
- package/assets/docs/domainspecs/pharma/authorization.domain.md +25 -0
- package/assets/docs/domainspecs/pharma/coding-standards.domain.md +28 -0
- package/assets/docs/domainspecs/pharma/comandrulemap.md +136 -0
- package/assets/docs/domainspecs/pharma/cqrs.domain.md +16 -0
- package/assets/docs/domainspecs/pharma/data-classification.domain.md +24 -0
- package/assets/docs/domainspecs/pharma/data-provenance.md +21 -0
- package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +11 -0
- package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +36 -0
- package/assets/docs/domainspecs/pharma/domain-requirements.md +99 -0
- package/assets/docs/domainspecs/pharma/eventing.domain.md +18 -0
- package/assets/docs/domainspecs/pharma/fhir.md +31 -0
- package/assets/docs/domainspecs/pharma/folder-structure.domain.md +24 -0
- package/assets/docs/domainspecs/pharma/hl7.md +17 -0
- package/assets/docs/domainspecs/pharma/idmp.md +26 -0
- package/assets/docs/domainspecs/pharma/integration-terms.md +21 -0
- package/assets/docs/domainspecs/pharma/ndc.md +28 -0
- package/assets/docs/domainspecs/pharma/persistence.domain.md +23 -0
- package/assets/docs/domainspecs/pharma/pharma-terms.md +27 -0
- package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +30 -0
- package/assets/docs/domainspecs/pharma/regulatory-compliance.md +19 -0
- package/assets/docs/domainspecs/pharma/terminology.md +32 -0
- package/assets/docs/domainspecs/pharma/testing.domain.md +19 -0
- package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +17 -0
- package/assets/docs/domainspecs/pharma/zero-trust.domain.md +12 -0
- package/assets/docs/glossary/ai-rules.md +59 -0
- package/assets/docs/governance/api-versioning.md +99 -0
- package/assets/docs/governance/coding-standards.md +87 -0
- package/assets/docs/governance/dependency-policy.md +40 -0
- package/assets/docs/interop/ihe-conformance.md +31 -0
- package/assets/docs/pharma-constitution.my-ref.md +86 -0
- package/assets/docs/requirement-spec.txt +15 -0
- package/assets/docs/security/auditing.md +117 -0
- package/assets/docs/security/authorization-matrix.md +14 -0
- package/assets/docs/security/authorization.md +87 -0
- package/assets/docs/security/data-classification.md +38 -0
- package/assets/docs/security/zero-trust.md +76 -0
- package/assets/docs/technology-constitution.md +172 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +3 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/utils/copy-assets.d.ts +8 -1
- package/dist/utils/copy-assets.d.ts.map +1 -1
- package/dist/utils/copy-assets.js +1 -0
- package/dist/utils/copy-assets.js.map +1 -1
- package/dist/utils/paths.js +1 -1
- package/dist/utils/paths.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
+
# .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"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
installed:
|
|
2
|
+
- agent-context
|
|
3
|
+
settings:
|
|
4
|
+
auto_execute_hooks: true
|
|
5
|
+
hooks:
|
|
6
|
+
after_specify:
|
|
7
|
+
- extension: agent-context
|
|
8
|
+
command: aw-spec.agent-context.update
|
|
9
|
+
enabled: true
|
|
10
|
+
optional: true
|
|
11
|
+
priority: 10
|
|
12
|
+
prompt: Execute aw-spec.agent-context.update?
|
|
13
|
+
description: Refresh agent context after specification
|
|
14
|
+
condition: null
|
|
15
|
+
after_plan:
|
|
16
|
+
- extension: agent-context
|
|
17
|
+
command: aw-spec.agent-context.update
|
|
18
|
+
enabled: true
|
|
19
|
+
optional: true
|
|
20
|
+
priority: 10
|
|
21
|
+
prompt: Execute aw-spec.agent-context.update?
|
|
22
|
+
description: Refresh agent context after planning
|
|
23
|
+
condition: null
|
|
@@ -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,17 @@
|
|
|
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/scripts/bash/setup-plan.sh": "4eb12c5b00f5c66a7d01b56c90898d320dcef4425d9b96652d57156c84948eda",
|
|
8
|
+
".aw-spec/scripts/bash/setup-tasks.sh": "cf21ba2212b4dd5b435c5ea8527500cfd27768b86c0bbc7ebc3207759f118d27",
|
|
9
|
+
".aw-spec/scripts/bash/check-prerequisites.sh": "afce0aa8db177320d83aa0b8e3619c06b865fd810781894e4a7a3f81664941ce",
|
|
10
|
+
".aw-spec/scripts/bash/create-new-feature.sh": "324762a95ec2f534d0982931fdb11380558258791fe3bfe3ca7e11a768653134",
|
|
11
|
+
".aw-spec/templates/constitution-template.md": "ce7549540fa45543cca797a150201d868e64495fdff39dc38246fb17bd4024b3",
|
|
12
|
+
".aw-spec/templates/checklist-template.md": "c37695297e5d3153d64f82c21223509940b13932046c7961c42d1d669516130c",
|
|
13
|
+
".aw-spec/templates/tasks-template.md": "fc29a233f6f5a27ca31f1aa46b596af6500c627441c6e62b2bc4a1d721525842",
|
|
14
|
+
".aw-spec/templates/spec-template.md": "3945437fc35cd30a5b2bf7beea680337c3516826d3efa5a6b92c4a7eca1ba28e",
|
|
15
|
+
".aw-spec/templates/plan-template.md": "cc7f7979cf8d8836ec26492785affd80791d3422a2b745062ec695be8c985ef7"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"integration": "claude",
|
|
3
|
+
"version": "0.10.1",
|
|
4
|
+
"installed_at": "2026-06-10T07:39:01.929414+00:00",
|
|
5
|
+
"files": {
|
|
6
|
+
".claude/skills/aw-spec-analyze/SKILL.md": "9b8caa25a53ba97ddcfc993b5f304990468e29aa0bf1e397f534c7a0a54678ab",
|
|
7
|
+
".claude/skills/aw-spec-clarify/SKILL.md": "fc52a87c6a851c5cdb1451c766c6c71619554b35d219071c74214a4f4cc33d8a",
|
|
8
|
+
".claude/skills/aw-spec-constitution/SKILL.md": "cbe4e06a11cbf92bdb39bcf2a3000717f33556c751ad5666bfefcc2811851bf6",
|
|
9
|
+
".claude/skills/aw-spec-implement/SKILL.md": "6018e531dd7d366318d107fba44ad36881e0ce3649a93365292eedb713203710",
|
|
10
|
+
".claude/skills/aw-spec-plan/SKILL.md": "93b68cc5219333a9588813830ed6a61904f8f470bd0c5b01419b5b31b923b433",
|
|
11
|
+
".claude/skills/aw-spec-checklist/SKILL.md": "7e223721a3c43e1083a018af3ced3297b3c1486468a158b29f09a85b4f2a6e2b",
|
|
12
|
+
".claude/skills/aw-spec-specify/SKILL.md": "823f6ebe99d1f7b7f5e29754a16c0fa6e8be36087aa97344ddb61a22e54dac79",
|
|
13
|
+
".claude/skills/aw-spec-tasks/SKILL.md": "8c2ff9da9e93603484ac4ef077dd0c67b7b51253315e71fbdc334924e145a03e",
|
|
14
|
+
".claude/skills/aw-spec-taskstoissues/SKILL.md": "41e708e04a8449a2ee27cdbffb19b0fbb8596ef0862611e827afb1372056c23f",
|
|
15
|
+
".claude/skills/aw-spec-select-domain/SKILL.md": "07cbbc12dcbad9c2d0342fde853c4338eb91c9c818586f75aa291f6ebcf59eca"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# [PROJECT_NAME] Constitution
|
|
2
|
+
<!-- Example: Spec Constitution, TaskFlow Constitution, etc. -->
|
|
3
|
+
|
|
4
|
+
## Core Principles
|
|
5
|
+
|
|
6
|
+
### [PRINCIPLE_1_NAME]
|
|
7
|
+
<!-- Example: I. Library-First -->
|
|
8
|
+
[PRINCIPLE_1_DESCRIPTION]
|
|
9
|
+
<!-- Example: Every feature starts as a standalone library; Libraries must be self-contained, independently testable, documented; Clear purpose required - no organizational-only libraries -->
|
|
10
|
+
|
|
11
|
+
### [PRINCIPLE_2_NAME]
|
|
12
|
+
<!-- Example: II. CLI Interface -->
|
|
13
|
+
[PRINCIPLE_2_DESCRIPTION]
|
|
14
|
+
<!-- Example: Every library exposes functionality via CLI; Text in/out protocol: stdin/args → stdout, errors → stderr; Support JSON + human-readable formats -->
|
|
15
|
+
|
|
16
|
+
### [PRINCIPLE_3_NAME]
|
|
17
|
+
<!-- Example: III. Test-First (NON-NEGOTIABLE) -->
|
|
18
|
+
[PRINCIPLE_3_DESCRIPTION]
|
|
19
|
+
<!-- Example: TDD mandatory: Tests written → User approved → Tests fail → Then implement; Red-Green-Refactor cycle strictly enforced -->
|
|
20
|
+
|
|
21
|
+
### [PRINCIPLE_4_NAME]
|
|
22
|
+
<!-- Example: IV. Integration Testing -->
|
|
23
|
+
[PRINCIPLE_4_DESCRIPTION]
|
|
24
|
+
<!-- Example: Focus areas requiring integration tests: New library contract tests, Contract changes, Inter-service communication, Shared schemas -->
|
|
25
|
+
|
|
26
|
+
### [PRINCIPLE_5_NAME]
|
|
27
|
+
<!-- Example: V. Observability, VI. Versioning & Breaking Changes, VII. Simplicity -->
|
|
28
|
+
[PRINCIPLE_5_DESCRIPTION]
|
|
29
|
+
<!-- Example: Text I/O ensures debuggability; Structured logging required; Or: MAJOR.MINOR.BUILD format; Or: Start simple, YAGNI principles -->
|
|
30
|
+
|
|
31
|
+
## [SECTION_2_NAME]
|
|
32
|
+
<!-- Example: Additional Constraints, Security Requirements, Performance Standards, etc. -->
|
|
33
|
+
|
|
34
|
+
[SECTION_2_CONTENT]
|
|
35
|
+
<!-- Example: Technology stack requirements, compliance standards, deployment policies, etc. -->
|
|
36
|
+
|
|
37
|
+
## [SECTION_3_NAME]
|
|
38
|
+
<!-- Example: Development Workflow, Review Process, Quality Gates, etc. -->
|
|
39
|
+
|
|
40
|
+
[SECTION_3_CONTENT]
|
|
41
|
+
<!-- Example: Code review requirements, testing gates, deployment approval process, etc. -->
|
|
42
|
+
|
|
43
|
+
## Governance
|
|
44
|
+
<!-- Example: Constitution supersedes all other practices; Amendments require documentation, approval, migration plan -->
|
|
45
|
+
|
|
46
|
+
[GOVERNANCE_RULES]
|
|
47
|
+
<!-- Example: All PRs/reviews must verify compliance; Complexity must be justified; Use [GUIDANCE_FILE] for runtime development guidance -->
|
|
48
|
+
|
|
49
|
+
**Version**: [CONSTITUTION_VERSION] | **Ratified**: [RATIFICATION_DATE] | **Last Amended**: [LAST_AMENDED_DATE]
|
|
50
|
+
<!-- Example: Version: 2.1.1 | Ratified: 2025-06-13 | Last Amended: 2025-07-16 -->
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Consolidated prerequisite checking script
|
|
4
|
+
#
|
|
5
|
+
# This script provides unified prerequisite checking for Spec-Driven Development workflow.
|
|
6
|
+
# It replaces the functionality previously spread across multiple scripts.
|
|
7
|
+
#
|
|
8
|
+
# Usage: ./check-prerequisites.sh [OPTIONS]
|
|
9
|
+
#
|
|
10
|
+
# OPTIONS:
|
|
11
|
+
# --json Output in JSON format
|
|
12
|
+
# --require-tasks Require tasks.md to exist (for implementation phase)
|
|
13
|
+
# --include-tasks Include tasks.md in AVAILABLE_DOCS list
|
|
14
|
+
# --paths-only Only output path variables (no validation)
|
|
15
|
+
# --help, -h Show help message
|
|
16
|
+
#
|
|
17
|
+
# OUTPUTS:
|
|
18
|
+
# JSON mode: {"FEATURE_DIR":"...", "AVAILABLE_DOCS":["..."]}
|
|
19
|
+
# Text mode: FEATURE_DIR:... \n AVAILABLE_DOCS: \n ✓/✗ file.md
|
|
20
|
+
# Paths only: REPO_ROOT: ... \n BRANCH: ... \n FEATURE_DIR: ... etc.
|
|
21
|
+
|
|
22
|
+
set -e
|
|
23
|
+
|
|
24
|
+
# Parse command line arguments
|
|
25
|
+
JSON_MODE=false
|
|
26
|
+
REQUIRE_TASKS=false
|
|
27
|
+
INCLUDE_TASKS=false
|
|
28
|
+
PATHS_ONLY=false
|
|
29
|
+
|
|
30
|
+
for arg in "$@"; do
|
|
31
|
+
case "$arg" in
|
|
32
|
+
--json)
|
|
33
|
+
JSON_MODE=true
|
|
34
|
+
;;
|
|
35
|
+
--require-tasks)
|
|
36
|
+
REQUIRE_TASKS=true
|
|
37
|
+
;;
|
|
38
|
+
--include-tasks)
|
|
39
|
+
INCLUDE_TASKS=true
|
|
40
|
+
;;
|
|
41
|
+
--paths-only)
|
|
42
|
+
PATHS_ONLY=true
|
|
43
|
+
;;
|
|
44
|
+
--help|-h)
|
|
45
|
+
cat << 'EOF'
|
|
46
|
+
Usage: check-prerequisites.sh [OPTIONS]
|
|
47
|
+
|
|
48
|
+
Consolidated prerequisite checking for Spec-Driven Development workflow.
|
|
49
|
+
|
|
50
|
+
OPTIONS:
|
|
51
|
+
--json Output in JSON format
|
|
52
|
+
--require-tasks Require tasks.md to exist (for implementation phase)
|
|
53
|
+
--include-tasks Include tasks.md in AVAILABLE_DOCS list
|
|
54
|
+
--paths-only Only output path variables (no prerequisite validation)
|
|
55
|
+
--help, -h Show this help message
|
|
56
|
+
|
|
57
|
+
EXAMPLES:
|
|
58
|
+
# Check task prerequisites (plan.md required)
|
|
59
|
+
./check-prerequisites.sh --json
|
|
60
|
+
|
|
61
|
+
# Check implementation prerequisites (plan.md + tasks.md required)
|
|
62
|
+
./check-prerequisites.sh --json --require-tasks --include-tasks
|
|
63
|
+
|
|
64
|
+
# Get feature paths only (no validation)
|
|
65
|
+
./check-prerequisites.sh --paths-only
|
|
66
|
+
|
|
67
|
+
EOF
|
|
68
|
+
exit 0
|
|
69
|
+
;;
|
|
70
|
+
*)
|
|
71
|
+
echo "ERROR: Unknown option '$arg'. Use --help for usage information." >&2
|
|
72
|
+
exit 1
|
|
73
|
+
;;
|
|
74
|
+
esac
|
|
75
|
+
done
|
|
76
|
+
|
|
77
|
+
# Source common functions
|
|
78
|
+
SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
79
|
+
source "$SCRIPT_DIR/common.sh"
|
|
80
|
+
|
|
81
|
+
# Get feature paths
|
|
82
|
+
_paths_output=$(get_feature_paths) || { echo "ERROR: Failed to resolve feature paths" >&2; exit 1; }
|
|
83
|
+
eval "$_paths_output"
|
|
84
|
+
unset _paths_output
|
|
85
|
+
|
|
86
|
+
# If paths-only mode, output paths and exit (no validation)
|
|
87
|
+
if $PATHS_ONLY; then
|
|
88
|
+
if $JSON_MODE; then
|
|
89
|
+
# Minimal JSON paths payload (no validation performed)
|
|
90
|
+
if has_jq; then
|
|
91
|
+
jq -cn \
|
|
92
|
+
--arg repo_root "$REPO_ROOT" \
|
|
93
|
+
--arg branch "$CURRENT_BRANCH" \
|
|
94
|
+
--arg feature_dir "$FEATURE_DIR" \
|
|
95
|
+
--arg feature_spec "$FEATURE_SPEC" \
|
|
96
|
+
--arg impl_plan "$IMPL_PLAN" \
|
|
97
|
+
--arg tasks "$TASKS" \
|
|
98
|
+
'{REPO_ROOT:$repo_root,BRANCH:$branch,FEATURE_DIR:$feature_dir,FEATURE_SPEC:$feature_spec,IMPL_PLAN:$impl_plan,TASKS:$tasks}'
|
|
99
|
+
else
|
|
100
|
+
printf '{"REPO_ROOT":"%s","BRANCH":"%s","FEATURE_DIR":"%s","FEATURE_SPEC":"%s","IMPL_PLAN":"%s","TASKS":"%s"}\n' \
|
|
101
|
+
"$(json_escape "$REPO_ROOT")" "$(json_escape "$CURRENT_BRANCH")" "$(json_escape "$FEATURE_DIR")" "$(json_escape "$FEATURE_SPEC")" "$(json_escape "$IMPL_PLAN")" "$(json_escape "$TASKS")"
|
|
102
|
+
fi
|
|
103
|
+
else
|
|
104
|
+
echo "REPO_ROOT: $REPO_ROOT"
|
|
105
|
+
echo "BRANCH: $CURRENT_BRANCH"
|
|
106
|
+
echo "FEATURE_DIR: $FEATURE_DIR"
|
|
107
|
+
echo "FEATURE_SPEC: $FEATURE_SPEC"
|
|
108
|
+
echo "IMPL_PLAN: $IMPL_PLAN"
|
|
109
|
+
echo "TASKS: $TASKS"
|
|
110
|
+
fi
|
|
111
|
+
exit 0
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
# Validate required directories and files
|
|
115
|
+
if [[ ! -d "$FEATURE_DIR" ]]; then
|
|
116
|
+
echo "ERROR: Feature directory not found: $FEATURE_DIR" >&2
|
|
117
|
+
echo "Run /aw-spec-specify first to create the feature structure." >&2
|
|
118
|
+
exit 1
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
if [[ ! -f "$IMPL_PLAN" ]]; then
|
|
122
|
+
echo "ERROR: plan.md not found in $FEATURE_DIR" >&2
|
|
123
|
+
echo "Run /aw-spec-plan first to create the implementation plan." >&2
|
|
124
|
+
exit 1
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
# Check for tasks.md if required
|
|
128
|
+
if $REQUIRE_TASKS && [[ ! -f "$TASKS" ]]; then
|
|
129
|
+
echo "ERROR: tasks.md not found in $FEATURE_DIR" >&2
|
|
130
|
+
echo "Run /aw-spec-tasks first to create the task list." >&2
|
|
131
|
+
exit 1
|
|
132
|
+
fi
|
|
133
|
+
|
|
134
|
+
# Build list of available documents
|
|
135
|
+
docs=()
|
|
136
|
+
|
|
137
|
+
# Always check these optional docs
|
|
138
|
+
[[ -f "$RESEARCH" ]] && docs+=("research.md")
|
|
139
|
+
[[ -f "$DATA_MODEL" ]] && docs+=("data-model.md")
|
|
140
|
+
|
|
141
|
+
# Check contracts directory (only if it exists and has files)
|
|
142
|
+
if [[ -d "$CONTRACTS_DIR" ]] && [[ -n "$(ls -A "$CONTRACTS_DIR" 2>/dev/null)" ]]; then
|
|
143
|
+
docs+=("contracts/")
|
|
144
|
+
fi
|
|
145
|
+
|
|
146
|
+
[[ -f "$QUICKSTART" ]] && docs+=("quickstart.md")
|
|
147
|
+
|
|
148
|
+
# Include tasks.md if requested and it exists
|
|
149
|
+
if $INCLUDE_TASKS && [[ -f "$TASKS" ]]; then
|
|
150
|
+
docs+=("tasks.md")
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
# Output results
|
|
154
|
+
if $JSON_MODE; then
|
|
155
|
+
# Build JSON array of documents
|
|
156
|
+
if has_jq; then
|
|
157
|
+
if [[ ${#docs[@]} -eq 0 ]]; then
|
|
158
|
+
json_docs="[]"
|
|
159
|
+
else
|
|
160
|
+
json_docs=$(printf '%s\n' "${docs[@]}" | jq -R . | jq -s .)
|
|
161
|
+
fi
|
|
162
|
+
jq -cn \
|
|
163
|
+
--arg feature_dir "$FEATURE_DIR" \
|
|
164
|
+
--argjson docs "$json_docs" \
|
|
165
|
+
'{FEATURE_DIR:$feature_dir,AVAILABLE_DOCS:$docs}'
|
|
166
|
+
else
|
|
167
|
+
if [[ ${#docs[@]} -eq 0 ]]; then
|
|
168
|
+
json_docs="[]"
|
|
169
|
+
else
|
|
170
|
+
json_docs=$(for d in "${docs[@]}"; do printf '"%s",' "$(json_escape "$d")"; done)
|
|
171
|
+
json_docs="[${json_docs%,}]"
|
|
172
|
+
fi
|
|
173
|
+
printf '{"FEATURE_DIR":"%s","AVAILABLE_DOCS":%s}\n' "$(json_escape "$FEATURE_DIR")" "$json_docs"
|
|
174
|
+
fi
|
|
175
|
+
else
|
|
176
|
+
# Text output
|
|
177
|
+
echo "FEATURE_DIR:$FEATURE_DIR"
|
|
178
|
+
echo "AVAILABLE_DOCS:"
|
|
179
|
+
|
|
180
|
+
# Show status of each potential document
|
|
181
|
+
check_file "$RESEARCH" "research.md"
|
|
182
|
+
check_file "$DATA_MODEL" "data-model.md"
|
|
183
|
+
check_dir "$CONTRACTS_DIR" "contracts/"
|
|
184
|
+
check_file "$QUICKSTART" "quickstart.md"
|
|
185
|
+
|
|
186
|
+
if $INCLUDE_TASKS; then
|
|
187
|
+
check_file "$TASKS" "tasks.md"
|
|
188
|
+
fi
|
|
189
|
+
fi
|