aw-spec-cli 0.1.9 → 0.1.11

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.
Files changed (58) hide show
  1. package/assets/.appweaver/ORCH-DIALECT.md +17 -5
  2. package/assets/.appweaver/orchestrator/README.md +1 -1
  3. package/assets/.appweaver/orchestrator/adapters/claude_agent_sdk.py +2 -2
  4. package/assets/.appweaver/orchestrator/adapters/google_antigravity.py +28 -6
  5. package/assets/.appweaver/orchestrator/modules/delta-spec.orch.yaml +13 -1
  6. package/assets/.appweaver/orchestrator/orchestrator.py +126 -39
  7. package/assets/.appweaver/orchestrator/workflows/aw-spec-adopt.orch.yaml +5 -0
  8. package/assets/.appweaver/orchestrator/workflows/aw-spec-characterize.orch.yaml +1 -0
  9. package/assets/.appweaver/orchestrator/workflows/aw-spec-onboard.orch.yaml +1 -0
  10. package/assets/.appweaver/orchestrator/workflows/aw-spec-specify.orch.yaml +888 -141
  11. package/assets/.appweaver/scripts/bash/aw-spec-actions.sh +826 -16
  12. package/assets/.appweaver/scripts/powershell/aw-spec-actions.ps1 +780 -12
  13. package/assets/.appweaver/stack-profiles/java-spring.json +3 -3
  14. package/assets/.appweaver/templates/spec-template.md +73 -62
  15. package/assets/.appweaver/templates/story-template.md +107 -0
  16. package/assets/guardrails/technology/java-spring/ai-rules.md +505 -0
  17. package/assets/guardrails/technology/java-spring/api-versioning.md +782 -0
  18. package/assets/guardrails/technology/java-spring/authorization.md +618 -0
  19. package/assets/guardrails/technology/java-spring/clean-architecture.md +960 -0
  20. package/assets/guardrails/technology/java-spring/coding-standards.md +821 -0
  21. package/assets/guardrails/technology/java-spring/dependency-policy.md +91 -0
  22. package/assets/guardrails/technology/java-spring/domain-driven-design.md +467 -0
  23. package/assets/guardrails/technology/java-spring/domain_abstraction.md +424 -0
  24. package/assets/guardrails/technology/java-spring/folder-structure.md +1537 -0
  25. package/assets/guardrails/technology/java-spring/global_exception_handler.md +247 -0
  26. package/assets/guardrails/technology/java-spring/logging.md +215 -0
  27. package/assets/guardrails/technology/java-spring/modular-monolith.md +77 -0
  28. package/assets/guardrails/technology/java-spring/persistence.md +316 -0
  29. package/assets/guardrails/technology/java-spring/problem_details.md +98 -0
  30. package/assets/guardrails/technology/java-spring/result_mapping.md +48 -0
  31. package/assets/guardrails/technology/java-spring/technology-constitution.md +168 -0
  32. package/assets/guardrails/technology/java-spring/testing.md +601 -0
  33. package/assets/guardrails/technology/java-spring/zero-trust.md +210 -0
  34. package/dist/index.js +0 -0
  35. package/dist/utils/config.d.ts +22 -0
  36. package/dist/utils/config.d.ts.map +1 -0
  37. package/dist/utils/config.js +76 -0
  38. package/dist/utils/config.js.map +1 -0
  39. package/dist/utils/copy-assets.d.ts.map +1 -1
  40. package/dist/utils/copy-assets.js +4 -11
  41. package/dist/utils/copy-assets.js.map +1 -1
  42. package/dist/utils/paths.d.ts.map +1 -1
  43. package/dist/utils/paths.js +11 -7
  44. package/dist/utils/paths.js.map +1 -1
  45. package/package.json +2 -1
  46. package/assets/guardrails/technology/java-spring/README.md +0 -62
  47. package/dist/commands/update.d.ts +0 -3
  48. package/dist/commands/update.d.ts.map +0 -1
  49. package/dist/commands/update.js +0 -142
  50. package/dist/commands/update.js.map +0 -1
  51. package/dist/utils/manifest.d.ts +0 -31
  52. package/dist/utils/manifest.d.ts.map +0 -1
  53. package/dist/utils/manifest.js +0 -91
  54. package/dist/utils/manifest.js.map +0 -1
  55. package/dist/utils/update-engine.d.ts +0 -52
  56. package/dist/utils/update-engine.d.ts.map +0 -1
  57. package/dist/utils/update-engine.js +0 -203
  58. package/dist/utils/update-engine.js.map +0 -1
