sinapse-ai 9.4.0 → 9.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 (266) hide show
  1. package/.claude/CLAUDE.md +10 -4
  2. package/.claude/hooks/enforce-architecture-first.py +197 -197
  3. package/.claude/hooks/enforce-git-push-authority.sh +25 -4
  4. package/.claude/hooks/mind-clone-governance.py +193 -193
  5. package/.claude/hooks/read-protection.py +152 -152
  6. package/.claude/hooks/sql-governance.py +183 -183
  7. package/.claude/hooks/verify-packages.cjs +83 -0
  8. package/.claude/hooks/write-path-validation.py +195 -195
  9. package/.claude/rules/hook-governance.md +1 -0
  10. package/.claude/rules/mandatory-delegation.md +24 -0
  11. package/.claude/rules/project-intelligence.md +63 -0
  12. package/.claude/rules/response-format.md +4 -0
  13. package/.claude/rules/safe-collaboration.md +4 -2
  14. package/.claude/rules/security-data-protection.md +18 -0
  15. package/.claude/rules/squad-awareness.md +93 -67
  16. package/.claude/rules/token-economy.md +148 -0
  17. package/.codex/agents/analyst.md +90 -0
  18. package/.codex/agents/architect.md +78 -0
  19. package/.codex/agents/data-engineer.md +38 -0
  20. package/.codex/agents/developer.md +97 -0
  21. package/.codex/agents/devops.md +121 -0
  22. package/.codex/agents/product-lead.md +27 -0
  23. package/.codex/agents/project-lead.md +28 -0
  24. package/.codex/agents/quality-gate.md +89 -0
  25. package/.codex/agents/sprint-lead.md +28 -0
  26. package/.codex/agents/squad-creator.md +58 -0
  27. package/.codex/agents/ux-design-expert.md +28 -0
  28. package/.sinapse-ai/core/code-intel/registry-syncer.js +56 -3
  29. package/.sinapse-ai/core/doctor/checks/agent-memory.js +5 -1
  30. package/.sinapse-ai/core/doctor/checks/claude-md.js +4 -1
  31. package/.sinapse-ai/core/doctor/checks/code-intel.js +5 -1
  32. package/.sinapse-ai/core/doctor/checks/commands-count.js +4 -1
  33. package/.sinapse-ai/core/doctor/checks/constitution-consistency.js +4 -1
  34. package/.sinapse-ai/core/doctor/checks/core-config.js +4 -1
  35. package/.sinapse-ai/core/doctor/checks/entity-registry.js +6 -1
  36. package/.sinapse-ai/core/doctor/checks/git-hooks.js +5 -1
  37. package/.sinapse-ai/core/doctor/checks/graph-dashboard.js +4 -1
  38. package/.sinapse-ai/core/doctor/checks/hooks-claude-count.js +5 -1
  39. package/.sinapse-ai/core/doctor/checks/ide-sync.js +4 -1
  40. package/.sinapse-ai/core/doctor/checks/node-version.js +4 -1
  41. package/.sinapse-ai/core/doctor/checks/npm-packages.js +4 -1
  42. package/.sinapse-ai/core/doctor/checks/rules-files.js +4 -1
  43. package/.sinapse-ai/core/doctor/checks/settings-json.js +4 -1
  44. package/.sinapse-ai/core/doctor/checks/skills-count.js +4 -1
  45. package/.sinapse-ai/core/doctor/index.js +157 -50
  46. package/.sinapse-ai/core/ids/registry-updater.js +6 -1
  47. package/.sinapse-ai/core/logger/index.js +319 -0
  48. package/.sinapse-ai/core/orchestration/terminal-spawner.js +2 -2
  49. package/.sinapse-ai/core/telemetry/index.js +247 -0
  50. package/.sinapse-ai/data/entity-registry.yaml +1384 -944
  51. package/.sinapse-ai/development/agents/architect.md +5 -0
  52. package/.sinapse-ai/development/agents/data-engineer.md +38 -0
  53. package/.sinapse-ai/development/agents/developer.md +28 -0
  54. package/.sinapse-ai/development/agents/devops.md +4 -0
  55. package/.sinapse-ai/development/agents/product-lead.md +27 -0
  56. package/.sinapse-ai/development/agents/project-lead.md +28 -0
  57. package/.sinapse-ai/development/agents/quality-gate.md +4 -0
  58. package/.sinapse-ai/development/agents/sprint-lead/MEMORY.md +8 -0
  59. package/.sinapse-ai/development/agents/sprint-lead.md +28 -0
  60. package/.sinapse-ai/development/agents/squad-creator.md +58 -0
  61. package/.sinapse-ai/development/agents/ux-design-expert.md +28 -0
  62. package/.sinapse-ai/development/knowledge-base/agent-communication-protocol.md +127 -0
  63. package/.sinapse-ai/development/knowledge-base/database-scaling-patterns.md +374 -0
  64. package/.sinapse-ai/development/knowledge-base/environment-deployment-patterns.md +353 -0
  65. package/.sinapse-ai/development/knowledge-base/gotchas-patterns.md +224 -0
  66. package/.sinapse-ai/development/knowledge-base/infrastructure-decision-framework.md +221 -0
  67. package/.sinapse-ai/development/knowledge-base/security-pre-deploy-checklist.md +410 -0
  68. package/.sinapse-ai/development/knowledge-base/software-architecture-patterns.md +299 -0
  69. package/.sinapse-ai/development/knowledge-base/token-economy-guide.md +198 -0
  70. package/.sinapse-ai/development/scripts/populate-entity-registry.js +5 -1
  71. package/.sinapse-ai/development/skills/captcha-handler.md +82 -0
  72. package/.sinapse-ai/development/skills/chrome-brain.md +81 -0
  73. package/.sinapse-ai/development/skills/deploy-readiness.md +93 -0
  74. package/.sinapse-ai/development/skills/model-router.md +92 -0
  75. package/.sinapse-ai/development/skills/sinapse-methodology.md +175 -0
  76. package/.sinapse-ai/development/skills/story-fast-track.md +71 -0
  77. package/.sinapse-ai/development/tasks/dev-develop-story.md +10 -0
  78. package/.sinapse-ai/development/tasks/environment-promotion-pipeline.md +582 -0
  79. package/.sinapse-ai/development/tasks/generate-agent-handoff.md +223 -0
  80. package/.sinapse-ai/development/tasks/infrastructure-assessment.md +432 -0
  81. package/.sinapse-ai/development/tasks/load-testing-setup.md +611 -0
  82. package/.sinapse-ai/development/tasks/observability-blueprint.md +562 -0
  83. package/.sinapse-ai/development/templates/legal/breach-notification-tmpl.md +113 -0
  84. package/.sinapse-ai/development/templates/legal/privacy-policy-tmpl.md +93 -0
  85. package/.sinapse-ai/development/templates/legal/terms-of-service-tmpl.md +85 -0
  86. package/.sinapse-ai/development/templates/service-template/README.md.hbs +159 -159
  87. package/.sinapse-ai/development/templates/service-template/__tests__/index.test.ts.hbs +238 -238
  88. package/.sinapse-ai/development/templates/service-template/client.ts.hbs +404 -404
  89. package/.sinapse-ai/development/templates/service-template/errors.ts.hbs +183 -183
  90. package/.sinapse-ai/development/templates/service-template/index.ts.hbs +121 -121
  91. package/.sinapse-ai/development/templates/service-template/package.json.hbs +88 -88
  92. package/.sinapse-ai/development/templates/service-template/types.ts.hbs +146 -146
  93. package/.sinapse-ai/development/templates/squad-template/LICENSE +22 -22
  94. package/.sinapse-ai/development/workflows/story-development-cycle.yaml +40 -1
  95. package/.sinapse-ai/hooks/ids-post-commit.js +22 -0
  96. package/.sinapse-ai/infrastructure/contracts/compatibility/README.md +42 -0
  97. package/.sinapse-ai/infrastructure/contracts/compatibility/sinapse-current.yaml +35 -0
  98. package/.sinapse-ai/infrastructure/scripts/llm-routing/templates/claude-free-tracked.cmd +127 -127
  99. package/.sinapse-ai/infrastructure/scripts/llm-routing/templates/deepseek-proxy.cmd +71 -71
  100. package/.sinapse-ai/infrastructure/scripts/llm-routing/templates/deepseek-usage.cmd +51 -51
  101. package/.sinapse-ai/infrastructure/scripts/pr-review-ai.js +16 -13
  102. package/.sinapse-ai/infrastructure/scripts/setup-project-infra.js +128 -0
  103. package/.sinapse-ai/infrastructure/scripts/test-discovery.js +8 -3
  104. package/.sinapse-ai/infrastructure/scripts/validate-manifest-parity.js +380 -0
  105. package/.sinapse-ai/infrastructure/scripts/validate-parity.js +76 -25
  106. package/.sinapse-ai/infrastructure/templates/coderabbit.yaml.template +280 -280
  107. package/.sinapse-ai/infrastructure/templates/config/env.example +16 -0
  108. package/.sinapse-ai/infrastructure/templates/config/gitignore-additions.tmpl +59 -0
  109. package/.sinapse-ai/infrastructure/templates/github/CODEOWNERS.template +12 -0
  110. package/.sinapse-ai/infrastructure/templates/github/PULL_REQUEST_TEMPLATE.md +29 -0
  111. package/.sinapse-ai/infrastructure/templates/github/ci-template.yml +77 -0
  112. package/.sinapse-ai/infrastructure/templates/github/issue-templates/bug_report.md +34 -0
  113. package/.sinapse-ai/infrastructure/templates/github/issue-templates/feature_request.md +19 -0
  114. package/.sinapse-ai/infrastructure/templates/github-workflows/ci.yml.template +170 -170
  115. package/.sinapse-ai/infrastructure/templates/github-workflows/pr-automation.yml.template +331 -331
  116. package/.sinapse-ai/infrastructure/templates/github-workflows/release.yml.template +197 -197
  117. package/.sinapse-ai/infrastructure/templates/gitignore/gitignore-brownfield-merge.tmpl +19 -19
  118. package/.sinapse-ai/infrastructure/templates/gitignore/gitignore-node.tmpl +86 -86
  119. package/.sinapse-ai/infrastructure/templates/gitignore/gitignore-python.tmpl +146 -146
  120. package/.sinapse-ai/infrastructure/templates/gitignore/gitignore-sinapse-base.tmpl +64 -64
  121. package/.sinapse-ai/infrastructure/templates/sinapse-sync.yaml.template +183 -183
  122. package/.sinapse-ai/install-manifest.yaml +275 -140
  123. package/.sinapse-ai/local-config.yaml.template +65 -65
  124. package/.sinapse-ai/monitor/hooks/lib/__init__.py +2 -2
  125. package/.sinapse-ai/monitor/hooks/lib/enrich.py +59 -59
  126. package/.sinapse-ai/monitor/hooks/lib/send_event.py +48 -48
  127. package/.sinapse-ai/monitor/hooks/notification.py +30 -30
  128. package/.sinapse-ai/monitor/hooks/post_tool_use.py +46 -46
  129. package/.sinapse-ai/monitor/hooks/pre_compact.py +30 -30
  130. package/.sinapse-ai/monitor/hooks/pre_tool_use.py +41 -41
  131. package/.sinapse-ai/monitor/hooks/stop.py +30 -30
  132. package/.sinapse-ai/monitor/hooks/subagent_stop.py +30 -30
  133. package/.sinapse-ai/monitor/hooks/user_prompt_submit.py +39 -39
  134. package/.sinapse-ai/product/templates/adr.hbs +126 -126
  135. package/.sinapse-ai/product/templates/dbdr.hbs +242 -242
  136. package/.sinapse-ai/product/templates/epic.hbs +213 -213
  137. package/.sinapse-ai/product/templates/pmdr.hbs +187 -187
  138. package/.sinapse-ai/product/templates/prd-v2.0.hbs +217 -217
  139. package/.sinapse-ai/product/templates/prd.hbs +202 -202
  140. package/.sinapse-ai/product/templates/story-tmpl.yaml +59 -0
  141. package/.sinapse-ai/product/templates/story.hbs +264 -264
  142. package/.sinapse-ai/product/templates/task.hbs +171 -171
  143. package/.sinapse-ai/product/templates/tmpl-comment-on-examples.sql +159 -159
  144. package/.sinapse-ai/product/templates/tmpl-migration-script.sql +92 -92
  145. package/.sinapse-ai/product/templates/tmpl-rls-granular-policies.sql +105 -105
  146. package/.sinapse-ai/product/templates/tmpl-rls-kiss-policy.sql +11 -11
  147. package/.sinapse-ai/product/templates/tmpl-rls-roles.sql +136 -136
  148. package/.sinapse-ai/product/templates/tmpl-rls-simple.sql +78 -78
  149. package/.sinapse-ai/product/templates/tmpl-rls-tenant.sql +153 -153
  150. package/.sinapse-ai/product/templates/tmpl-rollback-script.sql +78 -78
  151. package/.sinapse-ai/product/templates/tmpl-seed-data.sql +141 -141
  152. package/.sinapse-ai/product/templates/tmpl-smoke-test.sql +17 -17
  153. package/.sinapse-ai/product/templates/tmpl-staging-copy-merge.sql +140 -140
  154. package/.sinapse-ai/product/templates/tmpl-stored-proc.sql +141 -141
  155. package/.sinapse-ai/product/templates/tmpl-trigger.sql +153 -153
  156. package/.sinapse-ai/product/templates/tmpl-view-materialized.sql +134 -134
  157. package/.sinapse-ai/product/templates/tmpl-view.sql +178 -178
  158. package/.sinapse-ai/scripts/diagnostics/health-dashboard/package-lock.json +427 -355
  159. package/LICENSE +34 -34
  160. package/README.en.md +167 -20
  161. package/README.md +190 -22
  162. package/bin/cli.js +510 -196
  163. package/bin/postinstall.js +564 -0
  164. package/bin/sinapse-cli +283 -283
  165. package/bin/sinapse-graph.js +9 -0
  166. package/bin/sinapse-init.js +36 -4
  167. package/bin/sinapse-minimal.js +20 -9
  168. package/bin/sinapse.js +202 -122
  169. package/bin/utils/deprecation-warning.js +46 -0
  170. package/bin/utils/pre-push-safety.js +14 -0
  171. package/docs/TELEMETRY.md +131 -0
  172. package/docs/chrome-brain-upgrade-plan.md +624 -0
  173. package/docs/framework/orqx-plan.md +1 -1
  174. package/docs/installation/chrome-brain.md +17 -7
  175. package/docs/mega-upgrade-orchestration-plan.md +71 -0
  176. package/docs/pt/contributing.md +20 -0
  177. package/docs/research-synthesis-for-upgrade.md +511 -0
  178. package/docs/security-audit-report.md +306 -0
  179. package/package.json +20 -8
  180. package/packages/installer/src/config/configure-environment.js +19 -44
  181. package/packages/installer/src/detection/detect-project-type.js +181 -63
  182. package/packages/installer/src/installer/manifest-signature.js +32 -17
  183. package/packages/installer/src/wizard/i18n.js +12 -0
  184. package/packages/installer/src/wizard/ide-config-generator.js +8 -39
  185. package/packages/installer/src/wizard/index.js +119 -14
  186. package/packages/installer/src/wizard/questions.js +2 -3
  187. package/packages/installer/tests/integration/environment-configuration.test.js +7 -5
  188. package/packages/installer/tests/unit/detection/detect-project-type.test.js +138 -1
  189. package/packages/installer/tests/unit/doctor/doctor-orchestrator.test.js +3 -3
  190. package/packages/sinapse-install/bin/edmcp.js +0 -0
  191. package/packages/sinapse-install/bin/sinapse-install.js +0 -0
  192. package/packages/sinapse-pro-cli/bin/sinapse-pro.js +0 -0
  193. package/scripts/check-markdown-links.py +353 -353
  194. package/scripts/coverage-report-summary.js +169 -0
  195. package/scripts/generate-install-manifest.js +6 -2
  196. package/scripts/release-readiness.js +169 -0
  197. package/scripts/test-install-matrix-local.sh +153 -0
  198. package/scripts/validate-install-docs.js +394 -0
  199. package/scripts/validate-no-external-refs.js +376 -0
  200. package/scripts/validate-squad-orqx.js +302 -0
  201. package/scripts/validate-story-meta.js +263 -0
  202. package/squads/claude-code-mastery/CHANGELOG.md +1 -1
  203. package/squads/claude-code-mastery/README.md +2 -2
  204. package/squads/claude-code-mastery/squad.yaml +1 -1
  205. package/squads/squad-artdir/README.md +90 -0
  206. package/squads/squad-artdir/agents/accessibility-guardian.md +184 -0
  207. package/squads/squad-artdir/agents/artdir-orqx.md +145 -0
  208. package/squads/squad-artdir/agents/color-psychologist.md +166 -0
  209. package/squads/squad-artdir/agents/cro-persuasion.md +161 -0
  210. package/squads/squad-artdir/agents/design-system-architect.md +100 -0
  211. package/squads/squad-artdir/agents/ia-architect.md +169 -0
  212. package/squads/squad-artdir/agents/interaction-designer.md +162 -0
  213. package/squads/squad-artdir/agents/layout-engineer.md +163 -0
  214. package/squads/squad-artdir/agents/motion-architect.md +185 -0
  215. package/squads/squad-artdir/agents/platform-aesthetic-director.md +84 -0
  216. package/squads/squad-artdir/agents/premium-packaging-strategist.md +107 -0
  217. package/squads/squad-artdir/agents/product-surface-director.md +86 -0
  218. package/squads/squad-artdir/agents/type-systemist.md +138 -0
  219. package/squads/squad-artdir/agents/visual-strategist.md +127 -0
  220. package/squads/squad-artdir/checklists/seven-pillars-validation-checklist.md +172 -0
  221. package/squads/squad-artdir/knowledge-base/case-nyo-ia-reference.md +289 -0
  222. package/squads/squad-artdir/knowledge-base/deliverables-templates.md +457 -0
  223. package/squads/squad-artdir/knowledge-base/motion-technique-catalog.md +247 -0
  224. package/squads/squad-artdir/knowledge-base/premium-packaging-principles.md +133 -0
  225. package/squads/squad-artdir/knowledge-base/psychological-toolkit.md +229 -0
  226. package/squads/squad-artdir/knowledge-base/saas-art-direction-canon.md +242 -0
  227. package/squads/squad-artdir/knowledge-base/seven-pillars-framework.md +289 -0
  228. package/squads/squad-artdir/knowledge-base/ten-pillars-framework.md +221 -0
  229. package/squads/squad-artdir/package.json +20 -0
  230. package/squads/squad-artdir/squad.yaml +271 -0
  231. package/squads/squad-artdir/tasks/audit-conversion.md +97 -0
  232. package/squads/squad-artdir/tasks/audit-drift-multi-surface.md +55 -0
  233. package/squads/squad-artdir/tasks/consult-saas-canon.md +54 -0
  234. package/squads/squad-artdir/tasks/create-art-direction-brief.md +110 -0
  235. package/squads/squad-artdir/tasks/create-premium-packaging-brief.md +61 -0
  236. package/squads/squad-artdir/tasks/create-wireflow.md +84 -0
  237. package/squads/squad-artdir/tasks/design-color-system.md +81 -0
  238. package/squads/squad-artdir/tasks/design-product-surface.md +60 -0
  239. package/squads/squad-artdir/tasks/design-token-system.md +58 -0
  240. package/squads/squad-artdir/tasks/diagnose-visual-language.md +92 -0
  241. package/squads/squad-artdir/tasks/first-5-minutes-choreography.md +65 -0
  242. package/squads/squad-artdir/tasks/specify-motion-system.md +84 -0
  243. package/squads/squad-artdir/tasks/validate-against-pillars.md +143 -0
  244. package/squads/squad-artdir/templates/art-direction-brief-template.md +215 -0
  245. package/squads/squad-artdir/workflows/conversion-audit-cycle.yaml +78 -0
  246. package/squads/squad-artdir/workflows/full-art-direction-cycle.yaml +98 -0
  247. package/squads/squad-artdir/workflows/saas-platform-art-direction-cycle.yaml +174 -0
  248. package/squads/squad-brand/knowledge-base/ai-visual-generation-canon.md +234 -0
  249. package/squads/squad-brand/squad.yaml +20 -6
  250. package/squads/squad-claude/knowledge-base/context-window-optimization.md +1 -1
  251. package/squads/squad-claude/knowledge-base/swarm-orchestration-patterns.md +2 -2
  252. package/squads/squad-content/knowledge-base/ai-native-content-loop.md +220 -0
  253. package/squads/squad-content/knowledge-base/signal-intelligence-v2.md +234 -0
  254. package/squads/squad-content/knowledge-base/task-ownership-map.md +235 -0
  255. package/squads/squad-content/squad.yaml +187 -27
  256. package/squads/squad-copy/knowledge-base/ai-copy-human-loop-canon.md +235 -0
  257. package/squads/squad-copy/squad.yaml +19 -4
  258. package/squads/squad-design/knowledge-base/cross-surface-token-canon.md +209 -0
  259. package/squads/squad-design/squad.yaml +19 -4
  260. package/.sinapse-ai/core/registry/service-registry.json +0 -6346
  261. package/.sinapse-ai/data/registry-update-log.jsonl +0 -1323
  262. package/.sinapse-ai/manifests/agents.csv +0 -29
  263. package/.sinapse-ai/manifests/tasks.csv +0 -204
  264. package/.sinapse-ai/manifests/workers.csv +0 -196
  265. package/squads/squad-growth/tasks/calculate-sample-size.md +0 -121
  266. package/squads/squad-paidmedia/tasks/calculate-sample-size.md +0 -57
