ma-agents 2.20.3 → 2.22.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 (149) hide show
  1. package/.opencode/skills/.ma-agents.json +241 -0
  2. package/.opencode/skills/MANIFEST.yaml +254 -0
  3. package/.opencode/skills/ai-audit-trail/SKILL.md +23 -0
  4. package/.opencode/skills/auto-bug-detection/SKILL.md +169 -0
  5. package/.opencode/skills/cmake-best-practices/SKILL.md +64 -0
  6. package/.opencode/skills/cmake-best-practices/examples/cmake.md +59 -0
  7. package/.opencode/skills/code-documentation/SKILL.md +57 -0
  8. package/.opencode/skills/code-documentation/examples/cpp.md +29 -0
  9. package/.opencode/skills/code-documentation/examples/csharp.md +28 -0
  10. package/.opencode/skills/code-documentation/examples/javascript_typescript.md +28 -0
  11. package/.opencode/skills/code-documentation/examples/python.md +57 -0
  12. package/.opencode/skills/code-review/SKILL.md +43 -0
  13. package/.opencode/skills/commit-message/SKILL.md +79 -0
  14. package/.opencode/skills/cpp-best-practices/SKILL.md +234 -0
  15. package/.opencode/skills/cpp-best-practices/examples/modern-idioms.md +189 -0
  16. package/.opencode/skills/cpp-best-practices/examples/naming-and-organization.md +102 -0
  17. package/.opencode/skills/cpp-concurrency-safety/SKILL.md +60 -0
  18. package/.opencode/skills/cpp-concurrency-safety/examples/concurrency.md +73 -0
  19. package/.opencode/skills/cpp-const-correctness/SKILL.md +63 -0
  20. package/.opencode/skills/cpp-const-correctness/examples/const_correctness.md +54 -0
  21. package/.opencode/skills/cpp-memory-handling/SKILL.md +42 -0
  22. package/.opencode/skills/cpp-memory-handling/examples/modern-cpp.md +49 -0
  23. package/.opencode/skills/cpp-memory-handling/examples/smart-pointers.md +46 -0
  24. package/.opencode/skills/cpp-modern-composition/SKILL.md +64 -0
  25. package/.opencode/skills/cpp-modern-composition/examples/composition.md +51 -0
  26. package/.opencode/skills/cpp-robust-interfaces/SKILL.md +55 -0
  27. package/.opencode/skills/cpp-robust-interfaces/examples/interfaces.md +56 -0
  28. package/.opencode/skills/create-hardened-docker-skill/SKILL.md +637 -0
  29. package/.opencode/skills/create-hardened-docker-skill/scripts/create-all.sh +489 -0
  30. package/.opencode/skills/csharp-best-practices/SKILL.md +278 -0
  31. package/.opencode/skills/docker-hardening-verification/SKILL.md +28 -0
  32. package/.opencode/skills/docker-hardening-verification/scripts/verify-hardening.sh +39 -0
  33. package/.opencode/skills/docker-image-signing/SKILL.md +28 -0
  34. package/.opencode/skills/docker-image-signing/scripts/sign-image.sh +33 -0
  35. package/.opencode/skills/document-revision-history/SKILL.md +104 -0
  36. package/.opencode/skills/git-workflow-skill/SKILL.md +194 -0
  37. package/.opencode/skills/git-workflow-skill/hooks/commit-msg +61 -0
  38. package/.opencode/skills/git-workflow-skill/hooks/pre-commit +38 -0
  39. package/.opencode/skills/git-workflow-skill/hooks/prepare-commit-msg +56 -0
  40. package/.opencode/skills/git-workflow-skill/scripts/finish-feature.sh +192 -0
  41. package/.opencode/skills/git-workflow-skill/scripts/install-hooks.sh +55 -0
  42. package/.opencode/skills/git-workflow-skill/scripts/start-feature.sh +110 -0
  43. package/.opencode/skills/git-workflow-skill/scripts/validate-workflow.sh +229 -0
  44. package/.opencode/skills/js-ts-dependency-mgmt/SKILL.md +49 -0
  45. package/.opencode/skills/js-ts-dependency-mgmt/examples/dependency_mgmt.md +60 -0
  46. package/.opencode/skills/js-ts-security-skill/SKILL.md +64 -0
  47. package/.opencode/skills/js-ts-security-skill/scripts/verify-security.sh +136 -0
  48. package/.opencode/skills/logging-best-practices/SKILL.md +50 -0
  49. package/.opencode/skills/logging-best-practices/examples/cpp.md +36 -0
  50. package/.opencode/skills/logging-best-practices/examples/csharp.md +49 -0
  51. package/.opencode/skills/logging-best-practices/examples/javascript.md +77 -0
  52. package/.opencode/skills/logging-best-practices/examples/python.md +57 -0
  53. package/.opencode/skills/logging-best-practices/references/logging-standards.md +29 -0
  54. package/.opencode/skills/open-presentation/SKILL.md +35 -0
  55. package/.opencode/skills/opentelemetry-best-practices/SKILL.md +34 -0
  56. package/.opencode/skills/opentelemetry-best-practices/examples/go.md +32 -0
  57. package/.opencode/skills/opentelemetry-best-practices/examples/javascript.md +58 -0
  58. package/.opencode/skills/opentelemetry-best-practices/examples/python.md +37 -0
  59. package/.opencode/skills/opentelemetry-best-practices/references/otel-standards.md +37 -0
  60. package/.opencode/skills/python-best-practices/SKILL.md +385 -0
  61. package/.opencode/skills/python-dependency-mgmt/SKILL.md +42 -0
  62. package/.opencode/skills/python-dependency-mgmt/examples/dependency_mgmt.md +67 -0
  63. package/.opencode/skills/python-security-skill/SKILL.md +56 -0
  64. package/.opencode/skills/python-security-skill/examples/security.md +56 -0
  65. package/.opencode/skills/self-signed-cert/SKILL.md +42 -0
  66. package/.opencode/skills/self-signed-cert/scripts/generate-cert.ps1 +45 -0
  67. package/.opencode/skills/self-signed-cert/scripts/generate-cert.sh +43 -0
  68. package/.opencode/skills/skill-creator/SKILL.md +196 -0
  69. package/.opencode/skills/skill-creator/references/output-patterns.md +82 -0
  70. package/.opencode/skills/skill-creator/references/workflows.md +28 -0
  71. package/.opencode/skills/skill-creator/scripts/init_skill.py +208 -0
  72. package/.opencode/skills/skill-creator/scripts/package_skill.py +99 -0
  73. package/.opencode/skills/skill-creator/scripts/quick_validate.py +113 -0
  74. package/.opencode/skills/story-status-lookup/SKILL.md +78 -0
  75. package/.opencode/skills/test-accompanied-development/SKILL.md +50 -0
  76. package/.opencode/skills/test-generator/SKILL.md +65 -0
  77. package/.opencode/skills/vercel-react-best-practices/SKILL.md +109 -0
  78. package/.opencode/skills/verify-hardened-docker-skill/SKILL.md +442 -0
  79. package/.opencode/skills/verify-hardened-docker-skill/scripts/verify-docker-hardening.sh +439 -0
  80. package/AiAudit.md +5 -0
  81. package/QUICK_START.md +11 -5
  82. package/README.md +52 -1
  83. package/bin/cli.js +31 -4
  84. package/docs/BMAD_AI_Development_Training.pptx +0 -0
  85. package/docs/technical-notes/context-persistence-research.md +434 -0
  86. package/docs/technical-notes/enforcement-hooks-research.md +415 -0
  87. package/lib/agents.js +34 -0
  88. package/lib/bmad-extension/agents/bmm-architect.customize.yaml +5 -0
  89. package/lib/bmad-extension/agents/bmm-bmad-master.customize.yaml +5 -0
  90. package/lib/bmad-extension/agents/bmm-cyber.customize.yaml +30 -0
  91. package/lib/bmad-extension/agents/bmm-dev.customize.yaml +5 -0
  92. package/lib/bmad-extension/agents/bmm-devops.customize.yaml +30 -0
  93. package/lib/bmad-extension/agents/bmm-mil498.customize.yaml +42 -0
  94. package/lib/bmad-extension/agents/bmm-pm.customize.yaml +5 -0
  95. package/lib/bmad-extension/agents/bmm-qa.customize.yaml +5 -0
  96. package/lib/bmad-extension/agents/bmm-sm.customize.yaml +5 -0
  97. package/lib/bmad-extension/agents/bmm-sre.customize.yaml +30 -0
  98. package/lib/bmad-extension/agents/bmm-tech-writer.customize.yaml +5 -0
  99. package/lib/bmad-extension/agents/bmm-ux-designer.customize.yaml +5 -0
  100. package/lib/bmad-extension/module-help.csv +7 -0
  101. package/lib/bmad-extension/module.yaml +3 -0
  102. package/lib/bmad-extension/workflows/add-sprint/workflow.md +112 -0
  103. package/lib/bmad-extension/workflows/add-to-sprint/workflow.md +206 -0
  104. package/lib/bmad-extension/workflows/create-bug-story/workflow.md +186 -0
  105. package/lib/bmad-extension/workflows/modify-sprint/workflow.md +250 -0
  106. package/lib/bmad-extension/workflows/project-context-expansion/workflow.md +229 -0
  107. package/lib/bmad-extension/workflows/sprint-status-view/workflow.md +193 -0
  108. package/lib/bmad.js +168 -36
  109. package/lib/hooks/claude-code/verify-manifest.js +56 -0
  110. package/lib/installer.js +282 -1
  111. package/lib/methodology/BMAD_AI_Development_Training.pptx +0 -0
  112. package/lib/methodology/version.json +7 -0
  113. package/lib/skill-authoring.js +732 -0
  114. package/lib/templates/project-context.template.md +47 -0
  115. package/opencode.json +8 -0
  116. package/package.json +2 -2
  117. package/skills/auto-bug-detection/SKILL.md +165 -0
  118. package/skills/auto-bug-detection/skill.json +8 -0
  119. package/skills/code-review/SKILL.md +40 -0
  120. package/skills/cpp-best-practices/SKILL.md +230 -0
  121. package/skills/cpp-best-practices/examples/modern-idioms.md +189 -0
  122. package/skills/cpp-best-practices/examples/naming-and-organization.md +102 -0
  123. package/skills/cpp-best-practices/skill.json +25 -0
  124. package/skills/csharp-best-practices/SKILL.md +274 -0
  125. package/skills/csharp-best-practices/skill.json +23 -0
  126. package/skills/git-workflow-skill/skill.json +1 -1
  127. package/skills/open-presentation/SKILL.md +31 -0
  128. package/skills/open-presentation/skill.json +11 -0
  129. package/skills/python-best-practices/SKILL.md +381 -0
  130. package/skills/python-best-practices/skill.json +26 -0
  131. package/skills/story-status-lookup/SKILL.md +74 -0
  132. package/skills/story-status-lookup/skill.json +8 -0
  133. package/test/agent-injection-strategy.test.js +13 -7
  134. package/test/bmad-extension.test.js +237 -0
  135. package/test/bmad-output-policy.test.js +119 -0
  136. package/test/build-bmad-args.test.js +361 -0
  137. package/test/create-agent.test.js +232 -0
  138. package/test/enforcement-hooks.test.js +324 -0
  139. package/test/generate-project-context.test.js +337 -0
  140. package/test/integration-verification.test.js +402 -0
  141. package/test/opencode-agent.test.js +150 -0
  142. package/test/opencode-json-error.test.js +260 -0
  143. package/test/opencode-json-injection.test.js +256 -0
  144. package/test/opencode-json-merge.test.js +299 -0
  145. package/test/skill-authoring.test.js +272 -0
  146. package/test/skill-customize-agent.test.js +253 -0
  147. package/test/skill-mandatory.test.js +235 -0
  148. package/test/skill-validation.test.js +378 -0
  149. package/test/yes-flag.test.js +1 -1
