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,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "aw-spec-addcomponent"
|
|
3
|
+
description: "Add an opt-in AppWeaver framework component to the project: pick a component from docs/components/, choose one or more implementations from its integration.md catalog, and wire the matching code in."
|
|
4
|
+
argument-hint: "Optional component folder name to select directly (e.g. Email)"
|
|
5
|
+
compatibility: "Requires aw-spec project structure with a docs/components/ directory whose subfolders each contain an integration.md runbook"
|
|
6
|
+
metadata:
|
|
7
|
+
author: "github-aw-spec"
|
|
8
|
+
source: "local"
|
|
9
|
+
user-invocable: true
|
|
10
|
+
disable-model-invocation: false
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## User Input
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
$ARGUMENTS
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The text the user typed after `/aw-spec-addcomponent` (if any) is an optional component folder name
|
|
21
|
+
to select directly (e.g. `Email`). If it matches a folder under `docs/components/`, skip the
|
|
22
|
+
component-selection prompt; otherwise fall through to interactive selection.
|
|
23
|
+
|
|
24
|
+
## Purpose
|
|
25
|
+
|
|
26
|
+
Add an **opt-in AppWeaver framework component** (Email, Jobs, QrGenerator, …) to the current
|
|
27
|
+
project. Each component lives in its own folder under `docs/components/` and ships two
|
|
28
|
+
agent-readable files: `README.md` (the contract) and `integration.md` (an **ordered agent
|
|
29
|
+
runbook**). This command discovers the available components, lets the developer pick **one**, then
|
|
30
|
+
lets them pick **one or more implementations** from that component's catalog, and finally executes
|
|
31
|
+
the component's own `integration.md` runbook to add the required code.
|
|
32
|
+
|
|
33
|
+
This command is the entry point; the per-component `integration.md` is the authority on *what code
|
|
34
|
+
to add*. Always defer to the selected component's runbook for the actual edits, package versions,
|
|
35
|
+
registration scaffold, and verification steps — do not invent integration steps from memory.
|
|
36
|
+
|
|
37
|
+
## Outline
|
|
38
|
+
|
|
39
|
+
1. **Discover candidate components.** List the immediate **subdirectories** of `docs/components/`
|
|
40
|
+
(directories only — ignore loose files such as `README.md`). This is the set of selectable
|
|
41
|
+
components.
|
|
42
|
+
- If `docs/components/` does not exist or has **no** subdirectories, report that no components
|
|
43
|
+
are available, point the user at `docs/components/README.md` for the expected layout, and
|
|
44
|
+
**stop** without changing anything.
|
|
45
|
+
- A component folder is only valid if it contains an `integration.md`. Skip (and note) any
|
|
46
|
+
subfolder missing one.
|
|
47
|
+
|
|
48
|
+
2. **Direct argument (optional).** If the user passed an argument:
|
|
49
|
+
- If it exactly matches one of the discovered folder names, treat that as the chosen component
|
|
50
|
+
and skip to step 4.
|
|
51
|
+
- If it does not match any folder, note the mismatch, list the available names, and fall through
|
|
52
|
+
to the interactive selection in step 3.
|
|
53
|
+
|
|
54
|
+
3. **Select the component (single-select).** Present the candidate components with the
|
|
55
|
+
`AskUserQuestion` tool (single-select, `multiSelect: false`). Use each folder name as the option
|
|
56
|
+
label and, if cheaply available, the one-line "Use when…" summary from
|
|
57
|
+
`docs/components/README.md` as the option description.
|
|
58
|
+
- If **more than 4** components exist, split across multiple `AskUserQuestion` questions/calls
|
|
59
|
+
(≤4 options per question).
|
|
60
|
+
- If **exactly one** component exists, ask a confirmation — *"Add component '<name>'?"* with
|
|
61
|
+
options **"Add '<name>'"** and **"Cancel"**.
|
|
62
|
+
- If the user cancels (or interactive questions cannot be asked and no valid argument was given),
|
|
63
|
+
**stop** without changing anything.
|
|
64
|
+
|
|
65
|
+
4. **Load the component runbook.** Read `docs/components/<chosen>/integration.md` and, when it
|
|
66
|
+
references it, `docs/components/<chosen>/README.md`. Locate the **"Implementation catalog
|
|
67
|
+
(selection list)"** section — its table rows are the selectable implementations. Each row's
|
|
68
|
+
`Key` is the implementation identifier; capture each Key plus its human description for the
|
|
69
|
+
prompt.
|
|
70
|
+
- If `integration.md` is missing or has no implementation catalog, report that the component is
|
|
71
|
+
not integrable via this command and **stop**.
|
|
72
|
+
|
|
73
|
+
5. **Select implementation(s) (multi-select).** Present the catalog rows with `AskUserQuestion`,
|
|
74
|
+
`multiSelect: true`. Use the `Key` as the option label and the row's "Implementation"/"Best for"
|
|
75
|
+
text as the description.
|
|
76
|
+
- If the catalog has a **single** row, tell the user it is the only available implementation and
|
|
77
|
+
ask them to confirm it (do not invent others).
|
|
78
|
+
- Honor any **grouping / selection rules** the component's `integration.md` states for reading
|
|
79
|
+
the answer (e.g. Jobs: pick exactly one Group A store, optionally one Group B status store).
|
|
80
|
+
If more rows exist than fit one prompt, split across multiple `AskUserQuestion` calls.
|
|
81
|
+
|
|
82
|
+
6. **Empty selection → exit cleanly.** If the user submits with **nothing selected** (or cancels
|
|
83
|
+
the implementation prompt), do **not** modify the project. Report that no implementation was
|
|
84
|
+
chosen, name the component, and tell them they can re-run `/aw-spec-addcomponent` any time. Then
|
|
85
|
+
**stop**.
|
|
86
|
+
|
|
87
|
+
7. **Add the code (one or more selected).** Execute the chosen component's `integration.md` runbook
|
|
88
|
+
**in order** for the selected implementation(s):
|
|
89
|
+
- Resolve the **host/startup project** the runbook targets — the single project that owns
|
|
90
|
+
`Program.cs` + the ASP.NET Core web SDK (`<App>.Service` for the Vertical Slice foundation,
|
|
91
|
+
`<App>.API` for the Modular Monolith foundation, or another name in a future template). **Find it
|
|
92
|
+
by locating `Program.cs`, not by assuming a fixed name.** These foundations have **no** separate
|
|
93
|
+
`…Application` / `…Infrastructure` project — package references, registration, and
|
|
94
|
+
`appsettings.json` all target this one project.
|
|
95
|
+
- Apply the runbook's **"Common steps"** once.
|
|
96
|
+
- Apply each selected implementation's **block** (package version in
|
|
97
|
+
`Directory.Packages.props`, `PackageReference` without `Version=`, registration line, config).
|
|
98
|
+
- Set `options.Provider` per the runbook (when multiple implementations are selected, follow the
|
|
99
|
+
runbook's rule for choosing the default/active provider — ask a single-select follow-up if it
|
|
100
|
+
requires one).
|
|
101
|
+
- Honor the cross-cutting rules in `docs/components/README.md` (R0.1–R0.5, incl. R0.2a): versions
|
|
102
|
+
only in `Directory.Packages.props`; register in the host/startup project resolved via `Program.cs`
|
|
103
|
+
(R0.2 — its `Extensions/InfrastructureServiceRegistration.cs`/`AddInfrastructure` if present,
|
|
104
|
+
else `Program.cs`); inject the abstraction; always set `options.Provider`; never commit secrets.
|
|
105
|
+
- **Register in both startup paths when they exist (R0.2a).** If the host project splits
|
|
106
|
+
registration into `AddInfrastructure` (`Extensions/InfrastructureServiceRegistration.cs`) **and**
|
|
107
|
+
`AddAspireInfrastructure` (`Extensions/AspireInfrastructureExtensions.cs`) — the
|
|
108
|
+
`if (isAspire) AddAspireInfrastructure(...) else AddInfrastructure(...)` switch in `Program.cs` —
|
|
109
|
+
add the component's registration to **both** methods, not just `AddInfrastructure`. The block is
|
|
110
|
+
the same in each, differing only in provider-specific calls (connection strings, `UseSqlite` vs
|
|
111
|
+
`UseNpgsql`) that must match that method's existing provider. Registering in only one leaves the
|
|
112
|
+
component missing whenever the app runs in the other mode.
|
|
113
|
+
- Run any optional usage/feature-slice and schema steps only if the runbook calls for them or the
|
|
114
|
+
user asks.
|
|
115
|
+
|
|
116
|
+
8. **Verify and report.** Run the component runbook's **Verification** checklist (at minimum
|
|
117
|
+
`dotnet build`). Then report:
|
|
118
|
+
- the component added and which implementation key(s) were wired,
|
|
119
|
+
- the active provider,
|
|
120
|
+
- the files changed,
|
|
121
|
+
- any follow-ups the developer must do out-of-band (secrets, migrations, DDL).
|
|
122
|
+
|
|
123
|
+
## Done When
|
|
124
|
+
|
|
125
|
+
- [ ] A component was chosen, or nothing was changed (no components available, or the user
|
|
126
|
+
cancelled).
|
|
127
|
+
- [ ] If implementations were selected, the component's `integration.md` runbook was executed for
|
|
128
|
+
each, the project builds, and the changes were reported.
|
|
129
|
+
- [ ] If **no** implementation was selected, the project was left untouched and the user was told so.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aw-spec-agent-context-update
|
|
3
|
+
description: Refresh the managed AW-Spec section in the coding agent context file
|
|
4
|
+
compatibility: Requires aw-spec project structure with .aw-spec/ directory
|
|
5
|
+
metadata:
|
|
6
|
+
author: github-aw-spec
|
|
7
|
+
source: agent-context:commands/aw-spec.agent-context.update.md
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Update Coding Agent Context
|
|
11
|
+
|
|
12
|
+
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`).
|
|
13
|
+
|
|
14
|
+
## Behavior
|
|
15
|
+
|
|
16
|
+
The script reads the agent-context extension config at
|
|
17
|
+
`.aw-spec/extensions/agent-context/agent-context-config.yml` to discover:
|
|
18
|
+
|
|
19
|
+
- `context_file` — the path of the coding agent context file to manage.
|
|
20
|
+
- `context_markers.start` / `.end` — the delimiters surrounding the managed section. Defaults to `<!-- AW-SPEC START -->` and `<!-- AW-SPEC END -->` when the field is missing.
|
|
21
|
+
|
|
22
|
+
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`).
|
|
23
|
+
|
|
24
|
+
If `context_file` is empty or the file cannot be located, the command reports nothing to do and exits successfully.
|
|
25
|
+
|
|
26
|
+
## Execution
|
|
27
|
+
|
|
28
|
+
- **Bash**: `.aw-spec/extensions/agent-context/scripts/bash/update-agent-context.sh [plan_path]`
|
|
29
|
+
- **PowerShell**: `.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1 [plan_path]`
|
|
30
|
+
|
|
31
|
+
When `plan_path` is omitted, the script auto-detects the most recently modified `specs/*/plan.md`.
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "aw-spec-analyze"
|
|
3
|
+
description: "Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation."
|
|
4
|
+
argument-hint: "Optional focus areas for analysis"
|
|
5
|
+
compatibility: "Requires aw-spec project structure with .aw-spec/ directory"
|
|
6
|
+
metadata:
|
|
7
|
+
author: "github-aw-spec"
|
|
8
|
+
source: "templates/commands/analyze.md"
|
|
9
|
+
user-invocable: true
|
|
10
|
+
disable-model-invocation: false
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## User Input
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
$ARGUMENTS
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
You **MUST** consider the user input before proceeding (if not empty).
|
|
21
|
+
|
|
22
|
+
## Context Reuse (cross-command dedup)
|
|
23
|
+
|
|
24
|
+
**Skip Read-ing any file already in this conversation.** Before loading a standards/domain/template/spec file this command names, check whether it is already in context (loaded earlier here or by a prior `/aw-spec-*` command). If present and unchanged, reuse it and **skip the Read** — only Read files not yet loaded. A file already in context still counts as loaded; this just avoids the redundant re-read.
|
|
25
|
+
|
|
26
|
+
## Auto-Loaded Engineering Standards (Required Context)
|
|
27
|
+
|
|
28
|
+
**Before doing anything else in this command, load the project engineering-standards files listed below into context using the Read tool.** These were previously supplied manually as `@docs/...` mentions; they are now loaded automatically so the user does not need to pass them. Rules:
|
|
29
|
+
|
|
30
|
+
- Read each file below **before** starting the Pre-Execution Checks / analysis. Treat their contents as authoritative engineering standards for this command, second only to `.aw-spec/memory/constitution.md`.
|
|
31
|
+
- If a listed file does not exist, skip it silently and continue — do **not** error and do **not** ask the user to provide it.
|
|
32
|
+
- This is the **domain-agnostic technical** set, so the framework is reusable across domains. Domain-specific rule files (e.g. healthcare FHIR/HL7/PHI) are **not** part of this set — they are offered separately in the **Domain Rule-File Selection** section below (sourced from `comandrulemap.md`). You can also add any extra file directly with an `@` mention.
|
|
33
|
+
|
|
34
|
+
Standards for `/aw-spec-analyze`:
|
|
35
|
+
- docs/security/auditing.md
|
|
36
|
+
- docs/governance/coding-standards.md
|
|
37
|
+
- docs/glossary/ai-rules.md
|
|
38
|
+
|
|
39
|
+
## Domain Rule-File Selection (interactive)
|
|
40
|
+
|
|
41
|
+
After the technical standards above are loaded, and **before** the Pre-Execution Checks, resolve the active domain and ask the user which **domain** rule files to load for this command:
|
|
42
|
+
|
|
43
|
+
1. **Resolve the active domain.** Read `.aw-spec/domain.json` and take its `domain` value — the active domain-specs folder name. The candidate domain rule files are the bullet list under the `## /aw-spec-analyze` heading in `docs/domainspecs/<domain>/comandrulemap.md`.
|
|
44
|
+
2. **Domain gate (missing domain or rules).** If `.aw-spec/domain.json` is absent or its `domain` is empty, **or** `docs/domainspecs/<domain>/comandrulemap.md` does not exist:
|
|
45
|
+
- Ask one single-select question with the AskUserQuestion tool — *"Domain is not set or its rule files are missing (state which: no domain set / domain '<domain>' has no comandrulemap.md). Continue without domain rules?"* — with options **"Continue (technical only)"** and **"Exit"**.
|
|
46
|
+
- **Continue (technical only)** → skip steps 3-5 and proceed with only the auto-loaded technical standards (plus any `@`-mentioned files).
|
|
47
|
+
- **Exit** → stop the command **immediately** with no side effects: do **not** run the Pre-Execution Checks, hooks, Outline, or any later step, and create/modify nothing. Tell the user to run `/aw-spec-select-domain` (or fix the domain folder) and re-run.
|
|
48
|
+
- If interactive questions cannot be asked (non-interactive/automated run), default to **Continue (technical only)**.
|
|
49
|
+
- Exception: if `comandrulemap.md` exists but has **no entries under this command's heading**, this is **not** a gate trigger — load no domain files for this command and continue normally to the Pre-Execution Checks.
|
|
50
|
+
3. **Show a selection box** using the AskUserQuestion tool:
|
|
51
|
+
- Ask one single-select question — *"Domain rule files for /aw-spec-analyze:"* — with options **"Select all (recommended)"**, **"Pick a subset"**, and **"None (technical only)"**.
|
|
52
|
+
- If the user chooses **"Pick a subset"**, follow up with **multi-select** questions whose options are the individual candidate files so the user can tick the ones they want. AskUserQuestion allows ≤4 options per question and ≤4 questions per call, so split the candidates into groups of ≤4 (by category: architecture overlays, clinical domain, security overlays, governance overlays, glossary) across as many calls as needed.
|
|
53
|
+
- If interactive questions cannot be asked (non-interactive or automated run), skip the prompt and default to **Select all**.
|
|
54
|
+
4. **Load the selection.** Read every file the user selected (the full list for "Select all"; nothing extra for "None"). If any selected file does not exist on disk, skip it silently and continue — do not error.
|
|
55
|
+
5. **Final context set** = the always-loaded technical standards (section above) **+** the domain files selected here **+** any files the user passed via `@` mention in their command. The `@`-mentioned files are always loaded in addition, whether or not they appear in the candidate list, and are never removed by a "None"/subset choice.
|
|
56
|
+
6. Proceed to the Pre-Execution Checks only after the selected files are loaded.
|
|
57
|
+
|
|
58
|
+
## Pre-Execution Checks
|
|
59
|
+
|
|
60
|
+
**Check for extension hooks (before analysis)**:
|
|
61
|
+
- Check if `.aw-spec/extensions.yml` exists in the project root.
|
|
62
|
+
- If it exists, read it and look for entries under the `hooks.before_analyze` key
|
|
63
|
+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
|
|
64
|
+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
|
|
65
|
+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
|
|
66
|
+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
|
|
67
|
+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
|
|
68
|
+
- When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `aw-spec.git.commit` → `/aw-spec-git-commit`.
|
|
69
|
+
- For each executable hook, output the following based on its `optional` flag:
|
|
70
|
+
- **Optional hook** (`optional: true`):
|
|
71
|
+
```
|
|
72
|
+
## Extension Hooks
|
|
73
|
+
|
|
74
|
+
**Optional Pre-Hook**: {extension}
|
|
75
|
+
Command: `/{command}`
|
|
76
|
+
Description: {description}
|
|
77
|
+
|
|
78
|
+
Prompt: {prompt}
|
|
79
|
+
To execute: `/{command}`
|
|
80
|
+
```
|
|
81
|
+
- **Mandatory hook** (`optional: false`):
|
|
82
|
+
```
|
|
83
|
+
## Extension Hooks
|
|
84
|
+
|
|
85
|
+
**Automatic Pre-Hook**: {extension}
|
|
86
|
+
Executing: `/{command}`
|
|
87
|
+
EXECUTE_COMMAND: {command}
|
|
88
|
+
|
|
89
|
+
Wait for the result of the hook command before proceeding to the Goal.
|
|
90
|
+
```
|
|
91
|
+
- If no hooks are registered or `.aw-spec/extensions.yml` does not exist, skip silently
|
|
92
|
+
|
|
93
|
+
## Goal
|
|
94
|
+
|
|
95
|
+
Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/aw-spec-tasks` has successfully produced a complete `tasks.md`.
|
|
96
|
+
|
|
97
|
+
## Operating Constraints
|
|
98
|
+
|
|
99
|
+
**STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
|
|
100
|
+
|
|
101
|
+
**Constitution Authority**: The project constitution (`.aw-spec/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/aw-spec-analyze`.
|
|
102
|
+
|
|
103
|
+
## Execution Steps
|
|
104
|
+
|
|
105
|
+
### 1. Initialize Analysis Context
|
|
106
|
+
|
|
107
|
+
Run `.aw-spec/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
|
|
108
|
+
|
|
109
|
+
- SPEC = FEATURE_DIR/spec.md
|
|
110
|
+
- PLAN = FEATURE_DIR/plan.md
|
|
111
|
+
- TASKS = FEATURE_DIR/tasks.md
|
|
112
|
+
|
|
113
|
+
Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
|
|
114
|
+
For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
|
|
115
|
+
|
|
116
|
+
### 2. Load Artifacts (Progressive Disclosure)
|
|
117
|
+
|
|
118
|
+
Load only the minimal necessary context from each artifact:
|
|
119
|
+
|
|
120
|
+
**From spec.md:**
|
|
121
|
+
|
|
122
|
+
- Overview/Context
|
|
123
|
+
- Functional Requirements
|
|
124
|
+
- Success Criteria (measurable outcomes — e.g., performance, security, availability, user success, business impact)
|
|
125
|
+
- User Stories
|
|
126
|
+
- Edge Cases (if present)
|
|
127
|
+
|
|
128
|
+
**From plan.md:**
|
|
129
|
+
|
|
130
|
+
- Architecture/stack choices
|
|
131
|
+
- Data Model references
|
|
132
|
+
- Phases
|
|
133
|
+
- Technical constraints
|
|
134
|
+
|
|
135
|
+
**From tasks.md:**
|
|
136
|
+
|
|
137
|
+
- Task IDs
|
|
138
|
+
- Descriptions
|
|
139
|
+
- Phase grouping
|
|
140
|
+
- Parallel markers [P]
|
|
141
|
+
- Referenced file paths
|
|
142
|
+
|
|
143
|
+
**From constitution:**
|
|
144
|
+
|
|
145
|
+
- Load `.aw-spec/memory/constitution.md` for principle validation
|
|
146
|
+
|
|
147
|
+
### 3. Build Semantic Models
|
|
148
|
+
|
|
149
|
+
Create internal representations (do not include raw artifacts in output):
|
|
150
|
+
|
|
151
|
+
- **Requirements inventory**: For each Functional Requirement (FR-###) and Success Criterion (SC-###), record a stable key. Use the explicit FR-/SC- identifier as the primary key when present, and optionally also derive an imperative-phrase slug for readability (e.g., "User can upload file" → `user-can-upload-file`). Include only Success Criteria items that require buildable work (e.g., load-testing infrastructure, security audit tooling), and exclude post-launch outcome metrics and business KPIs (e.g., "Reduce support tickets by 50%").
|
|
152
|
+
- **User story/action inventory**: Discrete user actions with acceptance criteria
|
|
153
|
+
- **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
|
|
154
|
+
- **Constitution rule set**: Extract principle names and MUST/SHOULD normative statements
|
|
155
|
+
|
|
156
|
+
### 4. Detection Passes (Token-Efficient Analysis)
|
|
157
|
+
|
|
158
|
+
Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary.
|
|
159
|
+
|
|
160
|
+
#### A. Duplication Detection
|
|
161
|
+
|
|
162
|
+
- Identify near-duplicate requirements
|
|
163
|
+
- Mark lower-quality phrasing for consolidation
|
|
164
|
+
|
|
165
|
+
#### B. Ambiguity Detection
|
|
166
|
+
|
|
167
|
+
- Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria
|
|
168
|
+
- Flag unresolved placeholders (TODO, TKTK, ???, `<placeholder>`, etc.)
|
|
169
|
+
|
|
170
|
+
#### C. Underspecification
|
|
171
|
+
|
|
172
|
+
- Requirements with verbs but missing object or measurable outcome
|
|
173
|
+
- User stories missing acceptance criteria alignment
|
|
174
|
+
- Tasks referencing files or components not defined in spec/plan
|
|
175
|
+
|
|
176
|
+
#### D. Constitution Alignment
|
|
177
|
+
|
|
178
|
+
- Any requirement or plan element conflicting with a MUST principle
|
|
179
|
+
- Missing mandated sections or quality gates from constitution
|
|
180
|
+
|
|
181
|
+
#### E. Coverage Gaps
|
|
182
|
+
|
|
183
|
+
- Requirements with zero associated tasks
|
|
184
|
+
- Tasks with no mapped requirement/story
|
|
185
|
+
- Success Criteria requiring buildable work (performance, security, availability) not reflected in tasks
|
|
186
|
+
|
|
187
|
+
#### F. Inconsistency
|
|
188
|
+
|
|
189
|
+
- Terminology drift (same concept named differently across files)
|
|
190
|
+
- Data entities referenced in plan but absent in spec (or vice versa)
|
|
191
|
+
- Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)
|
|
192
|
+
- Conflicting requirements (e.g., one requires Next.js while other specifies Vue)
|
|
193
|
+
|
|
194
|
+
### 5. Severity Assignment
|
|
195
|
+
|
|
196
|
+
Use this heuristic to prioritize findings:
|
|
197
|
+
|
|
198
|
+
- **CRITICAL**: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality
|
|
199
|
+
- **HIGH**: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion
|
|
200
|
+
- **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case
|
|
201
|
+
- **LOW**: Style/wording improvements, minor redundancy not affecting execution order
|
|
202
|
+
|
|
203
|
+
### 6. Produce Compact Analysis Report
|
|
204
|
+
|
|
205
|
+
Output a Markdown report (no file writes) with the following structure:
|
|
206
|
+
|
|
207
|
+
## Specification Analysis Report
|
|
208
|
+
|
|
209
|
+
| ID | Category | Severity | Location(s) | Summary | Recommendation |
|
|
210
|
+
|----|----------|----------|-------------|---------|----------------|
|
|
211
|
+
| A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |
|
|
212
|
+
|
|
213
|
+
(Add one row per finding; generate stable IDs prefixed by category initial.)
|
|
214
|
+
|
|
215
|
+
**Coverage Summary Table:**
|
|
216
|
+
|
|
217
|
+
| Requirement Key | Has Task? | Task IDs | Notes |
|
|
218
|
+
|-----------------|-----------|----------|-------|
|
|
219
|
+
|
|
220
|
+
**Constitution Alignment Issues:** (if any)
|
|
221
|
+
|
|
222
|
+
**Unmapped Tasks:** (if any)
|
|
223
|
+
|
|
224
|
+
**Metrics:**
|
|
225
|
+
|
|
226
|
+
- Total Requirements
|
|
227
|
+
- Total Tasks
|
|
228
|
+
- Coverage % (requirements with >=1 task)
|
|
229
|
+
- Ambiguity Count
|
|
230
|
+
- Duplication Count
|
|
231
|
+
- Critical Issues Count
|
|
232
|
+
|
|
233
|
+
### 7. Provide Next Actions
|
|
234
|
+
|
|
235
|
+
At end of report, output a concise Next Actions block:
|
|
236
|
+
|
|
237
|
+
- If CRITICAL issues exist: Recommend resolving before `/aw-spec-implement`
|
|
238
|
+
- If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
|
|
239
|
+
- Provide explicit command suggestions: e.g., "Run /aw-spec-specify with refinement", "Run /aw-spec-plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'"
|
|
240
|
+
|
|
241
|
+
### 8. Offer Remediation
|
|
242
|
+
|
|
243
|
+
Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
|
|
244
|
+
|
|
245
|
+
### 9. Check for extension hooks
|
|
246
|
+
|
|
247
|
+
After reporting, check if `.aw-spec/extensions.yml` exists in the project root.
|
|
248
|
+
- If it exists, read it and look for entries under the `hooks.after_analyze` key
|
|
249
|
+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
|
|
250
|
+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
|
|
251
|
+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
|
|
252
|
+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
|
|
253
|
+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
|
|
254
|
+
- When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `aw-spec.git.commit` → `/aw-spec-git-commit`.
|
|
255
|
+
- For each executable hook, output the following based on its `optional` flag:
|
|
256
|
+
- **Optional hook** (`optional: true`):
|
|
257
|
+
```
|
|
258
|
+
## Extension Hooks
|
|
259
|
+
|
|
260
|
+
**Optional Hook**: {extension}
|
|
261
|
+
Command: `/{command}`
|
|
262
|
+
Description: {description}
|
|
263
|
+
|
|
264
|
+
Prompt: {prompt}
|
|
265
|
+
To execute: `/{command}`
|
|
266
|
+
```
|
|
267
|
+
- **Mandatory hook** (`optional: false`):
|
|
268
|
+
```
|
|
269
|
+
## Extension Hooks
|
|
270
|
+
|
|
271
|
+
**Automatic Hook**: {extension}
|
|
272
|
+
Executing: `/{command}`
|
|
273
|
+
EXECUTE_COMMAND: {command}
|
|
274
|
+
```
|
|
275
|
+
- If no hooks are registered or `.aw-spec/extensions.yml` does not exist, skip silently
|
|
276
|
+
|
|
277
|
+
## Operating Principles
|
|
278
|
+
|
|
279
|
+
### Context Efficiency
|
|
280
|
+
|
|
281
|
+
- **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation
|
|
282
|
+
- **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis
|
|
283
|
+
- **Token-efficient output**: Limit findings table to 50 rows; summarize overflow
|
|
284
|
+
- **Deterministic results**: Rerunning without changes should produce consistent IDs and counts
|
|
285
|
+
|
|
286
|
+
### Analysis Guidelines
|
|
287
|
+
|
|
288
|
+
- **NEVER modify files** (this is read-only analysis)
|
|
289
|
+
- **NEVER hallucinate missing sections** (if absent, report them accurately)
|
|
290
|
+
- **Prioritize constitution violations** (these are always CRITICAL)
|
|
291
|
+
- **Use examples over exhaustive rules** (cite specific instances, not generic patterns)
|
|
292
|
+
- **Report zero issues gracefully** (emit success report with coverage statistics)
|
|
293
|
+
|
|
294
|
+
## Context
|
|
295
|
+
|
|
296
|
+
$ARGUMENTS
|