Skip to content

Commit 63ca09e

Browse files
dshkolclaude
andcommitted
Add deployment config and style enhancements
- Configure Netlify deployment (netlify.toml, GitHub Actions workflow) - Add base path /thedaily for subdirectory deployment - Redesign landing page with featured articles - Add article type tags (New Release / Deep Dive) - Enhance CPI articles with causation context and regional narrative - Add contextual causation guidelines to VOICE-GUIDE.md - Create fetch_context.R utility for hedged causation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 79eab19 commit 63ca09e

10 files changed

Lines changed: 819 additions & 88 deletions

File tree

.claude/skills/the-daily-generator/VOICE-GUIDE.md

Lines changed: 68 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,37 @@ Statistics Canada's "The Daily" has a distinctive voice: neutral, clinical, and
5050
| alarming | significant |
5151
| good/bad news | [omit entirely] |
5252

53-
### Avoid Causal Claims
54-
55-
| Avoid | Use Instead |
56-
|-------|-------------|
57-
| "due to" | "coincided with" |
58-
| "caused by" | "occurred alongside" |
59-
| "because of" | [describe correlation only] |
60-
| "led to" | [avoid causal language] |
53+
### Contextual Causation (Hedged Language)
54+
55+
For major price movers (>10% change), provide context using **hedged language** that describes correlation without asserting direct causation.
56+
57+
**Hedged connectors (safe to use):**
58+
- "amid" - "Coffee prices rose 27.8% amid supply disruptions in producing regions"
59+
- "coinciding with" - "Beef prices increased coinciding with tight cattle supply"
60+
- "following" - "Gasoline prices fell following declines in crude oil markets"
61+
- "in the context of" - "Rent increases moderated in the context of new housing supply"
62+
- "as markets responded to" - "Lumber prices rose as markets responded to supply constraints"
63+
64+
**Stronger causation (use only when sourced from StatCan or verified):**
65+
- "driven by" - Only when StatCan's Daily explicitly states this
66+
- "due to" - Only when citing official analysis
67+
- "caused by" - Avoid unless quoting an authoritative source
68+
69+
**Known patterns (high confidence):**
70+
These economic relationships are well-established and can be referenced:
71+
- Gasoline ↔ crude oil prices
72+
- Beef ↔ North American cattle inventories
73+
- Coffee ↔ weather in producing regions, trade policy
74+
- Mortgage interest ↔ Bank of Canada rate decisions
75+
- Rent ↔ housing supply conditions
76+
- Airfare ↔ fuel costs, travel demand
77+
78+
**When no context is available:**
79+
Fall back to trend language without causation:
80+
- "Beef prices (+17.7%) continued their upward trend"
81+
- "Coffee prices rose for the sixth consecutive month"
82+
83+
See `r-tools/fetch_context.R` for the context-fetching utility.
6184

6285
## Article Structure
6386

@@ -82,9 +105,18 @@ Statistics Canada's "The Daily" has a distinctive voice: neutral, clinical, and
82105
- Use data tables for detailed numbers
83106

84107
### 5. Regional Analysis (if applicable)
85-
- Provincial variations
86-
- Highest and lowest regions
87-
- Use data tables
108+
109+
Open with a summary of provincial movement patterns:
110+
- "On an annual basis in November, prices rose at a faster pace in five provinces, were unchanged in two, and rose at a slower pace in the remaining three compared with October."
111+
112+
Highlight the leader and laggard with context:
113+
- "Of all the provinces, [Province] recorded the [largest/smallest] increase at X.X%, [brief driver if known]. At the other end, [Province] recorded the [lowest/highest] at X.X%."
114+
115+
Add comparative context:
116+
- "[Province] (+X.X%) and [Province] (+X.X%) also exceeded the national rate, while [Province] (+X.X%) remained below it."
117+
- "The X.X percentage point spread between [highest] and [lowest] reflects significant regional variation."
118+
119+
Include table with "vs. National" column showing percentage point differences.
88120

89121
### 6. Note to Readers
90122
- Brief methodology explanation
@@ -121,6 +153,31 @@ Always provide context with comparisons:
121153
6. **Exclamation marks** - Never use them
122154
7. **Questions** - Don't pose rhetorical questions
123155

