agents-united 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/LICENSE +21 -201
  2. package/README.md +627 -2
  3. package/dist/cli.d.ts +4 -1
  4. package/dist/cli.js +3826 -260
  5. package/dist/cli.js.map +1 -1
  6. package/package.json +9 -3
  7. package/registry/agents/orchestrator-business.md +151 -11
  8. package/registry/agents/orchestrator-design.md +127 -12
  9. package/registry/agents/orchestrator-engineering.md +129 -13
  10. package/registry/agents/orchestrator-marketing.md +134 -11
  11. package/registry/agents/orchestrator-research.md +159 -11
  12. package/registry/agents/orchestrator-security.md +150 -12
  13. package/registry/agents/orchestrator-system-architecture.md +131 -12
  14. package/registry/agents/subagent-accessibility-lead.md +40 -0
  15. package/registry/agents/subagent-ai-model-architect.md +76 -0
  16. package/registry/agents/subagent-android-architect.md +40 -0
  17. package/registry/agents/subagent-backend-architect.md +342 -9
  18. package/registry/agents/subagent-business-panel-experts.md +114 -8
  19. package/registry/agents/subagent-code-reviewer.md +181 -8
  20. package/registry/agents/subagent-cross-platform-specialist.md +40 -0
  21. package/registry/agents/subagent-data-engineer.md +40 -0
  22. package/registry/agents/subagent-deep-research.md +65 -8
  23. package/registry/agents/subagent-design-ops-lead.md +109 -8
  24. package/registry/agents/subagent-design-researcher.md +121 -8
  25. package/registry/agents/subagent-design-systems-architect.md +120 -8
  26. package/registry/agents/subagent-designer-toolkit-expert.md +335 -8
  27. package/registry/agents/subagent-devops-engineer.md +403 -0
  28. package/registry/agents/subagent-distributed-systems-architect.md +40 -0
  29. package/registry/agents/subagent-e2e-tester.md +40 -0
  30. package/registry/agents/subagent-frontend-architect.md +337 -8
  31. package/registry/agents/subagent-interaction-designer.md +288 -8
  32. package/registry/agents/subagent-ios-architect.md +40 -0
  33. package/registry/agents/subagent-lifecycle-email-specialist.md +40 -0
  34. package/registry/agents/subagent-marketing-campaign-specialist.md +66 -8
  35. package/registry/agents/subagent-marketing-content-strategist.md +171 -8
  36. package/registry/agents/subagent-marketing-conversion-specialist.md +66 -8
  37. package/registry/agents/subagent-marketing-creative-designer.md +85 -0
  38. package/registry/agents/subagent-marketing-growth-strategist.md +125 -8
  39. package/registry/agents/subagent-ml-platform-engineer.md +74 -0
  40. package/registry/agents/subagent-paid-acquisition-specialist.md +40 -0
  41. package/registry/agents/subagent-plg-strategist.md +40 -0
  42. package/registry/agents/subagent-prototype-tester.md +114 -8
  43. package/registry/agents/subagent-qa-automation-lead.md +40 -0
  44. package/registry/agents/subagent-repo-index.md +169 -8
  45. package/registry/agents/subagent-security-engineer.md +117 -8
  46. package/registry/agents/subagent-seo-specialist.md +40 -0
  47. package/registry/agents/subagent-socratic-mentor.md +91 -8
  48. package/registry/agents/subagent-sysops-sre-lead.md +62 -0
  49. package/registry/agents/subagent-system-architect.md +106 -8
  50. package/registry/agents/subagent-ui-designer.md +135 -8
  51. package/registry/agents/subagent-ux-strategist.md +75 -8
  52. package/registry/bundles.json +818 -154
  53. package/registry/rules/AGENTS.md +41 -0
  54. package/registry/rules/CLAUDE.md +12 -0
  55. package/registry/rules/CURSOR.md +12 -0
  56. package/registry/rules/GEMINI.md +40 -5
  57. package/registry/rules/clean-code-and-architecture.md +25 -0
  58. package/registry/rules/domain-modeling-and-adr.md +27 -0
  59. package/registry/rules/git-guardrails.md +19 -0
  60. package/registry/rules/multi-agent-coordination.md +33 -0
  61. package/registry/rules/quality-aesthetics-accessibility.md +29 -0
  62. package/registry/rules/skill-attribution.md +27 -0
  63. package/registry/rules/test-driven-development.md +41 -0
  64. package/registry/skills/ab-test-setup/SKILL.md +140 -6
  65. package/registry/skills/accessibility-audit/SKILL.md +147 -0
  66. package/registry/skills/ad-attribution-modeling/SKILL.md +202 -0
  67. package/registry/skills/ad-creative-design/SKILL.md +24 -0
  68. package/registry/skills/ai-prototype-refactoring/SKILL.md +25 -0
  69. package/registry/skills/architecture-design/SKILL.md +133 -7
  70. package/registry/skills/azure-infrastructure-bicep/SKILL.md +24 -0
  71. package/registry/skills/backend-api-design/SKILL.md +148 -0
  72. package/registry/skills/chaos-engineering/SKILL.md +38 -0
  73. package/registry/skills/churn-prevention-playbook/SKILL.md +177 -0
  74. package/registry/skills/ci-cd-pipeline-automation/SKILL.md +37 -0
  75. package/registry/skills/clickable-prototype-spec/SKILL.md +147 -0
  76. package/registry/skills/code-refactoring/SKILL.md +132 -0
  77. package/registry/skills/component-library-management/SKILL.md +147 -0
  78. package/registry/skills/component-playground-setup/SKILL.md +147 -0
  79. package/registry/skills/content-calendar-strategy/SKILL.md +147 -0
  80. package/registry/skills/conversion-funnel-optimization/SKILL.md +147 -0
  81. package/registry/skills/copywriting-frameworks/SKILL.md +147 -0
  82. package/registry/skills/database-design/SKILL.md +132 -0
  83. package/registry/skills/dependency-management/SKILL.md +133 -7
  84. package/registry/skills/design-handoff-spec/SKILL.md +147 -0
  85. package/registry/skills/design-ops-workflow/SKILL.md +147 -0
  86. package/registry/skills/design-system-governance/SKILL.md +147 -0
  87. package/registry/skills/design-system-tokens/SKILL.md +147 -0
  88. package/registry/skills/design-tokens-management/SKILL.md +147 -0
  89. package/registry/skills/design-version-control/SKILL.md +147 -0
  90. package/registry/skills/diagnosing-bugs/SKILL.md +43 -0
  91. package/registry/skills/docker-deployment/SKILL.md +141 -0
  92. package/registry/skills/domain-modeling/SKILL.md +50 -0
  93. package/registry/skills/email-drip-sequences/SKILL.md +177 -0
  94. package/registry/skills/email-marketing-automation/SKILL.md +147 -0
  95. package/registry/skills/finishing-a-development-branch/SKILL.md +123 -7
  96. package/registry/skills/frontend-component-design/SKILL.md +150 -0
  97. package/registry/skills/git-guardrails/SKILL.md +38 -0
  98. package/registry/skills/google-ads-optimization/SKILL.md +24 -0
  99. package/registry/skills/graphql-schema-design/SKILL.md +143 -0
  100. package/registry/skills/grill-me/SKILL.md +51 -0
  101. package/registry/skills/grill-with-docs/SKILL.md +78 -0
  102. package/registry/skills/growth-experiment-design/SKILL.md +147 -0
  103. package/registry/skills/handoff/SKILL.md +41 -0
  104. package/registry/skills/hf-model-evaluation/SKILL.md +80 -0
  105. package/registry/skills/interaction-pattern-library/SKILL.md +147 -0
  106. package/registry/skills/interactive-prototype-builder/SKILL.md +147 -0
  107. package/registry/skills/local-llm-inference/SKILL.md +74 -0
  108. package/registry/skills/maestro-mobile-testing/SKILL.md +37 -0
  109. package/registry/skills/marketing-creative-design/SKILL.md +182 -0
  110. package/registry/skills/meta-ad-creative-testing/SKILL.md +23 -0
  111. package/registry/skills/micro-interaction-design/SKILL.md +147 -0
  112. package/registry/skills/microservices-architecture/SKILL.md +138 -0
  113. package/registry/skills/mobile-android-design/SKILL.md +37 -0
  114. package/registry/skills/mobile-first-design/SKILL.md +147 -0
  115. package/registry/skills/mobile-ios-design/SKILL.md +37 -0
  116. package/registry/skills/mobile-platform-offline-validate/SKILL.md +37 -0
  117. package/registry/skills/modal-serverless-python/SKILL.md +78 -0
  118. package/registry/skills/onboarding-cro/SKILL.md +175 -7
  119. package/registry/skills/paid-acquisition-ppc/SKILL.md +167 -0
  120. package/registry/skills/performance-optimization/SKILL.md +132 -7
  121. package/registry/skills/playwright-best-practices/SKILL.md +36 -0
  122. package/registry/skills/product-launch-playbook/SKILL.md +147 -0
  123. package/registry/skills/programmatic-seo/SKILL.md +203 -7
  124. package/registry/skills/rag-vector-pipeline/SKILL.md +80 -0
  125. package/registry/skills/react-best-practices/SKILL.md +37 -0
  126. package/registry/skills/receiving-code-review/SKILL.md +121 -7
  127. package/registry/skills/replicate-model-inference/SKILL.md +73 -0
  128. package/registry/skills/requesting-code-review/SKILL.md +128 -7
  129. package/registry/skills/responsive-design-audit/SKILL.md +147 -0
  130. package/registry/skills/runpod-gpu-orchestration/SKILL.md +81 -0
  131. package/registry/skills/schema-markup-strategy/SKILL.md +190 -0
  132. package/registry/skills/security-audit/SKILL.md +136 -0
  133. package/registry/skills/seo-audit/SKILL.md +140 -6
  134. package/registry/skills/signup-flow-cro/SKILL.md +140 -6
  135. package/registry/skills/social-media-campaign/SKILL.md +147 -0
  136. package/registry/skills/state-driven-ui-animation/SKILL.md +147 -0
  137. package/registry/skills/subagent-driven-development/SKILL.md +126 -7
  138. package/registry/skills/supabase-backend-architecture/SKILL.md +25 -0
  139. package/registry/skills/systematic-debugging/SKILL.md +129 -7
  140. package/registry/skills/technical-documentation/SKILL.md +133 -0
  141. package/registry/skills/technical-seo-audit/SKILL.md +24 -0
  142. package/registry/skills/telemetry-monitoring/SKILL.md +37 -0
  143. package/registry/skills/test-driven-development/SKILL.md +127 -7
  144. package/registry/skills/to-spec/SKILL.md +43 -0
  145. package/registry/skills/to-tickets/SKILL.md +45 -0
  146. package/registry/skills/turso-distributed-sqlite/SKILL.md +23 -0
  147. package/registry/skills/ui-component-spec/SKILL.md +147 -0
  148. package/registry/skills/usability-testing-protocol/SKILL.md +147 -0
  149. package/registry/skills/user-flow-mapping/SKILL.md +147 -0
  150. package/registry/skills/user-journey-mapping/SKILL.md +147 -0
  151. package/registry/skills/vector-database-design/SKILL.md +80 -0
  152. package/registry/skills/vercel-deploy-best-practices/SKILL.md +24 -0
  153. package/registry/skills/viral-referral-loops/SKILL.md +205 -0
  154. package/registry/workflows/workflow-analyze.md +53 -8
  155. package/registry/workflows/workflow-api-contract-design.md +48 -0
  156. package/registry/workflows/workflow-app-store-release.md +48 -0
  157. package/registry/workflows/workflow-brainstorm.md +53 -8
  158. package/registry/workflows/workflow-build.md +53 -8
  159. package/registry/workflows/workflow-business-panel.md +53 -8
  160. package/registry/workflows/workflow-cleanup.md +53 -8
  161. package/registry/workflows/workflow-deploy-staging.md +49 -0
  162. package/registry/workflows/workflow-design-code.md +53 -8
  163. package/registry/workflows/workflow-design-ops--handoff.md +53 -8
  164. package/registry/workflows/workflow-design-ops--plan-sprint.md +53 -8
  165. package/registry/workflows/workflow-design-ops--setup-workflow.md +53 -8
  166. package/registry/workflows/workflow-design-orchestrate.md +53 -8
  167. package/registry/workflows/workflow-design-systems--audit-system.md +53 -8
  168. package/registry/workflows/workflow-design-systems--create-component.md +53 -8
  169. package/registry/workflows/workflow-design-systems--tokenize.md +53 -8
  170. package/registry/workflows/workflow-diagnose.md +45 -0
  171. package/registry/workflows/workflow-e2e-testing.md +49 -0
  172. package/registry/workflows/workflow-email-drip-sequence.md +65 -0
  173. package/registry/workflows/workflow-estimate.md +53 -8
  174. package/registry/workflows/workflow-explain.md +53 -8
  175. package/registry/workflows/workflow-frontend-audit.md +49 -0
  176. package/registry/workflows/workflow-git.md +53 -8
  177. package/registry/workflows/workflow-grill.md +51 -0
  178. package/registry/workflows/workflow-implement.md +54 -8
  179. package/registry/workflows/workflow-incident-triage.md +49 -0
  180. package/registry/workflows/workflow-interaction-design--design-interaction.md +53 -8
  181. package/registry/workflows/workflow-interaction-design--error-flow.md +53 -8
  182. package/registry/workflows/workflow-interaction-design--map-states.md +53 -8
  183. package/registry/workflows/workflow-marketing-audit.md +53 -8
  184. package/registry/workflows/workflow-marketing-campaign-builder.md +53 -8
  185. package/registry/workflows/workflow-marketing-content-pipeline.md +53 -8
  186. package/registry/workflows/workflow-marketing-growth-experiment.md +53 -8
  187. package/registry/workflows/workflow-marketing-launch.md +53 -8
  188. package/registry/workflows/workflow-marketing-panel.md +53 -8
  189. package/registry/workflows/workflow-ml-eval.md +51 -0
  190. package/registry/workflows/workflow-mobile-build.md +49 -0
  191. package/registry/workflows/workflow-onboarding-funnel-cro.md +65 -0
  192. package/registry/workflows/workflow-paid-acquisition-campaign.md +65 -0
  193. package/registry/workflows/workflow-paid-campaign-launch.md +47 -0
  194. package/registry/workflows/workflow-plan.md +53 -8
  195. package/registry/workflows/workflow-prototyping-testing--evaluate.md +53 -8
  196. package/registry/workflows/workflow-prototyping-testing--experiment.md +53 -8
  197. package/registry/workflows/workflow-prototyping-testing--prototype-plan.md +53 -8
  198. package/registry/workflows/workflow-prototyping-testing--test-plan.md +53 -8
  199. package/registry/workflows/workflow-rag-pipeline-deploy.md +53 -0
  200. package/registry/workflows/workflow-recommend.md +53 -8
  201. package/registry/workflows/workflow-research.md +53 -8
  202. package/registry/workflows/workflow-review.md +53 -8
  203. package/registry/workflows/workflow-seo-audit-pipeline.md +47 -0
  204. package/registry/workflows/workflow-seo-content-pipeline.md +65 -0
  205. package/registry/workflows/workflow-serverless-gpu-deploy.md +52 -0
  206. package/registry/workflows/workflow-spec-panel.md +53 -8
  207. package/registry/workflows/workflow-spec.md +44 -0
  208. package/registry/workflows/workflow-test.md +53 -8
  209. package/registry/workflows/workflow-troubleshoot.md +53 -8
  210. package/registry/workflows/workflow-ui-design--color-palette.md +53 -8
  211. package/registry/workflows/workflow-ui-design--design-screen.md +53 -8
  212. package/registry/workflows/workflow-ui-design--responsive-audit.md +53 -8
  213. package/registry/workflows/workflow-ui-design--type-system.md +53 -8
  214. package/registry/workflows/workflow-ux-strategy--benchmark.md +53 -8
  215. package/registry/workflows/workflow-ux-strategy--frame-problem.md +53 -8
  216. package/registry/workflows/workflow-ux-strategy--strategize.md +53 -8
  217. package/registry/skills/analytics-tracking/SKILL.md +0 -13
  218. package/registry/skills/brainstorming/SKILL.md +0 -13
  219. package/registry/skills/browser-agent/SKILL.md +0 -13
  220. package/registry/skills/campaign-strategy/SKILL.md +0 -13
  221. package/registry/skills/competitor-alternatives/SKILL.md +0 -13
  222. package/registry/skills/confidence-check/SKILL.md +0 -13
  223. package/registry/skills/copy-editing/SKILL.md +0 -13
  224. package/registry/skills/copywriting/SKILL.md +0 -13
  225. package/registry/skills/deep-research/SKILL.md +0 -13
  226. package/registry/skills/design-ops/SKILL.md +0 -13
  227. package/registry/skills/design-research/SKILL.md +0 -13
  228. package/registry/skills/design-systems/SKILL.md +0 -13
  229. package/registry/skills/designer-toolkit/SKILL.md +0 -13
  230. package/registry/skills/email-sequence/SKILL.md +0 -13
  231. package/registry/skills/executing-plans/SKILL.md +0 -13
  232. package/registry/skills/form-cro/SKILL.md +0 -13
  233. package/registry/skills/free-tool-strategy/SKILL.md +0 -13
  234. package/registry/skills/interaction-design/SKILL.md +0 -13
  235. package/registry/skills/launch-strategy/SKILL.md +0 -13
  236. package/registry/skills/marketing-ideas/SKILL.md +0 -13
  237. package/registry/skills/marketing-psychology/SKILL.md +0 -13
  238. package/registry/skills/page-cro/SKILL.md +0 -13
  239. package/registry/skills/paid-ads/SKILL.md +0 -13
  240. package/registry/skills/paywall-upgrade-cro/SKILL.md +0 -13
  241. package/registry/skills/popup-cro/SKILL.md +0 -13
  242. package/registry/skills/pricing-strategy/SKILL.md +0 -13
  243. package/registry/skills/prototyping-testing/SKILL.md +0 -13
  244. package/registry/skills/referral-program/SKILL.md +0 -13
  245. package/registry/skills/schema-markup/SKILL.md +0 -13
  246. package/registry/skills/security-review/SKILL.md +0 -13
  247. package/registry/skills/social-content/SKILL.md +0 -13
  248. package/registry/skills/ui-design/SKILL.md +0 -13
  249. package/registry/skills/ux-strategy/SKILL.md +0 -13
  250. package/registry/skills/writing-plans/SKILL.md +0 -13
@@ -0,0 +1,202 @@
1
+ ---
2
+ name: ad-attribution-modeling
3
+ description: Production-grade Ad Attribution Modeling playbook for multi-touch attribution (MTA), ROAS/CAC calculation, marketing mix modeling (MMM), and Server-to-Server Conversions API integration.
4
+ metadata:
5
+ author: "agents-united"
6
+ version: "2.0.0"
7
+ ---
8
+
9
+ # Multi-Touch Ad Attribution Modeling & ROAS/CAC Analytics Engine
10
+
11
+ ## Overview & Purpose
12
+ The Ad Attribution Modeling skill provides a mathematical and technical framework for calculating marketing ROI across multi-touch buyer journeys.
13
+
14
+ Following this skill implements Multi-Touch Attribution models (First-Touch, Last-Touch, Linear, U-Shaped, W-Shaped, Data-Driven/Algorithmic), Server-to-Server Conversions API pipelines (Meta CAPI, Google Enhanced Conversions) to bypass browser ad-blockers, and Blended vs. Paid CAC reconciliation across cohort payback windows.
15
+
16
+ ## Execution Triggers & Prerequisites
17
+ ### Execution Triggers
18
+ - Resolving attribution discrepancies between Google Ads, Meta Ads, and Stripe/CRM revenue.
19
+ - Deploying Server-Side Conversions API (CAPI) to combat iOS ATT tracking signal loss.
20
+ - Evaluating channel efficiency across complex multi-channel buyer touchpoints.
21
+ - Calculating cohort-level customer acquisition payback periods and LTV:CAC ratios.
22
+
23
+ ### Prerequisites
24
+ - Event telemetry pipeline (Segment, RudderStack, PostHog, or custom event stream).
25
+ - Server-side ad platform credentials (Meta Pixel Access Token, Google Conversion API tokens).
26
+ - Transaction ledger or billing database access (Stripe API, PostgreSQL orders table).
27
+ - Clean git working directory.
28
+
29
+ ## Input & Output Requirements
30
+ ### Inputs
31
+ | Parameter | Type | Required | Description |
32
+ |---|---|---|---|
33
+ | `touchpoint_events` | Array<Object> | Yes | Stream of user interaction events with UTM parameters |
34
+ | `conversion_events` | Array<Object> | Yes | Completed purchase/signup events with revenue value |
35
+ | `channel_ad_spend` | Object | Yes | Cost breakdown by channel for the observation period |
36
+ | `attribution_model` | String | Optional | Model: `first_touch`, `last_touch`, `linear`, `u_shaped`, `w_shaped` |
37
+ | `lookback_window_days`| Number | Optional | Attribution lookback window in days (default: 30) |
38
+
39
+ ### Outputs
40
+ | Artifact | Path / Format | Description |
41
+ |---|---|---|
42
+ | Attribution Spec Document | `docs/ad-attribution-modeling/attribution-spec.md` | Model formulas, lookback definitions, CAPI specs |
43
+ | Attribution Engine Module | `src/analytics/attribution-engine.ts` | Multi-touch weighting and calculations |
44
+ | Server CAPI Dispatcher | `src/analytics/server-capi-dispatcher.ts` | Server-to-server conversion event sender |
45
+ | Channel ROAS Report | `reports/ad-attribution-modeling/roas-summary.json` | Attribution weights, ROAS, and CAC by channel |
46
+
47
+ ## Step-by-Step Execution Runbook
48
+
49
+ ### Phase 1: Touchpoint Event Telemetry & Server-Side Ingestion Setup
50
+ 1. Ingest raw customer session touchpoint streams (First Visit, Organic Search, Paid Click, Newsletter Open, Trial Signup, Purchase).
51
+ 2. Standardize touchpoint schemas: extract `userId`, `anonymousId`, `timestamp`, `channel`, `campaign`, `adId`, `landingPage`.
52
+ 3. Filter out bot traffic, internal testing IP addresses, and invalid referrers.
53
+ 4. Persist touchpoint history in structured analytical storage keyed by resolved customer identity.
54
+
55
+ ### Phase 2: Attribution Model Algorithm Selection & Weight Formulation
56
+ 1. Formulate mathematical weight distribution algorithms:
57
+ - **First-Touch**: 100% weight to initial discovery channel.
58
+ - **Last-Touch**: 100% weight to final pre-conversion interaction.
59
+ - **Linear**: Equal distribution across all $N$ touchpoints ($1/N$).
60
+ - **U-Shaped**: 40% First-Touch, 40% Lead Creation Touch, 20% split across intermediate touches.
61
+ - **W-Shaped**: 30% First-Touch, 30% Lead Creation, 30% Opportunity Creation, 10% intermediate touches.
62
+ 2. Apply lookback window filtering (discard touchpoints older than 30 or 90 days before conversion).
63
+
64
+ ### Phase 3: Multi-Touch Conversion Path Calculation & Blended Metric Synthesis
65
+ 1. Execute multi-touch weighting calculations across all cohort conversion paths.
66
+ 2. Aggregate attributed revenue per channel: $\text{Attributed Revenue} = \sum (\text{Order Value} \times \text{Touchpoint Weight})$.
67
+ 3. Compute channel-specific ROAS: $\text{ROAS} = \text{Attributed Revenue} / \text{Channel Ad Spend}$.
68
+ 4. Compute Blended CAC vs Paid CAC:
69
+ - $\text{Blended CAC} = \text{Total Marketing Spend} / \text{Total New Customers}$
70
+ - $\text{Paid CAC} = \text{Paid Ad Spend} / \text{Paid Attributed Customers}$
71
+
72
+ ### Phase 4: Server-to-Server Conversions API (CAPI) Pipeline Deployment
73
+ 1. Implement server-side dispatch worker capturing server-verified conversions (e.g. Stripe checkout completed).
74
+ 2. Hash customer PII identifiers (email, phone, name) using SHA-256 before transmission.
75
+ 3. Attach shared `event_id` and browser `fbp`/`fbc` cookies to enable ad platform deduplication with client pixels.
76
+ 4. Dispatch payload to Meta Conversions API and Google Ads Enhanced Conversions endpoints.
77
+
78
+ ### Phase 5: Cohort LTV/CAC Payback Window Auditing & Executive Reporting
79
+ 1. Calculate cohort payback period: $\text{Payback Months} = \text{CAC} / (\text{ARPU} \times \text{Gross Margin \%})$.
80
+ 2. Generate executive attribution summary report at `reports/ad-attribution-modeling/roas-summary.json`.
81
+ 3. Highlight underperforming channels where CAC exceeds LTV / 3 payback threshold.
82
+ 4. Commit attribution analytics engine to repository.
83
+ ```bash
84
+ git add src/analytics/ docs/ad-attribution-modeling/
85
+ git commit -m "feat(ad-attribution-modeling): implement multi-touch attribution and server CAPI engine"
86
+ ```
87
+
88
+ ## Code & Configuration Exemplars
89
+
90
+ ### Exemplar 1: TypeScript Multi-Touch Attribution Engine
91
+ ```typescript
92
+ export interface Touchpoint {
93
+ channel: string;
94
+ timestamp: number;
95
+ }
96
+
97
+ export type AttributionModel = 'first_touch' | 'last_touch' | 'linear' | 'u_shaped';
98
+
99
+ export function calculateAttributedWeights(
100
+ touchpoints: Touchpoint[],
101
+ model: AttributionModel
102
+ ): Record<string, number> {
103
+ const result: Record<string, number> = {};
104
+ const n = touchpoints.length;
105
+ if (n === 0) return result;
106
+
107
+ touchpoints.forEach(t => { result[t.channel] = (result[t.channel] || 0); });
108
+
109
+ if (n === 1 || model === 'first_touch') {
110
+ result[touchpoints[0].channel] += 1.0;
111
+ return result;
112
+ }
113
+ if (model === 'last_touch') {
114
+ result[touchpoints[n - 1].channel] += 1.0;
115
+ return result;
116
+ }
117
+ if (model === 'linear') {
118
+ const weight = 1.0 / n;
119
+ touchpoints.forEach(t => { result[t.channel] += weight; });
120
+ return result;
121
+ }
122
+ if (model === 'u_shaped') {
123
+ if (n === 2) {
124
+ result[touchpoints[0].channel] += 0.5;
125
+ result[touchpoints[1].channel] += 0.5;
126
+ } else {
127
+ result[touchpoints[0].channel] += 0.4;
128
+ result[touchpoints[n - 1].channel] += 0.4;
129
+ const middleWeight = 0.2 / (n - 2);
130
+ for (let i = 1; i < n - 1; i++) {
131
+ result[touchpoints[i].channel] += middleWeight;
132
+ }
133
+ }
134
+ return result;
135
+ }
136
+ return result;
137
+ }
138
+ ```
139
+
140
+ ### Exemplar 2: Server-Side Meta CAPI Conversion Dispatcher
141
+ ```typescript
142
+ import crypto from 'node:crypto';
143
+
144
+ export interface CapiConversionPayload {
145
+ eventName: string;
146
+ eventId: string;
147
+ eventTime: number;
148
+ userEmail: string;
149
+ value: number;
150
+ currency: string;
151
+ }
152
+
153
+ export function hashSha256(value: string): string {
154
+ return crypto.createHash('sha256').update(value.trim().toLowerCase()).digest('hex');
155
+ }
156
+
157
+ export function formatMetaCapiPayload(payload: CapiConversionPayload, pixelId: string) {
158
+ return {
159
+ data: [
160
+ {
161
+ event_name: payload.eventName,
162
+ event_time: payload.eventTime,
163
+ event_id: payload.eventId,
164
+ user_data: {
165
+ em: [hashSha256(payload.userEmail)],
166
+ },
167
+ custom_data: {
168
+ currency: payload.currency,
169
+ value: payload.value,
170
+ },
171
+ action_source: 'website',
172
+ },
173
+ ],
174
+ };
175
+ }
176
+ ```
177
+
178
+ ## Edge Cases & Error Recovery Procedures
179
+
180
+ ### Scenario A: Duplicate Conversion Reporting between Browser Pixel and Server CAPI
181
+ 1. **Diagnosis**: Ad platform counts purchase event twice, inflating reported ROAS by 100%.
182
+ 2. **Recovery Protocol**:
183
+ - Step 1: Verify `event_id` string parity between client-side pixel event and server-side CAPI payload.
184
+ - Step 2: Ensure timestamps on both dispatches are within platform deduplication window (under 48 hours).
185
+ - Step 3: Inspect Meta Events Manager deduplication diagnostics to confirm 100% deduplication rate.
186
+
187
+ ### Scenario B: Orphaned Touchpoint Sessions Due to Cross-Domain Redirects
188
+ 1. **Diagnosis**: UTM parameters lost when user redirects from marketing landing page to auth/checkout subdomain.
189
+ 2. **Recovery Protocol**:
190
+ - Step 1: Implement first-party cookie persistence storing original UTM touchpoint for 30 days.
191
+ - Step 2: Append persistent anonymous session ID across cross-domain link anchors.
192
+ - Step 3: Re-stitch orphaned checkout sessions using server-side anonymous ID lookup.
193
+
194
+ ## Verification & Validation Checklist
195
+ - [ ] Frontmatter conforms strictly to `author: "agents-united"` and `version: "2.0.0"`.
196
+ - [ ] All 7 mandatory sections present with explicit headers.
197
+ - [ ] Step-by-Step Execution Runbook body contains >= 50 lines.
198
+ - [ ] Multi-touch models (Linear, U-Shaped, W-Shaped) formulated with exact math.
199
+ - [ ] Server-Side CAPI integration with SHA-256 PII hashing detailed.
200
+ - [ ] Code exemplars provided with valid syntax fencing.
201
+ - [ ] Zero dummy placeholder strings or unpopulated template markers present.
202
+ - [ ] Project build, test suite, and doctor check pass 100% cleanly.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: ad-creative-design
3
+ description: High-converting advertising visual layouts, social banner design systems, aspect ratio formatting, and visual hook variations.
4
+ metadata:
5
+ author: "Agents United Creative Team"
6
+ version: "1.0.0"
7
+ license: "MIT"
8
+ ---
9
+
10
+ # Ad Creative Design Playbook
11
+
12
+ ## Overview & Purpose
13
+ `ad-creative-design` provides standardized design frameworks and visual hierarchies for digital advertising campaigns across Meta, Google Display, LinkedIn, and X.
14
+
15
+ ## Core Directives & Standards
16
+ 1. **Visual Hierarchy** — Lead with a high-contrast visual hook (top 40% of viewport), followed by a 1-sentence value proposition, social proof badge, and an actionable CTA.
17
+ 2. **Aspect Ratio Compliance** — Export designs in 1:1 (Feed/Square), 9:16 (Stories/Reels/Shorts), and 1.91:1 (Landscape/Feed).
18
+ 3. **Contrast & Readability** — Maintain WCAG AA compliant text contrast against background gradients or imagery.
19
+ 4. **Multi-Hook Variation** — Provide at least 3 distinct visual angle variations per campaign concept (Product Demo screenshot, Stat/Metric Callout, Minimalist Typography).
20
+
21
+ ## Verification Checklist
22
+ - [ ] Visual elements scale cleanly across mobile screen viewports.
23
+ - [ ] Text covers less than 20% of ad image area to maximize ad delivery score.
24
+ - [ ] CTA button stands out with clear accent color contrast.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: ai-prototype-refactoring
3
+ description: Refactoring rapid AI-generated prototypes from Lovable, v0, and Bolt into production-ready modular React components, typed design tokens, and clean architectures.
4
+ metadata:
5
+ author: "Agents United Frontend Group"
6
+ version: "1.0.0"
7
+ license: "MIT"
8
+ ---
9
+
10
+ # AI Prototype Refactoring Playbook (Lovable / v0 / Bolt)
11
+
12
+ ## Overview & Purpose
13
+ `ai-prototype-refactoring` standardizes the ingestion and transformation of single-file AI prototype exports (from Lovable.dev, v0.dev, Bolt.new) into enterprise-grade modular React/TypeScript codebases.
14
+
15
+ ## Core Directives & Standards
16
+ 1. **Deconstruct Monolithic Files** — Break large 1000+ line single-file components into atomic design hierarchy (`atoms`, `molecules`, `organisms`, `layouts`).
17
+ 2. **Strict TypeScript Typing** — Replace all inferred `any` and inline untyped JSON objects with formal TypeScript interfaces and Zod validation schemas.
18
+ 3. **Design System Token Mapping** — Extract hardcoded arbitrary Tailwind classes (e.g. `bg-[#1a2b3c]`, `p-[17px]`) into semantic Tailwind configuration tokens (e.g. `bg-primary`, `p-4`).
19
+ 4. **Interactive State & Hook Extraction** — Move inline messy `useState` spaghetti into custom hooks (`useCartState`, `useFilterParams`, `useAuthModal`).
20
+ 5. **Accessibility (a11y) & Semantic HTML** — Replace unsemantic `div` click handlers with semantic `<button>`, `<nav>`, `<main>`, `<dialog>`, and accessible ARIA attributes.
21
+
22
+ ## Verification Checklist
23
+ - [ ] Refactored components pass strict TypeScript compilation (`tsc --noEmit`).
24
+ - [ ] Unit and visual regression tests author for critical interaction flows.
25
+ - [ ] No hardcoded placeholder mock data remaining in production component code.
@@ -1,13 +1,139 @@
1
1
  ---
