@manhd_d/ai-harness 0.0.0-stage → 0.6.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 (231) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/CONTRIBUTING.md +13 -0
  3. package/LICENSE +21 -0
  4. package/README.md +328 -2
  5. package/SECURITY.md +10 -0
  6. package/adapters/ai-python/adapter.yaml +46 -0
  7. package/adapters/ai-python/checks/verification.yaml +32 -0
  8. package/adapters/ai-python/evals/cases.json +25 -0
  9. package/adapters/ai-python/rules/architecture.md +3 -0
  10. package/adapters/ai-python/rules/database.md +3 -0
  11. package/adapters/ai-python/rules/performance.md +3 -0
  12. package/adapters/ai-python/rules/security.md +3 -0
  13. package/adapters/ai-python/rules.md +29 -0
  14. package/adapters/ai-python/skills/harness-ai-python-rag-access/SKILL.md +23 -0
  15. package/adapters/ai-python/skills/harness-ai-python-tool-safety/SKILL.md +23 -0
  16. package/adapters/astro/README.md +23 -0
  17. package/adapters/astro/adapter.yaml +31 -0
  18. package/adapters/astro/checks/verification.yaml +59 -0
  19. package/adapters/astro/evals/cases.json +45 -0
  20. package/adapters/astro/rules/architecture.md +9 -0
  21. package/adapters/astro/rules/deployment.md +9 -0
  22. package/adapters/astro/rules/performance.md +8 -0
  23. package/adapters/astro/rules/security.md +9 -0
  24. package/adapters/astro/rules.md +17 -0
  25. package/adapters/astro/skills/harness-astro-cloudflare/SKILL.md +27 -0
  26. package/adapters/astro/skills/harness-astro-islands/SKILL.md +28 -0
  27. package/adapters/astro/skills/harness-astro-microfrontend/SKILL.md +27 -0
  28. package/adapters/astro/skills/harness-astro-performance/SKILL.md +27 -0
  29. package/adapters/astro/skills/harness-astro-project-architecture/SKILL.md +28 -0
  30. package/adapters/astro/skills/harness-astro-seo/SKILL.md +28 -0
  31. package/adapters/java-spring/adapter.yaml +42 -0
  32. package/adapters/java-spring/checks/verification.yaml +33 -0
  33. package/adapters/java-spring/evals/cases.json +25 -0
  34. package/adapters/java-spring/rules/architecture.md +3 -0
  35. package/adapters/java-spring/rules/database.md +3 -0
  36. package/adapters/java-spring/rules/performance.md +3 -0
  37. package/adapters/java-spring/rules/security.md +3 -0
  38. package/adapters/java-spring/rules.md +34 -0
  39. package/adapters/java-spring/skills/harness-java-spring-database-migration/SKILL.md +23 -0
  40. package/adapters/java-spring/skills/harness-java-spring-kafka-outbox/SKILL.md +23 -0
  41. package/adapters/java-spring/skills/harness-java-spring-spring-api/SKILL.md +23 -0
  42. package/adapters/kubernetes/adapter.yaml +58 -0
  43. package/adapters/kubernetes/checks/verification.yaml +63 -0
  44. package/adapters/kubernetes/evals/cases.json +25 -0
  45. package/adapters/kubernetes/rules/architecture.md +5 -0
  46. package/adapters/kubernetes/rules/reliability.md +5 -0
  47. package/adapters/kubernetes/rules/security.md +5 -0
  48. package/adapters/kubernetes/rules.md +9 -0
  49. package/adapters/kubernetes/skills/harness-kubernetes-helm-release/SKILL.md +26 -0
  50. package/adapters/kubernetes/skills/harness-kubernetes-rollout-safety/SKILL.md +27 -0
  51. package/adapters/kubernetes/skills/harness-kubernetes-workload-review/SKILL.md +27 -0
  52. package/adapters/react-native/adapter.yaml +28 -0
  53. package/adapters/react-native/checks/verification.yaml +30 -0
  54. package/adapters/react-native/evals/cases.json +25 -0
  55. package/adapters/react-native/rules/architecture.md +3 -0
  56. package/adapters/react-native/rules/database.md +3 -0
  57. package/adapters/react-native/rules/performance.md +3 -0
  58. package/adapters/react-native/rules/security.md +3 -0
  59. package/adapters/react-native/rules.md +23 -0
  60. package/adapters/react-native/skills/harness-react-native-device-permissions/SKILL.md +23 -0
  61. package/adapters/react-native/skills/harness-react-native-offline-sync/SKILL.md +23 -0
  62. package/adapters/react-nextjs/adapter.yaml +28 -0
  63. package/adapters/react-nextjs/checks/verification.yaml +49 -0
  64. package/adapters/react-nextjs/evals/cases.json +25 -0
  65. package/adapters/react-nextjs/rules/architecture.md +3 -0
  66. package/adapters/react-nextjs/rules/database.md +3 -0
  67. package/adapters/react-nextjs/rules/performance.md +3 -0
  68. package/adapters/react-nextjs/rules/security.md +3 -0
  69. package/adapters/react-nextjs/rules.md +27 -0
  70. package/adapters/react-nextjs/skills/harness-react-nextjs-accessible-ui/SKILL.md +23 -0
  71. package/adapters/react-nextjs/skills/harness-react-nextjs-server-boundaries/SKILL.md +23 -0
  72. package/bin/aih.js +4 -0
  73. package/capabilities/devops/README.md +24 -0
  74. package/capabilities/devops/capability.json +20 -0
  75. package/capabilities/devops/checks/verification.json +17 -0
  76. package/capabilities/devops/evals/cases.json +25 -0
  77. package/capabilities/devops/skills/harness-devops-ci-cd/SKILL.md +27 -0
  78. package/capabilities/devops/skills/harness-devops-deployment/SKILL.md +27 -0
  79. package/capabilities/devops/skills/harness-devops-docker/SKILL.md +25 -0
  80. package/capabilities/devops/skills/harness-devops-incident-response/SKILL.md +27 -0
  81. package/capabilities/devops/skills/harness-devops-infrastructure/SKILL.md +28 -0
  82. package/capabilities/devops/skills/harness-devops-observability/SKILL.md +25 -0
  83. package/capabilities/devops/workflows/incident-recovery.md +12 -0
  84. package/capabilities/devops/workflows/pr-to-production.md +16 -0
  85. package/capabilities/monetization/README.md +40 -0
  86. package/capabilities/monetization/capability.json +25 -0
  87. package/capabilities/monetization/checks/verification.json +53 -0
  88. package/capabilities/monetization/evals/cases.json +45 -0
  89. package/capabilities/monetization/skills/harness-monetization-ad-placement-ux/SKILL.md +28 -0
  90. package/capabilities/monetization/skills/harness-monetization-adsense-integration/SKILL.md +29 -0
  91. package/capabilities/monetization/skills/harness-monetization-analytics-revenue/SKILL.md +28 -0
  92. package/capabilities/monetization/skills/harness-monetization-publisher-compliance/SKILL.md +28 -0
  93. package/capabilities/monetization/skills/harness-monetization-seo-growth/SKILL.md +28 -0
  94. package/capabilities/monetization/templates/ad-placement-review.md +31 -0
  95. package/capabilities/monetization/templates/analytics-report.md +38 -0
  96. package/capabilities/monetization/templates/privacy-consent-checklist.md +39 -0
  97. package/capabilities/monetization/templates/site-monetization-plan.md +46 -0
  98. package/capabilities/monetization/workflows/site-to-adsense.md +19 -0
  99. package/capabilities/monetization/workflows/traffic-to-revenue-review.md +14 -0
  100. package/capabilities/product/README.md +78 -0
  101. package/capabilities/product/agents/business-analyst.md +15 -0
  102. package/capabilities/product/agents/product-manager.md +15 -0
  103. package/capabilities/product/agents/product-owner.md +15 -0
  104. package/capabilities/product/agents/project-manager.md +15 -0
  105. package/capabilities/product/agents/requirements-reviewer.md +15 -0
  106. package/capabilities/product/capability.json +55 -0
  107. package/capabilities/product/checks/verification.json +41 -0
  108. package/capabilities/product/evals/cases.json +35 -0
  109. package/capabilities/product/skills/harness-product-acceptance-criteria/SKILL.md +25 -0
  110. package/capabilities/product/skills/harness-product-backlog-prioritization/SKILL.md +25 -0
  111. package/capabilities/product/skills/harness-product-brd-generation/SKILL.md +25 -0
  112. package/capabilities/product/skills/harness-product-business-analysis/SKILL.md +26 -0
  113. package/capabilities/product/skills/harness-product-document-review/SKILL.md +26 -0
  114. package/capabilities/product/skills/harness-product-idea-discovery/SKILL.md +27 -0
  115. package/capabilities/product/skills/harness-product-knowledge-analysis/SKILL.md +28 -0
  116. package/capabilities/product/skills/harness-product-prd-generation/SKILL.md +26 -0
  117. package/capabilities/product/skills/harness-product-product-research/SKILL.md +27 -0
  118. package/capabilities/product/skills/harness-product-srs-generation/SKILL.md +28 -0
  119. package/capabilities/product/skills/harness-product-traceability/SKILL.md +24 -0
  120. package/capabilities/product/skills/harness-product-use-case-generation/SKILL.md +26 -0
  121. package/capabilities/product/skills/harness-product-user-stories/SKILL.md +25 -0
  122. package/capabilities/product/templates/acceptance-criteria.md +27 -0
  123. package/capabilities/product/templates/backlog.md +23 -0
  124. package/capabilities/product/templates/brd.md +43 -0
  125. package/capabilities/product/templates/business-rules.md +27 -0
  126. package/capabilities/product/templates/decision-log.md +7 -0
  127. package/capabilities/product/templates/delivery-plan.md +18 -0
  128. package/capabilities/product/templates/idea.md +38 -0
  129. package/capabilities/product/templates/prd-lite.md +39 -0
  130. package/capabilities/product/templates/prd.md +36 -0
  131. package/capabilities/product/templates/product-brief.md +27 -0
  132. package/capabilities/product/templates/research.md +31 -0
  133. package/capabilities/product/templates/review-report.md +26 -0
  134. package/capabilities/product/templates/source-register.md +19 -0
  135. package/capabilities/product/templates/srs.md +46 -0
  136. package/capabilities/product/templates/traceability.md +23 -0
  137. package/capabilities/product/templates/use-cases.md +34 -0
  138. package/capabilities/product/workflows/change-impact-analysis.md +15 -0
  139. package/capabilities/product/workflows/confluence-to-spec.md +21 -0
  140. package/capabilities/product/workflows/document-driven.md +13 -0
  141. package/capabilities/product/workflows/idea-driven.md +13 -0
  142. package/capabilities/product/workflows/idea-to-prd.md +20 -0
  143. package/capabilities/uiux/README.md +21 -0
  144. package/capabilities/uiux/capability.json +23 -0
  145. package/capabilities/uiux/checks/verification.json +17 -0
  146. package/capabilities/uiux/design-system/tokens.example.json +21 -0
  147. package/capabilities/uiux/evals/cases.json +15 -0
  148. package/capabilities/uiux/integrations/confluence.md +10 -0
  149. package/capabilities/uiux/integrations/figma.md +10 -0
  150. package/capabilities/uiux/skills/harness-uiux-design-review/SKILL.md +24 -0
  151. package/capabilities/uiux/skills/harness-uiux-design-system/SKILL.md +24 -0
  152. package/capabilities/uiux/skills/harness-uiux-figma-design/SKILL.md +26 -0
  153. package/capabilities/uiux/skills/harness-uiux-requirements-analysis/SKILL.md +26 -0
  154. package/capabilities/uiux/skills/harness-uiux-screen-planning/SKILL.md +24 -0
  155. package/capabilities/uiux/skills/harness-uiux-user-flow/SKILL.md +25 -0
  156. package/capabilities/uiux/templates/requirements.md +7 -0
  157. package/capabilities/uiux/templates/screen-spec.md +15 -0
  158. package/capabilities/uiux/workflows/docs-to-figma.md +22 -0
  159. package/capabilities/uiux/workflows/idea-to-figma.md +11 -0
  160. package/cli/adapter-schema.js +42 -0
  161. package/cli/adapters.js +149 -0
  162. package/cli/capabilities.js +93 -0
  163. package/cli/composition.js +96 -0
  164. package/cli/evaluation-contract.js +40 -0
  165. package/cli/files.js +125 -0
  166. package/cli/harness.js +255 -0
  167. package/cli/main.js +114 -0
  168. package/cli/module-contract.js +29 -0
  169. package/core/agents/implementer.md +16 -0
  170. package/core/agents/planner.md +16 -0
  171. package/core/agents/reviewer.md +16 -0
  172. package/core/agents/security-reviewer.md +16 -0
  173. package/core/agents/test-engineer.md +16 -0
  174. package/core/checks/verification.json +28 -0
  175. package/core/evals/cases.json +25 -0
  176. package/core/evals/composition.json +33 -0
  177. package/core/policies/permissions.md +17 -0
  178. package/core/policies/security.md +15 -0
  179. package/core/rules/context.md +15 -0
  180. package/core/rules/foundations.md +24 -0
  181. package/core/skills/harness-ai-evaluation/SKILL.md +21 -0
  182. package/core/skills/harness-debugging/SKILL.md +20 -0
  183. package/core/skills/harness-review/SKILL.md +20 -0
  184. package/core/skills/harness-spec/SKILL.md +21 -0
  185. package/core/skills/harness-tdd/SKILL.md +20 -0
  186. package/core/workflows/bugfix.md +9 -0
  187. package/core/workflows/spec-to-code.md +19 -0
  188. package/core/workflows/upgrade.md +10 -0
  189. package/docs/adapters.md +83 -0
  190. package/docs/agent-handoffs.md +79 -0
  191. package/docs/architecture.md +107 -0
  192. package/docs/cli.md +104 -0
  193. package/docs/documentation-workflows.md +71 -0
  194. package/docs/end-to-end-workflow.md +116 -0
  195. package/docs/examples/ai-rag-service.md +60 -0
  196. package/docs/examples/astro-adsense-microtools.md +80 -0
  197. package/docs/examples/astro-micro-tools.md +125 -0
  198. package/docs/examples/document-driven-project.md +62 -0
  199. package/docs/examples/fullstack-web.md +80 -0
  200. package/docs/examples/idea-driven-project.md +71 -0
  201. package/docs/examples/react-native-app.md +57 -0
  202. package/docs/examples/spring-boot-api.md +100 -0
  203. package/docs/getting-started.md +148 -0
  204. package/docs/monetization.md +53 -0
  205. package/docs/npm-release.md +70 -0
  206. package/docs/openspec.md +23 -0
  207. package/docs/pull-request.md +37 -0
  208. package/docs/reference-analysis.md +22 -0
  209. package/docs/release-policy.md +17 -0
  210. package/docs/skill-matrix.md +134 -0
  211. package/docs/verification.md +20 -0
  212. package/docs/versioning.md +89 -0
  213. package/evals/README.md +45 -0
  214. package/evals/cases.json +41 -0
  215. package/harness.yaml +24 -0
  216. package/integrations/confluence/README.md +31 -0
  217. package/integrations/github/README.md +17 -0
  218. package/integrations/github/pull_request_template.md +22 -0
  219. package/integrations/gitlab/README.md +9 -0
  220. package/integrations/gitlab/harness-ci.yml +10 -0
  221. package/integrations/mcp/README.md +16 -0
  222. package/integrations/mcp/server-inventory.example.json +16 -0
  223. package/package.json +42 -4
  224. package/scripts/score-eval.js +40 -0
  225. package/templates/AGENTS.md +18 -0
  226. package/templates/openspec/.openspec.yaml +1 -0
  227. package/templates/openspec/config.yaml +14 -0
  228. package/templates/openspec/design.md +14 -0
  229. package/templates/openspec/proposal.md +19 -0
  230. package/templates/openspec/spec.md +8 -0
  231. package/templates/openspec/tasks.md +11 -0
