@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
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@vetala/vetala",
3
+ "version": "0.1.0-beta",
4
+ "type": "module",
5
+ "license": "Apache-2.0",
6
+ "description": "Terminal-first AI coding CLI with tools, memory, and local skills.",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/bymehul/vetala.git"
10
+ },
11
+ "homepage": "https://github.com/bymehul/vetala#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/bymehul/vetala/issues"
14
+ },
15
+ "bin": {
16
+ "vetala": "./dist/src/cli.js"
17
+ },
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "files": [
22
+ "dist/src",
23
+ "skill",
24
+ "README.md",
25
+ "CONTRIBUTING.md",
26
+ "LICENSE",
27
+ "THIRD_PARTY_LICENSES.md",
28
+ "terminal.png"
29
+ ],
30
+ "engines": {
31
+ "node": ">=20.0.0"
32
+ },
33
+ "scripts": {
34
+ "build": "tsc -p tsconfig.json",
35
+ "check": "tsc --noEmit -p tsconfig.json",
36
+ "dev": "tsx src/cli.ts",
37
+ "prepare": "npm run build",
38
+ "test": "node --test --import tsx test/**/*.ts"
39
+ },
40
+ "dependencies": {
41
+ "chalk": "^5.4.1",
42
+ "commander": "^14.0.0",
43
+ "gradient-string": "^3.0.0",
44
+ "ink": "^6.8.0",
45
+ "ink-select-input": "^6.2.0",
46
+ "ink-spinner": "^5.0.0",
47
+ "ink-text-input": "^6.0.0",
48
+ "ora": "^9.3.0",
49
+ "react": "^19.0.0"
50
+ },
51
+ "devDependencies": {
52
+ "@types/node": "^24.0.0",
53
+ "@types/react": "^19.0.12",
54
+ "tsx": "^4.20.5",
55
+ "typescript": "^5.8.2"
56
+ }
57
+ }
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: agents-md-generator
3
+ description: Analyze repository structure and generate or update standardized AGENTS.md files that serve as contributor guides for AI agents. Supports both single-repo and monorepo structures. Measures LOC to determine character limits and produces structured documents covering overview, folder structure, patterns, conventions, and working agreements. Update mode refreshes only the standard sections while preserving user-defined custom sections. Use when setting up a new repository, onboarding AI agents to an existing codebase, updating an existing AGENTS.md, or when the user mentions AGENTS.md.
4
+ ---
5
+
6
+ # AGENTS.md Generation Capability
7
+
8
+ This skill enables the agent to generate `AGENTS.md` files that serve as contributor guides for AI agents working on a codebase.
9
+
10
+ ## Core Capability
11
+
12
+ - **Function**: Analyze repository structure and generate or update a standardized `AGENTS.md` document
13
+ - **Output Format**: Markdown file with structured sections
14
+ - **Character Limit**: Dynamic, based on repository LOC (Lines of Code)
15
+ - **Monorepo Support**: Automatically detects monorepo structures and generates hierarchical documentation (Root + Packages)
16
+ - **Update Support**: Refreshes only standard sections in an existing `AGENTS.md`, preserving user-defined custom sections
17
+
18
+ ## Output Sections
19
+
20
+ ### Single Repo / Package Document (5 Sections)
21
+ For single repositories or individual packages in a monorepo:
22
+
23
+ - **Overview**: 1-2 sentence project description (abstract, no tool/framework lists)
24
+ - **Folder Structure**: Key directories and their contents
25
+ - **Core Behaviors & Patterns**: Logging, error handling, control flow, module structure patterns observed in code
26
+ - **Conventions**: Naming, comments, code style derived from analysis
27
+ - **Working Agreements**: Rules for agent behavior and communication
28
+
29
+ ### Monorepo Root Document (3 Sections)
30
+ For the root of a monorepo structure:
31
+
32
+ - **Overview**: 1-2 sentences describing the monorepo's purpose
33
+ - **Folder Structure**: High-level map of apps, packages, and shared configs
34
+ - **Working Agreements**: Common working agreements applicable to all packages
35
+
36
+ ## Operation Modes
37
+
38
+ ### Generate vs Update
39
+
40
+ - **Generate**: Creates a new `AGENTS.md` from scratch (default when no `AGENTS.md` exists)
41
+ - **Update**: Refreshes standard sections in an existing `AGENTS.md` while preserving custom sections. See [./references/update_strategy.md](./references/update_strategy.md) for detailed workflow and section matching rules.
42
+
43
+ The agent automatically selects the appropriate mode based on whether an `AGENTS.md` file already exists at the target location.
44
+
45
+ ### Generation Modes (Monorepo)
46
+
47
+ Supports three modes: **All** (root + all packages, default), **Root Only**, and **Single Package**. See [./references/monorepo_strategy.md](./references/monorepo_strategy.md) for detailed strategy and mode selection criteria.
48
+
49
+ ## Tools
50
+
51
+ This skill uses the following read-only tools for repository analysis. See [./references/read_only_commands.md](./references/read_only_commands.md) for detailed usage patterns.
52
+
53
+ - **`tokei`**: LOC measurement (required)
54
+ - **`rg` (ripgrep)**: Content search (preferred)
55
+ - **`grep` / `Select-String`**: Content search (fallback per OS)
56
+ - **`sed -n` / `Get-Content \| Select-Object`**: Paginated file reading per OS
57
+ - **`tree`**: Directory structure visualization
58
+ - **`find`**: File and directory discovery (Linux / macOS)
59
+ - **`ls`, `pwd`**: Basic directory navigation
60
+
61
+ ## Domain Knowledge
62
+
63
+ - **LOC Measurement**: Capability to measure repository size and determine character limits. See [./references/loc_measurement.md](./references/loc_measurement.md)
64
+ - **Repository Analysis**: Capability to inspect and understand codebase structure. See [./references/read_only_commands.md](./references/read_only_commands.md)
65
+ - **Output Template**: Standardized AGENTS.md structure specification. See [./references/agents_md_template.md](./references/agents_md_template.md)
66
+ - **Working Agreements**: Agent behavior rules for generated documents. See [./references/working_agreements.md](./references/working_agreements.md)
67
+ - **Monorepo Detection**: Capability to identify monorepo structures. See [./references/monorepo_detection.md](./references/monorepo_detection.md)
68
+ - **Monorepo Strategy**: Strategy for generating documentation in monorepos. See [./references/monorepo_strategy.md](./references/monorepo_strategy.md)
69
+ - **Update Strategy**: Strategy for updating existing AGENTS.md files with selective section refresh. See [./references/update_strategy.md](./references/update_strategy.md)
70
+
71
+ ## Scope Boundaries
72
+
73
+ - **Read-Only Analysis**: Supports non-destructive commands for repository inspection
74
+ - **Output Scope**: Produces documentation content only; excludes run/test/build/deploy instructions
75
+ - **Excluded Inputs**: Lock files (`pnpm-lock.yaml`, `package-lock.json`, `yarn.lock`, etc.) are outside analysis scope
@@ -0,0 +1,160 @@
1
+ # AGENTS.md Output Template Specification
2
+
3
+ Defines the exact structure and content requirements for generated `AGENTS.md` files.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Monorepo Root Document Structure](#monorepo-root-document-structure-agentsmd)
8
+ - [Standard Document Structure](#standard-document-structure-single-repo--packages)
9
+ - [Section Specifications](#section-specifications)
10
+ - [Format Requirements](#format-requirements)
11
+ - [Anti-Patterns (Excluded Content)](#anti-patterns-excluded-content)
12
+
13
+ ## Monorepo Root Document Structure (`/AGENTS.md`)
14
+
15
+ Used only when generating the root document for a monorepo.
16
+
17
+ ```markdown
18
+ # AGENTS.md
19
+
20
+ ## 1. Overview
21
+ [1-2 sentences describing the monorepo's purpose]
22
+
23
+ ## 2. Folder Structure
24
+ [High-level map of apps, packages, and shared configs]
25
+
26
+ ## 3. Working Agreements
27
+ [Common working agreements applicable to all packages]
28
+ ```
29
+
30
+ ## Standard Document Structure (Single Repo & Packages)
31
+
32
+ ```markdown
33
+ # AGENTS.md
34
+
35
+ ## 1. Overview
36
+ [1-2 sentences describing the project's purpose and role]
37
+
38
+ ## 2. Folder Structure
39
+ [Key directories with brief descriptions]
40
+
41
+ ## 3. Core Behaviors & Patterns
42
+ [Observed patterns from code analysis]
43
+
44
+ ## 4. Conventions
45
+ [Naming, comments, code style rules]
46
+
47
+ ## 5. Working Agreements
48
+ [Agent behavior rules - see working_agreements.md]
49
+ ```
50
+
51
+ ## Section Specifications
52
+
53
+ ### Section 1: Overview
54
+
55
+ - **Length**: 1-2 very short sentences
56
+ - **Content**: Abstract description of project purpose and role
57
+ - **Excludes**: Long lists of tools, frameworks, commands, environment details
58
+
59
+ ### Section 2: Folder Structure
60
+
61
+ - **Format**: Hierarchical nested bullet list with indentation
62
+ - **Analysis Scope**: Traverse **all depths** of the directory tree during analysis
63
+ - **Output Scope**: Stop at **architecturally significant boundaries** where roles become clear
64
+ - **Content**: Each listed entry should explain the **role and responsibility** concisely
65
+ - **Goal**: Reader should understand where to find/place code for a given concern
66
+
67
+ **Analysis vs Output Principle**:
68
+
69
+ - **Analysis**: All depths — Understand full structure and identify architectural boundaries
70
+ - **Output**: Significant levels only — Present only directories where distinct roles and responsibilities exist
71
+
72
+ **When to Stop Drilling Down**:
73
+
74
+ - When a directory represents a **single cohesive concern** (e.g., `services`, `models`, `utils`)
75
+ - When further depth would only list individual files, not distinct modules
76
+ - When the role can be summarized in one brief sentence
77
+
78
+ **Content Requirements**:
79
+
80
+ - Describe **what** the directory contains and **why** it exists in a brief sentence
81
+ - For source directories, explain the architectural role (e.g., "actions", "services", "models")
82
+ - Mention any conventions (e.g., "mirror main packages if tests are added")
83
+ - Note cross-references to docs if relevant (e.g., "align changes with these when relevant")
84
+
85
+ **Example Structure**:
86
+
87
+ ```markdown
88
+ - `src/main/kotlin/com/example/app`: core application code.
89
+ - `actions`: UI actions wiring user interactions to business logic.
90
+ - `services`: business logic, external integrations, data processing.
91
+ - `ui`: view components, dialogs, panels, layout scaffolding.
92
+ - `model`: domain entities, enums, DTOs.
93
+ - `utils`: shared helpers and utility functions.
94
+ - `settings`: configuration management and persistent state.
95
+ - `src/main/resources`: configuration files, message bundles, static assets.
96
+ - `src/test/kotlin`: test code; mirror main package structure when adding tests.
97
+ - `docs`: development guides and specifications; keep aligned with implementation.
98
+ - `gradle/` or `config/`: build configuration and tooling setup.
99
+ ```
100
+
101
+ **Anti-patterns**:
102
+
103
+ - Flat list without hierarchy or context
104
+ - Generic descriptions like "Core plugin implementation" without explaining structure
105
+ - Omitting important subdirectories that define architecture
106
+ - Missing guidance on where to place new code
107
+
108
+ ### Section 3: Core Behaviors & Patterns
109
+
110
+ Document **cross-cutting patterns** that repeat across the codebase. Focus on patterns that a contributor must follow to keep code consistent — not individual function descriptions.
111
+
112
+ **Pattern Discovery Approach**:
113
+
114
+ - Search for **recurring idioms** that appear in 3+ files (e.g., shared error handling wrappers, common logging calls, repeated guard clause shapes)
115
+ - Identify **architectural boundaries** and how data flows across them (e.g., Controller → Service → Repository, Action → Service → UI)
116
+ - Look for **project-specific abstractions** the team has built on top of frameworks (e.g., custom base classes, shared decorators, wrapper utilities)
117
+ - Note **implicit rules** not captured in linter configs (e.g., "all async operations go through a central queue", "state mutations only via specific helpers")
118
+
119
+ **Pattern Categories** (include only those actually observed):
120
+
121
+ - **Logging**: Logger initialization pattern, log levels, structured logging conventions
122
+ - **Error Handling**: Error propagation strategy, recovery vs fail-fast, custom error types
123
+ - **Control Flow**: Guard clauses, early returns, null-safety idioms
124
+ - **Concurrency / Threading**: Thread model, async patterns, synchronization approaches
125
+ - **Module Communication**: How modules call each other, dependency direction, event/message patterns
126
+ - **State Management**: Where and how state is held, mutated, and shared
127
+
128
+ **Anti-patterns**:
129
+
130
+ - Listing individual functions or classes instead of cross-cutting patterns
131
+ - Describing what a single file does rather than what the codebase does consistently
132
+ - Including patterns that appear only once (not truly cross-cutting)
133
+
134
+ ### Section 4: Conventions
135
+
136
+ - **Naming**: camelCase, snake_case, PascalCase usage
137
+ - **Prefixes/Suffixes**: `SomethingService`, `useSomething`, `SomethingProps`
138
+ - **Comments**: Tone, language, brevity
139
+ - **Legacy Handling**: TODO, FIXME, NOTE, deprecated markers
140
+
141
+ ### Section 5: Working Agreements
142
+
143
+ See the working agreements specification referenced from SKILL.md.
144
+
145
+ ## Format Requirements
146
+
147
+ - **Language**: English only (for the content of the `AGENTS.md` file)
148
+ - **Max Length**: Dynamic based on repository LOC (see LOC measurement specification referenced from SKILL.md)
149
+ - **Format**: Valid Markdown
150
+ - **Tone**: Concise, neutral
151
+ - **Headings**: Short and descriptive
152
+ - **Content Style**: Compact bullet points or short sentences
153
+
154
+ ## Anti-Patterns (Excluded Content)
155
+
156
+ - "Common Commands" section
157
+ - "How to run" instructions
158
+ - "Testing Strategy" documentation
159
+ - Build/deploy instructions
160
+ - Detailed CI pipeline configuration
@@ -0,0 +1,67 @@
1
+ # LOC Measurement Specification
2
+
3
+ Defines the method for measuring repository size and determining dynamic character limits for AGENTS.md.
4
+
5
+ ## Measurement Command
6
+
7
+ ```bash
8
+ tokei -e "*.json" -e "*.yaml" -e "*.yml" -e "*.md" -e "*.sh" -e "*.lock" -e "*.map" -e "*.svg" .
9
+ ```
10
+
11
+ **Priority**: This is the **first step** before generating AGENTS.md.
12
+
13
+ ## Tool Installation
14
+
15
+ If `tokei` is not installed:
16
+
17
+ ```
18
+ tokei is not installed.
19
+ https://github.com/XAMPPRocky/tokei Please install it from here and try again.
20
+ ```
21
+
22
+ ## Character Limit by Repository Scale
23
+
24
+ ```yaml
25
+ - scale: Small
26
+ loc_range: "≤ 10,000"
27
+ character_limit: 10,000
28
+ - scale: Small-Medium
29
+ loc_range: "10,001 ~ 50,000"
30
+ character_limit: 12,000
31
+ - scale: Medium
32
+ loc_range: "50,001 ~ 100,000"
33
+ character_limit: 15,000
34
+ - scale: Medium-Large
35
+ loc_range: "100,001 ~ 500,000"
36
+ character_limit: 20,000
37
+ - scale: Large
38
+ loc_range: "500,001 ~ 1,000,000"
39
+ character_limit: 30,000
40
+ - scale: Extra-Large
41
+ loc_range: "> 1,000,000"
42
+ character_limit: 50,000
43
+ ```
44
+
45
+ ## Workflow
46
+
47
+ 1. Run `tokei` command to get total LOC
48
+ 2. If tokei not installed → display installation guide and stop
49
+ 3. Determine repository scale from LOC value
50
+ 4. Apply corresponding character limit to AGENTS.md generation
51
+
52
+ ## tokei Output Interpretation
53
+
54
+ Use the **Total** lines value from tokei output:
55
+
56
+ ```
57
+ ===============================================================================
58
+ Language Files Lines Code Comments Blanks
59
+ ===============================================================================
60
+ TypeScript 150 45000 38000 3000 4000
61
+ JavaScript 30 5000 4200 400 400
62
+ -------------------------------------------------------------------------------
63
+ Total 180 50000 42200 3400 4400
64
+ ===============================================================================
65
+ ```
66
+
67
+ In this example: Total Lines = 50,000 → Small-Medium → 10,000 chars limit
@@ -0,0 +1,78 @@
1
+ # Monorepo Detection Specification
2
+
3
+ Defines the method for identifying if the current repository is a monorepo.
4
+
5
+ ## Detection Logic
6
+
7
+ A repository is considered a monorepo if **any** of the following marker files or configurations exist in the root directory:
8
+
9
+ ### JavaScript / TypeScript Ecosystem
10
+
11
+ - **`pnpm-workspace.yaml`**: pnpm workspaces
12
+ - **`lerna.json`**: Lerna
13
+ - **`nx.json`**: Nx
14
+ - **`turbo.json`**: Turborepo
15
+ - **`rush.json`**: Rush
16
+ - **`package.json`** with `workspaces` field: npm/Yarn workspaces
17
+
18
+ ### JVM Ecosystem (Gradle / Maven)
19
+
20
+ - **`settings.gradle.kts`** or **`settings.gradle`** containing `include(` or `includeBuild(`: Gradle multi-project / composite build
21
+ - **Root `pom.xml`** with `<modules>` section: Maven multi-module project
22
+
23
+ ### Go
24
+
25
+ - **`go.work`**: Go workspaces (Go 1.18+)
26
+
27
+ ### Rust
28
+
29
+ - **`Cargo.toml`** with `[workspace]` section: Cargo workspaces
30
+
31
+ ### Python
32
+
33
+ - **`pyproject.toml`** with `[tool.hatch.envs]` or workspace config: Hatch workspaces
34
+ - Multiple `pyproject.toml` or `setup.py` under a shared root with a top-level orchestration config
35
+
36
+ ### Build Systems (Language-Agnostic)
37
+
38
+ - **`WORKSPACE`** or **`WORKSPACE.bazel`** or **`MODULE.bazel`**: Bazel
39
+ - **`pants.toml`** or **`pants.ini`**: Pants
40
+
41
+ ## Workspace Package Discovery
42
+
43
+ After identifying a monorepo, discover packages from the relevant configuration:
44
+
45
+ ### JavaScript / TypeScript
46
+
47
+ - **`pnpm-workspace.yaml`**: `packages` field
48
+ - **`package.json`**: `workspaces` field
49
+ - **`lerna.json`**: `packages` field
50
+ - **`nx.json`**: `projects` field or scan directories
51
+
52
+ ### JVM (Gradle / Maven)
53
+
54
+ - **`settings.gradle.kts`** / **`settings.gradle`**: Parse `include()` / `includeBuild()` declarations
55
+ - **`pom.xml`**: Parse `<modules>` entries
56
+
57
+ ### Go
58
+
59
+ - **`go.work`**: Parse `use` directives
60
+
61
+ ### Rust
62
+
63
+ - **`Cargo.toml`**: Parse `[workspace] members` field
64
+
65
+ ### Build Systems
66
+
67
+ - **Bazel**: Scan directories containing `BUILD` or `BUILD.bazel` files
68
+ - **Pants**: Scan directories containing `BUILD` files
69
+
70
+ ## Fallback Discovery
71
+
72
+ If no configuration explicitly lists packages, scan these common directory patterns:
73
+
74
+ - `packages/*/`
75
+ - `apps/*/`
76
+ - `libs/*/`
77
+ - `modules/*/`
78
+ - `services/*/`
@@ -0,0 +1,60 @@
1
+ # Monorepo Generation Strategy
2
+
3
+ Defines the strategy for generating AGENTS.md files in a monorepo environment.
4
+
5
+ ## Generation Modes
6
+
7
+ ```yaml
8
+ - mode: All (Default)
9
+ scope: Root + All Packages
10
+ when_to_use: Initial setup, full regeneration
11
+ - mode: Root Only
12
+ scope: Root document only
13
+ when_to_use: Update shared working agreements
14
+ - mode: Single Package
15
+ scope: One specific package
16
+ when_to_use: Package-specific changes
17
+ ```
18
+
19
+ ## Document Hierarchy
20
+
21
+ ```yaml
22
+ - document: Root
23
+ location: /AGENTS.md
24
+ sections: 3
25
+ character_limit: Dynamic based on LOC
26
+ - document: Package
27
+ location: Per-package directories discovered via workspace config (see monorepo_detection.md)
28
+ sections: 5 (Standard)
29
+ character_limit: Dynamic based on LOC
30
+ ```
31
+
32
+ ## LOC Measurement
33
+
34
+ - **Root Document**: Run `tokei` in root directory
35
+ - **Package Document**: Run `tokei` inside the package directory
36
+
37
+ ## Working Agreements Inheritance
38
+
39
+ - **Root**: Full working agreements (master copy)
40
+ - **Package**: "See root `/AGENTS.md`" (reference only, no additions)
41
+
42
+ **Note**: Package-specific behaviors and conventions belong in **Section 3 (Core Behaviors & Patterns)** and **Section 4 (Conventions)**, not in Working Agreements.
43
+
44
+ ## Section Boundary Rules
45
+
46
+ Defines what content belongs in which section of a package AGENTS.md.
47
+
48
+ ```yaml
49
+ - content_type: Package-specific implementation patterns
50
+ target_section: Section 3 (Core Behaviors & Patterns)
51
+ examples: Logging approach, error handling, control flow
52
+ - content_type: Package-specific naming/style conventions
53
+ target_section: Section 4 (Conventions)
54
+ examples: Naming rules, comment style, file organization
55
+ - content_type: Common working principles across all packages
56
+ target_section: Section 5 (Working Agreements)
57
+ examples: Response language, code block handling, commit rules, context building
58
+ ```
59
+
60
+ **Anti-pattern**: Do NOT place package-specific technical details (e.g., how a particular package handles errors or structures modules) into Section 5 (Working Agreements). Working Agreements are reserved for shared behavioral rules that apply uniformly across the entire repository.
@@ -0,0 +1,151 @@
1
+ # Read-Only Commands Specification
2
+
3
+ Defines the allowed commands for repository analysis during AGENTS.md generation.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Allowed Command Categories](#allowed-command-categories)
8
+ - [ripgrep (`rg`) Usage Patterns](#ripgrep-rg-usage-patterns)
9
+ - [tree Command Usage](#tree-command-usage)
10
+ - [Files to Ignore](#files-to-ignore)
11
+ - [Files Allowed to Read](#files-allowed-to-read)
12
+ - [Source File Analysis Rules](#source-file-analysis-rules)
13
+
14
+ ## Allowed Command Categories
15
+
16
+ ### Basic Inspection
17
+
18
+ - **`pwd`**: Print working directory
19
+ - **`ls`**: List directory contents
20
+ - **`tree`**: Display directory structure
21
+ - **`find`**: File and directory discovery (Linux / macOS)
22
+ - **`Get-ChildItem`**: File and directory discovery (Windows PowerShell)
23
+
24
+ ### LOC Measurement
25
+
26
+ - **`tokei`**: Count lines of code — **Required** for determining character limits (see LOC measurement specification referenced from SKILL.md)
27
+
28
+ ### Content Search
29
+
30
+ ```yaml
31
+ - command: rg (ripgrep)
32
+ platform: All
33
+ priority: Preferred
34
+ notes: Check availability first with `rg --version`
35
+ - command: grep
36
+ platform: Linux / macOS
37
+ priority: Fallback
38
+ notes: Use only if `rg` unavailable
39
+ - command: Select-String
40
+ platform: Windows (PowerShell)
41
+ priority: Fallback
42
+ notes: Use only if `rg` unavailable
43
+ ```
44
+
45
+ ### Paginated File Reading
46
+
47
+ When additional context is needed beyond initial search results, read files in incremental ranges:
48
+
49
+ - **Linux / macOS**: `sed -n 'START,ENDp' FILE` — e.g. `sed -n '1,80p' src/app.js`
50
+ - **Windows (PowerShell)**: `Get-Content FILE | Select-Object -Skip (START-1) -First COUNT` — e.g. `Get-Content src\app.js | Select-Object -Skip 0 -First 80`
51
+
52
+ **Incremental reading pattern**:
53
+
54
+ 1. Read an initial range (e.g., lines 1–80)
55
+ 2. If the context is insufficient, continue from where the previous range ended (e.g., lines 81–160)
56
+ 3. Repeat until enough context is collected
57
+
58
+ **Per-file reading limit**:
59
+
60
+ - Default upper bound: **800 lines** per file
61
+ - Line budget applies **from the first non-import line**; import/require/using blocks at the top of a file are excluded from the count
62
+ - Extend beyond 800 lines **only** when architecture boundaries (e.g., module exports, class definitions, route registrations) have not yet been identified
63
+ - When extending, read in additional 400-line increments and re-evaluate after each increment
64
+ - **Hard cap: 1600 lines** per file — never read beyond this limit regardless of context needs
65
+ - Collect only the context required for analysis; avoid excessive context collection that may degrade output quality
66
+
67
+ ## ripgrep (`rg`) Usage Patterns
68
+
69
+ ### Scope Filtering
70
+
71
+ ```bash
72
+ rg "pattern" -g "*.js" -g "!*.min.js" # Target by glob, exclude minified
73
+ rg "pattern" -g "src/**" # Scope to a directory subtree
74
+ ```
75
+
76
+ ### Visibility & Configs
77
+
78
+ ```bash
79
+ rg "pattern" --hidden # Include hidden files, respect .gitignore
80
+ ```
81
+
82
+ ### Context Retrieval
83
+
84
+ ```bash
85
+ rg "pattern" -C 5 # Include 5 surrounding lines
86
+ ```
87
+
88
+ ### Output Control
89
+
90
+ ```bash
91
+ rg "pattern" -l # List files only (discovery)
92
+ rg "pattern" --json # JSON output for parsing
93
+ ```
94
+
95
+ ### Search Safety
96
+
97
+ ```bash
98
+ rg -F "exact.string()" # Literal search (no regex)
99
+ ```
100
+
101
+ ## tree Command Usage
102
+
103
+ ```bash
104
+ tree -I 'node_modules|.git|dist|build|.turbo|.next|out' -L 3
105
+ ```
106
+
107
+ **Purpose**: Ignore large, low-signal directories (node_modules, build artifacts, VCS metadata)
108
+
109
+ **Note**: `-L 3` is an example depth. Increase depth as needed for full structural analysis (e.g., `-L 5` or `-L 8` for deeper hierarchies).
110
+
111
+ ## Files to Ignore
112
+
113
+ Lock files must NOT be read:
114
+
115
+ - `pnpm-lock.yaml`
116
+ - `package-lock.json`
117
+ - `yarn.lock`
118
+ - `poetry.lock`
119
+ - `Pipfile.lock`
120
+ - `Cargo.lock`
121
+ - `Gemfile.lock`
122
+ - `Podfile.lock`
123
+ - Any other dependency lockfile
124
+
125
+ ## Files Allowed to Read
126
+
127
+ ### Documentation
128
+
129
+ - `README.md`
130
+ - `CONTRIBUTING.md`
131
+ - `docs/` contents
132
+
133
+ ### Style/Tooling Configuration
134
+
135
+ - `.editorconfig`
136
+ - `.eslintrc*`, `eslint.config.*`
137
+ - `.prettierrc*`
138
+ - `pyproject.toml`, `ruff.toml`, `mypy.ini`
139
+
140
+ ### Package Manifests
141
+
142
+ - `package.json`
143
+ - `pyproject.toml`
144
+ - `go.mod`
145
+ - `Cargo.toml`
146
+
147
+ ## Source File Analysis Rules
148
+
149
+ - **Skip**: Import/require/using sections when analyzing patterns
150
+ - **Infer Stack From**: Package manifests, not import statements
151
+ - **Additional Context**: Use paginated file reading to collect more context as needed