@@ -0,0 +1,234 @@
1
+ # Knowledge Base: AI Visual Generation Canon
2
+
3
+ > **Status:** Canon — canonical source of truth for how `squad-brand` (Meridian) produces brand-consistent visual output at scale using AI image/video models.
4
+ > **Version:** 1.0 (shipped with squad-brand v2.0.0 framework-upgrade / fw-v2.3)
5
+ > **Depends on:** `ai-api-capabilities.md` (capability catalog), `prompt-engineering-visual.md` (prompt mechanics)
6
+ > **Supersedes:** ad-hoc generation workflows
7
+
8
+ ## Why this doc exists
9
+
10
+ `ai-api-capabilities.md` is a **catalog** — "which API does what". `prompt-engineering-visual.md` is a **mechanics reference** — "how to write a prompt". Neither is a **canon** — "the rules that must hold for every brand asset we ship". In 2026, ~80% of brand visual production runs through AI models, and the gap between "I generated something that looks cool" and "I generated something that is on-brand and legally safe to ship" is the single biggest risk factor for brand drift.
11
+
12
+ This KB is the canonical playbook. Every agent in `squad-brand` that produces visual assets (brand-collateral-designer, brand-identity-designer, brand-motion-vfx, brand-creative-engineer) MUST comply with this canon for any asset that will leave the studio.
13
+
14
+ ---
15
+
16
+ ## 1. The 5 brand-consistency dimensions (lock these, always)
17
+
18
+ Every batch of AI-generated visual output is judged on 5 dimensions. Each dimension has a **lock protocol** — the concrete steps that enforce consistency across a batch, across sessions, across months.
19
+
20
+ ### 1.1 Style lock
21
+
22
+ **What it means:** The "visual vocabulary" — illustration style, render style, graphic sensibility. A batch must NOT mix photorealistic shots with flat illustrations unless the brand canon explicitly allows both.
23
+
24
+ **Lock protocol:**
25
+ 1. Declare the style in the brand canon (e.g. "editorial photography, natural light, medium grain").
26
+ 2. For each generation session, prepend the exact canon style phrase to every prompt.
27
+ 3. Pin 1-3 reference images in the model session (every modern model accepts reference input — Midjourney `--cref`, Stable Diffusion IP-Adapter, DALL-E upload, Flux img2img).
28
+ 4. If the model drifts mid-batch, STOP and re-seed with the reference — never "work around" drift in post.
29
+
30
+ ### 1.2 Lighting lock
31
+
32
+ **What it means:** Direction, hardness, color temperature, time-of-day. Lighting is the highest-signal brand marker after color and is often the first thing that drifts.
33
+
34
+ **Lock protocol:**
35
+ 1. Codify lighting in the canon: direction (N-SW 45°), hardness (soft/medium/hard), color temp (K), intensity (flat/dimensional/dramatic).
36
+ 2. Use precise vocabulary in prompts — "soft north-light 5500K, subtle rim" beats "nice lighting".
37
+ 3. Reference-image lock handles lighting implicitly when the reference is on-brand.
38
+ 4. For video: lock AFTER first frame — subsequent frames must inherit the anchor frame's lighting.
39
+
40
+ ### 1.3 Palette lock
41
+
42
+ **What it means:** Every color in the output must either be in the brand palette OR be a naturalistic color that the brand palette allows in context (e.g. skin tones, sky).
43
+
44
+ **Lock protocol:**
45
+ 1. Brand canon declares: primary palette (3-5 colors), secondary palette (5-10), neutrals (3-5), allowed environmental colors (context-dependent).
46
+ 2. Prompts reference specific named colors ("cerulean #1E40AF, warm ivory #FAF8F1").
47
+ 3. Post-generation palette extraction — run a script (or visual check) on the output against the declared palette. Any color > 5% area that is NOT in the allowed set is a FAIL.
48
+ 4. For illustrations/vectors: use a color-palette LUT or Figma variable binding to hard-lock at the design-tool layer.
49
+
50
+ ### 1.4 Subject lock
51
+
52
+ **What it means:** The specific entity (person, product, space) must be recognizably the same across all shots in a batch. This is the most technically demanding dimension and the one where naive prompting fails hardest.
53
+
54
+ **Lock protocol:**
55
+ 1. For **real people/products** the brand owns: use a trained LoRA / DreamBooth / textual inversion model of the subject (or Midjourney `--cref` / Flux reference).
56
+ 2. For **synthetic characters** that recur: lock via seed + prompt signature + reference image pinning. Treat the first accepted generation as the canonical reference and build the LoRA from the batch.
57
+ 3. For **products**: the reference image is the source of truth — every shot is inpainting/compositing, not free generation. Never trust a pure text-to-image generation of a real product.
58
+ 4. When the subject is **generic** (a crowd, a landscape): no subject lock required but the other 4 dimensions still apply.
59
+
60
+ ### 1.5 Composition lock
61
+
62
+ **What it means:** Framing, aspect, focal points, negative space behavior. Composition is the dimension most often "drifted" by AI models because they default to centered hero compositions.
63
+
64
+ **Lock protocol:**
65
+ 1. Specify aspect explicitly in every prompt (aspect params, `--ar`, output resolution).
66
+ 2. Specify framing vocabulary: close-up / medium / wide / establishing, eye-level / low / high angle.
67
+ 3. For batches that need composition variety: define the variety upfront (3 framings × 2 angles = 6-cell grid) and generate per cell, not free.
68
+ 4. For templates (social media slots, email headers): use ControlNet/reference with the canonical layout wireframe.
69
+
70
+ ---
71
+
72
+ ## 2. Model selection matrix (when to use which)
73
+
74
+ | Output type | First choice | Second choice | When to use which |
75
+ |-------------|-------------|---------------|-------------------|
76
+ | Hero editorial photography | Flux / Midjourney v6+ | Stable Diffusion + SDXL refiner | Flux for realism + control, MJ for aesthetic polish |
77
+ | Product shots on white | Stable Diffusion + ControlNet | DALL-E 3 edit | SD for compositing precision, DALL-E when product reference isn't available |
78
+ | Illustration series | Midjourney + style LoRA | Flux + reference image | MJ has the best style coherence for non-photo |
79
+ | Text-in-image (posters, quote cards) | Ideogram | DALL-E 3 | Ideogram is the only model with reliable text rendering in 2026 |
80
+ | Character consistency across batch | LoRA-trained Flux / SD | Midjourney `--cref` | Train once, reuse everywhere |
81
+ | Product in lifestyle scene | SD img2img with product reference | Photoroom API → AI background | SD if you need the product to exist; Photoroom if you have the product photo and need the context |
82
+ | Video (short, 2-5 sec) | Runway Gen-3 / Kling 2.0 | Pika Labs | Runway for cinematography, Kling for physical realism |
83
+ | Motion graphics | Figma → Rive → Lottie | After Effects + plugin generation | Stay vector whenever possible — AI video is still expensive per second and drift-prone |
84
+ | Brand animation (logo, intro) | Manual (After Effects / Rive) | — | Brand logo motion is canon — NEVER free-generate, always hand-authored |
85
+
86
+ **Rule:** If the output will carry the **wordmark**, the **logomark**, or a **recognizable brand character**, the AI model is assisting a human motion designer, not driving the work. Free-generation is banned for identity-critical assets.
87
+
88
+ ---
89
+
90
+ ## 3. Style-lock techniques (detailed reference)
91
+
92
+ ### 3.1 Reference images
93
+ - Always the first line of defense. Modern models all support it.
94
+ - Pin 1-3 references — more than 3 causes the model to average and lose specificity.
95
+ - References should be EXACT matches for the dimensions you're locking (style reference for style, subject reference for subject, composition reference for composition).
96
+
97
+ ### 3.2 LoRA / DreamBooth / textual inversion
98
+ - For recurring subjects or recurring style, train a LoRA (recommended: 15-50 images, 1500-3000 steps on SDXL or Flux).
99
+ - LoRA is the most reliable lock for subject + style. It's an hour of setup that saves weeks of re-prompting.
100
+ - Maintain a LoRA registry per brand: `brands/{brand}/loras/{subject}/v{n}.safetensors` with changelog.
101
+
102
+ ### 3.3 Seed control
103
+ - Locking a seed pins one axis of randomness. Useful for A/B style tests (same seed, different prompts).
104
+ - NOT sufficient alone — same seed + different prompt still drifts.
105
+
106
+ ### 3.4 ControlNet / Canny / depth / pose
107
+ - Pin composition and structure via a control map derived from a wireframe/sketch.
108
+ - Essential for templated outputs (social media slot layouts, email header banners).
109
+ - Control + LoRA + seed = maximum lock.
110
+
111
+ ### 3.5 Negative prompts
112
+ - Every brand canon should include a banned vocabulary list. Hard-code the list into every prompt as negatives.
113
+ - Example bans: "watermark", "logo overlay", "low quality", "deformed", "stock photo look", plus brand-specific bans.
114
+
115
+ ---
116
+
117
+ ## 4. Batch consistency QA checklist (mandatory per batch)
118
+
119
+ Before any batch ships out of the studio, it MUST pass this checklist:
120
+
121
+ | # | Check | Threshold | Action if FAIL |
122
+ |---|-------|-----------|---------------|
123
+ | 1 | Style dimension matches canon reference | Visual inspection | Regenerate with style reference |
124
+ | 2 | Lighting dimension matches canon | Visual inspection | Regenerate with lighting reference |
125
+ | 3 | Palette extraction — all > 5% colors in allowed set | Script / visual | Color-correct or regenerate |
126
+ | 4 | Subject dimension — same entity across all shots where required | Visual + reference comparison | Regenerate with stronger LoRA/reference |
127
+ | 5 | Composition dimension — matches declared framing grid | Visual | Regenerate per cell |
128
+ | 6 | Text accuracy (if text-in-image) — spelling, hierarchy | Proofread | Regenerate with Ideogram or DALL-E |
129
+ | 7 | Face/hand anatomy sanity check | Visual | Inpaint fixes or regenerate |
130
+ | 8 | Watermark / model artifact absence | Visual | Remove via inpaint |
131
+ | 9 | Resolution meets delivery spec | Metadata check | Upscale via Topaz / Flux refiner |
132
+ | 10 | No unintended text/logos visible (hallucinated signage, off-brand logos) | Visual | Inpaint away |
133
+
134
+ **A batch that fails any check does not ship. Period.** The batch goes back to regeneration. Partial passes are not acceptable — AI generation is cheap enough that "re-run the batch" is always the right call.
135
+
136
+ ---
137
+
138
+ ## 5. Legal / IP guardrails (non-negotiable)
139
+
140
+ ### 5.1 Training data provenance
141
+ - Prefer models with documented training data (Adobe Firefly, Getty Generative, Flux-with-license).
142
+ - For SD/MJ/DALL-E: check the brand's legal policy on generative use. Some brands forbid models trained on scraped web data.
143
+ - If the model is used for backgrounds or textures where likeness doesn't matter, provenance is lower-risk.
144
+ - If the model is used for faces, characters, or recognizable art styles, provenance is high-risk — prefer trained-LoRA approach with brand-owned training data.
145
+
146
+ ### 5.2 Commercial-use flags
147
+ - Every delivered asset must have a logged "commercial use cleared" status.
148
+ - Required metadata per asset: model used, model license, prompt, seed, reference images used, LoRA(s) used, date.
149
+ - Store metadata in sidecar JSON or EXIF — never "in memory".
150
+
151
+ ### 5.3 Right of publicity (people's likenesses)
152
+ - NEVER generate outputs depicting a recognizable real person without signed release.
153
+ - Synthetic people generated by AI are OK if the output does not resemble any real celebrity (run a reverse-image check against known-persons databases before ship).
154
+ - Stock-model LoRAs (models who have signed releases for AI training) are the safest source when you need real-looking faces.
155
+
156
+ ### 5.4 Trademark avoidance
157
+ - Hallucinated logos, branded signage, branded products in scenes → inpaint away before ship.
158
+ - Crowd scenes and urban scenes are the #1 source of accidental trademark content.
159
+
160
+ ### 5.5 Copyright on style
161
+ - "In the style of [living artist]" → legally risky in many jurisdictions.
162
+ - "In the style of [public-domain / historical movement]" → safe.
163
+ - When in doubt, describe the style by its attributes (palette, brushwork, composition) rather than by attribution.
164
+
165
+ ---
166
+
167
+ ## 6. Generation session hygiene (operational discipline)
168
+
169
+ Every session of AI generation MUST produce:
170
+
171
+ 1. **Session log** — `brands/{brand}/generations/{yyyy-mm-dd}-{session-slug}/`
172
+ 2. **Per-asset metadata sidecar** — prompt, seed, model, LoRA(s), references, negative prompts.
173
+ 3. **The canonical brand references used** — copied into the session folder (no "floating" references).
174
+ 4. **The pass/fail log** per QA check (the 10 items in §4).
175
+ 5. **The final selects** — separated from rejects.
176
+ 6. **Commercial-use status** — signed off by the brand owner before ship.
177
+
178
+ Rejects are kept for ≥ 30 days (often useful as training data for the next LoRA) then archived or deleted per the brand's retention policy.
179
+
180
+ ---
181
+
182
+ ## 7. Batch orchestration patterns
183
+
184
+ | Pattern | When to use | Squad agents involved |
185
+ |---------|------------|----------------------|
186
+ | **Editorial set** (single concept, 5-15 variants) | Campaign hero + secondary shots | brand-creative-engineer drives, brand-identity-designer reviews |
187
+ | **Template grid** (N slots × M variants) | Social media calendar, email series | brand-collateral-designer owns grid definition, brand-creative-engineer generates |
188
+ | **Character series** (same subject, multiple scenes) | Recurring mascot, executive portraits | LoRA-first workflow, brand-identity-designer trains, brand-creative-engineer generates |
189
+ | **Mockup set** (product on N surfaces) | Brand presentation, pitch deck | Photoroom API / SD compositing, brand-collateral-designer owns |
190
+ | **Motion sequence** (logo intro, 3-6 sec) | Brand identity handoff to motion | Hand-authored by brand-motion-vfx, AI used only for assist (upscaling, cleanup) |
191
+
192
+ ---
193
+
194
+ ## 8. Anti-patterns (forbidden)
195
+
196
+ - **Generating a product shot from pure text-to-image** when a product reference photo exists. Always img2img / compositing when the product is real.
197
+ - **Mixing styles mid-batch without a canon rule allowing it.** If the brand canon says "editorial photography", a single flat illustration mid-batch is a FAIL.
198
+ - **Generating faces resembling real celebrities "for inspiration".** This is a legal landmine, not a creative shortcut.
199
+ - **"Fixing" drift in post.** If a batch drifted, regenerate. Don't color-correct your way out of a style mismatch.
200
+ - **Shipping without session metadata.** If you can't reproduce the asset later, you don't own it.
201
+ - **Using "in the style of [living artist]" prompts for brand-owned deliverables.** Legally and ethically risky.
202
+ - **Treating AI generation as "done" after the first acceptable output.** Every brand asset benefits from N:1 generate-to-ship ratio ≥ 5. Cheap to generate means pick the best, not pick the first.
203
+ - **Free-generating brand identity elements (logomark, wordmark, brand character).** Brand identity is a human craft, AI assists but doesn't drive.
204
+
205
+ ---
206
+
207
+ ## 9. Owner matrix (which squad-brand agent owns what)
208
+
209
+ | Canon element | Owner agent | Rationale |
210
+ |--------------|------------|-----------|
211
+ | Style lock + reference curation | brand-identity-designer | Owns the visual vocabulary |
212
+ | Lighting + palette lock | brand-creative-engineer | Owns the generation craft |
213
+ | Subject lock + LoRA training | brand-creative-engineer + brand-identity-designer | Joint: one trains, one approves |
214
+ | Composition lock + batch templates | brand-collateral-designer | Owns templated output |
215
+ | Batch QA (§4 checklist) | brand-auditor | Independent review, not the generator |
216
+ | Legal / IP guardrails | brand-legal-ip reference KB + brand-strategist sign-off | Strategic, not creative |
217
+ | Session hygiene + metadata | brand-creative-engineer | Operational discipline |
218
+ | Motion / video canon | brand-motion-vfx | Owns motion craft |
219
+ | Sonic (if multimodal) | brand-sonic-designer | Owns sonic craft — see `sonic-branding-principles.md` |
220
+
221
+ ---
222
+
223
+ ## 10. Reference index
224
+
225
+ - `squads/squad-brand/knowledge-base/ai-api-capabilities.md` — capability catalog (this squad)
226
+ - `squads/squad-brand/knowledge-base/prompt-engineering-visual.md` — prompt mechanics (this squad)
227
+ - `squads/squad-brand/knowledge-base/brand-legal-ip.md` — legal reference (this squad)
228
+ - `squads/squad-brand/knowledge-base/color-psychology.md` — palette theory (this squad)
229
+ - `squads/squad-brand/knowledge-base/brandbook-structure.md` — where the generated assets land
230
+ - `squads/squad-design/knowledge-base/cross-surface-token-canon.md` — how brand tokens propagate to product surfaces (design squad canon)
231
+
232
+ ## Change log
233
+
234
+ - **2026-04-12 (v1.0)** — Created as part of squad-brand v3.3 / fw-v2.3. Raises `ai-api-capabilities.md` and `prompt-engineering-visual.md` from "capability notes" to a canonical playbook covering the 5 brand-consistency dimensions with lock protocols, model selection matrix, batch QA checklist, legal/IP guardrails, and agent ownership matrix.
@@ -1,13 +1,13 @@
1
1
  # ══════════════════════════════════════════════════════════════════════════════