@@ -0,0 +1,71 @@
1
+ # Walkthrough A — từ ý tưởng của developer tới tài liệu và code
2
+
3
+ Đây là **ví dụ thực hành** của chế độ **Idea-driven**, không gắn với một dự án CRM hay công nghệ cụ thể. `aih` chỉ cài hướng dẫn/skills và tạo **template trống**; AI host như Codex, IDE assistant hoặc ChatGPT Work có quyền repo mới có thể phân tích và ghi nội dung. Trong Chat thông thường, bạn vẫn có thể thảo luận ý tưởng, nhưng việc ghi file cần công cụ và quyền truy cập phù hợp.
4
+
5
+ ## 1. Chuẩn bị dự án và cài Harness
6
+
7
+ Yêu cầu: Node.js 22+, Git, CLI `aih` đã cài từ bản nguồn được review, và một thư mục dự án tồn tại. Xem [Getting started](../getting-started.md) để cài CLI từ source; bản tính năng này nằm trong PR cho tới khi merge.
8
+
9
+ ```bash
10
+ mkdir expense-app
11
+ cd expense-app
12
+ git init
13
+ aih init --capabilities product
14
+ aih new-doc idea
15
+ aih new-doc decision-log
16
+ aih check
17
+ aih skills
18
+ aih skill harness-product-idea-discovery
19
+ aih skill harness-product-product-research
20
+ ```
21
+
22
+ Nếu dự án đã cài Harness, sửa `.harness/project.json` để thêm `product` vào `capabilities`, rồi dùng `aih update --dry-run && aih update && aih check` trên branch riêng; **không** chạy lại init với lựa chọn không tương thích.
23
+
24
+ ## 2. Giao AI thảo luận thay vì bắt đầu code
25
+
26
+ Dán prompt này vào AI host có quyền đọc repository (hoặc thảo luận trước trong Chat):
27
+
28
+ > Đọc AGENTS.md và skill harness-product-idea-discovery đã cài. Ý tưởng ban đầu của tôi: “Ứng dụng quản lý chi tiêu cá nhân cho phép nhập giao dịch, AI đề xuất phân loại, có báo cáo theo tháng”. Hãy giữ nguyên ý tưởng gốc, đóng vai BA/PM/PO và thảo luận từng nhóm vấn đề quan trọng với tôi. Đề xuất user personas, MVP, non-goals và trade-off; không tự cho rằng các đề xuất là quyết định của tôi. Phân biệt FACT / INFERENCE / DECISION / UNKNOWN. Chưa code hay tự duyệt scope.
29
+
30
+ Sau mỗi vòng thảo luận, AI host cập nhật các file đã tạo trước đó: `docs/discovery/idea.md` và `docs/product/decision-log.md` (nếu được cấp quyền). Bạn là người chốt mục tiêu và MVP, không cần có BA/PM/PO riêng cho dự án cá nhân.
31
+
32
+ ## 3. Tạo draft tài liệu có cấu trúc
33
+
34
+ ```bash
35
+ aih new-doc research
36
+ aih new-doc prd-lite
37
+ aih new-doc acceptance-criteria
38
+ aih new-doc traceability
39
+ aih check
40
+ ```
41
+
42
+ `idea.md` và `decision-log.md` đã tạo tại bước 1; không chạy lại. Các lệnh chỉ chạy **một lần trên mỗi file** và sẽ từ chối ghi đè. Khi đã có file, AI host điền nội dung vào đúng file dựa trên thảo luận, không chạy lại `new-doc`.
43
+
44
+ Prompt mẫu:
45
+
46
+ > Đọc AGENTS.md và skill harness-product-product-research đã cài. Nếu có công cụ web được cấp phép, hãy tìm các sản phẩm tương tự và ghi nguồn, ngày kiểm tra, điểm mạnh/yếu vào docs/discovery/research.md; nếu không có công cụ thì đánh dấu chưa nghiên cứu, không bịa nguồn. Từ các quyết định tôi đã duyệt, hoàn thiện docs/product/prd-lite.md, acceptance-criteria.md và traceability.md. Chỉ ghi draft/pending-review đối với thông tin chưa phê duyệt, rồi gửi diff để tôi review.
47
+
48
+ Khi cần chi tiết hơn (đa actor, nghiệp vụ phức tạp, nhiều tích hợp), tạo thêm `aih new-doc brd`, `aih new-doc prd`, `aih new-doc srs`, `aih new-doc use-cases` theo **mức độ cần thiết**, không bắt mọi dự án phải có tất cả.
49
+
50
+ ## 4. Human approval và OpenSpec
51
+
52
+ Sau khi duyệt scope, cập nhật trạng thái/decision record thật của owner. Chỉ khi requirements và AC cho một thay đổi đã được duyệt, mới chuyển sang OpenSpec:
53
+
54
+ ```bash
55
+ aih new-change add-expense-categorization
56
+ # Chỉ là các file proposal/design/tasks/spec dạng TODO, chưa được phê duyệt.
57
+ ```
58
+
59
+ Prompt handoff:
60
+
61
+ > Đọc approved scope trong docs/product/ và requirement IDs; dùng core harness-spec để hoàn thiện openspec/changes/add-expense-categorization/, bao gồm test scenarios, rủi ro bảo mật dữ liệu, xử lý lỗi và những điểm còn thiếu. Không tự triển khai nếu scope chưa được duyệt. Sau khi tôi review, dùng adapter phù hợp để implement/test và tạo PR, không tự merge.
62
+
63
+ Nếu dùng OpenSpec upstream, cài/pin CLI riêng và chạy `openspec validate add-expense-categorization --strict` sau khi điền nội dung. Harness không tự cài hay chạy OpenSpec CLI.
64
+
65
+ ## 5. Lưu trữ và thay đổi về sau
66
+
67
+ - `docs/discovery/` lưu ý tưởng và research đã ghi nguồn; `docs/product/` lưu tài liệu yêu cầu của **project**, không lưu trong source `ai-harness`.
68
+ - `openspec/` lưu technical change và trace ID. Review tài liệu, code và CI trên PR, sau đó con người quyết định merge.
69
+ - Khi ý tưởng thay đổi, dùng `workflows/change-impact-analysis.md` và yêu cầu AI tạo diff; không tự ghi đè tài liệu approved.
70
+
71
+ **Giới hạn:** `aih verify --scope all` / `aih eval --scope all` chỉ cho checklist/eval advisory; không chứng minh đã thực sự chạy test, nghiên cứu hoặc review.
@@ -0,0 +1,57 @@
1
+ # Walkthrough 3 — React Native/Expo: permission, offline và release
2
+
3
+ **Tình huống giả định:** thêm màn hình lưu nháp khi offline và đồng bộ lại khi có mạng trong ứng dụng React Native/Expo đã tồn tại. Đây là hướng dẫn công việc, **không** scaffold app, không dùng Kubernetes cho ứng dụng di động.
4
+
5
+ ## 1. Init
6
+
7
+ ~~~bash
8
+ cd /path/to/existing-react-native-app
9
+ aih resolve --adapters react-native --capabilities product,uiux
10
+ aih init --adapters react-native --capabilities product,uiux --dry-run
11
+ aih init --adapters react-native --capabilities product,uiux
12
+ aih check
13
+ aih skills
14
+ ~~~
15
+
16
+ Nếu chỉ sửa một lỗi offline đã có ticket/AC duyệt, có thể bỏ Product và UI/UX không cần thiết, giữ Core + React Native. `aih detect` có thể nhận React Native/Expo tại thư mục target chứa `package.json`, không tự quét monorepo.
17
+
18
+ ## 2. Requirements & UX
19
+
20
+ - BA/PO mô tả business rule: trạng thái draft, server authoritative fields, replay/dedupe, login/logout giữa chừng, đa thiết bị, mất mạng và dữ liệu nhạy cảm.
21
+ - Tạo draft Product theo [getting started](../getting-started.md); duyệt story/AC trước khi design.
22
+ - `harness-uiux-user-flow` và `harness-uiux-screen-planning` mô tả offline banner, pending queue, syncing, conflict, retry, auth expired và error accessibility.
23
+ - Figma chỉ ghi khi có MCP quyền hợp lệ và gate. Khi không có Figma, Markdown screen specs vẫn là bàn giao hợp lệ.
24
+
25
+ ## 3. Spec và code
26
+
27
+ ~~~bash
28
+ aih new-change offline-draft-sync
29
+ aih skill harness-spec
30
+ aih skill harness-tdd
31
+ aih skill harness-react-native-offline-sync
32
+ aih skill harness-react-native-device-permissions
33
+ ~~~
34
+
35
+ - `offline-sync`: định nghĩa local persistence encryption/retention, idempotency key, queue/retry backoff, conflict resolution và đồng bộ lại khi token hết hạn.
36
+ - `device-permissions`: chỉ cần nếu feature có camera/location/notification/deep link; kiểm tra iOS và Android riêng, fallback khi từ chối permission.
37
+ - Spec chứa test matrix: airplane mode, offline restart, duplicate request, conflict, revoke session, low storage và app update.
38
+ - Không log token/customer payload, không giả định AsyncStorage/SecureStore đã được chọn; dùng stack đang có.
39
+
40
+ **Verification** — tùy project scripts/toolchain, không được Harness thực thi:
41
+
42
+ ~~~bash
43
+ # Chỉ chạy sau khi xác nhận có scripts tương ứng trong package.json
44
+ npm test
45
+ # Expo / device build và kiểm thử emulator/thiết bị cần setup riêng
46
+ ~~~
47
+
48
+ Ngoài unit tests, report thiết bị/OS và test thật trên iOS/Android, permissions denied, offline transitions và accessibility evidence.
49
+
50
+ ## 4. PR và phát hành
51
+
52
+ - `harness-review` và `security-reviewer` kiểm tra mã hóa/scope lưu local, auth và routing.
53
+ - `aih verify --scope all` chỉ tạo checklist; đính kèm kết quả build/device tests thực chạy.
54
+ - Nếu dùng `devops`, đây là **release planning** chung, không phải auto publish App Store/Play Store. Approval theo signing credentials/store policy nằm ngoài `aih`.
55
+ - Nếu app phụ thuộc backend API, xác nhận contract tương thích và liên kết PR khác repo; không stage backend từ repo mobile.
56
+
57
+ **Handoff:** approved user stories/AC → offline flows → OpenSpec → persistence/sync implementation → device test evidence → reviewed PR → authorized mobile release.
@@ -0,0 +1,100 @@
1
+ # Walkthrough 1 — Spring Boot API từ yêu cầu tới release
2
+
3
+ **Tình huống giả định:** thêm REST API tra cứu khách hàng theo tenant vào một **repo Spring Boot hiện có**, có PostgreSQL/Oracle tùy dự án, có thể thêm Kafka Outbox và Kubernetes **nếu thật sự có**. Không có source thực tế trong walkthrough này; endpoint, SQL và lệnh test là **đề xuất cần đối chiếu với project**.
4
+
5
+ **Modules:** Core + `java-spring` + `product`, bổ sung `devops,kubernetes` chỉ khi sở hữu pipeline/manifests. Xem [full SDLC](../end-to-end-workflow.md), [skills](../skill-matrix.md).
6
+
7
+ ## 1. Setup & input
8
+
9
+ ~~~bash
10
+ cd /path/to/existing-spring-service
11
+ aih resolve --adapters java-spring,kubernetes --capabilities product,devops
12
+ aih init --adapters java-spring,kubernetes --capabilities product,devops --dry-run
13
+ aih init --adapters java-spring,kubernetes --capabilities product,devops
14
+ aih check
15
+ aih skills
16
+ ~~~
17
+
18
+ Trong service không triển khai trên Kubernetes thì **bỏ `kubernetes`**; không dùng `aih detect` thay cho việc xác nhận stack. `aih init` chỉ chép Harness, không scaffold Spring Boot.
19
+
20
+ Input: source revision, business owner, endpoint contract đang có, auth/tenant rules, schema migration policy, test/build tool, environment/approver. Ghi fact và unknown trong `.harness/local.md` hoặc change riêng, không thay Core managed files.
21
+
22
+ ## 2. BA/PO → reviewed requirements
23
+
24
+ ~~~bash
25
+ aih new-doc brd
26
+ aih new-doc prd
27
+ aih new-doc backlog
28
+ aih new-doc acceptance-criteria
29
+ aih new-doc traceability
30
+ aih skill harness-product-business-analysis
31
+ aih skill harness-product-prd-generation
32
+ aih skill harness-product-acceptance-criteria
33
+ ~~~
34
+
35
+ AI IDE đọc nguồn được cấp quyền, đề xuất `FR-001`: tenant chỉ xem dữ liệu của mình; `AC-US-001-01`: tenant khác trả 403/404 tùy contract đã duyệt. **Chưa có xác nhận của PO thì đây vẫn là draft.** Reviewer dùng `harness-product-document-review` để phát hiện lỗ hổng; BA/PO là người xác nhận.
36
+
37
+ ## 3. OpenSpec & technical review
38
+
39
+ ~~~bash
40
+ aih new-change add-customer-lookup
41
+ aih skill harness-spec
42
+ ~~~
43
+
44
+ Từ approved `FR/AC`, hoàn thiện `openspec/changes/add-customer-lookup/{proposal,design,tasks}.md` và delta specs. Nội dung cần có: API status/body, JWT/LDAP principal→tenant, authorization ở service/data access, error mapping, pagination, audit, DB indexes và backward compatibility. Không suy đoán dialect hoặc thông số tải.
45
+
46
+ Nếu OpenSpec CLI được cài **riêng** và version tương thích với project:
47
+
48
+ ~~~bash
49
+ openspec validate add-customer-lookup --strict
50
+ ~~~
51
+
52
+ Lệnh `new-change` **chỉ tạo draft**, không validate/approve spec. Gate: reviewer duyệt API/security/data boundaries.
53
+
54
+ ## 4. Code theo adapter skills
55
+
56
+ ~~~bash
57
+ aih skill harness-java-spring-spring-api
58
+ aih skill harness-tdd
59
+ aih skill harness-java-spring-database-migration
60
+ aih skill harness-java-spring-kafka-outbox
61
+ ~~~
62
+
63
+ - `spring-api`: controller/service/repository theo pattern hiện có, tenant-scope server-side, DTO và HTTP contract.
64
+ - `database-migration`: chỉ dùng **khi đổi schema**; thiết kế expand → compatible deploy → contract, rollback/data-loss risk.
65
+ - `kafka-outbox`: chỉ dùng **khi có event publication**; transactional write, duplicate consumer delivery, retry/dead-letter.
66
+ - `harness-tdd`: negative auth test, missing resource, validation, successful request, regression. Không tạo implementation Kafka/DB nếu requirement không cần.
67
+
68
+ Lệnh verify ứng dụng **tùy repo** — dưới đây chỉ là ví dụ nếu có Maven wrapper:
69
+
70
+ ~~~bash
71
+ # Kiểm tra wrapper và profile của repo trước khi chạy
72
+ ./mvnw test
73
+ # ./mvnw verify # nếu project cấu hình integration tests phù hợp
74
+ ~~~
75
+
76
+ `aih verify --scope all` xuất checklist **không chạy Maven**. Nếu không chạy được integration test do thiếu DB, báo blocker; không ghi Pass.
77
+
78
+ ## 5. PR → staging → production
79
+
80
+ ~~~bash
81
+ aih verify --scope all
82
+ aih eval --scope all
83
+ aih check
84
+ ~~~
85
+
86
+ Reviewer sử dụng `harness-review` + `security-reviewer`; PR gắn change ID, approved AC, diff, actual test logs, migration sequence, unrun checks, release/rollback plan. Không tự merge.
87
+
88
+ Nếu có pipeline/manifests: `harness-devops-ci-cd` → `harness-devops-docker` → `harness-kubernetes-workload-review`, `harness-kubernetes-helm-release` (nếu Helm) → `harness-devops-deployment` / `harness-kubernetes-rollout-safety`. Chỉ người/runtime được phép và có approval theo artifact/environment mới deploy; sau rollout kiểm chứng readiness + actual error/latency data.
89
+
90
+ ## Expected handoff (mẫu, không phải kết quả đã chạy)
91
+
92
+ | Stage | Output cần bàn giao |
93
+ | --- | --- |
94
+ | Product | `docs/product/brd.md`, `prd.md`, `backlog.md`, `acceptance-criteria.md`, `traceability.md` approved |
95
+ | Spec | `openspec/changes/add-customer-lookup/` reviewed |
96
+ | Code | Endpoint + auth/contract tests + migration/event tests nếu có |
97
+ | Review | PR, CI/test evidence, risk list, human decision |
98
+ | Release | Image digest, environment approval, rollback steps, measured health |
99
+
100
+ **Sau khi PR đã merge:** upstream OpenSpec archive/sync nếu dự án sử dụng OpenSpec; không archive khi change vẫn chưa merge.
@@ -0,0 +1,148 @@
1
+ # Getting started — cài và sử dụng AI Harness
2
+
3
+ AI Harness phân phối **rules, role contracts, skills và workflows** tới repository ứng dụng. Lệnh `aih` là CLI chạy offline, không phải AI agent runner: nó không tạo ứng dụng, đọc Confluence, tạo Figma, chạy test, gọi LLM, merge PR hay deploy.
4
+
5
+ **Đọc theo thứ tự:** [Full SDLC](end-to-end-workflow.md) → [Skill matrix](skill-matrix.md) → [Agent handoffs](agent-handoffs.md) → [Ví dụ theo stack](#ví-dụ-thực-hành).
6
+
7
+ ## 1. Chuẩn bị
8
+
9
+ - Node.js >=22, Git và npm (cần quyền repository private chỉ khi cài từ source).
10
+ - Một **repository ứng dụng đã tồn tại** và AI IDE/assistant có thể đọc file trong repository đó.
11
+ - Chỉ kết nối GitHub, Confluence, Figma hay nền tảng khác trong AI host khi cần, theo quyền đã phê duyệt.
12
+ - **OpenSpec CLI là tùy chọn**: `aih new-change` tạo bản nháp offline, còn `openspec validate` cần OpenSpec CLI cài riêng. Xem [OpenSpec](openspec.md).
13
+ - Bản nguồn hiện tại là candidate; chưa mặc định có một bản `@manhd_d/ai-harness` được phát hành trên npm registry. Xem [npm release](npm-release.md).
14
+
15
+ ## 2. Cài một lần từ source đã review
16
+
17
+ ~~~bash
18
+ git clone git@github.com:manh0303/ai-harness.git
19
+ cd ai-harness
20
+ # Nếu thử PR Astro chưa merge, chọn branch đã review:
21
+ git switch feat/astro-lightweight-adapter
22
+ # Sau khi merge, ưu tiên commit/tag chính thức đã review.
23
+ npm test
24
+ npm run validate
25
+ npm run test:package
26
+ npm pack
27
+ npm install -g ./manhd_d-ai-harness-0.6.0.tgz
28
+ aih --version
29
+ ~~~
30
+
31
+ Nếu package đã được publish công khai thì có thể cài bằng `npm install -g @manhd_d/ai-harness`; **đừng coi lệnh cài registry là dùng được trước khi xác minh việc phát hành**. Cài bộ `aih` không tự cài OpenSpec hay dependency Spring/React/Python cho ứng dụng.
32
+
33
+ ## 3. Cài Harness vào repository ứng dụng
34
+
35
+ Ví dụ service Spring Boot có nhu cầu làm tài liệu sản phẩm và triển khai Kubernetes:
36
+
37
+ ~~~bash
38
+ cd /path/to/existing-spring-service
39
+ aih resolve --adapters java-spring,kubernetes --capabilities product,devops
40
+ aih init --adapters java-spring,kubernetes --capabilities product,devops --dry-run
41
+ aih init --adapters java-spring,kubernetes --capabilities product,devops
42
+ aih check
43
+ aih skills
44
+ ~~~
45
+
46
+ - `aih resolve`: kiểm tra dependency/compatibility và cảnh báo recommendation; **không cài module**.
47
+ - `aih init --dry-run`: xem diff dự kiến, **không cài đặt lâu dài**.
48
+ - `aih init`: cài snapshot đã chọn trong `.harness/`, tạo AGENTS block, ghi lock và expose skills trong `.agents/skills/`.
49
+ - `aih check`: kiểm tra integrity của file do Harness quản lý, **không kiểm thử source code ứng dụng**.
50
+ - `aih skills`: liệt kê metadata. `aih skill <tên>`: đọc **một** skill đã cài, không tự kích hoạt agent.
51
+
52
+ **Các lựa chọn phổ biến:**
53
+
54
+ | Dự án | Lựa chọn |
55
+ | --- | --- |
56
+ | API Spring | `--adapters java-spring` |
57
+ | Web React/Next.js | `--adapters react-nextjs --capabilities uiux` |
58
+ | Astro web tools (static-first) | `--adapters astro` (tùy chọn `--capabilities product,uiux`) |
59
+ | Astro/React + advertising | `--adapters astro --capabilities monetization` (hoặc `react-nextjs`) |
60
+ | React Native/Expo | `--adapters react-native --capabilities product,uiux` |
61
+ | Python AI/RAG | `--adapters ai-python --capabilities product` |
62
+ | Full-stack một repo | `--adapters java-spring,react-nextjs,kubernetes --capabilities product,uiux,devops` |
63
+ | Chỉ BA/PO | `--capabilities product` |
64
+ | Core-only | Không truyền adapters/capabilities |
65
+
66
+ `aih detect` kiểm tra heuristic các file trực tiếp ở target, không tìm đệ quy monorepo. Với mỗi microservice/repository độc lập, cài riêng và chỉ chọn những module thực sự cần.
67
+
68
+ ## Astro cho web tools nhỏ
69
+
70
+ Nếu xây nhiều tiện ích như QR, JSON hoặc image tools: dùng [Astro micro-tools walkthrough](examples/astro-micro-tools.md) với lệnh `aih init --adapters astro` và skill islands, SEO, performance, Cloudflare. `astro` được nhận diện từ dependencies. React Islands không bắt buộc; MFE/Workers không được cài tự động.
71
+
72
+ ## Website công cụ miễn phí có quảng cáo
73
+
74
+ Nếu mục tiêu là traffic SEO và doanh thu AdSense, chọn optional `monetization` **không phụ thuộc Astro**; website có thể dùng Next.js. Xem [Monetization guide](monetization.md), [walkthrough Astro + AdSense](examples/astro-adsense-microtools.md) và `aih skill harness-monetization-adsense-integration`. Các hướng dẫn chỉ giúp chuẩn bị, không tự tạo tài khoản AdSense hoặc kết nối Analytics.
75
+
76
+ ## Hai hướng dẫn theo loại dự án
77
+
78
+ - [Idea-driven — có ý tưởng và muốn AI cùng thảo luận, nghiên cứu, viết tài liệu](examples/idea-driven-project.md).
79
+ - [Document-driven — có BRD/PRD/SRS từ BA, cần AI đưa vào phát triển phần mềm](examples/document-driven-project.md).
80
+
81
+ **Lưu ý:** khi PR chứa tính năng chưa merge, cần checkout đúng branch/commit đã review trước khi `npm pack`; cài từ `main` không mặc định có các tính năng chỉ có trong PR.
82
+
83
+ ## 4. Bắt đầu một thay đổi có traceability
84
+
85
+ Hai workflow tài liệu: `idea-driven` khi bắt đầu từ ý tưởng thô, `document-driven` khi đã có BRD/PRD/SRS/Confluence do BA cung cấp. Cả hai dùng chung pipeline, approval và OpenSpec. Xem [Documentation workflows](documentation-workflows.md).
86
+
87
+
88
+ ~~~bash
89
+ # Chỉ dùng được khi đã chọn capability product:
90
+ aih new-doc brd
91
+ aih new-doc prd
92
+ aih new-doc backlog
93
+ aih new-doc acceptance-criteria
94
+ aih new-doc traceability
95
+ aih new-doc idea # docs/discovery/
96
+ aih new-doc research # docs/discovery/
97
+ aih new-doc prd-lite # docs/product/
98
+ aih new-doc srs # docs/product/
99
+ aih new-doc use-cases # docs/product/
100
+
101
+ # Tạo change bản nháp OpenSpec — không cần cài OpenSpec CLI:
102
+ aih new-change add-customer-api
103
+
104
+ # Đọc từng skill cần thiết:
105
+ aih skill harness-product-prd-generation
106
+ aih skill harness-spec
107
+ aih skill harness-tdd
108
+ ~~~
109
+
110
+ Các lệnh `new-doc` chỉ copy template trống sang `docs/product/`; AI host/BA/PO phải điền theo nguồn đáng tin cậy và duyệt. `new-change` chỉ tạo proposal/design/tasks/spec có TODO; **không phải spec đã được approve**. Trước khi yêu cầu IDE implement, hướng assistant đọc `AGENTS.md` và `.harness/local.md` của dự án.
111
+
112
+ **Prompt mẫu gửi cho assistant:**
113
+
114
+ > Hãy đọc AGENTS.md, .harness/local.md và các skill phù hợp đã cài. Phân tích yêu cầu theo source ID, nêu các điểm chưa rõ, soạn OpenSpec change và test scenarios. Chỉ implement khi scope được duyệt; báo cáo tests thực chạy và tạo PR để tôi review, không tự merge hoặc deploy.
115
+
116
+ ## 5. Verify / evaluate và release
117
+
118
+ ~~~bash
119
+ aih verify --scope all
120
+ aih eval --scope all
121
+ aih check
122
+ ~~~
123
+
124
+ - `verify`: checklist advisory, `executed: false`. Dùng bằng chứng chạy build/test **bên ngoài CLI**.
125
+ - `eval`: dataset và report để con người chạy bài test với một AI runtime được cấp quyền rồi chấm; **không gọi model, không tự chấm**.
126
+ - `--scope all`: Core + capability + adapter và scenario ghép module phù hợp. Không có scope thì mặc định chỉ là adapter.
127
+ - Production approval phải chỉ rõ artifact, environment và người phê duyệt; CI xanh không cấp quyền deploy.
128
+
129
+ Đọc các [approval gates trong Full SDLC](end-to-end-workflow.md) và [DevOps runbook](../capabilities/devops/workflows/pr-to-production.md).
130
+
131
+ ## 6. Update bộ Harness đã cài
132
+
133
+ ~~~bash
134
+ # Trên branch của consumer, commit trạng thái hiện tại trước.
135
+ # Thay đổi adapters/capabilities trong .harness/project.json nếu cần.
136
+ aih update --dry-run
137
+ aih update
138
+ aih check
139
+ ~~~
140
+
141
+ Không chỉnh file snapshot dưới `.harness/core|adapters|capabilities` hoặc skill do Harness quản lý; nội dung riêng của dự án thuộc `.harness/local.md`. Nếu có drift, khôi phục từ Git và review diff; không sửa lock hash để che lỗi.
142
+
143
+ ## Ví dụ thực hành
144
+
145
+ - [Spring Boot REST API với Kafka/DB/Kubernetes](examples/spring-boot-api.md)
146
+ - [Full-stack Spring + Next.js + Figma](examples/fullstack-web.md)
147
+ - [React Native/Expo có offline-sync](examples/react-native-app.md)
148
+ - [Python AI/RAG với kiểm soát truy cập](examples/ai-rag-service.md)
@@ -0,0 +1,53 @@
1
+ # Website monetization — ads as a business layer, not a framework dependency
2
+
3
+ The optional `monetization` capability is reusable for Astro, React/Next.js or a static website. It guides research, policy-safe ad UX and unit economics; it does **not** connect to Google accounts, add scripts, fetch ad statistics, generate clicks or promise income. The user needs a legitimate publisher-owned domain and valuable original tools/content.
4
+
5
+ ## Choose modules
6
+
7
+ ```bash
8
+ # Minimal website with advertising business workflow
9
+ aih resolve --adapters astro --capabilities monetization
10
+ aih init --adapters astro --capabilities monetization --dry-run
11
+ aih init --adapters astro --capabilities monetization
12
+ aih check
13
+ aih skills
14
+ aih skill harness-monetization-adsense-integration
15
+ aih skill harness-monetization-ad-placement-ux
16
+ aih verify --scope capabilities # review checklist only, never a browser/policy scan
17
+ ```
18
+
19
+ For React/Next.js, substitute `--adapters react-nextjs`. Add `product,uiux` only when discovery/design workflow is useful: `aih init --adapters astro --capabilities product,uiux,monetization`. For a project already initialized with Harness, update the `.harness/project.json` capabilities array on a branch and run `aih update --dry-run`, `aih update`, `aih check` (do **not** re-init). No extra runtime dependencies or AdSense credentials are needed to install this instructional module.
20
+
21
+ ## Workflow A — website → AdSense application → approved integration
22
+
23
+ 1. Build a working **useful tool** first: QR, format conversion, image, PDF or other legitimate user need. Avoid scraped, duplicated or thin generated pages. Prefer local browser processing to minimize operating cost and protect user input.
24
+ 2. Prepare unique public tool URLs, descriptive content, privacy disclosures, appropriate contact/about/trust information and accessible mobile UX. Review applicable original-content/network rules.
25
+ 3. Register/verify publisher-owned site in the actual AdSense account **outside Harness**. Eligibility and approval are Google decisions. If status is unknown, record UNKNOWN, not approved.
26
+ 4. Review ad positions: keep actual tool input/output actions easy to find. Ads cannot impersonate navigation or Download/Generate buttons. Reserve stable slot area to reduce unexpected shift.
27
+ 5. Determine site audience and legal/privacy/consent needs. For relevant personalized ads to EEA/UK/Swiss traffic Google requires a certified CMP integrated with the IAB TCF; decide approved solution with owner and applicable advisers.
28
+ 6. If approved to publish, use the actual Google-provided ad integration and owner-authorized publisher details. `ads.txt` at the root domain is **highly recommended, not universally mandatory**; never invent an account/seller ID.
29
+ 7. Human reviews actual changed pages, ad/no-fill/adblocked/consent UX and production release scope before deploy. `aih` cannot publish ads or deploy.
30
+
31
+ Project-owned artifacts: `docs/monetization/site-monetization-plan.md`, `ad-placement-review.md`, `privacy-consent-checklist.md`. The templates are installed at `.harness/capabilities/monetization/templates/` and must be copied into consumer docs by your authorized editor **without overwrite**; `aih new-doc` creates **Product-only** templates.
32
+
33
+ ## Workflow B — traffic → financial learning
34
+
35
+ Use `harness-monetization-seo-growth` and `harness-monetization-analytics-revenue` to measure legitimate traffic quality, Page RPM, ad earnings and real hosting/API costs.
36
+
37
+ ```text
38
+ Page RPM = (estimated earnings / page views) × 1000
39
+ Modeled earnings = (assumed page views / 1000) × assumed Page RPM
40
+ Modeled contribution = modeled earnings − explicitly scoped costs
41
+ ```
42
+
43
+ Do not confuse Page RPM with ad-impression RPM, or `estimated earnings` with payments received. If no actual AdSense/analytics access exists, pageviews, RPM and income are UNKNOWN; show parameterized scenarios rather than inventing country-specific payouts. Report observed vs forecast numbers in `docs/monetization/analytics-report.md`. Review using owner-approved experiments without traffic manipulation or invalid clicks.
44
+
45
+ ## Policy sources — recheck before every actual release
46
+
47
+ - [Google AdSense placement policies](https://support.google.com/adsense/answer/1346295?hl=en) — avoid accidental clicks, disguised ads/controls
48
+ - [Avoiding invalid traffic](https://support.google.com/adsense/answer/2660562?hl=en) — no click exchanges, self-clicks, forced/fake activity
49
+ - [Google ads.txt guide](https://support.google.com/adsense/answer/12171612?hl=en) — highly recommended; serve authorized records at root
50
+ - [Google publisher CMP/TCF requirements](https://support.google.com/adsense/answer/13554116?hl=en) — EEA, UK, Switzerland
51
+ - [Google Page RPM definition](https://support.google.com/adsense/answer/190515?hl=en) — metric, not guaranteed yield
52
+
53
+ Provider policies, privacy laws, pricing and revenue rates change. An AI-generated checklist does not establish legal compliance or Google site approval. Check exact pages, audiences, networks and dates.
@@ -0,0 +1,70 @@
1
+ # npm installation and release
2
+
3
+ The public npm package is `@manhd_d/ai-harness` (executable: `aih`). The private GitHub repository stays `manh0303/ai-harness`. Different npm and GitHub usernames are expected.
4
+
5
+ **Changing this configuration and merging a PR does not publish a package.** Public npm publication makes every file inside the npm tarball publicly accessible, regardless of GitHub repository visibility.
6
+
7
+ ## First publication: manual, maintainer-controlled
8
+
9
+ 1. Confirm the verified npm account is `manhd_d`, with 2FA enabled, and the publishing machine uses the official npm registry.
10
+ 2. Merge the reviewed PR. Check out the approved `main` commit. Review `npm pack --dry-run` for secrets before sharing the archive.
11
+ 3. Run:
12
+
13
+ ```bash
14
+ git switch main
15
+ git pull --ff-only
16
+ npm login
17
+ npm whoami
18
+ npm config get registry
19
+ npm ci --ignore-scripts --no-audit --no-fund
20
+ npm test
21
+ npm run validate
22
+ npm run check:release
23
+ npm run test:package
24
+ npm pack --dry-run
25
+ npm publish --access public
26
+ npm view @manhd_d/ai-harness version
27
+ ```
28
+
29
+ `npm whoami` must return `manhd_d`. The expected first package version is `0.6.0`, if the maintainer has approved that release and the version is not already published. Publishing may require browser/2FA confirmation. Never commit npm credentials or tokens.
30
+
31
+ A successful publish is independently verifiable with `npm view`. You can add an annotated git tag `v0.6.0` to the exact commit afterwards, but **do not create/publish a GitHub Release for a version already published manually**.
32
+
33
+ ## Later releases: npm Trusted Publishing via GitHub Actions
34
+
35
+ After the first successful manual publication, go to [npm](https://www.npmjs.com) → package `@manhd_d/ai-harness` → Settings → Trusted publishing and configure a GitHub Actions publisher:
36
+
37
+ | Field | Value |
38
+ | --- | --- |
39
+ | GitHub user/organization | `manh0303` |
40
+ | Repository | `ai-harness` |
41
+ | Workflow file | `npm-publish.yml` |
42
+ | Environment | Leave empty (workflow does not use an environment) |
43
+
44
+ Select direct **npm publish** permissions if npm offers a stage-only option. Configure the trusted publisher shortly before the next release if npm applies an initial activation deadline. No long-lived `NPM_TOKEN` is required.
45
+
46
+ For each subsequent version: use a dedicated release PR to update `package.json`, `package-lock.json`, `harness.yaml` and `CHANGELOG.md` together, run CI, review and merge. Create a tag `vX.Y.Z` at the tested main commit and **publish the corresponding GitHub Release**. Only this Release publication triggers `.github/workflows/npm-publish.yml`. The workflow checks that the commit is reachable from main, that the tag matches the package version, and that tests and tarball smoke checks pass before attempting OIDC-based publication.
47
+
48
+ A private GitHub source repository does not support npm provenance attestation even though the public package can use OIDC. Do not enable npm provenance for this private repository. See [npm Trusted Publishing](https://docs.npmjs.com/trusted-publishers/).
49
+
50
+ ## Local installation before npm publication
51
+
52
+ ```bash
53
+ npm pack
54
+ npm install -g ./manhd_d-ai-harness-0.6.0.tgz
55
+ aih --version
56
+ ```
57
+
58
+ ## Installation after verified npm publication
59
+
60
+ ```bash
61
+ npm install -g @manhd_d/ai-harness
62
+ aih --version
63
+ cd /path/to/existing-project
64
+ aih init --adapters java-spring
65
+ aih check
66
+ ```
67
+
68
+ Existing consumers can update the CLI with `npm update -g @manhd_d/ai-harness`. Use `aih update --dry-run`, `aih update`, `aih check` to update a consumer project's snapshot on a branch. CLI installation does not install OpenSpec, an AI runtime or application dependencies.
69
+
70
+ Read [Getting started](getting-started.md) and [Release policy](release-policy.md).
@@ -0,0 +1,23 @@
1
+ # OpenSpec integration
2
+
3
+ The initial integration uses the upstream `spec-driven` schema, project context and artifact rules.
4
+ It does not fork OpenSpec, bundle its CLI or implement its archive/sync engine.
5
+ Install and pin OpenSpec with the package manager and runtime requirements appropriate to your project.
6
+ Consult upstream installation instructions; no floating `latest` dependency is injected into consumers.
7
+
8
+ The harness new-change command creates `.openspec.yaml`, proposal.md, design.md, tasks.md and
9
+ specs/<change-id>/spec.md. Replace draft TODOs and use capability names that match your actual domain;
10
+ the change ID is only a default capability slug. For changes to existing behavior use MODIFIED/REMOVED
11
+ delta sections as required by upstream. Keep acceptance criteria observable.
12
+
13
+ Use upstream `openspec validate <change-id> --strict` before review. Tool-specific slash commands are
14
+ not hardcoded; use the integration generated by your pinned OpenSpec version if needed.
15
+ Archive/sync is performed through OpenSpec only after all related PRs merge. This repo's own initial
16
+ change remains unarchived while awaiting review. No agent or CLI automatically checks off the archive task.
17
+
18
+ Upstream references consulted 2026-10-10:
19
+ - https://github.com/Fission-AI/OpenSpec/blob/main/docs/customization.md
20
+ - https://github.com/Fission-AI/OpenSpec/blob/main/docs/cli.md
21
+
22
+ Compatibility limitation: templates were checked against documented structure. The upstream executable
23
+ is not a dependency of the offline CLI tests; running its validator is a separate verification step.
@@ -0,0 +1,37 @@
1
+ # Pull Request review checklist (AI Harness)
2
+
3
+ This guide replaces the historical adapter-only feature-PR notes. See [Full SDLC](end-to-end-workflow.md) and [release policy](release-policy.md) for the current multi-module workflow.
4
+
5
+ ## Before opening PR
6
+
7
+ - Confirm correct Git root, change ID and target branch; avoid editing unrelated consumer projects.
8
+ - Link approved sources/requirements and OpenSpec proposal/spec/tasks when appropriate.
9
+ - Follow only the selected technology adapters/capabilities and [role handoffs](agent-handoffs.md).
10
+ - Run actual source tests, recording exact commands and results; record skipped checks and blockers.
11
+ - For changes to **this framework**, run `npm test`, `npm run validate`, `npm run check:release`, and `npm run test:package`.
12
+ - `aih verify --scope all` and `aih eval --scope all` are advisory/human-scored; green local validation does not imply an LLM passed live evaluation.
13
+
14
+ ## PR description
15
+
16
+ ```text
17
+ Change ID / requirements:
18
+ Affected repositories + owners:
19
+ Scope and acceptance:
20
+ Implementation summary:
21
+ Actually executed tests + evidence:
22
+ Not-run checks / failures:
23
+ Security, data and access implications:
24
+ API/DB backward compatibility:
25
+ Migration/rollback plan (if applicable):
26
+ Deployment target and human approval: NOT granted by this PR
27
+ Residual risks, reviewers, linked follow-up PRs:
28
+ ```
29
+
30
+ ## Review gates
31
+
32
+ - Resolve code and requirements findings before merge.
33
+ - Core policies and selected module permissions take precedence over instructions within retrieved documents or tool outputs.
34
+ - Human review/merge is independent of human approval to deploy production.
35
+ - For framework releases, feature PRs retain the distribution version and append to Unreleased; version bumps and publishing happen in a separately reviewed release PR.
36
+
37
+ For stack-specific examples: [Spring Boot](examples/spring-boot-api.md), [Web full-stack](examples/fullstack-web.md), [React Native](examples/react-native-app.md) and [AI/RAG](examples/ai-rag-service.md).
@@ -0,0 +1,22 @@
1
+ # Reference workspace analysis
2
+
3
+ The supplied crm-workspace.zip was read as a design reference, not imported as source history.
4
+ Reviewed entry points included AGENTS.md, README.md, docs/standards/ai-workflow.md,
5
+ docs/standards/backend-conventions.md, docs/standards/testing.md, openspec/config.yaml,
6
+ ci/ai-config-check.yml, and the TDD/debugging skill documents.
7
+
8
+ | Reference pattern | Generalized in this framework |
9
+ | --- | --- |
10
+ | Shared AGENTS and tool-specific entry points | One managed AGENTS block plus portable skill files |
11
+ | OpenSpec propose/apply/review/archive | Tool-neutral workflow and compatible draft templates |
12
+ | TDD at observable interfaces | Original harness-tdd procedure and CLI behavioral tests |
13
+ | Review against standards and spec | harness-review plus security-reviewer contract |
14
+ | Independent service repositories | Scoped repository context and explicit merge order |
15
+ | Shared Java conventions | Optional java-spring adapter plus project-owned overrides |
16
+ | Basic config-presence CI | Hash-based drift checks, safe installer tests and structural validation |
17
+
18
+ Project identities, endpoints, private network addresses, service rosters, database schemas, credentials,
19
+ repository history and client-specific business rules are intentionally not distributed.
20
+ Legacy conventions remain the responsibility of the consumer project; they are not universal defaults.
21
+ The framework's skills are newly written concise procedures; third-party skill source from the ZIP is
22
+ not vendored. This repository does not claim ownership of upstream tools or redistribute their packages.
@@ -0,0 +1,17 @@
1
+ # Release discipline and module versioning
2
+
3
+ Distribution version is `harness.yaml` + `package.json` + `package-lock.json`. Optional `module_version` belongs to each adapter/capability, allowing independent contracts inside a single npm package.
4
+
5
+ ## Prevent concurrent version conflicts
6
+ 1. Feature PRs **do not bump** distribution version, tag or publish. Describe changes in the Unreleased changelog.
7
+ 2. Each module maintainer changes `module_version` only for real contract changes, describing compatibility impact in the PR.
8
+ 3. One **release PR** assigns the next distribution version, updates all three metadata files, and moves Unreleased notes into a version heading.
9
+ 4. Check CI on Linux/Windows and Node 22/24; run behavioral agent evaluations when instructions change, not just synthetic unit tests.
10
+ 5. A human merges the release PR and separately approves npm publication: first version is manually published; subsequent versions require a human-published matching GitHub Release. No publishing merely on merge or tag.
11
+
12
+ ## Compatibility
13
+ - Existing schema-1 config and locks remain valid. Optional module contract fields are additive.
14
+ - `aih verify` / `aih eval` default to adapter-only. `--scope all` includes Core, capabilities and matching cross-module cases.
15
+ - New installs and reviewed updates validate required module dependencies. `aih resolve` never silently installs recommendations.
16
+ - Reports are bundle/dataset bound; human-scored reports do not prove AI behavior or tool execution.
17
+ - No module may bypass Core permission rules, and the CLI grants no runtime privilege.