@vetala/vetala 0.1.0-beta

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.

Potentially problematic release.


This version of @vetala/vetala might be problematic. Click here for more details.

Files changed (271) hide show
  1. package/CONTRIBUTING.md +77 -0
  2. package/LICENSE +184 -0
  3. package/README.md +136 -0
  4. package/THIRD_PARTY_LICENSES.md +17 -0
  5. package/dist/src/agent.d.ts +30 -0
  6. package/dist/src/agent.js +216 -0
  7. package/dist/src/agent.js.map +1 -0
  8. package/dist/src/approvals.d.ts +18 -0
  9. package/dist/src/approvals.js +81 -0
  10. package/dist/src/approvals.js.map +1 -0
  11. package/dist/src/cli.d.ts +2 -0
  12. package/dist/src/cli.js +87 -0
  13. package/dist/src/cli.js.map +1 -0
  14. package/dist/src/config.d.ts +12 -0
  15. package/dist/src/config.js +183 -0
  16. package/dist/src/config.js.map +1 -0
  17. package/dist/src/context-memory.d.ts +7 -0
  18. package/dist/src/context-memory.js +96 -0
  19. package/dist/src/context-memory.js.map +1 -0
  20. package/dist/src/ink/command-suggestions.d.ts +7 -0
  21. package/dist/src/ink/command-suggestions.js +179 -0
  22. package/dist/src/ink/command-suggestions.js.map +1 -0
  23. package/dist/src/ink/ink-terminal-ui.d.ts +36 -0
  24. package/dist/src/ink/ink-terminal-ui.js +79 -0
  25. package/dist/src/ink/ink-terminal-ui.js.map +1 -0
  26. package/dist/src/ink/repl-app.d.ts +9 -0
  27. package/dist/src/ink/repl-app.js +789 -0
  28. package/dist/src/ink/repl-app.js.map +1 -0
  29. package/dist/src/ink/transcript-cards.d.ts +6 -0
  30. package/dist/src/ink/transcript-cards.js +24 -0
  31. package/dist/src/ink/transcript-cards.js.map +1 -0
  32. package/dist/src/path-policy.d.ts +11 -0
  33. package/dist/src/path-policy.js +67 -0
  34. package/dist/src/path-policy.js.map +1 -0
  35. package/dist/src/process-utils.d.ts +13 -0
  36. package/dist/src/process-utils.js +52 -0
  37. package/dist/src/process-utils.js.map +1 -0
  38. package/dist/src/repl.d.ts +9 -0
  39. package/dist/src/repl.js +13 -0
  40. package/dist/src/repl.js.map +1 -0
  41. package/dist/src/sarvam/client.d.ts +15 -0
  42. package/dist/src/sarvam/client.js +208 -0
  43. package/dist/src/sarvam/client.js.map +1 -0
  44. package/dist/src/sarvam/models.d.ts +2 -0
  45. package/dist/src/sarvam/models.js +7 -0
  46. package/dist/src/sarvam/models.js.map +1 -0
  47. package/dist/src/search-provider.d.ts +6 -0
  48. package/dist/src/search-provider.js +8 -0
  49. package/dist/src/search-provider.js.map +1 -0
  50. package/dist/src/session-store.d.ts +19 -0
  51. package/dist/src/session-store.js +318 -0
  52. package/dist/src/session-store.js.map +1 -0
  53. package/dist/src/skills/runtime.d.ts +26 -0
  54. package/dist/src/skills/runtime.js +317 -0
  55. package/dist/src/skills/runtime.js.map +1 -0
  56. package/dist/src/skills/types.d.ts +25 -0
  57. package/dist/src/skills/types.js +2 -0
  58. package/dist/src/skills/types.js.map +1 -0
  59. package/dist/src/terminal-ui.d.ts +29 -0
  60. package/dist/src/terminal-ui.js +236 -0
  61. package/dist/src/terminal-ui.js.map +1 -0
  62. package/dist/src/tools/filesystem.d.ts +2 -0
  63. package/dist/src/tools/filesystem.js +622 -0
  64. package/dist/src/tools/filesystem.js.map +1 -0
  65. package/dist/src/tools/git.d.ts +2 -0
  66. package/dist/src/tools/git.js +326 -0
  67. package/dist/src/tools/git.js.map +1 -0
  68. package/dist/src/tools/index.d.ts +6 -0
  69. package/dist/src/tools/index.js +21 -0
  70. package/dist/src/tools/index.js.map +1 -0
  71. package/dist/src/tools/registry.d.ts +15 -0
  72. package/dist/src/tools/registry.js +59 -0
  73. package/dist/src/tools/registry.js.map +1 -0
  74. package/dist/src/tools/shell.d.ts +2 -0
  75. package/dist/src/tools/shell.js +97 -0
  76. package/dist/src/tools/shell.js.map +1 -0
  77. package/dist/src/tools/skill.d.ts +3 -0
  78. package/dist/src/tools/skill.js +130 -0
  79. package/dist/src/tools/skill.js.map +1 -0
  80. package/dist/src/tools/web.d.ts +3 -0
  81. package/dist/src/tools/web.js +144 -0
  82. package/dist/src/tools/web.js.map +1 -0
  83. package/dist/src/types.d.ts +236 -0
  84. package/dist/src/types.js +2 -0
  85. package/dist/src/types.js.map +1 -0
  86. package/dist/src/workspace-trust.d.ts +3 -0
  87. package/dist/src/workspace-trust.js +31 -0
  88. package/dist/src/workspace-trust.js.map +1 -0
  89. package/dist/src/xdg.d.ts +9 -0
  90. package/dist/src/xdg.js +77 -0
  91. package/dist/src/xdg.js.map +1 -0
  92. package/package.json +57 -0
  93. package/skill/agents-md-generator/SKILL.md +75 -0
  94. package/skill/agents-md-generator/references/agents_md_template.md +160 -0
  95. package/skill/agents-md-generator/references/loc_measurement.md +67 -0
  96. package/skill/agents-md-generator/references/monorepo_detection.md +78 -0
  97. package/skill/agents-md-generator/references/monorepo_strategy.md +60 -0
  98. package/skill/agents-md-generator/references/read_only_commands.md +151 -0
  99. package/skill/agents-md-generator/references/update_strategy.md +160 -0
  100. package/skill/agents-md-generator/references/working_agreements.md +53 -0
  101. package/skill/biz-opportunity-scout/SKILL.md +53 -0
  102. package/skill/biz-opportunity-scout/references/competitive_analysis.md +84 -0
  103. package/skill/biz-opportunity-scout/references/market_sizing.md +68 -0
  104. package/skill/biz-opportunity-scout/references/pmf_indicators.md +94 -0
  105. package/skill/biz-opportunity-scout/references/report_template.md +243 -0
  106. package/skill/biz-opportunity-scout/references/unit_economics.md +97 -0
  107. package/skill/code-review/SKILL.md +86 -0
  108. package/skill/code-review/references/change_analysis.md +116 -0
  109. package/skill/code-review/references/git_operations.md +115 -0
  110. package/skill/code-review/references/impact_detection.md +149 -0
  111. package/skill/code-review/references/output_format.md +137 -0
  112. package/skill/code-review/references/severity_criteria.md +100 -0
  113. package/skill/code-security-audit/SKILL.md +123 -0
  114. package/skill/code-security-audit/references/audit_process.md +277 -0
  115. package/skill/code-security-audit/references/remediation_patterns.md +599 -0
  116. package/skill/code-security-audit/references/report_format.md +391 -0
  117. package/skill/code-security-audit/references/security_domains.md +830 -0
  118. package/skill/code-security-audit/references/vulnerability_patterns.md +813 -0
  119. package/skill/composition-patterns/SKILL.md +83 -0
  120. package/skill/composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
  121. package/skill/composition-patterns/rules/architecture-compound-components.md +112 -0
  122. package/skill/composition-patterns/rules/patterns-children-over-render-props.md +87 -0
  123. package/skill/composition-patterns/rules/patterns-explicit-variants.md +100 -0
  124. package/skill/composition-patterns/rules/react19-no-forwardref.md +42 -0
  125. package/skill/composition-patterns/rules/state-context-interface.md +191 -0
  126. package/skill/composition-patterns/rules/state-decouple-implementation.md +113 -0
  127. package/skill/composition-patterns/rules/state-lift-state.md +125 -0
  128. package/skill/deploy-to-vercel/SKILL.md +293 -0
  129. package/skill/deploy-to-vercel/resources/deploy-sandbox.sh +301 -0
  130. package/skill/deploy-to-vercel/resources/deploy.sh +301 -0
  131. package/skill/doc/SKILL_GUIDELINES.md +138 -0
  132. package/skill/git-workflow/SKILL.md +94 -0
  133. package/skill/git-workflow/references/advanced-git.md +632 -0
  134. package/skill/git-workflow/references/branching-strategies.md +344 -0
  135. package/skill/git-workflow/references/ci-cd-integration.md +683 -0
  136. package/skill/git-workflow/references/code-quality-tools.md +351 -0
  137. package/skill/git-workflow/references/commit-conventions.md +439 -0
  138. package/skill/git-workflow/references/github-releases.md +288 -0
  139. package/skill/git-workflow/references/pull-request-workflow.md +773 -0
  140. package/skill/git-workflow/scripts/verify-git-workflow.sh +263 -0
  141. package/skill/jetbrains-vmoptions/SKILL.md +51 -0
  142. package/skill/jetbrains-vmoptions/references/common-options.md +357 -0
  143. package/skill/jetbrains-vmoptions/references/gc-options.md +350 -0
  144. package/skill/jetbrains-vmoptions/references/memory-options.md +339 -0
  145. package/skill/jetbrains-vmoptions/references/prerequisite-check.md +65 -0
  146. package/skill/kysely-converter/SKILL.md +62 -0
  147. package/skill/kysely-converter/references/delete.md +323 -0
  148. package/skill/kysely-converter/references/insert.md +386 -0
  149. package/skill/kysely-converter/references/operators.md +331 -0
  150. package/skill/kysely-converter/references/select.md +1000 -0
  151. package/skill/kysely-converter/references/update.md +349 -0
  152. package/skill/kysely-converter/references/window_function.md +537 -0
  153. package/skill/react-best-practices/SKILL.md +131 -0
  154. package/skill/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  155. package/skill/react-best-practices/rules/advanced-init-once.md +42 -0
  156. package/skill/react-best-practices/rules/advanced-use-latest.md +39 -0
  157. package/skill/react-best-practices/rules/async-api-routes.md +38 -0
  158. package/skill/react-best-practices/rules/async-defer-await.md +80 -0
  159. package/skill/react-best-practices/rules/async-dependencies.md +51 -0
  160. package/skill/react-best-practices/rules/async-parallel.md +28 -0
  161. package/skill/react-best-practices/rules/async-suspense-boundaries.md +99 -0
  162. package/skill/react-best-practices/rules/bundle-barrel-imports.md +59 -0
  163. package/skill/react-best-practices/rules/bundle-conditional.md +31 -0
  164. package/skill/react-best-practices/rules/bundle-defer-third-party.md +49 -0
  165. package/skill/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  166. package/skill/react-best-practices/rules/bundle-preload.md +50 -0
  167. package/skill/react-best-practices/rules/client-event-listeners.md +74 -0
  168. package/skill/react-best-practices/rules/client-localstorage-schema.md +71 -0
  169. package/skill/react-best-practices/rules/client-passive-event-listeners.md +48 -0
  170. package/skill/react-best-practices/rules/client-swr-dedup.md +56 -0
  171. package/skill/react-best-practices/rules/js-batch-dom-css.md +107 -0
  172. package/skill/react-best-practices/rules/js-cache-function-results.md +80 -0
  173. package/skill/react-best-practices/rules/js-cache-property-access.md +28 -0
  174. package/skill/react-best-practices/rules/js-cache-storage.md +70 -0
  175. package/skill/react-best-practices/rules/js-combine-iterations.md +32 -0
  176. package/skill/react-best-practices/rules/js-early-exit.md +50 -0
  177. package/skill/react-best-practices/rules/js-hoist-regexp.md +45 -0
  178. package/skill/react-best-practices/rules/js-index-maps.md +37 -0
  179. package/skill/react-best-practices/rules/js-length-check-first.md +49 -0
  180. package/skill/react-best-practices/rules/js-min-max-loop.md +82 -0
  181. package/skill/react-best-practices/rules/js-set-map-lookups.md +24 -0
  182. package/skill/react-best-practices/rules/js-tosorted-immutable.md +57 -0
  183. package/skill/react-best-practices/rules/rendering-activity.md +26 -0
  184. package/skill/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  185. package/skill/react-best-practices/rules/rendering-conditional-render.md +40 -0
  186. package/skill/react-best-practices/rules/rendering-content-visibility.md +38 -0
  187. package/skill/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  188. package/skill/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  189. package/skill/react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
  190. package/skill/react-best-practices/rules/rendering-svg-precision.md +28 -0
  191. package/skill/react-best-practices/rules/rendering-usetransition-loading.md +75 -0
  192. package/skill/react-best-practices/rules/rerender-defer-reads.md +39 -0
  193. package/skill/react-best-practices/rules/rerender-dependencies.md +45 -0
  194. package/skill/react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
  195. package/skill/react-best-practices/rules/rerender-derived-state.md +29 -0
  196. package/skill/react-best-practices/rules/rerender-functional-setstate.md +74 -0
  197. package/skill/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  198. package/skill/react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
  199. package/skill/react-best-practices/rules/rerender-memo.md +44 -0
  200. package/skill/react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
  201. package/skill/react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
  202. package/skill/react-best-practices/rules/rerender-transitions.md +40 -0
  203. package/skill/react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
  204. package/skill/react-best-practices/rules/server-after-nonblocking.md +73 -0
  205. package/skill/react-best-practices/rules/server-auth-actions.md +96 -0
  206. package/skill/react-best-practices/rules/server-cache-lru.md +41 -0
  207. package/skill/react-best-practices/rules/server-cache-react.md +76 -0
  208. package/skill/react-best-practices/rules/server-dedup-props.md +65 -0
  209. package/skill/react-best-practices/rules/server-hoist-static-io.md +142 -0
  210. package/skill/react-best-practices/rules/server-parallel-fetching.md +83 -0
  211. package/skill/react-best-practices/rules/server-serialization.md +38 -0
  212. package/skill/react-native-skills/SKILL.md +115 -0
  213. package/skill/react-native-skills/rules/animation-derived-value.md +53 -0
  214. package/skill/react-native-skills/rules/animation-gesture-detector-press.md +95 -0
  215. package/skill/react-native-skills/rules/animation-gpu-properties.md +65 -0
  216. package/skill/react-native-skills/rules/design-system-compound-components.md +66 -0
  217. package/skill/react-native-skills/rules/fonts-config-plugin.md +71 -0
  218. package/skill/react-native-skills/rules/imports-design-system-folder.md +68 -0
  219. package/skill/react-native-skills/rules/js-hoist-intl.md +61 -0
  220. package/skill/react-native-skills/rules/list-performance-callbacks.md +44 -0
  221. package/skill/react-native-skills/rules/list-performance-function-references.md +132 -0
  222. package/skill/react-native-skills/rules/list-performance-images.md +53 -0
  223. package/skill/react-native-skills/rules/list-performance-inline-objects.md +97 -0
  224. package/skill/react-native-skills/rules/list-performance-item-expensive.md +94 -0
  225. package/skill/react-native-skills/rules/list-performance-item-memo.md +82 -0
  226. package/skill/react-native-skills/rules/list-performance-item-types.md +104 -0
  227. package/skill/react-native-skills/rules/list-performance-virtualize.md +67 -0
  228. package/skill/react-native-skills/rules/monorepo-native-deps-in-app.md +46 -0
  229. package/skill/react-native-skills/rules/monorepo-single-dependency-versions.md +63 -0
  230. package/skill/react-native-skills/rules/navigation-native-navigators.md +188 -0
  231. package/skill/react-native-skills/rules/react-compiler-destructure-functions.md +50 -0
  232. package/skill/react-native-skills/rules/react-compiler-reanimated-shared-values.md +48 -0
  233. package/skill/react-native-skills/rules/react-state-dispatcher.md +91 -0
  234. package/skill/react-native-skills/rules/react-state-fallback.md +56 -0
  235. package/skill/react-native-skills/rules/react-state-minimize.md +65 -0
  236. package/skill/react-native-skills/rules/rendering-no-falsy-and.md +74 -0
  237. package/skill/react-native-skills/rules/rendering-text-in-text-component.md +36 -0
  238. package/skill/react-native-skills/rules/scroll-position-no-state.md +82 -0
  239. package/skill/react-native-skills/rules/state-ground-truth.md +80 -0
  240. package/skill/react-native-skills/rules/ui-expo-image.md +66 -0
  241. package/skill/react-native-skills/rules/ui-image-gallery.md +104 -0
  242. package/skill/react-native-skills/rules/ui-measure-views.md +78 -0
  243. package/skill/react-native-skills/rules/ui-menus.md +174 -0
  244. package/skill/react-native-skills/rules/ui-native-modals.md +77 -0
  245. package/skill/react-native-skills/rules/ui-pressable.md +61 -0
  246. package/skill/react-native-skills/rules/ui-safe-area-scroll.md +65 -0
  247. package/skill/react-native-skills/rules/ui-scrollview-content-inset.md +45 -0
  248. package/skill/react-native-skills/rules/ui-styling.md +87 -0
  249. package/skill/react-vite-guide/SKILL.md +101 -0
  250. package/skill/react-vite-guide/references/composition-patterns.md +709 -0
  251. package/skill/react-vite-guide/references/performance-optimization.md +1222 -0
  252. package/skill/react-vite-guide/references/vite-specific.md +385 -0
  253. package/skill/react-vite-guide/references/web-interface.md +146 -0
  254. package/skill/skill-maker/SKILL.md +52 -0
  255. package/skill/skill-maker/references/content_spec.md +67 -0
  256. package/skill/skill-maker/references/frontmatter_spec.md +96 -0
  257. package/skill/skill-maker/references/input_validation.md +90 -0
  258. package/skill/skill-maker/references/skill_structure.md +74 -0
  259. package/skill/system-prompt-creator/SKILL.md +50 -0
  260. package/skill/system-prompt-creator/references/data_format_selection.md +135 -0
  261. package/skill/system-prompt-creator/references/multi_prompt_architecture.md +386 -0
  262. package/skill/system-prompt-creator/references/prompt_structure.md +140 -0
  263. package/skill/system-prompt-creator/references/quality_criteria.md +83 -0
  264. package/skill/typst-creator/SKILL.md +51 -0
  265. package/skill/typst-creator/references/layout.md +401 -0
  266. package/skill/typst-creator/references/math.md +297 -0
  267. package/skill/typst-creator/references/scripting.md +237 -0
  268. package/skill/typst-creator/references/styling.md +217 -0
  269. package/skill/typst-creator/references/syntax.md +234 -0
  270. package/skill/web-design-guidelines/SKILL.md +35 -0
  271. package/terminal.png +0 -0
