@mytechtoday/augment-extensions 3.1.2 → 3.3.0

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 (386) hide show
  1. package/AGENTS.md +127 -0
  2. package/README.md +1050 -32
  3. package/augment-extensions/coding-standards/java/CHANGELOG.md +12 -0
  4. package/augment-extensions/coding-standards/java/README.md +54 -0
  5. package/augment-extensions/coding-standards/java/examples/SearchRequest.java +13 -0
  6. package/augment-extensions/coding-standards/java/metadata.json +36 -0
  7. package/augment-extensions/coding-standards/java/module.json +35 -0
  8. package/augment-extensions/coding-standards/java/rules/language-and-api-design.md +45 -0
  9. package/augment-extensions/coding-standards/java/rules/reliability-and-concurrency.md +43 -0
  10. package/augment-extensions/coding-standards/java/rules/testing-tooling-and-security.md +39 -0
  11. package/augment-extensions/coding-standards/q/CHANGELOG.md +16 -0
  12. package/augment-extensions/coding-standards/q/README.md +53 -0
  13. package/augment-extensions/coding-standards/q/examples/ArrayAndTupleNamingConventions.qs +27 -0
  14. package/augment-extensions/coding-standards/q/examples/CallableAliasNamingConventions.qs +20 -0
  15. package/augment-extensions/coding-standards/q/examples/CircuitCompositionNamingConventions.qs +24 -0
  16. package/augment-extensions/coding-standards/q/examples/ConstantValueNamingConventions.qs +19 -0
  17. package/augment-extensions/coding-standards/q/examples/EntryPointAttributeNamingConventions.qs +17 -0
  18. package/augment-extensions/coding-standards/q/examples/FunctorApplicationInControlledCircuits.qs +84 -0
  19. package/augment-extensions/coding-standards/q/examples/FunctorSpecializationNamingConventions.qs +29 -0
  20. package/augment-extensions/coding-standards/q/examples/GenericTypeParameterNamingConventions.qs +20 -0
  21. package/augment-extensions/coding-standards/q/examples/HamiltonianOperatorNamingConventions.qs +24 -0
  22. package/augment-extensions/coding-standards/q/examples/MeasurementResultNamingConventions.qs +48 -0
  23. package/augment-extensions/coding-standards/q/examples/NamespaceNamingConventions.qs +30 -0
  24. package/augment-extensions/coding-standards/q/examples/OperationAndFunctionNamingConventions.qs +31 -0
  25. package/augment-extensions/coding-standards/q/examples/OracleCallableNamingConventions.qs +41 -0
  26. package/augment-extensions/coding-standards/q/examples/PauliBasisNamingConventions.qs +42 -0
  27. package/augment-extensions/coding-standards/q/examples/PauliOperatorNamingConventions.qs +24 -0
  28. package/augment-extensions/coding-standards/q/examples/QubitManagementAndTeleportation.qs +94 -0
  29. package/augment-extensions/coding-standards/q/examples/QubitNamingConventions.qs +53 -0
  30. package/augment-extensions/coding-standards/q/examples/QubitRegisterNamingConventions.qs +30 -0
  31. package/augment-extensions/coding-standards/q/examples/StateVectorNamingConventions.qs +23 -0
  32. package/augment-extensions/coding-standards/q/examples/UserDefinedTypeNamingConventions.qs +22 -0
  33. package/augment-extensions/coding-standards/q/examples/VariableAndParameterNamingConventions.qs +26 -0
  34. package/augment-extensions/coding-standards/q/examples/bell-state.qs +21 -0
  35. package/augment-extensions/coding-standards/q/metadata.json +38 -0
  36. package/augment-extensions/coding-standards/q/module.json +29 -0
  37. package/augment-extensions/coding-standards/q/rules/q-error-handling.md +143 -0
  38. package/augment-extensions/coding-standards/q/rules/q-naming-conventions.md +82 -0
  39. package/augment-extensions/coding-standards/q/rules/q-performance-optimization.md +10 -0
  40. package/augment-extensions/coding-standards/q/rules/q-qubit-management.md +10 -0
  41. package/augment-extensions/coding-standards/q/rules/q-security.md +10 -0
  42. package/augment-extensions/coding-standards/q/rules/q-standards.md +127 -0
  43. package/augment-extensions/coding-standards/q/rules/q-testing.md +10 -0
  44. package/augment-extensions/coding-standards/spring/CHANGELOG.md +12 -0
  45. package/augment-extensions/coding-standards/spring/README.md +61 -0
  46. package/augment-extensions/coding-standards/spring/examples/OrderController.java +40 -0
  47. package/augment-extensions/coding-standards/spring/metadata.json +39 -0
  48. package/augment-extensions/coding-standards/spring/module.json +38 -0
  49. package/augment-extensions/coding-standards/spring/rules/beans-configuration-and-boot.md +39 -0
  50. package/augment-extensions/coding-standards/spring/rules/data-testing-and-transactions.md +36 -0
  51. package/augment-extensions/coding-standards/spring/rules/production-operations.md +40 -0
  52. package/augment-extensions/coding-standards/spring/rules/web-apis-and-security.md +43 -0
  53. package/augment-extensions/visual-design/CHANGELOG.md +2 -2
  54. package/augment-extensions/visual-design/README.md +31 -8
  55. package/augment-extensions/visual-design/VERSION +1 -0
  56. package/augment-extensions/visual-design/__tests__/README.md +32 -18
  57. package/augment-extensions/visual-design/__tests__/guidance-contract.test.ts +355 -0
  58. package/augment-extensions/visual-design/__tests__/vendor-styles.test.ts +23 -5
  59. package/augment-extensions/visual-design/domains/other/dotnet-application.ts +1 -1
  60. package/augment-extensions/visual-design/domains/other/mobile-application.ts +3 -4
  61. package/augment-extensions/visual-design/domains/other/os-application.ts +1 -1
  62. package/augment-extensions/visual-design/domains/other/windows-platform.ts +1 -1
  63. package/augment-extensions/visual-design/domains/web-page-styles/amazon-cloudscape.ts +4 -4
  64. package/augment-extensions/visual-design/domains/web-page-styles/google-modern.ts +10 -10
  65. package/augment-extensions/visual-design/domains/web-page-styles/microsoft-fluent.ts +3 -3
  66. package/augment-extensions/visual-design/examples/README.md +2 -0
  67. package/augment-extensions/visual-design/examples/basic-usage.md +5 -3
  68. package/augment-extensions/visual-design/examples/vendor-comparison.md +2 -2
  69. package/augment-extensions/visual-design/guidelines/coverage-map.md +30 -0
  70. package/augment-extensions/visual-design/guidelines/design-levels.md +211 -0
  71. package/augment-extensions/visual-design/guidelines/index.md +5 -0
  72. package/augment-extensions/visual-design/metadata.json +26 -5
  73. package/augment-extensions/visual-design/module.json +39 -6
  74. package/augment-extensions/visual-design/rules/accessibility-and-color.md +51 -0
  75. package/augment-extensions/visual-design/rules/design-practice.md +55 -0
  76. package/augment-extensions/visual-design/rules/index.md +34 -0
  77. package/augment-extensions/visual-design/rules/platform-guidance.md +47 -0
  78. package/augment-extensions/visual-design/scripts/validate-guidance.cjs +233 -0
  79. package/augment-extensions/visual-design/skills/README.md +11 -0
  80. package/augment-extensions/visual-design/skills/design-brief.md +40 -0
  81. package/augment-extensions/visual-design/skills/design-review.md +38 -0
  82. package/augment-extensions/visual-design/skills/responsive-validation/SKILL.md +94 -0
  83. package/augment-extensions/visual-design/skills/responsive-validation/scripts/responsive-sweep.cjs +457 -0
  84. package/augment-extensions/visual-design/style-selector.ts +4 -4
  85. package/augment-extensions/visual-design/types.ts +101 -46
  86. package/augment-extensions/visual-design/visual-design-core.ts +8 -8
  87. package/augment-extensions/workflows/agent-engineering/README.md +67 -0
  88. package/augment-extensions/workflows/agent-engineering/examples/contracts.cjs +89 -0
  89. package/augment-extensions/workflows/agent-engineering/examples/demo.cjs +17 -0
  90. package/augment-extensions/workflows/agent-engineering/examples/evaluation-cases.json +7 -0
  91. package/augment-extensions/workflows/agent-engineering/examples/graphs.cjs +149 -0
  92. package/augment-extensions/workflows/agent-engineering/examples/loop.cjs +125 -0
  93. package/augment-extensions/workflows/agent-engineering/examples/recovery.cjs +51 -0
  94. package/augment-extensions/workflows/agent-engineering/examples/stub.cjs +11 -0
  95. package/augment-extensions/workflows/agent-engineering/examples/verify.cjs +21 -0
  96. package/augment-extensions/workflows/agent-engineering/module.json +24 -0
  97. package/augment-extensions/workflows/agent-engineering/rules/01-adoption.md +30 -0
  98. package/augment-extensions/workflows/agent-engineering/rules/02-agents.md +34 -0
  99. package/augment-extensions/workflows/agent-engineering/rules/03-contracts.md +34 -0
  100. package/augment-extensions/workflows/agent-engineering/rules/04-loops.md +39 -0
  101. package/augment-extensions/workflows/agent-engineering/rules/05-graphs.md +39 -0
  102. package/augment-extensions/workflows/agent-engineering/rules/06-improvement.md +38 -0
  103. package/augment-extensions/workflows/agent-engineering/schemas/contracts.schema.json +1 -0
  104. package/augment-extensions/workflows/agent-engineering/scripts/validate.cjs +32 -0
  105. package/augment-extensions/workflows/agent-engineering/sources.md +12 -0
  106. package/augment-extensions/workflows/agent-engineering/templates/agent.json +40 -0
  107. package/augment-extensions/workflows/agent-engineering/templates/check-tool.json +94 -0
  108. package/augment-extensions/workflows/agent-engineering/templates/evidence.json +29 -0
  109. package/augment-extensions/workflows/agent-engineering/templates/invocation.json +40 -0
  110. package/augment-extensions/workflows/agent-engineering/templates/node.json +27 -0
  111. package/augment-extensions/workflows/agent-engineering/templates/state.json +27 -0
  112. package/augment-extensions/workflows/agent-engineering/templates/task.json +40 -0
  113. package/augment-extensions/workflows/agent-engineering/templates/tool.json +52 -0
  114. package/augment-extensions/workflows/decision-layer/README.md +136 -0
  115. package/augment-extensions/workflows/decision-layer/examples/call-inventory.json +6 -0
  116. package/augment-extensions/workflows/decision-layer/examples/config.json +9 -0
  117. package/augment-extensions/workflows/decision-layer/examples/decision.json +13 -0
  118. package/augment-extensions/workflows/decision-layer/examples/labeled-cases.json +410 -0
  119. package/augment-extensions/workflows/decision-layer/examples/source.txt +3 -0
  120. package/augment-extensions/workflows/decision-layer/examples/task.json +8 -0
  121. package/augment-extensions/workflows/decision-layer/installation/package-lock.json +27 -0
  122. package/augment-extensions/workflows/decision-layer/installation/package.json +7 -0
  123. package/augment-extensions/workflows/decision-layer/installation/sources.json +18 -0
  124. package/augment-extensions/workflows/decision-layer/module.json +24 -0
  125. package/augment-extensions/workflows/decision-layer/rules/00-index.md +5 -0
  126. package/augment-extensions/workflows/decision-layer/rules/01-responsibilities.md +15 -0
  127. package/augment-extensions/workflows/decision-layer/rules/02-operation.md +13 -0
  128. package/augment-extensions/workflows/decision-layer/runtime/cli.cjs +70 -0
  129. package/augment-extensions/workflows/decision-layer/runtime/common.cjs +85 -0
  130. package/augment-extensions/workflows/decision-layer/runtime/contracts.d.ts +8 -0
  131. package/augment-extensions/workflows/decision-layer/runtime/decisions.cjs +198 -0
  132. package/augment-extensions/workflows/decision-layer/runtime/evaluate.cjs +61 -0
  133. package/augment-extensions/workflows/decision-layer/runtime/install.cjs +186 -0
  134. package/augment-extensions/workflows/decision-layer/runtime/integrations.cjs +64 -0
  135. package/augment-extensions/workflows/decision-layer/runtime/runner.cjs +201 -0
  136. package/augment-extensions/workflows/decision-layer/runtime/worker-child.cjs +15 -0
  137. package/augment-extensions/workflows/decision-layer/runtime/workers.cjs +15 -0
  138. package/augment-extensions/workflows/decision-layer/schemas/config.schema.json +27 -0
  139. package/augment-extensions/workflows/decision-layer/scripts/validate.cjs +16 -0
  140. package/augment-extensions/workflows/decision-layer/sources.md +25 -0
  141. package/cli/MODULES.md +804 -302
  142. package/cli/dist/__test_file-tracking.d.ts +2 -0
  143. package/cli/dist/__test_file-tracking.d.ts.map +1 -0
  144. package/cli/dist/__test_file-tracking.js +4 -0
  145. package/cli/dist/__test_file-tracking.js.map +1 -0
  146. package/cli/dist/adapters/banner.d.ts +62 -0
  147. package/cli/dist/adapters/banner.d.ts.map +1 -0
  148. package/cli/dist/adapters/banner.js +105 -0
  149. package/cli/dist/adapters/banner.js.map +1 -0
  150. package/cli/dist/adapters/claude-code.d.ts +13 -0
  151. package/cli/dist/adapters/claude-code.d.ts.map +1 -0
  152. package/cli/dist/adapters/claude-code.js +79 -0
  153. package/cli/dist/adapters/claude-code.js.map +1 -0
  154. package/cli/dist/adapters/copilot.d.ts +17 -0
  155. package/cli/dist/adapters/copilot.d.ts.map +1 -0
  156. package/cli/dist/adapters/copilot.js +81 -0
  157. package/cli/dist/adapters/copilot.js.map +1 -0
  158. package/cli/dist/adapters/cursor.d.ts +16 -0
  159. package/cli/dist/adapters/cursor.d.ts.map +1 -0
  160. package/cli/dist/adapters/cursor.js +99 -0
  161. package/cli/dist/adapters/cursor.js.map +1 -0
  162. package/cli/dist/adapters/index.d.ts +25 -0
  163. package/cli/dist/adapters/index.d.ts.map +1 -0
  164. package/cli/dist/adapters/index.js +59 -0
  165. package/cli/dist/adapters/index.js.map +1 -0
  166. package/cli/dist/adapters/types.d.ts +113 -0
  167. package/cli/dist/adapters/types.d.ts.map +1 -0
  168. package/cli/dist/adapters/types.js +13 -0
  169. package/cli/dist/adapters/types.js.map +1 -0
  170. package/cli/dist/adapters/windsurf.d.ts +14 -0
  171. package/cli/dist/adapters/windsurf.d.ts.map +1 -0
  172. package/cli/dist/adapters/windsurf.js +78 -0
  173. package/cli/dist/adapters/windsurf.js.map +1 -0
  174. package/cli/dist/analysis/ast-parser.d.ts.map +1 -1
  175. package/cli/dist/analysis/ast-parser.js +25 -9
  176. package/cli/dist/analysis/ast-parser.js.map +1 -1
  177. package/cli/dist/analysis/index.d.ts +1 -0
  178. package/cli/dist/analysis/index.d.ts.map +1 -1
  179. package/cli/dist/analysis/index.js +1 -0
  180. package/cli/dist/analysis/index.js.map +1 -1
  181. package/cli/dist/analysis/pattern-analyzer.d.ts +6 -0
  182. package/cli/dist/analysis/pattern-analyzer.d.ts.map +1 -0
  183. package/cli/dist/analysis/pattern-analyzer.js +100 -0
  184. package/cli/dist/analysis/pattern-analyzer.js.map +1 -0
  185. package/cli/dist/cli.js +67 -37
  186. package/cli/dist/cli.js.map +1 -1
  187. package/cli/dist/commands/code-analysis.d.ts.map +1 -1
  188. package/cli/dist/commands/code-analysis.js +22 -2
  189. package/cli/dist/commands/code-analysis.js.map +1 -1
  190. package/cli/dist/commands/decision.d.ts +4 -0
  191. package/cli/dist/commands/decision.d.ts.map +1 -0
  192. package/cli/dist/commands/decision.js +32 -0
  193. package/cli/dist/commands/decision.js.map +1 -0
  194. package/cli/dist/commands/export.d.ts +81 -0
  195. package/cli/dist/commands/export.d.ts.map +1 -0
  196. package/cli/dist/commands/export.js +334 -0
  197. package/cli/dist/commands/export.js.map +1 -0
  198. package/cli/dist/commands/gui-decision.d.ts +6 -0
  199. package/cli/dist/commands/gui-decision.d.ts.map +1 -0
  200. package/cli/dist/commands/gui-decision.js +189 -0
  201. package/cli/dist/commands/gui-decision.js.map +1 -0
  202. package/cli/dist/commands/gui-module-manager.d.ts +14 -0
  203. package/cli/dist/commands/gui-module-manager.d.ts.map +1 -0
  204. package/cli/dist/commands/gui-module-manager.js +326 -0
  205. package/cli/dist/commands/gui-module-manager.js.map +1 -0
  206. package/cli/dist/commands/gui.d.ts +5 -9
  207. package/cli/dist/commands/gui.d.ts.map +1 -1
  208. package/cli/dist/commands/gui.js +186 -231
  209. package/cli/dist/commands/gui.js.map +1 -1
  210. package/cli/dist/commands/init.d.ts +2 -0
  211. package/cli/dist/commands/init.d.ts.map +1 -1
  212. package/cli/dist/commands/init.js +84 -3
  213. package/cli/dist/commands/init.js.map +1 -1
  214. package/cli/dist/commands/lifecycle.d.ts +14 -0
  215. package/cli/dist/commands/lifecycle.d.ts.map +1 -0
  216. package/cli/dist/commands/lifecycle.js +463 -0
  217. package/cli/dist/commands/lifecycle.js.map +1 -0
  218. package/cli/dist/commands/link.d.ts +5 -0
  219. package/cli/dist/commands/link.d.ts.map +1 -1
  220. package/cli/dist/commands/link.js +137 -29
  221. package/cli/dist/commands/link.js.map +1 -1
  222. package/cli/dist/commands/list.js +2 -2
  223. package/cli/dist/commands/list.js.map +1 -1
  224. package/cli/dist/commands/mcp.d.ts +1 -2
  225. package/cli/dist/commands/mcp.d.ts.map +1 -1
  226. package/cli/dist/commands/mcp.js +20 -20
  227. package/cli/dist/commands/mcp.js.map +1 -1
  228. package/cli/dist/commands/module-management.d.ts +9 -0
  229. package/cli/dist/commands/module-management.d.ts.map +1 -0
  230. package/cli/dist/commands/module-management.js +420 -0
  231. package/cli/dist/commands/module-management.js.map +1 -0
  232. package/cli/dist/commands/search.js +1 -11
  233. package/cli/dist/commands/search.js.map +1 -1
  234. package/cli/dist/commands/self-remove.d.ts.map +1 -1
  235. package/cli/dist/commands/self-remove.js +98 -44
  236. package/cli/dist/commands/self-remove.js.map +1 -1
  237. package/cli/dist/commands/show.d.ts +1 -1
  238. package/cli/dist/commands/show.d.ts.map +1 -1
  239. package/cli/dist/commands/show.js +21 -10
  240. package/cli/dist/commands/show.js.map +1 -1
  241. package/cli/dist/commands/showCompleted.d.ts +1 -0
  242. package/cli/dist/commands/showCompleted.d.ts.map +1 -1
  243. package/cli/dist/commands/showCompleted.js +4 -3
  244. package/cli/dist/commands/showCompleted.js.map +1 -1
  245. package/cli/dist/commands/skill.d.ts +7 -1
  246. package/cli/dist/commands/skill.d.ts.map +1 -1
  247. package/cli/dist/commands/skill.js +79 -21
  248. package/cli/dist/commands/skill.js.map +1 -1
  249. package/cli/dist/commands/unlink.d.ts +2 -0
  250. package/cli/dist/commands/unlink.d.ts.map +1 -1
  251. package/cli/dist/commands/unlink.js +86 -44
  252. package/cli/dist/commands/unlink.js.map +1 -1
  253. package/cli/dist/commands/update.d.ts.map +1 -1
  254. package/cli/dist/commands/update.js +6 -16
  255. package/cli/dist/commands/update.js.map +1 -1
  256. package/cli/dist/commands/upgrade.d.ts +2 -0
  257. package/cli/dist/commands/upgrade.d.ts.map +1 -1
  258. package/cli/dist/commands/upgrade.js +22 -5
  259. package/cli/dist/commands/upgrade.js.map +1 -1
  260. package/cli/dist/commands/use.d.ts.map +1 -1
  261. package/cli/dist/commands/use.js +2 -68
  262. package/cli/dist/commands/use.js.map +1 -1
  263. package/cli/dist/core/compatibility-checker.d.ts +37 -1
  264. package/cli/dist/core/compatibility-checker.d.ts.map +1 -1
  265. package/cli/dist/core/compatibility-checker.js +133 -12
  266. package/cli/dist/core/compatibility-checker.js.map +1 -1
  267. package/cli/dist/gui/state/navigation-state.d.ts +20 -0
  268. package/cli/dist/gui/state/navigation-state.d.ts.map +1 -0
  269. package/cli/dist/gui/state/navigation-state.js +115 -0
  270. package/cli/dist/gui/state/navigation-state.js.map +1 -0
  271. package/cli/dist/gui/state/selection-state.d.ts +21 -0
  272. package/cli/dist/gui/state/selection-state.d.ts.map +1 -0
  273. package/cli/dist/gui/state/selection-state.js +117 -0
  274. package/cli/dist/gui/state/selection-state.js.map +1 -0
  275. package/cli/dist/lib/export-runner.d.ts +76 -0
  276. package/cli/dist/lib/export-runner.d.ts.map +1 -0
  277. package/cli/dist/lib/export-runner.js +111 -0
  278. package/cli/dist/lib/export-runner.js.map +1 -0
  279. package/cli/dist/lib/mcp-detection.d.ts +40 -0
  280. package/cli/dist/lib/mcp-detection.d.ts.map +1 -0
  281. package/cli/dist/lib/mcp-detection.js +167 -0
  282. package/cli/dist/lib/mcp-detection.js.map +1 -0
  283. package/cli/dist/lib/mirror-coordination.d.ts +57 -0
  284. package/cli/dist/lib/mirror-coordination.d.ts.map +1 -0
  285. package/cli/dist/lib/mirror-coordination.js +151 -0
  286. package/cli/dist/lib/mirror-coordination.js.map +1 -0
  287. package/cli/dist/lib/mirror-runner.d.ts +123 -0
  288. package/cli/dist/lib/mirror-runner.d.ts.map +1 -0
  289. package/cli/dist/lib/mirror-runner.js +579 -0
  290. package/cli/dist/lib/mirror-runner.js.map +1 -0
  291. package/cli/dist/lib/module-resolver.d.ts +65 -0
  292. package/cli/dist/lib/module-resolver.d.ts.map +1 -0
  293. package/cli/dist/lib/module-resolver.js +211 -0
  294. package/cli/dist/lib/module-resolver.js.map +1 -0
  295. package/cli/dist/lib/source-hash.d.ts +62 -0
  296. package/cli/dist/lib/source-hash.d.ts.map +1 -0
  297. package/cli/dist/lib/source-hash.js +99 -0
  298. package/cli/dist/lib/source-hash.js.map +1 -0
  299. package/cli/dist/types/coordination-export.d.ts +33 -0
  300. package/cli/dist/types/coordination-export.d.ts.map +1 -0
  301. package/cli/dist/types/coordination-export.js +28 -0
  302. package/cli/dist/types/coordination-export.js.map +1 -0
  303. package/cli/dist/types/gui.d.ts +4 -0
  304. package/cli/dist/types/gui.d.ts.map +1 -1
  305. package/cli/dist/types/lifecycle.d.ts +81 -0
  306. package/cli/dist/types/lifecycle.d.ts.map +1 -0
  307. package/cli/dist/types/lifecycle.js +3 -0
  308. package/cli/dist/types/lifecycle.js.map +1 -0
  309. package/cli/dist/utils/beads-sync.d.ts +4 -0
  310. package/cli/dist/utils/beads-sync.d.ts.map +1 -1
  311. package/cli/dist/utils/beads-sync.js.map +1 -1
  312. package/cli/dist/utils/catalog-sync.d.ts.map +1 -1
  313. package/cli/dist/utils/catalog-sync.js +41 -8
  314. package/cli/dist/utils/catalog-sync.js.map +1 -1
  315. package/cli/dist/utils/coordination-queries.d.ts +3 -0
  316. package/cli/dist/utils/coordination-queries.d.ts.map +1 -1
  317. package/cli/dist/utils/coordination-queries.js +2 -2
  318. package/cli/dist/utils/coordination-queries.js.map +1 -1
  319. package/cli/dist/utils/decision-runner.d.ts +18 -0
  320. package/cli/dist/utils/decision-runner.d.ts.map +1 -0
  321. package/cli/dist/utils/decision-runner.js +114 -0
  322. package/cli/dist/utils/decision-runner.js.map +1 -0
  323. package/cli/dist/utils/extensions-config.d.ts +29 -0
  324. package/cli/dist/utils/extensions-config.d.ts.map +1 -0
  325. package/cli/dist/utils/extensions-config.js +151 -0
  326. package/cli/dist/utils/extensions-config.js.map +1 -0
  327. package/cli/dist/utils/extractCommandHelp.d.ts +2 -2
  328. package/cli/dist/utils/extractCommandHelp.d.ts.map +1 -1
  329. package/cli/dist/utils/extractCommandHelp.js +10 -4
  330. package/cli/dist/utils/extractCommandHelp.js.map +1 -1
  331. package/cli/dist/utils/file-tracking.d.ts +4 -0
  332. package/cli/dist/utils/file-tracking.d.ts.map +1 -1
  333. package/cli/dist/utils/file-tracking.js +5 -5
  334. package/cli/dist/utils/file-tracking.js.map +1 -1
  335. package/cli/dist/utils/glob-match.d.ts +6 -0
  336. package/cli/dist/utils/glob-match.d.ts.map +1 -0
  337. package/cli/dist/utils/glob-match.js +8 -0
  338. package/cli/dist/utils/glob-match.js.map +1 -0
  339. package/cli/dist/utils/gui-helpers.d.ts.map +1 -1
  340. package/cli/dist/utils/gui-helpers.js +7 -3
  341. package/cli/dist/utils/gui-helpers.js.map +1 -1
  342. package/cli/dist/utils/inspection-cache.d.ts +8 -0
  343. package/cli/dist/utils/inspection-cache.d.ts.map +1 -1
  344. package/cli/dist/utils/inspection-cache.js +12 -0
  345. package/cli/dist/utils/inspection-cache.js.map +1 -1
  346. package/cli/dist/utils/inspection-handlers.d.ts.map +1 -1
  347. package/cli/dist/utils/inspection-handlers.js +230 -52
  348. package/cli/dist/utils/inspection-handlers.js.map +1 -1
  349. package/cli/dist/utils/install-rules.d.ts +15 -0
  350. package/cli/dist/utils/install-rules.d.ts.map +1 -1
  351. package/cli/dist/utils/install-rules.js +247 -0
  352. package/cli/dist/utils/install-rules.js.map +1 -1
  353. package/cli/dist/utils/interactive-prompt.d.ts +7 -0
  354. package/cli/dist/utils/interactive-prompt.d.ts.map +1 -0
  355. package/cli/dist/utils/interactive-prompt.js +41 -0
  356. package/cli/dist/utils/interactive-prompt.js.map +1 -0
  357. package/cli/dist/utils/lifecycle.d.ts +47 -0
  358. package/cli/dist/utils/lifecycle.d.ts.map +1 -0
  359. package/cli/dist/utils/lifecycle.js +841 -0
  360. package/cli/dist/utils/lifecycle.js.map +1 -0
  361. package/cli/dist/utils/mcp-integration.d.ts +24 -3
  362. package/cli/dist/utils/mcp-integration.d.ts.map +1 -1
  363. package/cli/dist/utils/mcp-integration.js +364 -151
  364. package/cli/dist/utils/mcp-integration.js.map +1 -1
  365. package/cli/dist/utils/module-system.d.ts +7 -0
  366. package/cli/dist/utils/module-system.d.ts.map +1 -1
  367. package/cli/dist/utils/module-system.js +137 -42
  368. package/cli/dist/utils/module-system.js.map +1 -1
  369. package/cli/dist/utils/modules-catalog.d.ts.map +1 -1
  370. package/cli/dist/utils/modules-catalog.js +5 -0
  371. package/cli/dist/utils/modules-catalog.js.map +1 -1
  372. package/cli/dist/utils/openspec-sync.d.ts +4 -0
  373. package/cli/dist/utils/openspec-sync.d.ts.map +1 -1
  374. package/cli/dist/utils/openspec-sync.js.map +1 -1
  375. package/cli/dist/utils/plugin-system.js +1 -1
  376. package/cli/dist/utils/plugin-system.js.map +1 -1
  377. package/cli/dist/utils/skill-system.d.ts +11 -0
  378. package/cli/dist/utils/skill-system.d.ts.map +1 -1
  379. package/cli/dist/utils/skill-system.js +101 -3
  380. package/cli/dist/utils/skill-system.js.map +1 -1
  381. package/cli/dist/utils/zip-archive.d.ts +25 -0
  382. package/cli/dist/utils/zip-archive.d.ts.map +1 -0
  383. package/cli/dist/utils/zip-archive.js +287 -0
  384. package/cli/dist/utils/zip-archive.js.map +1 -0
  385. package/modules.md +89 -6
  386. package/package.json +150 -135
