@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Invictus AI (invictusai.com.br)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/LICENSING.md ADDED
@@ -0,0 +1,49 @@
1
+ # Licensing
2
+
3
+ This repository is **split-licensed**. The engine is open source; the doctrine is
4
+ source-available. Which license applies depends only on where a file lives.
5
+
6
+ | Path | License | What it is |
7
+ |---|---|---|
8
+ | `packages/core/`, `packages/hooks/`, `packages/kit/src/`, `packages/kit/bin/`, `tools/`, `scripts/` | **MIT** (`LICENSE`) | The engine: the `invi` CLI, the hook runtime, the metrics-trailer codec. |
9
+ | `content/` — and the `content-dist/` copy bundled into the published package | **Elastic License 2.0** (`content/LICENSE`) | The doctrine: fragments, skills, agent templates, `PIPELINE.md`, requirement templates. |
10
+ | `docs/` — including the handbook | **Elastic License 2.0** (`docs/LICENSE`) | The written work: the 12-chapter handbook, architecture and platform docs. |
11
+
12
+ ## Why the split
13
+
14
+ The engine is MIT on purpose, and that purpose has not changed: **the code that
15
+ runs on a client's machine, reads their repository and signs their commits must
16
+ be auditable before they trust it.** Nobody should have to take our word for what
17
+ a hook does. MIT is the strongest possible statement there.
18
+
19
+ The doctrine is a different kind of asset. The fragments, skills and agent
20
+ prompts are the accumulated judgment of the practice — they are the product, not
21
+ the plumbing. MIT on those would permit anyone to rebrand and resell the whole
22
+ system while keeping only a copyright line in a file nobody opens. The Elastic
23
+ License 2.0 keeps them **readable, auditable, freely usable and freely modifiable
24
+ by anyone who installs the kit**, and forbids exactly one thing: repackaging them
25
+ as a competing hosted or managed service.
26
+
27
+ ## What this means in practice
28
+
29
+ **For a client or an individual developer — nothing changes.**
30
+ `npx @invictus-group-ai/orchestra init` works for everyone, with no key, no
31
+ account, and no gate. Read every file, change every file, run it on any number of
32
+ private and commercial projects. Restricting the *license* does not restrict
33
+ *distribution*: the package stays public on npm.
34
+
35
+ **For someone wanting to resell the system:** the engine is yours under MIT. The
36
+ doctrine is not.
37
+
38
+ **Contributions** are accepted under the license of the path they touch.
39
+
40
+ ## Trademarks
41
+
42
+ "Invictus AI", "Invictus Orchestra" and "Invictus Maestro" are trademarks of
43
+ Invictus AI. Neither license grants trademark rights (MIT is silent; ELv2 §
44
+ Limitations is explicit). A permitted fork of the engine must carry its own name.
45
+
46
+ ---
47
+
48
+ *This file describes the licensing arrangement; the licenses themselves are the
49
+ `LICENSE` files it points to, which are the operative documents.*
package/README.md ADDED
@@ -0,0 +1,507 @@
1
+ # @invictus-group-ai/orchestra
2
+
3
+ The `invi` CLI — installer and day-to-day verbs of the Invictus AI kit
4
+ (ARCHITECTURE §8). Commander-based, ESM, Node ≥ 20. Every command accepts
5
+ `--json` (machine output on stdout) and `-C/--dir <path>` (target repo).
6
+
7
+ ```bash
8
+ npx @invictus-group-ai/orchestra init
9
+ ```
10
+
11
+ ## Requirements
12
+
13
+ | What | Why it is needed | Check |
14
+ |---|---|---|
15
+ | **Node.js ≥ 20** | the CLI and the hook engine run on it | `node -v` |
16
+ | **git** | the kit installs git hooks and reads the history | `git --version` |
17
+ | **An agent CLI** — Claude Code today | the session hooks attach to it. The git hooks (trailers, guards, sync) work without it | `claude --version` |
18
+
19
+ No account, no API key and no network call are needed to install.
20
+
21
+ ## Install
22
+
23
+ Install it in the **root of the repository you are going to work on**, right after cloning that repository. The kit installs itself *into the repo*, not into your machine — that is what makes it travel to the rest of the team through git.
24
+
25
+ ```bash
26
+ cd <your-project> # the repo root, where .git is
27
+ npm install -D @invictus-group-ai/orchestra @invictus-group-ai/hooks
28
+ npx invi init
29
+ ```
30
+
31
+ `@invictus-group-ai/core` comes along as a dependency — you never install it directly.
32
+
33
+ **Your project is not a Node project?** (Python, Delphi, PHP, Java, Ruby…) The same two commands work: npm creates a minimal `package.json` and a `node_modules/` in the repo root. Commit the `package.json`, add `node_modules/` to `.gitignore`, and every teammate gets the engine with one `npm install`. The git hooks look it up at `<repo>/node_modules/@invictus-group-ai/hooks`.
34
+
35
+ **Just trying it out?** `npx @invictus-group-ai/orchestra init` installs nothing into the repo — but then the git hooks have no engine to call and no commit carries metrics. Use it to look around, not to run the kit.
36
+
37
+ ## First steps
38
+
39
+ 1. **`npx invi init`** — detects the stacks from your lockfiles, asks a short interview (base branch, protected branches, ticket pattern, language, and the project's #1 catastrophic risk), then installs only what this repo needs. The last phase verifies itself and prints the installed surface in tokens.
40
+ 2. **Commit what it wrote.** `CLAUDE.md`, `.invictus/`, `.claude/` and `.githooks/` belong to the team. `.invictus/local/` is per-machine (salt, keys) and is gitignored for you — never commit it.
41
+ 3. **`npx invi doctor`** — must end healthy. Run it after cloning, after every `invi update`, and in CI if you want a continuous signal.
42
+ 4. **Open a session in your agent CLI.** The repo's journal is injected at session start, the standing rules from `CLAUDE.md` apply, and the guards are live.
43
+ 5. **Work normally.** Commit as usual: the git hook appends the metrics trailer by itself. Never write `Invictus:` trailers by hand.
44
+ 6. **`npx invi update`** when a new kit version ships — it three-way merges the new content and keeps your edits.
45
+
46
+ On another machine everything travels with `git clone` + `npm install`; the first agent session in that clone activates the git hooks (`core.hooksPath`) automatically.
47
+
48
+ ## Commands at a glance
49
+
50
+ Every command takes `--json` (machine output on stdout) and `-C/--dir <path>` (target repo).
51
+
52
+ | Command | What it does |
53
+ |---|---|
54
+ | `invi init` | install the kit in this repo: detect → map → interview → render → verify |
55
+ | `invi update` | three-way merge the new kit content into this repo, keeping your edits |
56
+ | `invi doctor` | health check: drift, hooks, `core.hooksPath`, event-log integrity |
57
+ | `invi status` | install + activity summary, read from the manifest and the event log |
58
+ | `invi export` | pack the installed surface into one tarball for another machine |
59
+ | `invi map [--check]` | apply the codebase documents written by `/invi-map` to the rendered agents |
60
+ | `invi journal <checkpoint\|note\|decision> -m "…"` | the only sanctioned writer of the event log |
61
+ | `invi task <create\|state\|list\|current\|show>` | task records and the pipeline state machine |
62
+ | `invi plan <id>` / `invi run <id>` | scaffold and lint a plan; route the task to inline, quick or full pipeline |
63
+ | `invi gate <security\|tests\|review\|qa> <id>` | record a gate result and advance the task |
64
+ | `invi verify <id>` / `invi review <id>` | run the workspace commands and assemble the review context |
65
+ | `invi ship <id>` | pre-PR gatekeeper: asserts the gates, pushes, opens the PR (merge stays human) |
66
+ | `invi req <create\|approve\|event\|status>` | the PO requirement lifecycle (EARS) |
67
+ | `invi keys provision` | derive this machine's platform credentials into `.invictus/local/` |
68
+ | `invi sync [--dry-run]` | send new events and commit trailers to the platform (runs by itself on push) |
69
+
70
+ `npx invi <command> --help` prints the flags of any of them. The chapters below document each command in depth; the full client handbook (pt-BR) lives in `docs/handbook/`.
71
+
72
+ ## Which command, in which order
73
+
74
+ Two different things carry the Invictus name, and the difference decides where you type them:
75
+
76
+ - **Skills** — `/invi-task`, `/po-spec`, … — are invoked **inside your agent CLI** (type `/` followed by the name). They carry the judgment: what to build, whether the code is safe, whether a criterion really passed.
77
+ - **Verbs** — `invi task`, `invi gate`, … — are deterministic commands you run **in the terminal**. They own the mechanics: validation, state transitions, the event log. *Logic in code, judgment in prompts.*
78
+
79
+ The skills call the verbs for you, so you rarely type a verb by hand during a task — but every verb is there when you want to inspect or fix the state yourself.
80
+
81
+ ### The developer flow
82
+
83
+ One task, start to finish. `/invi-mode <ticket>` runs steps 2–8 as one orchestrated sequence; run them one at a time when you want to stay in control of each step.
84
+
85
+ | # | You run | What it does |
86
+ |---|---|---|
87
+ | 1 | `/invi-status` | Where the project stands, and exactly one proposed next action. A good way to open any session. |
88
+ | 2 | `/invi-task <ticket, pasted text or file>` | Normalizes the ticket into `.invictus/tasks/<id>/task.json`, creates the task branch and writes the plan — then proves the plan is executable with `invi plan <id>` (every step names real files, a runnable check, and a measurable outcome). |
89
+ | 3 | `invi run <id>` | Sizes the task from deterministic signals (type, criteria, plan, diff footprint, fragile areas) and prints the route: `inline`, `quick` or `full-pipeline`, with its reasons. **You never pick the weight class yourself.** |
90
+ | 4 | *implement* | The stack agents work against the plan. Changing code that already works? `/invi-refactor-legacy` — characterization tests first, no rewrites. |
91
+ | 5 | `/invi-security` → `/invi-test` → `/invi-review` → `/invi-qa` | The four gates, **always in this order**: security findings invalidate everything downstream, so they are cheapest to fix first. Each gate records its verdict (`invi gate <name> <id> --verdict …`) and advances the task state. Two fix loops per gate; exhausting them marks the task `blocked` instead of pretending. |
92
+ | 6 | `invi verify <id>` | The honesty check before shipping: runs your *real* test/build/lint commands from the manifest, demands a `qa.md` with one verdict row per criterion, and requires all four gates green **now**. What cannot be run is reported as a gap, never as a pass. |
93
+ | 7 | `/invi-commit` | Conventional commit with the ticket as the join key. The git hook appends the metrics trailer by itself — never write `Invictus:` lines by hand. |
94
+ | 8 | `invi ship <id>` (or `/invi-pr`) | Refuses precisely unless the task is at `qa_ok`, every gate's latest verdict passes, and the tests run green now — then pushes the branch and opens the PR with a rendered body. |
95
+ | 9 | **a human merges** | Always. Nothing in the kit merges for you. After the merge: `invi task state <id> done`. |
96
+ | 10 | `/invi-journal` | Checkpoint the finished task before starting the next one — that is what the next session reads back. |
97
+
98
+ Two shortcuts worth knowing: a small task (`inline`, per step 3) skips the ceremony — implement, `invi verify`, `/invi-commit` — and `invi sync` needs no invocation at all, it runs on push. On your first week in a repository, run `/invi-map` once: it dispatches mapper subagents that document the codebase, and `invi map` feeds what they found into every rendered agent.
99
+
100
+ ### The product-owner flow
101
+
102
+ Requirements come *before* the developer flow and close *after* it. The `po-*` skills speak business language, not code, and are installed in every repository.
103
+
104
+ | # | The PO runs | What it does |
105
+ |---|---|---|
106
+ | 1 | `/po-intake` | A Socratic interview about the need — actors, trigger, outcome, failure paths, scope — until the ambiguity is gone. Produces a brief. |
107
+ | 2 | `/po-spec` | Turns the brief into `REQ-###.md` files with EARS acceptance criteria (`AC-###.n`), one behavior per criterion, every *When* paired with its *If-Then* failure twin. Status: `draft`. |
108
+ | 3 | `/po-lint` | Conformance gate: vague adverbs ("fast", "user-friendly"), criteria nobody can test, event-driven criteria missing their failure twin. Fix and re-run — a draft stays a draft through any number of cycles. |
109
+ | 4 | **the PO approves** | Always human — the requirements-layer twin of the merge. Recorded as `invi req approve REQ-### --confirmed`; the flag *is* the recorded human decision. |
110
+ | 5 | `/po-handoff` | Converts the approved requirement into canonical task JSON, carrying `req: ["REQ-###"]` and each criterion verbatim. The developer flow above picks it up at step 2. |
111
+ | 6 | *(the developer flow runs)* | The REQ id travels into every commit trailer — which is what makes **cost per requirement** measurable instead of anecdotal. |
112
+ | 7 | `/po-verify` | Business acceptance: each acceptance criterion becomes one UAT scenario, walked with the PO. Every criterion passing marks the requirement `delivered`; a defect found later reopens it. |
113
+ | 8 | `/po-status` | What is in draft, in progress and delivered, in business language — with the tasks and the cost attached to each requirement. `invi req status` is the same picture, deterministic and `--json`-able. |
114
+
115
+ The two human stops — **approval** (step 4) and **merge** (developer step 9) — are deliberate and cannot be automated away. Everything between them can.
116
+
117
+ Both flows are taught in depth in the pt-BR handbook: `docs/handbook/06-skills-oficiais-commands.md` for the developer track and `docs/handbook/10-trilha-po-requisitos.md` for the PO track.
118
+
119
+ ## Commands
120
+
121
+ ### `invi init [-y|--yes] [--lang <tag>] [interview flags]`
122
+
123
+ Five phases:
124
+
125
+ 1. **DETECT** — walks the repo (bounded depth/file count, skips `node_modules`
126
+ etc.) for manifests across ecosystems: `package.json` (+ lockfiles for exact
127
+ versions), `pyproject.toml`, `requirements.txt`, `composer.json`, `go.mod`,
128
+ `Gemfile`, `*.csproj`/`*.sln`, `pubspec.yaml`, `Cargo.toml`, `mix.exs`,
129
+ docker-compose files, `.github/workflows/`, `*.tf`. Monorepo-aware:
130
+ `pnpm-workspace.yaml`, `turbo.json`, and npm `workspaces` are expanded and
131
+ detection runs **per workspace** (workspaces also see hoisted root deps).
132
+ Probes PATH for `claude`, `codex`, `gemini`; notes existing `.claude/`,
133
+ `.invictus/`, `.husky/`. Fragments are scored from their front-matter
134
+ `detect` blocks: `deps` AND-match (best-effort `>=N` range check against
135
+ lockfile versions), `files` ANY-match via a mini-glob; declared `conflicts`
136
+ resolve by score, and a fragment whose `detect.deps` is a strict superset of
137
+ another's shadows it (e.g. `nextjs-prisma-postgres` over `nextjs-app-router`).
138
+ 2. **MAP** — writes `.invictus/codebase/README.md` pointing at the real flow:
139
+ mapping is agent work, so init installs the `/invi-map` skill (dispatches up
140
+ to four parallel mapper subagents that write the five codebase documents)
141
+ and the deterministic `invi map` verb applies them (see below). Until
142
+ the map exists, rendered agents keep their honest `TODO(map)` defaults.
143
+ 3. **INTERVIEW** — readline prompts: base branch (default from git
144
+ `origin/HEAD`), protected branches, ticket pattern (default `tk\d+`,
145
+ regex-validated), render language (default `pt-BR`), the project's #1
146
+ catastrophic risk (free text), optional domain modules/scopes and fragile
147
+ areas (free text, Enter to skip — feed the agent templates), and per-domain
148
+ confirmation of proposed domain fragments. `--yes` accepts every default
149
+ (and the detector's domain proposals). Every question also has a
150
+ per-question flag for headless runs — `--risk`, `--ticket-pattern`
151
+ (validated before anything is written), `--base-branch`,
152
+ `--protected-branches` (comma-separated), `--modules` (comma-separated),
153
+ `--fragile-areas`, `--lang` — a flag answers its question without
154
+ prompting, so `--yes` + flags is a fully scriptable CI install. The
155
+ answers are persisted to `.invictus/interview.json` (they drive the agent
156
+ re-render on `invi update`), and a re-run of init proposes the
157
+ previously captured answers as defaults instead of losing them.
158
+ 4. **RENDER** —
159
+ - copies selected fragments (base + stacks + confirmed domains) into
160
+ `.invictus/` (front-matter stripped, provenance header added), plus their
161
+ `references/<slug>/` exemplar dirs when the content layer has them;
162
+ - generates a **thin CLAUDE.md**: `@imports` + a PROJECT FACTS section
163
+ auto-built from lockfile versions, wrapped in
164
+ `<!-- invictus:begin/end -->` markers so updates replace only their own
165
+ section (client prose outside the markers is preserved byte-for-byte);
166
+ AGENTS.md / GEMINI.md variants are rendered when those CLIs are detected;
167
+ - installs ALL content-layer skills (they are universal, including the
168
+ pipeline pack `invi-task`/`invi-security`/`invi-test`/`invi-review`/`invi-qa`/
169
+ `invi-commit`/`invi-pr`/`invi-mode`) into `.claude/skills/`;
170
+ - renders the agent template pack into `.claude/agents/`: the four
171
+ universal agents always, stack builder agents selected via
172
+ `content/agents/mapping.json` against the installed fragments (plus
173
+ detection-signal fallbacks for stacks without a fragment, probed in
174
+ specificity order: csproj, pubspec, wp-config, django, angular, vue,
175
+ svelte, then the generic react/python/node; `match: closest` renders get
176
+ a TODO(map) banner).
177
+ `{{VARIABLES}}` fill from the interview + manifest data; a missing source
178
+ renders the documented default **plus a visible `TODO(map)` marker** —
179
+ never an empty string. Rendered agents are recorded (sha256) in
180
+ `.invictus/files.json` like every other kit-written file;
181
+ - scaffolds the PO requirements layer (`content/PIPELINE.md` §7.1):
182
+ installs the requirement templates to `.invictus/templates/requirements/`
183
+ (the paths the `po-*` skills read) and renders
184
+ `.invictus/requirements/constitution.md` from the constitution template,
185
+ Article I seeded with the interview's catastrophic risk. An existing
186
+ constitution is **never overwritten** — after seeding it belongs to the
187
+ PO, like `.invictus/CLAUDE.local.md`;
188
+ - **JSON-deep-merges** the hooks settings-template into
189
+ `.claude/settings.json` — existing entries always win/persist, hook groups
190
+ merge by matcher, and the merge is idempotent. Template source order:
191
+ installed `@invictus-group-ai/hooks` → monorepo sibling → bundled fallback;
192
+ - installs `.githooks/` (prepare-commit-msg, commit-msg, pre-commit,
193
+ pre-push — thin dispatchers into `@invictus-group-ai/hooks git <name>`) and sets
194
+ `core.hooksPath`, unless `.husky/` (or a foreign hooksPath) exists — then
195
+ it warns with chaining instructions instead of clobbering;
196
+ - writes `.invictus/manifest.json` (schema of `@invictus-group-ai/core`, sha256
197
+ per fragment) plus `.invictus/files.json` (sha256 for **every** other
198
+ kit-written file; marker-managed files hash only their invictus block);
199
+ - scaffolds `.invictus/journal/` and `.invictus/log/` and appends the
200
+ first event through the core event log (hash-chained JSONL);
201
+ - generates `TRANSPARENCY.md` (LGPD disclosure per DECISIONS D-002 —
202
+ what is collected, what never is, why, who accesses, retention; rendered
203
+ in pt-BR when the render language is pt-BR);
204
+ - derives the pseudonymous devId via `@invictus-group-ai/core` from the git email
205
+ and a machine-local salt (`.invictus/local/salt`, auto-gitignored) and
206
+ registers it in the manifest.
207
+ 5. **VERIFY** — fires every hook registered in `.claude/settings.json` with
208
+ fixture JSON on stdin and asserts the exit-code contract (allow → 0;
209
+ secret-guard block fixture → 2). When `@invictus-group-ai/hooks` is not installed
210
+ in the repo the checks report **SKIPPED** — never silently passed. Asserts
211
+ every installed skill and rendered agent is well-formed: front-matter
212
+ parses, names match, and no unfilled `{{VARIABLE}}` survives without a TODO
213
+ marker on its line. Also checks `core.hooksPath` and re-reads the manifest,
214
+ then prints the installed surface:
215
+ `N skills, A agents, M fragments, ~X tokens of standing context`.
216
+
217
+ ### `invi doctor`
218
+
219
+ Drift report, exit 1 on errors: manifest validity; fragment sha256 vs disk
220
+ (edited → warn, missing → error); detection re-run vs manifest (dep removed →
221
+ stale fragment; new match → suggest install); hook registration present in
222
+ settings.json; `core.hooksPath`; kit-file inventory drift — edited files under
223
+ `.claude/skills/` or `.claude/agents/` are reported as **customized** (client
224
+ edits are legitimate and never a problem; missing files stay errors); event-log
225
+ hash-chain verification per dev; local salt presence.
226
+
227
+ ### `invi keys provision --client <id> --master-key <hex> --platform-url <url> [--rederive]`
228
+
229
+ Kit-side counterpart of the platform auth model (docs/PLATFORM-API.md). Writes
230
+ `.invictus/local/client.json` (`{clientId, platformUrl}`) and `dev.key` — the
231
+ hex of `deriveDevHmacKey(masterKey, devId)` for the current git identity's
232
+ pseudonymous devId (same resolution order the hooks use). The master key is
233
+ **never persisted** and never echoed back. Refuses to write when anything
234
+ under `.invictus/local/` is git-tracked or the path is not effectively
235
+ gitignored (negation patterns are caught via `git check-ignore`).
236
+
237
+ **Stable dev IDs** (PLATFORM-API "stable dev IDs" contract note): provisioning
238
+ also writes `.invictus/local/salt` with the CLIENT-STABLE salt
239
+ `deriveClientSalt(masterKey)` (core: HKDF-SHA256, fixed info string
240
+ `invictus-client-salt-v1`), so every machine provisioned for the same client
241
+ derives the same devId per git email. When the machine already resolves a
242
+ legacy devId (minted from a pre-provision machine-local random salt), it is
243
+ **kept by default** — the old id anchors immutable history (the per-dev
244
+ event-log hash chain, commit trailers in git, platform rows), and switching
245
+ silently would fork one human across two pseudonymous identities.
246
+ `--rederive` makes the switch explicit: it overwrites the local salt,
247
+ re-points the manifest `devs[]` entry (and a `dev.json` pin when present) at
248
+ the stable id, and derives `dev.key` for it; history recorded under the old
249
+ id stays under it (the platform treats devIds as opaque, so both coexist).
250
+
251
+ ### `invi sync [--dry-run] [--url <base-url>]`
252
+
253
+ Implements docs/PLATFORM-API.md v1 exactly: POSTs the authenticated dev's new
254
+ event-log entries to `<platformUrl>/v1/ingest/events` in batches of ≤500, with
255
+ `Authorization: Bearer <devKeyHex>` + `X-Invictus-Client` + `X-Invictus-Dev`
256
+ headers and a `{ repo, events }` body (repo = normalized origin remote, e.g.
257
+ `github.com/acme/app`). Entries travel **verbatim** — the platform recomputes
258
+ each entry hash and verifies the per-dev chain, so nothing may be rewritten in
259
+ flight (which is why journal-note text syncs as-is when sync is enabled;
260
+ TRANSPARENCY.md discloses this, and the platform rejects any entry carrying an
261
+ `email` field). The watermark is taken **from the response** (last accepted
262
+ `h`) and persisted per batch in `.invictus/local/sync-state.json`. Offline
263
+ platform → clear message, exit 0, everything retried next run (ingestion is
264
+ idempotent on `(devId, h)`). Not provisioned → clear message pointing at
265
+ `invi keys provision`, exit 0. Env overrides: `INVICTUS_PLATFORM_URL`,
266
+ `INVICTUS_CLIENT_ID`, `INVICTUS_DEV_KEY`, `INVICTUS_DEV_ID`.
267
+
268
+ ### `invi update`
269
+
270
+ Real three-way merge of the installed surface, keyed on the sha256 recorded at
271
+ install (manifest fragments + `.invictus/files.json`), with pristine base
272
+ copies in `.invictus/baseline/`:
273
+
274
+ - untouched file → replaced with the new render;
275
+ - client-edited → line-based diff3 (`src/util/diff3.ts`, no external binary):
276
+ clean merge lands in place; conflicting hunks produce a `<file>.new` sidecar
277
+ with conflict markers and leave the client file untouched (exit 1 so CI
278
+ notices);
279
+ - client-edited without a recorded baseline (pre-0.2.0 installs) → plain
280
+ upstream `.new` sidecar;
281
+ - `.invictus/CLAUDE.local.md` is never touched;
282
+ - the CLAUDE.md/AGENTS.md/GEMINI.md invictus block — including PROJECT FACTS —
283
+ is regenerated from a fresh detection pass (client prose outside the markers
284
+ survives byte-for-byte);
285
+ - `.githooks/*` dispatchers are kit-owned and regenerated outright;
286
+ - new upstream skills are installed; the requirements templates under
287
+ `.invictus/templates/requirements/` are refreshed like any managed file
288
+ (installs that predate them gain them as `added`);
289
+ - rendered agents (`.claude/agents/`) are **re-rendered** from the upstream
290
+ templates using the interview answers persisted at init
291
+ (`.invictus/interview.json`), with the `invi map` rules:
292
+ sha256-customized agents are skipped with a warning (never overwritten),
293
+ `invictus:map` regions are preserved across the re-render (extracted from
294
+ the old render, re-applied to the new one), and the inventory hashes are
295
+ refreshed. Installs that predate the answers file keep the old
296
+ skip-with-warning behavior until init is re-run;
297
+ - a changelog of every action is printed, and manifest/inventory/baseline
298
+ records follow the new hashes.
299
+
300
+ Upstream source (phase 4): an explicit override (`INVICTUS_CONTENT_DIR` or the
301
+ `contentDir` option) always wins; otherwise, when the registry has a NEWER
302
+ `@invictus-group-ai/orchestra` than the installed CLI (`npm view …@latest` equivalent,
303
+ plain HTTP — no npm binary needed), its tarball is downloaded once per version
304
+ into `~/.cache/invictus/kit-content/<version>/` (integrity-checked against
305
+ `dist.integrity`), the bundled `content-dist/` is extracted, and the merge
306
+ runs against the PUBLISHED content; otherwise — offline, registry missing,
307
+ version not newer, tarball unusable — it degrades with a warning to the local
308
+ content layer (same resolution as init), exactly the pre-registry behavior.
309
+ `INVICTUS_REGISTRY` overrides the registry base URL.
310
+
311
+ ### `invi status` / `invi journal`
312
+
313
+ Human summaries rendered from the manifest + event log (markdown views are
314
+ never parsed — the log is the source of truth, D-005). `invi journal
315
+ checkpoint|note|decision -m "..." [--ticket tk123]` is the only sanctioned log
316
+ writer: it builds the hash-chained envelope via `@invictus-group-ai/core` and
317
+ re-renders `.invictus/journal/<day>.md` and `MEMORY.md`.
318
+
319
+ ### `invi task` / `invi gate`
320
+
321
+ Deterministic owners of `.invictus/tasks/` and the pipeline state machine
322
+ (content/PIPELINE.md §1/§3/§4 — logic in code, judgment in prompts):
323
+
324
+ - `task create --file <path> | --stdin` validates the canonical task JSON
325
+ (zod; unknown extra fields round-trip, PO-layer `req[]` included), refuses
326
+ ids outside the manifest `ticketPattern` (or the `adhoc-<yyyymmdd>-<n>`
327
+ form) and duplicates, writes `task.json` + the derived `state.json`, appends
328
+ a `task.event` (created) to the event log, and prints the id (the last
329
+ human-mode stdout line — scriptable).
330
+ - `task state <id> <new-state>` performs ONLY the §3 legal transitions
331
+ (`open → in_progress → security_ok → tests_ok → review_ok → qa_ok →
332
+ pr_open → done`, `blocked` from any active state, `blocked → in_progress`);
333
+ illegal jumps exit non-zero with the legal options named, and every
334
+ transition is appended as a `task.event`.
335
+ - `task list` / `task show <id>` render the records (`--json` everywhere).
336
+ - `gate <security|tests|review|qa> <task-id> --verdict
337
+ pass|pass-with-reservations|fail [--loop <n>] [--details <json>]` appends
338
+ the §4 `gate` event (details restricted to `findings`/`criteria_ok`/
339
+ `not_verified` — metrics, never content) and advances the state on a
340
+ passing verdict, in gate order; `fail` records without moving state;
341
+ `pass-with-reservations` is review/qa-only; `test` aliases `tests`.
342
+
343
+ ### `invi map [--check]`
344
+
345
+ The DETERMINISTIC half of the codebase-map system — judgment lives in the
346
+ `/invi-map` skill (content/skills/invi-map), which dispatches up to four
347
+ parallel mapper subagents (stack/architecture, conventions, testing,
348
+ concerns) that write `.invictus/codebase/{STACK,ARCHITECTURE,CONVENTIONS,
349
+ TESTING,CONCERNS}.md` with `mapped_at` + `workspaces` front-matter and
350
+ evidence-based content. `invi map` then:
351
+
352
+ - validates the five documents and their front-matter;
353
+ - extracts the agent-template variables from the marked sections
354
+ (`<!-- invictus:var:NAME --> … <!-- /invictus:var:NAME -->`):
355
+ ARCHITECTURE.md → `ARCHITECTURE_SUMMARY`, `DATA_ACCESS_RULES`;
356
+ CONVENTIONS.md → `CONVENTIONS_SUMMARY`, `REFERENCE_FILES`;
357
+ - re-renders the installed `.claude/agents/`, replacing the rendered
358
+ TODO(map) defaults (values are wrapped in `<!-- invictus:map:NAME -->`
359
+ markers, so re-maps refresh in place — the operation is idempotent);
360
+ - agents whose sha256 no longer matches `.invictus/files.json` are
361
+ client-customized: **skipped with a warning, never overwritten**;
362
+ - an empty/absent marked section means "not captured" — the agents keep
363
+ their honest TODO(map) defaults; nothing is ever invented.
364
+
365
+ `--check` writes nothing: it reports missing/invalid documents and extracted
366
+ values not yet applied (both exit 1), plus how many commits landed since the
367
+ oldest `mapped_at` (staleness — informational).
368
+
369
+ ### Orchestration verbs — `req` / `plan` / `run` / `verify` / `review` / `ship`
370
+
371
+ The deterministic scaffolding around the pipeline skills (contract:
372
+ content/PIPELINE.md §8; ARCHITECTURE §8). Judgment — writing criteria,
373
+ reviewing code, deciding approval — stays in the skills; these verbs own the
374
+ mechanics and the event-log record.
375
+
376
+ - `req create --file <path>` — mechanical REQ validation (front-matter, id
377
+ format, status enum, at least one `AC-<req>.<n>`, EARS keyword shape,
378
+ failure-twin heuristic warning) and installation under
379
+ `.invictus/requirements/`; errors block (exit 1, nothing written), warnings
380
+ inform (`/po-lint` remains the semantic gate).
381
+ `req approve <id> --confirmed` — draft → approved + `req.event`; the flag
382
+ is the explicit record that a HUMAN approved (refused without it).
383
+ `req event <id> --event handoff|ac_result|delivered|reopened …` — appends
384
+ the §7.3 payload (strict zod: metrics, never content) and performs the
385
+ matching §7.2 status transition; illegal jumps refused.
386
+ `req status [--json]` — every REQ with lifecycle status, the tasks whose
387
+ `task.json` `req[]` cite it, per-task gate progress from the event log,
388
+ and per-AC UAT verdicts. Rung 1 of the §7.3 degradation ladder.
389
+ - `plan <task-id>` — scaffolds `.invictus/tasks/<id>/plan.md` (one
390
+ `### S<n>` step per criterion with `Files / Action / Verify / Done`
391
+ placeholders) when missing, then LINTS: every step must name exact file
392
+ paths, a runnable verify command, and a measurable done — missing pieces
393
+ are blockers (exit 1), and the result lands as a `verify` event
394
+ (`kind: "plan.lint"`).
395
+ - `run <task-id> [--force <v> --reason <text>]` — the auto-sizing router:
396
+ deterministic heuristics (type, AC count, plan presence/size, branch diff
397
+ footprint, fragile-area intersection) → `inline | quick | full-pipeline`
398
+ WITH localized reasons, recorded as a `decision` event
399
+ (`kind: "run.sizing"`), and prints exactly which skill to invoke. The
400
+ human never picks the weight class; `--force` overrides with the reason
401
+ logged, never silently.
402
+ - `verify <task-id>` — runs the REAL manifest workspace commands
403
+ (`project.workspaces.<ws>.{test,build,lint}` — never invented),
404
+ cross-checks `qa.md` exists with per-criterion verdict rows, checks §4
405
+ gate-event completeness, and appends the summary as a `verify` event —
406
+ exit 1 while any gap remains; what can't run is a gap, never a pass.
407
+ - `review <task-id>` — read-only review-context assembler: branch delta vs
408
+ the manifest base (§2 range convention), changed files ∩ fragile areas
409
+ (from `.invictus/codebase/CONCERNS.md` `FRAGILE_PATHS`, defaults
410
+ otherwise), prior review-gate events, plan/qa state — printed as the EN
411
+ `KEY: value` block `/invi-review` consumes. No events appended.
412
+ - `ship <task-id>` — the pre-PR gatekeeper: refuses (exit 1, precise
413
+ reasons) unless the task is at `qa_ok`, all four gates' latest verdict
414
+ passes in the event log, the manifest test commands run green NOW, and
415
+ the branch is pushed (it pushes; protected branches never). Then renders
416
+ the PR body from task.json + plan + gate results, runs `gh pr create`
417
+ when `gh` is on PATH (else prints the compare URL derived from the real
418
+ origin remote) and advances `qa_ok → pr_open`. Merge stays ALWAYS human.
419
+
420
+ ## Content resolution
421
+
422
+ Order: `INVICTUS_CONTENT_DIR` env override → monorepo walk-up (a dev checkout
423
+ is always fresher) → `content-dist/` bundled into the published package by the
424
+ `prepack` script (`scripts/bundle-content.mjs` copies `../../content` at pack
425
+ time; `content-dist/` is gitignored and shipped via the package.json `files`
426
+ whitelist). Uses `content/fragments/index.json` when present and globs
427
+ front-matter otherwise.
428
+
429
+ ## Detection extras
430
+
431
+ Python workspaces get a **derived, runnable test command** even though Python
432
+ has no script manifest: Makefile `test:` target → `make test`; `tox.ini` →
433
+ `tox`; `pytest` in deps/dev-deps → `pytest`, wrapped as `uv run pytest` /
434
+ `poetry run pytest` when the lockfile indicates the runner. Declared
435
+ `package.json` scripts always win; commands are never invented — no signal
436
+ keeps the honest `TODO(map)` default in rendered agents.
437
+
438
+ ## Language (D-003)
439
+
440
+ Client-facing CLI output — init phase banners, interview questions, verify and
441
+ surface reports, doctor findings, status/journal/sync/keys/update messages —
442
+ renders from a message catalog (`src/i18n/`): EN is the canonical source
443
+ (`en.ts`), pt-BR the default client rendering (`pt-BR.ts`). Resolution order:
444
+ `--lang` flag > `manifest.language.render` > pt-BR. Machine tokens (paths,
445
+ commands, enum values like `UpdateChange.action` in `--json` output) are never
446
+ translated; developer diagnostics (agent-renderer warnings, tsc output, hook
447
+ fixture details in JSON results) stay EN.
448
+
449
+ Missing-translation safety is compile-time: `MessageKey = keyof typeof en` and
450
+ the pt-BR catalog is declared `Record<MessageKey, string>`, so a missing OR
451
+ extra key fails `tsc` (which runs before every test). `init --yes` output is
452
+ snapshot-tested in both languages (`test/init-snapshot.test.ts`).
453
+
454
+ ## Known limitations (phase 2)
455
+
456
+ - Installed fragments are the EN canonical source; pt-BR fragment rendering is
457
+ pending.
458
+ - `--help`/command descriptions (commander wiring) stay EN — they resolve
459
+ before the target repo (and its manifest language) is known.
460
+ - Before provisioning, the machine-local random salt means the same email can
461
+ yield different devIds on different machines. Resolved in phase 3 for
462
+ platform clients: `keys provision` writes the client-stable
463
+ `deriveClientSalt(masterKey)` salt (and `--rederive` migrates a legacy id);
464
+ repos that never provision keep per-machine ids (`doctor` warns).
465
+ - `invi update` re-renders `.claude/agents/` only when
466
+ `.invictus/interview.json` exists (written by init since phase 5); older
467
+ installs keep the skip-with-warning behavior until init is re-run.
468
+
469
+ ## Tests
470
+
471
+ ```bash
472
+ npm install # from the monorepo root (workspace deps)
473
+ npm test --workspace=@invictus-group-ai/orchestra
474
+ ```
475
+
476
+ Covers: detection on fixture repos (Next.js app, FastAPI service, pnpm/turbo
477
+ monorepo with per-workspace detection) including the derived Python test
478
+ commands, CLAUDE.md generation snapshot + marker-splice preservation, settings
479
+ deep-merge preserving pre-existing hooks (+ idempotence), manifest and
480
+ inventory round-trips, scripted interview runs, an end-to-end `init --yes` on
481
+ a temp repo, doctor drift cases, journal chaining, `keys provision`
482
+ (derivation, refusal on version-controlled paths, master key never persisted,
483
+ two-machine stable-devId determinism, legacy-id keep-by-default + `--rederive`
484
+ switch), `map` (front-matter validation, marked-section extraction from
485
+ fixture docs, agent re-render idempotence, customized-agent skip, `--check`
486
+ pending/staleness reporting),
487
+ `sync` wire-format against a mock `node:http` platform (exact headers/body,
488
+ ≤500 batching, watermark from response, offline + HTTP-error behavior), the
489
+ diff3 merger, `update` (clean replace, clean merge, conflict sidecar,
490
+ CLAUDE.local.md untouchable, PROJECT FACTS regeneration, skill additions),
491
+ the `update` registry fetch against a mock `node:http` registry serving the
492
+ npm-view JSON plus a REAL `npm pack` tarball (newer-version download +
493
+ extraction + merge, per-version cache hit, not-newer/offline/integrity-failure
494
+ degradation to the local layer, `INVICTUS_CONTENT_DIR` and `contentDir`
495
+ overrides winning),
496
+ the task/gate verbs (exhaustive §3 legality matrix, create validation +
497
+ round-trip, gate→state advancement, event-chain integrity, and a CLI-level
498
+ create→gates→pr_open flow through the real binary), and
499
+ content-dir resolution order. The publish surface has its own permanent gate:
500
+ `npm run test:tarball` at the monorepo root (`scripts/test-tarball.mjs`) packs
501
+ all three packages, installs the tarballs into a clean fixture outside the
502
+ monorepo, runs `npx invi init --yes` end-to-end and asserts the bundled
503
+ content resolves, VERIFY passes with hooks running, and the
504
+ `INVICTUS_CONTENT_DIR` override still wins (see PUBLISHING.md). When the private `invictus-platform` checkout
505
+ sits next to this monorepo with `dist/` built and deps installed, a LIVE
506
+ round-trip test boots it on an ephemeral port and syncs real batches
507
+ (`test/platform-live.test.ts` — skips cleanly otherwise).