taketomarket 0.1.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 (123) hide show
  1. package/.claude-plugin/plugin.json +10 -0
  2. package/LICENSE +21 -0
  3. package/README.md +419 -0
  4. package/agents/ttm-producer.md +53 -0
  5. package/bin/lib/campaign.cjs +553 -0
  6. package/bin/lib/commit.cjs +105 -0
  7. package/bin/lib/core.cjs +172 -0
  8. package/bin/lib/deviation.cjs +149 -0
  9. package/bin/lib/drift-log.cjs +219 -0
  10. package/bin/lib/health.cjs +438 -0
  11. package/bin/lib/slug.cjs +59 -0
  12. package/bin/lib/state.cjs +96 -0
  13. package/bin/ttm-tools.cjs +157 -0
  14. package/gates/base-gates.md +266 -0
  15. package/gates/discipline/.gitkeep +0 -0
  16. package/gates/gate-evaluation.md +341 -0
  17. package/gates/meta-gates.md +19 -0
  18. package/install.js +307 -0
  19. package/package.json +53 -0
  20. package/playbooks/.gitkeep +0 -0
  21. package/playbooks/aeo.md +223 -0
  22. package/playbooks/affiliate.md +272 -0
  23. package/playbooks/base.md +110 -0
  24. package/playbooks/email.md +306 -0
  25. package/playbooks/events.md +320 -0
  26. package/playbooks/linkedin.md +263 -0
  27. package/playbooks/paid-ads.md +318 -0
  28. package/playbooks/pr-media.md +296 -0
  29. package/playbooks/seo.md +284 -0
  30. package/playbooks/social.md +305 -0
  31. package/playbooks/youtube.md +325 -0
  32. package/references/context-loading.md +107 -0
  33. package/references/learnings-extraction.md +94 -0
  34. package/references/measurement-template.md +48 -0
  35. package/references/meta-gate-evaluation.md +169 -0
  36. package/references/positioning-check-report.md +197 -0
  37. package/references/review-checklist.md +78 -0
  38. package/references/ship-checklist-items.md +94 -0
  39. package/settings.json +4 -0
  40. package/skills/ttm-aeo-check/SKILL.md +20 -0
  41. package/skills/ttm-affiliate-kit/SKILL.md +19 -0
  42. package/skills/ttm-archive/SKILL.md +13 -0
  43. package/skills/ttm-brand-refresh/SKILL.md +19 -0
  44. package/skills/ttm-brief/SKILL.md +14 -0
  45. package/skills/ttm-competitor-scan/SKILL.md +19 -0
  46. package/skills/ttm-email-preflight/SKILL.md +19 -0
  47. package/skills/ttm-fix/SKILL.md +13 -0
  48. package/skills/ttm-health/SKILL.md +12 -0
  49. package/skills/ttm-icp-refresh/SKILL.md +19 -0
  50. package/skills/ttm-init/SKILL.md +12 -0
  51. package/skills/ttm-keyword-map/SKILL.md +19 -0
  52. package/skills/ttm-learn/SKILL.md +14 -0
  53. package/skills/ttm-measure/SKILL.md +14 -0
  54. package/skills/ttm-new-campaign/SKILL.md +13 -0
  55. package/skills/ttm-next/SKILL.md +12 -0
  56. package/skills/ttm-positioning-check/SKILL.md +19 -0
  57. package/skills/ttm-positioning-shift/SKILL.md +19 -0
  58. package/skills/ttm-produce/SKILL.md +14 -0
  59. package/skills/ttm-repurpose/SKILL.md +20 -0
  60. package/skills/ttm-research/SKILL.md +13 -0
  61. package/skills/ttm-resume/SKILL.md +13 -0
  62. package/skills/ttm-review/SKILL.md +13 -0
  63. package/skills/ttm-seo-audit/SKILL.md +20 -0
  64. package/skills/ttm-ship/SKILL.md +13 -0
  65. package/skills/ttm-state/SKILL.md +13 -0
  66. package/skills/ttm-verify/SKILL.md +14 -0
  67. package/templates/agents-md.md +65 -0
  68. package/templates/campaign-brief.md +74 -0
  69. package/templates/campaign-research.md +39 -0
  70. package/templates/campaign-state.md +40 -0
  71. package/templates/claude-md.md +65 -0
  72. package/templates/deviation-log.md +12 -0
  73. package/templates/drift-log.md +17 -0
  74. package/templates/fix-brief.md +59 -0
  75. package/templates/fix-log.md +22 -0
  76. package/templates/measurement-report.md +75 -0
  77. package/templates/migration-plan.md +24 -0
  78. package/templates/production-manifest.json +20 -0
  79. package/templates/reference-files/brand.md +45 -0
  80. package/templates/reference-files/calendar.md +30 -0
  81. package/templates/reference-files/channels.md +40 -0
  82. package/templates/reference-files/competitors.md +40 -0
  83. package/templates/reference-files/icp.md +50 -0
  84. package/templates/reference-files/learnings.md +40 -0
  85. package/templates/reference-files/metrics.md +42 -0
  86. package/templates/reference-files/positioning.md +38 -0
  87. package/templates/reference-files/state.md +27 -0
  88. package/templates/verification-report.md +59 -0
  89. package/workflows/discipline/.gitkeep +0 -0
  90. package/workflows/discipline/aeo-check.md +180 -0
  91. package/workflows/discipline/affiliate-kit.md +147 -0
  92. package/workflows/discipline/email-preflight.md +150 -0
  93. package/workflows/discipline/keyword-map.md +125 -0
  94. package/workflows/discipline/repurpose.md +329 -0
  95. package/workflows/discipline/seo-audit.md +169 -0
  96. package/workflows/lifecycle/.gitkeep +0 -0
  97. package/workflows/lifecycle/brief-positioning-check.md +90 -0
  98. package/workflows/lifecycle/brief.md +355 -0
  99. package/workflows/lifecycle/fix.md +495 -0
  100. package/workflows/lifecycle/learn.md +405 -0
  101. package/workflows/lifecycle/measure.md +379 -0
  102. package/workflows/lifecycle/produce.md +383 -0
  103. package/workflows/lifecycle/research.md +264 -0
  104. package/workflows/lifecycle/review.md +432 -0
  105. package/workflows/lifecycle/ship.md +521 -0
  106. package/workflows/lifecycle/verify.md +507 -0
  107. package/workflows/reference-mgmt/.gitkeep +0 -0
  108. package/workflows/reference-mgmt/brand-refresh.md +193 -0
  109. package/workflows/reference-mgmt/competitor-scan.md +228 -0
  110. package/workflows/reference-mgmt/icp-refresh.md +200 -0
  111. package/workflows/reference-mgmt/positioning-check.md +339 -0
  112. package/workflows/reference-mgmt/positioning-shift.md +368 -0
  113. package/workflows/setup/.gitkeep +0 -0
  114. package/workflows/setup/init-questions.md +225 -0
  115. package/workflows/setup/init-validation.md +155 -0
  116. package/workflows/setup/init.md +449 -0
  117. package/workflows/setup/new-campaign.md +134 -0
  118. package/workflows/utility/.gitkeep +0 -0
  119. package/workflows/utility/archive.md +334 -0
  120. package/workflows/utility/health.md +166 -0
  121. package/workflows/utility/next.md +187 -0
  122. package/workflows/utility/resume.md +249 -0
  123. package/workflows/utility/state.md +207 -0