@@ -0,0 +1,143 @@
1
+ Q# Error Handling
2
+ Authoritative content lives in q-standards.md. This rule file expands the error-handling principles with complete rationales, production-grade examples, anti-patterns, hardware/simulator distinctions, hybrid-host integration, and AI-generation guardrails required for reliable quantum software.
3
+ Why Error Handling Matters in Q#
4
+ Quantum programs operate under extreme resource constraints: every qubit allocation consumes scarce physical or simulated hardware, circuit depth directly impacts decoherence, and measurements are destructive and probabilistic. Unhandled or silently ignored failures waste quantum resources, produce misleading results, and can corrupt entangled states across an entire program. Robust error handling enforces early termination on invalid classical inputs, explicit branching on measurement outcomes, and clear separation between development-time diagnostics and production hardware execution. These practices align with the QDK’s library-first philosophy, the no-cloning theorem, and Azure Quantum’s cost model, where unnecessary shots or failed runs incur real monetary and temporal penalties.
5
+
6
+ 1. Validate Classical Inputs Before Any Qubit Allocation
7
+ Rule: Perform all classical precondition checks and throw via fail before any use or borrow statement. This prevents unnecessary qubit lifetime extension and avoids allocating resources on hardware targets that will immediately fail.
8
+
9
+ Rationale: Qubit allocation is the most expensive operation in both simulators (memory) and real devices (calibration time, queue wait). Early validation keeps the quantum kernel pure and minimal, improving resource estimation accuracy and allowing the classical host to handle input sanitization.
10
+
11
+ Correct Example (standalone operation with full validation)
12
+ operation GroverSearch(nQubits: Int, iterations: Int) : Result[] {
13
+ if (nQubits < 2) {
14
+ fail "Grover search requires at least 2 qubits for meaningful oracle superposition.";
15
+ }
16
+ if (iterations < 0) {
17
+ fail $"Number of iterations must be non-negative; received {iterations}.";
18
+ }
19
+ // All classical validation complete before allocation
20
+ use register = Qubit[nQubits];
21
+ // ... oracle and diffusion implementation ...
22
+ return MeasureAllZ(register);
23
+ }
24
+ Anti-pattern (allocation before validation – rejected by this standard)
25
+ operation BadGrover(nQubits: Int) : Result[] {
26
+ use register = Qubit[nQubits]; // Allocation happens unconditionally
27
+ if (nQubits < 2) { fail "..."; } // Wastes qubits on every call
28
+ // ...
29
+ }
30
+ Edge case: When the operation is called from a controlled functor or inside a within block, early fail still terminates the entire scope cleanly without leaving qubits in an undefined state.
31
+
32
+ 2. Use fail Exclusively for Unrecoverable Quantum-State or Resource Violations
33
+ Rule: Reserve the fail statement for conditions that violate physical invariants, state assumptions, or resource limits that cannot be recovered within the quantum kernel. Never use fail for normal control flow or expected measurement outcomes.
34
+
35
+ Rationale: fail raises an ExecutionFailException (or equivalent runtime exception) that propagates through the Q# runtime and host language, ensuring the entire quantum program aborts. This is the only mechanism that guarantees deterministic termination across simulators, resource estimators, and hardware targets.
36
+
37
+ Supported unrecoverable conditions:
38
+
39
+ Invalid qubit count or register size for a specific algorithm.
40
+ Violation of a known state assumption after a unitary (e.g., expected |0⟩ after an inverse operation).
41
+ Classical parameters outside hardware-supported ranges (e.g., depth exceeding coherence time estimates).
42
+ Post-measurement state that contradicts an assertion required by later operations.
43
+ Correct multi-line example (state assumption after uncomputation)
44
+ operation PrepareAndUncompute(target: Qubit, ancillary: Qubit) : Unit is Adj + Ctl {
45
+ H(target);
46
+ CNOT(target, ancillary);
47
+ // ... oracle application ...
48
+ Adjoint CNOT(target, ancillary); // uncompute
49
+ Adjoint H(target);
50
+ // State must now be |00⟩
51
+ if (MResetZ(ancillary) == One) {
52
+ fail "Uncomputation failed: ancillary did not return to |0⟩ state.";
53
+ }
54
+ }
55
+ Anti-pattern (using return for error signaling – breaks composability)
56
+ operation BadErrorSignal(qubits: Qubit[]) : Result { // Do not do this
57
+ if (Length(qubits) == 0) { return Zero; } // Ambiguous success/failure
58
+ // ...
59
+ }
60
+ 3. Branch Explicitly on Result Values; Convert Only When Necessary
61
+ Rule: Always compare Result values directly with Zero or One. Use Microsoft.Quantum.Convert.ResultAsBool only when interfacing with classical Boolean logic or host-language interop. Never rely on implicit conversion.
62
+
63
+ Rationale: Result is a distinct Q# type with no implicit Boolean conversion. Explicit branching preserves quantum-specific semantics and makes intent obvious to static analyzers, resource estimators, and AI code reviewers.
64
+
65
+ Correct patterns
66
+ let measurement = M(qubit);
67
+ if (measurement == One) {
68
+ X(qubit); // Corrective Pauli
69
+ }
70
+ When conversion is justified (hybrid boundary)
71
+ open Microsoft.Quantum.Convert;
72
+
73
+ operation MeasureAndReport(qubit: Qubit) : Bool {
74
+ let result = M(qubit);
75
+ return ResultAsBool(result); // Explicit, documented conversion for host
76
+ }
77
+ Anti-pattern (implicit or unsafe comparison)
78
+ if (M(qubit)) { ... } // Compile error in modern Q#
79
+ if (M(qubit) == true) { ... } // Type mismatch
80
+ 4. Leverage Microsoft.Quantum.Diagnostics Only During Development
81
+ Rule: Use AssertQubit, AssertAllZero, AssertMeasurementProbability, DumpMachine, and DumpRegister freely in development and testing workflows. Explicitly gate or remove these calls before hardware submission or production resource estimation.
82
+
83
+ Rationale: Diagnostics throw on simulator failure (providing immediate feedback) but are either no-ops or cause undefined behavior on real hardware. Leaving them active inflates circuit depth and can trigger unnecessary queue retries on Azure Quantum.
84
+
85
+ Development-only wrapper pattern (recommended for reusable libraries)
86
+ open Microsoft.Quantum.Diagnostics;
87
+
88
+ function AssertInDev(reg: Qubit[], expected: Result[]) : Unit {
89
+ #if DEBUG
90
+ AssertAllZero(reg); // Only compiled in debug builds
91
+ #endif
92
+ }
93
+ Correct production call site
94
+ operation SafeAlgorithm(register: Qubit[]) : Unit {
95
+ // ... core logic ...
96
+ #if DEBUG
97
+ DumpRegister((), register); // Simulator-only visibility
98
+ #endif
99
+ }
100
+ Hardware-safe alternative: Replace runtime assertions with classical post-processing in the host after measurement results are returned.
101
+
102
+ 5. Surface Quantum Failures as Host-Language Exceptions in Hybrid Applications
103
+ Rule: In Python, C#, or JavaScript host programs, catch Q# fail exceptions and rethrow them as native exceptions. Never implement automatic retry logic inside the quantum kernel or silently swallow failures on real hardware targets.
104
+
105
+ Rationale: Real hardware shots are expensive and non-deterministic. Silent retries violate the principle of least surprise and can mask calibration drift or coherence loss. The classical host is the proper place for retry policies, exponential back-off, or circuit cutting.
106
+
107
+ Python host example (using Azure Quantum or IQ#)
108
+ from qsharp import AzureQuantum, ExecutionFailException
109
+
110
+ try:
111
+ result = my_operation.run(...)
112
+ except ExecutionFailException as e:
113
+ raise RuntimeError(f"Quantum kernel failed: {e.message}") from e
114
+ # Or implement host-level retry with circuit modification
115
+ Prohibited (kernel-level silent retry)
116
+ operation BadRetry(target: Qubit) : Unit {
117
+ mutable attempts = 0;
118
+ while (attempts < 3) {
119
+ let res = M(target);
120
+ if (res == One) { attempts += 1; continue; } // Never do this on hardware
121
+ }
122
+ }
123
+ Common Pitfalls and Anti-Patterns
124
+ Anti-Pattern Why It Violates This Standard Correct Alternative
125
+ Allocating qubits then checking parameters Wastes resources on every invocation Validate before use/borrow
126
+ Using return to signal quantum error Breaks operation composability and functor support Use fail for unrecoverable cases
127
+ Leaving DumpMachine calls in production code Pollutes logs and adds simulator-only overhead Gate behind #if DEBUG or remove
128
+ Implicit Result → bool conversion attempts Compile-time or runtime errors Use ResultAsBool explicitly only at boundaries
129
+ Retry loops inside Q# for hardware failures Ignores decoherence and cost model Surface to host for intelligent retry
130
+ Testing and Debugging Strategies
131
+ Unit tests: Use the Q# testing framework with Microsoft.Quantum.Testing and simulator assertions.
132
+ Resource estimation: Run Estimate on code with all diagnostics removed to obtain accurate T-count and qubit metrics.
133
+ Hardware preview: Submit minimal circuits with validation guards to Azure Quantum’s simulator targets first.
134
+ Logging: Use Message from Microsoft.Quantum.Intrinsic for non-fatal classical debug output; reserve fail for termination.
135
+ AI Code-Generation Implications
136
+ When generating Q# code via Augment Code AI or similar systems:
137
+
138
+ Every public operation must include at least one classical precondition check before qubit allocation.
139
+ All measurement branches must be exhaustive and explicit.
140
+ Diagnostics must be annotated with a clear #if DEBUG guard or equivalent comment explaining removal before hardware deployment.
141
+ Any generated fail message must be descriptive, include variable values where possible, and reference the exact violated invariant.
142
+ Generated hybrid host wrappers must catch and rethrow quantum exceptions without silent recovery.
143
+ Adhering to these rules produces auditable, resource-efficient, and production-ready Q# libraries that integrate seamlessly with the broader Augment Extensions ecosystem.
@@ -0,0 +1,82 @@
1
+ Q# Naming Conventions
2
+ This document defines the authoritative, production-ready naming conventions for Q# within the Augment Extensions ecosystem for Augment Code AI.
3
+ These rules are strictly quantum-specific, optimized for qubit management, circuit readability, resource estimation, functor support, simulator compatibility, and Azure Quantum workflows. Every convention is designed for immediate enforcement by AI augmentation tools.
4
+ Namespaces
5
+ Rule: Namespace names MUST use PascalCase and follow a hierarchical dot-separated structure that reflects logical quantum domains (algorithms, libraries, hardware targets).
6
+ Rationale: Q# namespaces organize the entire quantum codebase. Hierarchical PascalCase mirrors Microsoft.Quantum.* libraries, prevents name collisions in large-scale quantum projects, improves IDE navigation, and enables precise circuit export/resource estimation grouping. Flat or lowercase namespaces degrade discoverability and increase cognitive load when reasoning about entangled subsystems.
7
+
8
+ ✅ Good
9
+ namespace Augment.Quantum.Algorithms.Grover {
10
+ open Microsoft.Quantum.Intrinsic;
11
+ open Microsoft.Quantum.Canon;
12
+
13
+ // Grover search implementation
14
+ }
15
+ ❌ Avoid
16
+ namespace grover_search { // lowercase + snake_case
17
+ // Hard to discover, breaks QDK patterns
18
+ }
19
+ Edge cases: Reusable Augment modules MUST prefix with AugmentQuantum.. Hardware-specific namespaces follow Augment.Quantum.Hardware.IonQ.
20
+
21
+ Operations & Functions (Callables)
22
+ Rule: Operation and function names MUST be PascalCase and verb-led for operations (Prepare, Apply, Measure, Estimate) or descriptive for functions.
23
+ Rationale: Operations define quantum unitary transformations and measurements; clear verb-led names instantly convey circuit intent, simplify functor application (Adj + Ctl), and improve resource estimator output readability. Distinguishing operations from pure functions is critical for hybrid quantum-classical correctness and AI generation accuracy.
24
+
25
+ ✅ Good
26
+ operation PrepareBellState(q1 : Qubit, q2 : Qubit) : Unit is Adj + Ctl {
27
+ H(q1);
28
+ CNOT(q1, q2);
29
+ }
30
+
31
+ function CalculatePhaseEstimationPrecision(nQubits : Int) : Double {
32
+ return 1.0 / (2.0 * IntAsDouble(nQubits));
33
+ }
34
+ ❌ Avoid
35
+ operation bell(q1 : Qubit, q2 : Qubit) : Unit { // vague, not PascalCase
36
+ }
37
+ Exceptions: Intrinsic gates (H, X, CNOT, etc.) retain their canonical short names for literature compatibility.
38
+
39
+ Qubits & Registers
40
+ Rule: Qubit and register identifiers MUST use camelCase and be descriptively named (targetQubit, dataRegister, controlQubits).
41
+ Rationale: Qubits are scarce, stateful resources. Descriptive names reduce allocation errors in use/borrow blocks, improve simulator debugging, and make resource estimation reports far more interpretable. Poor naming leads to subtle bugs in multi-qubit entanglement circuits.
42
+
43
+ use targetQubit = Qubit();
44
+ use dataRegister = Qubit[5];
45
+ use controlQubits = Qubit[3];
46
+ Pitfall: Single-letter names outside tight mathematical contexts (e.g., q only in minimal examples).
47
+
48
+ Variables & Parameters
49
+ Rule: All local variables and parameters MUST use camelCase.
50
+ Rationale: Q# heavily interleaves classical control with quantum operations. camelCase maintains visual consistency with the language’s type system and improves flow in dense loops, measurement post-processing, and hybrid algorithms.
51
+
52
+ let inputAngle = 1.57;
53
+ let nIterations = 10;
54
+ let measurementOutcomes = MeasureAllZ(register);
55
+ Constants & Literals
56
+ Rule: Constants MUST be UPPER_SNAKE_CASE.
57
+ Rationale: Quantum constants frequently represent rotation angles (π/4), tolerance thresholds, or circuit depths. UPPER_SNAKE_CASE clearly separates immutable values from mutable quantum state, aiding maintenance and static analysis tools.
58
+
59
+ const PI_OVER_4 = 0.7853981633974483;
60
+ const MAX_SIMULATOR_QUBITS = 30;
61
+ User-Defined Types (UDTs)
62
+ Rule: UDT names MUST be PascalCase.
63
+ Rationale: UDTs encapsulate complex quantum data (amplitudes, Hamiltonians, measurement results). PascalCase aligns with Q#’s type system and improves type safety in AI-generated code for large quantum simulations.
64
+
65
+ newtype ComplexAmplitude = (Real : Double, Imag : Double);
66
+ newtype QuantumStateVector = (Qubits : Qubit[], Amplitudes : ComplexAmplitude[]);
67
+ Files & Modules
68
+ Rule: Q# source files (.qs) MUST use kebab-case (e.g., bell-state-preparation.qs).
69
+ Rationale: File names directly influence project structure, import clarity, and build tooling in QDK solutions. kebab-case maximizes readability across operating systems and version control.
70
+
71
+ Attributes
72
+ Rule: Custom attributes and built-in attribute usage MUST follow PascalCase conventions (e.g., @EntryPoint()).
73
+ Rationale: Attributes control compilation behavior, testing, and entry-point execution. Consistent naming ensures compatibility with the Q# compiler and Azure Quantum deployment pipelines.
74
+
75
+ @EntryPoint()
76
+ operation RunQuantumProgram() : Unit {
77
+ // Main quantum entry point
78
+ }
79
+ Additional Q#-specific guidance:
80
+ • Prefix reusable Augment modules with AugmentQuantum.
81
+ • Avoid single-letter names except in standard quantum literature shorthand (q, qs) or tight mathematical loops.
82
+ • Names MUST enhance circuit readability for visualizers, resource estimators, and hybrid C#/IQ# hosts.
@@ -0,0 +1,10 @@
1
+ # Q# Performance and Resource Estimation
2
+
3
+ > Skeleton rule file. See `q-standards.md` for full context.
4
+
5
+ - Run the QDK `ResourcesEstimator` or Azure Quantum Resource Estimator before any hardware submission. Report qubit count, T-count, gate count, and depth.
6
+ - Minimize two-qubit gates; prefer hardware-native gates of the target provider.
7
+ - Reuse qubits via `Reset` and `borrow`. Offload classical loops to the host language.
8
+ - Choose simulators by scale: full-state (<= 20 qubits), Toffoli/sparse (larger), resource estimator (scaling studies).
9
+ - Apply provider-appropriate error mitigation; document the choice.
10
+ - Prefer library-optimized primitives from `Microsoft.Quantum.Canon` and `Preparation` over hand-rolled gate sequences.
@@ -0,0 +1,10 @@
1
+ # Q# Qubit Management
2
+
3
+ > Skeleton rule file. See `q-standards.md` for full context.
4
+
5
+ - Allocate with `use` (fresh) or `borrow` (clean borrowed). Never extend qubit lifetime beyond its tight scope.
6
+ - `Reset` qubits before scope exit when they may be non-zero, especially for hardware targets.
7
+ - Prefer `within { ... } apply { ... }` for automatic uncomputation over manual adjoint inversion.
8
+ - Declare `is Adj + Ctl` on operations whenever semantically valid.
9
+ - Never hold qubits across host-language boundaries.
10
+ - Respect the no-cloning theorem: never assume a qubit can be copied.
@@ -0,0 +1,10 @@
1
+ # Q# Security and Quantum Hygiene
2
+
3
+ > Skeleton rule file. See `q-standards.md` for full context.
4
+
5
+ - No-cloning compliance is mandatory. No state-duplication shortcuts.
6
+ - For QKD or QRNG, follow standard protocols and document measurement bases.
7
+ - Sanitize, and where appropriate encrypt, parameters and results crossing the host/Q# boundary, especially for Azure Quantum jobs.
8
+ - Use authenticated Azure Quantum workspaces. Never log raw job outputs that could leak superposition-derived data.
9
+ - Minimize timing and resource variance that could leak information in cryptographic contexts.
10
+ - Pair Q# components with post-quantum-resistant classical algorithms.
@@ -0,0 +1,127 @@
1
+ # Q# AI Prompter Rules
2
+
3
+ You are generating, reviewing, or refactoring Q# code for the Quantum Development Kit (QDK 1.0+) and Azure Quantum. Apply every rule below. Treat qubits, gates, and circuit depth as scarce, expensive resources.
4
+
5
+ ## Role and Output Contract
6
+
7
+ - Default to library-first solutions using `Microsoft.Quantum.Intrinsic`, `Canon`, `Preparation`, `Diagnostics`, `ResourceEstimation`, and `Convert`. Implement custom gates only when no library primitive fits.
8
+ - Every public `operation`/`function` MUST carry `///` doc comments with `# Summary`, `# Input`, `# Output`, and a `# Remarks` block stating qubit state assumptions (e.g., "expects |0> input") and resource implications.
9
+ - Never violate the no-cloning theorem. Never assume a qubit can be copied; use entanglement or teleportation patterns explicitly.
10
+ - Prefer correctness, then resource economy, then readability. Reject solutions that submit un-estimated circuits to hardware.
11
+
12
+ ## Naming
13
+
14
+ | Element | Convention | Example |
15
+ |---|---|---|
16
+ | Namespaces | PascalCase, hierarchical | `Augment.Quantum.Algorithms.Grover` |
17
+ | Operations / Functions | PascalCase, verb-led | `PrepareBellState`, `ApplyOracle`, `MeasureAllZ` |
18
+ | Qubits / Registers | camelCase, descriptive | `targetQubit`, `dataRegister` |
19
+ | Variables / Parameters | camelCase | `inputAngle`, `nIterations` |
20
+ | Constants | UPPER_SNAKE_CASE | `PI_OVER_4` |
21
+ | User-Defined Types | PascalCase | `QuantumRegister` |
22
+ | Files | kebab-case `.qs` | `bell-state.qs`, `oracle-utils.qs` |
23
+
24
+ Prefix reusable Augment quantum modules with `AugmentQuantum`. Avoid single-letter names outside tight loop indices.
25
+
26
+ ## Formatting
27
+
28
+ - 4-space indent, no tabs. Target line length <= 100. Brace on same line as declaration.
29
+ - Single space after `operation`, `function`, `let`, `mutable`, `use`, `borrow`. Spaces around operators.
30
+ - Group `open` statements: `Microsoft.Quantum.*` first, then project namespaces.
31
+ - Use `within { ... } apply { ... }` for automatic uncomputation.
32
+ - Visually align gate sequences in circuits.
33
+
34
+ ## Operations vs. Functions
35
+
36
+ - `function`: deterministic, side-effect-free classical logic only.
37
+ - `operation`: anything touching qubits, gates, measurement, or randomness.
38
+ - Declare `is Adj + Ctl` whenever semantically valid. Missing functors blocks circuit optimization and is a defect.
39
+
40
+ ## Qubit Management
41
+
42
+ - Allocate with `use` (fresh) or `borrow` (clean borrowed). Never extend qubit lifetime beyond its tight scope.
43
+ - `Reset` qubits before scope exit when they may be non-zero, especially on hardware targets.
44
+ - Prefer `within/apply` over manual adjoint inversion.
45
+ - Never hold qubits across host-language boundaries.
46
+
47
+ ## Hybrid Classical-Quantum
48
+
49
+ - Do classical pre/post-processing in the host (Python via IQ#, C# via QDK libs). Keep `operation` bodies quantum-dense.
50
+ - Expose entry points with `@EntryPoint()` for Azure Quantum job submission.
51
+ - Bridge types via `Microsoft.Quantum.Convert`.
52
+ - Wrap quantum failures in host-language exceptions; never silently retry on hardware.
53
+
54
+ ## Error Handling
55
+
56
+ - Use `fail "message"` for unrecoverable conditions (invalid qubit count, violated state assumption).
57
+ - Branch on `Result` (`Zero`/`One`) explicitly; convert with `ResultAsBool` when needed.
58
+ - Use `Microsoft.Quantum.Diagnostics` (`AssertQubit`, `AssertAllZero`, `DumpMachine`, `DumpRegister`) during development; gate them out for hardware runs.
59
+ - Validate classical inputs before allocating qubits.
60
+
61
+ ```qsharp
62
+ if (nQubits < 2) {
63
+ fail "Grover search requires at least 2 qubits.";
64
+ }
65
+ ```
66
+
67
+ ## Performance and Resource Estimation
68
+
69
+ - Run the QDK `ResourcesEstimator` or Azure Quantum Resource Estimator before any hardware submission. Report qubit count, T-count, gate count, and depth.
70
+ - Minimize two-qubit gates; prefer hardware-native gates of the target provider.
71
+ - Reuse qubits via `Reset` and `borrow`. Offload classical loops to the host.
72
+ - Choose simulators by scale: full-state (<= 20 qubits), Toffoli/sparse (larger), resource estimator (scaling studies).
73
+ - Apply provider-appropriate error mitigation; document the choice.
74
+
75
+ ## Security and Quantum Hygiene
76
+
77
+ - No-cloning compliance is mandatory. No state duplication shortcuts.
78
+ - For QKD or QRNG, follow standard protocols and document measurement bases.
79
+ - Sanitize and, where appropriate, encrypt parameters and results crossing the host/Q# boundary, especially for Azure Quantum jobs.
80
+ - Use authenticated Azure Quantum workspaces; never log raw job outputs that could leak superposition-derived data.
81
+ - Pair Q# components with post-quantum-resistant classical algorithms.
82
+
83
+ ## Canonical Examples
84
+
85
+ ```qsharp
86
+ /// # Summary
87
+ /// Prepares a Bell pair (|00> + |11>)/sqrt(2) on two qubits.
88
+ /// # Input
89
+ /// q1, q2 : Qubits assumed in |0> state.
90
+ operation PrepareBellState(q1 : Qubit, q2 : Qubit) : Unit is Adj + Ctl {
91
+ H(q1);
92
+ CNOT(q1, q2);
93
+ }
94
+ ```
95
+
96
+ ```qsharp
97
+ @EntryPoint()
98
+ operation RunGroverSearch(nQubits : Int, markedItem : Int) : Result[] {
99
+ use qubits = Qubit[nQubits];
100
+ // Grover iteration via Microsoft.Quantum.* library ops
101
+ return MeasureEachZ(qubits);
102
+ }
103
+ ```
104
+
105
+ ## Anti-Patterns (Reject in Review)
106
+
107
+ - Long-lived qubits outside tight `use`/`borrow` scopes; missing `Reset`.
108
+ - `operation` declared without `is Adj + Ctl` when it qualifies.
109
+ - Heavy classical loops or arithmetic inside `operation` bodies.
110
+ - Magic numbers for qubit counts, angles, or iteration counts.
111
+ - Submitting circuits to hardware without resource estimation.
112
+ - Re-implementing standard gates or oracles instead of using libraries.
113
+ - Missing or incomplete `///` docs on public callables.
114
+
115
+ ## When Asked to Generate Q#
116
+
117
+ 1. Confirm the target (simulator vs. provider) and qubit budget. If unstated, assume full-state simulator and note assumptions.
118
+ 2. Sketch the circuit at the operation level, choosing library primitives.
119
+ 3. Implement with `is Adj + Ctl` where valid and `within/apply` for uncomputation.
120
+ 4. Add `///` docs, input validation, and resource-estimation guidance.
121
+ 5. Provide a brief host-language invocation snippet only if requested.
122
+
123
+ ## Augment Extensions Integration
124
+
125
+ - Link with `augx link coding-standards/q`.
126
+ - Combine with `coding-standards/python` (IQ# host) or `coding-standards/c` style modules for full-stack hybrid solutions.
127
+ - When prompting Augment Code AI, cite this file: "Follow Q# AI Prompter Rules for qubit scoping, functors, and resource estimation."
@@ -0,0 +1,10 @@
1
+ # Q# Testing
2
+
3
+ > Skeleton rule file. See `q-standards.md` for full context.
4
+
5
+ - Use `Microsoft.Quantum.Diagnostics` assertions (`AssertQubit`, `AssertAllZero`, `AssertOperationsEqualReferenced`) for unit tests.
6
+ - Run tests via `dotnet test` against the full-state simulator first, then resource estimator.
7
+ - Property-test parameterized circuits over representative input domains.
8
+ - Verify adjoint and controlled variants explicitly; missing functor tests is a defect.
9
+ - Pin QDK and Azure Quantum SDK versions in `.qsproj` so test runs are reproducible.
10
+ - For hybrid apps, add host-language tests (Python/IQ# or C#) wrapping the Q# entry points.
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ All notable changes to this module are documented here.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [1.0.0] - 2026-11-26
8
+
9
+ ### Added
10
+
11
+ - Initial Spring Framework and Spring Boot standards module covering configuration, web APIs, transactions, testing, security, and production operations.
12
+ - Added an illustrative Spring Boot 3+ MVC endpoint example using Jakarta Validation.
@@ -0,0 +1,61 @@
1
+ # Spring Framework and Spring Boot Standards
2
+
3
+ Version 1.0.0 provides practical guidance for applications built with Spring Framework and Spring Boot. The module is useful on its own and complements the Java Coding Standards module.
4
+
5
+ ## Overview
6
+
7
+ Use these rules for Spring-specific design and operation: constructor injection, bean lifecycle, Boot auto-configuration, external settings, Spring MVC or WebFlux, request validation, error handling, transaction boundaries, Spring testing, Spring Security, observability, health, and Actuator exposure.
8
+
9
+ The module does not prescribe a Spring release, database, deployment platform, or build tool. Inspect the consuming project's Spring Boot and Spring Framework versions, Java toolchain, dependency management, and official compatibility requirements before suggesting APIs or dependencies. Spring Cloud, Spring AI, Spring Batch, Spring Data, and other Spring portfolio projects are separate products. This module covers their integration only when an application already uses them and the concern is directly relevant.
10
+
11
+ ## Installation
12
+
13
+ Link the module directly:
14
+
15
+ ```bash
16
+ augx link coding-standards/spring
17
+ ```
18
+
19
+ Inspect its guidance with:
20
+
21
+ ```bash
22
+ augx show coding-standards/spring
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ 1. Identify the project's Spring Framework, Spring Boot, Spring Security, and Java versions before suggesting annotations, configuration keys, or dependencies.
28
+ 2. Choose the rule file for the concern: bean and Boot configuration, web APIs and security, data and tests, or production operations.
29
+ 3. Use this module for Spring-specific decisions. Link the Java module separately for general language, API, and platform guidance.
30
+
31
+ ## Contents
32
+
33
+ - [Beans, configuration, and Boot](rules/beans-configuration-and-boot.md): dependency injection, bean lifecycle, application structure, auto-configuration, and externalized settings.
34
+ - [Web APIs and security](rules/web-apis-and-security.md): MVC and WebFlux choice, endpoints, validation, consistent errors, and Spring Security.
35
+ - [Data, testing, and transactions](rules/data-testing-and-transactions.md): persistence boundaries, transaction behavior, unit tests, slices, and integration tests.
36
+ - [Production operations](rules/production-operations.md): production configuration, observability, health checks, graceful lifecycle, and safe Actuator exposure.
37
+ - [OrderController.java](examples/OrderController.java): an illustrative Spring Boot 3+ MVC endpoint using constructor injection and Jakarta validation. It is not a compiled project.
38
+
39
+ ## Relationship to Java guidance
40
+
41
+ [Java Coding Standards](../java/README.md) owns general Java language, API, exception, concurrency, build, testing, and security practices. This module owns Spring Framework and Spring Boot behavior. Link either module independently. When both are linked, apply Java rules to language choices and this module to framework choices, without duplicating general Java advice.
42
+
43
+ ## Version and source policy
44
+
45
+ Follow the versions declared by the consuming project and its supported Java baseline. Use the official compatibility and reference documentation for those exact versions. Do not add a starter or portfolio project just because an example uses it. Versioned details in examples are labeled so teams can adjust them to their own supported releases.
46
+
47
+ Official sources:
48
+
49
+ - [Spring projects](https://spring.io/projects)
50
+ - [Spring Framework reference](https://docs.spring.io/spring-framework/reference/)
51
+ - [Spring Boot reference](https://docs.spring.io/spring-boot/reference/)
52
+ - [Spring Boot system requirements](https://docs.spring.io/spring-boot/system-requirements.html)
53
+ - [Spring Security reference](https://docs.spring.io/spring-security/reference/)
54
+
55
+ ## Character count
56
+
57
+ The count covers every file in this module directory, including manifests, documentation, rules, and examples: see `module.json` and `metadata.json` for the verified total.
58
+
59
+ ## Changelog
60
+
61
+ See [CHANGELOG.md](CHANGELOG.md).
@@ -0,0 +1,40 @@
1
+ // Illustrative single-file Spring Boot 3+ MVC example using Jakarta Validation.
2
+ // Verify dependency versions, package layout, and validation setup against the consuming project.
3
+ package example.orders;
4
+
5
+ import jakarta.validation.Valid;
6
+ import jakarta.validation.constraints.NotBlank;
7
+ import org.springframework.http.HttpStatus;
8
+ import org.springframework.stereotype.Service;
9
+ import org.springframework.web.bind.annotation.PostMapping;
10
+ import org.springframework.web.bind.annotation.RequestBody;
11
+ import org.springframework.web.bind.annotation.RequestMapping;
12
+ import org.springframework.web.bind.annotation.ResponseStatus;
13
+ import org.springframework.web.bind.annotation.RestController;
14
+
15
+ @RestController
16
+ @RequestMapping("/orders")
17
+ class OrderController {
18
+ private final OrderService orderService;
19
+
20
+ OrderController(OrderService orderService) {
21
+ this.orderService = orderService;
22
+ }
23
+
24
+ @PostMapping
25
+ @ResponseStatus(HttpStatus.CREATED)
26
+ OrderResponse create(@Valid @RequestBody CreateOrderRequest request) {
27
+ return orderService.create(request);
28
+ }
29
+ }
30
+
31
+ record CreateOrderRequest(@NotBlank String reference) {}
32
+
33
+ record OrderResponse(String reference) {}
34
+
35
+ @Service
36
+ class OrderService {
37
+ OrderResponse create(CreateOrderRequest request) {
38
+ return new OrderResponse(request.reference());
39
+ }
40
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "name": "spring-standards",
4
+ "displayName": "Spring Framework and Spring Boot Standards",
5
+ "description": "Practical Spring Framework and Spring Boot guidance for dependency injection, configuration, web APIs, transactions, testing, security, and operations.",
6
+ "type": "coding-standards",
7
+ "language": "java",
8
+ "tags": [
9
+ "spring",
10
+ "spring-framework",
11
+ "spring-boot",
12
+ "java",
13
+ "dependency-injection",
14
+ "configuration",
15
+ "spring-mvc",
16
+ "webflux",
17
+ "validation",
18
+ "transactions",
19
+ "spring-security",
20
+ "actuator",
21
+ "testing"
22
+ ],
23
+ "compatibility": {
24
+ "augmentMinVersion": "1.0.0"
25
+ },
26
+ "characterCount": 24030,
27
+ "lastUpdated": "2026-11-26",
28
+ "files": {
29
+ "rules": [
30
+ "beans-configuration-and-boot.md",
31
+ "web-apis-and-security.md",
32
+ "data-testing-and-transactions.md",
33
+ "production-operations.md"
34
+ ],
35
+ "examples": [
36
+ "OrderController.java"
37
+ ]
38
+ }
39
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "spring-standards",
3
+ "version": "1.0.0",
4
+ "displayName": "Spring Framework and Spring Boot Standards",
5
+ "description": "Practical Spring Framework and Spring Boot guidance for dependency injection, configuration, web APIs, transactions, testing, security, and operations.",
6
+ "type": "coding-standards",
7
+ "author": "Augment Extensions",
8
+ "license": "MIT",
9
+ "tags": [
10
+ "spring",
11
+ "spring-framework",
12
+ "spring-boot",
13
+ "java",
14
+ "dependency-injection",
15
+ "configuration",
16
+ "spring-mvc",
17
+ "webflux",
18
+ "validation",
19
+ "transactions",
20
+ "spring-security",
21
+ "actuator",
22
+ "testing"
23
+ ],
24
+ "files": [
25
+ "rules/beans-configuration-and-boot.md",
26
+ "rules/web-apis-and-security.md",
27
+ "rules/data-testing-and-transactions.md",
28
+ "rules/production-operations.md",
29
+ "examples/OrderController.java"
30
+ ],
31
+ "dependencies": [],
32
+ "augment": {
33
+ "characterCount": 24030,
34
+ "priority": "high",
35
+ "category": "coding-standards",
36
+ "language": "java"
37
+ }
38
+ }
@@ -0,0 +1,39 @@
1
+ # Spring Beans, Configuration, and Boot
2
+
3
+ Use the Spring container deliberately. Keep application behavior explicit and configuration external to compiled code.
4
+
5
+ ## Inject dependencies and manage beans
6
+
7
+ - Prefer constructor injection for required collaborators. It makes dependencies visible, supports immutable fields, and lets a plain unit test construct the class without starting a container.
8
+ - Use Spring-managed beans for application services and infrastructure that need container lifecycle, configuration, or framework integration. Do not retrieve dependencies from the application context inside business code.
9
+ - Define a bean with `@Bean` when configuring a third-party type or when explicit factory logic is clearer than component scanning. Keep configuration focused and deterministic.
10
+ - Choose singleton scope unless per-request or per-operation state requires another scope. A singleton service should not keep mutable request state in fields.
11
+ - Keep constructors and bean initialization fast and side-effect light. Perform network calls or other fallible startup work only through an explicit lifecycle design with defined failure and shutdown behavior.
12
+ - Avoid circular dependencies. Extract a shared responsibility or change the direction of the dependency rather than hiding the cycle with setter injection or lazy lookups.
13
+ - Use lifecycle callbacks only for lifecycle work. Ensure external resources created by a bean have a corresponding managed close or destroy path.
14
+
15
+ ## Structure Spring Boot applications clearly
16
+
17
+ - Use one primary `@SpringBootApplication` entry point and place it above the application packages it should discover. Add component scanning or auto-configuration exclusions only for a documented reason.
18
+ - Organize code around the application's domain or features when that makes ownership and changes easier to follow. Keep HTTP controllers thin and delegate use cases to application services.
19
+ - Let auto-configuration provide conventional infrastructure when it matches the application. Add explicit beans to replace behavior intentionally, not preemptively.
20
+ - When configuration is surprising, inspect the condition report with the supported Boot diagnostic options before excluding classes or copying internal auto-configuration details.
21
+ - Keep framework annotations at the integration boundary where possible. Avoid spreading container lookups and framework-specific types through domain logic without a need.
22
+ - Do not mix APIs or configuration conventions from different Spring Boot generations without checking migration notes, dependency management, and supported Java versions.
23
+
24
+ ## Externalize and validate settings
25
+
26
+ - Put environment-specific settings in supported external configuration sources. Do not compile hostnames, credentials, tokens, or environment-specific paths into application code.
27
+ - Bind related settings to a typed configuration object when that improves validation and discoverability. Use direct property injection for a small isolated value when it is consistent with the codebase.
28
+ - Validate required configuration at startup and fail with a clear, non-secret diagnostic. Define safe defaults only for values that are genuinely optional.
29
+ - Use profiles for intentional environment-specific configuration, not as a replacement for a clear configuration model. Understand property-source precedence before relying on overrides.
30
+ - Keep secrets in the deployment's approved secret mechanism. Avoid committing secret values in properties, YAML, test fixtures, or build files. Redact them in logs and diagnostic endpoints.
31
+ - Add a new configuration source or secret manager only when the deployment actually requires it.
32
+
33
+ ## Official references
34
+
35
+ - [Spring Framework dependency injection](https://docs.spring.io/spring-framework/reference/core/beans/dependencies/factory-collaborators.html)
36
+ - [Spring bean lifecycle](https://docs.spring.io/spring-framework/reference/core/beans/factory-nature.html)
37
+ - [Spring Boot auto-configuration](https://docs.spring.io/spring-boot/reference/using/auto-configuration.html)
38
+ - [Spring Boot externalized configuration](https://docs.spring.io/spring-boot/reference/features/external-config.html)
39
+ - [Spring Boot system requirements](https://docs.spring.io/spring-boot/system-requirements.html)