@@ -0,0 +1,149 @@
1
+ # Impact Detection
2
+
3
+ Techniques for identifying side effects, consumer impact, and contract compatibility of code changes.
4
+
5
+ ## Change Surface Identification
6
+
7
+ Changed entities are analyzed by role:
8
+
9
+ - **Behavioral units**: Functions, methods, handlers, jobs, workflows
10
+ - **Data contracts**: Request/response payloads, persisted schemas, serialized structures
11
+ - **Operational contracts**: Runtime entrypoints, scheduled tasks, event names, configuration keys
12
+
13
+ ## Symbol Exposure Analysis
14
+
15
+ Exposure is classified by externally consumable surface:
16
+
17
+ | Exposure Type | Description | Typical Evidence |
18
+ |---------------|-------------|------------------|
19
+ | **Externally Consumable Interface** | Contracts consumed across module/service boundaries | Public exports, API descriptors, protocol definitions |
20
+ | **Module/Package Public Surface** | Symbols intended for downstream consumers | Re-export files, package entrypoint files, public manifest mappings |
21
+ | **Runtime Entrypoint Contract** | Startup, routing, eventing, or job invocation interfaces | Route maps, event registration, scheduler/worker bindings |
22
+
23
+ ## Dependency Tracing
24
+
25
+ ### Exact Symbol Lookup
26
+ ```bash
27
+ rg -F "<symbol_name>(" .
28
+ ```
29
+ - **Purpose**: Finds direct executable call sites for changed callable symbols
30
+
31
+ ### Broader Reference Lookup
32
+ ```bash
33
+ rg "<symbol_name>" .
34
+ ```
35
+ - **Purpose**: Finds textual references when exact call patterns are insufficient
36
+
37
+ ### Boundary/Entrypoint Lookup
38
+ ```bash
39
+ rg "<entrypoint_or_contract_name>" .
40
+ ```
41
+ - **Purpose**: Identifies where a changed contract is wired into runtime behavior
42
+
43
+ ### Exposure Lookup
44
+ ```bash
45
+ rg "<public_surface_indicator>.*<symbol_name>|<symbol_name>.*<public_surface_indicator>" .
46
+ ```
47
+ - **Purpose**: Confirms whether changed entities are reachable from external consumers
48
+
49
+ ## Consumer Counting
50
+
51
+ Consumer impact is computed in two steps:
52
+
53
+ 1. **Raw Match Count**
54
+ - Count all matches from broad search to establish initial reference volume
55
+
56
+ 2. **Normalized Consumer Count**
57
+ - Include: production runtime references and executable call sites
58
+ - Exclude: definition lines, comments/doc-only references, test-only references, generated files, vendor/third_party code
59
+ - Deduplicate multiple references from the same logical consumer location
60
+
61
+ > Normalized Consumer Count is the authoritative signal for impact and breaking-change severity.
62
+
63
+ ## Evidence Confidence Model
64
+
65
+ | Confidence | Score Range | Characteristics |
66
+ |------------|-------------|-----------------|
67
+ | **High** | `>= 0.8` | Multiple direct executable references with call-path confirmation |
68
+ | **Medium** | `0.5 - 0.79` | References exist but aliasing/re-export/indirection leaves partial uncertainty |
69
+ | **Low** | `< 0.5` | Evidence depends on strings, reflection, dynamic dispatch, or incomplete traceability |
70
+
71
+ ### Verification Status Mapping
72
+
73
+ | Verification Status | Criteria |
74
+ |---------------------|----------|
75
+ | **Verified** | High-confidence evidence with executable reference path |
76
+ | **Partially Verified** | Medium-confidence evidence with unresolved indirection |
77
+ | **Unverifiable** | Low-confidence evidence where static tracing cannot prove runtime linkage |
78
+
79
+ Unverifiable findings are included explicitly in the review report under analysis limitations.
80
+
81
+ ## Impact Categories
82
+
83
+ ### Direct Impact
84
+ - **Callers/Invokers**: Executable consumers that directly invoke changed behavior
85
+ - **Contract Consumers**: Components that parse, validate, or depend on changed contracts
86
+ - **Runtime Integrations**: Route/event/job bindings mapped to changed interfaces
87
+
88
+ ### Indirect Impact
89
+ - **Transitive Consumers**: Callers downstream from direct consumers
90
+ - **Shared State Dependents**: Components reading or writing affected shared state
91
+ - **Operational Coupling**: Alerting, retry, caching, and fallback layers coupled to changed behavior
92
+
93
+ ## Behavioral Test Coverage Check
94
+
95
+ Coverage analysis evaluates changed behavior units, not only file presence.
96
+
97
+ 1. Map changed behavior units from the patch
98
+ 2. Identify tests asserting those behaviors (success path, failure path, boundary conditions)
99
+ 3. Classify coverage:
100
+ - **Covered**: Relevant assertions exist for changed behavior
101
+ - **Partially Covered**: Assertions exist but miss critical branch/edge path
102
+ - **Not Covered**: No relevant assertions found
103
+
104
+ ### Risk Escalation for Missing Coverage
105
+
106
+ | Coverage Status | Escalation Guidance |
107
+ |-----------------|---------------------|
108
+ | **Covered** | No automatic escalation |
109
+ | **Partially Covered** | Consider one-level risk increase when change is high impact |
110
+ | **Not Covered** | Increase risk level for behavior/regression findings |
111
+
112
+ ## Breaking Change Detection (Generic)
113
+
114
+ Breaking-change checks are contract-oriented and language-agnostic.
115
+
116
+ | Contract Change Type | Breaking? | Detection Signal |
117
+ |----------------------|-----------|------------------|
118
+ | **Required input increased** | Yes | New mandatory field/argument/parameter requirement |
119
+ | **Accepted value domain narrowed** | Yes | Removed valid values, stricter validation without compatibility path |
120
+ | **Output contract changed incompatibly** | Yes | Removed/renamed output fields or changed semantic guarantees |
121
+ | **Endpoint/operation signature changed** | Yes | Path/method/operation name or invocation shape changed |
122
+ | **Externally consumed member removed/renamed** | Yes | Consumer-visible symbol removed or renamed without compatibility layer |
123
+ | **Additive backward-compatible extension** | No (usually) | Optional additions preserving existing consumer behavior |
124
+
125
+ ### Decision Signal
126
+
127
+ - If a breaking contract change has normalized consumers > 0, classify at least as **Critical candidate**
128
+ - Final severity considers impact magnitude, confidence, and critical-domain context
129
+
130
+ ## Risk Indicators
131
+
132
+ | Indicator | Base Risk | Description |
133
+ |-----------|-----------|-------------|
134
+ | **No Behavioral Coverage** | High | Changed behavior lacks relevant tests |
135
+ | **High Normalized Consumers** | High | Change affects many runtime consumers |
136
+ | **Exposed Public Surface** | High | Change is reachable by external consumers |
137
+ | **Shared State Mutation** | High | Global or shared state semantics are modified |
138
+ | **Data Shape Change** | High | Persisted or exchanged contract changed |
139
+ | **Config Contract Change** | Medium | Runtime config keys/semantics changed |
140
+
141
+ ## Analysis Limitations
142
+
143
+ Static/textual analysis has known limits:
144
+
145
+ - Dynamic invocation, reflection, and runtime plugin loading
146
+ - Indirection through aliases, generated wiring, or external orchestration
147
+ - Cross-repository consumers not present in current workspace
148
+
149
+ These are recorded as confidence reductions and/or `Unverifiable` findings.
@@ -0,0 +1,137 @@
1
+ # Output Format
2
+
3
+ Structure and formatting specification for production-ready code review results.
4
+
5
+ ## Review Report Structure
6
+
7
+ ```
8
+ ## Review Summary
9
+ - **Target**: <commit_hash | start_hash~end_hash>
10
+ - **Author**: <name>
11
+ - **Files Changed**: <count>
12
+ - **Lines**: +<added> / -<deleted>
13
+
14
+ ## Findings
15
+
16
+ ### Critical (<count>)
17
+ ...
18
+
19
+ ### Major (<count>)
20
+ ...
21
+
22
+ ### Minor (<count>)
23
+ ...
24
+
25
+ ### Nit (<count>)
26
+ ...
27
+
28
+ ## Analysis Limitations
29
+ - <unverifiable area or analysis constraint>
30
+
31
+ ## Risk Context
32
+ - **Critical Domains Affected**: <none | list>
33
+ - **Weighted Risk Score**: <numeric_score>
34
+
35
+ ## Decision Rationale
36
+ - <why this verdict was selected>
37
+
38
+ ## Verdict
39
+ <APPROVE | REQUEST_CHANGES | COMMENT>
40
+ ```
41
+
42
+ ## Finding Entry Format
43
+
44
+ ```
45
+ #### [<severity>] <title>
46
+ - **File**: `<file_path>:<line_number>`
47
+ - **Issue**: <description>
48
+ - **Evidence**: <specific code/path/behavioral evidence>
49
+ - **Impact**: <user/service/data/operational impact>
50
+ - **Confidence**: <0.0-1.0>
51
+ - **Verification Status**: <Verified | Partially Verified | Unverifiable>
52
+ - **Suggestion**: <at least one remediation direction>
53
+ ```
54
+
55
+ ### Example Entry
56
+ ```
57
+ #### [Major] Incompatible output contract for downstream consumer
58
+ - **File**: `service/account/response_mapper.ext:118`
59
+ - **Issue**: Response field `accountStatus` was renamed to `status` without compatibility mapping
60
+ - **Evidence**: Consumer adapters still reference `accountStatus` in runtime parsing logic
61
+ - **Impact**: Downstream consumers may fail to parse responses, causing request failures
62
+ - **Confidence**: 0.86
63
+ - **Verification Status**: Verified
64
+ - **Suggestion**: Add compatibility mapping or versioned response contract before removing old field
65
+ ```
66
+
67
+ ## Verdict Criteria
68
+
69
+ Verdict selection combines count-based baseline rules and risk-weighted adjustments.
70
+
71
+ ### Baseline Rules (Count-Based)
72
+
73
+ | Verdict | Condition |
74
+ |---------|-----------|
75
+ | **REQUEST_CHANGES** | Any Critical finding exists |
76
+ | **REQUEST_CHANGES** | 3+ Major findings exist |
77
+ | **COMMENT** | Major findings exist (1-2) |
78
+ | **COMMENT** | 5+ Minor findings exist |
79
+ | **APPROVE** | Only Minor/Nit findings or none |
80
+
81
+ ### Weighted Risk Model
82
+
83
+ - **Severity Weights**: Critical=10, Major=5, Minor=2, Nit=1
84
+ - **Confidence Factor**: High=1.0, Medium=0.7, Low=0.4
85
+ - **Critical Domain Bonus**: +4 per finding impacting authentication/authorization, payment/billing, data integrity/migration, or availability/reliability
86
+
87
+ `Weighted Risk Score = Sum((Severity Weight * Confidence Factor) + Critical Domain Bonus)`
88
+
89
+ ### Risk-Aware Verdict Adjustments
90
+
91
+ | Condition | Adjustment |
92
+ |-----------|------------|
93
+ | Any Verified Critical finding | REQUEST_CHANGES |
94
+ | Weighted Risk Score >= 12 with medium-or-higher confidence evidence | REQUEST_CHANGES |
95
+ | Weighted Risk Score 6-11 | COMMENT (unless baseline already requests changes) |
96
+ | Weighted Risk Score <= 5 and no Major+ findings | APPROVE candidate |
97
+
98
+ ### Confidence-Aware Handling
99
+
100
+ | Evidence Shape | Handling |
101
+ |----------------|----------|
102
+ | High confidence + high impact | Keep or escalate severity as reported |
103
+ | Medium confidence + medium/high impact | Keep severity, include verification note |
104
+ | Low confidence finding | Avoid automatic escalation; request manual verification in rationale |
105
+
106
+ ## Grouping Options
107
+
108
+ ### By Severity (Default)
109
+ Findings are grouped under severity headers.
110
+
111
+ ### By File
112
+ ```
113
+ ## path/to/file.ext
114
+ - [Major] Contract incompatibility (L118)
115
+ - [Minor] Error context is underspecified (L44)
116
+ ```
117
+
118
+ ## Positive Feedback
119
+
120
+ Include a `Highlights` section when clearly justified by the patch quality.
121
+
122
+ ```
123
+ ## Highlights
124
+ - <description of a notable positive practice>
125
+ ```
126
+
127
+ ## Summary Statistics
128
+
129
+ | Metric | Description |
130
+ |--------|-------------|
131
+ | **Total Findings** | Sum of all severity counts |
132
+ | **Critical Count** | Number of critical issues |
133
+ | **Major Count** | Number of major issues |
134
+ | **Minor Count** | Number of minor issues |
135
+ | **Nit Count** | Number of nit issues |
136
+ | **Weighted Risk Score** | Risk-weighted score using severity and confidence factors |
137
+ | **Unverifiable Count** | Number of findings marked as `Unverifiable` |
@@ -0,0 +1,100 @@
1
+ # Severity Criteria
2
+
3
+ Classification criteria for code review findings by severity level, with confidence-aware interpretation.
4
+
5
+ ## Severity Levels
6
+
7
+ ## Critical
8
+
9
+ Issues with immediate high risk to system integrity, security, availability, or external contract compatibility.
10
+
11
+ | Category | Examples |
12
+ |----------|----------|
13
+ | **Security Exposure** | Injection vectors, credential leakage, authorization bypass |
14
+ | **Data Integrity Failure** | Corruption, irreversible mutation, destructive migration without safe path |
15
+ | **Availability Risk** | Crash loops, deadlock potential, unbounded resource exhaustion |
16
+ | **Externally Breaking Contract** | Incompatible changes on consumed public/runtime interfaces |
17
+ | **Rollback Gap in High-Risk Change** | No rollback/mitigation path for high-impact operational changes |
18
+
19
+ ### Indicators
20
+ - Sensitive operation without required access control
21
+ - Destructive schema/data change without compatibility or rollback path
22
+ - Consumer-visible contract removed or renamed while consumers exist
23
+ - Critical monitoring/remediation controls removed during risky behavior changes
24
+
25
+ ## Major
26
+
27
+ Issues that cause incorrect behavior, major reliability degradation, or high operational cost.
28
+
29
+ | Category | Examples |
30
+ |----------|----------|
31
+ | **Behavioral Defects** | Incorrect branch logic, boundary errors, invalid fallback behavior |
32
+ | **Performance Degradation** | Unbounded processing, repeated expensive operations, excessive I/O |
33
+ | **Error Handling Gaps** | Swallowed failures, incorrect retry boundaries, misclassified errors |
34
+ | **Concurrency/Race Risk** | Inconsistent shared-state access, missing synchronization strategy |
35
+ | **Observability Regression** | Loss of diagnostic context, reduced signal for incident response |
36
+ | **Configuration Semantics Drift** | Runtime config meaning changed without compatibility handling |
37
+
38
+ ### Indicators
39
+ - Changed behavior lacks reliable failure-path handling
40
+ - Operationally expensive path triggered without guardrails
41
+ - Logging/metrics signal required for detection or triage is significantly reduced
42
+ - Consumer-impacting change exists but evidence or impact is below Critical threshold
43
+
44
+ ## Minor
45
+
46
+ Issues affecting maintainability, readability, or medium-term quality.
47
+
48
+ | Category | Examples |
49
+ |----------|----------|
50
+ | **Maintainability** | Excessive complexity, duplicated logic, unclear module boundaries |
51
+ | **Readability** | Ambiguous naming, difficult control flow, poor local context |
52
+ | **Design Hygiene** | Tight coupling, low-cohesion utility placement |
53
+
54
+ ### Indicators
55
+ - Complex change with limited local explanation
56
+ - Duplication likely to drift over time
57
+ - Readability issues that increase future defect risk
58
+
59
+ ## Nit
60
+
61
+ Low-impact polish and consistency suggestions.
62
+
63
+ | Category | Examples |
64
+ |----------|----------|
65
+ | **Style Consistency** | Formatting or local style drift |
66
+ | **Naming Polish** | Naming clarity improvements with negligible behavioral impact |
67
+ | **Comment Hygiene** | Outdated comments or missing short contextual notes |
68
+
69
+ ### Indicators
70
+ - Cosmetic inconsistency without runtime impact
71
+ - Minor naming or organization cleanup opportunities
72
+
73
+ ## Confidence Axis
74
+
75
+ Confidence qualifies how strongly evidence supports a finding.
76
+
77
+ | Confidence Tier | Score Range | Interpretation |
78
+ |-----------------|-------------|----------------|
79
+ | **High** | `>= 0.8` | Strong direct evidence; severity can be acted on directly |
80
+ | **Medium** | `0.5 - 0.79` | Credible but partially indirect evidence; include verification notes |
81
+ | **Low** | `< 0.5` | Weak or indirect evidence; avoid automatic escalation |
82
+
83
+ ## Critical vs Major Boundary Guidance
84
+
85
+ | Decision Factor | Critical Lean | Major Lean |
86
+ |-----------------|--------------|------------|
87
+ | **Data Risk** | Data loss/corruption likely or irreversible | Data inconsistency possible but recoverable |
88
+ | **Business Logic Impact** | Core transaction/authorization correctness is broken | Limited-path incorrect behavior without systemic failure |
89
+ | **Rollback/Mitigation** | No safe rollback path for high-impact change | Rollback or mitigation exists and is practical |
90
+ | **Observability Effect** | Incident detection/containment capability critically degraded | Detection degraded but still operationally manageable |
91
+
92
+ ## Escalation Conditions
93
+
94
+ A Major finding is considered a `REQUEST_CHANGES` candidate when all conditions hold:
95
+
96
+ - Impacts at least one critical domain (`authentication/authorization`, `payment/billing`, `data integrity/migration`, `availability/reliability`)
97
+ - Impact is high for users, service continuity, or data correctness
98
+ - Confidence is Medium or High (`>= 0.5`)
99
+
100
+ If confidence is Low, keep the finding non-escalated and request manual verification.
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: code-security-audit
3
+ description: Performs OWASP-based code security audits on any codebase. Analyzes source code against ASVS 5.0.0 verification requirements, API Security Top 10 2023 risk patterns, OWASP CheatSheet secure coding practices, and WSTG testing methodologies. Input is a codebase to review; output is a detailed Markdown security audit report. Use when the user requests a security audit, security review, vulnerability assessment, or code security analysis.
4
+ ---
5
+
6
+ # Code Security Audit Capabilities
7
+
8
+ OWASP 4-source integrated code security audit system for universal codebase analysis.
9
+
10
+ ## Knowledge Sources
11
+
12
+ - **OWASP ASVS 5.0.0**: 345 verification requirements across 17 security domains (L1/L2/L3)
13
+ - **OWASP API Security Top 10 2023**: 10 API-specific risk categories with code-level indicators
14
+ - **OWASP CheatSheet Series**: 109 practical secure coding cheat sheets for remediation guidance
15
+ - **OWASP WSTG (Web Security Testing Guide)**: 12 testing categories with 120+ test scenarios
16
+
17
+ ## Source Roles
18
+
19
+ | Source | Role | Usage |
20
+ |--------|------|-------|
21
+ | ASVS 5.0.0 | Verification requirements baseline | Defines what to check — structured requirements per domain |
22
+ | API Security Top 10 2023 | Risk taxonomy | Defines what to look for — API-specific threat patterns |
23
+ | CheatSheet Series | Implementation guidance | Defines how to fix — secure coding patterns and practices |
24
+ | WSTG | Test methodology | Defines how to verify — concrete test scenarios per vulnerability |
25
+
26
+ ## Domains
27
+
28
+ - **Input Handling** (V1, V2, V5): Encoding, sanitization, injection prevention, validation, file handling
29
+ - **Authentication & Session** (V6, V7, V9, V10): Auth mechanisms, session management, token handling, OAuth/OIDC
30
+ - **Authorization** (V8): Object-level, function-level, property-level access control
31
+ - **Cryptography** (V11, V12): Storage encryption, key management, TLS configuration
32
+ - **API Security** (V4, V17): REST/GraphQL/WebSocket/WebRTC security, rate limiting, resource consumption
33
+ - **Data Protection** (V14): Sensitive data exposure, privacy controls, client-side data
34
+ - **Configuration** (V13, V16): Security headers, CORS, error handling, logging, deployment hardening
35
+ - **Secure Coding** (V3, V15): Web frontend security, architecture patterns, defensive coding, concurrency safety
36
+
37
+ ## Input Contract
38
+
39
+ | Field | Required | Description |
40
+ |-------|----------|-------------|
41
+ | **Codebase path** | Yes | The current workspace or repository the agent is operating in. Defaults to the active codebase; users may narrow scope to specific directories or files (e.g., `src/auth/`, `api/controllers/`) |
42
+ | **Audit level** | No | ASVS verification level (default: **L2**). See level definitions below |
43
+ | **Focus areas** | No | Security domains to prioritize. See focus area catalog below |
44
+ | **Tech context** | No | Language, framework, or architecture notes for targeted analysis |
45
+
46
+ ### Audit Levels (OWASP ASVS 5.0.0)
47
+
48
+ | Level | Target Application | Requirements | Description |
49
+ |-------|-------------------|-------------|-------------|
50
+ | **L1** | All applications | ~86 | Essential baseline — covers critical vulnerabilities that are typically exploitable and must be addressed in every application (e.g., SQL injection, OS command injection, basic auth checks) |
51
+ | **L2** | Applications handling sensitive data (PII, financial, health) | ~230 | Standard security — includes L1 plus defense-in-depth controls such as SSRF protection, template injection prevention, secure session management, and proper cryptographic usage |
52
+ | **L3** | Mission-critical systems (banking, healthcare, military, infrastructure) | ~345 | Comprehensive defense — includes L1+L2 plus advanced controls such as formula injection prevention, full input canonicalization, and exhaustive cryptographic verification |
53
+
54
+ ### Focus Area Catalog
55
+
56
+ | Focus Area | Domains | Example Checks |
57
+ |------------|---------|----------------|
58
+ | **authentication** | V6, V7, V9, V10 | Password storage, MFA, OAuth/OIDC flow, credential rotation |
59
+ | **authorization** | V8 | Object-level (BOLA), function-level, property-level access control |
60
+ | **injection** | V1, V2 | SQLi, XSS, command injection, LDAP/XPath injection, template injection, XXE |
61
+ | **cryptography** | V11, V12 | Weak algorithms, key management, TLS configuration, secret storage |
62
+ | **api-security** | V4, V17 | Rate limiting, resource consumption, REST/GraphQL/WebSocket security |
63
+ | **session** | V7, V9, V10 | Token handling, session fixation, cookie attributes, JWT validation, CSRF |
64
+ | **file-handling** | V5 | Path traversal, unrestricted upload, file type validation, storage security |
65
+ | **data-protection** | V14 | Sensitive data exposure, privacy controls, client-side data leakage |
66
+ | **configuration** | V13, V16 | Security headers, CORS, error handling, logging, deployment hardening |
67
+ | **secure-coding** | V3, V15 | Frontend security, concurrency safety, architecture patterns, defensive coding |
68
+
69
+ ## Preconditions
70
+
71
+ - Codebase is accessible and readable
72
+ - Agent has file search and read capabilities
73
+ - If codebase structure cannot be determined, the agent reports limitations in the audit output
74
+
75
+ ## Core Capabilities
76
+
77
+ - **Codebase Reconnaissance**: Identifies technology stack, frameworks, entry points, and security-relevant file areas
78
+ - **Domain-Scoped Analysis**: Systematically audits code across all 8 security domains
79
+ - **ASVS Requirement Verification**: Checks code against applicable ASVS 5.0.0 requirements at the specified level
80
+ - **Vulnerability Pattern Detection**: Identifies known vulnerable code patterns from the integrated knowledge base
81
+ - **Cross-Source Correlation**: Maps findings to ASVS requirements, API Top 10 risks, CheatSheet guidance, and WSTG test IDs
82
+ - **Severity Classification**: Rates findings as Critical/High/Medium/Low with evidence and confidence
83
+ - **Remediation Guidance**: Provides concrete fix patterns sourced from CheatSheet Series
84
+ - **Structured Report Generation**: Produces a comprehensive Markdown audit report
85
+
86
+ ## Audit Workflow
87
+
88
+ ```
89
+ 1. Reconnaissance → Identify stack, structure, entry points
90
+ 2. Scope Definition → Select applicable ASVS domains and level
91
+ 3. Domain Analysis → Audit each security domain systematically
92
+ 4. Finding Synthesis → Deduplicate, correlate across sources, assign severity
93
+ 5. Remediation Map → Attach fix patterns per finding
94
+ 6. Report Generation → Produce structured Markdown report
95
+ ```
96
+
97
+ ## Output Contract
98
+
99
+ The audit produces a Markdown report containing:
100
+
101
+ - **Executive Summary**: Overall risk posture, critical findings count, audit scope
102
+ - **Findings Table**: Each finding with severity, ASVS ID, CWE, evidence, and remediation
103
+ - **Domain Reports**: Per-domain detailed analysis with code references
104
+ - **Remediation Roadmap**: Prioritized fix recommendations
105
+ - **Audit Metadata**: Scope, level, limitations, methodology notes
106
+
107
+ ## Severity Levels
108
+
109
+ | Level | Criteria |
110
+ |-------|----------|
111
+ | **Critical** | Exploitable vulnerability with direct security impact (RCE, SQLi, auth bypass, data breach) |
112
+ | **High** | Significant security weakness requiring prompt remediation (broken access control, weak crypto, SSRF) |
113
+ | **Medium** | Security concern with conditional exploitability (missing headers, verbose errors, weak validation) |
114
+ | **Low** | Defense-in-depth improvement or best practice deviation (logging gaps, minor config issues) |
115
+ | **Info** | Observation or recommendation with no direct security impact |
116
+
117
+ ## Technical References
118
+
119
+ - **[audit_process.md](references/audit_process.md)**: Complete step-by-step audit methodology and reconnaissance procedures
120
+ - **[security_domains.md](references/security_domains.md)**: All 17 ASVS domains with code-audit-relevant requirements and cross-source mappings
121
+ - **[vulnerability_patterns.md](references/vulnerability_patterns.md)**: Concrete code-level vulnerability patterns organized by category
122
+ - **[remediation_patterns.md](references/remediation_patterns.md)**: Secure coding fix patterns from CheatSheet Series
123
+ - **[report_format.md](references/report_format.md)**: Detailed Markdown report structure and finding schema