@synapta/skills 0.1.1 → 0.2.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 (354) hide show
  1. package/dist/index.js +11 -4
  2. package/package.json +3 -4
  3. package/skills/ATTRIBUTION.md +80 -0
  4. package/skills/accessibility-audit/SKILL.md +325 -0
  5. package/skills/accessibility-audit/reference/wcag-checklist.md +103 -0
  6. package/skills/apns-notifier/SKILL.md +86 -0
  7. package/skills/approval-policy-enforcer/SKILL.md +66 -0
  8. package/skills/apps-sdk-builder/LICENSE.txt +201 -0
  9. package/skills/apps-sdk-builder/SKILL.md +328 -0
  10. package/skills/apps-sdk-builder/agents/openai.yaml +13 -0
  11. package/skills/apps-sdk-builder/references/app-archetypes.md +132 -0
  12. package/skills/apps-sdk-builder/references/apps-sdk-docs-workflow.md +135 -0
  13. package/skills/apps-sdk-builder/references/interactive-state-sync-patterns.md +113 -0
  14. package/skills/apps-sdk-builder/references/repo-contract-and-validation.md +93 -0
  15. package/skills/apps-sdk-builder/references/search-fetch-standard.md +67 -0
  16. package/skills/apps-sdk-builder/references/upstream-example-workflow.md +79 -0
  17. package/skills/apps-sdk-builder/references/window-openai-patterns.md +79 -0
  18. package/skills/apps-sdk-builder/scripts/scaffold_node_ext_apps.mjs +606 -0
  19. package/skills/architecture-selector/SKILL.md +64 -0
  20. package/skills/backlog-planner/SKILL.md +68 -0
  21. package/skills/carplay-entitlement-checker/SKILL.md +82 -0
  22. package/skills/concept-deepener/SKILL.md +86 -0
  23. package/skills/concept-discovery/SKILL.md +517 -0
  24. package/skills/concept-discovery/assets/sample-analysis.json +81 -0
  25. package/skills/concept-discovery/expected_outputs/sample-enum-dictionary.md +25 -0
  26. package/skills/concept-discovery/expected_outputs/sample-page-user-list.md +83 -0
  27. package/skills/concept-discovery/expected_outputs/sample-prd-readme.md +43 -0
  28. package/skills/concept-discovery/references/framework-patterns.md +228 -0
  29. package/skills/concept-discovery/references/prd-quality-checklist.md +65 -0
  30. package/skills/concept-discovery/scripts/codebase_analyzer.py +732 -0
  31. package/skills/concept-discovery/scripts/prd_scaffolder.py +435 -0
  32. package/skills/dast-zap/SKILL.md +453 -0
  33. package/skills/dast-zap/assets/.gitkeep +9 -0
  34. package/skills/dast-zap/assets/github_action.yml +207 -0
  35. package/skills/dast-zap/assets/gitlab_ci.yml +226 -0
  36. package/skills/dast-zap/assets/zap_automation.yaml +196 -0
  37. package/skills/dast-zap/assets/zap_context.xml +192 -0
  38. package/skills/dast-zap/references/EXAMPLE.md +40 -0
  39. package/skills/dast-zap/references/api_testing_guide.md +475 -0
  40. package/skills/dast-zap/references/authentication_guide.md +431 -0
  41. package/skills/dast-zap/references/false_positive_handling.md +427 -0
  42. package/skills/dast-zap/references/owasp_mapping.md +255 -0
  43. package/skills/dep-sbom-scan/SKILL.md +466 -0
  44. package/skills/deploy-cloudflare/SKILL.md +930 -0
  45. package/skills/deploy-docker/SKILL.md +55 -0
  46. package/skills/deploy-fly/SKILL.md +228 -0
  47. package/skills/deploy-k8s/SKILL.md +108 -0
  48. package/skills/deploy-k8s/assets/logo.png +0 -0
  49. package/skills/deploy-k8s/docs/README.md +29 -0
  50. package/skills/deploy-k8s/docs/SUMMARY.md +56 -0
  51. package/skills/deploy-k8s/docs/advanced/token-efficiency.md +61 -0
  52. package/skills/deploy-k8s/docs/architecture/multi-tenancy.md +96 -0
  53. package/skills/deploy-k8s/docs/architecture/storage-and-state.md +102 -0
  54. package/skills/deploy-k8s/docs/architecture/workload-patterns.md +87 -0
  55. package/skills/deploy-k8s/docs/book.json +16 -0
  56. package/skills/deploy-k8s/docs/community/changelog.md +34 -0
  57. package/skills/deploy-k8s/docs/community/contributing.md +67 -0
  58. package/skills/deploy-k8s/docs/core-concepts/failure-modes.md +153 -0
  59. package/skills/deploy-k8s/docs/core-concepts/philosophy.md +83 -0
  60. package/skills/deploy-k8s/docs/core-concepts/workflow.md +124 -0
  61. package/skills/deploy-k8s/docs/examples/bad-patterns.md +47 -0
  62. package/skills/deploy-k8s/docs/examples/do-dont-checklist.md +37 -0
  63. package/skills/deploy-k8s/docs/examples/good-patterns.md +49 -0
  64. package/skills/deploy-k8s/docs/failure-modes/api-drift.md +104 -0
  65. package/skills/deploy-k8s/docs/failure-modes/fragile-rollouts.md +99 -0
  66. package/skills/deploy-k8s/docs/failure-modes/insecure-workload-defaults.md +80 -0
  67. package/skills/deploy-k8s/docs/failure-modes/network-exposure.md +98 -0
  68. package/skills/deploy-k8s/docs/failure-modes/privilege-sprawl.md +91 -0
  69. package/skills/deploy-k8s/docs/failure-modes/resource-starvation.md +85 -0
  70. package/skills/deploy-k8s/docs/getting-started/installation.md +152 -0
  71. package/skills/deploy-k8s/docs/getting-started/quick-start.md +115 -0
  72. package/skills/deploy-k8s/docs/guides/helm-patterns.md +71 -0
  73. package/skills/deploy-k8s/docs/guides/kustomize-patterns.md +65 -0
  74. package/skills/deploy-k8s/docs/guides/observability.md +67 -0
  75. package/skills/deploy-k8s/docs/guides/security-hardening.md +59 -0
  76. package/skills/deploy-k8s/docs/guides/validation-and-policy.md +66 -0
  77. package/skills/deploy-k8s/docs/integrations/mcp-integration.md +52 -0
  78. package/skills/deploy-k8s/docs/package-lock.json +2892 -0
  79. package/skills/deploy-k8s/docs/package.json +13 -0
  80. package/skills/deploy-k8s/references/api-drift.md +298 -0
  81. package/skills/deploy-k8s/references/conditional/aks-patterns.md +70 -0
  82. package/skills/deploy-k8s/references/conditional/eks-patterns.md +79 -0
  83. package/skills/deploy-k8s/references/conditional/gitops-controllers.md +71 -0
  84. package/skills/deploy-k8s/references/conditional/gke-patterns.md +74 -0
  85. package/skills/deploy-k8s/references/conditional/observability-stacks.md +80 -0
  86. package/skills/deploy-k8s/references/conditional/openshift-patterns.md +67 -0
  87. package/skills/deploy-k8s/references/daemonset-operator-patterns.md +155 -0
  88. package/skills/deploy-k8s/references/deployment-patterns.md +146 -0
  89. package/skills/deploy-k8s/references/do-dont-patterns.md +87 -0
  90. package/skills/deploy-k8s/references/examples-bad.md +282 -0
  91. package/skills/deploy-k8s/references/examples-good.md +440 -0
  92. package/skills/deploy-k8s/references/fragile-rollouts.md +303 -0
  93. package/skills/deploy-k8s/references/helm-patterns.md +203 -0
  94. package/skills/deploy-k8s/references/insecure-workload-defaults.md +300 -0
  95. package/skills/deploy-k8s/references/job-patterns.md +120 -0
  96. package/skills/deploy-k8s/references/kustomize-patterns.md +239 -0
  97. package/skills/deploy-k8s/references/multi-tenancy.md +343 -0
  98. package/skills/deploy-k8s/references/network-exposure.md +481 -0
  99. package/skills/deploy-k8s/references/observability.md +302 -0
  100. package/skills/deploy-k8s/references/privilege-sprawl.md +273 -0
  101. package/skills/deploy-k8s/references/resource-starvation.md +374 -0
  102. package/skills/deploy-k8s/references/security-hardening.md +209 -0
  103. package/skills/deploy-k8s/references/stateful-patterns.md +130 -0
  104. package/skills/deploy-k8s/references/storage-and-state.md +330 -0
  105. package/skills/deploy-k8s/references/validation-and-policy.md +242 -0
  106. package/skills/deploy-railway/SKILL.md +235 -0
  107. package/skills/deploy-railway/references/analyze-db-mongo.md +84 -0
  108. package/skills/deploy-railway/references/analyze-db-mysql.md +254 -0
  109. package/skills/deploy-railway/references/analyze-db-postgres.md +479 -0
  110. package/skills/deploy-railway/references/analyze-db-redis.md +208 -0
  111. package/skills/deploy-railway/references/analyze-db.md +344 -0
  112. package/skills/deploy-railway/references/configure.md +309 -0
  113. package/skills/deploy-railway/references/deploy.md +195 -0
  114. package/skills/deploy-railway/references/operate.md +214 -0
  115. package/skills/deploy-railway/references/request.md +248 -0
  116. package/skills/deploy-railway/references/setup.md +312 -0
  117. package/skills/deploy-railway/scripts/analyze-mongo.py +1549 -0
  118. package/skills/deploy-railway/scripts/analyze-mysql.py +1195 -0
  119. package/skills/deploy-railway/scripts/analyze-postgres.py +3058 -0
  120. package/skills/deploy-railway/scripts/analyze-redis.py +1090 -0
  121. package/skills/deploy-railway/scripts/dal.py +671 -0
  122. package/skills/deploy-railway/scripts/enable-pg-stats.py +170 -0
  123. package/skills/deploy-railway/scripts/pg-extensions.py +370 -0
  124. package/skills/deploy-railway/scripts/railway-api.sh +52 -0
  125. package/skills/deploy-ssh/SKILL.md +91 -0
  126. package/skills/deploy-vercel/SKILL.md +304 -0
  127. package/skills/deploy-vercel/resources/deploy-codex.sh +301 -0
  128. package/skills/deploy-vercel/resources/deploy.sh +301 -0
  129. package/skills/docs-runbooks/SKILL.md +399 -0
  130. package/skills/drive-status-renderer/SKILL.md +62 -0
  131. package/skills/iac-scan/SKILL.md +680 -0
  132. package/skills/iac-scan/assets/.gitkeep +9 -0
  133. package/skills/iac-scan/assets/checkov_config.yaml +94 -0
  134. package/skills/iac-scan/assets/github_actions.yml +199 -0
  135. package/skills/iac-scan/assets/gitlab_ci.yml +218 -0
  136. package/skills/iac-scan/assets/pre_commit_config.yaml +92 -0
  137. package/skills/iac-scan/references/EXAMPLE.md +40 -0
  138. package/skills/iac-scan/references/compliance_mapping.md +237 -0
  139. package/skills/iac-scan/references/custom_policies.md +460 -0
  140. package/skills/iac-scan/references/suppression_guide.md +431 -0
  141. package/skills/incident-briefing/SKILL.md +66 -0
  142. package/skills/incident-triage/SKILL.md +481 -0
  143. package/{LICENSE → skills/mcp-builder/LICENSE.txt} +15 -14
  144. package/skills/mcp-builder/SKILL.md +244 -0
  145. package/skills/mcp-builder/reference/evaluation.md +602 -0
  146. package/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
  147. package/skills/mcp-builder/reference/node_mcp_server.md +970 -0
  148. package/skills/mcp-builder/reference/python_mcp_server.md +719 -0
  149. package/skills/mcp-builder/scripts/connections.py +151 -0
  150. package/skills/mcp-builder/scripts/evaluation.py +373 -0
  151. package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
  152. package/skills/mcp-builder/scripts/requirements.txt +2 -0
  153. package/skills/mobile-pairing/SKILL.md +52 -0
  154. package/skills/ops-sre/SKILL.md +297 -0
  155. package/skills/playwright-qa/LICENSE.txt +201 -0
  156. package/skills/playwright-qa/NOTICE.txt +14 -0
  157. package/skills/playwright-qa/SKILL.md +156 -0
  158. package/skills/playwright-qa/agents/openai.yaml +6 -0
  159. package/skills/playwright-qa/assets/playwright-small.svg +3 -0
  160. package/skills/playwright-qa/assets/playwright.png +0 -0
  161. package/skills/playwright-qa/references/cli.md +116 -0
  162. package/skills/playwright-qa/references/workflows.md +95 -0
  163. package/skills/playwright-qa/scripts/playwright_cli.sh +25 -0
  164. package/skills/release-publish/SKILL.md +85 -0
  165. package/skills/repo-bootstrap/SKILL.md +92 -0
  166. package/skills/repo-bootstrap/assets/example-workflows/validate-agents.yml +89 -0
  167. package/skills/repo-bootstrap/assets/root-thin.md +141 -0
  168. package/skills/repo-bootstrap/assets/root-verbose.md +149 -0
  169. package/skills/repo-bootstrap/assets/scoped/backend-go.md +107 -0
  170. package/skills/repo-bootstrap/assets/scoped/backend-php.md +94 -0
  171. package/skills/repo-bootstrap/assets/scoped/backend-python.md +84 -0
  172. package/skills/repo-bootstrap/assets/scoped/backend-typescript.md +89 -0
  173. package/skills/repo-bootstrap/assets/scoped/claude-code-skill.md +101 -0
  174. package/skills/repo-bootstrap/assets/scoped/cli.md +83 -0
  175. package/skills/repo-bootstrap/assets/scoped/concourse.md +196 -0
  176. package/skills/repo-bootstrap/assets/scoped/ddev.md +68 -0
  177. package/skills/repo-bootstrap/assets/scoped/docker.md +160 -0
  178. package/skills/repo-bootstrap/assets/scoped/documentation.md +98 -0
  179. package/skills/repo-bootstrap/assets/scoped/examples.md +96 -0
  180. package/skills/repo-bootstrap/assets/scoped/frontend-typescript.md +88 -0
  181. package/skills/repo-bootstrap/assets/scoped/github-actions.md +174 -0
  182. package/skills/repo-bootstrap/assets/scoped/gitlab-ci.md +174 -0
  183. package/skills/repo-bootstrap/assets/scoped/oro-bundle.md +209 -0
  184. package/skills/repo-bootstrap/assets/scoped/oro-project.md +170 -0
  185. package/skills/repo-bootstrap/assets/scoped/python-modern.md +170 -0
  186. package/skills/repo-bootstrap/assets/scoped/resources.md +96 -0
  187. package/skills/repo-bootstrap/assets/scoped/skill-repo.md +139 -0
  188. package/skills/repo-bootstrap/assets/scoped/symfony.md +168 -0
  189. package/skills/repo-bootstrap/assets/scoped/testing.md +87 -0
  190. package/skills/repo-bootstrap/assets/scoped/typo3-docs.md +103 -0
  191. package/skills/repo-bootstrap/assets/scoped/typo3-extension.md +133 -0
  192. package/skills/repo-bootstrap/assets/scoped/typo3-project.md +137 -0
  193. package/skills/repo-bootstrap/assets/scoped/typo3-testing.md +80 -0
  194. package/skills/repo-bootstrap/checkpoints.yaml +279 -0
  195. package/skills/repo-bootstrap/evals/evals.json +385 -0
  196. package/skills/repo-bootstrap/references/ai-contribution-guidelines.md +63 -0
  197. package/skills/repo-bootstrap/references/ai-tool-compatibility.md +223 -0
  198. package/skills/repo-bootstrap/references/directory-coverage.md +82 -0
  199. package/skills/repo-bootstrap/references/examples/coding-agent-cli/AGENTS.md +70 -0
  200. package/skills/repo-bootstrap/references/examples/coding-agent-cli/go.mod +3 -0
  201. package/skills/repo-bootstrap/references/examples/coding-agent-cli/scripts-AGENTS.md +389 -0
  202. package/skills/repo-bootstrap/references/examples/express-api-ts/.env.example +13 -0
  203. package/skills/repo-bootstrap/references/examples/express-api-ts/AGENTS.md +91 -0
  204. package/skills/repo-bootstrap/references/examples/express-api-ts/package.json +33 -0
  205. package/skills/repo-bootstrap/references/examples/express-api-ts/pnpm-lock.yaml +3 -0
  206. package/skills/repo-bootstrap/references/examples/express-api-ts/src/AGENTS.md +91 -0
  207. package/skills/repo-bootstrap/references/examples/express-api-ts/src/config.ts +28 -0
  208. package/skills/repo-bootstrap/references/examples/express-api-ts/src/controllers/userController.ts +74 -0
  209. package/skills/repo-bootstrap/references/examples/express-api-ts/src/index.ts +26 -0
  210. package/skills/repo-bootstrap/references/examples/express-api-ts/src/middleware/errorHandler.ts +45 -0
  211. package/skills/repo-bootstrap/references/examples/express-api-ts/src/middleware/requestLogger.ts +18 -0
  212. package/skills/repo-bootstrap/references/examples/express-api-ts/src/routes/health.ts +18 -0
  213. package/skills/repo-bootstrap/references/examples/express-api-ts/src/routes/users.ts +13 -0
  214. package/skills/repo-bootstrap/references/examples/express-api-ts/src/utils/errors.ts +40 -0
  215. package/skills/repo-bootstrap/references/examples/express-api-ts/src/utils/logger.ts +14 -0
  216. package/skills/repo-bootstrap/references/examples/express-api-ts/tsconfig.json +24 -0
  217. package/skills/repo-bootstrap/references/examples/fastapi-app/.env.example +19 -0
  218. package/skills/repo-bootstrap/references/examples/fastapi-app/AGENTS.md +92 -0
  219. package/skills/repo-bootstrap/references/examples/fastapi-app/pyproject.toml +88 -0
  220. package/skills/repo-bootstrap/references/examples/fastapi-app/src/AGENTS.md +85 -0
  221. package/skills/repo-bootstrap/references/examples/fastapi-app/src/__init__.py +3 -0
  222. package/skills/repo-bootstrap/references/examples/fastapi-app/src/config.py +49 -0
  223. package/skills/repo-bootstrap/references/examples/fastapi-app/src/main.py +66 -0
  224. package/skills/repo-bootstrap/references/examples/fastapi-app/src/models/__init__.py +13 -0
  225. package/skills/repo-bootstrap/references/examples/fastapi-app/src/models/item.py +43 -0
  226. package/skills/repo-bootstrap/references/examples/fastapi-app/src/models/user.py +40 -0
  227. package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/__init__.py +5 -0
  228. package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/health.py +20 -0
  229. package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/items.py +61 -0
  230. package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/users.py +55 -0
  231. package/skills/repo-bootstrap/references/examples/fastapi-app/src/services/__init__.py +6 -0
  232. package/skills/repo-bootstrap/references/examples/fastapi-app/src/services/item_service.py +77 -0
  233. package/skills/repo-bootstrap/references/examples/fastapi-app/src/services/user_service.py +69 -0
  234. package/skills/repo-bootstrap/references/examples/fastapi-app/uv.lock +4 -0
  235. package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/.scopes +3 -0
  236. package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/AGENTS.md +86 -0
  237. package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/admin/package.json +20 -0
  238. package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/admin/src/App.tsx +5 -0
  239. package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/cmd/api/main.go +7 -0
  240. package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/go.mod +2 -0
  241. package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/main.go +7 -0
  242. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/.scopes +3 -0
  243. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/AGENTS.md +89 -0
  244. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/go.mod +2 -0
  245. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/AGENTS.md +90 -0
  246. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/package.json +17 -0
  247. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/App.tsx +1 -0
  248. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Button.tsx +1 -0
  249. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Footer.tsx +1 -0
  250. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Header.tsx +1 -0
  251. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Sidebar.tsx +1 -0
  252. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/main.go +7 -0
  253. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/package-lock.json +0 -0
  254. package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/package.json +12 -0
  255. package/skills/repo-bootstrap/references/examples/ldap-selfservice/AGENTS.md +70 -0
  256. package/skills/repo-bootstrap/references/examples/ldap-selfservice/go.mod +3 -0
  257. package/skills/repo-bootstrap/references/examples/ldap-selfservice/internal-AGENTS.md +371 -0
  258. package/skills/repo-bootstrap/references/examples/ldap-selfservice/internal-web-AGENTS.md +448 -0
  259. package/skills/repo-bootstrap/references/examples/php-with-frontend/.scopes +3 -0
  260. package/skills/repo-bootstrap/references/examples/php-with-frontend/AGENTS.md +91 -0
  261. package/skills/repo-bootstrap/references/examples/php-with-frontend/composer.json +8 -0
  262. package/skills/repo-bootstrap/references/examples/php-with-frontend/package.json +15 -0
  263. package/skills/repo-bootstrap/references/examples/php-with-frontend/pnpm-lock.yaml +0 -0
  264. package/skills/repo-bootstrap/references/examples/php-with-frontend/src/Controller.php +3 -0
  265. package/skills/repo-bootstrap/references/examples/php-with-frontend/web/AGENTS.md +92 -0
  266. package/skills/repo-bootstrap/references/examples/php-with-frontend/web/package.json +26 -0
  267. package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/App.tsx +3 -0
  268. package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/Button.tsx +10 -0
  269. package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/Footer.tsx +9 -0
  270. package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/Header.tsx +9 -0
  271. package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/main.tsx +3 -0
  272. package/skills/repo-bootstrap/references/examples/php-with-frontend/web/tsconfig.json +13 -0
  273. package/skills/repo-bootstrap/references/examples/pnpm-workspace/AGENTS.md +75 -0
  274. package/skills/repo-bootstrap/references/examples/pnpm-workspace/package.json +7 -0
  275. package/skills/repo-bootstrap/references/examples/pnpm-workspace/packages/web/package.json +11 -0
  276. package/skills/repo-bootstrap/references/examples/pnpm-workspace/packages/web/src/index.ts +11 -0
  277. package/skills/repo-bootstrap/references/examples/pnpm-workspace/pnpm-lock.yaml +42 -0
  278. package/skills/repo-bootstrap/references/examples/pnpm-workspace/pnpm-workspace.yaml +2 -0
  279. package/skills/repo-bootstrap/references/examples/simple-ldap-go/AGENTS.md +70 -0
  280. package/skills/repo-bootstrap/references/examples/simple-ldap-go/examples-AGENTS.md +45 -0
  281. package/skills/repo-bootstrap/references/examples/simple-ldap-go/go.mod +3 -0
  282. package/skills/repo-bootstrap/references/examples/t3x-rte-ckeditor-image/AGENTS.md +70 -0
  283. package/skills/repo-bootstrap/references/examples/t3x-rte-ckeditor-image/Classes-AGENTS.md +392 -0
  284. package/skills/repo-bootstrap/references/examples/t3x-rte-ckeditor-image/composer.json +8 -0
  285. package/skills/repo-bootstrap/references/feedback-memory-schema.md +135 -0
  286. package/skills/repo-bootstrap/references/git-hooks-setup.md +79 -0
  287. package/skills/repo-bootstrap/references/output-structure.md +124 -0
  288. package/skills/repo-bootstrap/references/scripts-guide.md +175 -0
  289. package/skills/repo-bootstrap/references/verification-guide.md +137 -0
  290. package/skills/repo-bootstrap/scripts/analyze-git-history.sh +315 -0
  291. package/skills/repo-bootstrap/scripts/check-freshness.sh +230 -0
  292. package/skills/repo-bootstrap/scripts/detect-golden-samples.sh +161 -0
  293. package/skills/repo-bootstrap/scripts/detect-heuristics.sh +93 -0
  294. package/skills/repo-bootstrap/scripts/detect-project.sh +486 -0
  295. package/skills/repo-bootstrap/scripts/detect-scopes.sh +330 -0
  296. package/skills/repo-bootstrap/scripts/detect-utilities.sh +133 -0
  297. package/skills/repo-bootstrap/scripts/extract-adrs.sh +194 -0
  298. package/skills/repo-bootstrap/scripts/extract-agent-configs.sh +331 -0
  299. package/skills/repo-bootstrap/scripts/extract-architecture-rules.sh +522 -0
  300. package/skills/repo-bootstrap/scripts/extract-ci-commands.sh +385 -0
  301. package/skills/repo-bootstrap/scripts/extract-ci-rules.sh +384 -0
  302. package/skills/repo-bootstrap/scripts/extract-commands.sh +358 -0
  303. package/skills/repo-bootstrap/scripts/extract-documentation.sh +308 -0
  304. package/skills/repo-bootstrap/scripts/extract-github-rulesets.sh +96 -0
  305. package/skills/repo-bootstrap/scripts/extract-github-settings.sh +88 -0
  306. package/skills/repo-bootstrap/scripts/extract-ide-settings.sh +228 -0
  307. package/skills/repo-bootstrap/scripts/extract-platform-files.sh +290 -0
  308. package/skills/repo-bootstrap/scripts/extract-quality-configs.sh +442 -0
  309. package/skills/repo-bootstrap/scripts/generate-agents.sh +2424 -0
  310. package/skills/repo-bootstrap/scripts/generate-file-map.sh +153 -0
  311. package/skills/repo-bootstrap/scripts/lib/config-root.sh +211 -0
  312. package/skills/repo-bootstrap/scripts/lib/summary.sh +244 -0
  313. package/skills/repo-bootstrap/scripts/lib/template.sh +397 -0
  314. package/skills/repo-bootstrap/scripts/validate-structure.sh +324 -0
  315. package/skills/repo-bootstrap/scripts/verify-commands.sh +615 -0
  316. package/skills/repo-bootstrap/scripts/verify-content.sh +302 -0
  317. package/skills/schema-api-contracts/SKILL.md +56 -0
  318. package/skills/secret-hygiene/SKILL.md +511 -0
  319. package/skills/secret-hygiene/assets/.gitkeep +9 -0
  320. package/skills/secret-hygiene/assets/config-balanced.toml +81 -0
  321. package/skills/secret-hygiene/assets/config-custom.toml +178 -0
  322. package/skills/secret-hygiene/assets/config-strict.toml +48 -0
  323. package/skills/secret-hygiene/assets/github-action.yml +181 -0
  324. package/skills/secret-hygiene/assets/gitlab-ci.yml +257 -0
  325. package/skills/secret-hygiene/assets/precommit-config.yaml +70 -0
  326. package/skills/secret-hygiene/references/EXAMPLE.md +40 -0
  327. package/skills/secret-hygiene/references/compliance_mapping.md +538 -0
  328. package/skills/secret-hygiene/references/detection_rules.md +276 -0
  329. package/skills/secret-hygiene/references/false_positives.md +598 -0
  330. package/skills/secret-hygiene/references/remediation_guide.md +530 -0
  331. package/skills/stack-selector/SKILL.md +56 -0
  332. package/skills/telegram-control/SKILL.md +110 -0
  333. package/skills/telegram-control/references/architecture.md +184 -0
  334. package/skills/telegram-control/references/convex.md +173 -0
  335. package/skills/telegram-control/references/error_handling.md +212 -0
  336. package/skills/telegram-control/references/initial_setup.md +165 -0
  337. package/skills/telegram-control/references/telegram_api.md +156 -0
  338. package/skills/telegram-control/scripts/cancel_message.ts +53 -0
  339. package/skills/telegram-control/scripts/list_scheduled.ts +103 -0
  340. package/skills/telegram-control/scripts/logger.ts +121 -0
  341. package/skills/telegram-control/scripts/proxy-util.ts +11 -0
  342. package/skills/telegram-control/scripts/schedule_message.ts +216 -0
  343. package/skills/telegram-control/scripts/send_message.ts +115 -0
  344. package/skills/telegram-control/scripts/setup.ts +185 -0
  345. package/skills/telegram-control/scripts/types.ts +75 -0
  346. package/skills/telegram-control/scripts/view_history.ts +74 -0
  347. package/skills/test-strategy/SKILL.md +352 -0
  348. package/skills/threat-model/SKILL.md +303 -0
  349. package/skills/threat-model/examples/example-output.md +196 -0
  350. package/skills/threat-model/template.md +96 -0
  351. package/skills/ts-lint/SKILL.md +80 -0
  352. package/skills/ui-flow/SKILL.md +668 -0
  353. package/skills/voice-command-router/SKILL.md +51 -0
  354. package/skills/widget-live-activity-sync/SKILL.md +66 -0