156+
## Article Type Tags
157+
158+
Each article should be tagged with its generation type:
159+
160+
| Type | Tag (EN) | Tag (FR) | CSS Class | When to Use |
161+
|------|----------|----------|-----------|-------------|
162+
| **New Release** | `New Release` | `Nouvelle publication` | `.release` | Article generated in response to fresh StatCan data release |
163+
| **Deep Dive** | `Deep Dive` | `Analyse approfondie` | `.dive` | Article analyzing existing data series, historical patterns, or thematic analysis |
164+
165+
### Implementation
166+
167+
In article frontmatter or release date line:
168+
```html
169+
<p class="release-date">Released: December 22, 2025 <span class="article-type-tag release">New Release</span></p>
170+
```
171+
172+
On landing page cards:
173+
```html
174+
<span class="article-type-tag release">New Release</span>
175+
```
176+
177+
### Visual Style
178+
- **New Release**: Red background (#AF3C43) - signals time-sensitive, fresh data
179+
- **Deep Dive**: Gray background (#6c757d) - signals evergreen analysis
180+
124181
## Examples
125182

126183
### Good Lede

.github/workflows/deploy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy to Netlify
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: '20'
17+
cache: 'npm'
18+
19+
- name: Install dependencies
20+
run: npm ci
21+
22+
- name: Build site
23+
run: npm run build
24+
25+
- name: Deploy to Netlify
26+
uses: nwtgck/actions-netlify@v3
27+
with:
28+
publish-dir: './dist'
29+
production-deploy: true
30+
env:
31+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
32+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

docs/STYLE-ANALYSIS.md

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
# The Daily Style Analysis Report
2+
3+
Comparison of Statistics Canada's "The Daily" with our D-AI-LY implementation.
4+
5+
**Date:** December 24, 2025
6+
**Articles reviewed:** Food Services (Dec 24), CPI November 2025 (Dec 15), Labour Force Survey November 2025 (Dec 5)
7+
8+
---
9+
10+
## Executive Summary
11+
12+
The official Daily articles are **significantly more sophisticated** than our current D-AI-LY implementation in three key areas:
13+
14+
1. **Narrative depth** - StatCan explains causation, not just reports numbers
15+
2. **Headline approach** - StatCan uses neutral titles; we lead with stats
16+
3. **Regional coverage** - StatCan has dedicated provincial analysis sections
17+
18+
---
19+
20+
## 1. Headline Patterns
21+
22+
### StatCan Approach
23+
Titles use the **indicator name + reference period** format without embedding statistics:
24+
25+
| Article | StatCan Title |
26+
|---------|---------------|
27+
| CPI | "Consumer Price Index, November 2025" |
28+
| LFS | "Labour Force Survey, November 2025" |
29+
| Food Services | "Food services and drinking places, October 2025" |
30+
31+
### D-AI-LY Approach
32+
We lead with the **key statistic** in the headline:
33+
34+
| Article | D-AI-LY Title |
35+
|---------|---------------|
36+
| CPI | "Consumer prices up 2.2% year over year in November 2025" |
37+
| Gasoline | "Les prix de l'essence en hausse de 1,7 % en novembre 2025" |
38+
| NHPI | "New housing prices unchanged in November 2025" |
39+
40+
### Assessment
41+
Both approaches are valid. StatCan's is more neutral; ours is more attention-grabbing. **No change recommended** - our approach works for a public-facing summary format.
42+
43+
---
44+
45+
## 2. Structure Comparison
46+
47+
### StatCan Structure
48+
```
49+
Title (indicator + date)
50+
├── Tabs: Text | Tables | Related info | Previous release | PDF
51+
├── Release date
52+
├── Opening paragraphs (key findings with context)
53+
├── Section: [Narrative heading describing finding]
54+
│ └── Multiple paragraphs with causation
55+
├── Section: [Another narrative heading]
56+
├── Section: Regional highlights
57+
├── Special callout boxes (e.g., "Focus on Canada and the United States")
58+
├── Sidebar carousel (key metrics, 3-5 charts)
59+
├── Expandable data table
60+
├── Note to readers (blue background)
61+
└── Contact information
62+
```
63+
64+
### D-AI-LY Structure
65+
```
66+
Title (stat + indicator + date)
67+
├── Release date
68+
├── Highlights box (bullet points)
69+
├── Opening paragraph
70+
├── Chart 1 (inline)
71+
├── Section heading
72+
├── Chart 2 (inline)
73+
├── Section: Provincial variation (table)
74+
├── Note to readers
75+
└── Source info
76+
```
77+
78+
### Key Differences
79+
80+
| Feature | StatCan | D-AI-LY |
81+
|---------|---------|---------|
82+
| Charts | Sidebar carousel (5+) | Inline (2-3) |
83+
| Tables | Expandable | Static markdown |
84+
| Highlights | Sometimes explicit section | Always bullet box |
85+
| Regional data | Dedicated narrative section | Simple table |
86+
| Special boxes | Policy focus callouts | None |
87+
| External links | Bank of Canada, dashboards | Table viewer only |
88+
89+
---
90+
91+
## 3. Tone & Language
92+
93+
### StatCan: Analytical & Explanatory
94+
95+
StatCan articles **explain why** prices or indicators moved, not just that they moved:
96+
97+
> "Higher beef prices have been driven, in part, by lower cattle inventories in North America. Coffee prices have been impacted by adverse weather conditions in growing regions and rose amid American tariffs on coffee-producing countries."
98+
99+
> "The largest contributor to the lower prices was Ontario (-20.2%), partially due to a base-year effect from a swift monthly increase in November 2024 (+11.0%), which coincided with a series of high-profile concerts in Toronto."
100+
101+
**Language patterns:**
102+
- "put downward pressure on"
103+
- "Offsetting the slower growth..."
104+
- "Partially due to a base-year effect"
105+
- "driven by gains in part-time work"
106+
107+
### D-AI-LY: Descriptive & Formulaic
108+
109+
Our articles report what happened without much explanation:
110+
111+
> "The Consumer Price Index (CPI) stood at 165.4 in November 2025, up 2.2% compared with the same month a year earlier."
112+
113+
> "Food prices rose 4.2%."
114+
115+
**Language patterns:**
116+
- "increased X%"
117+
- "rose/fell X%"
118+
- "recorded the highest/lowest"
119+
120+
### Gap Analysis
121+
122+
| Aspect | StatCan | D-AI-LY | Gap |
123+
|--------|---------|---------|-----|
124+
| Causation | Explains drivers | Reports changes | **High** |
125+
| Context | Real-world events | Historical comparison | **Medium** |
126+
| Transitions | Sophisticated | Basic | **Medium** |
127+
| Specificity | Product-level detail | Category-level | **Medium** |
128+
129+
---
130+
131+
## 4. Regional Coverage
132+
133+
### StatCan Approach
134+
Dedicated "Regional highlights" section with narrative:
135+
136+
> "On an annual basis in November, prices rose at a faster pace in five provinces, were unchanged in two, and rose at a slower pace in the remaining three compared with October."
137+
138+
> "Of all the provinces, prices accelerated the most in New Brunswick, rising 2.7% year over year in November, following an increase of 2.1% in October."
139+
140+
### D-AI-LY Approach
141+
Simple table with minimal narrative:
142+
143+
> "Price increases varied across provinces and territories. Manitoba recorded the highest year-over-year increase at 3.3%."
144+
145+
| Province | Year-over-year change |
146+
|----------|----------------------|
147+
| Manitoba | +3.3% |
148+
| Quebec | +3.0% |
149+
| ... | ... |
150+
151+
### Recommendation
152+
**Enhance regional coverage** with more narrative analysis. Our discovery tool already identifies regional variance - we should use this to generate richer provincial stories.
153+
154+
---
155+
156+
## 5. Special Features We're Missing
157+
158+
### 1. Causation Explanations
159+
StatCan explains **why** things changed. We should add brief explanations where data supports it.
160+
161+
### 2. Policy Context Boxes
162+
StatCan includes special callouts like "Focus on Canada and the United States" about tariffs. We could add similar topical context.
163+
164+
### 3. Multi-metric Sidebars
165+
StatCan shows 4-5 key metrics in a carousel. We show 1 chart at a time.
166+
167+
### 4. Dashboard Links
168+
StatCan links to interactive dashboards: "Further information is available in the Food Services and Drinking Places Sales dashboard."
169+
170+
### 5. Specific Product Mentions
171+
CPI article mentions specific products: berries, beef (+17.7%), coffee (+27.8%). Our articles stay at category level.
172+
173+
---
174+
175+
## 6. Recommendations
176+
177+
### Keep (Working Well)
178+
- Lead-with-stat headlines (more engaging than StatCan's neutral titles)
179+
- Highlights bullet box (clear and scannable)
180+
- Observable Plot charts (modern, interactive)
181+
- Bilingual coverage (EN/FR parity)
182+
- Reproducibility code blocks (unique value-add)
183+
184+
### Enhance (Priority Changes)
185+
186+
#### High Priority
187+
1. **Add causation** - Include brief "why" explanations where data supports inference
188+
2. **Richer regional sections** - Use discovery tool findings to write provincial narratives
189+
3. **More specific detail** - Break down categories into specific products/drivers
190+
191+
#### Medium Priority
192+
4. **Contextual boxes** - Add "Focus on" sections for major policy/economic context
193+
5. **Multiple chart types** - Add component breakdown charts, not just time series
194+
6. **External links** - Link to StatCan dashboards and related releases
195+
196+
#### Low Priority
197+
7. **Sidebar carousel** - Consider multi-metric sidebar (requires template changes)
198+
8. **Expandable tables** - Interactive table toggling
199+
200+
---
201+
202+
## 7. Voice Guide Updates
203+
204+
Based on this analysis, update VOICE-GUIDE.md to include:
205+
206+
### New Patterns to Adopt
207+
208+
**Causation phrases:**
209+
- "driven by..."
210+
- "partially due to..."
211+
- "contributed to..."
212+
- "put upward/downward pressure on..."
213+
214+
**Transition phrases:**
215+
- "Offsetting the [increase/decrease] in X were..."
216+
- "Contributing to the [rise/fall] were..."
217+
- "While X remained elevated, growth slowed in..."
218+
219+
**Regional narrative patterns:**
220+
- "Of all the provinces, [Province] recorded the [largest/smallest]..."
221+
- "Prices rose at a faster pace in X provinces, were unchanged in Y, and rose at a slower pace in Z"
222+
223+
---
224+
225+
## Sources
226+
227+
- [The Daily - Consumer Price Index, November 2025](https://www150.statcan.gc.ca/n1/daily-quotidien/251215/dq251215a-eng.htm)
228+
- [The Daily - Labour Force Survey, November 2025](https://www150.statcan.gc.ca/n1/daily-quotidien/251205/dq251205a-eng.htm)
229+
- [The Daily - Food services and drinking places, October 2025](https://www150.statcan.gc.ca/n1/daily-quotidien/251224/dq251224a-eng.htm)

0 commit comments

Comments
 (0)