ima-claude 2.20.0 → 2.25.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.
- package/README.md +48 -9
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/plugins/ima-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/ima-claude/agents/explorer.md +29 -15
- package/plugins/ima-claude/agents/implementer.md +58 -13
- package/plugins/ima-claude/agents/memory.md +19 -19
- package/plugins/ima-claude/agents/reviewer.md +56 -34
- package/plugins/ima-claude/agents/tester.md +59 -16
- package/plugins/ima-claude/agents/wp-developer.md +66 -21
- package/plugins/ima-claude/hooks/bootstrap.sh +42 -44
- package/plugins/ima-claude/hooks/prompt_coach_digest.md +14 -17
- package/plugins/ima-claude/hooks/prompt_coach_system.md +10 -12
- package/plugins/ima-claude/personalities/README.md +17 -6
- package/plugins/ima-claude/personalities/enable-efficient.md +61 -0
- package/plugins/ima-claude/personalities/enable-terse.md +71 -0
- package/plugins/ima-claude/skills/agentic-workflows/SKILL.md +35 -71
- package/plugins/ima-claude/skills/architect/SKILL.md +54 -168
- package/plugins/ima-claude/skills/compound-bridge/SKILL.md +41 -94
- package/plugins/ima-claude/skills/design-to-code/SKILL.md +43 -78
- package/plugins/ima-claude/skills/discourse/SKILL.md +79 -194
- package/plugins/ima-claude/skills/discourse-admin/SKILL.md +41 -103
- package/plugins/ima-claude/skills/docs-organize/SKILL.md +63 -203
- package/plugins/ima-claude/skills/ember-discourse/SKILL.md +90 -200
- package/plugins/ima-claude/skills/espocrm/SKILL.md +14 -23
- package/plugins/ima-claude/skills/espocrm-api/SKILL.md +79 -192
- package/plugins/ima-claude/skills/functional-programmer/SKILL.md +33 -237
- package/plugins/ima-claude/skills/gh-cli/SKILL.md +26 -65
- package/plugins/ima-claude/skills/ima-bootstrap/SKILL.md +71 -104
- package/plugins/ima-claude/skills/ima-bootstrap/references/ima-brand.md +32 -22
- package/plugins/ima-claude/skills/ima-brand/SKILL.md +18 -23
- package/plugins/ima-claude/skills/ima-copywriting/SKILL.md +68 -179
- package/plugins/ima-claude/skills/ima-doc2pdf/SKILL.md +32 -102
- package/plugins/ima-claude/skills/ima-editorial-scorecard/SKILL.md +38 -63
- package/plugins/ima-claude/skills/ima-editorial-workflow/SKILL.md +69 -114
- package/plugins/ima-claude/skills/ima-email-creator/SKILL.md +16 -22
- package/plugins/ima-claude/skills/ima-forms-expert/SKILL.md +21 -37
- package/plugins/ima-claude/skills/jira-checkpoint/SKILL.md +39 -120
- package/plugins/ima-claude/skills/jquery/SKILL.md +107 -233
- package/plugins/ima-claude/skills/js-fp/SKILL.md +75 -296
- package/plugins/ima-claude/skills/js-fp-api/SKILL.md +52 -162
- package/plugins/ima-claude/skills/js-fp-react/SKILL.md +47 -270
- package/plugins/ima-claude/skills/js-fp-vue/SKILL.md +55 -209
- package/plugins/ima-claude/skills/js-fp-wordpress/SKILL.md +59 -204
- package/plugins/ima-claude/skills/livecanvas/SKILL.md +19 -32
- package/plugins/ima-claude/skills/mcp-atlassian/SKILL.md +92 -162
- package/plugins/ima-claude/skills/mcp-context7/SKILL.md +32 -64
- package/plugins/ima-claude/skills/mcp-gitea/SKILL.md +98 -188
- package/plugins/ima-claude/skills/mcp-github/SKILL.md +60 -124
- package/plugins/ima-claude/skills/mcp-memory/SKILL.md +1 -177
- package/plugins/ima-claude/skills/mcp-qdrant/SKILL.md +58 -115
- package/plugins/ima-claude/skills/mcp-sequential/SKILL.md +32 -87
- package/plugins/ima-claude/skills/mcp-serena/SKILL.md +54 -80
- package/plugins/ima-claude/skills/mcp-tavily/SKILL.md +40 -63
- package/plugins/ima-claude/skills/mcp-vestige/SKILL.md +75 -116
- package/plugins/ima-claude/skills/php-authnet/SKILL.md +32 -65
- package/plugins/ima-claude/skills/php-fp/SKILL.md +50 -129
- package/plugins/ima-claude/skills/php-fp-wordpress/SKILL.md +25 -73
- package/plugins/ima-claude/skills/phpunit-wp/SKILL.md +103 -463
- package/plugins/ima-claude/skills/playwright/SKILL.md +69 -220
- package/plugins/ima-claude/skills/prompt-starter/SKILL.md +33 -83
- package/plugins/ima-claude/skills/prompt-starter/references/code-review.md +38 -0
- package/plugins/ima-claude/skills/py-fp/SKILL.md +78 -384
- package/plugins/ima-claude/skills/quasar-fp/SKILL.md +54 -255
- package/plugins/ima-claude/skills/quickstart/SKILL.md +7 -11
- package/plugins/ima-claude/skills/rails/SKILL.md +63 -184
- package/plugins/ima-claude/skills/resume-session/SKILL.md +14 -35
- package/plugins/ima-claude/skills/rg/SKILL.md +61 -146
- package/plugins/ima-claude/skills/ruby-fp/SKILL.md +66 -163
- package/plugins/ima-claude/skills/save-session/SKILL.md +10 -39
- package/plugins/ima-claude/skills/scorecard/SKILL.md +24 -38
- package/plugins/ima-claude/skills/skill-analyzer/SKILL.md +42 -71
- package/plugins/ima-claude/skills/skill-creator/SKILL.md +79 -250
- package/plugins/ima-claude/skills/task-master/SKILL.md +11 -31
- package/plugins/ima-claude/skills/task-planner/SKILL.md +44 -153
- package/plugins/ima-claude/skills/task-runner/SKILL.md +61 -143
- package/plugins/ima-claude/skills/unit-testing/SKILL.md +59 -134
- package/plugins/ima-claude/skills/wp-ddev/SKILL.md +38 -120
- package/plugins/ima-claude/skills/wp-local/SKILL.md +26 -108
|
@@ -7,226 +7,115 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# IMA Copywriting
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
You are not a generic marketing copywriter. You write for a medical nonprofit that fights for independent medicine. Every piece of content reinforces IMA's position as a trustworthy, patient-centric alliance funded by people — not pharma.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Before Writing
|
|
17
|
-
|
|
18
|
-
**Always load the `ima-brand` skill first.** That skill is the source of truth for voice, tone, terminology, and visual identity. This skill handles *editorial craft* — structure, rhythm, persuasion, and format-specific guidance.
|
|
19
|
-
|
|
20
|
-
---
|
|
10
|
+
IMA = Independent Medical Alliance. Patient-centric, pharma-independent. Load `ima-brand` first (voice/tone authority).
|
|
21
11
|
|
|
22
12
|
## Content Type Router
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
|
27
|
-
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
| ✊ Op-Ed | [references/format-op-ed.md](references/format-op-ed.md) | Professional + Direct (earned edge) |
|
|
34
|
-
| 📱 Social Post | [references/format-social-media.md](references/format-social-media.md) | Friendly + Informational |
|
|
35
|
-
|
|
36
|
-
**Read only the reference file for the content type you're writing.** Do not load all formats.
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## IMA Writing Principles
|
|
14
|
+
| Format | Reference File | Tone |
|
|
15
|
+
|--------|----------------|------|
|
|
16
|
+
| Newsletter | [references/format-newsletter.md](references/format-newsletter.md) | Friendly + Informative |
|
|
17
|
+
| Webinar Email | [references/format-webinar-email.md](references/format-webinar-email.md) | Friendly + Informative (higher energy) |
|
|
18
|
+
| Blog Post | [references/format-blog-post.md](references/format-blog-post.md) | Professional + Informative |
|
|
19
|
+
| Press Release | [references/format-press-release.md](references/format-press-release.md) | Professional + Informative |
|
|
20
|
+
| Fundraising Email | [references/format-fundraising-email.md](references/format-fundraising-email.md) | Inspirational + Supportive |
|
|
21
|
+
| Op-Ed | [references/format-op-ed.md](references/format-op-ed.md) | Professional + Direct |
|
|
22
|
+
| Social Post | [references/format-social-media.md](references/format-social-media.md) | Friendly + Informational |
|
|
41
23
|
|
|
42
|
-
|
|
24
|
+
Read only the reference file for active content type.
|
|
43
25
|
|
|
44
|
-
|
|
45
|
-
Lead with what the research shows. Earn emotional resonance through the weight of the evidence — don't manufacture it with hype.
|
|
26
|
+
## Writing Principles
|
|
46
27
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
❌ "Cancer rates are exploding and nobody is doing anything."
|
|
54
|
-
✅ "Cancer is striking earlier, faster, and harder. At IMA, we're changing that."
|
|
55
|
-
|
|
56
|
-
### 3. Independent, Not Adversarial
|
|
57
|
-
IMA's independence is its strength. Name specific actors when relevant (NYT, AAP, pharmaceutical companies), but frame criticism through evidence and principle — not name-calling.
|
|
58
|
-
|
|
59
|
-
❌ "Big Pharma shills at the NYT are lying again."
|
|
60
|
-
✅ "The New York Times published a hit piece on Dr. Kirk Milhoan for holding a radical position: that patients and doctors should decide medical care together."
|
|
61
|
-
|
|
62
|
-
### 4. Plain Language with Precision
|
|
63
|
-
Write so a patient can understand and a physician won't cringe. Define medical terms on first use. Never dumb down the science — translate it.
|
|
64
|
-
|
|
65
|
-
❌ "The study found bad stuff in the vaccines."
|
|
66
|
-
✅ "New research explains why regulators keep missing DNA contamination in mRNA vaccines — and why independent labs keep finding it."
|
|
67
|
-
|
|
68
|
-
### 5. The Reader Is an Ally, Not a Target
|
|
69
|
-
IMA's audience chose to be here. Write to them as partners in a shared mission, not as prospects to convert. Respect their intelligence.
|
|
70
|
-
|
|
71
|
-
❌ "You won't BELIEVE what we discovered..."
|
|
72
|
-
✅ "Someone didn't want you to see this research."
|
|
73
|
-
|
|
74
|
-
### 6. Honest Confidence
|
|
75
|
-
State positions directly. Don't hedge when the evidence is strong. Don't overstate when it's emerging. The distinction is the brand.
|
|
76
|
-
|
|
77
|
-
- Strong evidence: "Measles is highly treatable."
|
|
78
|
-
- Emerging evidence: "Research points to mitochondrial dysfunction as a central driver."
|
|
79
|
-
- Opinion: "We believe public health conversations should be rooted in data, not fear."
|
|
80
|
-
|
|
81
|
-
---
|
|
28
|
+
1. **Evidence first** — Lead with research; earn emotion through weight of evidence, not hype.
|
|
29
|
+
2. **Solution-oriented** — Acknowledge problem → pivot to IMA action. Reader leaves empowered, not paralyzed.
|
|
30
|
+
3. **Independent, not adversarial** — Name actors when relevant; frame criticism through evidence, not name-calling.
|
|
31
|
+
4. **Plain language with precision** — Patient understands, physician won't cringe. Define jargon on first use.
|
|
32
|
+
5. **Reader is ally** — Partners in shared mission, not prospects to convert.
|
|
33
|
+
6. **Honest confidence** — State strong evidence directly. Hedge emerging evidence. Label opinion.
|
|
82
34
|
|
|
83
|
-
##
|
|
84
|
-
|
|
85
|
-
### Voice Characteristics
|
|
35
|
+
## Style Rules
|
|
86
36
|
|
|
87
37
|
| Always | Never |
|
|
88
38
|
|--------|-------|
|
|
89
|
-
| Direct
|
|
39
|
+
| Direct declarative sentences | Clickbait / sensationalism |
|
|
90
40
|
| Active voice | Passive constructions |
|
|
91
41
|
| Specific claims with evidence | Vague wellness-speak |
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
| Humor and wit (when appropriate) | Snark without substance |
|
|
95
|
-
|
|
96
|
-
### Word-Level Rules
|
|
97
|
-
|
|
98
|
-
1. **Simple over complex** — "use" not "utilize," "help" not "facilitate"
|
|
99
|
-
2. **Precise over vague** — Avoid "streamline," "optimize," "innovative," "cutting-edge"
|
|
100
|
-
3. **Active over passive** — "IMA researchers discovered" not "It was discovered"
|
|
101
|
-
4. **Earned intensity** — Phrases like "hit piece," "backfired," "the establishment is nervous" land because IMA uses them sparingly and backs them up
|
|
102
|
-
5. **No exclamation points in body copy** — Exception: social media openers ("Live tonight!") and fundraising CTAs (one acceptable)
|
|
103
|
-
6. **Define jargon** — "PACVS (Post-Acute COVID Vaccination Syndrome)" on first use
|
|
42
|
+
| Earned intensity (used sparingly) | Breathless urgency |
|
|
43
|
+
| "use" not "utilize" | "streamline," "optimize," "cutting-edge" |
|
|
104
44
|
|
|
105
|
-
|
|
45
|
+
No exclamation points in body copy — exception: social openers, one fundraising CTA.
|
|
106
46
|
|
|
107
|
-
|
|
108
|
-
|-------|-------------|-----|
|
|
109
|
-
| FLCCC | IMA / Independent Medical Alliance | Rebrand complete |
|
|
110
|
-
| "Cure" / "treatment" (unqualified) | "Protocol" / "approach" / "may help with" | Precision |
|
|
111
|
-
| "You should" | "You may consider" / "Research suggests" | Patient autonomy |
|
|
112
|
-
| "Alternative medicine" | "Integrative medicine" / "complementary approaches" | Accurate framing |
|
|
113
|
-
| "Big Pharma" (as sole descriptor) | Name the company or say "pharmaceutical industry" | Credibility |
|
|
114
|
-
| "We believe" (for science) | "Evidence shows" / "Research indicates" | Evidence-based positioning |
|
|
115
|
-
| "Anti-vaccine" (describing IMA) | "Pro-informed-consent" / "independent" | Accuracy |
|
|
47
|
+
## Terminology
|
|
116
48
|
|
|
117
|
-
|
|
49
|
+
| Avoid | Use |
|
|
50
|
+
|-------|-----|
|
|
51
|
+
| FLCCC | IMA / Independent Medical Alliance |
|
|
52
|
+
| "cure" / "treatment" (unqualified) | "protocol" / "approach" / "may help with" |
|
|
53
|
+
| "you should" | "you may consider" / "research suggests" |
|
|
54
|
+
| "alternative medicine" | "integrative medicine" / "complementary approaches" |
|
|
55
|
+
| "Big Pharma" (sole descriptor) | company name or "pharmaceutical industry" |
|
|
56
|
+
| "we believe" (for science) | "evidence shows" / "research indicates" |
|
|
57
|
+
| "anti-vaccine" (describing IMA) | "pro-informed-consent" / "independent" |
|
|
118
58
|
|
|
119
|
-
|
|
59
|
+
## AI Tells — Never Use
|
|
120
60
|
|
|
121
|
-
|
|
122
|
-
- "It's worth noting that..."
|
|
123
|
-
- "At its core,..."
|
|
124
|
-
- "Let's delve into..."
|
|
125
|
-
- "This begs the question..."
|
|
126
|
-
- "In conclusion,..."
|
|
127
|
-
- "Moreover,..." / "Furthermore,..." (overuse)
|
|
128
|
-
|
|
129
|
-
**For approved transition phrases**: See [references/ima-transitions.md](references/ima-transitions.md)
|
|
130
|
-
|
|
131
|
-
---
|
|
61
|
+
"In today's rapidly evolving landscape" · "It's worth noting" · "At its core" · "Let's delve into" · "In conclusion" · "Moreover" / "Furthermore" (overuse)
|
|
132
62
|
|
|
133
|
-
|
|
63
|
+
See [references/ima-transitions.md](references/ima-transitions.md) for approved transitions.
|
|
134
64
|
|
|
135
|
-
|
|
65
|
+
## CTA Patterns
|
|
136
66
|
|
|
137
|
-
| Context | CTA
|
|
138
|
-
|
|
139
|
-
| Webinar / Blog (email/web) | "Watch Now »" / "Read More »" |
|
|
140
|
-
| Download
|
|
141
|
-
| Conference
|
|
142
|
-
| Donate (primary) | "💙 Match My Gift Today »" |
|
|
143
|
-
| Donate (secondary) | "🌱 Help Us Grow Hope »" |
|
|
67
|
+
| Context | CTA | Notes |
|
|
68
|
+
|---------|-----|-------|
|
|
69
|
+
| Webinar / Blog (email/web) | "Watch Now »" / "Read More »" | » required on email/web |
|
|
70
|
+
| Download | "Download Now »" | |
|
|
71
|
+
| Conference | "🎟 Buy Tickets Now »" | Emoji before text |
|
|
72
|
+
| Donate (primary) | "💙 Match My Gift Today »" | Match campaigns |
|
|
73
|
+
| Donate (secondary) | "🌱 Help Us Grow Hope »" | End-of-email |
|
|
144
74
|
| Donate (evergreen) | "Please Support IMA's Mission »" | Standard newsletter close |
|
|
145
|
-
| Social
|
|
75
|
+
| Social | "Watch now." / "Learn more and sign:" | No chevron; short imperative |
|
|
146
76
|
|
|
147
|
-
|
|
148
|
-
1. **Email/web:** Always include » chevron at end
|
|
149
|
-
2. **Social:** No chevron. Short imperative sentence ("Watch now.") or natural lead-in to link
|
|
150
|
-
3. Emoji before CTA text on standalone email/web CTAs (💙, 🎟, 🌱, 👉)
|
|
151
|
-
4. Verb-first: "Watch," "Read," "Download," "Support," "Buy"
|
|
152
|
-
5. Never: "Click Here," "Learn More," "Submit"
|
|
153
|
-
6. One primary CTA per content section; repeat in P.S. for fundraising
|
|
154
|
-
|
|
155
|
-
---
|
|
77
|
+
Verb-first. One primary CTA per section; repeat in P.S. for fundraising. Never "Click Here," "Learn More," "Submit."
|
|
156
78
|
|
|
157
79
|
## Structural Patterns
|
|
158
80
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
Every newsletter ends with this block. Vary the content; keep the structure:
|
|
162
|
-
|
|
81
|
+
**"Honest Medicine" Close** (every newsletter):
|
|
163
82
|
```
|
|
164
83
|
PLEASE SUPPORT HONEST MEDICINE
|
|
165
84
|
|
|
166
|
-
[2-3 sentences
|
|
167
|
-
No pharma funding, no institutional strings. Just [
|
|
85
|
+
[2-3 sentences: this week's outputs → what donors fund.]
|
|
86
|
+
No pharma funding, no institutional strings. Just [what IMA does].
|
|
168
87
|
|
|
169
88
|
If you've found value in what we do, your support helps us keep going.
|
|
170
89
|
|
|
171
90
|
Please Support IMA's Mission »
|
|
172
91
|
```
|
|
173
92
|
|
|
174
|
-
|
|
93
|
+
**Opening Hook Patterns:**
|
|
175
94
|
|
|
176
95
|
| Pattern | Example |
|
|
177
96
|
|---------|---------|
|
|
178
97
|
| Bold declaration | "The establishment is nervous." |
|
|
179
98
|
| Provocative setup | "Someone didn't want you to see this research." |
|
|
180
|
-
| Trend
|
|
99
|
+
| Trend | "Peptides are popping up like no tomorrow in wellness." |
|
|
181
100
|
| Contrast/irony | "Apparently, this is now a radical position." |
|
|
182
101
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
Always emoji + title format. 3-6 items:
|
|
186
|
-
|
|
187
|
-
| Emoji | Use For |
|
|
188
|
-
|-------|---------|
|
|
189
|
-
| 💊 | Drug/therapy/peptide content |
|
|
190
|
-
| 📰 | News, responses, op-eds |
|
|
191
|
-
| 🔬 | Research, studies, journal articles |
|
|
192
|
-
| 🧬 | Genetics, DNA, molecular biology |
|
|
193
|
-
| ⚡ | Breaking/urgent content |
|
|
194
|
-
| 💬 | Opinion, commentary, "Here's a Thought" |
|
|
195
|
-
| 💪 | Health guides, wellness content |
|
|
196
|
-
| 💤 | Sleep-related content |
|
|
197
|
-
| 🎉 | Achievements, appointments, wins |
|
|
198
|
-
| 📖 | Journal, publications, long reads |
|
|
199
|
-
| 📄 | Guides, downloadables, PDFs |
|
|
200
|
-
|
|
201
|
-
---
|
|
102
|
+
**Quick Links Block** (newsletters, emoji + title, 3-6 items):
|
|
103
|
+
💊 therapy · 📰 news/op-eds · 🔬 research · 🧬 genetics · ⚡ breaking · 💬 opinion · 💪 wellness · 💤 sleep · 🎉 wins · 📖 publications · 📄 guides
|
|
202
104
|
|
|
203
105
|
## Quality Checklist
|
|
204
106
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
- [ ]
|
|
208
|
-
- [ ]
|
|
209
|
-
- [ ]
|
|
210
|
-
- [ ]
|
|
211
|
-
- [ ]
|
|
212
|
-
- [ ]
|
|
213
|
-
- [ ]
|
|
214
|
-
- [ ]
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
## Additional References
|
|
222
|
-
|
|
223
|
-
- **[references/ima-transitions.md](references/ima-transitions.md)** — Approved transition phrases
|
|
224
|
-
- **[references/ima-copy-frameworks.md](references/ima-copy-frameworks.md)** — Headline formulas, structural templates, section patterns
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
## Related Skills
|
|
229
|
-
|
|
230
|
-
- **ima-brand**: Voice, tone, terminology, visual identity (ALWAYS load alongside this skill)
|
|
231
|
-
- **ima-editorial-scorecard**: Score and assess existing content against IMA standards
|
|
232
|
-
- **ima-bootstrap**: CSS/SCSS for web implementation of IMA content
|
|
107
|
+
- [ ] Sounds like IMA, not generic health org?
|
|
108
|
+
- [ ] Every health claim supported or labeled?
|
|
109
|
+
- [ ] No "FLCCC," no unqualified "cure"?
|
|
110
|
+
- [ ] < 10% passive voice?
|
|
111
|
+
- [ ] Patient understands? Physician respects?
|
|
112
|
+
- [ ] Clear next action for reader?
|
|
113
|
+
- [ ] Chevron on email/web CTAs; short imperative on social?
|
|
114
|
+
- [ ] Urgency earned, not manufactured?
|
|
115
|
+
- [ ] No AI tells?
|
|
116
|
+
- [ ] IMA independence signal present?
|
|
117
|
+
|
|
118
|
+
## References
|
|
119
|
+
|
|
120
|
+
- [references/ima-transitions.md](references/ima-transitions.md) — Approved transition phrases
|
|
121
|
+
- [references/ima-copy-frameworks.md](references/ima-copy-frameworks.md) — Headline formulas, structural templates
|
|
@@ -14,37 +14,19 @@ description: >-
|
|
|
14
14
|
|
|
15
15
|
# IMA DOCX → Branded PDF
|
|
16
16
|
|
|
17
|
-
Extracts content from
|
|
18
|
-
Lato typography, navy/gold colors, and IMA layout standards. Works with guides,
|
|
19
|
-
reports, white papers, and other IMA documents. Outputs content pages only
|
|
20
|
-
(no cover page) — the cover is handled by `ima-cover-creator` and merged via pypdf.
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Why ReportLab for Content
|
|
25
|
-
|
|
26
|
-
Content pages are pure document flow: headings, body paragraphs, bullet lists,
|
|
27
|
-
inline bold/italic, embedded images, and running footers. ReportLab handles all of
|
|
28
|
-
this with proper Lato font registration, automatic page breaks, and precise
|
|
29
|
-
typographic control. No coordinate math needed — the flow engine does the work.
|
|
30
|
-
|
|
31
|
-
---
|
|
17
|
+
Extracts content from Word documents, generates branded IMA PDF (Lato, navy/gold, IMA layout). Outputs content pages only — cover handled by `ima-cover-creator` and merged via pypdf.
|
|
32
18
|
|
|
33
19
|
## Quick Start
|
|
34
20
|
|
|
35
|
-
### 1. Install dependencies (once)
|
|
36
|
-
|
|
37
21
|
```bash
|
|
22
|
+
# Install (once)
|
|
38
23
|
pip install python-docx reportlab Pillow pypdf --break-system-packages
|
|
39
|
-
```
|
|
40
24
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
```bash
|
|
25
|
+
# Generate content PDF
|
|
44
26
|
python3 scripts/generate_pdf.py path/to/document.docx --out content.pdf
|
|
45
27
|
```
|
|
46
28
|
|
|
47
|
-
|
|
29
|
+
## Merge with Cover
|
|
48
30
|
|
|
49
31
|
```python
|
|
50
32
|
from pypdf import PdfReader, PdfWriter
|
|
@@ -55,7 +37,7 @@ content = PdfReader("content.pdf")
|
|
|
55
37
|
writer = PdfWriter()
|
|
56
38
|
writer.add_page(cover.pages[0])
|
|
57
39
|
|
|
58
|
-
# Skip
|
|
40
|
+
# Skip first 2 pages (ReportLab placeholder cover + overflow)
|
|
59
41
|
for page in content.pages[2:]:
|
|
60
42
|
writer.add_page(page)
|
|
61
43
|
|
|
@@ -63,28 +45,19 @@ with open("final.pdf", "wb") as f:
|
|
|
63
45
|
writer.write(f)
|
|
64
46
|
```
|
|
65
47
|
|
|
66
|
-
---
|
|
67
|
-
|
|
68
48
|
## Pipeline
|
|
69
49
|
|
|
70
50
|
```
|
|
71
|
-
DOCX
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
+
|
|
77
|
-
cover.pdf (from ima-cover-creator)
|
|
78
|
-
↓ pypdf merge
|
|
79
|
-
↓
|
|
80
|
-
final.pdf → Canva import
|
|
51
|
+
DOCX → extract_docx.py → generate_pdf.py → content.pdf
|
|
52
|
+
+
|
|
53
|
+
cover.pdf (ima-cover-creator)
|
|
54
|
+
↓ pypdf merge
|
|
55
|
+
final.pdf → Canva import
|
|
81
56
|
```
|
|
82
57
|
|
|
83
|
-
|
|
58
|
+
## Typography Spec
|
|
84
59
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
All values confirmed from Canva design data. Font: Lato (Google Fonts).
|
|
60
|
+
Font: Lato (Google Fonts). Values confirmed from Canva design data.
|
|
88
61
|
|
|
89
62
|
### Headings
|
|
90
63
|
|
|
@@ -124,18 +97,16 @@ All values confirmed from Canva design data. Font: Lato (Google Fonts).
|
|
|
124
97
|
| Body width | 7.5 in |
|
|
125
98
|
| Footer height | 0.4 in from bottom |
|
|
126
99
|
|
|
127
|
-
---
|
|
128
|
-
|
|
129
100
|
## Content Extraction
|
|
130
101
|
|
|
131
|
-
|
|
102
|
+
`extract_docx.py` classifies each paragraph into typed blocks. Each block includes `runs` with per-run bold/italic flags.
|
|
132
103
|
|
|
133
104
|
| Type | Description |
|
|
134
105
|
|------|-------------|
|
|
135
|
-
| `h1` | Top-level heading
|
|
106
|
+
| `h1` | Top-level heading |
|
|
136
107
|
| `h2` | Section heading |
|
|
137
108
|
| `h3` | Sub-heading |
|
|
138
|
-
| `heading_bold` | All-bold paragraph
|
|
109
|
+
| `heading_bold` | All-bold paragraph |
|
|
139
110
|
| `body` | Regular paragraph |
|
|
140
111
|
| `bullet` | List item |
|
|
141
112
|
| `author` | Author name |
|
|
@@ -146,97 +117,56 @@ The `extract_docx.py` script classifies each Word paragraph into typed blocks:
|
|
|
146
117
|
| `answer_start` | Q&A answer (YES/NO prefix) |
|
|
147
118
|
| `reference` | Numbered citation |
|
|
148
119
|
| `ref_heading` | "References" heading |
|
|
149
|
-
| `figure_caption` |
|
|
120
|
+
| `figure_caption` | Caption |
|
|
150
121
|
| `page_break` | Hard page break |
|
|
151
122
|
|
|
152
|
-
Each block includes `runs` with per-run bold/italic flags for inline formatting.
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
123
|
## Image Handling
|
|
157
124
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
4. Inserts ReportLab `Image` flowables at the correct positions
|
|
164
|
-
5. Scales to fit within `page_width - 2 × margin`
|
|
165
|
-
|
|
166
|
-
Images that appear between text paragraphs (image-only paragraphs) are also caught
|
|
167
|
-
and appended after all text content.
|
|
168
|
-
|
|
169
|
-
---
|
|
125
|
+
1. Read all image relationships from DOCX package
|
|
126
|
+
2. Map paragraph indices to embedded image positions
|
|
127
|
+
3. Write images to temp files
|
|
128
|
+
4. Insert ReportLab `Image` flowables at correct positions
|
|
129
|
+
5. Scale to fit `page_width - 2 × margin`
|
|
170
130
|
|
|
171
131
|
## Cover Page Behavior
|
|
172
132
|
|
|
173
|
-
|
|
174
|
-
text) as pages 1-2 of its output. This exists so the script works standalone, but
|
|
175
|
-
when pairing with `ima-cover-creator`, **skip the first 2 pages** during merge.
|
|
133
|
+
ReportLab generates placeholder cover as pages 1-2. Skip them during merge. To verify:
|
|
176
134
|
|
|
177
|
-
To check which pages to skip:
|
|
178
135
|
```python
|
|
179
136
|
from pypdf import PdfReader
|
|
180
137
|
r = PdfReader("content.pdf")
|
|
181
138
|
for i in range(min(3, len(r.pages))):
|
|
182
|
-
|
|
183
|
-
print(f"Page {i}: {text}")
|
|
139
|
+
print(f"Page {i}: {r.pages[i].extract_text()[:100]}")
|
|
184
140
|
```
|
|
185
141
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
---
|
|
142
|
+
First content page typically starts with "Introduction" or section heading.
|
|
189
143
|
|
|
190
144
|
## Scripts
|
|
191
145
|
|
|
192
146
|
| Script | Purpose |
|
|
193
147
|
|--------|---------|
|
|
194
|
-
| `generate_pdf.py` |
|
|
148
|
+
| `generate_pdf.py` | DOCX → branded PDF via ReportLab |
|
|
195
149
|
| `extract_docx.py` | Extracts structured content from Word documents |
|
|
196
|
-
| `docx_utils.py` | Shared
|
|
197
|
-
|
|
198
|
-
---
|
|
150
|
+
| `docx_utils.py` | Shared DOCX parsing utilities |
|
|
199
151
|
|
|
200
152
|
## Fonts
|
|
201
153
|
|
|
202
|
-
Lato TTF
|
|
203
|
-
directory (which is git-ignored). The font family (Regular, Bold, Italic, BoldItalic)
|
|
204
|
-
is registered with ReportLab so that `<b>` and `<i>` markup works in Paragraph objects.
|
|
205
|
-
|
|
206
|
-
If the fonts are already present, the download is skipped.
|
|
207
|
-
|
|
208
|
-
---
|
|
154
|
+
Lato TTF auto-downloaded from Google Fonts on first run into `fonts/` (git-ignored). Family (Regular, Bold, Italic, BoldItalic) registered with ReportLab. Download skipped if fonts present.
|
|
209
155
|
|
|
210
156
|
## Customization
|
|
211
157
|
|
|
212
|
-
### Adjusting the footer
|
|
213
|
-
|
|
214
|
-
The footer shows the document title and date. To customize:
|
|
215
158
|
```python
|
|
216
|
-
#
|
|
159
|
+
# Footer text (in generate_pdf.py)
|
|
217
160
|
title_short = (title[:60] + "...") if len(title) > 60 else title
|
|
218
161
|
footer_text = f"{title_short} ({clean_date})"
|
|
219
162
|
```
|
|
220
163
|
|
|
221
|
-
|
|
164
|
+
To add paragraph types: add classifier rule in `extract_docx.py`, handler in `block_to_flowables()`, and `ParagraphStyle` in `build_styles()`.
|
|
222
165
|
|
|
223
|
-
|
|
224
|
-
2. Add a handler in `block_to_flowables()` in `generate_pdf.py`
|
|
225
|
-
3. Create a ReportLab `ParagraphStyle` in `build_styles()`
|
|
226
|
-
|
|
227
|
-
---
|
|
228
|
-
|
|
229
|
-
## Relationship to Other Skills
|
|
166
|
+
## Related Skills
|
|
230
167
|
|
|
231
168
|
| Skill | Role |
|
|
232
169
|
|-------|------|
|
|
233
|
-
| **ima-cover-creator** |
|
|
234
|
-
| **ima-cancer-care-guides** | Full pipeline
|
|
170
|
+
| **ima-cover-creator** | Branded cover page (PPTX → PDF) |
|
|
171
|
+
| **ima-cancer-care-guides** | Full pipeline with Markdown source and Canva API |
|
|
235
172
|
| **ima-brand** | Source of truth for colors, typography, voice |
|
|
236
|
-
|
|
237
|
-
**Typical workflow:**
|
|
238
|
-
```
|
|
239
|
-
ima-cover-creator → cover.pdf (1 page)
|
|
240
|
-
ima-doc2pdf → content.pdf (skip first 2 pages)
|
|
241
|
-
pypdf merge → final.pdf → Canva import
|
|
242
|
-
```
|