@@ -0,0 +1,330 @@
1
+ #!/usr/bin/env bash
2
+ # Detect directories that should have scoped AGENTS.md files
3
+ set -euo pipefail
4
+
5
+ PROJECT_DIR="${1:-.}"
6
+ cd "$PROJECT_DIR"
7
+
8
+ MIN_FILES=5 # Minimum files to warrant scoped AGENTS.md
9
+
10
+ # Get project info
11
+ PROJECT_INFO=$(bash "$(dirname "$0")/detect-project.sh" "$PROJECT_DIR")
12
+ LANGUAGE=$(echo "$PROJECT_INFO" | jq -r '.language')
13
+
14
+ scopes=()
15
+
16
+ # Function to count source files in a directory
17
+ count_source_files() {
18
+ local dir="$1"
19
+ local pattern="$2"
20
+ find "$dir" -maxdepth 3 -type f -name "$pattern" 2>/dev/null | wc -l
21
+ }
22
+
23
+ # Function to add scope (uses jq for proper JSON escaping)
24
+ add_scope() {
25
+ local path="$1"
26
+ local type="$2"
27
+ local count="$3"
28
+
29
+ scopes+=("$(jq -n --arg p "$path" --arg t "$type" --argjson c "$count" \
30
+ '{path: $p, type: $t, files: $c}')")
31
+ }
32
+
33
+ # Language-specific scope detection
34
+ case "$LANGUAGE" in
35
+ "go")
36
+ # Check common Go directories
37
+ [ -d "internal" ] && {
38
+ count=$(count_source_files "internal" "*.go")
39
+ [ "$count" -ge "$MIN_FILES" ] && add_scope "internal" "backend-go" "$count"
40
+ }
41
+
42
+ [ -d "pkg" ] && {
43
+ count=$(count_source_files "pkg" "*.go")
44
+ [ "$count" -ge "$MIN_FILES" ] && add_scope "pkg" "backend-go" "$count"
45
+ }
46
+
47
+ [ -d "cmd" ] && {
48
+ count=$(count_source_files "cmd" "*.go")
49
+ [ "$count" -ge 3 ] && add_scope "cmd" "cli" "$count"
50
+ }
51
+
52
+ [ -d "examples" ] && {
53
+ count=$(count_source_files "examples" "*.go")
54
+ [ "$count" -ge 3 ] && add_scope "examples" "examples" "$count"
55
+ }
56
+
57
+ [ -d "testutil" ] && {
58
+ count=$(count_source_files "testutil" "*.go")
59
+ [ "$count" -ge 3 ] && add_scope "testutil" "testing" "$count"
60
+ }
61
+
62
+ [ -d "docs" ] && {
63
+ count=$(find docs -type f \( -name "*.md" -o -name "*.rst" \) | wc -l)
64
+ [ "$count" -ge 3 ] && add_scope "docs" "documentation" "$count"
65
+ }
66
+ ;;
67
+
68
+ "php")
69
+ # Determine PHP backend type based on framework
70
+ FRAMEWORK=$(echo "$PROJECT_INFO" | jq -r '.framework')
71
+ PROJECT_TYPE=$(echo "$PROJECT_INFO" | jq -r '.type')
72
+
73
+ # Select appropriate backend template
74
+ # Differentiate between extension/bundle (standalone package) vs project (full installation)
75
+ if [ "$PROJECT_TYPE" = "php-typo3-extension" ]; then
76
+ PHP_BACKEND_TYPE="typo3-extension"
77
+ elif [ "$PROJECT_TYPE" = "php-typo3" ]; then
78
+ PHP_BACKEND_TYPE="typo3-project"
79
+ elif [ "$PROJECT_TYPE" = "php-oro-bundle" ]; then
80
+ PHP_BACKEND_TYPE="oro-bundle"
81
+ elif [ "$PROJECT_TYPE" = "php-oro" ]; then
82
+ PHP_BACKEND_TYPE="oro-project"
83
+ elif [ "$FRAMEWORK" = "symfony" ] || [ "$PROJECT_TYPE" = "php-symfony" ]; then
84
+ PHP_BACKEND_TYPE="symfony"
85
+ else
86
+ PHP_BACKEND_TYPE="backend-php"
87
+ fi
88
+
89
+ # Check common PHP directories
90
+ [ -d "Classes" ] && {
91
+ count=$(count_source_files "Classes" "*.php")
92
+ [ "$count" -ge "$MIN_FILES" ] && add_scope "Classes" "$PHP_BACKEND_TYPE" "$count"
93
+ }
94
+
95
+ [ -d "src" ] && {
96
+ count=$(count_source_files "src" "*.php")
97
+ [ "$count" -ge "$MIN_FILES" ] && add_scope "src" "$PHP_BACKEND_TYPE" "$count"
98
+ }
99
+
100
+ [ -d "Tests" ] && {
101
+ count=$(count_source_files "Tests" "*.php")
102
+ if [ "$count" -ge 3 ]; then
103
+ # Use TYPO3-specific testing template for TYPO3 extensions
104
+ if [ "$PROJECT_TYPE" = "php-typo3-extension" ]; then
105
+ add_scope "Tests" "typo3-testing" "$count"
106
+ else
107
+ add_scope "Tests" "testing" "$count"
108
+ fi
109
+ fi
110
+ }
111
+
112
+ [ -d "tests" ] && {
113
+ count=$(count_source_files "tests" "*.php")
114
+ [ "$count" -ge 3 ] && add_scope "tests" "testing" "$count"
115
+ }
116
+
117
+ [ -d "Documentation" ] && {
118
+ count=$(find Documentation -type f \( -name "*.rst" -o -name "*.md" \) | wc -l)
119
+ if [ "$count" -ge 3 ]; then
120
+ # Use TYPO3-specific docs template for TYPO3 extensions
121
+ if [ "$PROJECT_TYPE" = "php-typo3-extension" ]; then
122
+ add_scope "Documentation" "typo3-docs" "$count"
123
+ else
124
+ add_scope "Documentation" "documentation" "$count"
125
+ fi
126
+ fi
127
+ }
128
+
129
+ [ -d "Resources" ] && {
130
+ count=$(find Resources -type f | wc -l)
131
+ [ "$count" -ge 5 ] && add_scope "Resources" "resources" "$count"
132
+ }
133
+
134
+ # Oro-specific: check for Bundle directories within projects
135
+ if [ "$PROJECT_TYPE" = "php-oro" ]; then
136
+ for bundle_dir in src/*/Bundle/*/; do
137
+ [ -d "$bundle_dir" ] && {
138
+ count=$(count_source_files "$bundle_dir" "*.php")
139
+ [ "$count" -ge "$MIN_FILES" ] && add_scope "${bundle_dir%/}" "oro-bundle" "$count"
140
+ }
141
+ done
142
+ fi
143
+ ;;
144
+
145
+ "typescript")
146
+ # Check common TypeScript/JavaScript directories
147
+ [ -d "src" ] && {
148
+ count=$(count_source_files "src" "*.ts")
149
+ ts_count=$count
150
+ count=$(count_source_files "src" "*.tsx")
151
+ tsx_count=$count
152
+
153
+ if [ "$tsx_count" -ge "$MIN_FILES" ]; then
154
+ add_scope "src" "frontend-typescript" "$tsx_count"
155
+ elif [ "$ts_count" -ge "$MIN_FILES" ]; then
156
+ add_scope "src" "backend-typescript" "$ts_count"
157
+ fi
158
+ }
159
+
160
+ [ -d "components" ] && {
161
+ count=$(count_source_files "components" "*.tsx")
162
+ [ "$count" -ge "$MIN_FILES" ] && add_scope "components" "frontend-typescript" "$count"
163
+ }
164
+
165
+ [ -d "pages" ] && {
166
+ count=$(count_source_files "pages" "*.tsx")
167
+ [ "$count" -ge 3 ] && add_scope "pages" "frontend-typescript" "$count"
168
+ }
169
+
170
+ [ -d "app" ] && {
171
+ count=$(count_source_files "app" "*.tsx")
172
+ [ "$count" -ge 3 ] && add_scope "app" "frontend-typescript" "$count"
173
+ }
174
+
175
+ if [ -d "server" ] || [ -d "backend" ]; then
176
+ dir=$([ -d "server" ] && echo "server" || echo "backend")
177
+ count=$(count_source_files "$dir" "*.ts")
178
+ [ "$count" -ge "$MIN_FILES" ] && add_scope "$dir" "backend-typescript" "$count"
179
+ fi
180
+
181
+ if [ -d "__tests__" ] || [ -d "tests" ]; then
182
+ dir=$([ -d "__tests__" ] && echo "__tests__" || echo "tests")
183
+ count=$(count_source_files "$dir" "*.test.ts")
184
+ [ "$count" -ge 3 ] && add_scope "$dir" "testing" "$count"
185
+ fi
186
+ ;;
187
+
188
+ "python")
189
+ # Determine Python template: use python-modern if pyproject.toml with ruff/mypy
190
+ PYTHON_TEMPLATE="backend-python"
191
+ if [ -f "pyproject.toml" ]; then
192
+ if grep -q 'ruff' pyproject.toml 2>/dev/null || grep -q 'mypy' pyproject.toml 2>/dev/null; then
193
+ PYTHON_TEMPLATE="python-modern"
194
+ fi
195
+ fi
196
+
197
+ # Check common Python directories
198
+ [ -d "src" ] && {
199
+ count=$(count_source_files "src" "*.py")
200
+ [ "$count" -ge "$MIN_FILES" ] && add_scope "src" "$PYTHON_TEMPLATE" "$count"
201
+ }
202
+
203
+ [ -d "tests" ] && {
204
+ count=$(count_source_files "tests" "*.py")
205
+ [ "$count" -ge 3 ] && add_scope "tests" "testing" "$count"
206
+ }
207
+
208
+ [ -d "scripts" ] && {
209
+ count=$(count_source_files "scripts" "*.py")
210
+ [ "$count" -ge 3 ] && add_scope "scripts" "cli" "$count"
211
+ }
212
+
213
+ [ -d "docs" ] && {
214
+ count=$(find docs -type f \( -name "*.md" -o -name "*.rst" \) | wc -l)
215
+ [ "$count" -ge 3 ] && add_scope "docs" "documentation" "$count"
216
+ }
217
+ ;;
218
+ esac
219
+
220
+ # Check for web subdirectories (cross-language)
221
+ # IMPORTANT: Only create frontend-typescript scopes if Node toolchain exists
222
+ # Either: package.json in scope dir, package.json at root, or lockfile at root
223
+ has_node_toolchain() {
224
+ local scope_dir="$1"
225
+ [ -f "$scope_dir/package.json" ] || \
226
+ [ -f "package.json" ] || \
227
+ [ -f "pnpm-lock.yaml" ] || \
228
+ [ -f "yarn.lock" ] || \
229
+ [ -f "bun.lockb" ] || \
230
+ [ -f "package-lock.json" ]
231
+ }
232
+
233
+ for web_dir in internal/web web frontend client ui; do
234
+ if [ -d "$web_dir" ]; then
235
+ count=$(find "$web_dir" -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) 2>/dev/null | wc -l)
236
+ if [ "$count" -ge "$MIN_FILES" ] && has_node_toolchain "$web_dir"; then
237
+ add_scope "$web_dir" "frontend-typescript" "$count"
238
+ fi
239
+ fi
240
+ done
241
+
242
+ # Check for Claude Code skills (each skill gets its own scope)
243
+ if [ -d "skills" ]; then
244
+ for skill_dir in skills/*/; do
245
+ if [ -f "${skill_dir}SKILL.md" ]; then
246
+ # Count files in skill (sh, md, yaml)
247
+ count=$(find "$skill_dir" -type f \( -name "*.sh" -o -name "*.md" -o -name "*.yaml" -o -name "*.yml" \) 2>/dev/null | wc -l)
248
+ add_scope "${skill_dir%/}" "claude-code-skill" "$count"
249
+ fi
250
+ done
251
+ fi
252
+
253
+ # Check for DDEV local development environment (cross-language)
254
+ if [ -d ".ddev" ]; then
255
+ count=$(find .ddev -type f \( -name "*.yaml" -o -name "*.yml" \) 2>/dev/null | wc -l)
256
+ [ "$count" -ge 1 ] && add_scope ".ddev" "ddev" "$count"
257
+ fi
258
+
259
+ # Check for Docker/container directories (cross-language)
260
+ # These get "docker" scope type for container-focused documentation
261
+ for docker_dir in docker deploy .docker infrastructure infra; do
262
+ if [ -d "$docker_dir" ]; then
263
+ # Count Docker-related files
264
+ count=$(find "$docker_dir" -type f \( -name "Dockerfile*" -o -name "*.dockerfile" -o -name "docker-compose*.yml" -o -name "compose*.yml" -o -name "*.yaml" -o -name "*.sh" \) 2>/dev/null | wc -l)
265
+ [ "$count" -ge 2 ] && add_scope "$docker_dir" "docker" "$count"
266
+ fi
267
+ done
268
+
269
+ # Check for CI/CD configurations (cross-language)
270
+ # GitHub Actions
271
+ if [ -d ".github/workflows" ]; then
272
+ count=$(find .github/workflows -type f -name "*.yml" -o -name "*.yaml" 2>/dev/null | wc -l)
273
+ [ "$count" -ge 1 ] && add_scope ".github/workflows" "github-actions" "$count"
274
+ fi
275
+
276
+ # GitLab CI - use .gitlab directory if exists, otherwise skip (root AGENTS.md covers it)
277
+ if [ -f ".gitlab-ci.yml" ]; then
278
+ if [ -d ".gitlab" ]; then
279
+ count=$(find .gitlab -type f -name "*.yml" 2>/dev/null | wc -l)
280
+ [ "$count" -ge 1 ] && add_scope ".gitlab" "gitlab-ci" "$count"
281
+ fi
282
+ # Note: If no .gitlab/ directory, the root AGENTS.md will mention gitlab-ci.yml
283
+ fi
284
+
285
+ # Concourse CI
286
+ concourse_detected=false
287
+ concourse_dir=""
288
+ for concourse_pattern in "ci/pipeline.yml" "ci/pipeline.yaml" "concourse/pipeline.yml"; do
289
+ if [ -f "$concourse_pattern" ]; then
290
+ concourse_dir=$(dirname "$concourse_pattern")
291
+ concourse_detected=true
292
+ break
293
+ fi
294
+ done
295
+ # Check for pipeline.yml at root - only create scope if ci/ directory exists
296
+ if [ "$concourse_detected" = false ]; then
297
+ if [ -f "pipeline.yml" ] || [ -f "pipeline.yaml" ]; then
298
+ if [ -d "ci" ]; then
299
+ concourse_dir="ci"
300
+ concourse_detected=true
301
+ fi
302
+ # If no ci/ directory, root AGENTS.md will cover the pipeline file
303
+ fi
304
+ fi
305
+ # Also check for *-pipeline.yml at root - only create scope if ci/ directory exists
306
+ if [ "$concourse_detected" = false ]; then
307
+ pipeline_files=$(find . -maxdepth 1 -name "*-pipeline.yml" -o -name "*-pipeline.yaml" 2>/dev/null | wc -l)
308
+ if [ "$pipeline_files" -gt 0 ] && [ -d "ci" ]; then
309
+ concourse_dir="ci"
310
+ concourse_detected=true
311
+ fi
312
+ fi
313
+ if [ "$concourse_detected" = true ] && [ -n "$concourse_dir" ] && [ -d "$concourse_dir" ]; then
314
+ count=$(find "$concourse_dir" -type f \( -name "*.yml" -o -name "*.yaml" -o -name "*.sh" \) 2>/dev/null | wc -l)
315
+ [ "$count" -ge 1 ] && add_scope "$concourse_dir" "concourse" "$count"
316
+ fi
317
+
318
+ # Output JSON
319
+ if [ ${#scopes[@]} -eq 0 ]; then
320
+ echo '{"scopes": []}'
321
+ else
322
+ # Join scopes with commas via explicit loop — avoids IFS= entirely
323
+ # (the opengrep bash.lang.security.ifs-tampering rule flags any
324
+ # IFS= assignment, even inside subshells).
325
+ joined="${scopes[0]}"
326
+ for ((i=1; i<${#scopes[@]}; i++)); do
327
+ joined+=",${scopes[i]}"
328
+ done
329
+ echo "{\"scopes\": [$joined]}"
330
+ fi
@@ -0,0 +1,133 @@
1
+ #!/usr/bin/env bash
2
+ # Detect utility files and libraries to prevent reinvention
3
+ set -euo pipefail
4
+
5
+ PROJECT_DIR="${1:-.}"
6
+ cd "$PROJECT_DIR"
7
+
8
+ # Check if git is available
9
+ if ! git rev-parse --git-dir > /dev/null 2>&1; then
10
+ echo ""
11
+ exit 0
12
+ fi
13
+
14
+ # Get project language
15
+ PROJECT_INFO=$(bash "$(dirname "$0")/detect-project.sh" "$PROJECT_DIR" 2>/dev/null || echo '{"language":"unknown"}')
16
+ LANGUAGE=$(echo "$PROJECT_INFO" | jq -r '.language')
17
+
18
+ # Common utility directory names
19
+ UTIL_DIRS=("utils" "util" "helpers" "helper" "lib" "shared" "common" "pkg")
20
+
21
+ # Find utility directories
22
+ find_util_dirs() {
23
+ for dir in "${UTIL_DIRS[@]}"; do
24
+ [ -d "$dir" ] && echo "$dir"
25
+ [ -d "src/$dir" ] && echo "src/$dir"
26
+ [ -d "internal/$dir" ] && echo "internal/$dir"
27
+ done
28
+ }
29
+
30
+ # Extract exports from TypeScript index file
31
+ extract_ts_exports() {
32
+ local file="$1"
33
+ grep -oE "export \{ [^}]+ \}" "$file" 2>/dev/null | \
34
+ sed 's/export { //; s/ }//; s/,/\n/g' | \
35
+ tr -d ' ' | head -10
36
+ }
37
+
38
+ # Extract function names from Go file
39
+ extract_go_exports() {
40
+ local dir="$1"
41
+ find "$dir" -name "*.go" -type f 2>/dev/null | while read -r file; do
42
+ grep -oE "^func [A-Z][a-zA-Z0-9_]*" "$file" 2>/dev/null | \
43
+ sed 's/func //' | head -5
44
+ done | sort -u | head -10
45
+ }
46
+
47
+ # Extract function names from Python file
48
+ extract_py_exports() {
49
+ local dir="$1"
50
+ find "$dir" -name "*.py" ! -name "__*" -type f 2>/dev/null | while read -r file; do
51
+ grep -oE "^def [a-z_][a-z0-9_]*" "$file" 2>/dev/null | \
52
+ sed 's/def //' | head -5
53
+ done | sort -u | head -10
54
+ }
55
+
56
+ # Infer utility purpose from name
57
+ infer_purpose() {
58
+ local name="$1"
59
+ case "$name" in
60
+ *date*|*time*|*format*Date*) echo "date/time formatting" ;;
61
+ *http*|*fetch*|*api*|*client*) echo "HTTP requests" ;;
62
+ *log*) echo "logging" ;;
63
+ *valid*|*check*) echo "validation" ;;
64
+ *parse*) echo "parsing" ;;
65
+ *format*) echo "formatting" ;;
66
+ *error*) echo "error handling" ;;
67
+ *auth*|*token*) echo "authentication" ;;
68
+ *cache*) echo "caching" ;;
69
+ *config*) echo "configuration" ;;
70
+ *string*|*str*) echo "string manipulation" ;;
71
+ *file*|*path*) echo "file operations" ;;
72
+ *) echo "utility" ;;
73
+ esac
74
+ }
75
+
76
+ # Generate output
77
+ output=""
78
+
79
+ while IFS= read -r dir; do
80
+ [ -z "$dir" ] && continue
81
+
82
+ case "$LANGUAGE" in
83
+ "typescript")
84
+ # Check for index.ts barrel export
85
+ if [ -f "$dir/index.ts" ]; then
86
+ while IFS= read -r export; do
87
+ [ -z "$export" ] && continue
88
+ purpose=$(infer_purpose "$export")
89
+ output="$output| $purpose | \`$export\` | \`$dir/\` |\n"
90
+ done < <(extract_ts_exports "$dir/index.ts")
91
+ fi
92
+ ;;
93
+
94
+ "go")
95
+ while IFS= read -r func; do
96
+ [ -z "$func" ] && continue
97
+ purpose=$(infer_purpose "$func")
98
+ output="$output| $purpose | \`$func\` | \`$dir/\` |\n"
99
+ done < <(extract_go_exports "$dir")
100
+ ;;
101
+
102
+ "python")
103
+ while IFS= read -r func; do
104
+ [ -z "$func" ] && continue
105
+ purpose=$(infer_purpose "$func")
106
+ output="$output| $purpose | \`$func\` | \`$dir/\` |\n"
107
+ done < <(extract_py_exports "$dir")
108
+ ;;
109
+
110
+ "php")
111
+ # List PHP utility classes
112
+ while read -r file; do
113
+ class=$(grep -oE "class [A-Z][a-zA-Z0-9_]+" "$file" 2>/dev/null | head -1 | sed 's/class //')
114
+ [ -n "$class" ] && {
115
+ purpose=$(infer_purpose "$class")
116
+ relpath="${file#./}"
117
+ output="$output| $purpose | \`$class\` | \`$relpath\` |\n"
118
+ }
119
+ done < <(find "$dir" -name "*.php" -type f 2>/dev/null | head -20)
120
+ ;;
121
+ esac
122
+ done < <(find_util_dirs)
123
+
124
+ # Check for common utility files at root or src
125
+ for util_file in "utils.ts" "utils.js" "helpers.ts" "helpers.js" "utils.py" "helpers.py"; do
126
+ for prefix in "" "src/"; do
127
+ file="${prefix}${util_file}"
128
+ [ -f "$file" ] && output="$output| utilities | \`$file\` | \`$file\` |\n"
129
+ done
130
+ done
131
+
132
+ # Output (remove empty lines, duplicates)
133
+ echo -e "$output" | sed '/^$/d' | sort -u | head -15
@@ -0,0 +1,194 @@
1
+ #!/usr/bin/env bash
2
+ # Extract Architectural Decision Records (ADRs) from common locations
3
+ # Returns JSON with ADR metadata for AGENTS.md generation
4
+ set -euo pipefail
5
+
6
+ PROJECT_DIR="${1:-.}"
7
+ cd "$PROJECT_DIR"
8
+
9
+ # Common ADR directory locations
10
+ ADR_DIRS=(
11
+ "docs/adr" "docs/adrs" "docs/decisions" "docs/architecture/decisions"
12
+ "Documentation/ADR" "Documentation/Decisions"
13
+ "adr" "ADR"
14
+ )
15
+
16
+ # Find the first existing ADR directory
17
+ ADR_DIR=""
18
+ for dir in "${ADR_DIRS[@]}"; do
19
+ if [ -d "$dir" ]; then
20
+ ADR_DIR="$dir"
21
+ break
22
+ fi
23
+ done
24
+
25
+ # If no ADR directory found, check for standalone ADR files in docs/
26
+ if [ -z "$ADR_DIR" ]; then
27
+ # Look for ADR-named files anywhere in docs/
28
+ if [ -d "docs" ]; then
29
+ adr_file=$(find docs -maxdepth 2 -type f \( -name "ADR-*.md" -o -name "adr-*.md" -o -name "*-adr-*.md" -o -name "ADR*.rst" \) 2>/dev/null | head -1)
30
+ if [ -n "$adr_file" ]; then
31
+ ADR_DIR=$(dirname "$adr_file")
32
+ fi
33
+ fi
34
+ fi
35
+
36
+ # No ADRs found
37
+ if [ -z "$ADR_DIR" ]; then
38
+ jq -n '{adr_count: 0, adr_directory: null, adrs: []}'
39
+ exit 0
40
+ fi
41
+
42
+ # Collect ADR files
43
+ ADR_FILES=()
44
+ while IFS= read -r -d '' file; do
45
+ ADR_FILES+=("$file")
46
+ done < <(find "$ADR_DIR" -maxdepth 1 -type f \( -name "ADR-*.md" -o -name "adr-*.md" -o -name "*-adr-*.md" -o -name "ADR*.rst" -o -name "adr*.rst" -o -name "*.md" \) -print0 2>/dev/null | sort -z)
47
+
48
+ # Deduplicate and filter — only include files that look like ADRs
49
+ FILTERED_FILES=()
50
+ for file in "${ADR_FILES[@]}"; do
51
+ basename=$(basename "$file")
52
+ # Accept files with ADR in the name, or numbered files (common ADR pattern like 0001-*.md)
53
+ if [[ "$basename" =~ ^[Aa][Dd][Rr][-_] ]] || [[ "$basename" =~ ^[0-9]{3,4}[-_] ]] || [[ "$basename" =~ -[Aa][Dd][Rr][-_] ]]; then
54
+ FILTERED_FILES+=("$file")
55
+ fi
56
+ done
57
+
58
+ if [ ${#FILTERED_FILES[@]} -eq 0 ]; then
59
+ jq -n --arg dir "$ADR_DIR" '{adr_count: 0, adr_directory: $dir, adrs: []}'
60
+ exit 0
61
+ fi
62
+
63
+ # Extract metadata from each ADR
64
+ ADRS_JSON="[]"
65
+ for file in "${FILTERED_FILES[@]}"; do
66
+ filename=$(basename "$file")
67
+
68
+ # Read file content
69
+ content=$(cat "$file" 2>/dev/null) || continue
70
+ [ -z "$content" ] && continue
71
+
72
+ # Extract title: first heading (# or ##)
73
+ title=""
74
+ while IFS= read -r line; do
75
+ if [[ "$line" =~ ^#{1,2}[[:space:]]+(.*) ]]; then
76
+ title="${BASH_REMATCH[1]}"
77
+ # Strip leading ADR number prefix like "ADR-001:" or "ADR 1:"
78
+ title=$(echo "$title" | sed -E 's/^ADR[-_ ]?[0-9]+:?\s*//i')
79
+ break
80
+ fi
81
+ done <<< "$content"
82
+ [ -z "$title" ] && title="$filename"
83
+
84
+ # Extract status: look for "Status:" line or **Status** pattern
85
+ status="Unknown"
86
+ while IFS= read -r line; do
87
+ # Match patterns like "## Status", then read next non-empty line
88
+ if [[ "$line" =~ ^#{1,3}[[:space:]]+[Ss]tatus ]]; then
89
+ # Read lines after the status heading to find the actual status
90
+ found_heading=false
91
+ while IFS= read -r sline; do
92
+ if [ "$found_heading" = false ]; then
93
+ found_heading=true
94
+ continue
95
+ fi
96
+ # Skip empty lines
97
+ [[ -z "${sline// /}" ]] && continue
98
+ # Extract the status value
99
+ sline=$(echo "$sline" | sed -E 's/^\*\*//;s/\*\*.*$//;s/^- //;s/^`//;s/`$//')
100
+ if [[ "$sline" =~ ^(Accepted|Proposed|Deprecated|Superseded|Rejected|Draft|Approved) ]]; then
101
+ status="${BASH_REMATCH[1]}"
102
+ fi
103
+ break
104
+ done
105
+ break
106
+ fi
107
+ # Match inline patterns: "**Status**: Accepted", "**Status:** Accepted", "Status: Accepted"
108
+ if [[ "$line" =~ \*?\*?[Ss]tatus\*?\*?:?[[:space:]]*(Accepted|Proposed|Deprecated|Superseded|Rejected|Draft|Approved) ]]; then
109
+ status="${BASH_REMATCH[1]}"
110
+ break
111
+ fi
112
+ done <<< "$content"
113
+
114
+ # Extract summary: first paragraph after Context heading, or first paragraph after title
115
+ summary=""
116
+ # Try "Context" section first
117
+ in_context=false
118
+ while IFS= read -r line; do
119
+ if [[ "$line" =~ ^#{1,3}[[:space:]]+(Context|Background) ]]; then
120
+ in_context=true
121
+ continue
122
+ fi
123
+ if [ "$in_context" = true ]; then
124
+ [[ -z "${line// /}" ]] && continue
125
+ # Stop at next heading
126
+ [[ "$line" =~ ^# ]] && break
127
+ # Take the first non-empty, non-heading line
128
+ summary=$(echo "$line" | sed -E 's/^\*\*//;s/\*\*$//;s/^- //')
129
+ # Truncate to ~120 chars
130
+ if [ ${#summary} -gt 120 ]; then
131
+ summary="${summary:0:117}..."
132
+ fi
133
+ break
134
+ fi
135
+ done <<< "$content"
136
+
137
+ # Fallback: first paragraph after title
138
+ if [ -z "$summary" ]; then
139
+ past_title=false
140
+ while IFS= read -r line; do
141
+ if [[ "$line" =~ ^# ]] && [ "$past_title" = false ]; then
142
+ past_title=true
143
+ continue
144
+ fi
145
+ if [ "$past_title" = true ]; then
146
+ [[ -z "${line// /}" ]] && continue
147
+ [[ "$line" =~ ^# ]] && break
148
+ [[ "$line" =~ ^[*-][[:space:]] ]] && continue
149
+ summary=$(echo "$line" | sed -E 's/^\*\*//;s/\*\*$//;s/^- //')
150
+ if [ ${#summary} -gt 120 ]; then
151
+ summary="${summary:0:117}..."
152
+ fi
153
+ break
154
+ fi
155
+ done <<< "$content"
156
+ fi
157
+
158
+ # Extract decision: look for "Decision" section
159
+ decision=""
160
+ in_decision=false
161
+ while IFS= read -r line; do
162
+ if [[ "$line" =~ ^#{1,3}[[:space:]]+(Decision|Resolution) ]]; then
163
+ in_decision=true
164
+ continue
165
+ fi
166
+ if [ "$in_decision" = true ]; then
167
+ [[ -z "${line// /}" ]] && continue
168
+ [[ "$line" =~ ^# ]] && break
169
+ [[ "$line" =~ ^\`\`\` ]] && break
170
+ decision=$(echo "$line" | sed -E 's/^\*\*//;s/\*\*$//;s/^- //')
171
+ if [ ${#decision} -gt 150 ]; then
172
+ decision="${decision:0:147}..."
173
+ fi
174
+ break
175
+ fi
176
+ done <<< "$content"
177
+
178
+ # Build JSON entry
179
+ ADRS_JSON=$(echo "$ADRS_JSON" | jq \
180
+ --arg file "$filename" \
181
+ --arg title "$title" \
182
+ --arg status "$status" \
183
+ --arg summary "$summary" \
184
+ --arg decision "$decision" \
185
+ '. + [{file: $file, title: $title, status: $status, summary: $summary, decision: $decision}]')
186
+ done
187
+
188
+ # Output final JSON
189
+ ADR_COUNT=$(echo "$ADRS_JSON" | jq 'length')
190
+ jq -n \
191
+ --argjson count "$ADR_COUNT" \
192
+ --arg dir "$ADR_DIR" \
193
+ --argjson adrs "$ADRS_JSON" \
194
+ '{adr_count: $count, adr_directory: $dir, adrs: $adrs}'