@@ -6,9 +6,9 @@
6
6
  "ecosystem": "java",
7
7
  "root": "src/main/java/",
8
8
  "run_from": "root",
9
- "build": "./mvnw package -DskipTests",
10
- "test": "./mvnw test",
11
- "run": "./mvnw spring-boot:run",
9
+ "build": "./mvn clean install",
10
+ "test": "./mvn test",
11
+ "run": "./mvn spring-boot:run",
12
12
  "detect": [
13
13
  "pom.xml",
14
14
  "build.gradle"
@@ -13,10 +13,18 @@
13
13
  <!--
14
14
  AGGREGATE = FEATURE. This spec covers ONE aggregate (e.g. Order) and is the
15
15
  single LIVING source of truth for its whole lifecycle. Every operation on it
16
- (CreateOrder, UpdateOrder, …) is a USER STORY below — NOT a separate feature.
17
- A later requirement is a new US-n added here as a delta (see .appweaver/changes/
18
- and delta-spec-template.md), never a new spec folder. One spec + one design.md
19
- (specs/[Aggregate]/design.md) — the DESIGN derives from THIS document.
16
+ (CreateOrder, UpdateOrder, …) is a REQUIREMENT below (FR-n) — NOT a separate
17
+ feature and NOT a user story. A later requirement is a new FR-n added here,
18
+ never a new spec folder. One spec + one design.md (specs/[Aggregate]/design.md)
19
+ — the DESIGN derives from THIS document.
20
+
21
+ THIS DOCUMENT HOLDS NO USER STORIES. A story is an execution SLICE over this
22
+ spec and lives beside it in stories/, citing the FR-/BR- ids it delivers. This
23
+ spec is authored ONCE and stories never merge back into it: when a story needs
24
+ the contract itself to change, update-spec folds it back through specify's
25
+ validate loop and appends a Change History row. Design and code trace to the
26
+ FR-/BR- ids here, never to a story id — which is what lets the backlog churn
27
+ without disturbing the design.
20
28
 
21
29
  Section order is intentional: establish the business need and scope, then the
22
30
  stable core the aggregate IS (requirements → rules → constraints → entities →
@@ -215,10 +223,10 @@
215
223
  State each as CHECKABLE, and cite the rule or principle it was lifted from.
216
224
  -->
217
225
 
218
- - **UX-001**: [Accessibility conformance — e.g. every user-facing surface MUST meet [standard, level]; every task in the User Stories is completable keyboard-only. — lifted from UX-II, ux/accessibility-standards.md]
226
+ - **UX-001**: [Accessibility conformance — e.g. every user-facing surface MUST meet [standard, level]; every task the requirements above describe is completable keyboard-only. — lifted from UX-II, ux/accessibility-standards.md]
219
227
  - **UX-002**: [Interaction states — e.g. every asynchronous operation MUST present its loading, empty, partial-failure, recovery and success states; no state leaves the user without a next action. — lifted from UX-IV, ux/interaction-states.md]
220
228
  - **UX-003**: [Content and language — e.g. user-facing text uses the ubiquitous language of Key Entities; every error names what happened and what to do next; regulated wording is reproduced verbatim. — lifted from UX-V, ux/content-design.md]
221
- - **UX-004**: [Journey integrity — e.g. each US-n is completable without leaving this aggregate's surface; destructive actions are confirmed and reversible. — lifted from ux/journey-mapping.md]
229
+ - **UX-004**: [Journey integrity — e.g. each FR-n is completable without leaving this aggregate's surface; destructive actions are confirmed and reversible. — lifted from ux/journey-mapping.md]
222
230
  - **UX-005**: [Responsiveness-as-a-limit — e.g. an interaction acknowledges input within [n] ms and shows progress past [n] s. A front-end bound; the server-side budget it depends on is CN-nnn.]
223
231
 
224
232
  ## Edge Cases & Exceptional Scenarios
@@ -232,54 +240,6 @@
232
240
  - What happens when [boundary condition, e.g., the same order is submitted twice]?
233
241
  - How does the system handle [error scenario, e.g., a referenced product no longer exists]?
234
242
 
235
- ## User Stories *(prioritized)*
236
-
237
- <!--
238
- Prioritized user journeys (P1 = most critical). Each MUST be INDEPENDENTLY
239
- TESTABLE — implementing just one still yields a viable slice of value that can be
240
- developed, tested, deployed, and demonstrated on its own.
241
-
242
- Give each a STABLE id (US-1, US-2, …); design sections trace to these ids. Each
243
- story exercises specific System Requirements / Business Rules — cite them so the
244
- spine (US ↔ FR/BR ↔ design ↔ code) stays exact. On this living spec, note when a
245
- story entered or changed: "Added: vX.Y (CR-…)" / "Modified: vX.Y (CR-…)".
246
- -->
247
-
248
- ### US-1 - [Brief Title] (Priority: P1) · _Added: v1.0_
249
-
250
- [Describe this user journey in plain language.]
251
-
252
- **Why this priority**: [The value and why it ranks here.]
253
-
254
- **Exercises**: [FR-001, FR-003, BR-001]
255
-
256
- **Acceptance Criteria**:
257
-
258
- 1. **Given** [initial state], **When** [action], **Then** [expected outcome]
259
- 2. **Given** [initial state], **When** [action], **Then** [expected outcome]
260
-
261
- **Independent Test**: [How this story is verified on its own and the value it delivers.]
262
-
263
- ---
264
-
265
- ### US-2 - [Brief Title] (Priority: P2) · _Added: v1.0_
266
-
267
- [Describe this user journey in plain language.]
268
-
269
- **Why this priority**: [The value and why it ranks here.]
270
-
271
- **Exercises**: [FR-…, BR-…]
272
-
273
- **Acceptance Criteria**:
274
-
275
- 1. **Given** [initial state], **When** [action], **Then** [expected outcome]
276
-
277
- **Independent Test**: [How this story is verified on its own.]
278
-
279
- ---
280
-
281
- [Add more user stories as needed (US-3, US-4, …), each with a priority and a stable id.]
282
-
283
243
  ## Success Criteria *(mandatory)*
284
244
 
285
245
  <!--
@@ -294,16 +254,67 @@
294
254
  - **SC-003**: [User-satisfaction metric, e.g., "90% of first-time users complete an order without assistance."]
295
255
  - **SC-004**: [Business metric, e.g., "Reduce order-related support tickets by 50%."]
296
256
 
257
+ ## Story Coverage
258
+
259
+ <!--
260
+ GENERATED — DO NOT HAND-EDIT. Everything between the two AW:COVERAGE markers is
261
+ rewritten wholesale from the stories/ directory, which is the source of truth: each
262
+ story's `exercises:` frontmatter says which requirements it delivers, and this table is
263
+ that relation read the other way round. Hand-edit it and your edit is gone at the next
264
+ write; change who delivers what by editing the story.
265
+
266
+ It answers the question the contract cannot answer about itself — who is building this,
267
+ and what is nobody building. A requirement with no story is a requirement nobody has
268
+ started; a requirement whose stories are all closed is DELIVERED, which is the rule
269
+ analyze-code and the pre-deploy gate key on. "Delivered" is never "a story closed" —
270
+ a follow-on may still carry the remainder.
271
+
272
+ Scoped to FR- and BR-, because those are the ids a story cites. The lifted sections
273
+ (CN-/DC-/IC-/UX-) are constraints the design and the gates trace, not slices of work.
274
+
275
+ Fenced out of the ledger ON PURPOSE. The sha256 that guards this document covers the
276
+ CONTRACT, and this section is not contract — it is a projection of the backlog. Were it
277
+ inside the hash, creating a story would look like an unledgered spec edit and refuse the
278
+ next update-stories; were it visible to the diff, adding a story would read as a
279
+ requirement change and mint a version row. So spec-check, spec-diff and ledger-append
280
+ all cut this block out before they look at anything.
281
+ -->
282
+
283
+ <!-- AW:COVERAGE:BEGIN -->
284
+ | Requirement | Open stories | Closed / cancelled |
285
+ |-------------|--------------|--------------------|
286
+ | _(none yet — run /appweaver update-stories to raise the backlog)_ | | |
287
+ <!-- AW:COVERAGE:END -->
288
+
297
289
  ## Change History
298
290
 
299
291
  <!--
300
- The living-truth ledger. Every applied change request appends a row here, carrying
301
- the version it ships as. finalize-delta writes the row when it merges the delta;
302
- close-delta then archives the CR, bumps the minor version in active_version.json and
303
- stamps that same number into this document's **Version** header — one mechanism, one
304
- stage, so header, row and active_version.json never disagree. Newest last.
292
+ The living-truth ledger, and the sync anchor between this spec and its story backlog.
293
+
294
+ Each row names the requirement ids that version touched. Every story records the spec
295
+ version it last synced at (spec_version: in its frontmatter), so a story is stale when
296
+ some row above its version names an id that story cites — one version comparison, no
297
+ per-requirement content hashing. update-stories reads the rows to refresh the backlog;
298
+ update-spec appends one when it folds a hand-edited story back into this document.
299
+
300
+ The ledger is hand-written, so it is guarded. active_version.json carries a sha256 of
301
+ this whole file as of the last ledger-aware write. A body that has changed while the
302
+ version stands still is a hand edit that skipped the ledger: update-stories and
303
+ check-stories refuse until a row is added, because otherwise every affected story goes
304
+ quietly stale and nothing says so.
305
+
306
+ Version numbers have a single writer, so the header, the newest row and
307
+ active_version.json never disagree: close-delta bumps the minor version in
308
+ active_version.json and stamps that same number into this document's **Version**
309
+ header. Newest last.
310
+
311
+ THE "Requirements changed" CELL IS GENERATED. specify computes it from a diff of the
312
+ document it just wrote — including the v1.0 row below, whose placeholder ids are
313
+ replaced with the ones the finished spec actually carries. A row that names the ids
314
+ somebody believed it changed is worth nothing to a story trying to find out whether it
315
+ is stale; only a row derived from the document is.
305
316
  -->
306
317
 
307
- | Version | Date | Change | User stories | CR |
308
- |---------|------|--------|--------------|-----|
309
- | v1.0 | [DATE] | Initial specification | US-1 | — |
318
+ | Version | Date | Change | Requirements changed | Stories |
319
+ |---------|------|--------|----------------------|---------|
320
+ | v1.0 | [DATE] | Initial specification | FR-001…FR-00n, BR-001…BR-00n | — |
@@ -0,0 +1,107 @@
1
+ ---
2
+ id: [Feature-NNN]
3
+ type: functional
4
+ status: open
5
+ title: [one line — the outcome this story delivers]
6
+ exercises: []
7
+ spec_version: [vN.N]
8
+ depends_on: []
9
+ follows:
10
+ work_item:
11
+ created: [DATE]
12
+ ---
13
+
14
+ <!--
15
+ USER STORY — one execution slice over a feature's spec.
16
+
17
+ Canonical home: specs/<Feature>/stories/<Feature-NNN>.md
18
+ Execution artefacts, once story-spec has run: specs/<Feature>/stories/<Feature-NNN>/
19
+
20
+ A story is a slice of work over a spec that is already written. It is NEVER a proposal
21
+ to change the spec — nothing here merges back into spec.md. When a story genuinely
22
+ needs the contract to change, update-spec folds it back through specify's
23
+ checklist -> clarify -> validate loop, and the spec's Change History gains a row.
24
+
25
+ ONE STORY, ONE FEATURE. A story whose design touches a second feature is failed by
26
+ analyze-story-design. Cross-feature ordering goes in depends_on, not in a second story.
27
+
28
+ FRONTMATTER — every field the gates read lives here, so checking the backlog is a
29
+ directory scan rather than a markdown parse.
30
+
31
+ id Minted by the kit: the feature name plus the next free number in
32
+ stories/. user-story refuses to write over an existing file, so a
33
+ collision is an add/add git conflict, never a silent overwrite.
34
+ change-story-id corrects it while it is still legal — see below.
35
+
36
+ type functional | technical
37
+ functional delivers requirement ids; exercises must be non-empty.
38
+ technical a refactor, dependency upgrade or performance fix. Changes
39
+ no requirement, so exercises stays empty and the EXISTING
40
+ TEST SUITE is the oracle: analyze-slice fails the story if
41
+ any test was MODIFIED, not only if a test is red. A test
42
+ that had to change means behaviour changed, and the work
43
+ was a functional story citing an FR-. Technical stories
44
+ deliver no requirement and do not count toward the
45
+ "no open stories" completeness rule.
46
+
47
+ status open | closed | cancelled
48
+ cancelled is what keeps "open" meaningful — abandoned work that stays
49
+ open blocks its requirement from ever reading as delivered.
50
+
51
+ exercises The FR-/BR- ids this story delivers, e.g. [FR-003, BR-002]. This is the
52
+ behavioural anchor: design and code trace to these ids, never to a story
53
+ id. A requirement is DELIVERED when it has NO OPEN STORIES — not when a
54
+ particular story closed, because a follow-on may carry the remainder.
55
+
56
+ spec_version The spec version this story last synced at. A row above this version
57
+ naming an id in exercises means the story is stale; check-stories
58
+ reports it and update-stories acts on it. Restamped on every sync.
59
+
60
+ depends_on Story ids that must land first, e.g. [Payment-004]. About CODE ordering,
61
+ not spec: implement warns on an open dependency, which is where calling
62
+ into code that does not exist starts to cost something. close-story
63
+ warns but does not block — a dependency still being open does not make
64
+ this story's own work wrong. A cycle is rejected at authoring time.
65
+
66
+ follows On a follow-on only: the story id this one carries the remainder of.
67
+ When the spec moves under a story that already has a story-spec,
68
+ update-stories leaves that story untouched and mints a follow-on
69
+ instead. There is no superseded status; the link is the whole record.
70
+
71
+ work_item Optional tracker id (JIRA-1234). The kit's id and the tracker's id stay
72
+ separate so the kit depends on no particular tracker.
73
+
74
+ CHANGE-STORY-ID IS LEGAL only while the story is open and stories/<ID>/ does not exist.
75
+ After story-spec runs, the id is in that directory, in the story-spec and story-design,
76
+ in the OKF log, in commit messages and branch names — most of which the kit cannot
77
+ rewrite.
78
+
79
+ stories.md beside this file is a GENERATED index. Never hand-edit it; it is rebuilt
80
+ from this directory, which is what keeps close-story conflict-free.
81
+ -->
82
+
83
+ # [Feature-NNN] — [Title]
84
+
85
+ ## Story
86
+
87
+ As a [role], I want [capability], so that [outcome].
88
+
89
+ ## Requirements delivered
90
+
91
+ <!-- One line per id in exercises:, saying what THIS story delivers of it. A story
92
+ rarely delivers a whole requirement; say which part. Empty for a technical story. -->
93
+
94
+ - **[FR-00n]** — [the part of this requirement this story delivers]
95
+
96
+ ## Acceptance
97
+
98
+ <!-- Checkable statements, in the spec's vocabulary. These are what analyze-slice pairs
99
+ tests against. For a technical story, state the no-behaviour-change invariant here
100
+ and name the suite that proves it. -->
101
+
102
+ - [ ] [observable outcome]
103
+
104
+ ## Notes
105
+
106
+ <!-- Optional: sequencing, risks, what is deliberately out of this slice. Anything that
107
+ belongs to the CONTRACT belongs in spec.md via update-spec, not here. -->