aw-spec-cli 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/assets/.appweaver/DESIGN-FORMAT.md +200 -0
  2. package/assets/.appweaver/ORCH-DIALECT.md +156 -0
  3. package/assets/.appweaver/RULE-PARTITION.md +175 -0
  4. package/assets/.appweaver/STACK-PROFILES.md +461 -0
  5. package/assets/.appweaver/ai-rules.md +180 -0
  6. package/assets/.appweaver/domain.json +1 -0
  7. package/assets/.appweaver/extensions/.registry +19 -0
  8. package/assets/.appweaver/extensions/agent-context/README.md +57 -0
  9. package/assets/.appweaver/extensions/agent-context/agent-context-config.yml +4 -0
  10. package/assets/.appweaver/extensions/agent-context/commands/aw-spec.agent-context.update.md +26 -0
  11. package/assets/.appweaver/extensions/agent-context/extension.yml +37 -0
  12. package/assets/.appweaver/extensions/agent-context/scripts/bash/update-agent-context.sh +201 -0
  13. package/assets/.appweaver/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +237 -0
  14. package/assets/.appweaver/extensions.yml +16 -0
  15. package/assets/.appweaver/feature.json +3 -0
  16. package/assets/.appweaver/init-options.json +9 -0
  17. package/assets/.appweaver/integration.json +15 -0
  18. package/assets/.appweaver/integrations/aw-spec.manifest.json +9 -0
  19. package/assets/.appweaver/interpreter/run-skill.py +1176 -0
  20. package/assets/.appweaver/memory/constitution.md +50 -0
  21. package/assets/.appweaver/orchestrator/.smoke-out/smoke.md +6 -0
  22. package/assets/.appweaver/orchestrator/AGENT-PROFILE.md +94 -0
  23. package/assets/.appweaver/orchestrator/README.md +300 -0
  24. package/assets/.appweaver/orchestrator/adapters/claude_agent_sdk.py +74 -0
  25. package/assets/.appweaver/orchestrator/adapters/google_antigravity.py +74 -0
  26. package/assets/.appweaver/orchestrator/modules/delta-design.orch.yaml +105 -0
  27. package/assets/.appweaver/orchestrator/modules/delta-spec.orch.yaml +101 -0
  28. package/assets/.appweaver/orchestrator/modules/domain-select.orch.yaml +90 -0
  29. package/assets/.appweaver/orchestrator/modules/lane-gate.orch.yaml +126 -0
  30. package/assets/.appweaver/orchestrator/modules/tech-select.orch.yaml +123 -0
  31. package/assets/.appweaver/orchestrator/orchestrator.py +1721 -0
  32. package/assets/.appweaver/orchestrator/rev-templates/ai-rules.reference.md +40 -0
  33. package/assets/.appweaver/orchestrator/rev-templates/delta-design-template.skeleton.md +101 -0
  34. package/assets/.appweaver/orchestrator/rev-templates/design-template.skeleton.md +245 -0
  35. package/assets/.appweaver/orchestrator/rev-templates/domain-constitution.skeleton.md +63 -0
  36. package/assets/.appweaver/orchestrator/rev-templates/domain-requirements.skeleton.md +48 -0
  37. package/assets/.appweaver/orchestrator/rev-templates/domain-rule-bindings.skeleton.md +59 -0
  38. package/assets/.appweaver/orchestrator/rev-templates/domain-rule-file.skeleton.md +39 -0
  39. package/assets/.appweaver/orchestrator/rev-templates/frontend-rule-file.skeleton.md +63 -0
  40. package/assets/.appweaver/orchestrator/rev-templates/tech-rule-bindings.skeleton.md +116 -0
  41. package/assets/.appweaver/orchestrator/rev-templates/technical-constitution.skeleton.md +106 -0
  42. package/assets/.appweaver/orchestrator/rev-templates/technical-rule-file.skeleton.md +54 -0
  43. package/assets/.appweaver/orchestrator/rev-templates/ui-constitution.skeleton.md +125 -0
  44. package/assets/.appweaver/orchestrator/rev-templates/ui-delta-design-template.skeleton.md +123 -0
  45. package/assets/.appweaver/orchestrator/rev-templates/ui-design-template.skeleton.md +294 -0
  46. package/assets/.appweaver/orchestrator/workflows/_smoke.orch.yaml +160 -0
  47. package/assets/.appweaver/orchestrator/workflows/aw-spec-add-component.orch.yaml +270 -0
  48. package/assets/.appweaver/orchestrator/workflows/aw-spec-adopt.orch.yaml +934 -0
  49. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +251 -0
  50. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +265 -0
  51. package/assets/.appweaver/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +437 -0
  52. package/assets/.appweaver/orchestrator/workflows/aw-spec-build.orch.yaml +197 -0
  53. package/assets/.appweaver/orchestrator/workflows/aw-spec-characterize.orch.yaml +475 -0
  54. package/assets/.appweaver/orchestrator/workflows/aw-spec-close-delta.orch.yaml +181 -0
  55. package/assets/.appweaver/orchestrator/workflows/aw-spec-constitution.orch.yaml +727 -0
  56. package/assets/.appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml +100 -0
  57. package/assets/.appweaver/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +69 -0
  58. package/assets/.appweaver/orchestrator/workflows/aw-spec-deploy.orch.yaml +85 -0
  59. package/assets/.appweaver/orchestrator/workflows/aw-spec-design-ui.orch.yaml +386 -0
  60. package/assets/.appweaver/orchestrator/workflows/aw-spec-design.orch.yaml +382 -0
  61. package/assets/.appweaver/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +462 -0
  62. package/assets/.appweaver/orchestrator/workflows/aw-spec-foundation.orch.yaml +265 -0
  63. package/assets/.appweaver/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +253 -0
  64. package/assets/.appweaver/orchestrator/workflows/aw-spec-implement-ui.orch.yaml +267 -0
  65. package/assets/.appweaver/orchestrator/workflows/aw-spec-implement.orch.yaml +287 -0
  66. package/assets/.appweaver/orchestrator/workflows/aw-spec-inventory.orch.yaml +238 -0
  67. package/assets/.appweaver/orchestrator/workflows/aw-spec-onboard.orch.yaml +1822 -0
  68. package/assets/.appweaver/orchestrator/workflows/aw-spec-parity.orch.yaml +293 -0
  69. package/assets/.appweaver/orchestrator/workflows/aw-spec-run.orch.yaml +194 -0
  70. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-domain.orch.yaml +83 -0
  71. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-feature.orch.yaml +128 -0
  72. package/assets/.appweaver/orchestrator/workflows/aw-spec-select-stack.orch.yaml +296 -0
  73. package/assets/.appweaver/orchestrator/workflows/aw-spec-specify.orch.yaml +439 -0
  74. package/assets/.appweaver/scripts/bash/aw-inventory.sh +17 -0
  75. package/assets/.appweaver/scripts/bash/aw-parity.sh +13 -0
  76. package/assets/.appweaver/scripts/bash/aw-rev-constitution.sh +13 -0
  77. package/assets/.appweaver/scripts/bash/aw-spec-actions.sh +2626 -0
  78. package/assets/.appweaver/scripts/bash/aw-xref.sh +15 -0
  79. package/assets/.appweaver/scripts/bash/common.sh +533 -0
  80. package/assets/.appweaver/scripts/powershell/aw-inventory.ps1 +17 -0
  81. package/assets/.appweaver/scripts/powershell/aw-parity.ps1 +13 -0
  82. package/assets/.appweaver/scripts/powershell/aw-rev-constitution.ps1 +13 -0
  83. package/assets/.appweaver/scripts/powershell/aw-spec-actions.ps1 +2232 -0
  84. package/assets/.appweaver/scripts/powershell/aw-xref.ps1 +15 -0
  85. package/assets/.appweaver/scripts/python/aw-component-catalog.py +121 -0
  86. package/assets/.appweaver/scripts/python/aw-inventory.py +1180 -0
  87. package/assets/.appweaver/scripts/python/aw-parity.py +380 -0
  88. package/assets/.appweaver/scripts/python/aw-rev-constitution.py +329 -0
  89. package/assets/.appweaver/scripts/python/aw-stack.py +1251 -0
  90. package/assets/.appweaver/scripts/python/aw-xref.py +1330 -0
  91. package/assets/.appweaver/scripts/python/validate_okf.py +352 -0
  92. package/assets/.appweaver/stack-profiles/angular.json +16 -0
  93. package/assets/.appweaver/stack-profiles/blazor-wasm.json +17 -0
  94. package/assets/.appweaver/stack-profiles/dotnet-webapi.json +15 -0
  95. package/assets/.appweaver/stack-profiles/go-chi.json +14 -0
  96. package/assets/.appweaver/stack-profiles/java-spring.json +16 -0
  97. package/assets/.appweaver/stack-profiles/nextjs.json +16 -0
  98. package/assets/.appweaver/stack-profiles/node-express.json +15 -0
  99. package/assets/.appweaver/stack-profiles/python-fastapi.json +16 -0
  100. package/assets/.appweaver/stack-profiles/react-vite.json +17 -0
  101. package/assets/.appweaver/stack-profiles/sveltekit.json +16 -0
  102. package/assets/.appweaver/stack-profiles/vue-vite.json +17 -0
  103. package/assets/.appweaver/stacks.json +3 -0
  104. package/assets/.appweaver/templates/constitution-domain-template.md +116 -0
  105. package/assets/.appweaver/templates/constitution-technical-template.md +108 -0
  106. package/assets/.appweaver/templates/constitution-ui-template.md +116 -0
  107. package/assets/.appweaver/templates/delta-design-template.md +69 -0
  108. package/assets/.appweaver/templates/delta-spec-template.md +63 -0
  109. package/assets/.appweaver/templates/design-template.md +383 -0
  110. package/assets/.appweaver/templates/okf-concept-template.md +114 -0
  111. package/assets/.appweaver/templates/parity-manifest-template.json +49 -0
  112. package/assets/.appweaver/templates/source-map-template.md +85 -0
  113. package/assets/.appweaver/templates/spec-template.md +309 -0
  114. package/assets/.appweaver/templates/ui-design-template.md +273 -0
  115. package/assets/foundations/dotnet/ModularMonolith/ModularMonolith.Reference.pack.txt +25248 -0
  116. package/assets/foundations/dotnet/ModularMonolith/ModularMonolith.pack.txt +5726 -0
  117. package/assets/foundations/dotnet/ModularMonolith/pack-foundation.ps1 +145 -0
  118. package/assets/foundations/dotnet/ModularMonolith/pack-foundation.sh +196 -0
  119. package/assets/foundations/dotnet/ModularMonolith/pack-reference-foundation.ps1 +157 -0
  120. package/assets/foundations/dotnet/ModularMonolith/pack-reference-foundation.sh +209 -0
  121. package/assets/foundations/dotnet/ModularMonolith/unpack-foundation.ps1 +126 -0
  122. package/assets/foundations/dotnet/ModularMonolith/unpack-foundation.sh +217 -0
  123. package/assets/foundations/dotnet/ModularMonolith/unpack-reference-foundation.ps1 +129 -0
  124. package/assets/foundations/dotnet/ModularMonolith/unpack-reference-foundation.sh +218 -0
  125. package/assets/foundations/dotnet/VerticalSlice/VerticalSlice.Reference.pack.txt +19318 -0
  126. package/assets/foundations/dotnet/VerticalSlice/VerticalSlice.pack.txt +2833 -0
  127. package/assets/foundations/dotnet/VerticalSlice/pack-foundation.ps1 +145 -0
  128. package/assets/foundations/dotnet/VerticalSlice/pack-foundation.sh +196 -0
  129. package/assets/foundations/dotnet/VerticalSlice/pack-reference-foundation.ps1 +157 -0
  130. package/assets/foundations/dotnet/VerticalSlice/pack-reference-foundation.sh +209 -0
  131. package/assets/foundations/dotnet/VerticalSlice/unpack-foundation.ps1 +126 -0
  132. package/assets/foundations/dotnet/VerticalSlice/unpack-foundation.sh +217 -0
  133. package/assets/foundations/dotnet/VerticalSlice/unpack-reference-foundation.ps1 +129 -0
  134. package/assets/foundations/dotnet/VerticalSlice/unpack-reference-foundation.sh +218 -0
  135. package/assets/foundations/dotnet/components/Email/README.md +119 -0
  136. package/assets/foundations/dotnet/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +84 -0
  137. package/assets/foundations/dotnet/components/Email/integration.md +300 -0
  138. package/assets/foundations/dotnet/components/Jobs/README.md +113 -0
  139. package/assets/foundations/dotnet/components/Jobs/integration.md +259 -0
  140. package/assets/foundations/dotnet/components/QrGenerator/README.md +85 -0
  141. package/assets/foundations/dotnet/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +57 -0
  142. package/assets/foundations/dotnet/components/QrGenerator/integration.md +230 -0
  143. package/assets/foundations/dotnet/components/README.md +74 -0
  144. package/assets/guardrails/README.md +222 -0
  145. package/assets/guardrails/domain/healthcare/ai-rules.domain.md +34 -0
  146. package/assets/guardrails/domain/healthcare/api-versioning.domain.md +17 -0
  147. package/assets/guardrails/domain/healthcare/auditing.domain.md +97 -0
  148. package/assets/guardrails/domain/healthcare/authorization.domain.md +26 -0
  149. package/assets/guardrails/domain/healthcare/clinical-terms.md +20 -0
  150. package/assets/guardrails/domain/healthcare/coding-standards.domain.md +26 -0
  151. package/assets/guardrails/domain/healthcare/consent.md +19 -0
  152. package/assets/guardrails/domain/healthcare/cqrs.domain.md +12 -0
  153. package/assets/guardrails/domain/healthcare/data-classification.domain.md +28 -0
  154. package/assets/guardrails/domain/healthcare/dependency-policy.domain.md +11 -0
  155. package/assets/guardrails/domain/healthcare/dicom.md +15 -0
  156. package/assets/guardrails/domain/healthcare/domain-constitution.md +119 -0
  157. package/assets/guardrails/domain/healthcare/domain-driven-design.domain.md +28 -0
  158. package/assets/guardrails/domain/healthcare/eventing.domain.md +18 -0
  159. package/assets/guardrails/domain/healthcare/fhir.md +36 -0
  160. package/assets/guardrails/domain/healthcare/folder-structure.domain.md +25 -0
  161. package/assets/guardrails/domain/healthcare/hipaa.md +34 -0
  162. package/assets/guardrails/domain/healthcare/hl7.md +15 -0
  163. package/assets/guardrails/domain/healthcare/ihe-conformance.md +31 -0
  164. package/assets/guardrails/domain/healthcare/integration-terms.md +21 -0
  165. package/assets/guardrails/domain/healthcare/persistence.domain.md +20 -0
  166. package/assets/guardrails/domain/healthcare/terminology.md +30 -0
  167. package/assets/guardrails/domain/healthcare/testing.domain.md +15 -0
  168. package/assets/guardrails/domain/healthcare/ux/accessibility-standards.md +36 -0
  169. package/assets/guardrails/domain/healthcare/ux/content-design.md +32 -0
  170. package/assets/guardrails/domain/healthcare/ux/interaction-states.md +44 -0
  171. package/assets/guardrails/domain/healthcare/ux/journey-mapping.md +40 -0
  172. package/assets/guardrails/domain/healthcare/vertical-slices.domain.md +18 -0
  173. package/assets/guardrails/domain/healthcare/zero-trust.domain.md +12 -0
  174. package/assets/guardrails/domain/pharma/ai-rules.domain.md +32 -0
  175. package/assets/guardrails/domain/pharma/api-versioning.domain.md +20 -0
  176. package/assets/guardrails/domain/pharma/atc.md +22 -0
  177. package/assets/guardrails/domain/pharma/auditing.domain.md +90 -0
  178. package/assets/guardrails/domain/pharma/authorization.domain.md +25 -0
  179. package/assets/guardrails/domain/pharma/coding-standards.domain.md +28 -0
  180. package/assets/guardrails/domain/pharma/cqrs.domain.md +16 -0
  181. package/assets/guardrails/domain/pharma/data-classification.domain.md +24 -0
  182. package/assets/guardrails/domain/pharma/data-provenance.md +21 -0
  183. package/assets/guardrails/domain/pharma/dependency-policy.domain.md +11 -0
  184. package/assets/guardrails/domain/pharma/domain-constitution.md +113 -0
  185. package/assets/guardrails/domain/pharma/domain-driven-design.domain.md +36 -0
  186. package/assets/guardrails/domain/pharma/domain-requirements.sample.md +103 -0
  187. package/assets/guardrails/domain/pharma/eventing.domain.md +18 -0
  188. package/assets/guardrails/domain/pharma/fhir.md +31 -0
  189. package/assets/guardrails/domain/pharma/folder-structure.domain.md +26 -0
  190. package/assets/guardrails/domain/pharma/hl7.md +17 -0
  191. package/assets/guardrails/domain/pharma/idmp.md +26 -0
  192. package/assets/guardrails/domain/pharma/integration-terms.md +21 -0
  193. package/assets/guardrails/domain/pharma/ndc.md +28 -0
  194. package/assets/guardrails/domain/pharma/persistence.domain.md +23 -0
  195. package/assets/guardrails/domain/pharma/pharma-terms.md +27 -0
  196. package/assets/guardrails/domain/pharma/product-lifecycle.domain.md +30 -0
  197. package/assets/guardrails/domain/pharma/regulatory-compliance.md +19 -0
  198. package/assets/guardrails/domain/pharma/terminology.md +32 -0
  199. package/assets/guardrails/domain/pharma/testing.domain.md +19 -0
  200. package/assets/guardrails/domain/pharma/vertical-slices.domain.md +17 -0
  201. package/assets/guardrails/domain/pharma/zero-trust.domain.md +12 -0
  202. package/assets/guardrails/projects/dotnet-default-project/domain/domain-requirements.md +58 -0
  203. package/assets/guardrails/projects/dotnet-default-project/domain-rule-bindings.md +113 -0
  204. package/assets/guardrails/projects/dotnet-default-project/frontend/ui-requirements.md +43 -0
  205. package/assets/guardrails/projects/dotnet-default-project/service/technical-requirements.md +40 -0
  206. package/assets/guardrails/projects/dotnet-default-project/tech-rule-bindings.md +263 -0
  207. package/assets/guardrails/requirement-spec.txt +27 -0
  208. package/assets/guardrails/technology/dotnet-webapi/PACKAGING.md +184 -0
  209. package/assets/guardrails/technology/dotnet-webapi/api-versioning.md +44 -0
  210. package/assets/guardrails/technology/dotnet-webapi/auditing.md +96 -0
  211. package/assets/guardrails/technology/dotnet-webapi/authorization-matrix.md +14 -0
  212. package/assets/guardrails/technology/dotnet-webapi/authorization.md +39 -0
  213. package/assets/guardrails/technology/dotnet-webapi/clean-architecture.md +54 -0
  214. package/assets/guardrails/technology/dotnet-webapi/coding-standards.md +87 -0
  215. package/assets/guardrails/technology/dotnet-webapi/cqrs.md +63 -0
  216. package/assets/guardrails/technology/dotnet-webapi/data-classification.md +38 -0
  217. package/assets/guardrails/technology/dotnet-webapi/dependency-policy.md +40 -0
  218. package/assets/guardrails/technology/dotnet-webapi/domain-driven-design.md +91 -0
  219. package/assets/guardrails/technology/dotnet-webapi/eventing.md +57 -0
  220. package/assets/guardrails/technology/dotnet-webapi/examples/api-versioning.md +75 -0
  221. package/assets/guardrails/technology/dotnet-webapi/examples/auditing.md +84 -0
  222. package/assets/guardrails/technology/dotnet-webapi/examples/authorization.md +68 -0
  223. package/assets/guardrails/technology/dotnet-webapi/examples/clean-architecture.md +37 -0
  224. package/assets/guardrails/technology/dotnet-webapi/examples/cqrs.md +97 -0
  225. package/assets/guardrails/technology/dotnet-webapi/examples/domain-driven-design.md +141 -0
  226. package/assets/guardrails/technology/dotnet-webapi/examples/eventing.md +46 -0
  227. package/assets/guardrails/technology/dotnet-webapi/examples/persistence.md +207 -0
  228. package/assets/guardrails/technology/dotnet-webapi/examples/vertical-slices.md +151 -0
  229. package/assets/guardrails/technology/dotnet-webapi/examples/zero-trust.md +48 -0
  230. package/assets/guardrails/technology/dotnet-webapi/folder-structure.md +61 -0
  231. package/assets/guardrails/technology/dotnet-webapi/modular-monolith.md +47 -0
  232. package/assets/guardrails/technology/dotnet-webapi/persistence.md +82 -0
  233. package/assets/guardrails/technology/dotnet-webapi/technology-constitution.md +162 -0
  234. package/assets/guardrails/technology/dotnet-webapi/testing.md +55 -0
  235. package/assets/guardrails/technology/dotnet-webapi/vertical-slices.md +70 -0
  236. package/assets/guardrails/technology/dotnet-webapi/zero-trust.md +48 -0
  237. package/assets/guardrails/technology/java-spring/README.md +62 -0
  238. package/assets/guardrails/technology/nextjs/accessibility-implementation.md +56 -0
  239. package/assets/guardrails/technology/nextjs/api-client.md +56 -0
  240. package/assets/guardrails/technology/nextjs/api-integration.dotnet-webapi.md +174 -0
  241. package/assets/guardrails/technology/nextjs/api-integration.java-spring.md +203 -0
  242. package/assets/guardrails/technology/nextjs/auth-session.md +68 -0
  243. package/assets/guardrails/technology/nextjs/client-security.md +69 -0
  244. package/assets/guardrails/technology/nextjs/component-architecture.md +60 -0
  245. package/assets/guardrails/technology/nextjs/component-conventions.md +58 -0
  246. package/assets/guardrails/technology/nextjs/design-system.md +60 -0
  247. package/assets/guardrails/technology/nextjs/error-handling.md +72 -0
  248. package/assets/guardrails/technology/nextjs/forms-and-validation.md +75 -0
  249. package/assets/guardrails/technology/nextjs/frontend-testing.md +94 -0
  250. package/assets/guardrails/technology/nextjs/i18n.md +57 -0
  251. package/assets/guardrails/technology/nextjs/observability.md +67 -0
  252. package/assets/guardrails/technology/nextjs/performance-budgets.md +66 -0
  253. package/assets/guardrails/technology/nextjs/routing-navigation.md +52 -0
  254. package/assets/guardrails/technology/nextjs/state-management.md +70 -0
  255. package/assets/guardrails/technology/nextjs/ui-constitution.md +166 -0
  256. package/dist/commands/init.js +2 -2
  257. package/dist/commands/init.js.map +1 -1
  258. package/dist/utils/copy-assets.js +8 -8
  259. package/dist/utils/copy-assets.js.map +1 -1
  260. package/package.json +1 -1
  261. package/assets/docs/pharma-constitution.my-ref.md +0 -86
@@ -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,6 @@
1
+ <!-- authored by aw-orchestrator MOCK transport -->
2
+ <!-- target: .appweaver/orchestrator/.smoke-out/smoke.md -->
3
+ <!-- envelope: system=[] context=['.appweaver/orchestrator/.smoke-out/smoke.md'] -->
4
+ <!-- task chars: 48 -->
5
+
6
+ # (mock content)
@@ -0,0 +1,94 @@
1
+ # Agent transport profile schema
2
+
3
+ The orchestrator engine (`orchestrator.py`) is **agent-agnostic**. It never names
4
+ Claude, Gemini, or Kilo. Each agent supplies a small JSON **profile** that maps
5
+ the engine's neutral knobs onto that agent's real headless CLI flags. Each
6
+ profile lives **once at its agent's root**, shared by every orchestrator skill
7
+ for that agent; the engine that consumes it is the *general* file in `.appweaver/`.
8
+
9
+ ```
10
+ .appweaver/orchestrator/orchestrator.py ← general engine (reads a profile)
11
+ .appweaver/orchestrator/adapters/*.py ← shared SDK adapters (one per SDK, not per agent)
12
+ .claude/agent.json ← Claude Code profile (claude -p / claude-agent-sdk)
13
+ .agents/agent.json ← Antigravity profile (agy -p / google-antigravity)
14
+ .kilocode/agent.json ← Kilo Code profile (delegates to claude)
15
+ ```
16
+
17
+ The launcher passes its profile with `--agent-profile <path>` (which implies
18
+ `--transport real`).
19
+
20
+ ## Fields
21
+
22
+ | Field | Meaning |
23
+ |---|---|
24
+ | `name` | label shown in the banner/logs |
25
+ | `runtime` / `note` | free-text documentation (ignored by the engine) |
26
+ | `bin` | the CLI executable (e.g. `claude`, `gemini`) |
27
+ | `args` | always-on args prepended to every call |
28
+ | `model_flag` | flag for `--model` (e.g. `--model`, `-m`); omit to ignore model |
29
+ | `system` | how the interpreter's system block is injected: `{ "flag": "--system-prompt" }` to pass it as a flag, or `"prepend"` to fold it into the prompt (for CLIs with no system flag, e.g. gemini) |
30
+ | `user` | how the user block is delivered: `{ "mode": "stdin" }` or `{ "mode": "arg", "flag": "-p" }` |
31
+ | `tools_flag` | flag for the tools allowlist (e.g. `--tools`), or `null` if the CLI governs tools another way (gemini → `--approval-mode`) |
32
+ | `approval` | map from the neutral permission mode (`acceptEdits`, `bypassPermissions`, `default`, `readonly`) to that CLI's args |
33
+ | `isolation` | map from `--isolation` (`bare`, `fresh`) to that CLI's args (e.g. `--bare`, or `["--setting-sources", ""]`) |
34
+ | `budget_flag` | optional flag for a per-call spend cap (`--max-budget-usd`); omit if unsupported |
35
+ | `result_keys` | keys to look for in the CLI's JSON output that hold the final text (first match wins); falls back to raw stdout |
36
+ | `sdk` | how the `sdk` / `sdk-apply` strategies run an isolated generation via that agent's SDK (see below) |
37
+
38
+ ## The `sdk` block
39
+
40
+ The `sdk`/`sdk-apply` strategies never name an SDK in the engine — the profile
41
+ declares everything:
42
+
43
+ | Field | Meaning |
44
+ |---|---|
45
+ | `type` | label for humans/tooling (the engine does not branch on it) |
46
+ | `package` | the pip package to install when the module isn't importable (`--sdk-install` or `auto_install: true` triggers `python -m pip install <package>`) |
47
+ | `module` | the Python module the engine imports (e.g. `claude_agent_sdk`, `google.antigravity`) |
48
+ | `adapter` | **required** — path (relative to this profile file) to a Python file exporting `generate(request) -> str` that owns this SDK's calling convention; may be sync or async. Shared adapters live in `.appweaver/orchestrator/adapters/`, one per SDK, so profiles whose SDKs match reference the same file (e.g. `"../.appweaver/orchestrator/adapters/claude_agent_sdk.py"`). The engine ships no SDK code of its own, so a profile without an adapter cannot run the `sdk`/`sdk-apply` strategies |
49
+ | `auto_install` | `true` to always install the missing package without needing `--sdk-install` |
50
+
51
+ `module`, `package`, and `adapter` are all required — the engine has no
52
+ default agent, so a developer who only has one agent root (e.g. only
53
+ `.agents/`) never depends on another agent's files being present. A missing
54
+ or broken field/adapter stops the run with a message naming exactly what to
55
+ fix.
56
+
57
+ The adapter's `request` dict carries `system`, `user`, `tools`,
58
+ `permission_mode`, `model`, and the full `sdk` block (for adapter-specific
59
+ options). Adapters are keyed by SDK, not by agent:
60
+ `adapters/google_antigravity.py` maps the neutral permission modes onto
61
+ Antigravity policies and drives `Agent` / `LocalAgentConfig` (used by
62
+ `.agents`), while `adapters/claude_agent_sdk.py` drives `query` /
63
+ `ClaudeAgentOptions` (shared by `.claude` and `.kilocode`, whose SDK is the
64
+ same) — none of which the engine knows about; it only follows the profile's
65
+ `sdk.adapter` pointer.
66
+
67
+ ## How the engine builds the command
68
+
69
+ ```
70
+ [bin] + args
71
+ + (model_flag model) if model_flag and --model
72
+ + (system.flag system) if system is a {flag}
73
+ + (tools_flag tools) if tools_flag
74
+ + approval[permission_mode | default]
75
+ + isolation[--isolation]
76
+ + (budget_flag budget) if budget_flag and --budget
77
+ + (user.flag prompt) if user.mode == "arg"
78
+ stdin = prompt if user.mode == "stdin"
79
+ ```
80
+
81
+ When `system` is `"prepend"`, the system block is folded into the prompt
82
+ (`system + "\n\n---\n\n" + user`) instead of passed as a flag.
83
+
84
+ ## Adding a new agent
85
+
86
+ 1. Drop an `agent.json` at that agent's root (`.<agent>/agent.json`) describing its CLI.
87
+ 2. Add a launcher in that agent's native format that calls
88
+ `orchestrator.py … --agent-profile .<agent>/agent.json`.
89
+ 3. For the `sdk`/`sdk-apply` strategies, add an `sdk` block and point
90
+ `sdk.adapter` at the matching adapter in `.appweaver/orchestrator/adapters/`
91
+ — or drop a new adapter there first if that SDK has none yet.
92
+
93
+ No engine change required. Verify with `--dry-run` (prints the exact command
94
+ without executing).
@@ -0,0 +1,300 @@
1
+ # aw-orchestrator (prototype)
2
+
3
+ A reference runtime for the architecture you sketched: **the Python interpreter
4
+ owns 100% of context assembly; a _fresh_ agent does the execution with tools;
5
+ control returns to the interpreter, which reviews and continues.**
6
+
7
+ It is **agent-agnostic**: the same engine + workflows drive Claude Code,
8
+ Antigravity (Gemini), or Kilo Code. The engine never names an agent — each agent
9
+ supplies a small transport **profile**.
10
+
11
+ This engine is now the **only** pipeline that ships. The earlier declarative tier
12
+ (`aw-spec-decl-*` skills, `aw-spec.declarative/v1`) was **retired 2026-08-03**.
13
+
14
+ > **`.appweaver/interpreter/run-skill.py` deliberately SURVIVES that retirement.**
15
+ > It is no longer an entry point — nothing launches it — but `orchestrator.py`
16
+ > imports it at load time for its YAML loader (`load_yaml`, orchestrator.py ~L112).
17
+ > **Deleting it breaks every workflow in this directory.** Fold the loader in before
18
+ > removing the file.
19
+
20
+ ## General vs. agent-specific (file layout)
21
+
22
+ The transport **profile lives once at each agent's root** (`.claude/agent.json`,
23
+ `.agents/agent.json`, `.kilocode/agent.json`), so every orchestrator skill for
24
+ that agent shares it — no per-skill duplication. Only the thin launcher is
25
+ per-skill.
26
+
27
+ ```
28
+ .appweaver/orchestrator/ ← GENERAL (shared by all agents)
29
+ orchestrator.py engine (profile-driven; no agent hardcoded)
30
+ workflows/aw-spec-demo.orch.yaml demo workflow (run: /appweaver demo)
31
+ AGENT-PROFILE.md the transport-profile schema
32
+ README.md
33
+
34
+ .claude/agent.json ← Claude Code profile (all its skills share this)
35
+ .claude/skills/appweaver-demo/SKILL.md ← Claude Code launcher
36
+ .agents/agent.json ← Antigravity profile
37
+ .agents/skills/appweaver-demo/SKILL.md ← Antigravity launcher
38
+ .kilocode/agent.json ← Kilo Code profile
39
+ .kilocode/workflows/appweaver-demo.md ← Kilo Code launcher
40
+ ```
41
+
42
+ ## Your diagram → this code
43
+
44
+ | Diagram box | Where it lives |
45
+ |---|---|
46
+ | Agent skill launches the runtime | the per-agent launcher runs `orchestrator.py … --agent-profile <profile>` |
47
+ | Python Workflow / Interpreter Runtime | `orchestrator.py` — `Orchestrator.run()` |
48
+ | **Builds Complete Context** | `build_context` → `_assemble_system()` + `_assemble_user()` |
49
+ | **Invoke (fresh generation)** | `agent_generate` → `_run_fresh()` → the profile's CLI |
50
+ | Agent uses tools (Edit, Bash…) | tools/approval flags from the profile |
51
+ | **Return structured result** | trailing ```` ```json {…} ```` block → `_extract_json()` → bound via `outputs:` |
52
+ | Interpreter continues next step | `_run_steps()` / `_run_loop()` |
53
+ | **Review the current output** | `agent_review` → a second fresh, read-only generation |
54
+ | …continues | the `revise` loop in `workflows/aw-spec-demo.orch.yaml` |
55
+
56
+ ## Why this overrides the launching agent's own context (your R6)
57
+
58
+ Generation does **not** happen inside the launching agent's conversation. Each
59
+ `agent_generate` / `agent_review` shells out to a **separate** process described
60
+ by the profile. For the Claude Code profile that is:
61
+
62
+ ```
63
+ claude -p --bare \
64
+ --system-prompt "<interpreter-authored standards>" \
65
+ --output-format json --tools "Read,Write,Edit,Bash" \
66
+ --permission-mode acceptEdits --no-session-persistence
67
+ < <interpreter-authored task on stdin>
68
+ ```
69
+
70
+ - `-p` → a brand-new conversation; the caller's transcript is **not** inherited.
71
+ - `--bare` → no CLAUDE.md / auto-memory / hooks; the only context is what we pass.
72
+ - `--system-prompt` + stdin → the interpreter owns the system and user blocks.
73
+
74
+ So every model request sees **exactly** the interpreter's payload — nothing from
75
+ the launching agent. (The Gemini profile achieves the same isolation differently;
76
+ see below.)
77
+
78
+ ## Run it
79
+
80
+ Safe (default) — **no model calls**. Prints the exact payloads the fresh agent
81
+ would receive (proof of isolation), simulates the writes, runs the whole loop:
82
+
83
+ ```bash
84
+ python3 .appweaver/orchestrator/orchestrator.py .appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml # mock
85
+ python3 .appweaver/orchestrator/orchestrator.py .appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml --show-full
86
+ ```
87
+
88
+ For real — pass an agent profile (implies `--transport real`):
89
+
90
+ ```bash
91
+ # Claude Code
92
+ python3 .appweaver/orchestrator/orchestrator.py .appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml \
93
+ --agent-profile .claude/agent.json --isolation bare --model opus
94
+
95
+ # Antigravity (Gemini)
96
+ python3 .appweaver/orchestrator/orchestrator.py .appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml \
97
+ --agent-profile .agents/agent.json --isolation fresh --model gemini-2.5-pro
98
+
99
+ # Kilo Code (delegates generation to claude -p)
100
+ python3 .appweaver/orchestrator/orchestrator.py .appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml \
101
+ --agent-profile .kilocode/agent.json --isolation fresh --model opus
102
+ ```
103
+
104
+ Add `--dry-run` to print the exact command a profile would run **without
105
+ executing it**. Output lands in `.appweaver/orchestrator/.demo-out/` (safe to delete).
106
+
107
+ ## Execution strategies — `--strategy`, per-step `strategy:`
108
+
109
+ The interpreter assembles **100% of every payload in all strategies**; they
110
+ differ only in *who executes it* and *who applies the file changes*. The
111
+ developer picks per command (launcher passes `--strategy`) and can override
112
+ per step in the workflow YAML (`strategy:` on `agent_generate`/`agent_review`).
113
+
114
+ | `--strategy` | Who generates | Who applies | Instances | Isolation (R6) |
115
+ |---|---|---|---|---|
116
+ | `sdk` | isolated SDK instance | SDK instance (tools) | 1 | guaranteed |
117
+ | `sdk-apply` | isolated SDK instance (read-only) | **invoking agent** (suspend/resume) | 1 + you | generation clean; apply local |
118
+ | `spawn` | fresh CLI process (profile) | same process | N cold | guaranteed |
119
+ | `agent` | invoking agent (suspend/resume) | invoking agent | **0** | best-effort |
120
+
121
+ ```bash
122
+ # Strategy 1 — SDK generates + implements (needs: pip install claude-agent-sdk)
123
+ python3 .appweaver/orchestrator/orchestrator.py <wf.yaml> --strategy sdk --model opus
124
+
125
+ # Strategy 2 — SDK generates read-only; YOU apply the artifact (suspend kind=apply)
126
+ python3 .appweaver/orchestrator/orchestrator.py <wf.yaml> --strategy sdk-apply \
127
+ --checkpoint <state.json>
128
+
129
+ # Strategy 3 — the original profile transport
130
+ python3 .appweaver/orchestrator/orchestrator.py <wf.yaml> --strategy spawn \
131
+ --agent-profile .claude/agent.json
132
+
133
+ # Strategy 4 — zero new instances (the checkpoint section below)
134
+ python3 .appweaver/orchestrator/orchestrator.py <wf.yaml> --strategy agent \
135
+ --checkpoint <state.json>
136
+ ```
137
+
138
+ Rules: `spawn` needs `--agent-profile`; `agent` and `sdk-apply` need
139
+ `--checkpoint`. Omitting `--strategy` keeps the legacy behavior
140
+ (`--agent-profile` → spawn, `--checkpoint` → agent, neither → mock). The
141
+ loop + checkpoint machinery is strategy-independent — every completed
142
+ generation is written to the replay cache, so **mixed-strategy workflows
143
+ survive suspend/resume** (an `sdk` result is not re-generated when an `agent`
144
+ or `apply` step later suspends the run). The state file persists
145
+ strategy/model, so resuming with a bare `--checkpoint` continues the original
146
+ run correctly. In `sdk-apply`, `agent_review` steps degrade to a plain
147
+ read-only `sdk` call (reviews have no apply phase). The `claude-agent-sdk`
148
+ import is lazy — strategies `spawn`/`agent`/mock keep the engine stdlib-only.
149
+
150
+ ## Checkpoint transport — zero additional instances (the run-skill.py method)
151
+
152
+ If spawning a second agent instance is impossible or unwanted, `--checkpoint`
153
+ ports run-skill.py's **suspend/resume** method into this engine:
154
+
155
+ ```bash
156
+ python3 .appweaver/orchestrator/orchestrator.py .appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml \
157
+ --checkpoint .appweaver/orchestrator/.demo-out/demo.state.json --json
158
+ ```
159
+
160
+ At each `agent_generate` / `agent_review` the interpreter writes the fully
161
+ assembled payload to `<state>.system.md` / `<state>.user.md`, persists its
162
+ state (`vars` seeds + a loop-aware **replay cache**), prints the pending
163
+ request, and **exits with code 2** — which releases the invoking agent from
164
+ the Bash call. The agent fulfills the request **in its own conversation**
165
+ (instructed to use ONLY the payload files), writes its reply — ending with the
166
+ required ```` ```json ```` fence — to `<state>.response.md`, and re-runs the
167
+ same command. Completed steps replay from the cache, so the run continues
168
+ exactly where it suspended; on a terminal end the state file and sidecars are
169
+ deleted. Launcher: the `appweaver-demo` skill/workflow handles this via its
170
+ `sdk-apply` / `agent` strategies (step 3, the suspend/resume loop). The same
171
+ loop works for any agent that can run bash and read/write files — including
172
+ Kilo Code, natively, with no `claude` CLI.
173
+
174
+ **The trade-off, stated plainly:** the interpreter keeps 100% ownership of
175
+ what goes *into* each payload, but the request executes inside the invoking
176
+ agent's conversation — its system prompt and accumulated transcript ride
177
+ along, and payloads pile up across steps. Payload ownership is preserved;
178
+ **context isolation (R6) is not.**
179
+
180
+ **`--checkpoint` + `--agent-profile` combine freely** (D1): mixing them as a
181
+ *generation* transport still makes no sense (a step generates via the profile
182
+ OR via the invoker, chosen by `--strategy`), but the checkpoint is also the
183
+ **interaction channel** — `ask` / `user_select` / `dispatch_hooks` suspend
184
+ through it under EVERY strategy so the launching agent can relay to the human.
185
+ Converted `aw-spec-*` workflows therefore always run with `--checkpoint`,
186
+ whatever the strategy. The full `pending.kind` protocol (`agent_generate`,
187
+ `agent_review`/`agent_query`, `apply`, `author`, `ask`, `select`, `hook`) is
188
+ documented in `.appweaver/ORCH-DIALECT.md`.
189
+
190
+ | | profile transports (`--agent-profile`) | checkpoint (`--checkpoint`) |
191
+ |---|---|---|
192
+ | Agent instances | +1 fresh process per generation | **0** — the invoker generates |
193
+ | Model request contains | ONLY the interpreter's payload | payload **+ the invoker's context** |
194
+ | R6 (context override) | guaranteed by construction | best-effort (instructions only) |
195
+ | Extra auth / CLI needed | yes (`claude`/`gemini` + key for `--bare`) | none |
196
+ | Permission prompts / HITL | none (headless) | the agent's native ones |
197
+
198
+ ## The three agents
199
+
200
+ | Agent | Folder | Fresh-generation CLI | System block | Tools | Isolation |
201
+ |---|---|---|---|---|---|
202
+ | Claude Code | `.claude/` | `claude -p` | `--system-prompt` | `--tools` | `--bare` (needs `ANTHROPIC_API_KEY`) / `--setting-sources ""` |
203
+ | Antigravity | `.agents/` | `gemini -p` | folded into prompt (no system flag) | `--approval-mode` | best-effort (no `--bare` equivalent) |
204
+ | Kilo Code | `.kilocode/` | `claude -p` (no native headless CLI) | `--system-prompt` | `--tools` | `--bare` / `--setting-sources ""` |
205
+
206
+ Adding a fourth agent = drop an `agent.json` + a launcher in its folder; no
207
+ engine change. See `AGENT-PROFILE.md` for the schema.
208
+
209
+ ## Invoking from an agent (the top of your diagram)
210
+
211
+ You don't run this by hand — each agent's skill/workflow launches it, and the
212
+ agent's *only* job is to run the orchestrator and relay the JSON. It **never
213
+ generates**; its conversation **never** enters a model request.
214
+
215
+ ```
216
+ User → /appweaver-demo → (agent runs) orchestrator.py --agent-profile <its profile>
217
+ → interpreter builds context → spawns a fresh CLI per step (isolated)
218
+ → interpreter reviews + continues → agent reports final JSON
219
+ ```
220
+
221
+ Contrast the retired `aw-spec-decl-*` launchers, which ran `run-skill.py --llm agent`
222
+ and then asked the *same* agent to fulfill `pending_generation` in its own context —
223
+ the context leak this design removes, and one reason that tier was retired.
224
+
225
+ ## Workflow vocabulary (prototype)
226
+
227
+ - `set` — set vars (`vars: {k: v}`).
228
+ - `build_context` — declare the envelope for the next request: `system:` files
229
+ (→ system prompt) and `context:` files (→ user message). Optional entries
230
+ `{ path: …, optional: true }` are tolerated when missing. `context_from: <var>`
231
+ appends a var holding a list of paths (e.g. files a prior generation wrote).
232
+ - `agent_generate` — fresh generation with write tools. `task:` is the
233
+ instruction; **the interpreter does not specify output paths** — the fresh
234
+ runtime/LLM decides them (per the loaded folder-structure standards) and
235
+ reports them in the result's `files[]`. Bind with
236
+ `outputs: [{ name: gen_files, from: "$.files" }]`.
237
+ - `agent_review` — fresh, read-only generation. `review_of_var: <var>` reviews
238
+ the files a prior generation reported (or `review_of:` for a static list);
239
+ returns `{pass, issues}`.
240
+ - `loop` (`while:` + `max_iterations:`) with `break` (+ `condition:`) — the
241
+ review→revise cycle.
242
+
243
+ The engine now implements the FULL dialect the `aw-spec-*` conversions need on
244
+ top of these demo actions: `execute_script`, `verify_context`,
245
+ `load_standards` (sticky system prefix), `agent_author` (interpreter-owned
246
+ `output_target`, read-only generation), `agent_query` (generic structured
247
+ JSON), `ask`/`user_select` (HITL via checkpoint), `dispatch_hooks`, `include`
248
+ (shared modules), foreach loops (`over:`/`as:`), `inputs:`/`--input`, and
249
+ `--validate`. See `.appweaver/ORCH-DIALECT.md` for the complete reference;
250
+ shared per-skill workflows live in `workflows/`, shared modules in `modules/`,
251
+ and each root's parametric `/appweaver <skill> [strategy] [input…]`
252
+ launcher runs them.
253
+
254
+ ## How this differed from `run-skill.py` (historical — that tier is retired)
255
+
256
+ | | `run-skill.py` (retired tier) | `orchestrator.py` (ships) |
257
+ |---|---|---|
258
+ | Context handed over | file **paths** (agent/checkpoint) | fully **assembled content** |
259
+ | Where generation runs | inside the caller's conversation | a **fresh**, profile-driven process — or the caller, via `--checkpoint` |
260
+ | Caller's context leaks in | yes (agent/checkpoint mode) | **no** with a profile; yes with `--checkpoint` (by design) |
261
+ | Multi-agent | per-agent launchers | per-agent launchers **+ transport profiles** |
262
+ | Deterministic scripts/gates/hooks | rich (scaffolding, domain gate, …) | ported (`execute_script`, `verify_context`, `dispatch_hooks`, `include`, HITL — see `ORCH-DIALECT.md`) |
263
+
264
+ That intended path — fold this mechanism back into `run-skill.py` — is now moot:
265
+ the declarative tier was retired instead, and this engine won. What remains of
266
+ `run-skill.py` is its YAML loader, which `orchestrator.py` imports (see the note
267
+ at the top of this file).
268
+
269
+ ## Not yet (deliberately)
270
+
271
+ - Structured output parsed from a trailing JSON fence (one retry on fresh
272
+ strategies), not enforced via a schema.
273
+ - Gemini isolation is best-effort (no `--bare` equivalent); a `GEMINI.md` in the
274
+ working directory would still load.
275
+ - No provider-side prompt-cache warming; `load_standards` keeps the system
276
+ prefix byte-stable across steps so a provider cache CAN hit, but nothing
277
+ primes it.
278
+ - No session context ledger for the `agent` strategy (run-skill's
279
+ cross-command dedup); fresh strategies don't need one.
280
+
281
+ (The deterministic dispatcher — scripts, gates, hooks, domain-select, includes,
282
+ HITL — IS now ported; see `.appweaver/ORCH-DIALECT.md`.)
283
+
284
+
285
+ # spawn (Strategy 3) — demo skill
286
+ python3 .appweaver/orchestrator/orchestrator.py .appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml \
287
+ --strategy spawn --agent-profile .claude/agent.json --isolation bare --json
288
+
289
+ # sdk (Strategy 1) — demo skill
290
+ python3 .appweaver/orchestrator/orchestrator.py .appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml \
291
+ --strategy sdk --agent-profile .claude/agent.json --model opus --json
292
+
293
+ # sdk-apply (Strategy 2) — demo skill, then follow the suspend/resume loop
294
+ python3 .appweaver/orchestrator/orchestrator.py .appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml \
295
+ --strategy sdk-apply --agent-profile .claude/agent.json \
296
+ --checkpoint .appweaver/orchestrator/.demo-out/demo.state.json --json
297
+
298
+ # agent (Strategy 4) — demo skill, then follow the suspend/resume loop
299
+ python3 .appweaver/orchestrator/orchestrator.py .appweaver/orchestrator/workflows/aw-spec-demo.orch.yaml \
300
+ --strategy agent --checkpoint .appweaver/orchestrator/.demo-out/demo.state.json --json
@@ -0,0 +1,74 @@
1
+ """claude-agent-sdk adapter — a shared SDK adapter, loaded by the
2
+ aw-orchestrator engine when an agent profile's `sdk.adapter` points here
3
+ (both .claude/agent.json and .kilocode/agent.json do). Adapters live in this
4
+ library keyed by SDK, not by agent: everything claude-agent-sdk-specific is
5
+ HERE, the engine ships no SDK code of its own, and each profile declares
6
+ which adapter drives its SDK.
7
+
8
+ Contract (see orchestrator.py `_run_sdk`):
9
+ generate(request) -> str # the model's final reply text
10
+ request keys:
11
+ system interpreter-assembled system block (standards + rules)
12
+ user interpreter-assembled user block (context + task)
13
+ tools comma-separated tool allowlist for the fresh session
14
+ permission_mode neutral mode: readonly | acceptEdits |
15
+ bypassPermissions | default
16
+ model model name or None
17
+ sdk the profile's full sdk block (for adapter options)
18
+ generate may be sync or async — the engine handles both.
19
+ """
20
+ import os
21
+
22
+
23
+ def _dotenv_get(name):
24
+ """Look up one key in ./.env then ~/.env (workspace wins); None if absent."""
25
+ for env_path in (os.path.join(os.getcwd(), ".env"), os.path.expanduser("~/.env")):
26
+ if not os.path.exists(env_path):
27
+ continue
28
+ with open(env_path, "r", encoding="utf-8") as fh:
29
+ for line in fh:
30
+ line = line.strip()
31
+ if line and not line.startswith("#") and "=" in line:
32
+ k, v = line.split("=", 1)
33
+ if k.strip() == name:
34
+ return v.strip().strip("'\"")
35
+ return None
36
+
37
+
38
+ # the SDK authenticates via ANTHROPIC_API_KEY (unless the claude CLI login is
39
+ # available); a value exported in the shell always wins — the .env lookup only
40
+ # fills the gap when nothing is exported
41
+ _key = _dotenv_get("ANTHROPIC_API_KEY")
42
+ if _key:
43
+ os.environ.setdefault("ANTHROPIC_API_KEY", _key)
44
+
45
+ from claude_agent_sdk import ClaudeAgentOptions, query
46
+
47
+ # neutral permission modes → SDK modes ('readonly' is the workflow's notion,
48
+ # not an SDK mode — read-only is enforced by the tools allowlist)
49
+ _PERMISSION_MAP = {"acceptEdits": "acceptEdits",
50
+ "bypassPermissions": "bypassPermissions",
51
+ "default": "default", "readonly": "default"}
52
+
53
+
54
+ async def generate(request):
55
+ kwargs = dict(
56
+ system_prompt=request["system"],
57
+ allowed_tools=[t.strip() for t in (request.get("tools") or "").split(",")
58
+ if t.strip()],
59
+ permission_mode=_PERMISSION_MAP.get(request["permission_mode"], "default"),
60
+ setting_sources=[], # isolation: no CLAUDE.md / settings / hooks
61
+ )
62
+ if request.get("model"):
63
+ kwargs["model"] = request["model"]
64
+ options = ClaudeAgentOptions(**kwargs)
65
+ raw, texts = "", []
66
+ async for msg in query(prompt=request["user"], options=options):
67
+ r = getattr(msg, "result", None)
68
+ if isinstance(r, str) and r:
69
+ raw = r # ResultMessage: the final reply text
70
+ for blk in getattr(msg, "content", None) or []:
71
+ t = getattr(blk, "text", None)
72
+ if t:
73
+ texts.append(t)
74
+ return raw or "\n".join(texts)
@@ -0,0 +1,74 @@
1
+ """google-antigravity adapter — a shared SDK adapter, loaded by the
2
+ aw-orchestrator engine when an agent profile's `sdk.adapter` points here
3
+ (.agents/agent.json does). Adapters live in this library keyed by SDK, not
4
+ by agent: everything google-antigravity-specific is HERE, the engine ships
5
+ no SDK code of its own, and each profile declares which adapter drives its
6
+ SDK.
7
+
8
+ Contract (see orchestrator.py `_run_sdk`):
9
+ generate(request) -> str # the model's final reply text
10
+ request keys:
11
+ system interpreter-assembled system block (standards + rules)
12
+ user interpreter-assembled user block (context + task)
13
+ tools the workflow's neutral tools list (informational here;
14
+ Antigravity governs capability via policies instead)
15
+ permission_mode neutral mode: readonly | acceptEdits |
16
+ bypassPermissions | default
17
+ model model name or None
18
+ sdk the profile's full sdk block (for adapter options)
19
+ generate may be sync or async — the engine handles both.
20
+ """
21
+ import os
22
+
23
+
24
+ def _dotenv_get(name):
25
+ """Look up one key in ./.env then ~/.env (workspace wins); None if absent."""
26
+ for env_path in (os.path.join(os.getcwd(), ".env"), os.path.expanduser("~/.env")):
27
+ if not os.path.exists(env_path):
28
+ continue
29
+ with open(env_path, "r", encoding="utf-8") as fh:
30
+ for line in fh:
31
+ line = line.strip()
32
+ if line and not line.startswith("#") and "=" in line:
33
+ k, v = line.split("=", 1)
34
+ if k.strip() == name:
35
+ return v.strip().strip("'\"")
36
+ return None
37
+
38
+
39
+ # the SDK authenticates via GEMINI_API_KEY; a value exported in the shell
40
+ # always wins — the .env lookup only fills the gap when nothing is exported
41
+ _key = _dotenv_get("GEMINI_API_KEY")
42
+ if _key:
43
+ os.environ.setdefault("GEMINI_API_KEY", _key)
44
+
45
+ from google.antigravity import Agent, LocalAgentConfig
46
+ from google.antigravity.hooks import policy
47
+
48
+ # tools an isolated reviewer may use when the workflow asks for readonly
49
+ _READONLY_TOOLS = ("view_file", "list_directory", "search_directory",
50
+ "find_file", "finish", "ask_question")
51
+
52
+
53
+ def _policies(permission_mode):
54
+ """Neutral permission modes → Antigravity policy chains."""
55
+ if permission_mode == "readonly":
56
+ return [policy.deny_all()] + [policy.allow(t) for t in _READONLY_TOOLS]
57
+ if permission_mode == "bypassPermissions":
58
+ return [policy.allow_all()]
59
+ # acceptEdits / default: edits proceed, shell commands need confirmation
60
+ return [policy.confirm_run_command()]
61
+
62
+
63
+ async def generate(request):
64
+ config = LocalAgentConfig(
65
+ system_instructions=request["system"],
66
+ policies=_policies(request["permission_mode"]),
67
+ # a fresh SDK session has no workspace by default; grant the project
68
+ # root so the isolated generation can read/write the files it decides
69
+ workspaces=[os.getcwd()],
70
+ model=request.get("model") or None,
71
+ )
72
+ async with Agent(config=config) as agent:
73
+ response = await agent.chat(request["user"])
74
+ return await response.text()