Skip to content

feat(skills): add github-markdown skill - #11

Merged
rjstone merged 12 commits into
mainfrom
skill/gfm-markdown
Nov 30, 2026
Merged

rjstone merged 12 commits into
mainfrom
skill/gfm-markdown

Conversation

@rjstone

@rjstone rjstone commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Adds github-markdown, a skill written here for GitHub-only Markdown. It assumes plain CommonMark knowledge and covers only what github.com adds or changes.

What's in it

  • SKILL.md (short): when to use GitHub features vs plain Markdown (root README, GitHub-only text such as templates and comments, and everything else), then a quick reference for alerts, footnotes, heading anchors, line breaks, relative links, task lists, tables, autolinks, mentions and closing keywords.
  • references/html.md: what github.com's sanitizer removes and keeps (based on html-pipeline's SanitizationFilter, v2.14.3 and v3), <details>, <picture> for dark and light mode, centering and sizing, custom anchors.
  • references/diagrams-math.md: Mermaid, GeoJSON/TopoJSON, STL, math and $ escaping, code fences.
  • references/autolinks.md: where #123 and SHAs autolink (not in repo files or wikis), reference forms, creating the target first, unfurling, avoiding backlinks, label and color chips, closing keywords.
  • Registered in skills.sh.json, the README skill table, AGENTS.md and skills/index.json.

Sources: GitHub Docs "Basic writing and formatting syntax" and "Working with advanced formatting", the GFM spec 0.29, github/markup and html-pipeline.

Testing (writing-skills, Haiku subagents)

Scenario Without the skill With the skill
Heading anchors Failed (kept _ from formatting) Passed after one wording fix (3 of 3)
Issue template with no style rule Did not ask about GitHub features Applied the rule and asked
Math $ escaping, avoiding backlinks - Passed (from the references)
Centered red title - Centered it, said red is not possible

README features, an MkDocs page, PR mentions and README issue links already passed without the skill.

Checked by hand on GitHub

  • References autolink in commit messages, but only if the issue or PR already exists when the commit is pushed (added to the skill).
  • Full SHAs and 7-character prefixes link, with or without user@; 6-character prefixes don't.
  • One closing keyword covers a comma-separated list (Closes #1, #2); and, a doubled comma or a keyword after the references ends it (the skill was corrected).

The plugin version is not bumped here; adding a skill is a minor bump at release.

bash scripts/ci.sh, claude plugin validate . and claude plugin validate . --profile directory pass locally (the one warning, about the root CLAUDE.md, is already on main).

🤖 Generated with Claude Code

https://claude.ai/code/session_01QT6szzQoh3BvFC1BY1KxyP

A short SKILL.md (when to use GitHub features vs plain Markdown, a quick
reference for alerts, footnotes, heading anchors, line breaks, autolinks,
mentions and closing keywords) with reference files for raw HTML,
diagrams and math, and autolink forms. Tested with and without the skill
on a subagent; the baseline got heading anchors wrong.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QT6szzQoh3BvFC1BY1KxyP
…s sanitizer

List the kept tags and attributes, unwrapping of removed tags, URL scheme
limits and the id caveat from html-pipeline's SanitizationFilter (v2.14.3
and v3), the public basis of github.com's sanitizer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QT6szzQoh3BvFC1BY1KxyP
@rjstone
rjstone marked this pull request as ready for review November 30, 2026 05:55
@rjstone

rjstone commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

This works:


test: autolink check

Refs #1 and OWNER/REPO#2.

One thing to note if it isn't there already:

If an issue doesn't exist when the commit is made (and for the owner/repo#1 style, if it doesn't exist in owner/repo) then the auto link won't happen and adding the issue later apparently wont cause it to get autolinked. Unsure if it's just update lag somewhere back end, but to ensure auto links work the issue or pr should exist before trying to refer to it.

rjstone commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

Thanks, that confirms the commit-message claim. Added the "create the target first" note to references/autolinks.md in e659195 (skill bumped to 0.1.2): a reference links only if the issue or PR already exists when the comment is posted or the commit is pushed, and creating it later doesn't link the earlier text.

Still unchecked: 7-character SHA prefixes, and one keyword per closed issue.


Generated by Claude Code

@rjstone

rjstone commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

Does each closed issue need its own keyword?

No. closes #1, #2 works and lists both on the close list.

Some other cases I did just for curiosity:

The rule seems to be something like clos(e|es)\s+(#\d+)(\s*,?\s*#\d+)*

So to be safe it should be:

close(s)|resolve(s)|fix(es) <whitespace no \n> #x <whitespace no \n with no more than one ,> #y <etc>

(Multiple commas like #1 ,,,, #2 breaks #2)

Tested on a real PR: 'Closes #1, #2' links both issues; 'and', doubled
commas or a keyword after the references end the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QT6szzQoh3BvFC1BY1KxyP

rjstone commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

Thanks. Fixed in references/autolinks.md (skill 0.1.3): one keyword covers a comma-separated list on the same line (Closes #1, #2); and, a doubled comma, or a keyword after the references ends the list.

Only the 7-character SHA prefix claim is left unchecked.


Generated by Claude Code

@rjstone

rjstone commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

See ee45b63

  • Full sha links, user@full-sha links
  • sha-7 links, user@sha-7 links
  • sha-6 doesn't seem to be a real thing and doesn't link user or not

rjstone commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

Thanks, that matches references/autolinks.md ("full 40-char SHA, or a 7+ char prefix"), so no change is needed. All three hand checks are now recorded under "Checked by hand on GitHub" in the PR description.


Generated by Claude Code

@rjstone

rjstone commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

Also see 700a438

…s do

Tested on GitHub: 'pr#3' and 'issue#1' stay plain text, and
'Fix #1 , #2' links and closes both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QT6szzQoh3BvFC1BY1KxyP
@rjstone

rjstone commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

Ok now I'll read the whole thing.

@rjstone rjstone left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, looks pretty good.

Comment thread skills/github-markdown/SKILL.md Resolved
…t links

From review: end lines with a backslash rather than two invisible spaces,
and write [label](url) or <url> instead of relying on bare-URL autolinks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QT6szzQoh3BvFC1BY1KxyP
Colors, styled text, layout and animation without CSS (MathJax, Mermaid,
diff blocks, nested tables, animated SVG), in its own file so the common
references stay small.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QT6szzQoh3BvFC1BY1KxyP
…by theme

Tested in a GitHub issue: \color works, \colorbox errors with
'macros are not allowed', and <mark> is a dim tint in dark mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QT6szzQoh3BvFC1BY1KxyP
Tested in a GitHub issue: links to both <a id> and <a name> jump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QT6szzQoh3BvFC1BY1KxyP
@rjstone
rjstone merged commit 3a8bb50 into main Nov 30, 2026
7 checks passed
@rjstone
rjstone deleted the skill/gfm-markdown branch November 30, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants