Skip to content

michtio/craftcms-claude-skills / skills/craft-plugins

craft-plugins

Verified

Index and router for plugin-specific Craft CMS 5 guidance — configuration, Twig API, PHP API, migrations, deployment, and pitfalls for the plugins this pack documents. Load whenever a task names a plugin this pack documents, and for passwordless or magic-link auth with no plugin named; read references/<plugin>.md first.

references/typogrify.md

View on GitHub
# Typogrify

Smart typography Twig filters by nystudio107. Prevents widows, fixes quotes, applies hanging punctuation, and handles typographic best practices automatically. Used on every project.

`nystudio107/craft-typogrify` — Free

## Documentation

- GitHub: https://github.com/nystudio107/craft-typogrify
- Plugin Store: https://plugins.craftcms.com/typogrify

## Common Pitfalls

- Applying `|typogrify` to HTML that contains inline scripts or JSON — it can mangle non-prose content. Only use on text/HTML content blocks.
- Using `|typogrify` inside `{% cache %}` tags that also contain SEOMatic variables — the cache conflict is with SEOMatic, not Typogrify, but the combination trips people up.
- Double-encoding entities — if content already has `&amp;` entities, Typogrify may double-process them. Use `|raw` before `|typogrify` if you're getting entity issues.
- Not using `|widont` on headings — this is the single most impactful filter for visual polish. Prevents orphaned single words on the last line.

## Twig Filters

### `|typogrify` (All-in-One)

Applies the full suite of typographic improvements:

```twig
{{ entry.body|typogrify }}
```

Includes: smart quotes, ellipses, dashes, widow prevention, ordinal suffixes, math symbols, and more.

### Individual Filters

```twig
{{ entry.title|widont }}              {# Prevents widows — adds &nbsp; before last word #}
{{ entry.body|smartypants }}          {# Smart quotes and dashes only #}
{{ entry.title|typogrifyFeed }}       {# Safe for RSS feeds (no HTML entities) #}
{{ text|truncate(160) }}              {# Truncate to character count, word-boundary aware #}
{{ text|truncateOnWord(160) }}        {# Same — truncates at word boundary #}
{{ richText|humanFileSize }}          {# Formats bytes as "1.2 MB" #}
{{ number|humanDuration }}            {# Formats seconds as "2 hours, 30 minutes" #}
{{ text|wordCount }}                  {# Returns word count #}
```

### Common Usage Patterns

```twig
{# Headings — always prevent widows #}
<h1>{{ entry.title|widont }}</h1>

{# Rich text — full typography treatment #}
<div class="prose">
    {{ entry.body|typogrify }}
</div>

{# SEO descriptions — truncate cleanly #}
<meta name="description" content="{{ entry.summary|truncateOnWord(160) }}">

{# Card excerpts #}
<p>{{ entry.body|striptags|truncateOnWord(120) }}</p>
```

## What `|typogrify` Does

- **Smart quotes** — straight `"` and `'` → curly `"` `"` `'` `'`
- **Dashes** — `--` → en-dash, `---` → em-dash
- **Ellipses** — `...` → `…`
- **Widow prevention** — `&nbsp;` before last word in block elements
- **Ordinal suffixes** — `1st` → `1<sup>st</sup>`
- **Math symbols** — `(c)` → `©`, `(tm)` → `™`
- **Hanging punctuation** — opening quotes hang in the margin

## Pair With

- **CKEditor** — apply `|typogrify` to CKEditor field output
- **SEOMatic** — Typogrify for display, SEOMatic for meta (don't apply `|typogrify` to meta descriptions)
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall