agentleFS
readiumreadium/swift-toolkit/.claude/skills/write-guide/SKILL.md

write-guide

Skill574 starsChanged 14 days agoBSD-3-ClauseView on GitHub

Use this skill to write user guides about features in the Readium Swift Toolkit.

We split this skill into the rules it gives an agent

20 rules. 0 are common, 13 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before writing, gather what you need:

    line 16
  2. Very specific:

    Identify relevant source files: Read the Swift interfaces (protocols, public types) for the feature — not the implementation, just the …

    line 18
  3. Very specific:

    Read related existing guides: Check docs/Guides/ for any guide that overlaps with the topic.

    line 22
  4. Distinctive:

    Every guide follows this shape:

    line 29
  5. Distinctive:

    Explain the why: When the API requires a non-obvious approach, explain the reason: "Readium does not have a concept of pages — instead, …

    line 57
  6. Distinctive:

    Set expectations early: Use "You are responsible for..." to clarify what the framework doesn't do, so developers aren't surprised:

    line 60
  7. Distinctive:

    Avoid filler: Don't pad with "In this guide, we will..." — the heading and first paragraph already tell the reader what's covered.

    line 64
  8. Very specific:

    Use fenced Swift code blocks: `swift

    line 69
  9. Distinctive:

    Don't explain what the code does in comments — let the surrounding prose do that.

    line 74
  10. Distinctive:

    Only add a comment if it highlights a non-obvious subtlety.

    line 75
  11. Very specific:

    SwiftUI only: When code examples involve UI, use SwiftUI — never UIKit directly.

    line 78
  12. Very specific:

    Do not show raw UIKit view controller presentation patterns (e.g., present(_:animated:)).

    line 81
  13. Distinctive:

    Use GitHub-flavored alert syntax:

    line 85
  14. Distinctive:

    Use these sparingly — one to three per guide is normal.

    line 101
  15. Distinctive:

    When you mention a concept that is covered in depth elsewhere, add a short cross-reference rather than re-explaining it.

    line 122
  16. Distinctive:

    Before writing the guide files, confirm the structure and outline of all the produced files with the users, and ask if changes are required.

    line 136
  17. Very specific:

    After confirmation, write the guides to the appropriate path under docs/Guides/.

    line 139
  18. Distinctive:

    After writing all files, review every guide you created or modified:

    line 150
  19. Very specific:

    Verify that every type, method, and property name mentioned in prose or code actually exists in the current source files (search Sources/ …

    line 151
  20. Distinctive:

    Check that code examples are syntactically plausible and use the API correctly.

    line 153

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Readium Guide Writer

This skill produces user guides for the Readium Swift Toolkit that match the style and quality of the existing guides in docs/Guides/.

Research first

Before writing, gather what you need:

  1. Identify relevant source files. Read the Swift interfaces (protocols, public types) for the feature — not the implementation, just the public API surface. Start in Sources/ and look for types whose names match the feature. Also look at the files changed in the current branch, compared to the develop branch.
  2. Read related existing guides. Check docs/Guides/ for any guide that overlaps with the topic. These tell you what's already explained and where to cross-reference.
  3. Confirm the output path. For example, guides for navigator topics go in docs/Guides/Navigator/. Ask the user if the right location is unclear.

Structure

Every guide follows this shape:

# Feature Name

[One-paragraph summary of what this guide covers and what the reader will be able to do.]

> [!NOTE / IMPORTANT / WARNING / TIP as appropriate]
> Any critical caveats, prerequisites, or "read this before you start" points.

## First major concept (how to set up / what the API is)

### Sub-topic

## Second major concept (how to use the API)

### Sub-topic

## [Optional] Complete example

[Full, copy-pasteable working code that brings everything together]

Writing style

Tone: Professional and direct, but approachable. Respect the reader's intelligence. Address them as "you". Use "we" only when explaining Readium's own design decisions.

Explain the why. When the API requires a non-obvious approach, explain the reason: "Readium does not have a concept of pages — instead, positions are used because..."

Set expectations early. Use "You are responsible for..." to clarify what the framework doesn't do, so developers aren't surprised:

"You are responsible for creating the view controller and adding it to your hierarchy."

Avoid filler. Don't pad with "In this guide, we will..." — the heading and first paragraph already tell the reader what's covered.

Code examples

  • Use fenced Swift code blocks: ```swift
  • Show complete, runnable snippets — not pseudo-code or fragments with ... unless a longer example truly needs ellipsis to stay focused.
  • Include realistic variable names, error handling (try/catch), and optional chaining where the real code would need them.
  • Don't explain what the code does in comments — let the surrounding prose do that. Only add a comment if it highlights a non-obvious subtlety.
  • For a feature that has several steps, show each step as its own snippet, then provide a "Complete example" section at the end that combines them.
  • SwiftUI only. When code examples involve UI, use SwiftUI — never UIKit directly. The Readium Navigator is UIKit-based internally, but bridging code (e.g., UIViewControllerRepresentable) is acceptable when needed to host the navigator. Do not show raw UIKit view controller presentation patterns (e.g., present(_:animated:)).

Callout blocks

Use GitHub-flavored alert syntax:

> [!NOTE]
> Additional clarification that helps but isn't blocking.

> [!IMPORTANT]
> Something the developer must know to avoid a broken integration.

> [!WARNING]
> A gotcha that could cause subtle bugs or unexpected behavior.

> [!TIP]
> A helpful suggestion or recommended pattern.

Use these sparingly — one to three per guide is normal.

Formatting conventions

ElementConvention
API type names, method namesPublication, navigator.go(to:) — bold + backtick
Parameters and property nameslocator, readingProgression — backtick only
UI concepts and user-facing termsplain bold: reading position
File names and pathsbacktick: TTSView.swift
TablesPad cells with whitespaces to vertically align the columns
No horizontal rulesNever use --- to separate sections

Cross-references

Link to related guides using relative paths:

See the [Navigator guide](Navigator/Navigator.md) for details on positioning.

When you mention a concept that is covered in depth elsewhere, add a short cross-reference rather than re-explaining it. Don't assume the reader has read other guides — give a one- sentence summary and point them there.

Terminology

Capitalize these terms consistently:

  • Navigator — the Readium component/protocol (always capitalized)
  • Publication — the API type (Publication) capitalized; "publication" lowercase when referring to the content generically
  • Locator — the type; "location" when speaking generically

Output

Before writing the guide files, confirm the structure and outline of all the produced files with the users, and ask if changes are required.

After confirmation, write the guides to the appropriate path under docs/Guides/. Then add links to them in these two index files:

  • README.md — under the appropriate section in the "User Guides" list. Match the existing bullet format: * [Title](docs/Guides/Path/To/Guide.md) – one-line description.
  • The appropriate DocC root file under docs/ — read the .md files at the root of docs/ to identify which one covers the topic area (e.g. a Navigator overview file for navigator guides). Add a - <doc:Guide-Name> entry under the matching ### Topic group. The DocC slug is the filename with spaces replaced by hyphens and the .md extension removed.

After writing all files, review every guide you created or modified:

  • Verify that every type, method, and property name mentioned in prose or code actually exists in the current source files (search Sources/ to confirm).
  • Check that code examples are syntactically plausible and use the API correctly.
  • Flag any discrepancy to the user rather than silently guessing.

Finally, briefly tell the user what you wrote and which existing guides you linked to, in case they want to update those guides to add a reciprocal link.

Download now (ZIP)

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. vercel/next.js★ 143ksame name
    2. runpod/runpod-plugins-official★ 47same name
    3. sethsontech-max/claudeSkills★ 1same name
    4. henrymbuguak/claude-with-the-anthropic-api★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.