@@ -0,0 +1,415 @@
1
+ # Enforcement Hooks Research — Technical Note
2
+
3
+ **Story:** 8.5 — Per-Agent Enforcement Hooks Research
4
+ **Date:** 2026-03-17
5
+ **Status:** Complete
6
+
7
+ ## Executive Summary
8
+
9
+ This technical note documents research into per-agent enforcement hooks across all supported AI coding agents. The goal is to determine which agents support runtime enforcement beyond instruction injection (Stories 8.1–8.2) and BMAD critical_actions (Story 8.3).
10
+
11
+ **Key Finding:** Claude Code, Cursor, GitHub Copilot, and Gemini CLI all support hook-based enforcement. A Claude Code prototype hook has been implemented. Cline and Kilocode have partial support. Antigravity's enforcement model is currently unavailable for integration.
12
+
13
+ ## Agent Enforcement Summary
14
+
15
+ | Agent | Hook Support | Mechanism | Enforcement Level | Status |
16
+ |-------|-------------|-----------|-------------------|--------|
17
+ | **Claude Code** | Full | `.claude/settings.json` hooks — 21 event types | Runtime verify/block | **Prototype implemented** |
18
+ | **Cursor** | Full (beta) | `.cursor/hooks/` — pre/post agent execution | Runtime observe/block | Deferred (beta API) |
19
+ | **GitHub Copilot** | Full | `.github/hooks/hooks.json` — preToolUse, postToolUse | Runtime verify/block | Deferred (preview) |
20
+ | **Gemini CLI** | Full | `~/.gemini/hooks/` — BeforeTool, SessionStart | Runtime verify/block | Deferred (CLI-only) |
21
+ | **Cline** | Partial | `.clinerules/hooks/` directory — workspace monitoring | Limited automation | Deferred (limited docs) |
22
+ | **Kilocode** | Partial | Agent hooks via AGENTS.md — file-save triggers | Follow-up automation | Deferred (limited scope) |
23
+ | **Antigravity** | None documented | No public hook API; ToS restricts third-party agent integration | N/A | **Not available** |
24
+ | **BMAD Agents (11)** | N/A | `critical_actions` in `.customize.yaml` — instruction-level | Instruction enforcement | **Implemented (Story 8.3)** |
25
+
26
+ ## Detailed Agent Research
27
+
28
+ ### 1. Claude Code (Anthropic)
29
+
30
+ #### Hook System Overview
31
+
32
+ Claude Code provides the most comprehensive hook system of all researched agents, with **21 distinct hook events** configurable via JSON settings files.
33
+
34
+ **Configuration Locations:**
35
+
36
+ | Location | Scope | Shared |
37
+ |----------|-------|--------|
38
+ | `~/.claude/settings.json` | User (all projects) | No |
39
+ | `.claude/settings.json` | Project | Yes (committed to git) |
40
+ | `.claude/settings.local.json` | Project (local only) | No (gitignored) |
41
+
42
+ **Configuration Format:**
43
+ ```json
44
+ {
45
+ "hooks": {
46
+ "EventName": [
47
+ {
48
+ "matcher": "regex_pattern",
49
+ "hooks": [
50
+ {
51
+ "type": "command",
52
+ "command": "path/to/script.sh"
53
+ }
54
+ ]
55
+ }
56
+ ]
57
+ }
58
+ }
59
+ ```
60
+
61
+ #### Available Hook Events (relevant subset)
62
+
63
+ | Event | Fires When | Can Block | Matcher Field |
64
+ |-------|-----------|----------|---------------|
65
+ | `SessionStart` | Session begins/resumes/compacts | No | `startup`, `resume`, `compact` |
66
+ | `PreToolUse` | Before any tool executes | Yes | Tool name (regex) |
67
+ | `PostToolUse` | After tool succeeds | No | Tool name (regex) |
68
+ | `UserPromptSubmit` | User submits prompt | Yes | None |
69
+ | `Stop` | Claude finishes responding | Yes | None |
70
+
71
+ #### Hook Types
72
+
73
+ 1. **Command** (`type: "command"`) — Executes shell script, receives JSON on stdin, returns exit code + stdout
74
+ 2. **HTTP** (`type: "http"`) — POSTs event JSON to endpoint, receives JSON response
75
+ 3. **Prompt** (`type: "prompt"`) — Single-turn LLM call (Haiku) for judgment-based decisions
76
+ 4. **Agent** (`type: "agent"`) — Spawns subagent with tool access for multi-step verification
77
+
78
+ #### Hook Input/Output Protocol
79
+
80
+ **Input** (JSON on stdin):
81
+ ```json
82
+ {
83
+ "session_id": "abc123",
84
+ "transcript_path": "/path/to/transcript.jsonl",
85
+ "cwd": "/project/root",
86
+ "hook_event_name": "PreToolUse",
87
+ "tool_name": "Edit",
88
+ "tool_input": { "file_path": "..." }
89
+ }
90
+ ```
91
+
92
+ **Output** (exit codes):
93
+ - Exit 0: Allow action; stdout text injected into context (SessionStart only)
94
+ - Exit 2: Block action; stderr becomes Claude's feedback
95
+ - Other: Allow; stderr logged in verbose mode
96
+
97
+ **Structured output** (JSON on stdout):
98
+ ```json
99
+ {
100
+ "hookSpecificOutput": {
101
+ "hookEventName": "PreToolUse",
102
+ "permissionDecision": "deny",
103
+ "permissionDecisionReason": "MANIFEST.yaml has not been read yet"
104
+ }
105
+ }
106
+ ```
107
+
108
+ #### MANIFEST Verification Feasibility
109
+
110
+ **Can a hook verify MANIFEST.yaml was read?** Yes, via two approaches:
111
+
112
+ 1. **Transcript parsing:** Hook reads `transcript_path` (.jsonl), searches for `Read` tool call with `MANIFEST.yaml` in path. Feasible but has performance implications (parsing grows with transcript size).
113
+
114
+ 2. **Marker file approach:** A `PostToolUse` hook on `Read` writes a marker file when MANIFEST.yaml is detected. A `PreToolUse` hook on `Edit|Write|Bash` checks for the marker. More performant but requires filesystem coordination.
115
+
116
+ **Recommendation:** Use a `SessionStart` hook for context injection (lightweight, reliable) as the primary mechanism. Transcript-based verification is feasible for higher-security environments but adds latency per tool call.
117
+
118
+ #### Limitations
119
+
120
+ - Hooks run per-tool-call (performance consideration for `PreToolUse`)
121
+ - Cannot directly access conversation memory/state (must parse transcript)
122
+ - `PostToolUse` hooks cannot undo actions (tool already executed)
123
+ - Windows requires Git Bash/WSL or PowerShell for shell scripts
124
+ - Default timeout: 10 minutes per hook (configurable)
125
+
126
+ #### Prototype Implementation
127
+
128
+ A prototype hook has been implemented at `lib/hooks/claude-code/verify-manifest.js`. See [Prototype Implementation](#prototype-implementation) section below.
129
+
130
+ ---
131
+
132
+ ### 2. Cursor (Anysphere)
133
+
134
+ #### Hook System
135
+
136
+ Cursor introduced hooks in v1.7 (late 2025) as a **beta feature** for organizations to observe, control, and extend the agent loop.
137
+
138
+ **Configuration:** Scripts in `.cursor/hooks/` directory.
139
+
140
+ **Capabilities:**
141
+ - Run custom logic before/after agent execution stages
142
+ - Inspect context and return allow/warn/deny decisions
143
+ - Enforce guardrails before MCP tool execution
144
+ - Connect to security tooling, observability platforms, compliance systems
145
+
146
+ **Enforcement Model:**
147
+ - Pre-execution hooks can inspect and block agent actions
148
+ - Policy-based: hooks return allow/warn/deny based on custom logic
149
+ - Integrates with organization security infrastructure
150
+
151
+ **Current Status:** Beta feature. Documentation is limited but improving. Community patterns are emerging.
152
+
153
+ **Recommendation:** Defer implementation until hooks exit beta. The instruction injection mechanism (Story 8.2, `.cursor/cursor.md`) provides adequate enforcement for now.
154
+
155
+ ---
156
+
157
+ ### 3. GitHub Copilot (GitHub/Microsoft)
158
+
159
+ #### Hook System
160
+
161
+ GitHub Copilot's coding agent supports hooks via `.github/hooks/hooks.json`, announced in public preview (March 2026).
162
+
163
+ **Configuration:**
164
+ ```json
165
+ // .github/hooks/hooks.json
166
+ {
167
+ "hooks": [
168
+ {
169
+ "event": "preToolUse",
170
+ "tool": "shell",
171
+ "command": "check-manifest.sh"
172
+ }
173
+ ]
174
+ }
175
+ ```
176
+
177
+ **Available Events:**
178
+ - `sessionStart` — Initialize environments, logging
179
+ - `sessionEnd` — Cleanup, notifications
180
+ - `userPromptSubmitted` — Audit user prompts
181
+ - `preToolUse` — Approve or deny tool executions (most powerful)
182
+ - `postToolUse` — Post-execution checks
183
+ - `errorOccurred` — Error handling
184
+
185
+ **Advanced Extension System:**
186
+ Beyond hooks, Copilot CLI supports `.github/extensions/` with full Node.js processes communicating over JSON-RPC for lifecycle-level control.
187
+
188
+ **Enforcement Distinction:** The key insight from GitHub's documentation is that hooks shift from "instruction" (please don't) to "enforcement" (deny in preToolUse) — fundamentally different in certainty.
189
+
190
+ **Recommendation:** Implement when hooks exit public preview. The `.github/copilot/copilot.md` instruction injection (Story 8.2) is the current enforcement layer.
191
+
192
+ ---
193
+
194
+ ### 4. Gemini CLI (Google)
195
+
196
+ #### Hook System
197
+
198
+ Gemini CLI introduced hooks in v0.26.0+ (January 2026), documented as "middleware for your AI assistant."
199
+
200
+ **Configuration:** `~/.gemini/hooks/` directory with script files.
201
+
202
+ **Available Events:**
203
+ - `SessionStart` / `SessionEnd`
204
+ - `BeforeModel` / `AfterModel`
205
+ - `BeforeTool` / `BeforeToolSelection`
206
+ - `PreCompress`
207
+ - `Notification`
208
+
209
+ **Enforcement Capabilities:**
210
+ - `BeforeTool` hooks can prevent actions (e.g., blocking sensitive data writes)
211
+ - Hooks run synchronously — Gemini CLI waits for completion before proceeding
212
+ - Policy enforcement for security and compliance requirements
213
+ - Enabled by default in v0.26.0+
214
+
215
+ **Important Note:** This applies to **Gemini CLI** specifically. The VS Code Gemini Code Assist extension may have different capabilities. The `gemini` agent in our registry targets the `.gemini/gemini.md` instruction file, which aligns with the IDE extension, not CLI.
216
+
217
+ **Recommendation:** Defer until the `gemini` agent registration clarifies CLI vs IDE targeting. Current instruction injection via `.gemini/gemini.md` (Story 8.2) covers the IDE use case.
218
+
219
+ ---
220
+
221
+ ### 5. Cline (Saoud Rizwan)
222
+
223
+ #### Enforcement Model
224
+
225
+ Cline's enforcement relies primarily on **instruction files** with a limited hooks mechanism.
226
+
227
+ **Instruction Enforcement:**
228
+ - `.clinerules` file in project root — global rules
229
+ - `.clinerules/` directory with path-based conditional rules
230
+ - Rules use glob patterns to activate based on file context
231
+ - Rules are injected into the system prompt automatically
232
+
233
+ **Hooks System:**
234
+ - `.clinerules/hooks/` directory — workspace monitoring hooks
235
+ - Hook discovery cache for performance optimization
236
+ - Limited documentation on hook capabilities
237
+ - Primarily used for workspace event reactions, not tool-call enforcement
238
+
239
+ **MCP Integration:**
240
+ - Cline supports MCP servers for external tool integration
241
+ - Custom MCP tools can enforce behaviors indirectly
242
+
243
+ **Recommendation:** No hook-based enforcement feasible at this time. The `.clinerules` and `.cline/clinerules.md` instruction injection (Story 8.2) is the primary enforcement mechanism. Monitor for improved hook documentation.
244
+
245
+ ---
246
+
247
+ ### 6. Kilocode (Kilo AI)
248
+
249
+ #### Enforcement Model
250
+
251
+ Kilocode uses a declarative configuration system rather than hooks.
252
+
253
+ **Instruction Enforcement:**
254
+ - `AGENTS.md` files in workspace — project-specific agent instructions
255
+ - Rules integrate with the Mode system
256
+ - Automatically incorporated into system prompts
257
+ - Organization-level model restrictions enforced
258
+
259
+ **Agent Hooks:**
260
+ - Follow-up action automation (e.g., run tests on file save)
261
+ - Limited to workspace events, not tool-call interception
262
+ - No pre-execution blocking capability documented
263
+
264
+ **Recommendation:** No hook-based enforcement available. The `.kilocode/kilocode.md` instruction injection (Story 8.2) is the only enforcement layer. Kilocode's AGENTS.md is complementary but not hook-based.
265
+
266
+ ---
267
+
268
+ ### 7. Antigravity (Google DeepMind)
269
+
270
+ #### Current Status: NOT AVAILABLE FOR INTEGRATION
271
+
272
+ **Critical Issue:** In February 2026, Google imposed an "Antigravity Restriction" affecting third-party agent integrations. Key facts:
273
+
274
+ - Google's ToS now explicitly lists **Claude Code** and **OpenCode** as disallowed when paired with Antigravity subscription OAuth
275
+ - Users routing tokens through third-party platforms were suspended
276
+ - Appeal process requires unlinking third-party agents
277
+ - The restriction was triggered by 10x usage spikes from unauthorized integration patterns
278
+
279
+ **Hook/Enforcement System:**
280
+ - No public hook API documented
281
+ - Agent-first IDE with opinionated workflows
282
+ - No documented extension mechanism for custom enforcement
283
+
284
+ **Recommendation:** **Do not implement** any enforcement hooks for Antigravity. The `.antigravity/antigravity.md` instruction injection (Story 8.2) remains as a passive layer, but active hook enforcement is not possible and may violate Google's ToS.
285
+
286
+ ---
287
+
288
+ ### 8. BMAD Agents (11 agents)
289
+
290
+ #### Enforcement: Already Implemented (Story 8.3)
291
+
292
+ All 11 BMAD agents have enforcement via `critical_actions` in `.customize.yaml` files deployed through the BMAD extension module.
293
+
294
+ **Mechanism:**
295
+ ```yaml
296
+ critical_actions:
297
+ 1: "Read the skills MANIFEST at {project-root}/_bmad/skills/MANIFEST.yaml"
298
+ 2: "For each skill marked always_load: true, read the skill file completely"
299
+ 3: "Follow all skill directives during this session"
300
+ ```
301
+
302
+ **Deployment:** Extension module at `_bmad/extensions/ma-agents-skills/` deployed during BMAD customization pipeline (Stage 3 in `bmad.js`).
303
+
304
+ **Coverage:**
305
+ - 4 custom agents (SRE, DevOps, Cyber, MIL-498): Full persona + menu + critical_actions
306
+ - 7 built-in agents (PM, Architect, Dev, QA, SM, Tech Writer, UX Designer): critical_actions only
307
+
308
+ ---
309
+
310
+ ## Prototype Implementation
311
+
312
+ ### Claude Code SessionStart Hook
313
+
314
+ **File:** `lib/hooks/claude-code/verify-manifest.js`
315
+
316
+ **Purpose:** Injects a context reminder at session start to reinforce MANIFEST.yaml skill loading. This is the most reliable enforcement approach — it works at session initialization with zero per-tool-call overhead.
317
+
318
+ **How it works:**
319
+ 1. Runs on `SessionStart` event
320
+ 2. Detects the project's skills MANIFEST.yaml path via `$CLAUDE_PROJECT_DIR`
321
+ 3. If MANIFEST exists, outputs a context reminder that gets injected into Claude's session
322
+ 4. If MANIFEST doesn't exist, exits silently (no-op for non-skill projects)
323
+
324
+ **Configuration for `.claude/settings.json`:**
325
+ ```json
326
+ {
327
+ "hooks": {
328
+ "SessionStart": [
329
+ {
330
+ "matcher": "startup",
331
+ "hooks": [
332
+ {
333
+ "type": "command",
334
+ "command": "node \"$CLAUDE_PROJECT_DIR/lib/hooks/claude-code/verify-manifest.js\""
335
+ }
336
+ ]
337
+ }
338
+ ]
339
+ }
340
+ }
341
+ ```
342
+
343
+ **Deployment Decision:** Project-level (`.claude/settings.json`) is recommended over user-level, because:
344
+ - Skills are project-specific
345
+ - Hook references project files
346
+ - Avoids polluting global settings
347
+ - Installer already manages `.claude/CLAUDE.md`
348
+
349
+ ### Why NOT a PreToolUse Verification Hook
350
+
351
+ A `PreToolUse` hook that parses the transcript to verify MANIFEST.yaml was read is **technically feasible** but **not recommended** as a default due to:
352
+
353
+ 1. **Performance:** Transcript parsing on every `Edit`/`Write`/`Bash` call adds latency that grows with conversation length
354
+ 2. **Complexity:** JSONL parsing in cross-platform scripts is fragile
355
+ 3. **User experience:** Blocking tool calls with "read MANIFEST first" errors disrupts workflow
356
+ 4. **Diminishing returns:** The SessionStart injection + instruction injection (Story 8.1) already provide two enforcement layers
357
+
358
+ **If higher-security enforcement is needed** in the future, the PreToolUse approach can be implemented using the marker file pattern:
359
+ 1. `PostToolUse` hook on `Read` — writes a `.manifest-verified` marker when MANIFEST.yaml is read
360
+ 2. `PreToolUse` hook on `Edit|Write` — checks for marker, denies if absent
361
+ 3. `SessionStart` hook — cleans up stale markers
362
+
363
+ ---
364
+
365
+ ## Multi-Layer Enforcement Architecture
366
+
367
+ The current and proposed enforcement layers form a defense-in-depth approach:
368
+
369
+ ```
370
+ Layer 1: Instruction Injection (Stories 8.1-8.2)
371
+ ├── MA-AGENTS block at TOP of agent instruction files
372
+ ├── All 7 IDE agents covered
373
+ └── Tells agent to read MANIFEST.yaml and load skills
374
+
375
+ Layer 2: BMAD Critical Actions (Story 8.3)
376
+ ├── critical_actions in .customize.yaml extension module
377
+ ├── All 11 BMAD agents covered
378
+ └── Mandatory steps injected into agent activation
379
+
380
+ Layer 3: Runtime Hooks (This Story — 8.5)
381
+ ├── Claude Code: SessionStart context injection (IMPLEMENTED)
382
+ ├── Cursor: Deferred (beta API)
383
+ ├── GitHub Copilot: Deferred (public preview)
384
+ ├── Gemini CLI: Deferred (CLI vs IDE clarification needed)
385
+ ├── Cline: Not feasible (limited hooks)
386
+ ├── Kilocode: Not feasible (no tool-call hooks)
387
+ └── Antigravity: Not available (ToS restriction)
388
+ ```
389
+
390
+ ---
391
+
392
+ ## Recommendations
393
+
394
+ ### Immediate (This Sprint)
395
+
396
+ 1. **Deploy Claude Code SessionStart hook** via installer when skills are installed for Claude Code
397
+ 2. **Document hook removal** when all skills are uninstalled
398
+
399
+ ### Near-Term (Next Sprint)
400
+
401
+ 3. **Monitor Cursor hooks** for GA release — implement when stable
402
+ 4. **Monitor GitHub Copilot hooks** for GA release — implement when stable
403
+ 5. **Clarify Gemini agent** CLI vs IDE targeting before implementing hooks
404
+
405
+ ### Future Considerations
406
+
407
+ 6. **PreToolUse enforcement hook** for high-security environments (marker file pattern)
408
+ 7. **HTTP hook endpoint** for centralized enforcement logging/auditing
409
+ 8. **Agent hook** (LLM-based) for intelligent compliance verification
410
+
411
+ ### Not Recommended
412
+
413
+ - Antigravity hook integration (ToS prohibits third-party agent coupling)
414
+ - Cline hook enforcement (insufficient API surface)
415
+ - Kilocode hook enforcement (no tool-call interception)
package/lib/agents.js CHANGED
@@ -21,6 +21,7 @@ const agents = [
21
21
  version: '1.0.0',
22
22
  category: 'ide',
23
23
  description: 'Anthropic Claude Code CLI',
24
+ skillsDir: '.claude/skills',
24
25
  getProjectPath: () => path.join(process.cwd(), '.claude', 'skills'),
25
26
  getGlobalPath: () => {
26
27
  const platform = os.platform();
@@ -43,6 +44,7 @@ const agents = [
43
44
  version: '1.0.0',
44
45
  category: 'ide',
45
46
  description: 'Google Gemini Code Assist',
47
+ skillsDir: '.gemini/skills',
46
48
  getProjectPath: () => path.join(process.cwd(), '.gemini', 'skills'),
47
49
  getGlobalPath: () => {
48
50
  const platform = os.platform();
@@ -65,6 +67,7 @@ const agents = [
65
67
  version: '1.0.0',
66
68
  category: 'ide',
67
69
  description: 'GitHub Copilot Agent Mode',
70
+ skillsDir: '.github/copilot/skills',
68
71
  getProjectPath: () => path.join(process.cwd(), '.github', 'copilot', 'skills'),
69
72
  getGlobalPath: () => {
70
73
  const platform = os.platform();
@@ -87,6 +90,7 @@ const agents = [
87
90
  version: '1.0.0',
88
91
  category: 'ide',
89
92
  description: 'Kilocode AI Assistant',
93
+ skillsDir: '.kilocode/skills',
90
94
  getProjectPath: () => path.join(process.cwd(), '.kilocode', 'skills'),
91
95
  getGlobalPath: () => {
92
96
  const platform = os.platform();
@@ -109,6 +113,7 @@ const agents = [
109
113
  version: '1.0.0',
110
114
  category: 'ide',
111
115
  description: 'Cline AI Assistant',
116
+ skillsDir: '.cline/skills',
112
117
  getProjectPath: () => path.join(process.cwd(), '.cline', 'skills'),
113
118
  getGlobalPath: () => {
114
119
  const platform = os.platform();
@@ -136,6 +141,7 @@ const agents = [
136
141
  version: '1.0.0',
137
142
  category: 'ide',
138
143
  description: 'Cursor AI Editor',
144
+ skillsDir: '.cursor/skills',
139
145
  getProjectPath: () => path.join(process.cwd(), '.cursor', 'skills'),
140
146
  getGlobalPath: () => {
141
147
  const platform = os.platform();
@@ -158,6 +164,7 @@ const agents = [
158
164
  version: '1.0.0',
159
165
  category: 'bmad',
160
166
  description: 'Specialized SRE Agent for BMAD-METHOD',
167
+ skillsDir: '_bmad/skills/sre',
161
168
  getProjectPath: () => path.join(process.cwd(), '_bmad', 'skills', 'sre'),
162
169
  getGlobalPath: () => {
163
170
  const platform = os.platform();
@@ -180,6 +187,7 @@ const agents = [
180
187
  version: '1.0.0',
181
188
  category: 'ide',
182
189
  description: 'Google Deepmind Antigravity Agent',
190
+ skillsDir: '.antigravity/skills',
183
191
  getProjectPath: () => path.join(process.cwd(), '.antigravity', 'skills'),
184
192
  getGlobalPath: () => {
185
193
  const platform = os.platform();
@@ -196,12 +204,36 @@ const agents = [
196
204
  instructionFiles: ['.antigravity/antigravity.md'],
197
205
  injectionStrategy: { position: 'top', skipPatterns: ['---'] }
198
206
  },
207
+ {
208
+ id: 'opencode',
209
+ name: 'OpenCode',
210
+ version: '1.0.0',
211
+ category: 'ide',
212
+ description: 'OpenCode AI Assistant',
213
+ skillsDir: '.opencode/skills',
214
+ getProjectPath: () => path.join(process.cwd(), '.opencode', 'skills'),
215
+ getGlobalPath: () => {
216
+ const platform = os.platform();
217
+ if (platform === 'win32') {
218
+ return path.join(os.homedir(), 'AppData', 'Roaming', 'opencode', 'skills');
219
+ } else if (platform === 'darwin') {
220
+ return path.join(os.homedir(), 'Library', 'Application Support', 'opencode', 'skills');
221
+ } else {
222
+ return path.join(os.homedir(), '.config', 'opencode', 'skills');
223
+ }
224
+ },
225
+ fileExtension: '.md',
226
+ template: 'generic',
227
+ instructionFiles: ['opencode.json'],
228
+ injectionStrategy: { position: 'json-merge', targetKey: 'instructions' }
229
+ },
199
230
  {
200
231
  id: 'bmm-devops',
201
232
  name: 'DevOps Agent',
202
233
  version: '1.0.0',
203
234
  category: 'bmad',
204
235
  description: 'Specialized DevOps Agent for BMAD-METHOD',
236
+ skillsDir: '_bmad/skills/devops',
205
237
  getProjectPath: () => path.join(process.cwd(), '_bmad', 'skills', 'devops'),
206
238
  getGlobalPath: () => {
207
239
  const platform = os.platform();
@@ -224,6 +256,7 @@ const agents = [
224
256
  version: '1.0.0',
225
257
  category: 'bmad',
226
258
  description: 'Specialized Cyber Security Analyst (Yael) for BMAD-METHOD',
259
+ skillsDir: '_bmad/skills/cyber',
227
260
  getProjectPath: () => path.join(process.cwd(), '_bmad', 'skills', 'cyber'),
228
261
  getGlobalPath: () => {
229
262
  const platform = os.platform();
@@ -246,6 +279,7 @@ const agents = [
246
279
  version: '2.0.0',
247
280
  category: 'bmad',
248
281
  description: 'MIL-STD-498 Documentation Expert',
282
+ skillsDir: '_bmad/skills/mil498',
249
283
  getProjectPath: () => path.join(process.cwd(), '_bmad', 'skills', 'mil498'),
250
284
  getGlobalPath: () => {
251
285
  const platform = os.platform();
@@ -0,0 +1,5 @@
1
+ critical_actions:
2
+ 1: "Read the skills MANIFEST at {project-root}/_bmad/skills/MANIFEST.yaml"
3
+ 2: "For each skill marked always_load: true, read the skill file completely"
4
+ 3: "If _bmad-output/project-context.md exists, read it completely"
5
+ 4: "Follow all skill directives and project-context rules during this session"
@@ -0,0 +1,5 @@
1
+ critical_actions:
2
+ 1: "Read the skills MANIFEST at {project-root}/_bmad/skills/MANIFEST.yaml"
3
+ 2: "For each skill marked always_load: true, read the skill file completely"
4
+ 3: "If _bmad-output/project-context.md exists, read it completely"
5
+ 4: "Follow all skill directives and project-context rules during this session"
@@ -0,0 +1,30 @@
1
+ # cyber.customize.yaml
2
+ agent:
3
+ metadata:
4
+ name: "Yael"
5
+
6
+ persona:
7
+ role: "Cyber Security Analyst"
8
+ identity: "Expert in vulnerability assessment, threat modeling, and system hardening with deep knowledge of security standards (OWASP, CIS)."
9
+ communication_style: "Analytical, precise, and risk-focused. Uses professional security terminology."
10
+ principles:
11
+ - "Security is a process, not a product."
12
+ - "Favor Defense in Depth."
13
+ - "Prioritize mitigations based on risk."
14
+
15
+ menu:
16
+ - trigger: bmad-cyber-vulnerability-scan
17
+ workflow: "bmm/workflows/cyber/vulnerability-scan.md"
18
+ description: "Run Vulnerability Scan"
19
+ - trigger: bmad-cyber-security-audit
20
+ workflow: "bmm/workflows/cyber/security-audit.md"
21
+ description: "Perform Deep Security Audit"
22
+ - trigger: bmad-cyber-threat-modeling
23
+ workflow: "bmm/workflows/cyber/threat-modeling.md"
24
+ description: "Identify Attack Vectors"
25
+
26
+ critical_actions:
27
+ 1: "Read the skills MANIFEST at {project-root}/_bmad/skills/cyber/MANIFEST.yaml"
28
+ 2: "For each skill marked always_load: true, read the skill file completely"
29
+ 3: "If _bmad-output/project-context.md exists, read it completely"
30
+ 4: "Follow all skill directives and project-context rules during this session"
@@ -0,0 +1,5 @@
1
+ critical_actions:
2
+ 1: "Read the skills MANIFEST at {project-root}/_bmad/skills/MANIFEST.yaml"
3
+ 2: "For each skill marked always_load: true, read the skill file completely"
4
+ 3: "If _bmad-output/project-context.md exists, read it completely"
5
+ 4: "Follow all skill directives and project-context rules during this session"
@@ -0,0 +1,30 @@
1
+ # devops.customize.yaml
2
+ agent:
3
+ metadata:
4
+ name: "Amit"
5
+
6
+ persona:
7
+ role: "DevOps Engineer"
8
+ identity: "Expert in CI/CD pipeline automation, Infrastructure as Code, and cloud-native technologies (Kubernetes, AWS/GCP)."
9
+ communication_style: "Collaborative, efficiency-minded, and tech-forward. Focuses on streamlining the delivery process."
10
+ principles:
11
+ - "Version control everything."
12
+ - "Immutable infrastructure is better."
13
+ - "Continuous improvement of the feedback loop."
14
+
15
+ menu:
16
+ - trigger: bmad-devops-configure-infrastructure
17
+ workflow: "bmm/workflows/devops/configure-infrastructure.md"
18
+ description: "Configure Infrastructure Components"
19
+ - trigger: bmad-devops-optimize-pipelines
20
+ workflow: "bmm/workflows/devops/optimize-pipelines.md"
21
+ description: "Review & Optimize CI/CD Pipelines"
22
+ - trigger: bmad-devops-manage-helm
23
+ workflow: "bmm/workflows/devops/manage-helm.md"
24
+ description: "Deploy & Manage Helm Charts"
25
+
26
+ critical_actions:
27
+ 1: "Read the skills MANIFEST at {project-root}/_bmad/skills/devops/MANIFEST.yaml"
28
+ 2: "For each skill marked always_load: true, read the skill file completely"
29
+ 3: "If _bmad-output/project-context.md exists, read it completely"
30
+ 4: "Follow all skill directives and project-context rules during this session"
@@ -0,0 +1,42 @@
1
+ # mil498.customize.yaml
2
+ agent:
3
+ metadata:
4
+ name: "Joseph"
5
+
6
+ persona:
7
+ role: "MIL-STD-498 Documentation Expert"
8
+ identity: "Seasoned Systems Engineer with expertise in defense industry standards and Data Item Descriptions (DIDs)."
9
+ communication_style: "Formal, precise, and authoritative. Values strict adherence to technical standards."
10
+ principles:
11
+ - "Documentation is the foundation of quality."
12
+ - "Traceability is mandatory."
13
+ - "Adherence to standards ensures mission success."
14
+
15
+ menu:
16
+ - trigger: bmad-mil-generate-srs
17
+ workflow: "bmm/workflows/mil498/srs/workflow.yaml"
18
+ description: "Generate SRS (Software Requirements Specification)"
19
+ - trigger: bmad-mil-generate-sdd
20
+ workflow: "bmm/workflows/mil498/sdd/workflow.yaml"
21
+ description: "Generate SDD (Software Design Description)"
22
+ - trigger: bmad-mil-generate-sdp
23
+ workflow: "bmm/workflows/mil498/sdp/workflow.yaml"
24
+ description: "Generate SDP (Software Development Plan)"
25
+ - trigger: bmad-mil-generate-ocd
26
+ workflow: "bmm/workflows/mil498/ocd/workflow.yaml"
27
+ description: "Generate OCD (Operational Concept Description)"
28
+ - trigger: bmad-mil-generate-sss
29
+ workflow: "bmm/workflows/mil498/sss/workflow.yaml"
30
+ description: "Generate SSS (System/Subsystem Specification)"
31
+ - trigger: bmad-mil-generate-std
32
+ workflow: "bmm/workflows/mil498/std/workflow.yaml"
33
+ description: "Generate STD (Software Test Description)"
34
+ - trigger: bmad-mil-generate-ssdd
35
+ workflow: "bmm/workflows/mil498/ssdd/workflow.yaml"
36
+ description: "Generate SSDD (System/Subsystem Design Description)"
37
+
38
+ critical_actions:
39
+ 1: "Read the skills MANIFEST at {project-root}/_bmad/skills/mil498/MANIFEST.yaml"
40
+ 2: "For each skill marked always_load: true, read the skill file completely"
41
+ 3: "If _bmad-output/project-context.md exists, read it completely"
42
+ 4: "Follow all skill directives and project-context rules during this session"
@@ -0,0 +1,5 @@
1
+ critical_actions:
2
+ 1: "Read the skills MANIFEST at {project-root}/_bmad/skills/MANIFEST.yaml"
3
+ 2: "For each skill marked always_load: true, read the skill file completely"
4
+ 3: "If _bmad-output/project-context.md exists, read it completely"
5
+ 4: "Follow all skill directives and project-context rules during this session"
@@ -0,0 +1,5 @@
1
+ critical_actions:
2
+ 1: "Read the skills MANIFEST at {project-root}/_bmad/skills/MANIFEST.yaml"
3
+ 2: "For each skill marked always_load: true, read the skill file completely"
4
+ 3: "If _bmad-output/project-context.md exists, read it completely"
5
+ 4: "Follow all skill directives and project-context rules during this session"
@@ -0,0 +1,5 @@
1
+ critical_actions:
2
+ 1: "Read the skills MANIFEST at {project-root}/_bmad/skills/MANIFEST.yaml"
3
+ 2: "For each skill marked always_load: true, read the skill file completely"
4
+ 3: "If _bmad-output/project-context.md exists, read it completely"
5
+ 4: "Follow all skill directives and project-context rules during this session"