2
- # SQUAD MANIFEST — squad-brand v3.2
2
+ # SQUAD MANIFEST — squad-brand v3.3
3
3
  # ══════════════════════════════════════════════════════════════════════════════
4
4
  # The world-class brand system squad for creating, managing and evolving
5
5
  # complete brand systems — from strategic positioning to compiled brandbook.
6
- # 15 agents | 97 tasks | 4 workflows | 19 KBs | 6 templates | Full coverage
6
+ # 15 agents | 97 tasks | 4 workflows | 30 KBs | 6 templates | Full coverage
7
7
  # ══════════════════════════════════════════════════════════════════════════════
8
8
 
9
9
  name: squad-brand
10
- version: 3.2.0
10
+ version: 3.3.0
11
11
  description: >
12
12
  Squad de classe mundial para criacao, gestao e evolucao de sistemas de marca
13
13
  completos. 15 agentes especialistas cobrindo 100% de um brand system world-class:
@@ -24,17 +24,31 @@ slashPrefix: SINAPSE
24
24
 
25
25
  metadata:
26
26
  created_at: "2026-03-11"
27
- updated_at: "2026-03-13"
27
+ updated_at: "2026-04-12"
28
28
  created_by: "squad-creator (Craft)"
29
29
  blueprint: "squads/.designs/squad-brand-design.yaml"