@@ -0,0 +1,495 @@
1
+ <purpose>
2
+ Fix workflow for /ttm-fix. Performs root cause analysis on assets marked
3
+ "needs-fix" during review, generates targeted fix briefs, re-produces in
4
+ isolated Task() context, re-verifies against all 10 gates (D-06), shows
5
+ results at each iteration (D-07), and caps at 3 attempts with escalation (D-08, LIFE-12).
6
+ Auto-approves to ship-ready on successful fix (D-14).
7
+ </purpose>
8
+
9
+ <required_reading>
10
+ @${CLAUDE_PLUGIN_ROOT}/references/context-loading.md
11
+ @${CLAUDE_PLUGIN_ROOT}/gates/base-gates.md
12
+ @${CLAUDE_PLUGIN_ROOT}/gates/gate-evaluation.md
13
+ @${CLAUDE_PLUGIN_ROOT}/agents/ttm-producer.md
14
+ </required_reading>
15
+
16
+ <constraints>
17
+ ## POSITIONING.md is READ-ONLY
18
+
19
+ **Do NOT modify `.marketing/POSITIONING.md` during this workflow.**
20
+
21
+ POSITIONING.md is an architectural invariant. If you detect positioning drift:
22
+ - In verify: use the Escalate option to launch /ttm-positioning-shift
23
+ - In other workflows: flag the issue and recommend running /ttm-positioning-check
24
+
25
+ Only /ttm-positioning-shift and /ttm-init may modify POSITIONING.md.
26
+ </constraints>
27
+
28
+ <process>
29
+
30
+ ## Text-Mode Detection
31
+
32
+ **Text mode (`--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS`
33
+ or if the runtime is not Claude Code. When TEXT_MODE is active, replace every
34
+ `AskUserQuestion` call with a plain-text numbered list.
35
+
36
+ Detection:
37
+ ```bash
38
+ if echo "$ARGUMENTS" | grep -q -- '--text'; then TEXT_MODE=true; fi
39
+ ```
40
+
41
+ If `AskUserQuestion` tool is not available in the current runtime, set `TEXT_MODE=true`.
42
+
43
+ When TEXT_MODE is active, replace each AskUserQuestion with a plain-text numbered list:
44
+ ```
45
+ [HEADER]
46
+ [QUESTION]
47
+ 1. [OPTION_1_LABEL] -- [OPTION_1_DESCRIPTION]
48
+ 2. [OPTION_2_LABEL] -- [OPTION_2_DESCRIPTION]
49
+ ...
50
+ Type the number of your choice:
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Step 1: Load Context
56
+
57
+ ```
58
+ takeToMarket > LOADING CONTEXT
59
+ ```
60
+
61
+ Extract SLUG from $ARGUMENTS (strip `--text` flag if present):
62
+ ```bash
63
+ SLUG=$(echo "$ARGUMENTS" | sed 's/--text//g' | xargs)
64
+ ```
65
+
66
+ If SLUG is empty, error: "Usage: /ttm-fix [campaign-slug]. Provide a campaign slug." Exit.
67
+
68
+ **Load Tier 1 summaries** from all 9 reference files (lines 1 to `<!-- END_SUMMARY -->`):
69
+ - `.marketing/POSITIONING.md`
70
+ - `.marketing/BRAND.md`
71
+ - `.marketing/ICP.md`
72
+ - `.marketing/CHANNELS.md`
73
+ - `.marketing/STATE.md` (frontmatter only)
74
+ - `.marketing/CALENDAR.md`
75
+ - `.marketing/COMPETITORS.md`
76
+ - `.marketing/METRICS.md`
77
+ - `.marketing/LEARNINGS.md`
78
+
79
+ **Load Tier 2 (full content)** for gate evaluation (same as verify per context-loading.md):
80
+ - `.marketing/POSITIONING.md` (needed for GATE-01 Positioning Drift)
81
+ - `.marketing/BRAND.md` (needed for GATE-02 Claim Accuracy, GATE-03 Voice Drift)
82
+ - `.marketing/ICP.md` (needed for GATE-09 ICP Fit)
83
+ - `.marketing/COMPETITORS.md` (needed for GATE-08 Competitor Collision)
84
+ - `.marketing/CHANNELS.md` (needed for GATE-06 UTM Hygiene)
85
+
86
+ **Load campaign-specific files** (always full-load per context-loading.md rule 4):
87
+ - `.marketing/CAMPAIGNS/${SLUG}/STATE.md`
88
+ - `.marketing/CAMPAIGNS/${SLUG}/BRIEF.md`
89
+
90
+ **Load MANIFEST.json:**
91
+ Read `.marketing/CAMPAIGNS/${SLUG}/MANIFEST.json`. If the file does not exist, error:
92
+ "No production manifest found for campaign '${SLUG}'. Run /ttm-produce first." Exit.
93
+
94
+ **Load VERIFICATION.md:**
95
+ Read `.marketing/CAMPAIGNS/${SLUG}/VERIFICATION.md`. If the file does not exist, error:
96
+ "No verification report found for campaign '${SLUG}'. Run /ttm-verify first." Exit.
97
+
98
+ **Load LEARNINGS.md Tier 2** (for root-cause taxonomy categories):
99
+ - `.marketing/LEARNINGS.md` (full content -- needed for root-cause category matching)
100
+
101
+ ---
102
+
103
+ ## Step 2: Validate Campaign State
104
+
105
+ ```
106
+ takeToMarket > VALIDATING CAMPAIGN
107
+ ```
108
+
109
+ Check campaign exists:
110
+ ```bash
111
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign state "${SLUG}" --raw
112
+ ```
113
+
114
+ If result shows `exists: false`: Tell the user the campaign does not exist and suggest
115
+ running `/ttm-new-campaign` first. Exit.
116
+
117
+ Read campaign state. Check the `phase` field:
118
+ - If phase is NOT `"reviewed"`: Warn the user:
119
+ "Campaign is in phase '${PHASE}'. Expected 'reviewed' before fix.
120
+ Run /ttm-review first."
121
+ Exit.
122
+
123
+ **Determine fix run number:**
124
+ Read `fix.run_count` from state. If null or 0, set `RUN_NUMBER=1`.
125
+ Otherwise set `RUN_NUMBER` to `fix.run_count + 1`.
126
+
127
+ ---
128
+
129
+ ## Step 3: Identify Assets Needing Fix
130
+
131
+ ```
132
+ takeToMarket > IDENTIFYING ASSETS
133
+ ```
134
+
135
+ Parse MANIFEST.json for assets where `review_status == "needs-fix"`.
136
+
137
+ Collect from both `hero` and `derivatives` entries. For each matching asset, record:
138
+ - `asset_id`, `name`, `file`, `type`, `channel`, `playbook`
139
+ - Load its review feedback file: `.marketing/CAMPAIGNS/${SLUG}/REVIEW-FEEDBACK-${NAME}.md`
140
+ If the feedback file does not exist, log warning and use VERIFICATION.md failures only.
141
+
142
+ If no assets need fix:
143
+ "No assets need fixing. All assets are either approved or rejected. Run /ttm-ship to proceed."
144
+ Exit.
145
+
146
+ Display summary:
147
+ ```
148
+ takeToMarket > FIX LOOP
149
+
150
+ Assets needing fix: ${COUNT}
151
+ - [ASSET_NAME_1] (severity from review feedback)
152
+ - [ASSET_NAME_2] (severity from review feedback)
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Step 4: Initialize Fix Log
158
+
159
+ Check if FIX-LOG.md exists in campaign directory:
160
+ `.marketing/CAMPAIGNS/${SLUG}/FIX-LOG.md`
161
+
162
+ If not, create it from `${CLAUDE_PLUGIN_ROOT}/templates/fix-log.md` template:
163
+ - Replace `[SLUG]` with campaign slug
164
+ - Replace `[ISO_TIMESTAMP]` with current timestamp
165
+
166
+ If FIX-LOG.md already exists, read it to determine prior attempt counts per asset.
167
+ Parse existing entries to find the highest attempt number for each asset.
168
+
169
+ ---
170
+
171
+ ## Step 5: Fix Loop Per Asset
172
+
173
+ For each asset with `review_status == "needs-fix"`:
174
+
175
+ Initialize `attempt_count` from prior attempts in FIX-LOG.md (0 if no prior attempts).
176
+
177
+ **WHILE attempt_count < 3 AND asset_status == "needs-fix":**
178
+
179
+ Increment `attempt_count`.
180
+
181
+ ### 5a. Root Cause Analysis (D-05)
182
+
183
+ Load: review feedback file + VERIFICATION.md failures for this asset + BRIEF.md.
184
+ Analyze against LEARNINGS.md root-cause taxonomy. Propose one of these 7 categories:
185
+ - `positioning-drift` -- Asset contradicts or extends beyond POSITIONING.md
186
+ - `weak-hook` -- Opening/hook does not grab ICP attention
187
+ - `wrong-channel` -- Content format mismatched for target channel
188
+ - `bad-timing` -- References or angles are dated or poorly timed
189
+ - `unverifiable-claim` -- Contains claims not in approved proof points
190
+ - `broken-funnel` -- CTA, conversion path, or next-step is missing/broken
191
+ - `creative-fatigue` -- Content is generic, template-like, or lacks originality
192
+
193
+ Present to user via AskUserQuestion (or text-mode):
194
+ ```
195
+ Proposed root cause for [ASSET_NAME]: [CATEGORY]
196
+ Explanation: [Why this root cause fits based on review feedback and gate failures]
197
+
198
+ 1. Confirm -- proceed with this root cause
199
+ 2. Correct -- select a different root cause
200
+ ```
201
+ If user selects "Correct", present numbered list of all 7 categories and let them choose.
202
+
203
+ ### 5b. Generate Fix Brief
204
+
205
+ Read template from `${CLAUDE_PLUGIN_ROOT}/templates/fix-brief.md`.
206
+ Fill all placeholders:
207
+ - `[SLUG]` -> campaign slug
208
+ - `[ASSET_NAME]` -> asset name from manifest
209
+ - `[ATTEMPT_NUMBER]` -> current attempt (1, 2, or 3)
210
+ - `[ROOT_CAUSE_CATEGORY]` -> confirmed root cause category
211
+ - `[ROOT_CAUSE_EXPLANATION]` -> explanation text
212
+ - `[BRIEF_PATH]` -> `.marketing/CAMPAIGNS/${SLUG}/BRIEF.md`
213
+ - `[FAILURE_LIST]` -> extract all WARN/FAIL findings for this asset from VERIFICATION.md,
214
+ plus review feedback items from REVIEW-FEEDBACK-${NAME}.md
215
+ - `[PASSING_LIST]` -> extract all PASS findings for this asset from VERIFICATION.md
216
+ (per RESEARCH Pitfall 3: these are preservation constraints -- the producer MUST NOT break these)
217
+ - `[CORRECTIONS_LIST]` -> derive specific corrections from root cause + review feedback
218
+ - `[ISO_TIMESTAMP]` -> current timestamp
219
+
220
+ Write fix brief to: `.marketing/CAMPAIGNS/${SLUG}/FIX-BRIEF-${ASSET_ID}-attempt-${N}.md`
221
+
222
+ ### 5c. Re-Produce Asset (Task() subagent)
223
+
224
+ Read agent prompt template from `${CLAUDE_PLUGIN_ROOT}/agents/ttm-producer.md`.
225
+ Fill placeholders -- **CRITICAL: use the FIX BRIEF path as `[BRIEF_PATH]`**, NOT the
226
+ original BRIEF.md:
227
+ - `[BRIEF_PATH]` -> `.marketing/CAMPAIGNS/${SLUG}/FIX-BRIEF-${ASSET_ID}-attempt-${N}.md`
228
+ - `[POSITIONING_PATH]` -> `.marketing/POSITIONING.md`
229
+ - `[BRAND_PATH]` -> `.marketing/BRAND.md`
230
+ - `[ICP_PATH]` -> `.marketing/ICP.md`
231
+ - `[PLAYBOOK_PATH]` -> playbook path from MANIFEST.json or `"none"`
232
+ - `[OUTPUT_PATH]` -> `.marketing/CAMPAIGNS/${SLUG}/${ASSET_FILE}` (overwrite failing version)
233
+ - `[ASSET_TYPE]` -> from MANIFEST.json
234
+ - `[CHANNEL]` -> from MANIFEST.json
235
+ - `[HERO_PATH]` -> hero asset path if this is a derivative, else `"none"`
236
+
237
+ Call Task() with populated prompt. Wait for completion.
238
+
239
+ Verify the re-produced file exists and has content:
240
+ ```bash
241
+ test -s ".marketing/CAMPAIGNS/${SLUG}/${ASSET_FILE}"
242
+ ```
243
+ If file missing/empty: log as failed attempt in FIX-LOG.md, continue loop.
244
+
245
+ ### 5d. Re-Verify Against All 10 Gates (D-06)
246
+
247
+ Follow the gate evaluation pattern from verify.md Step 4. For THIS SINGLE ASSET only:
248
+
249
+ For each of the 10 gates (in order from base-gates.md):
250
+ 1. Load the gate-specific reference data (same as verify.md)
251
+ 2. Evaluate per gate-evaluation.md instructions
252
+ 3. Record structured output: gate, tier, result, findings[]
253
+
254
+ Aggregate results for this asset: PASS/WARN/FAIL per gate.
255
+
256
+ **IMPORTANT:** Evaluate each gate SEPARATELY. Do not bundle multiple gates into a
257
+ single evaluation pass. Load gate-specific reference data for each evaluation.
258
+
259
+ ### 5e. Present Result to User (D-07)
260
+
261
+ Capture the "before" results from the original VERIFICATION.md for this asset.
262
+ Display gate summary table for this attempt:
263
+ ```
264
+ takeToMarket > FIX ATTEMPT ${N}/3: [ASSET_NAME]
265
+
266
+ Root cause: [CATEGORY]
267
+
268
+ | Gate | Before | After |
269
+ |------|--------|-------|
270
+ | Positioning Drift (GATE-01) | [BEFORE] | [AFTER] |
271
+ | Claim Accuracy (GATE-02) | [BEFORE] | [AFTER] |
272
+ | Voice Drift (GATE-03) | [BEFORE] | [AFTER] |
273
+ | Outcome Alignment (GATE-04) | [BEFORE] | [AFTER] |
274
+ | Funnel Integrity (GATE-05) | [BEFORE] | [AFTER] |
275
+ | UTM Hygiene (GATE-06) | [BEFORE] | [AFTER] |
276
+ | Compliance (GATE-07) | [BEFORE] | [AFTER] |
277
+ | Competitor Collision (GATE-08) | [BEFORE] | [AFTER] |
278
+ | ICP Fit (GATE-09) | [BEFORE] | [AFTER] |
279
+ | Format Correctness (GATE-10) | [BEFORE] | [AFTER] |
280
+ ```
281
+
282
+ **Determine fix result:**
283
+
284
+ - If ALL gates PASS (or only Tier 2 WARNs with no FAILs):
285
+ Fix successful.
286
+ ```
287
+ Fix successful! Auto-approving [ASSET_NAME] to ship-ready. (D-14)
288
+ ```
289
+ Set `asset_status` = `"ship-ready"`. Break loop.
290
+
291
+ - If any Tier 1 gates FAIL:
292
+ Fix attempt failed. If `attempt_count < 3`:
293
+ Present to user via AskUserQuestion (or text-mode):
294
+ ```
295
+ Attempt ${N}/3 still has failures:
296
+ [List of remaining FAIL findings]
297
+
298
+ 1. Continue fixing -- try again with adjusted approach
299
+ 2. Approve anyway -- accept current state and mark ship-ready
300
+ 3. Adjust feedback -- provide new specific feedback for next attempt
301
+ ```
302
+ - "Continue fixing": loop continues with next attempt
303
+ - "Approve anyway": set `asset_status` = `"ship-ready"`, break loop
304
+ - "Adjust feedback": collect new freeform feedback via AskUserQuestion,
305
+ append to review feedback file, loop continues with next attempt
306
+
307
+ ### 5f. Log Attempt to FIX-LOG.md
308
+
309
+ Append to `.marketing/CAMPAIGNS/${SLUG}/FIX-LOG.md`:
310
+ ```markdown
311
+ ## Asset: [ASSET_NAME]
312
+
313
+ ### Attempt [N]
314
+ - **Date:** [ISO_TIMESTAMP]
315
+ - **Root cause:** [CATEGORY] -- [EXPLANATION]
316
+ - **Fix brief:** FIX-BRIEF-[ASSET_ID]-attempt-[N].md
317
+ - **Gate results after fix:**
318
+ | Gate | Before | After |
319
+ |------|--------|-------|
320
+ | [GATE_NAME] | [BEFORE] | [AFTER] |
321
+ | ... |
322
+ - **Outcome:** [passed | failed -- reason | approved-by-user]
323
+ ```
324
+
325
+ **END WHILE**
326
+
327
+ ---
328
+
329
+ ## Step 6: Handle 3-Attempt Escalation (D-08, LIFE-12)
330
+
331
+ If `attempt_count == 3` AND asset still has gate failures (asset_status still "needs-fix"):
332
+
333
+ ```
334
+ takeToMarket > ESCALATION: [ASSET_NAME]
335
+
336
+ 3 fix attempts exhausted. Presenting attempt history:
337
+ ```
338
+
339
+ Read FIX-LOG.md entries for this asset. Display all 3 attempts:
340
+
341
+ ```
342
+ ### Attempt 1
343
+ Root cause: [CATEGORY]
344
+ Gate results: [summary -- N PASS / N WARN / N FAIL]
345
+ Fix brief: FIX-BRIEF-[ASSET_ID]-attempt-1.md
346
+
347
+ ### Attempt 2
348
+ Root cause: [CATEGORY]
349
+ Gate results: [summary]
350
+ Fix brief: FIX-BRIEF-[ASSET_ID]-attempt-2.md
351
+
352
+ ### Attempt 3
353
+ Root cause: [CATEGORY]
354
+ Gate results: [summary]
355
+ Fix brief: FIX-BRIEF-[ASSET_ID]-attempt-3.md
356
+
357
+ ### Failure Pattern Analysis
358
+ [AI analysis of what consistently failed across all 3 attempts -- identify the
359
+ recurring gates, whether the same root cause persists, and any oscillation patterns]
360
+
361
+ ### Suggested Manual Edits
362
+ Based on the pattern of failures:
363
+ 1. [Specific edit suggestion with file location and what to change]
364
+ 2. [Specific edit suggestion]
365
+
366
+ Asset status: needs-human-fix
367
+ You can manually edit the file and re-run /ttm-verify ${SLUG}
368
+ ```
369
+
370
+ Set asset `review_status` to `"needs-human-fix"` in memory.
371
+
372
+ ---
373
+
374
+ ## Step 7: Update MANIFEST.json
375
+
376
+ Read MANIFEST.json from `.marketing/CAMPAIGNS/${SLUG}/MANIFEST.json`.
377
+
378
+ Update `review_status` for each processed asset:
379
+ - `"ship-ready"` if fix succeeded or user approved anyway
380
+ - `"needs-human-fix"` if 3-attempt cap reached without resolution
381
+
382
+ Also add `fix_attempts` count per asset:
383
+ ```json
384
+ {
385
+ "hero": {
386
+ ...existing fields...,
387
+ "review_status": "ship-ready|needs-human-fix",
388
+ "fix_attempts": 2
389
+ },
390
+ "derivatives": [
391
+ {
392
+ ...existing fields...,
393
+ "review_status": "ship-ready|needs-human-fix",
394
+ "fix_attempts": 3
395
+ }
396
+ ]
397
+ }
398
+ ```
399
+
400
+ Write updated MANIFEST.json back to disk.
401
+
402
+ ---
403
+
404
+ ## Step 8: Update VERIFICATION.md
405
+
406
+ After the final re-verification of each asset, update VERIFICATION.md with the latest
407
+ gate results. Overwrite the file with the new results (same pattern as verify.md Step 8).
408
+
409
+ Use the templates/verification-report.md format. Include results from the most recent
410
+ re-verification run for fixed assets. Assets not processed by fix retain their original
411
+ verification results.
412
+
413
+ ---
414
+
415
+ ## Step 9: Update Campaign State
416
+
417
+ ```bash
418
+ TIMESTAMP=$(node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" timestamp --raw)
419
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" fix.run_count "${RUN_NUMBER}"
420
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" fix.last_run "$TIMESTAMP"
421
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" fix.overall_result "[all-fixed|partial|escalated]"
422
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" phase fixed
423
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" phase.fixed "$TIMESTAMP"
424
+ ```
425
+
426
+ **fix.overall_result logic:**
427
+ - `all-fixed` -- all needs-fix assets now ship-ready (including user "approve anyway")
428
+ - `partial` -- some fixed, some still need human fix
429
+ - `escalated` -- all needs-fix assets hit the 3-attempt cap
430
+
431
+ Also update gate fields in STATE.md with latest verification results for fixed assets
432
+ (same pattern as verify.md Step 9):
433
+ ```bash
434
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" gate.positioning_drift [pass|warn|fail]
435
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" gate.claim_accuracy [pass|warn|fail]
436
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" gate.voice_drift [pass|warn|fail]
437
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" gate.outcome_alignment [pass|warn|fail]
438
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" gate.funnel_integrity [pass|warn|fail]
439
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" gate.utm_hygiene [pass|warn|fail]
440
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" gate.compliance [pass|warn|fail]
441
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" gate.competitor_collision [pass|warn|fail]
442
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" gate.icp_fit [pass|warn|fail]
443
+ node "${CLAUDE_PLUGIN_ROOT}/bin/ttm-tools.cjs" campaign update "${SLUG}" gate.format_correctness [pass|warn|fail]
444
+ ```
445
+
446
+ For each gate, use the worst result across all assets (including both fixed and non-fixed).
447
+
448
+ ---
449
+
450
+ ## Step 10: Display Completion
451
+
452
+ ```
453
+ takeToMarket > FIX COMPLETE
454
+
455
+ Run: ${RUN_NUMBER}
456
+ Assets processed: ${TOTAL}
457
+ Fixed (ship-ready): ${FIXED_COUNT}
458
+ Needs human fix: ${ESCALATED_COUNT}
459
+
460
+ Fix log: .marketing/CAMPAIGNS/${SLUG}/FIX-LOG.md
461
+ ```
462
+
463
+ **If any ship-ready assets:**
464
+ ```
465
+ Next: Run /ttm-ship ${SLUG} to launch approved assets
466
+ ```
467
+
468
+ **If any needs-human-fix assets:**
469
+ ```
470
+ Edit the flagged files manually, then run /ttm-verify ${SLUG} to re-check
471
+ ```
472
+
473
+ </process>
474
+
475
+ <success_criteria>
476
+ - [ ] All needs-fix assets from MANIFEST.json processed through fix loop
477
+ - [ ] Root cause proposed from 7-category taxonomy with user confirmation (D-05)
478
+ - [ ] Fix brief generated per attempt with failure list, preservation constraints, and corrections
479
+ - [ ] Task() re-production uses fix brief path (NOT original brief) as [BRIEF_PATH]
480
+ - [ ] All 10 gates re-run after each fix per gate-evaluation.md (D-06)
481
+ - [ ] Results shown to user per iteration with before/after comparison (D-07)
482
+ - [ ] Auto-approve to ship-ready on all gates passing (D-14)
483
+ - [ ] 3-attempt cap enforced with escalation display (D-08, LIFE-12)
484
+ - [ ] FIX-LOG.md records every attempt with root cause, fix brief, and gate results
485
+ - [ ] MANIFEST.json updated with review_status and fix_attempts per asset
486
+ - [ ] Campaign STATE.md updated with fix.run_count, fix.last_run, fix.overall_result
487
+ - [ ] VERIFICATION.md updated with latest gate results after fix
488
+ </success_criteria>
489
+
490
+ <output>
491
+ - `.marketing/CAMPAIGNS/${SLUG}/FIX-LOG.md` (fix attempt history -- append-only)
492
+ - `.marketing/CAMPAIGNS/${SLUG}/FIX-BRIEF-*-attempt-*.md` (fix briefs per attempt -- persistent)
493
+ - `.marketing/CAMPAIGNS/${SLUG}/MANIFEST.json` (updated with fix results per asset)
494
+ - `.marketing/CAMPAIGNS/${SLUG}/VERIFICATION.md` (updated with latest gate results)
495
+ </output>