Skip to content

Commit eae7e42

Browse files
dshkolclaude
andcommitted
Improve: Skills docs, chart guidelines, and homepage dynamics
- Update discover skill with required coverage check before scanning - Add advanced narrative patterns to voice reference (streaks, offsets, cumulative) - Expand chart style guide with accessibility and color neutrality rules - Make homepage featured articles load dynamically from articles.json - Add utility scripts for chart color and label position fixes - Gitignore automation logs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5c351e0 commit eae7e42

9 files changed

Lines changed: 575 additions & 73 deletions

File tree

.claude/skills/the-daily-discover/SKILL.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,18 @@ Rscript r-tools/discover_stories.R
1919

2020
## Discovery Workflow
2121

22-
### 1. Scan Available Data
22+
### 1. Check Existing Coverage (REQUIRED FIRST STEP)
23+
24+
Before scanning CANSIM, identify tables already covered:
25+
26+
```bash
27+
# List existing articles to extract table numbers
28+
ls docs/en/*/index.md | xargs grep -h "statcan.gc.ca/t1/tbl1" | grep -oE "[0-9]{2}-[0-9]{2}-[0-9]{4}" | sort -u
29+
```
30+
31+
**Exclude these table numbers from recommendations.** The goal is diversity—never suggest a table that's already been covered unless explicitly asked for an update.
32+
33+
### 2. Scan Available Data
2334

2435
```r
2536
library(cansim)
@@ -34,34 +45,24 @@ candidates <- cubes %>%
3445
arrange(desc(cubeEndDate))
3546
```
3647

37-
### 2. Score Candidates
48+
### 3. Score Candidates
3849

3950
| Dimension | Weight | Criteria |
4051
|-----------|--------|----------|
4152
| Recency | 25% | Days since release (fresher = higher) |
42-
| Diversity | 25% | Sector gap from existing articles |
53+
| Diversity | 25% | Sector gap from existing articles—deprioritize sectors covered in last 7 days |
4354
| Narrative | 25% | Regional variation, trend reversals |
4455
| Public Interest | 15% | Topic relevance to general audiences |
4556
| Data Quality | 10% | Complete coverage, national totals |
4657

47-
### 3. Validate Top Candidates
58+
### 4. Validate Top Candidates
4859

4960
Before committing:
50-
1. Fetch sample data to verify structure
51-
2. Check for StatCan Daily release
52-
3. Verify national totals exist
53-
4. Confirm table is current (not deprecated)
54-
55-
## Check Existing Coverage
56-
57-
```bash
58-
ls docs/en/*/index.md | head -20
59-
```
60-
61-
Avoid redundancy:
62-
- If CPI just published, deprioritize other price indices
63-
- Retail Trade + Wholesale Trade complement each other
64-
- Housing Starts + Building Permits complement each other
61+
1. **Verify table numbers**: Run `search_cansim_cubes("keyword")` to confirm table numbers are current—they go stale as StatCan discontinues/replaces tables
62+
2. Fetch sample data to verify structure
63+
3. Check for StatCan Daily release
64+
4. Verify national totals exist
65+
5. Confirm table is current (not deprecated)
6566

6667
## Output Format
6768