30
30
  quality_target: "5.0/5.0 em todas as dimensoes"
31
31
  agents_count: 15
32
32
  tasks_count: 97
33
- knowledge_bases_count: 19
33
+ knowledge_bases_count: 30
34
34
  checklists_count: 3
35
35
  templates_count: 6
36
36
  workflows_count: 4
37
- total_files: 143
37
+ total_files: 155
38
+
39
+ changelog:
40
+ - version: "3.3.0"
41
+ date: "2026-04-12"
42
+ story: fw-v2.3
43
+ epic: EPIC-framework-upgrade-v2
44
+ highlights:
45
+ - "Shipped ai-visual-generation-canon.md KB — raises ai-api-capabilities.md + prompt-engineering-visual.md from capability notes to canonical playbook. Covers the 5 brand-consistency dimensions with lock protocols (style/lighting/palette/subject/composition), model selection matrix, batch QA checklist, legal/IP guardrails, session hygiene, batch orchestration patterns, agent ownership matrix."
46
+ - "Reconciled knowledge_bases_count 19 -> 30 to match disk reality (drift accumulated over multiple minor releases)."
47
+ - "Minor version bump (additive-only, no breaking changes, no persona edits)."
48
+ breaking_changes: []
49
+ deferred_to_follow_up:
50
+ - "AC2 — brand-to-platform-token-bridge.md (partially superseded: squads/squad-design/knowledge-base/cross-surface-token-canon.md already defines the Nexus<->Atlas contract that includes Meridian upstream; a brand-side mirror doc remains useful for brand-originated handoffs but is lower priority)."
51
+ - "AC3 — brand-ops-playbook.md (separate canon doc, worthy but scoped out to avoid diluting AI visual canon shipment quality)."
38
52
 
39
53
  # ══════════════════════════════════════════════════════════════════════════════
40
54
  # QUALITY STANDARDS — Regras de Robustez (v3.2)
@@ -152,7 +152,7 @@ Only loaded when editing API files.
152
152
  - Historical context (why decisions were made)
153
153
  - Duplicate information
154
154
 
155
- ### 5. Document Sharding (BMAD Pattern)
155
+ ### 5. Document Sharding
156
156
 
157
157
  Large documents split into focused shards:
158
158
 
@@ -321,9 +321,9 @@ Workers request authorization for dangerous operations via a queue:
321
321
 
322
322
  ---
323
323
 
324
- ## BMAD Method Patterns
324
+ ## Spec-Driven Agile-AI Patterns
325
325
 
326
- BMAD (Breakthrough Method for Agile AI-Driven Development) v6 provides patterns SINAPSE can adopt.
326
+ External agile-AI methodologies focused on spec-first development with strong human-in-the-loop checkpoints provide patterns SINAPSE can adopt.
327
327
 
328
328
  ### Document Sharding
329
329
 
@@ -0,0 +1,220 @@
1
+ # AI-Native Content Loop — Canon Playbook
2
+
3
+ > **Status:** Canon (squad-content v2.0)
4
+ > **Owner:** content-orqx (Nexus) with cross-agent collaboration
5
+ > **Created:** 2026-04-12 for Story fw-v2.4
6
+ > **Relationship to existing KBs:** Builds on `content-spine-engine.md`, `ai-leverage-content-framework.md`, `content-measurement-framework.md` and `ai-content-production.md`. This KB is the **canonical end-to-end pipeline** — the other KBs are mechanisms inside phases of this loop.
7
+
8
+ ---
9
+
10
+ ## 1. Why This Exists
11
+
12
+ In 2026, the content pipeline for any mature SINAPSE user is no longer `brief → writer → editor → publish → measure`. AI assistance is now a load-bearing layer at every step, and the real bottleneck has shifted to **where humans intervene and why**.
13
+
14
+ This playbook canonizes the 6-phase loop that squad-content runs for every content program, regardless of client, language or platform. It makes the human-in-the-loop decision explicit so that AI-native work does not mean commodity work.
15
+
16
+ ## 2. The 6-Phase Loop
17
+
18
+ ```
19
+ ┌───────────────────────────────────────────────────────────────────────┐
20
+ │ │
21
+ │ 1. SIGNAL → 2. AI DRAFT → 3. HUMAN EDIT → 4. PLATFORM ADAPT → │
22
+ │ ↑ ↓ │
23
+ │ └────────── 6. RETROFEED ←── 5. MEASURE ←──────────┘ │
24
+ │ │
25
+ └───────────────────────────────────────────────────────────────────────┘
26
+ ```
27
+
28
+ The loop is **closed** on purpose. Phase 6 (Retrofeed) is what turns a one-shot pipeline into a compounding asset.
29
+
30
+ ---
31
+
32
+ ## 3. Phase-by-Phase Specification
33
+
34
+ ### Phase 1 — SIGNAL
35
+
36
+ | Field | Value |
37
+ |-------|-------|
38
+ | **Lead agent** | `signal-intelligence` (Radar) |
39
+ | **Inputs** | Editorial pillars, client brief, calendar gaps, opportunity windows |
40
+ | **Outputs** | Classified signal (type, temperature, pillar, opportunity window), signal brief (1 paragraph + evidence) |
41
+ | **Tool stack** | Google Trends, X/Twitter API v2, TikTok Research API, Reddit API, Apify actors, Substack RSS, YouTube Data API, Exploding Topics, SparkToro |
42
+ | **Quality gate** | Signal-quality score ≥ 3/5 on (relevance, novelty, evidence, actionability, pillar fit) |
43
+ | **Failure modes** | Low-evidence hype, pillar drift, redundant signal (already covered), stale signal (window closed), competitor-exclusive signal (not adaptable) |
44
+ | **Hands off to** | Phase 2 only if quality gate passes; otherwise returns to source scan or archives signal with notes |
45
+
46
+ ### Phase 2 — AI DRAFT
47
+
48
+ | Field | Value |
49
+ |-------|-------|
50
+ | **Lead agent** | `content-engineer` (Arc) with structured prompt template |
51
+ | **Inputs** | Signal brief, Espinha Dorsal template (tese/mecanismo/prova/direcao), client voice profile, format target |
52
+ | **Outputs** | First-draft artifact (carousel/post/thread/script/article) grounded on the Espinha Dorsal; draft-confidence score (self-reported by the AI), list of claims needing verification |
53
+ | **Tool stack** | Claude / GPT / in-house prompts (see `ai-content-production.md`), retrieval over client KBs for voice lock, `content-spine-engine.md` as structural contract |
54
+ | **Quality gate** | Draft has: (a) one thesis explicit, (b) mechanism explained, (c) at least 1 proof item, (d) direction/CTA, (e) no invented facts flagged, (f) voice within ±1 on Halvorson Voice & Tone scale |
55
+ | **Failure modes** | Drift from Espinha Dorsal, invented facts ("hallucination"), commodity phrasing, voice drift, format-agnostic output that ignores target platform |
56
+ | **Hands off to** | Phase 3 with structured annotations from the AI (what it is confident about, what it is guessing) |
57
+
58
+ ### Phase 3 — HUMAN EDIT
59
+
60
+ | Field | Value |
61
+ |-------|-------|
62
+ | **Lead agent** | `editorial-strategist` (North) for high-stakes content; `content-governor` (Index) for compliance/voice enforcement; human editor in the client-side loop |
63
+ | **Inputs** | AI draft + AI annotations, client voice profile, brand guidelines from squad-brand, editorial preferences log |
64
+ | **Outputs** | Edited master version (format-agnostic), edit-reason log (what was changed and why), voice-lock confirmation |
65
+ | **Tool stack** | Markdown diff, `content-quality-checklist.md`, `editorial-governance.md`, preference tracking (`preferences/`) |
66
+ | **Quality gate** | Zero invented facts remaining, voice within ±0.5, E-E-A-T signals preserved or added, claims either removed or cited, hook/pattern-interrupt verified per `viral-potential-scoring.md` |
67
+ | **Failure modes** | Over-editing (losing AI's useful phrasing), under-editing (shipping invented facts), voice-scrubbing (removing brand specificity), missing human-in-the-loop on high-stakes pieces |
68
+ | **Hands off to** | Phase 4 after the master version is signed off |
69
+
70
+ ### Phase 4 — PLATFORM ADAPT
71
+
72
+ | Field | Value |
73
+ |-------|-------|
74
+ | **Lead agent** | `platform-specialist` (Morph) |
75
+ | **Inputs** | Edited master version, target platform set, `template-contract-system.md` contracts |
76
+ | **Outputs** | Platform-native variants (carousel for IG, thread for X, reel script, LinkedIn post, newsletter section, etc.), each bound to a Template Contract |
77
+ | **Tool stack** | `platform-algorithm-intelligence.md`, `content-atomization-repurposing.md`, `template-contract-system.md`, platform previewers, character counters |
78
+ | **Quality gate** | Each variant respects its Template Contract 100% (character limits, field counts, formatting); algorithmic hooks verified per `verify-algorithmic-hooks` task; no variant loses the core thesis during atomization |
79
+ | **Failure modes** | Contract violations, hook dilution, algorithm mismatch (wrong format for platform), lost thesis in atomization, copy-paste across platforms without nativization |
80
+ | **Hands off to** | Phase 5 via client publishing pipeline (outside squad authority) |
81
+
82
+ ### Phase 5 — MEASURE
83
+
84
+ | Field | Value |
85
+ |-------|-------|
86
+ | **Lead agent** | `content-analyst` (Lens) |
87
+ | **Inputs** | Published variants across platforms, analytics windows (24h, 7d, 30d), client KPIs |
88
+ | **Outputs** | Performance report per variant + cross-platform rollup; top-performer identification; underperformer diagnosis; retrofeed dataset |
89
+ | **Tool stack** | Parse.ly, Semrush, BuzzSumo, native analytics APIs, `content-scoring-models.md`, `content-measurement-framework.md`, `viral-potential-scoring.md` |
90
+ | **Quality gate** | Metrics collected for every variant (no missing variants), attribution model applied, benchmarks set, insights ranked by actionability |
91
+ | **Failure modes** | Vanity metrics only, no attribution, missing variants, retroactive benchmark inflation, platform-silo analysis with no cross-platform rollup |
92
+ | **Hands off to** | Phase 6 with structured retrofeed payload |
93
+
94
+ ### Phase 6 — RETROFEED
95
+
96
+ | Field | Value |
97
+ |-------|-------|
98
+ | **Lead agent** | `content-orqx` (Nexus) as coordinator; updates flow to Radar (signal tuning), North (pillar/calendar adjustment), Arc (prompt library update), Morph (template contract refinement), Index (preference log) |
99
+ | **Inputs** | Phase 5 performance dataset, hypotheses that produced each piece, prompt versions used |
100
+ | **Outputs** | Updated signal-quality scoring weights, refined editorial pillars, refreshed AI prompt library, updated template contracts, updated preferences/ log for the client |
101
+ | **Tool stack** | `generate-retrofeed-insights` task, preference log template, `ai-content-production.md` prompt library versioning |
102
+ | **Quality gate** | Every update is traceable to a phase-5 insight (no invented tuning); previous prompt/pillar/contract versions archived, not overwritten |
103
+ | **Failure modes** | Retrofeed ignored ("one-shot pipeline"), overfitting to single-post noise, loss of previous version history, no communication of changes to the other phases |
104
+ | **Hands off to** | Phase 1 of the next cycle (loop closes) |
105
+
106
+ ---
107
+
108
+ ## 4. Human-in-the-Loop Decision Tree
109
+
110
+ The biggest decision of the AI-native loop is **when AI draft ships with light touch vs. when a human must intervene heavily**. This decision happens at the Phase 2 → Phase 3 transition.
111
+
112
+ ```
113
+ ┌──────────────────┐
114
+ │ AI draft ready │
115
+ └────────┬─────────┘
116
+
117
+ Has any of these?
118
+ ┌──────────────────────┴─────────────────────┐
119
+ │ YES │ NO
120
+ ▼ ▼
121
+ Human REQUIRED Evaluate stakes
122
+ (Heavy intervention) and signals
123
+ │ │
124
+ │ ▼
125
+ │ ┌────────────────────┐
126
+ │ │ High-stakes piece? │
127
+ │ │ (Manifesto, │
128
+ │ │ flagship, PR, │
129
+ │ │ crisis response) │
130
+ │ └────┬───────────┬───┘
131
+ │ │ YES │ NO
132
+ │ ▼ ▼
133
+ │ Human heavy Awareness
134
+ │ review level high?
135
+ │ (L4/L5
136
+ │ Schwartz)
137
+ │ │
138
+ │ ┌────────┴───────┐
139
+ │ │ YES │ NO
140
+ │ ▼ ▼
141
+ │ Human light AI draft
142
+ │ review only can ship
143
+ │ (craft polish) with voice
144
+ │ check only
145
+ └── "Human REQUIRED" triggers:
146
+ - Invented fact flagged by AI itself
147
+ - Legal/compliance topic (health, finance, legal)
148
+ - Crisis response or reputation-sensitive
149
+ - Brand new concept not covered in prior content
150
+ - Voice drift score >1.0 on client voice-tone scale
151
+ - Opinion piece or manifesto (voice IS the product)
152
+ ```
153
+
154
+ ### Gate Signals Table
155
+
156
+ | Signal | Weight | Where to check |
157
+ |--------|--------|---------------|
158
+ | Copy/content type (opinion vs informational) | HIGH | Editorial calendar tag |
159
+ | Market awareness level (Schwartz L1-L5) | HIGH | Editorial brief + audience research |
160
+ | Stakes (flagship/manifesto vs daily post) | HIGH | Editorial pillars priority |
161
+ | Brand voice criticality | MEDIUM | Client preferences log |
162
+ | Legal/compliance category | CRITICAL | `validate-content-compliance` task |
163
+ | AI self-reported confidence | MEDIUM | Phase 2 annotations |
164
+ | Novelty of subject matter | MEDIUM | Prior content overlap check |
165
+
166
+ ---
167
+
168
+ ## 5. Tool Stack per Phase (Canonical Stack)
169
+
170
+ | Phase | Required KBs | Required Tasks | Required Templates |
171
+ |-------|-------------|----------------|-------------------|
172
+ | 1. Signal | `signal-detection-methods.md`, `signal-intelligence-v2.md`, `competitor-analysis-methods.md` | `scan-daily-signals`, `classify-signal-temperature`, `map-signal-to-pillar` | `weekly-signal-briefing-template.md` |
173
+ | 2. AI Draft | `content-spine-engine.md`, `ai-content-production.md`, `narrative-structures-library.md`, `hook-formulas-library.md` | `design-content-spine`, `write-*` family | `content-spine-template.md`, `content-brief-template.md` |
174
+ | 3. Human Edit | `editorial-governance.md`, `content-quality-criteria.md`, `writing-rules-engine.md`, `brazilian-content-context.md` | `validate-content-quality`, `check-brand-consistency` | `content-quality-checklist.md` |
175
+ | 4. Platform Adapt | `template-contract-system.md`, `platform-algorithm-intelligence.md`, `content-atomization-repurposing.md`, `viral-potential-scoring.md` | `adapt-for-*` family, `verify-algorithmic-hooks`, `batch-platform-adaptation` | `template-contract-registry-template.md` |
176
+ | 5. Measure | `content-measurement-framework.md`, `content-scoring-models.md`, `eeat-quality-standards.md` | `analyze-content-performance`, `score-content-quality`, `generate-content-report` | `content-performance-report-template.md` |
177
+ | 6. Retrofeed | `content-strategy-master-reference.md`, `content-governance-principles.md` | `generate-retrofeed-insights`, `update-content-preferences` | `preference-log-template.md` |
178
+
179
+ ---
180
+
181
+ ## 6. Anti-Patterns (Loop Violations)
182
+
183
+ - **Shipping Phase 2 as final** — skipping human edit for speed destroys the voice differential.
184
+ - **Skipping Phase 6** — without retrofeed the loop becomes a forever-beginner pipeline that never learns from performance.
185
+ - **Phase 4 before Phase 3** — platform adapting an unedited draft wastes work when the master version changes.
186
+ - **Phase 1 as gut feeling** — signals without quality gates produce noisy calendars and pillar drift.
187
+ - **Phase 5 with no attribution** — performance data that can't be traced back to hypotheses cannot retrofeed.
188
+ - **Bypassing the Espinha Dorsal at Phase 2** — AI drafts without thesis/mechanism/proof/direction collapse into commodity content.
189
+ - **Phase 3 voice-scrubbing** — editors removing brand specificity to make content "safer" kills the differentiation.
190
+ - **Cross-platform copy-paste at Phase 4** — ignoring Template Contracts is a contract violation per `template-contract-system.md`.
191
+
192
+ ---
193
+
194
+ ## 7. Success Criteria
195
+
196
+ The loop is operating at v2 standard when:
197
+
198
+ 1. Every phase has its lead agent identified in the sprint plan
199
+ 2. Every Phase 2 output carries AI annotations (confidence + claims to verify)
200
+ 3. Every Phase 4 variant passes its Template Contract before publishing
201
+ 4. Every cycle closes with a Phase 6 retrofeed payload that updates at least one upstream parameter
202
+ 5. No piece ships without passing the Phase 3 human-in-the-loop gate
203
+ 6. Cross-phase metrics are cross-referenced (signal type → performance type)
204
+
205
+ ---
206
+
207
+ ## 8. Relationship to Other Canon KBs
208
+
209
+ - `content-spine-engine.md` — structural contract for Phase 2 (AI draft must be spine-grounded)
210
+ - `template-contract-system.md` — contract enforcement for Phase 4
211
+ - `ai-content-production.md` — prompt library feeding Phase 2
212
+ - `ai-leverage-content-framework.md` — strategic framing for AI-about-AI pieces specifically
213
+ - `signal-intelligence-v2.md` (sibling KB from this story) — source taxonomy for Phase 1
214
+ - `task-ownership-map.md` (sibling KB from this story) — which of the 90 tasks live in which phase
215
+
216
+ ---
217
+
218
+ ## Change Log
219
+
220
+ - 2026-04-12 — v1.0 authored as part of Story fw-v2.4 (squad-content v2.0 upgrade)