2
2
  name: architecture-design
3
- description: Official Architecture Design skill for Agents United ecosystem providing runbooks and guidelines.
3
+ description: Production-grade Architecture Design playbook for microservices, event-driven backends, and C4 domain modeling.
4
+ metadata:
5
+ author: "agents-united"
6
+ version: "2.0.0"
4
7
  ---
5
8
 
6
- # Architecture Design
9
+ # System Architecture Design & ADR Management
7
10
 
8
- This skill provides comprehensive instructions, runbooks, and guidelines for Architecture Design.
11
+ ## Overview & Purpose
12
+ The System Architecture Design & ADR Management skill provides a deterministic, battle-tested framework for executing architecture-design processes across the Agents United multi-agent ecosystem.
9
13
 
10
- ## Procedure & Guidelines
11
- 1. Review domain requirements and constraints.
12
- 2. Execute step-by-step procedures test-first.
13
- 3. Validate results against acceptance criteria.
14
+ Following this skill ensures high quality, zero-regression execution, rigorous testing gates, and seamless cross-functional team alignment.
15
+
16
+ ## Execution Triggers & Prerequisites
17
+ ### Execution Triggers
18
+ - Direct request or workflow step invoking architecture-design.
19
+ - Auditing, implementing, or standardizing architecture-design procedures.
20
+ - Addressing technical debt, architectural reviews, or production readiness gates.
21
+ - Preparing pull requests or automated release validations.
22
+
23
+ ### Prerequisites
24
+ - Active project repository workspace with version control configured.
25
+ - Operational testing, typechecking, and build toolchains.
26
+ - Domain requirements, architectural constraints, or user stories defined.
27
+ - Clean git working tree before beginning execution.
28
+
29
+ ## Input & Output Requirements
30
+ ### Inputs
31
+ | Parameter | Type | Required | Description |
32
+ |---|---|---|---|
33
+ | `target_scope` | String | Yes | Target module, service, component, or file path |
34
+ | `config` | Object | Optional | Specific domain configurations, thresholds, and options |
35
+ | `output_dir` | Directory Path | Optional | Destination directory for generated artifacts and reports |
36
+ | `strict_mode` | Boolean | Optional | Enforce strict zero-warning validation and high test coverage |
37
+
38
+ ### Outputs
39
+ | Artifact | Path / Format | Description |
40
+ |---|---|---|
41
+ | Specification Document | `docs/architecture-design/spec.md` | Full technical specification and architectural plan |
42
+ | Implementation Files | `src/architecture-design/*` | Production-ready source code, tests, and configurations |
43
+ | Execution Report | `reports/architecture-design/summary.json` | Verification metrics, test results, and audit summary |
44
+
45
+ ## Step-by-Step Execution Runbook
46
+
47
+ ### Phase 1: Domain Decomposition & C4 Model Framing
48
+ 1. Deconstruct system requirements into Context, Container, Component, and Code layers.
49
+ 2. Define bounded contexts and domain aggregates to prevent leaky domain boundaries.
50
+ 3. Chart synchronous vs asynchronous communication channels and latency budgets.
51
+ 4. Identify stateful storage requirements and data partitioning strategies.
52
+ 5. Draft high-level architecture diagram and component topology.
53
+
54
+ ### Phase 2: Tradeoff Analysis & Non-Functional Requirements (NFRs)
55
+ 1. Quantify SLA/SLO requirements: p99 latency (<150ms), availability (99.99%), throughput (10k rps).
56
+ 2. Evaluate CAP theorem tradeoffs: Consistency vs Availability during network partitions.
57
+ 3. Assess infrastructure cost implications across compute, bandwidth, and managed services.
58
+ 4. Perform threat modeling (STRIDE) against network boundaries and data stores.
59
+ 5. Document architectural alternatives considered and reasons for rejection.
60
+
61
+ ### Phase 3: ADR Authoring & Interface Contract Definition
62
+ 1. Author formal ADR in docs/adr/ADR-XXXX.md following MADR template standards.
63
+ 2. Specify OpenAPI / gRPC Protobuf interface contracts for inter-service boundaries.
64
+ 3. Define idempotency keys and retry policies for distributed operations.
65
+ 4. Define failure domains, circuit breaker thresholds, and fallback degradations.
66
+ 5. Submit ADR for peer review by security and system architecture teams.
67
+
68
+ ### Phase 4: Architecture Validation & Prototyping Spike
69
+ 1. Build minimal executable spike to validate performance and latency assumptions.
70
+ 2. Verify distributed tracing propagation across boundary headers (TraceContext).
71
+ 3. Run automated load testing against prototype endpoints using k6 or autocannon.
72
+ 4. Validate disaster recovery and failover behavior under simulated node outages.
73
+ 5. Review spike results against target SLO metrics.
74
+
75
+ ### Phase 5: Governance & Downstream Implementation Handoff
76
+ 1. Publish accepted ADR to repository architecture registry.
77
+ 2. Generate service scaffold templates with pre-configured telemetry and lint rules.
78
+ 3. Brief backend and infrastructure subagents on architectural constraints.
79
+ 4. Create milestone tracking tickets linked directly to ADR acceptance criteria.
80
+ 5. Establish quarterly architectural drift review cadence.
81
+
82
+ ## Code & Configuration Exemplars
83
+
84
+ ### Exemplar 1: System Architecture Design & ADR Management Configuration & Specification
85
+ ```yaml
86
+ title: "ADR-004: Event-Driven Order Processing Architecture"
87
+ status: "accepted"
88
+ date: "2026-08-14"
89
+ deciders: ["System Architect", "Backend Lead"]
90
+ context: |
91
+ Synchronous REST calls between Checkout and Inventory services caused cascading latency spikes during peak loads.
92
+ decision: |
93
+ We will adopt an event-driven architecture using Apache Kafka with transactional outbox patterns.
94
+ consequences:
95
+ positive:
96
+ - Decouples checkout service latency from inventory processing.
97
+ - Guarantees at-least-once message delivery via transactional outbox.
98
+ negative:
99
+ - Eventual consistency requires asynchronous UI status polling.
100
+ ```
101
+
102
+ ### Exemplar 2: System Architecture Design & ADR Management TypeScript Type Contract
103
+ ```typescript
104
+ export interface ArchitectureDecisionRecord {
105
+ id: string;
106
+ title: string;
107
+ status: 'draft' | 'proposed' | 'accepted' | 'rejected' | 'deprecated';
108
+ context: string;
109
+ decision: string;
110
+ consequences: {
111
+ positive: string[];
112
+ negative: string[];
113
+ };
114
+ }
115
+ ```
116
+
117
+ ## Edge Cases & Error Recovery Procedures
118
+
119
+ ### Scenario A: Validation Failure in System Architecture Design & ADR Management
120
+ 1. **Diagnosis**: Static analysis, typechecking, or unit tests fail validation rules during execution.
121
+ 2. **Recovery Protocol**:
122
+ - Step 1: Inspect detailed error log output in test/build terminal.
123
+ - Step 2: Formulate targeted hypothesis and isolate failing line or assertion.
124
+ - Step 3: Implement surgical code fix and re-run verification suite.
125
+
126
+ ### Scenario B: Missing or Incompatible Dependency
127
+ 1. **Diagnosis**: Required toolchain binary or library dependency is missing from the environment.
128
+ 2. **Recovery Protocol**:
129
+ - Step 1: Verify `package.json` engine requirements and local environment versions.
130
+ - Step 2: Install required peer dependencies cleanly with lockfile sync.
131
+ - Step 3: Resume runbook from Phase 1.
132
+
133
+ ## Verification & Validation Checklist
134
+ - [ ] Frontmatter conforms strictly to `author: "agents-united"` and `version: "2.0.0"`.
135
+ - [ ] All 7 mandatory sections present with explicit headers.
136
+ - [ ] Step-by-Step Execution Runbook body contains >= 50 lines.
137
+ - [ ] Code exemplars provided with valid syntax fencing.
138
+ - [ ] Zero dummy placeholder strings or unpopulated template markers present.
139
+ - [ ] Project build, test suite, and doctor check pass 100% cleanly.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: azure-infrastructure-bicep
3
+ description: Enterprise cloud infrastructure automation on Microsoft Azure using Bicep IaC, Azure Container Apps, AKS, Azure OpenAI services, and Managed Identities.
4
+ metadata:
5
+ author: "Agents United DevOps Group"
6
+ version: "1.0.0"
7
+ license: "MIT"
8
+ ---
9
+
10
+ # Azure Infrastructure with Bicep Playbook
11
+
12
+ ## Overview & Purpose
13
+ `azure-infrastructure-bicep` defines cloud architecture standards and Infrastructure-as-Code (IaC) templates for deploying scalable applications on Microsoft Azure.
14
+
15
+ ## Core Directives & Standards
16
+ 1. **Modular Bicep Templates** — Organize IaC into reusable Bicep modules (`modules/containerApp.bicep`, `modules/keyVault.bicep`, `modules/openAI.bicep`) with strict parameter typing.
17
+ 2. **Passwordless Managed Identities** — Use Azure System-Assigned or User-Assigned Managed Identities and Azure RBAC instead of hardcoded connection strings or access keys.
18
+ 3. **Azure Container Apps (ACA) Microservices** — Deploy containerized workloads with KEDA auto-scaling (HTTP traffic and queue depth scaling) and Dapr sidecars.
19
+ 4. **Azure OpenAI Service Deployment** — Provision dedicated Azure OpenAI Cognitive Service accounts with private endpoints, virtual network integration, and rate-limit monitoring.
20
+ 5. **Azure Key Vault Integration** — Store all application secrets in Key Vault and inject them into container environments via Key Vault secret references.
21
+
22
+ ## Verification Checklist
23
+ - [ ] Bicep templates pass `az bicep build` and `az deployment group what-if` dry-run validations.
24
+ - [ ] Public network access disabled on storage accounts and databases (private endpoints enforced).
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: backend-api-design
3
+ description: Production-grade Backend API Design playbook for RESTful, gRPC, and GraphQL enterprise architectures.
4
+ metadata:
5
+ author: "agents-united"
6
+ version: "2.0.0"
7
+ ---
8
+
9
+ # Backend API Design & Contract Specification
10
+
11
+ ## Overview & Purpose
12
+ The Backend API Design & Contract Specification skill provides a deterministic, battle-tested framework for executing backend-api-design processes across the Agents United multi-agent ecosystem.
13
+
14
+ Following this skill ensures high quality, zero-regression execution, rigorous testing gates, and seamless cross-functional team alignment.
15
+
16
+ ## Execution Triggers & Prerequisites
17
+ ### Execution Triggers
18
+ - Direct request or workflow step invoking backend-api-design.
19
+ - Auditing, implementing, or standardizing backend-api-design procedures.
20
+ - Addressing technical debt, architectural reviews, or production readiness gates.
21
+ - Preparing pull requests or automated release validations.
22
+
23
+ ### Prerequisites
24
+ - Active project repository workspace with version control configured.
25
+ - Operational testing, typechecking, and build toolchains.
26
+ - Domain requirements, architectural constraints, or user stories defined.
27
+ - Clean git working tree before beginning execution.
28
+
29
+ ## Input & Output Requirements
30
+ ### Inputs
31
+ | Parameter | Type | Required | Description |
32
+ |---|---|---|---|
33
+ | `target_scope` | String | Yes | Target module, service, component, or file path |
34
+ | `config` | Object | Optional | Specific domain configurations, thresholds, and options |
35
+ | `output_dir` | Directory Path | Optional | Destination directory for generated artifacts and reports |
36
+ | `strict_mode` | Boolean | Optional | Enforce strict zero-warning validation and high test coverage |
37
+
38
+ ### Outputs
39
+ | Artifact | Path / Format | Description |
40
+ |---|---|---|
41
+ | Specification Document | `docs/backend-api-design/spec.md` | Full technical specification and architectural plan |
42
+ | Implementation Files | `src/backend-api-design/*` | Production-ready source code, tests, and configurations |
43
+ | Execution Report | `reports/backend-api-design/summary.json` | Verification metrics, test results, and audit summary |
44
+
45
+ ## Step-by-Step Execution Runbook
46
+
47
+ ### Phase 1: API Resource & Contract Modeling
48
+ 1. Model domain resources with standard pluralized URI paths (/api/v2/resources).
49
+ 2. Select communication protocol: RESTful JSON, gRPC Protobuf, or GraphQL based on payload needs.
50
+ 3. Define HTTP verb semantics strictly: GET (idempotent/safe), POST (create), PUT (replace), PATCH (partial), DELETE.
51
+ 4. Establish unified error response schema matching RFC 7807 Problem Details.
52
+ 5. Design pagination schemas supporting cursor-based and offset-based navigation.
53
+
54
+ ### Phase 2: Schema Validation & Security Hardening
55
+ 1. Write strict JSON Schema / Zod runtime validation definitions for all input payloads.
56
+ 2. Enforce Idempotency-Key headers for all non-idempotent financial/state transitions.
57
+ 3. Configure rate-limiting policies (token bucket algorithm) by authenticated tenant.
58
+ 4. Implement OAuth2 / JWT bearer token authentication and RBAC scope authorization checks.
59
+ 5. Sanitize all headers and query parameters against injection attacks.
60
+
61
+ ### Phase 3: Implementation & Middleware Pipeline Assembly
62
+ 1. Assemble Express / Fastify / Koa middleware pipeline: CORS -> Tracing -> Auth -> BodyParser -> RateLimit.
63
+ 2. Implement controller handlers with explicit separation between transport and service domains.
64
+ 3. Implement database transactions with optimistic locking for concurrent updates.
65
+ 4. Wire up structured JSON logging with CorrelationId injected on every log line.
66
+ 5. Enforce strict error boundary middleware to prevent uncaught promise rejections.
67
+
68
+ ### Phase 4: Automated Contract Testing & Mock Server Verification
69
+ 1. Run contract tests validating OpenAPI specification against live responses (Prism/Dredd).
70
+ 2. Execute end-to-end integration tests using Supertest or Vitest.
71
+ 3. Verify error code compliance for 400, 401, 403, 404, 409, 422, 429, and 500 scenarios.
72
+ 4. Benchmark p95 response time under concurrent simulated load.
73
+ 5. Validate backward-compatibility against previous API versions.
74
+
75
+ ### Phase 5: SDK Generation & Documentation Publication
76
+ 1. Generate TypeScript / Python client SDKs from OpenAPI definitions via @openapitools/openapi-generator-cli.
77
+ 2. Publish interactive Swagger / Redoc documentation endpoint.
78
+ 3. Generate changelog highlighting added fields, deprecated routes, and breaking changes.
79
+ 4. Commit updated API schemas to version control.
80
+ 5. Tag production release candidate.
81
+
82
+ ## Code & Configuration Exemplars
83
+
84
+ ### Exemplar 1: Backend API Design & Contract Specification Configuration & Specification
85
+ ```yaml
86
+ openapi: 3.1.0
87
+ info:
88
+ title: Enterprise Order Management API
89
+ version: 2.0.0
90
+ paths:
91
+ /api/v2/orders:
92
+ post:
93
+ summary: Create idempotent purchase order
94
+ parameters:
95
+ - in: header
96
+ name: Idempotency-Key
97
+ required: true
98
+ schema:
99
+ type: string
100
+ format: uuid
101
+ requestBody:
102
+ required: true
103
+ content:
104
+ application/json:
105
+ schema:
106
+ $ref: '#/components/schemas/CreateOrderRequest'
107
+ ```
108
+
109
+ ### Exemplar 2: Backend API Design & Contract Specification TypeScript Type Contract
110
+ ```typescript
111
+ export interface ApiResponse<T> {
112
+ success: boolean;
113
+ data?: T;
114
+ error?: {
115
+ code: string;
116
+ message: string;
117
+ details?: Record<string, unknown>;
118
+ };
119
+ metadata: {
120
+ requestId: string;
121
+ timestamp: string;
122
+ };
123
+ }
124
+ ```
125
+
126
+ ## Edge Cases & Error Recovery Procedures
127
+
128
+ ### Scenario A: Validation Failure in Backend API Design & Contract Specification
129
+ 1. **Diagnosis**: Static analysis, typechecking, or unit tests fail validation rules during execution.
130
+ 2. **Recovery Protocol**:
131
+ - Step 1: Inspect detailed error log output in test/build terminal.
132
+ - Step 2: Formulate targeted hypothesis and isolate failing line or assertion.
133
+ - Step 3: Implement surgical code fix and re-run verification suite.
134
+
135
+ ### Scenario B: Missing or Incompatible Dependency
136
+ 1. **Diagnosis**: Required toolchain binary or library dependency is missing from the environment.
137
+ 2. **Recovery Protocol**:
138
+ - Step 1: Verify `package.json` engine requirements and local environment versions.
139
+ - Step 2: Install required peer dependencies cleanly with lockfile sync.
140
+ - Step 3: Resume runbook from Phase 1.
141
+
142
+ ## Verification & Validation Checklist
143
+ - [ ] Frontmatter conforms strictly to `author: "agents-united"` and `version: "2.0.0"`.
144
+ - [ ] All 7 mandatory sections present with explicit headers.
145
+ - [ ] Step-by-Step Execution Runbook body contains >= 50 lines.
146
+ - [ ] Code exemplars provided with valid syntax fencing.
147
+ - [ ] Zero dummy placeholder strings or unpopulated template markers present.
148
+ - [ ] Project build, test suite, and doctor check pass 100% cleanly.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: chaos-engineering
3
+ description: Chaos engineering methodology, fault injection, network latency simulation, service degradation tests, and disaster recovery validation.
4
+ metadata:
5
+ author: "Agents United Core Team"
6
+ version: "1.0.0"
7
+ source: "https://github.com/NeoAnthropocene/agents-united"
8
+ ---
9
+
10
+ # Chaos Engineering & Fault Injection Playbook
11
+
12
+ ## Overview & Purpose
13
+ `chaos-engineering` provides a structured methodology for injecting controlled failures into distributed services and frontend applications to prove resilience before production incidents occur.
14
+
15
+ ## Rules & Constraints
16
+ 1. **Define Steady State** — Measure baseline normal behavior (error rate < 0.05%, p99 latency < 200ms) before injecting chaos.
17
+ 2. **Formulate Falsifiable Hypothesis** — Hypothesize that the system will continue functioning despite specific service or network outages.
18
+ 3. **Minimize Blast Radius** — Run chaos experiments in staging or with scoped tenant canary headers before cluster-wide testing.
19
+ 4. **Automated Abort Conditions** — Configure automated triggers that immediately halt the experiment if key business SLOs degrade beyond safety margins.
20
+
21
+ ## Step-by-Step Execution Runbook
22
+
23
+ ### Phase 1 — Experiment Design & Hypothesis
24
+ - Select chaos vector: Network latency (Toxiproxy), Database connection drop, Redis cache outage, or Pod termination.
25
+ - Establish baseline monitoring dashboards.
26
+
27
+ ### Phase 2 — Fault Injection Execution
28
+ - Trigger the fault in a controlled staging environment.
29
+ - Observe circuit breaker tripping, fallback cache utilization, and error message rendering.
30
+
31
+ ### Phase 3 — Analysis & Remediation
32
+ - Document whether the system gracefully degraded or suffered cascading failures.
33
+ - Implement necessary resilience patches (timeouts, retries with jitter, fallback defaults).
34
+
35
+ ## Verification Checklist
36
+ - [ ] System gracefully handles injected faults without crashing.
37
+ - [ ] Fallback user experience displays helpful degraded state UI.
38
+ - [ ] Post-experiment system recovers to steady state automatically.