.claude/skills/the-daily-generator/references/french.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,7 @@ d.toFixed(1).replace(".", ",") + " %" // 2,2 %
8686
// French currency
8787
d.toFixed(1).replace(".", ",") + " G$" // 165,4 G$
8888
```
89+
90+
## Chart Layout
91+
92+
French labels are typically longer than English. Increase left margins by ~20-40px for horizontal bar charts to prevent truncation (e.g., `marginLeft: 200` vs `marginLeft: 160` in English).

.claude/skills/the-daily-generator/references/voice.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,100 @@ On landing page cards:
218218

219219
### Bad Component Analysis
220220
"Food prices continued their alarming rise, squeezing household budgets and forcing families to make difficult choices." (emotional, speculative)
221+
222+
## Advanced Narrative Patterns
223+
224+
These patterns are observed in real Statistics Canada Daily articles and add depth to statistical storytelling.
225+
226+
### Streak Mentions
227+
228+
When a metric moves in the same direction for multiple consecutive periods, highlight the streak:
229+
230+
- "increased for the **fourth consecutive month** in October"
231+
- "fell for a **second consecutive month** in October"
232+
- "marked the **first decline since July**"
233+
234+
### Cumulative Context
235+
236+
Provide multi-period cumulative context for sustained trends:
237+
238+
- "bringing the **cumulative gain to 16,700 (+2.0%) since July**"
239+
- "The three-month gain in the sector **partially offset the cumulative decline of 10,300 (-0.8%)** recorded from April to July 2025"
240+
241+
### Offset Framing
242+
243+
When a current-period change reverses or partially offsets a prior period:
244+
245+
- "**largely offsetting** a decline of 24,300 (-0.1%) in September"
246+
- "**more than offsetting** the uptick in September (+11,000; +2.3%)"
247+
- "**partially offset by** declines in administration and support"
248+
249+
### Lone Exception Pattern
250+
251+
Highlight the outlier when most categories move in one direction:
252+
253+
- "**The only sector** to record a year-over-year increase was manufacturing"
254+
- "truck transportation (-4,500; -2.1%) was the **lone subsector** to record a year-over-year decline"
255+
256+
### Historical Milestone
257+
258+
When a value reaches a notable historical level:
259+
260+
- "The number of vacancies in October was the **lowest since October 2017**"
261+
- "to a level **comparable with January 2016**"
262+
- "the **highest level since April 2024**"
263+
264+
### Cross-Survey References
265+
266+
When relevant, link to related releases for complementary data:
267+
268+
- "unemployment rate rose from 6.6% to 6.9% (according to the **Labour Force Survey**)"
269+
- "For more information, see the **Consumer Price Index** release"
270+
271+
### Provincial Extremes with Context
272+
273+
When presenting provincial data, highlight both extremes:
274+
275+
- "**7.2 unemployed persons for every job vacancy** in Newfoundland and Labrador, the **highest ratio** among the provinces. In comparison, the... ratio was **lowest in Quebec (2.3)**, followed by Saskatchewan (2.5)"
276+
277+
### Causal Attribution (when data supports)
278+
279+
Provide brief explanations for derived metrics:
280+
281+
- "This increase in the job vacancy rate in manufacturing was **primarily due to the decline in payroll employment** over the period"
282+
- "Growth in average weekly earnings can reflect a range of factors, including changes in wages, **composition of employment**, hours worked and **base-year effects**"
283+
284+
## Article Types
285+
286+
### Single-Indicator Releases
287+
Most common type. Covers one metric (CPI, Retail Trade, GDP).
288+
289+
**Structure:**
290+
1. Headline with key number
291+
2. Highlights (3-5 bullets)
292+
3. Lede paragraph
293+
4. Component analysis
294+
5. Regional analysis
295+
6. Note to readers
296+
297+
### Multi-Indicator Releases
298+
Combines related metrics from the same survey (e.g., SEPH covers payroll employment + weekly earnings + job vacancies).
299+
300+
**Structure:**
301+
1. Headline (usually the primary metric)
302+
2. Highlights covering multiple metrics
303+
3. Lede paragraph for primary metric
304+
4. Section for each indicator with its own heading
305+
5. Cross-metric analysis
306+
6. Note to readers (may cover multiple surveys)
307+
308+
**Section heading pattern:** "[Sector/Topic] [verb] [direction] in [period]"
309+
- "Health care and social assistance records payroll employment increase in October"
310+
- "Job vacancies decrease in four sectors and increase in one"
311+
- "Average weekly earnings continue to increase on a year-over-year basis"
312+
313+
### Data Release Announcements
314+
Short articles announcing new tables are available. Not suitable for D-AI-LY (no narrative).
315+
316+
### Product Announcements
317+
Short articles pointing to dashboards or tools. Not suitable for D-AI-LY.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ output/
1818
.Rhistory
1919
.RData
2020
.Rproj.user/
21+
automation/logs/

0 commit comments

Comments
 (0)