@invictus-group-ai/orchestra 0.5.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 (466) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSING.md +49 -0
  3. package/README.md +507 -0
  4. package/assets/settings-template.json +99 -0
  5. package/bin/invi.js +6 -0
  6. package/content-dist/LICENSE +95 -0
  7. package/content-dist/PIPELINE.md +823 -0
  8. package/content-dist/README.md +128 -0
  9. package/content-dist/agents/README.md +135 -0
  10. package/content-dist/agents/mapping.json +476 -0
  11. package/content-dist/agents/stacks/backend-django.md +66 -0
  12. package/content-dist/agents/stacks/backend-dotnet.md +72 -0
  13. package/content-dist/agents/stacks/backend-fastapi.md +66 -0
  14. package/content-dist/agents/stacks/backend-laravel.md +66 -0
  15. package/content-dist/agents/stacks/backend-node.md +66 -0
  16. package/content-dist/agents/stacks/backend-spring.md +66 -0
  17. package/content-dist/agents/stacks/desktop-delphi.md +73 -0
  18. package/content-dist/agents/stacks/frontend-angular.md +65 -0
  19. package/content-dist/agents/stacks/frontend-react.md +67 -0
  20. package/content-dist/agents/stacks/frontend-svelte.md +67 -0
  21. package/content-dist/agents/stacks/frontend-vue.md +66 -0
  22. package/content-dist/agents/stacks/mobile-flutter.md +68 -0
  23. package/content-dist/agents/stacks/wordpress.md +66 -0
  24. package/content-dist/agents/universal/invi-qa.md +57 -0
  25. package/content-dist/agents/universal/invi-reviewer.md +61 -0
  26. package/content-dist/agents/universal/invi-security.md +55 -0
  27. package/content-dist/agents/universal/invi-tester.md +55 -0
  28. package/content-dist/agents/universal/invi-ui.md +85 -0
  29. package/content-dist/fragments/base.md +37 -0
  30. package/content-dist/fragments/domain/api-publica-rate-limiting.md +83 -0
  31. package/content-dist/fragments/domain/autenticacao-enterprise.md +86 -0
  32. package/content-dist/fragments/domain/busca-elasticsearch.md +86 -0
  33. package/content-dist/fragments/domain/dashboard-admin-rbac.md +80 -0
  34. package/content-dist/fragments/domain/design-system.md +71 -0
  35. package/content-dist/fragments/domain/ecommerce-completo.md +86 -0
  36. package/content-dist/fragments/domain/filas-jobs.md +80 -0
  37. package/content-dist/fragments/domain/integracao-crm-erp.md +82 -0
  38. package/content-dist/fragments/domain/lgpd.md +84 -0
  39. package/content-dist/fragments/domain/multi-tenancy.md +79 -0
  40. package/content-dist/fragments/domain/notificacoes-multicanal.md +81 -0
  41. package/content-dist/fragments/domain/pagamentos-brasil.md +85 -0
  42. package/content-dist/fragments/domain/plataforma-conteudo.md +77 -0
  43. package/content-dist/fragments/domain/realtime-websockets.md +92 -0
  44. package/content-dist/fragments/domain/relatorios-analytics.md +80 -0
  45. package/content-dist/fragments/domain/saas-stripe-billing.md +79 -0
  46. package/content-dist/fragments/domain/sistema-pagamentos.md +81 -0
  47. package/content-dist/fragments/domain/upload-midia.md +81 -0
  48. package/content-dist/fragments/domain/whatsapp-business.md +82 -0
  49. package/content-dist/fragments/index.json +1670 -0
  50. package/content-dist/fragments/references/angular-ngrx/app-config-and-testing.md +81 -0
  51. package/content-dist/fragments/references/angular-ngrx/store-pattern.md +155 -0
  52. package/content-dist/fragments/references/ansible-server-setup/layout-and-config.md +143 -0
  53. package/content-dist/fragments/references/ansible-server-setup/roles.md +238 -0
  54. package/content-dist/fragments/references/api-publica-rate-limiting/patterns.md +68 -0
  55. package/content-dist/fragments/references/astro-static/content-and-islands.md +117 -0
  56. package/content-dist/fragments/references/autenticacao-enterprise/pitfalls.md +70 -0
  57. package/content-dist/fragments/references/busca-elasticsearch/patterns.md +100 -0
  58. package/content-dist/fragments/references/chrome-extension-mv3/messaging-and-storage.md +109 -0
  59. package/content-dist/fragments/references/cli-typescript-commander/commands-and-config.md +136 -0
  60. package/content-dist/fragments/references/cloud-run-gcp/build-and-deploy.md +127 -0
  61. package/content-dist/fragments/references/cloud-run-gcp/iam-secrets-networking.md +65 -0
  62. package/content-dist/fragments/references/computer-vision-yolo/serving-and-export.md +182 -0
  63. package/content-dist/fragments/references/computer-vision-yolo/training-and-validation.md +131 -0
  64. package/content-dist/fragments/references/convex-react/functions.md +117 -0
  65. package/content-dist/fragments/references/convex-react/react-and-storage.md +109 -0
  66. package/content-dist/fragments/references/dashboard-admin-rbac/patterns.md +73 -0
  67. package/content-dist/fragments/references/data-pipeline-airflow/dag-patterns.md +149 -0
  68. package/content-dist/fragments/references/data-pipeline-airflow/operations.md +74 -0
  69. package/content-dist/fragments/references/delphi-object-pascal/legacy-extraction.md +175 -0
  70. package/content-dist/fragments/references/django-drf-celery/celery-tasks.md +47 -0
  71. package/content-dist/fragments/references/django-drf-celery/viewsets-and-serializers.md +92 -0
  72. package/content-dist/fragments/references/docker-compose-dev/compose-files.md +146 -0
  73. package/content-dist/fragments/references/docker-compose-dev/dockerfile-and-proxy.md +108 -0
  74. package/content-dist/fragments/references/dotnet-aspnet/data-and-di.md +90 -0
  75. package/content-dist/fragments/references/dotnet-aspnet/web-layer.md +88 -0
  76. package/content-dist/fragments/references/ecommerce-completo/patterns.md +76 -0
  77. package/content-dist/fragments/references/electron-app/ipc-bridge.md +123 -0
  78. package/content-dist/fragments/references/electron-app/security-and-packaging.md +134 -0
  79. package/content-dist/fragments/references/elixir-phoenix/context-and-web.md +112 -0
  80. package/content-dist/fragments/references/elixir-phoenix/processes.md +65 -0
  81. package/content-dist/fragments/references/filas-jobs/patterns.md +116 -0
  82. package/content-dist/fragments/references/fine-tuning-huggingface/data-and-export.md +114 -0
  83. package/content-dist/fragments/references/fine-tuning-huggingface/training-and-lora.md +123 -0
  84. package/content-dist/fragments/references/flutter/platform-channels-and-goldens.md +68 -0
  85. package/content-dist/fragments/references/flutter/state-and-widgets.md +95 -0
  86. package/content-dist/fragments/references/github-actions-cicd/workflows.md +235 -0
  87. package/content-dist/fragments/references/go-chi-gorm/http-layer.md +87 -0
  88. package/content-dist/fragments/references/go-chi-gorm/service-layer.md +58 -0
  89. package/content-dist/fragments/references/graphql-apollo/resolvers-and-loaders.md +128 -0
  90. package/content-dist/fragments/references/hono-bun/patterns.md +144 -0
  91. package/content-dist/fragments/references/integracao-crm-erp/patterns.md +100 -0
  92. package/content-dist/fragments/references/kubernetes-helm/chart-templates.md +162 -0
  93. package/content-dist/fragments/references/kubernetes-helm/secrets-storage-deploy.md +78 -0
  94. package/content-dist/fragments/references/langchain-python-agent/agent-and-cost.md +120 -0
  95. package/content-dist/fragments/references/langchain-python-agent/memory-and-resilience.md +76 -0
  96. package/content-dist/fragments/references/laravel/eloquent-and-queues.md +126 -0
  97. package/content-dist/fragments/references/laravel/http-layer.md +110 -0
  98. package/content-dist/fragments/references/lgpd/patterns.md +110 -0
  99. package/content-dist/fragments/references/llm-ops-production/routing-and-budget.md +118 -0
  100. package/content-dist/fragments/references/llm-ops-production/tracing-eval-ab.md +102 -0
  101. package/content-dist/fragments/references/microservices-docker/compose-and-gateway.md +93 -0
  102. package/content-dist/fragments/references/microservices-docker/events-and-correlation.md +88 -0
  103. package/content-dist/fragments/references/ml-fastapi-serving/metrics-drift-docker.md +97 -0
  104. package/content-dist/fragments/references/ml-fastapi-serving/serving-core.md +155 -0
  105. package/content-dist/fragments/references/ml-training-pipeline/dvc-pipeline.md +102 -0
  106. package/content-dist/fragments/references/ml-training-pipeline/mlflow-registry-ci.md +139 -0
  107. package/content-dist/fragments/references/monitoring-observability/alerts-and-config.md +169 -0
  108. package/content-dist/fragments/references/monitoring-observability/instrumentation-node.md +139 -0
  109. package/content-dist/fragments/references/multi-tenancy/patterns.md +85 -0
  110. package/content-dist/fragments/references/nestjs-typescript/guards-and-decorators.md +103 -0
  111. package/content-dist/fragments/references/nestjs-typescript/modules-dtos-setup.md +106 -0
  112. package/content-dist/fragments/references/nextjs-app-router/patterns.md +177 -0
  113. package/content-dist/fragments/references/nextjs-prisma-postgres/billing.md +167 -0
  114. package/content-dist/fragments/references/nextjs-trpc-drizzle/data-and-auth.md +121 -0
  115. package/content-dist/fragments/references/nextjs-trpc-drizzle/trpc-setup.md +62 -0
  116. package/content-dist/fragments/references/nodejs-express-typescript/config-and-tokens.md +48 -0
  117. package/content-dist/fragments/references/nodejs-express-typescript/middleware.md +108 -0
  118. package/content-dist/fragments/references/notificacoes-multicanal/patterns.md +78 -0
  119. package/content-dist/fragments/references/nuxt3-tailwind/server-routes.md +79 -0
  120. package/content-dist/fragments/references/nuxt3-tailwind/state-and-fetching.md +129 -0
  121. package/content-dist/fragments/references/openai-api-integration/calls.md +210 -0
  122. package/content-dist/fragments/references/openai-api-integration/client-and-cost.md +71 -0
  123. package/content-dist/fragments/references/pagamentos-brasil/gateways-reconciliation.md +92 -0
  124. package/content-dist/fragments/references/pagamentos-brasil/pix-boleto.md +115 -0
  125. package/content-dist/fragments/references/plataforma-conteudo/patterns.md +74 -0
  126. package/content-dist/fragments/references/python-fastapi/dependency-injection.md +99 -0
  127. package/content-dist/fragments/references/python-fastapi/settings-and-tasks.md +47 -0
  128. package/content-dist/fragments/references/rag-pipeline/ingestion.md +92 -0
  129. package/content-dist/fragments/references/rag-pipeline/retrieval-and-eval.md +148 -0
  130. package/content-dist/fragments/references/react-express-monolith/auth-and-client.md +110 -0
  131. package/content-dist/fragments/references/react-express-monolith/monorepo.md +71 -0
  132. package/content-dist/fragments/references/react-native-expo/native-patterns.md +103 -0
  133. package/content-dist/fragments/references/react-native-expo/navigation-and-auth.md +55 -0
  134. package/content-dist/fragments/references/react-ts-zustand-query/store-and-query.md +152 -0
  135. package/content-dist/fragments/references/react-typescript/feature-module.md +64 -0
  136. package/content-dist/fragments/references/react-typescript/forms-and-state.md +69 -0
  137. package/content-dist/fragments/references/react-typescript/recipes.md +37 -0
  138. package/content-dist/fragments/references/react-typescript/testing.md +40 -0
  139. package/content-dist/fragments/references/realtime-websockets/patterns.md +92 -0
  140. package/content-dist/fragments/references/relatorios-analytics/patterns.md +81 -0
  141. package/content-dist/fragments/references/remix-express-full/auth-and-uploads.md +88 -0
  142. package/content-dist/fragments/references/remix-express-full/express-server.md +54 -0
  143. package/content-dist/fragments/references/remix-typescript/auth-and-db.md +68 -0
  144. package/content-dist/fragments/references/remix-typescript/loaders-and-actions.md +98 -0
  145. package/content-dist/fragments/references/rust-axum/error-and-state.md +99 -0
  146. package/content-dist/fragments/references/rust-axum/handlers.md +87 -0
  147. package/content-dist/fragments/references/saas-stripe-billing/patterns.md +86 -0
  148. package/content-dist/fragments/references/serverless-lambda/handler-patterns.md +107 -0
  149. package/content-dist/fragments/references/sistema-pagamentos/pitfalls.md +54 -0
  150. package/content-dist/fragments/references/spring-boot/service-and-data.md +96 -0
  151. package/content-dist/fragments/references/spring-boot/web-layer.md +100 -0
  152. package/content-dist/fragments/references/supabase-nextjs/clients-and-middleware.md +102 -0
  153. package/content-dist/fragments/references/supabase-nextjs/rls-and-storage.md +86 -0
  154. package/content-dist/fragments/references/svelte-sveltekit/hooks-and-state.md +67 -0
  155. package/content-dist/fragments/references/svelte-sveltekit/load-and-actions.md +80 -0
  156. package/content-dist/fragments/references/t3-stack/routers-and-callers.md +75 -0
  157. package/content-dist/fragments/references/t3-stack/trpc-setup.md +60 -0
  158. package/content-dist/fragments/references/terraform-aws/modules-and-ci.md +114 -0
  159. package/content-dist/fragments/references/terraform-aws/state-and-workspaces.md +66 -0
  160. package/content-dist/fragments/references/turborepo-monorepo/pipeline-and-packages.md +84 -0
  161. package/content-dist/fragments/references/upload-midia/patterns.md +80 -0
  162. package/content-dist/fragments/references/vector-search-pinecone/client-and-upsert.md +98 -0
  163. package/content-dist/fragments/references/vector-search-pinecone/query-and-hybrid.md +81 -0
  164. package/content-dist/fragments/references/vps-deploy-producao/compose-prod.md +97 -0
  165. package/content-dist/fragments/references/vps-deploy-producao/proxy-and-operations.md +118 -0
  166. package/content-dist/fragments/references/vscode-extension/activation-and-tree.md +98 -0
  167. package/content-dist/fragments/references/vscode-extension/webview-csp.md +57 -0
  168. package/content-dist/fragments/references/vue3-pinia-vite/components-and-stores.md +73 -0
  169. package/content-dist/fragments/references/vue3-pinia-vite/queries-forms-testing.md +100 -0
  170. package/content-dist/fragments/references/whatsapp-business/patterns.md +107 -0
  171. package/content-dist/fragments/references/wordpress/hooks-and-security.md +92 -0
  172. package/content-dist/fragments/references/wordpress/wp-cli-gates.md +64 -0
  173. package/content-dist/fragments/stack/angular-ngrx.md +75 -0
  174. package/content-dist/fragments/stack/ansible-server-setup.md +69 -0
  175. package/content-dist/fragments/stack/astro-static.md +72 -0
  176. package/content-dist/fragments/stack/chrome-extension-mv3.md +66 -0
  177. package/content-dist/fragments/stack/cli-typescript-commander.md +66 -0
  178. package/content-dist/fragments/stack/cloud-run-gcp.md +63 -0
  179. package/content-dist/fragments/stack/computer-vision-yolo.md +62 -0
  180. package/content-dist/fragments/stack/convex-react.md +65 -0
  181. package/content-dist/fragments/stack/data-pipeline-airflow.md +64 -0
  182. package/content-dist/fragments/stack/delphi-object-pascal.md +63 -0
  183. package/content-dist/fragments/stack/django-drf-celery.md +63 -0
  184. package/content-dist/fragments/stack/docker-compose-dev.md +69 -0
  185. package/content-dist/fragments/stack/dotnet-aspnet.md +62 -0
  186. package/content-dist/fragments/stack/electron-app.md +70 -0
  187. package/content-dist/fragments/stack/elixir-phoenix.md +65 -0
  188. package/content-dist/fragments/stack/fine-tuning-huggingface.md +69 -0
  189. package/content-dist/fragments/stack/flutter.md +61 -0
  190. package/content-dist/fragments/stack/github-actions-cicd.md +73 -0
  191. package/content-dist/fragments/stack/go-chi-gorm.md +73 -0
  192. package/content-dist/fragments/stack/graphql-apollo.md +70 -0
  193. package/content-dist/fragments/stack/hono-bun.md +62 -0
  194. package/content-dist/fragments/stack/kubernetes-helm.md +67 -0
  195. package/content-dist/fragments/stack/langchain-python-agent.md +64 -0
  196. package/content-dist/fragments/stack/laravel.md +64 -0
  197. package/content-dist/fragments/stack/llm-ops-production.md +63 -0
  198. package/content-dist/fragments/stack/microservices-docker.md +70 -0
  199. package/content-dist/fragments/stack/ml-fastapi-serving.md +64 -0
  200. package/content-dist/fragments/stack/ml-training-pipeline.md +67 -0
  201. package/content-dist/fragments/stack/monitoring-observability.md +68 -0
  202. package/content-dist/fragments/stack/nestjs-typescript.md +68 -0
  203. package/content-dist/fragments/stack/nextjs-app-router.md +65 -0
  204. package/content-dist/fragments/stack/nextjs-prisma-postgres.md +61 -0
  205. package/content-dist/fragments/stack/nextjs-trpc-drizzle.md +63 -0
  206. package/content-dist/fragments/stack/nodejs-express-typescript.md +60 -0
  207. package/content-dist/fragments/stack/nuxt3-tailwind.md +62 -0
  208. package/content-dist/fragments/stack/openai-api-integration.md +58 -0
  209. package/content-dist/fragments/stack/python-fastapi.md +64 -0
  210. package/content-dist/fragments/stack/rag-pipeline.md +62 -0
  211. package/content-dist/fragments/stack/react-express-monolith.md +61 -0
  212. package/content-dist/fragments/stack/react-native-expo.md +68 -0
  213. package/content-dist/fragments/stack/react-ts-zustand-query.md +64 -0
  214. package/content-dist/fragments/stack/react-typescript.md +73 -0
  215. package/content-dist/fragments/stack/remix-express-full.md +63 -0
  216. package/content-dist/fragments/stack/remix-typescript.md +66 -0
  217. package/content-dist/fragments/stack/rust-axum.md +63 -0
  218. package/content-dist/fragments/stack/serverless-lambda.md +65 -0
  219. package/content-dist/fragments/stack/spring-boot.md +63 -0
  220. package/content-dist/fragments/stack/supabase-nextjs.md +64 -0
  221. package/content-dist/fragments/stack/svelte-sveltekit.md +67 -0
  222. package/content-dist/fragments/stack/t3-stack.md +63 -0
  223. package/content-dist/fragments/stack/terraform-aws.md +65 -0
  224. package/content-dist/fragments/stack/turborepo-monorepo.md +61 -0
  225. package/content-dist/fragments/stack/vector-search-pinecone.md +63 -0
  226. package/content-dist/fragments/stack/vps-deploy-producao.md +64 -0
  227. package/content-dist/fragments/stack/vscode-extension.md +64 -0
  228. package/content-dist/fragments/stack/vue3-pinia-vite.md +65 -0
  229. package/content-dist/fragments/stack/wordpress.md +63 -0
  230. package/content-dist/skills/invi-commit/SKILL.md +85 -0
  231. package/content-dist/skills/invi-journal/SKILL.md +67 -0
  232. package/content-dist/skills/invi-map/SKILL.md +118 -0
  233. package/content-dist/skills/invi-mode/SKILL.md +176 -0
  234. package/content-dist/skills/invi-pr/SKILL.md +142 -0
  235. package/content-dist/skills/invi-qa/SKILL.md +75 -0
  236. package/content-dist/skills/invi-refactor-legacy/SKILL.md +90 -0
  237. package/content-dist/skills/invi-review/SKILL.md +83 -0
  238. package/content-dist/skills/invi-security/SKILL.md +89 -0
  239. package/content-dist/skills/invi-status/SKILL.md +72 -0
  240. package/content-dist/skills/invi-task/SKILL.md +143 -0
  241. package/content-dist/skills/invi-test/SKILL.md +97 -0
  242. package/content-dist/skills/po-handoff/SKILL.md +130 -0
  243. package/content-dist/skills/po-intake/SKILL.md +115 -0
  244. package/content-dist/skills/po-lint/SKILL.md +82 -0
  245. package/content-dist/skills/po-spec/SKILL.md +138 -0
  246. package/content-dist/skills/po-status/SKILL.md +130 -0
  247. package/content-dist/skills/po-verify/SKILL.md +124 -0
  248. package/content-dist/templates/requirements/REQ-TEMPLATE.md +110 -0
  249. package/content-dist/templates/requirements/constitution-TEMPLATE.md +77 -0
  250. package/dist/baseline.d.ts +21 -0
  251. package/dist/baseline.d.ts.map +1 -0
  252. package/dist/baseline.js +43 -0
  253. package/dist/baseline.js.map +1 -0
  254. package/dist/cli.d.ts +15 -0
  255. package/dist/cli.d.ts.map +1 -0
  256. package/dist/cli.js +345 -0
  257. package/dist/cli.js.map +1 -0
  258. package/dist/commands/doctor.d.ts +31 -0
  259. package/dist/commands/doctor.d.ts.map +1 -0
  260. package/dist/commands/doctor.js +173 -0
  261. package/dist/commands/doctor.js.map +1 -0
  262. package/dist/commands/export.d.ts +49 -0
  263. package/dist/commands/export.d.ts.map +1 -0
  264. package/dist/commands/export.js +95 -0
  265. package/dist/commands/export.js.map +1 -0
  266. package/dist/commands/gate.d.ts +42 -0
  267. package/dist/commands/gate.d.ts.map +1 -0
  268. package/dist/commands/gate.js +97 -0
  269. package/dist/commands/gate.js.map +1 -0
  270. package/dist/commands/init.d.ts +88 -0
  271. package/dist/commands/init.d.ts.map +1 -0
  272. package/dist/commands/init.js +540 -0
  273. package/dist/commands/init.js.map +1 -0
  274. package/dist/commands/journalCmd.d.ts +47 -0
  275. package/dist/commands/journalCmd.d.ts.map +1 -0
  276. package/dist/commands/journalCmd.js +89 -0
  277. package/dist/commands/journalCmd.js.map +1 -0
  278. package/dist/commands/keys.d.ts +68 -0
  279. package/dist/commands/keys.d.ts.map +1 -0
  280. package/dist/commands/keys.js +240 -0
  281. package/dist/commands/keys.js.map +1 -0
  282. package/dist/commands/map.d.ts +123 -0
  283. package/dist/commands/map.d.ts.map +1 -0
  284. package/dist/commands/map.js +383 -0
  285. package/dist/commands/map.js.map +1 -0
  286. package/dist/commands/plan.d.ts +28 -0
  287. package/dist/commands/plan.d.ts.map +1 -0
  288. package/dist/commands/plan.js +64 -0
  289. package/dist/commands/plan.js.map +1 -0
  290. package/dist/commands/req.d.ts +92 -0
  291. package/dist/commands/req.d.ts.map +1 -0
  292. package/dist/commands/req.js +270 -0
  293. package/dist/commands/req.js.map +1 -0
  294. package/dist/commands/review.d.ts +40 -0
  295. package/dist/commands/review.d.ts.map +1 -0
  296. package/dist/commands/review.js +101 -0
  297. package/dist/commands/review.js.map +1 -0
  298. package/dist/commands/run.d.ts +33 -0
  299. package/dist/commands/run.d.ts.map +1 -0
  300. package/dist/commands/run.js +151 -0
  301. package/dist/commands/run.js.map +1 -0
  302. package/dist/commands/ship.d.ts +45 -0
  303. package/dist/commands/ship.d.ts.map +1 -0
  304. package/dist/commands/ship.js +252 -0
  305. package/dist/commands/ship.js.map +1 -0
  306. package/dist/commands/status.d.ts +36 -0
  307. package/dist/commands/status.d.ts.map +1 -0
  308. package/dist/commands/status.js +152 -0
  309. package/dist/commands/status.js.map +1 -0
  310. package/dist/commands/sync.d.ts +91 -0
  311. package/dist/commands/sync.d.ts.map +1 -0
  312. package/dist/commands/sync.js +331 -0
  313. package/dist/commands/sync.js.map +1 -0
  314. package/dist/commands/syncCommits.d.ts +56 -0
  315. package/dist/commands/syncCommits.d.ts.map +1 -0
  316. package/dist/commands/syncCommits.js +97 -0
  317. package/dist/commands/syncCommits.js.map +1 -0
  318. package/dist/commands/task.d.ts +108 -0
  319. package/dist/commands/task.d.ts.map +1 -0
  320. package/dist/commands/task.js +217 -0
  321. package/dist/commands/task.js.map +1 -0
  322. package/dist/commands/update.d.ts +92 -0
  323. package/dist/commands/update.d.ts.map +1 -0
  324. package/dist/commands/update.js +541 -0
  325. package/dist/commands/update.js.map +1 -0
  326. package/dist/commands/verifyTask.d.ts +50 -0
  327. package/dist/commands/verifyTask.d.ts.map +1 -0
  328. package/dist/commands/verifyTask.js +172 -0
  329. package/dist/commands/verifyTask.js.map +1 -0
  330. package/dist/content.d.ts +128 -0
  331. package/dist/content.d.ts.map +1 -0
  332. package/dist/content.js +177 -0
  333. package/dist/content.js.map +1 -0
  334. package/dist/detect.d.ts +122 -0
  335. package/dist/detect.d.ts.map +1 -0
  336. package/dist/detect.js +594 -0
  337. package/dist/detect.js.map +1 -0
  338. package/dist/events.d.ts +36 -0
  339. package/dist/events.d.ts.map +1 -0
  340. package/dist/events.js +76 -0
  341. package/dist/events.js.map +1 -0
  342. package/dist/frontmatter.d.ts +15 -0
  343. package/dist/frontmatter.d.ts.map +1 -0
  344. package/dist/frontmatter.js +74 -0
  345. package/dist/frontmatter.js.map +1 -0
  346. package/dist/i18n/en.d.ts +421 -0
  347. package/dist/i18n/en.d.ts.map +1 -0
  348. package/dist/i18n/en.js +443 -0
  349. package/dist/i18n/en.js.map +1 -0
  350. package/dist/i18n/index.d.ts +40 -0
  351. package/dist/i18n/index.d.ts.map +1 -0
  352. package/dist/i18n/index.js +66 -0
  353. package/dist/i18n/index.js.map +1 -0
  354. package/dist/i18n/pt-BR.d.ts +11 -0
  355. package/dist/i18n/pt-BR.d.ts.map +1 -0
  356. package/dist/i18n/pt-BR.js +435 -0
  357. package/dist/i18n/pt-BR.js.map +1 -0
  358. package/dist/identity.d.ts +78 -0
  359. package/dist/identity.d.ts.map +1 -0
  360. package/dist/identity.js +152 -0
  361. package/dist/identity.js.map +1 -0
  362. package/dist/index.d.ts +79 -0
  363. package/dist/index.d.ts.map +1 -0
  364. package/dist/index.js +48 -0
  365. package/dist/index.js.map +1 -0
  366. package/dist/insights.d.ts +86 -0
  367. package/dist/insights.d.ts.map +1 -0
  368. package/dist/insights.js +199 -0
  369. package/dist/insights.js.map +1 -0
  370. package/dist/interview.d.ts +81 -0
  371. package/dist/interview.d.ts.map +1 -0
  372. package/dist/interview.js +283 -0
  373. package/dist/interview.js.map +1 -0
  374. package/dist/inventory.d.ts +79 -0
  375. package/dist/inventory.d.ts.map +1 -0
  376. package/dist/inventory.js +86 -0
  377. package/dist/inventory.js.map +1 -0
  378. package/dist/journal.d.ts +22 -0
  379. package/dist/journal.d.ts.map +1 -0
  380. package/dist/journal.js +88 -0
  381. package/dist/journal.js.map +1 -0
  382. package/dist/migrations/legacyNames.d.ts +45 -0
  383. package/dist/migrations/legacyNames.d.ts.map +1 -0
  384. package/dist/migrations/legacyNames.js +118 -0
  385. package/dist/migrations/legacyNames.js.map +1 -0
  386. package/dist/plan.d.ts +42 -0
  387. package/dist/plan.d.ts.map +1 -0
  388. package/dist/plan.js +126 -0
  389. package/dist/plan.js.map +1 -0
  390. package/dist/render/agents.d.ts +327 -0
  391. package/dist/render/agents.d.ts.map +1 -0
  392. package/dist/render/agents.js +356 -0
  393. package/dist/render/agents.js.map +1 -0
  394. package/dist/render/claudeMd.d.ts +29 -0
  395. package/dist/render/claudeMd.d.ts.map +1 -0
  396. package/dist/render/claudeMd.js +110 -0
  397. package/dist/render/claudeMd.js.map +1 -0
  398. package/dist/render/githooks.d.ts +41 -0
  399. package/dist/render/githooks.d.ts.map +1 -0
  400. package/dist/render/githooks.js +168 -0
  401. package/dist/render/githooks.js.map +1 -0
  402. package/dist/render/markers.d.ts +13 -0
  403. package/dist/render/markers.d.ts.map +1 -0
  404. package/dist/render/markers.js +35 -0
  405. package/dist/render/markers.js.map +1 -0
  406. package/dist/render/requirements.d.ts +56 -0
  407. package/dist/render/requirements.d.ts.map +1 -0
  408. package/dist/render/requirements.js +86 -0
  409. package/dist/render/requirements.js.map +1 -0
  410. package/dist/render/settings.d.ts +43 -0
  411. package/dist/render/settings.d.ts.map +1 -0
  412. package/dist/render/settings.js +94 -0
  413. package/dist/render/settings.js.map +1 -0
  414. package/dist/render/transparency.d.ts +7 -0
  415. package/dist/render/transparency.d.ts.map +1 -0
  416. package/dist/render/transparency.js +164 -0
  417. package/dist/render/transparency.js.map +1 -0
  418. package/dist/requirements.d.ts +84 -0
  419. package/dist/requirements.d.ts.map +1 -0
  420. package/dist/requirements.js +229 -0
  421. package/dist/requirements.js.map +1 -0
  422. package/dist/sizing.d.ts +63 -0
  423. package/dist/sizing.d.ts.map +1 -0
  424. package/dist/sizing.js +104 -0
  425. package/dist/sizing.js.map +1 -0
  426. package/dist/tasks.d.ts +199 -0
  427. package/dist/tasks.d.ts.map +1 -0
  428. package/dist/tasks.js +320 -0
  429. package/dist/tasks.js.map +1 -0
  430. package/dist/util/diff3.d.ts +26 -0
  431. package/dist/util/diff3.d.ts.map +1 -0
  432. package/dist/util/diff3.js +112 -0
  433. package/dist/util/diff3.js.map +1 -0
  434. package/dist/util/fsx.d.ts +33 -0
  435. package/dist/util/fsx.d.ts.map +1 -0
  436. package/dist/util/fsx.js +153 -0
  437. package/dist/util/fsx.js.map +1 -0
  438. package/dist/util/git.d.ts +58 -0
  439. package/dist/util/git.d.ts.map +1 -0
  440. package/dist/util/git.js +171 -0
  441. package/dist/util/git.js.map +1 -0
  442. package/dist/util/merge.d.ts +27 -0
  443. package/dist/util/merge.d.ts.map +1 -0
  444. package/dist/util/merge.js +78 -0
  445. package/dist/util/merge.js.map +1 -0
  446. package/dist/util/out.d.ts +18 -0
  447. package/dist/util/out.d.ts.map +1 -0
  448. package/dist/util/out.js +23 -0
  449. package/dist/util/out.js.map +1 -0
  450. package/dist/util/proc.d.ts +12 -0
  451. package/dist/util/proc.d.ts.map +1 -0
  452. package/dist/util/proc.js +45 -0
  453. package/dist/util/proc.js.map +1 -0
  454. package/dist/util/registry.d.ts +58 -0
  455. package/dist/util/registry.d.ts.map +1 -0
  456. package/dist/util/registry.js +240 -0
  457. package/dist/util/registry.js.map +1 -0
  458. package/dist/verify.d.ts +52 -0
  459. package/dist/verify.d.ts.map +1 -0
  460. package/dist/verify.js +205 -0
  461. package/dist/verify.js.map +1 -0
  462. package/dist/version.d.ts +5 -0
  463. package/dist/version.d.ts.map +1 -0
  464. package/dist/version.js +18 -0
  465. package/dist/version.js.map +1 -0
  466. package/package.json +63 -0
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: invi-qa
3
+ description: Quality assurance of the current branch against the task's acceptance criteria — derives happy/edge/invalid/permission cases per criterion plus the client's catastrophic-risk case, runs whatever build/tests the environment allows, checks fragile-area regressions, and writes a verdict report. Use when the user asks for QA, to validate the delivery, or as GATE 4 of the pipeline before commit/PR.
4
+ ---
5
+
6
+ # invi-qa — quality assurance (GATE 4)
7
+
8
+ Confirm the delivery does what the task asked, without regressions. Think as the user AND as the
9
+ adversary.
10
+
11
+ ## Standing rules
12
+
13
+ - Communicate with the user in the language configured in `.invictus/manifest.json` (`language.render`, default pt-BR); write `qa.md` in that language. Output-block keys and verdicts stay EN.
14
+ - Config from the manifest: `project.baseBranch`, `project.ticketPattern`, `project.catastrophicRisk`, `project.workspaces.<ws>.{test,build,lint}`. Manifest missing → stop, point to `invi init`. Field missing → ask, never guess silently.
15
+ - **Honesty:** whatever the environment can't run is reported `not verified in this environment` — never fake an approval, never invent a bug.
16
+ - **Never edit production code here.** A bug found in QA goes back to the stack agents, then `/invi-test`, then this gate re-runs (under orchestration: max 2 fix cycles, then `blocked`).
17
+
18
+ ## Procedure
19
+
20
+ ### 1. Recover the acceptance criteria
21
+
22
+ In this order: `.invictus/tasks/<id>/task.json` (`acceptance_criteria[]`) → `.invictus/tasks/<id>/plan.md`
23
+ checklist → ask the user (interactive). Resolve `<id>` with **`invi task current --json`**, never by
24
+ running the ticket pattern against the branch yourself: a pattern like `\d+` matches the date inside
25
+ `adhoc-20260902-1` and hands back `20260902`, an id whose task does not exist. When no criteria are
26
+ found anywhere: record "no formal criteria — validated against the description" in the report and
27
+ validate against the description — interactive too, not only headless. A team without written criteria
28
+ still deserves a QA pass; refusing to run one teaches them to skip QA, not to write criteria.
29
+
30
+ ### 2. Delegate to the QA agent
31
+
32
+ Delegate to the **`invi-qa` agent** in `.claude/agents/` with the criteria and the full delta
33
+ (`git diff <baseBranch>...HEAD` plus uncommitted work via `git diff HEAD`). If the agent is not installed,
34
+ run QA inline and say so. The QA pass:
35
+
36
+ - **Derives cases per criterion**: happy path · edge · invalid input · permission/authorization — and, ALWAYS, the client's **catastrophic-risk case** (`project.catastrophicRisk`), even when no criterion names it; if the change cannot plausibly touch that risk, record `RISK_CASE: n/a` with one line of justification.
37
+ - **Runs what the environment allows**, using the real per-workspace commands from the manifest (`build`, `test`, `lint` of the touched workspaces). Nothing runnable ⇒ every automated item is `not verified`, with the exact command lines for dev/CI.
38
+ - **Checks regressions** in the fragile areas the installed fragments/agents name (and any area the plan flagged), prioritizing them over generic coverage.
39
+ - Verifies each criterion with **evidence** (test output, executed command, file/line of the implementing code) — a criterion with no evidence is `not verified`, not `ok`.
40
+
41
+ ### 3. Write the verdict report
42
+
43
+ Write `.invictus/tasks/<id>/qa.md`: criterion × result table (with evidence), bugs found (reproduction
44
+ steps, expected vs. actual), regression risks, not-verified items, and the verdict:
45
+
46
+ - `APPROVE` — all criteria ok (or explicitly waived by the user), no bugs.
47
+ - `WITH_RESERVATIONS` — criteria ok, but not-verified items or non-blocking observations remain; list them.
48
+ - `REJECT` — any criterion failed or a bug was found; list exactly what to fix.
49
+
50
+ ### 4. Gate event + route forward
51
+
52
+ - Log every run — standalone included — when the task exists under `.invictus/tasks/`:
53
+ `invi gate qa <task-id> --verdict pass|pass-with-reservations|fail --loop <n> --details '{"criteria_ok":"5/6"}'`
54
+ (`APPROVE` → `pass`, `WITH_RESERVATIONS` → `pass-with-reservations` — both advance the task to `qa_ok`;
55
+ `REJECT` → `fail`). Verb unavailable → walk the PIPELINE.md §4 ladder; under orchestration
56
+ `invi-mode` does the logging.
57
+ - **APPROVE / WITH_RESERVATIONS** → `/invi-commit` then `/invi-pr`. Reservations travel with the PR body.
58
+ - **REJECT** → back to implementation + `/invi-test`; status sync to any tracker happens outside this skill (orchestrator/human).
59
+
60
+ ## Output block
61
+
62
+ End with (grammar: `content/PIPELINE.md` §5):
63
+
64
+ ```INVICTUS-RESULT
65
+ BLOCK: QA
66
+ TASK: <ticket id>
67
+ VERDICT: APPROVE | WITH_RESERVATIONS | REJECT
68
+ CRITERIA_OK: <n>/<total>
69
+ BUGS: <n>
70
+ RISK_CASE: pass | fail | not-verified | n/a
71
+ NOT_VERIFIED: <list or ->
72
+ REPORT: .invictus/tasks/<id>/qa.md
73
+ LOOP: <n>
74
+ NEXT: <one line — on APPROVE: /invi-commit; on REJECT: the fix list>
75
+ ```
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: invi-refactor-legacy
3
+ description: Safe-refactoring mode for existing code — characterization tests first, Strangler Fig instead of rewrites, one concern per commit, zero behavior changes. Use when restructuring working code, paying down technical debt, adding types to untyped JavaScript, extracting functions, or splitting god files. NOT for greenfield features or rewrites from scratch.
4
+ ---
5
+
6
+ # invi-refactor-legacy — refactoring mode
7
+
8
+ Standing rule: communicate with the user in the language configured in `.invictus/manifest.json` (`language.render`, default pt-BR). Code identifiers and messages follow the neighboring code's language.
9
+
10
+ Improve the structure of existing code without changing its observable behavior. These rules are modal: they apply while this skill is active and must never stand in normal feature sessions (a permanent "PR contains zero feature changes" gate would poison feature work).
11
+
12
+ ## Objectives
13
+
14
+ - Improve code health without breaking functionality.
15
+ - Increase test coverage before and during refactoring.
16
+ - Make changes that are reviewable and reversible.
17
+ - Leave code better than found (Boy Scout Rule) and document decisions along the way.
18
+
19
+ ## Approach rules
20
+
21
+ 1. **Test before you touch.** No tests on the code you are about to change? Write characterization tests first — tests that pin current behavior, even where that behavior is wrong.
22
+ 2. **Strangler Fig, never big-bang.** Build the new implementation alongside the old, redirect traffic gradually, then delete the old code. Never leave both running indefinitely.
23
+ 3. **One concern per commit.** Each commit does exactly one thing: rename, extract, move, or simplify. Never mix refactoring with behavior changes in the same commit.
24
+ 4. **Red-Green-Refactor.** When adding tests: write a failing test → make it pass → refactor. Never skip the red phase.
25
+ 5. **Preserve the public interface.** Internal restructuring is safe; changing signatures or return shapes is a breaking change — handle it separately with a deprecation path.
26
+ 6. **Typing untyped JavaScript:** start at the leaf utilities and work inward. Use `unknown` instead of `any`. Enable `strict` in tsconfig from day one — "strict later" never happens.
27
+ 7. **Boy Scout Rule.** Every touched file ends slightly better than it started — never worse.
28
+ 8. **Refactor vs rewrite:** refactor when the logic is sound but messy; rewrite only when the logic is broken or the architecture cannot carry future requirements. Default to refactoring — rewrites run roughly 3× over estimate.
29
+ 9. **Checkpoint each stage.** After each completed, gate-passing stage (e.g. characterization tests in place; extraction done), run the invi-journal skill before starting the next stage.
30
+
31
+ ## If you encounter → then
32
+
33
+ | If you encounter | Then |
34
+ |------------------|------|
35
+ | A function over ~50 lines | Extract sub-functions with descriptive names — one job each |
36
+ | A file over ~300 lines | Split along natural module boundaries; keep the original as a re-export barrel temporarily |
37
+ | Magic numbers or strings | Extract to named constants (top of file or the constants module) |
38
+ | Conditionals nested 3+ levels | Invert with early returns / guard clauses |
39
+ | `// TODO` or `// HACK` comments | Open a ticket for it; fix in this PR only if in scope |
40
+ | `any` in TypeScript | Replace with the correct type; if unknown, use `unknown` plus a type guard |
41
+ | Logic duplicated in 3+ places | Extract a shared utility (at 2 occurrences, wait for the third) |
42
+ | A class doing 5+ unrelated things | Apply Single Responsibility — split it |
43
+ | Async code without error handling | Add try/catch with explicit error types; never swallow errors |
44
+ | Commented-out code | Delete it — git history exists |
45
+
46
+ ## Do not
47
+
48
+ - DO NOT refactor and add features in the same branch/PR.
49
+ - DO NOT rename a public API or database column without a deprecation path.
50
+ - DO NOT let "while I'm here…" turn a refactoring PR into a feature PR.
51
+ - DO NOT remove code you don't understand — understand it first.
52
+ - DO NOT use `any` as a typing shortcut — it defeats the purpose.
53
+ - DO NOT assume tests pass because CI passed before — run them locally.
54
+ - DO NOT big-bang an entire module in one PR — split into layered PRs.
55
+ - DO NOT delete old code until the new path is verified in production (Strangler Fig).
56
+
57
+ ## Output format
58
+
59
+ For each refactoring session produce:
60
+
61
+ 1. **Summary of changes** — bullets of what changed and why.
62
+ 2. **Before/after snippets** — for each significant change.
63
+ 3. **Test coverage delta** — coverage before vs after.
64
+ 4. **Open items** — things noticed but deliberately left for follow-up tickets.
65
+ 5. **Risks** — changes with non-obvious side-effect potential.
66
+
67
+ Commit message shape (conventional format + ticket join-key from `base.md`):
68
+
69
+ ```
70
+ refactor(auth): extract token validation to pure function
71
+
72
+ - Moved token parsing from AuthMiddleware into validateToken()
73
+ - Added unit tests for all token edge cases
74
+ - No behavior change — same logic, same error messages
75
+
76
+ refs tk342
77
+ ```
78
+
79
+ ## Quality gates
80
+
81
+ - [ ] All existing tests pass after EVERY commit, not just at the end.
82
+ - [ ] No new `any` types introduced.
83
+ - [ ] Every extracted function is self-documenting by name (or carries a doc comment).
84
+ - [ ] No file ends longer than it started, or the PR description justifies it.
85
+ - [ ] Test coverage did not decrease.
86
+ - [ ] The PR contains zero feature changes — pure refactoring.
87
+ - [ ] `git diff --stat` shows a reviewable file count (not 50+ files in one PR).
88
+ - [ ] Reviewed by someone who knows the original code.
89
+ - [ ] No dead code (unreachable branches, unused variables) remains.
90
+ - [ ] Tech-debt tracker / changelog updated when applicable.
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: invi-review
3
+ description: Code review of the current branch delta against the project's conventions — hunts bugs, pattern violations, and quality issues on a severity ladder topped by the client's catastrophic risk; verdict APPROVE, WITH-RESERVATIONS, or BLOCK, with optional consented auto-fix of mechanical findings. Use when the user asks to review / code review the changes, before opening a PR, or as GATE 3 of the pipeline.
4
+ ---
5
+
6
+ # invi-review — code review (GATE 3)
7
+
8
+ Catch mechanically what a hurried human read misses: correctness bugs, convention violations, and the
9
+ project's named risks — most severe first, every finding anchored to `file:line` with a concrete failure
10
+ scenario.
11
+
12
+ ## Standing rules
13
+
14
+ - Communicate with the user in the language configured in `.invictus/manifest.json` (`language.render`, default pt-BR). Output-block keys and verdicts stay EN.
15
+ - Config from the manifest: `project.baseBranch`, `project.catastrophicRisk`. Manifest missing → stop, point to `invi init`. Field missing → ask, never guess silently.
16
+ - **Honesty:** if there is nothing relevant to report, say so clearly — never invent a finding. If a check can't run here, mark it `not verified`.
17
+ - Scope: the branch delta. Pre-existing problems outside the diff are observations, never blocking findings.
18
+
19
+ ## Procedure
20
+
21
+ ### 1. Collect the delta
22
+
23
+ ```bash
24
+ git fetch origin <baseBranch> # tolerate failure offline — say so
25
+ git diff <baseBranch>...HEAD --stat
26
+ git diff <baseBranch>...HEAD
27
+ git status --short && git diff HEAD # uncommitted work counts too
28
+ ```
29
+
30
+ ### 2. Delegate to the reviewer
31
+
32
+ Delegate to the **`invi-reviewer` agent** in `.claude/agents/`, passing the range and the acceptance
33
+ criteria (`.invictus/tasks/<id>/task.json` when present). If the agent is not installed, review inline
34
+ with the ladder below and say so.
35
+
36
+ Severity ladder (the project-specific 🟠 pattern list comes from the installed fragments/agents — read the
37
+ neighboring conventions, don't invent them):
38
+
39
+ - **BLOCKER 🔴** — item #1 is always the client's catastrophic risk (`project.catastrophicRisk`); then: the change does not do what the task says (correctness bug with a reproducible scenario), data loss/corruption paths, security regressions the security gate missed (secret, injection, missing authz), broken build.
40
+ - **HIGH 🟠** — violation of a mandatory project pattern (error-shape convention, forbidden direct HTTP client, layer/import boundary, editing generated files, naming conventions the repo enforces), API contract break without a deprecation path, swallowed errors on critical paths.
41
+ - **MEDIUM 🟡** — new business logic without tests, blocking async, god-file growing further, wrong HTTP status semantics, N+1 or obviously quadratic hot path.
42
+ - **LOW 🔵** — leftover `console.log`/`debugger`/commented-out code, TODO/FIXME without ticket, naming/style drift.
43
+
44
+ For each finding: `file:line` · the problem · the concrete failure scenario ("with inputs X, Y happens") · the suggested fix. Also verify **neighbor-pattern conformity**: the new code must look like its neighbors — flag gratuitous novelty.
45
+
46
+ ### 3. Verdict
47
+
48
+ - Any **BLOCKER** ⇒ `BLOCK`.
49
+ - No blockers, but HIGH items to resolve before merge ⇒ `WITH_RESERVATIONS` (list exactly what must be fixed — that list is `MUST_FIX`).
50
+ - Otherwise ⇒ `APPROVE`.
51
+
52
+ Present findings most severe first, then the verdict and the minimal must-fix list. Record the result in
53
+ `.invictus/tasks/<id>/plan.md` when a plan exists.
54
+
55
+ ### 4. Auto-fix (consented, mechanical only)
56
+
57
+ With the user's explicit consent, apply mechanical 🔵/🟠 fixes (remove `console.log`, fix an annotation,
58
+ move a literal to config). Logic fixes (🔴 correctness) go back to the stack agents and must be re-tested
59
+ (`/invi-test`) before this gate re-runs. Under orchestration: max 2 fix cycles, then `blocked`.
60
+
61
+ ### 5. Gate event
62
+
63
+ Log every run — standalone included — when the task exists under `.invictus/tasks/`:
64
+ `invi gate review <task-id> --verdict pass|pass-with-reservations|fail --loop <n> --details '{"findings":{…}}'`
65
+ (`APPROVE` → `pass`, `WITH_RESERVATIONS` → `pass-with-reservations` — both advance the task to
66
+ `review_ok`; `BLOCK` → `fail`). Verb unavailable → walk the PIPELINE.md §4 ladder; under orchestration
67
+ `invi-mode` does the logging.
68
+
69
+ ## Output block
70
+
71
+ End with (grammar: `content/PIPELINE.md` §5):
72
+
73
+ ```INVICTUS-RESULT
74
+ BLOCK: REVIEW
75
+ TASK: <ticket id or ->
76
+ RANGE: <base>...HEAD + worktree
77
+ VERDICT: APPROVE | WITH_RESERVATIONS | BLOCK
78
+ FINDINGS: blocker=<n> high=<n> medium=<n> low=<n>
79
+ MUST_FIX: <n>
80
+ AUTO_FIXED: <n or ->
81
+ LOOP: <n>
82
+ NEXT: <one line — on APPROVE/WITH_RESERVATIONS: GATE 4 /invi-qa; on BLOCK: the minimal fix list>
83
+ ```
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: invi-security
3
+ description: Security gate for the current branch — hunts secrets, injection, broken authorization/IDOR, tenant-isolation breaks, and dependency risk in the branch delta, with the client's #1 catastrophic risk as the first BLOCKER item; verdict APPROVE or BLOCK. Use before tests/review/PR, when the user asks for a security check of the changes, or as GATE 1 of the pipeline. For a whole-repo audit use a full audit skill instead — this gate examines only the diff.
4
+ ---
5
+
6
+ # invi-security — security gate (GATE 1)
7
+
8
+ Adversarial security pass over the branch delta. This gate runs FIRST in the pipeline: a security finding
9
+ invalidates everything downstream, and it is cheapest to fix before tests, review, and QA are spent on a
10
+ doomed diff.
11
+
12
+ ## Standing rules
13
+
14
+ - Communicate with the user in the language configured in `.invictus/manifest.json` (`language.render`, default pt-BR). Output-block keys and verdicts stay EN.
15
+ - Config from the manifest: `project.baseBranch`, `project.catastrophicRisk`. Manifest missing → stop, point to `invi init`. Field missing → ask, never guess silently.
16
+ - **Honesty:** if a check can't run in this environment (e.g. no dependency scanner installed), report it as `not verified` — never fake a pass. If there is nothing relevant to find, say so clearly — never invent findings.
17
+ - Scope: the branch delta only. Pre-existing issues outside the diff are noted as observations, not findings, and never block.
18
+
19
+ ## Procedure
20
+
21
+ ### 1. Collect the delta
22
+
23
+ ```bash
24
+ git fetch origin <baseBranch> # tolerate failure offline — say so
25
+ git diff <baseBranch>...HEAD --stat # committed work
26
+ git diff <baseBranch>...HEAD
27
+ git status --short # uncommitted work
28
+ git diff HEAD
29
+ ```
30
+
31
+ Gates must see committed AND uncommitted work (commits land after the gates in this pipeline).
32
+
33
+ ### 2. Delegate to the security agent
34
+
35
+ Delegate to the **`invi-security` agent** installed in `.claude/agents/`, passing the diff range and the
36
+ manifest's `catastrophicRisk`. If the agent is not installed, run the checklist below inline and say that
37
+ the specialist agent was unavailable.
38
+
39
+ Severity ladder — findings reported as `file:line`, the issue, a **concrete failure scenario**, and the fix:
40
+
41
+ - **BLOCKER 🔴** — ladder item #1 is always the client's catastrophic risk (`project.catastrophicRisk`) — e.g. a cross-tenant data leak — followed by:
42
+ - secret/credential/token committed or written into a tracked file (scan the diff for key-like names with real-looking values; placeholders like `__ENV__`, `${VAR}`, `<fill-me>` are fine),
43
+ - injection: SQL/command/template built by string concatenation from external input,
44
+ - broken authorization: endpoint/action missing its permission check; IDOR (object fetched by id without ownership/tenant filter),
45
+ - tenant-isolation break, when the project is multi-tenant: any query/cache-key/file-path missing the tenant discriminator.
46
+ - **HIGH 🟠** — dependency added/updated with a known exploited vulnerability; crypto misuse (homemade hashing of passwords, ECB, hardcoded IV/salt); missing validation at a trust boundary (webhook without signature check, upload without type/size limits); secrets logged.
47
+ - **MEDIUM 🟡** — permissive CORS on a sensitive route; missing rate limiting on auth endpoints; error responses leaking internals (stack traces, SQL); PII written to logs.
48
+ - **LOW 🔵** — debug endpoints left enabled, verbose security headers hygiene, commented-out credentials (rotate anyway), TODO-security notes.
49
+
50
+ Dependency risk: if the diff touches a lockfile/manifest, run the ecosystem's audit command when available
51
+ (e.g. `npm audit`, `pip-audit`, `dotnet list package --vulnerable`); if none is available, list the new
52
+ packages and mark the check `not verified`.
53
+
54
+ ### 3. Verdict
55
+
56
+ - Any **BLOCKER** or unresolved **HIGH** ⇒ `BLOCK`. Otherwise ⇒ `APPROVE` (MEDIUM/LOW are listed for follow-up and do not block the gate).
57
+ - Present findings most severe first. For each: `file:line`, issue, failure scenario, fix.
58
+
59
+ ### 4. Auto-fix (consented, mechanical LOW only)
60
+
61
+ With the user's explicit consent, apply **mechanical LOW fixes only** (delete a commented-out credential,
62
+ disable a debug endpoint flag, remove a verbose header). Anything touching logic, authz, queries, or
63
+ crypto goes back to the stack agents and re-enters the gate. Report `AUTO_FIXED` count.
64
+
65
+ ### 5. Bounded loop + gate event
66
+
67
+ The orchestrator re-runs this gate after fixes — max 2 fix cycles, then the pipeline goes `blocked` with a
68
+ precise report. Track the attempt in `LOOP`.
69
+
70
+ Log every run — standalone included — when the task exists under `.invictus/tasks/`:
71
+ `invi gate security <task-id> --verdict pass|fail --loop <n> --details '{"findings":{"blocker":0,"high":0,"medium":0,"low":0}}'`
72
+ (`APPROVE` → `pass`, which advances the task to `security_ok`; `BLOCK` → `fail`). Verb unavailable →
73
+ walk the PIPELINE.md §4 ladder; under orchestration `invi-mode` does the logging.
74
+
75
+ ## Output block
76
+
77
+ End with (grammar: `content/PIPELINE.md` §5):
78
+
79
+ ```INVICTUS-RESULT
80
+ BLOCK: SECURITY
81
+ TASK: <ticket id or ->
82
+ RANGE: <base>...HEAD + worktree
83
+ VERDICT: APPROVE | BLOCK
84
+ FINDINGS: blocker=<n> high=<n> medium=<n> low=<n>
85
+ AUTO_FIXED: <n or ->
86
+ NOT_VERIFIED: <list or ->
87
+ LOOP: <n>
88
+ NEXT: <one line — on APPROVE: GATE 2 /invi-test; on BLOCK: the minimal fix list>
89
+ ```
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: invi-status
3
+ description: Resume project state and propose exactly one next action — reads the rendered journal views (MEMORY.md, today's journal), the engine status from the event log via the CLI, and git state. Use when starting the day, resuming after a long pause, returning from a context switch, or onboarding into the project. Optional argument narrows the scope (e.g. "payment").
4
+ ---
5
+
6
+ # invi-status — where are we, what's next
7
+
8
+ Standing rule: communicate with the user in the language configured in `.invictus/manifest.json` (`language.render`, default pt-BR). Machine artifacts (event payloads, CLI output) stay EN.
9
+
10
+ Interactive session resume. The passive counterpart is the `session-boot` hook (it injects context automatically at session start); this skill is the deliberate, deeper version that ends in a decision.
11
+
12
+ ## Procedure
13
+
14
+ 1. **Load persistent context**, in order:
15
+ - `.invictus/journal/MEMORY.md` — the agent-facing distillate (current state, recent decisions, known traps).
16
+ - `.invictus/journal/<today>.md`, if it exists — today's checkpoints.
17
+ - `invi status --json` — the engine's view rendered from the event log (last checkpoint, session history, gate results). If the CLI is unavailable, say so plainly and continue with the files and git.
18
+
19
+ These are rendered views: read them, never edit them (the event log `.invictus/log/` is the source of truth).
20
+
21
+ 2. **Collect git state:** current branch (`git branch --show-current`), last five commits (`git log -5 --oneline`), working-tree counts (`git status --short`), and how far the branch is ahead of / behind the manifest `project.baseBranch`.
22
+
23
+ 3. **Collect open items:** unfinished items from MEMORY.md and today's journal; pipeline tasks via `invi task list --json` (anything not `done` is open; `blocked` items are blocker candidates); open requirements under `.invictus/requirements/` (REQ files) when the PO layer is installed. If an argument was given, filter everything to that scope.
24
+
25
+ 4. **Detect blockers:** branch behind the base branch (rebase needed); gates failing at the last checkpoint; migration files pending in the project's migrations directory; uncommitted changes that predate today.
26
+
27
+ 5. **Propose ONE next action.** Not three, not five. One concrete, executable action with a justification grounded in the state above. If a blocker exists, unblocking it is usually that action.
28
+
29
+ ## Output format
30
+
31
+ ```
32
+ ## Status — <date> <time>
33
+
34
+ ### Where we are
35
+ - State: <1–2 lines from MEMORY.md / last checkpoint>
36
+ - Branch: <name> (<ahead/behind base>)
37
+ - Last commit: <sha> — <subject>
38
+ - Working tree: <N staged, N unstaged, N untracked>
39
+
40
+ ### Recent decisions (do not re-litigate)
41
+ - <from MEMORY.md>
42
+
43
+ ### Open items
44
+ 1. <top priority>
45
+ 2. <second>
46
+ 3. <third>
47
+
48
+ ### Blockers
49
+ - <each blocker with a suggested unblock — or "None">
50
+
51
+ ### Recommended next action
52
+ **<one concrete action, one sentence>**
53
+
54
+ Rationale: <why this is the best next action given the state>
55
+ ```
56
+
57
+ ## When to use
58
+
59
+ - First thing in the day, before any other prompt.
60
+ - Resuming after a pause longer than a few hours, or after a meeting broke the flow.
61
+ - Onboarding into a project that already has journal history.
62
+
63
+ ## When NOT to use
64
+
65
+ - Every few minutes during an in-progress task — it interrupts flow for no new information.
66
+ - Before a small, obvious task — the overhead is not worth it.
67
+
68
+ ## Anti-patterns
69
+
70
+ - Treating the output as absolute truth: when something looks off, confirm against `git status` before acting.
71
+ - Skipping MEMORY.md "because I remember yesterday" — the distillate exists precisely because nobody does.
72
+ - Presenting a menu of possible actions — the deliverable is the single prioritized action with its justification.
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: invi-task
3
+ description: Start a task from a ticket — accepts pasted text, a file under .invictus/tasks/, or canonical task JSON; normalizes it to the canonical task shape (id, type, title, acceptance criteria including the risk case), creates the branch <type>/<ticket>-<slug> off the refreshed base branch, and writes the execution plan. Use when starting, picking up, or beginning a ticket or task. Works interactively (you paste the ticket) and programmatically (the orchestrator provides it).
4
+ ---
5
+
6
+ # invi-task — start a task (ticket → branch → plan)
7
+
8
+ Turn a task description into a canonical task record, a ready branch, and a short executable plan.
9
+
10
+ ## Standing rules
11
+
12
+ - Communicate with the user in the language configured in `.invictus/manifest.json` (`language.render`, default pt-BR). Machine artifacts — `task.json` field names, output-block keys, enum values — stay EN; the ticket's own title/description keep their original language.
13
+ - Config comes from `.invictus/manifest.json`: `project.baseBranch`, `project.protectedBranches`, `project.ticketPattern`, `project.catastrophicRisk`. If the manifest is missing, stop and point to `invi init`. If a needed field is missing, ask — never guess silently.
14
+ - **One task = one branch = one goal.** If the ticket mixes goals, agree on a split with the user (interactive) or record the split decision in the plan (programmatic) — then run one task at a time.
15
+ - Never start coding without the branch created.
16
+
17
+ ## Input
18
+
19
+ Accept the task from any of these sources, in this order of precedence:
20
+
21
+ 1. **Canonical task JSON** — pasted or at `.invictus/tasks/<id>/task.json` (shape: see "Canonical task JSON" below).
22
+ 2. **A file under `.invictus/tasks/`** — e.g. `.invictus/tasks/<id>/intake.md` or any raw text file the orchestrator or a human dropped there.
23
+ 3. **Pasted text** — the user pastes title + description + acceptance criteria. If nothing was provided, ask for exactly that.
24
+
25
+ Optional argument: a ticket id (e.g. `/invi-task tk4242`) and/or a type (`feat|fix|refactor|test|docs|chore|perf|ci|build|style|hotfix`).
26
+
27
+ ## Procedure
28
+
29
+ ### 1. Normalize to the canonical task shape
30
+
31
+ Extract/derive: `id`, `type`, `title`, `description`, `acceptance_criteria[]`, `module` (domain scope, inferred from the text and the repo layout). Preserve unknown extra fields verbatim (round-trip rule, PIPELINE.md §1) — notably the PO-layer `req[]` field and any `[AC-###.n]` criterion prefixes (§7.4 traceability keys).
32
+
33
+ - `id` must match the manifest `ticketPattern`. No id recoverable? **Offer the adhoc id, do not
34
+ demand a ticket.** Interactive: propose `adhoc-<yyyymmdd>-<n>` and let the human accept it or
35
+ give a real id. Headless: mint it. Either way declare `ID_SOURCE: generated` in the output
36
+ block — loudly, never silently.
37
+
38
+ This matters more than it looks. Many teams adopt the kit before their tracker is populated,
39
+ or have developers who work from a message rather than a ticket. A prompt that just asks for
40
+ an id, with no way out, teaches those people to invent numbers — and an invented `4242`
41
+ collides with the real ticket 4242 the day the tracker catches up, corrupting the traceability
42
+ the id existed to provide. An `adhoc-` id can never collide, and it says plainly that this
43
+ work arrived without a ticket, which is true and worth recording.
44
+ - `type`: from the argument, else inferred from the text; when in doubt between feature and fix, ask (interactive) or default to `feat` and note it in the plan (headless).
45
+ - **Risk case check**: if the change plausibly touches the client's catastrophic risk (`project.catastrophicRisk`) and no acceptance criterion exercises it, ADD one derived from that risk statement and flag it (`RISK_CRITERION: added`). Every task that can hit the #1 risk carries its criterion.
46
+
47
+ Persist it with the deterministic verb — it validates the canonical shape (zod), writes
48
+ `.invictus/tasks/<id>/task.json` + `state.json`, appends the `task.event`, and prints the id back:
49
+
50
+ ```bash
51
+ invi task create --stdin <<'EOF'
52
+ {
53
+ "schema": 1,
54
+ "id": "…", "type": "…", "title": "…", "description": "…",
55
+ "acceptance_criteria": ["…"],
56
+ "module": "…", "status": "open", "url": "…", "source": "pasted | file | tracker | generated"
57
+ }
58
+ EOF
59
+ ```
60
+
61
+ A validation refusal (bad id, missing criteria, duplicate task) is YOUR bug to fix in the normalization —
62
+ fix the JSON, never bypass the verb. Only when the `invi` CLI is unavailable, write
63
+ `.invictus/tasks/<id>/task.json` in this exact shape directly and say so (PIPELINE.md §1).
64
+
65
+ ### 2. Create the branch off the refreshed base
66
+
67
+ Branch name: **`<type>/<ticket>-<slug>`** — slug = title lowercased, ASCII (accents stripped), hyphenated, ≤5 words. The base branch and ticket pattern come from the manifest — NEVER hardcoded.
68
+
69
+ ```bash
70
+ git fetch origin
71
+ git checkout <baseBranch>
72
+ git pull --ff-only origin <baseBranch>
73
+ git checkout -b <type>/<ticket>-<slug>
74
+ ```
75
+
76
+ - Uncommitted changes present? Warn and ask before switching (interactive); headless: stop with state `blocked` naming the dirty files.
77
+ - `git fetch` fails (offline/no remote)? Branch from the local base branch and say so plainly — degraded, not silent.
78
+ - Never create the task branch as, or commit to, a branch listed in `protectedBranches`.
79
+ - Branch created → advance the state machine: `invi task state <id> in_progress` (PIPELINE.md §3;
80
+ CLI unavailable → set `"status": "in_progress"` in `task.json` directly and say so).
81
+
82
+ ### 3. Map the probable code
83
+
84
+ Locate the module and probable files with Grep/Glob. Read one neighboring file of the same feature class — the plan must name the neighbor whose pattern the implementation will copy (neighbor-pattern conformity: copy the exact pattern, smallest coherent change). If an expected file doesn't exist in this checkout, record "verify in the full repository" in the plan instead of guessing.
85
+
86
+ ### 4. Write the plan — then prove its anatomy
87
+
88
+ Write `.invictus/tasks/<id>/plan.md` in the configured render language, short and executable. Steps
89
+ follow the proven task anatomy (PIPELINE.md §8.2 — the `### S<n>` headings and the four field labels
90
+ are EN machine artifacts; the prose inside them is yours):
91
+
92
+ ```markdown
93
+ # <id> — <title>
94
+ **Branch:** <type>/<ticket>-<slug> · **Module:** <module> · **Source:** <source>
95
+
96
+ ## Goal
97
+ <1–2 sentences>
98
+
99
+ ## Acceptance criteria
100
+ - [ ] <criterion 1 — mark the risk-case criterion explicitly>
101
+
102
+ ## Steps
103
+ ### S1 — <step title>
104
+ - Files: <exact repo paths, comma-separated>
105
+ - Action: <the smallest coherent change — name the neighbor pattern it copies>
106
+ - Verify: `<runnable command — from manifest project.workspaces, never invented>`
107
+ - Done: <observable, measurable outcome>
108
+
109
+ ## Probable files / neighbor pattern
110
+ - <path>:<line> — <why> (neighbor to copy: <path>)
111
+
112
+ ## Tests to create (unit + integration)
113
+ - …
114
+
115
+ ## Risks / fragile areas touched
116
+ - <does it touch the catastrophic risk? which fragile areas?>
117
+ ```
118
+
119
+ Then lint it mechanically: `invi plan <id>` — every step must name exact file paths, a runnable
120
+ verify command, and a measurable done; blockers are fixed IN THE PLAN now, never bypassed (the lint
121
+ result is logged as a `verify` event). CLI unavailable → keep the same anatomy and say the lint was
122
+ not run. `invi plan` also scaffolds this step shape from `task.json` when you want a starting
123
+ skeleton before filling it.
124
+
125
+ ### 5. Output block
126
+
127
+ End with (grammar: `content/PIPELINE.md` §5):
128
+
129
+ ```INVICTUS-RESULT
130
+ BLOCK: TASK
131
+ TASK: <id>
132
+ TYPE: <type>
133
+ TITLE: <title>
134
+ BRANCH: <type>/<ticket>-<slug>
135
+ MODULE: <module or ->
136
+ ID_SOURCE: provided | generated
137
+ TASK_JSON: .invictus/tasks/<id>/task.json
138
+ PLAN: .invictus/tasks/<id>/plan.md
139
+ CRITERIA: <n>
140
+ RISK_CRITERION: present | added | n/a
141
+ TARGET_FILES: <list or ->
142
+ NEXT: implement (stack agents in .claude/agents/) → GATE 1 /invi-security
143
+ ```
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: invi-test
3
+ description: Implement and run tests for the code changed on the current branch — classifies the changed files, applies a minimum-coverage matrix by change type (unit, integration, contract/permission, component), creates test scaffolding if the project has none, and runs the per-workspace test commands from the manifest. Use when the user asks to write/generate/cover tests, proactively after implementing a feature or fix, or as GATE 2 of the pipeline.
4
+ ---
5
+
6
+ # invi-test — implement and run tests (GATE 2)
7
+
8
+ Cover what changed. Tests are written against the real behavior the task demands — including the failure
9
+ and risk cases — not just the happy path.
10
+
11
+ ## Standing rules
12
+
13
+ - Communicate with the user in the language configured in `.invictus/manifest.json` (`language.render`, default pt-BR). Output-block keys and verdicts stay EN.
14
+ - Config from the manifest: `project.baseBranch`, `project.workspaces.<ws>.{test,build,lint}` — these are the project's REAL commands; never invent one. Manifest missing → stop, point to `invi init`. A touched workspace has no `test` command → **offer `not-verified`, do not demand a command.**
15
+ Interactive: say the workspace has no test command, ask whether one exists, and accept "there is
16
+ none" as an answer — then mark it `not-verified` and continue. Headless: mark it `not-verified`
17
+ and say so. Never invent a command, and never block the pipeline on a missing one: a repository
18
+ with no tests in one workspace is a fact about that repository, and reporting it honestly is the
19
+ gate doing its job. Blocking there teaches people to bypass the gate, which costs more than the
20
+ missing test.
21
+ - **Honesty:** if the environment lacks the SDK/runtime/browser to run the tests, do NOT invent a result — deliver the tests plus the exact command line for the dev/CI to run, and mark `not-verified`. Never fake a pass.
22
+ - Test code follows neighbor-pattern conformity: read an existing neighboring test first and copy its exact conventions (naming, layout, fixtures, mocking style).
23
+
24
+ ## Procedure
25
+
26
+ ### 1. Discover what changed
27
+
28
+ ```bash
29
+ git diff <baseBranch>...HEAD --name-only
30
+ git diff <baseBranch>...HEAD --stat
31
+ git status --short # uncommitted work counts too
32
+ ```
33
+
34
+ Map each changed file to a manifest workspace (match the file path against the workspace names/dirs; if
35
+ the mapping is ambiguous, ask). Classify each file: business logic/service · data access/query ·
36
+ API endpoint/controller · UI component · config/infra · pure refactor.
37
+
38
+ ### 2. Delegate to the tester agent
39
+
40
+ Delegate to the **`invi-tester` agent** in `.claude/agents/` with the changed-file list, their
41
+ classification, and the task goal (from `.invictus/tasks/<id>/task.json` / `plan.md` when present). If the
42
+ agent is not installed, write the tests directly and say so.
43
+
44
+ **Minimum-coverage matrix by change type:**
45
+
46
+ | Change type | Minimum tests |
47
+ |---|---|
48
+ | Business logic / service (new or changed) | Unit tests: happy path, edge cases, and the failure path returning the project's standard error shape — dependencies mocked |
49
+ | Data access / query touching tenant, ownership, or permissions | **Integration test** proving isolation (the catastrophic-risk case when applicable) and the correct result of the join/filter |
50
+ | API endpoint / controller | Contract test + permission/authz test; full endpoint test through the framework's test host where the stack supports it |
51
+ | UI component / frontend service | Co-located component/spec test |
52
+ | Pure refactor | Characterization tests pinning current behavior BEFORE the refactor is accepted |
53
+ | Fragile/legacy area (no existing tests) | Characterization tests first, then the change-specific tests |
54
+
55
+ ### 3. Scaffolding (only if the project lacks it)
56
+
57
+ If a touched workspace has no test setup at all, create the smallest idiomatic scaffolding for its stack
58
+ (test project/config + one example test wired to the workspace's `test` command), add it where the stack
59
+ expects it, and document what was created. Prefer the stack's default runner; never install a second
60
+ component library or exotic runner when a standard one exists.
61
+
62
+ ### 4. Run
63
+
64
+ Run each touched workspace's `test` command from the manifest — focused filter first when the runner
65
+ supports it, then the full suite of that workspace. Report results per workspace: `pass | fail |
66
+ not-verified` (+ the exact command for `not-verified`).
67
+
68
+ Failures caused by the new tests exposing real bugs go back to implementation (under orchestration this
69
+ consumes a fix loop — max 2, then `blocked`). Never weaken a test to make it pass.
70
+
71
+ ### 5. Report + gate event
72
+
73
+ List: test files created/updated and what each covers, scenarios knowingly left uncovered, and the exact
74
+ commands to run everything. Tick the test items in `.invictus/tasks/<id>/plan.md` when a plan exists.
75
+
76
+ Log every run — standalone included — when the task exists under `.invictus/tasks/`:
77
+ `invi gate tests <task-id> --verdict pass|fail --loop <n>` (`PASS` → `pass`, which advances the task
78
+ to `tests_ok`; `FAIL` → `fail`; `NOT_VERIFIED` explicitly accepted by the user → `pass` with
79
+ `--details '{"not_verified":true}'`). Verb unavailable → walk the PIPELINE.md §4 ladder; under
80
+ orchestration `invi-mode` does the logging.
81
+
82
+ ## Output block
83
+
84
+ End with (grammar: `content/PIPELINE.md` §5):
85
+
86
+ ```INVICTUS-RESULT
87
+ BLOCK: TEST
88
+ TASK: <ticket id or ->
89
+ WORKSPACES: <list>
90
+ TESTS_CREATED: <n>
91
+ SCAFFOLDING: existing | created | -
92
+ TESTS_RUN: <ws>=pass|fail|not-verified …
93
+ UNCOVERED: <n or ->
94
+ VERDICT: PASS | FAIL | NOT_VERIFIED
95
+ LOOP: <n>
96
+ NEXT: <one line — on PASS: GATE 3 /invi-review; on FAIL: what to fix; on NOT_VERIFIED: the command for dev/CI>
97
+ ```