c7b3f4cacf Render full SKILL.md as a code snippet on per-skill pages (PAP-16980) (#89)
> **Updated on current main:** #87 and the #90 cache hotfix are merged.
This PR now targets `main`, was rebased onto merge commit `8c5976f`, and
has a fresh successful Cloudflare preview plus post-rebase browser smoke
evidence.

## What & why (PAP-16980)

Improves SEO/AEO on the bundled/optional **per-skill reference pages**
(from PAP-16670) by clearly separating the *human-readable catalog
summary* (top of page) from the *authoritative full skill definition*.

Previously the "Full skill definition" section rendered the `SKILL.md`
as **parsed Markdown**, so each skill's own `##` headings, lists, and
fenced examples became real page content — competing with the summary,
inflating the on-page TOC (e.g. qa-acceptance went from **16 → 6** "On
this page" entries), and confusing crawlers/answer engines about the
page's true structure.

Now each per-skill page shows the **complete, verbatim `SKILL.md`**
(frontmatter + body) inline, rendered through the **existing production
code-snippet treatment**.

## Changes

- **Content (10 per-skill pages):** replaced the old `### Skill
frontmatter` bullets + parsed `### Skill instructions` layout with the
full `SKILL.md` embedded in a fenced ````markdown skill-source` block.
Source bytes were taken verbatim from each skill's authoritative
`SKILL.md` at the page's pinned `paperclip_version`, verified against
the page's own prior instructions body + frontmatter (name/description)
so no content drifted.
- **Renderers (`site/build-release.mjs`, `site/app.js`):** a
`skill-source` fence renders as `<pre><code class="language-markdown"
data-skill-download="SKILL.md">`. Every other code block is delegated to
marked's default renderer, so existing snippets are byte-for-byte
unchanged. Rendered identically in the crawler-visible build HTML and on
client SPA navigation.
- **Copy + Download (`site/app.js`, `site/styles.css`):**
`decorateCodeBlocks` reuses the existing Copy affordance and adds a
**Download `SKILL.md`** control beside it. Both share dimensions,
styling, hover/focus visibility, and the copied-success state; both
carry accessible labels/titles.
- **Readable full-source wrapping (`site/styles.css`):** only the
downloadable `SKILL.md` block uses `white-space: pre-wrap` and safe
long-token wrapping. Ordinary code snippets retain the existing
horizontal-scroll treatment.
- **Test:** `scripts/verify-skill-source-blocks.mjs` (`npm run
docs:test:skill-source-blocks`) asserts the render contract (single H1,
single `<pre>`, frontmatter present, no legacy headings) and that
ordinary docs pages emit no `data-skill-download`.

## Scope statement

No catalog-page layout, navigation, typography, summary-copy,
metadata-card, or information-architecture changes. `paperclip-website`
and generated `.site/` output are untouched. `optional/finance/ramp.md`
is intentionally excluded — it is a newer summary page with no embedded
full-definition section to reformat. The diff is the 10 skill pages +
the narrow renderer/Copy-Download support + the test.

## Evidence

**1–2. Before/after (desktop, 1280×900) + mobile after (390×844)** —
attached to Paperclip issue
[PAP-16980](https://paperclip-dev.tail29c1aa.ts.net/PAP/issues/3098577a-4f6f-4eb2-9151-a4b61917dffd)
(`before-desktop.png`, `after-desktop-controls.png`,
`after-controls-zoom.png`, `after-mobile.png`). GitHub cannot render the
auth-gated attachment URLs inline, so they live on the issue for
reviewers.

**4. Raw DOM/HTML (build output, qa-acceptance):**
- Article renders exactly **one H1**: `<h1 id="qa-acceptance">QA
Acceptance</h1>`
- Full source inside a single code block:
```html
<pre><code class="language-markdown" data-skill-download="SKILL.md">---
name: qa-acceptance
description: Produce QA acceptance criteria and a manual validation plan …
key: paperclipai/bundled/quality/qa-acceptance
recommendedForRoles:
  - qa
  …
</code></pre>
```
- Article `<pre>` count: **1** (inner ````` fences stay literal — no
breakout). 10/10 skill pages carry the block; 0 non-skill pages do.

**5. Copy + Download behavior (Playwright against the built site):**
```json
{
  "downloadFilename": "SKILL.md",
  "downloadMatchesBlock": true,     // downloaded file === code block text, byte-identical
  "downloadBytes": 3853,
  "copyShowsSuccess": true,          // Copy toggles the existing is-copied success state
  "accessibleLabels": { "copy": "Copy code", "download": "Download SKILL.md" }
}
```
Both controls reach `opacity: 1` on `.code-wrap:hover` and on keyboard
`:focus-visible` (verified `matches(':focus-visible') === true` →
computed opacity `1`).

**H1 audit (every generated route, incl. all skill URLs — requested on
the issue):** built the site on current `main` and scanned **all 184
generated `index.html` routes** (16 skill routes among them). **Every
route has exactly one `<h1>`.** The skill source's own `#`/`##` headings
live *inside* the `<pre><code>` block as literal text, so they do
**not** create competing H1s — the SEO/AEO goal.

## Tests

Run against current `main` after #87 and #90:

```
docs:build ............................. ok (184 routes)
docs:test:static-routes ................ pass (5 routes + 404 + root + subpath)
docs:test:skill-source-blocks .......... pass (10 skill pages, 1 control page)
H1 audit (all 184 routes) .............. pass (exactly 1 h1 each; 16 skill routes)
```

**Do not merge/deploy** — returning to Dotta/reviewers for approval per
PAP-16980.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: DevRel Gemini <[email protected]>
Co-authored-by: Paperclip <[email protected]>
2026-08-10 14:03:47 -07:00
2026-04-30 11:04:18 -05:00

Paperclip Docs

Source for the Paperclip documentation site — user guides, API and CLI reference, adapter docs, and deployment notes.

Read the docs: https://docs.paperclip.ing/

What's inside

  • Guides — Getting started, core concepts, and day-to-day usage.
  • API reference — Control-plane endpoints and payload schemas.
  • CLI reference — paperclip command surface.
  • Adapters — Plugin authoring and the integrations catalogue.
  • Deploy — Self-hosting, upgrades, and operational guidance.

The site is a single static shell that renders the Markdown files in docs/ directly — no framework, no build step required to read the raw pages.

Build and deployment

Build a release bundle locally with:

npm run docs:build

Cloudflare Pages is connected directly to paperclipai/paperclip-docs through GitHub. There is no normal Wrangler publish step for this repo:

  • Pushes to main deploy production at https://docs.paperclip.ing/.
  • Pushes to other branches create Cloudflare Pages preview/canary deployments.
  • Canary URLs are created by Cloudflare for each deployment, for example https://92b9a99c.paperclip-docs-74t.pages.dev. Use the URL shown in the Cloudflare Pages deployment row or GitHub deployment/check for the pushed branch and commit.

Contributing

Spotted a typo, a broken link, or something that could be clearer? There are two easy paths, both linked from the footer of every docs page:

  • Suggest an edit — opens the underlying Markdown file in GitHub's web editor. Make the change and submit a PR without leaving the browser.
  • Report an issue — opens a prefilled Docs feedback issue with the page URL already attached.

For larger changes, fork the repo and open a PR against main. Screenshots live under docs/user-guides/screenshots/{light,dark}/ and should be provided in both themes when replacing UI captures.

Community

License

Copyright (c) 2026 Paperclip Community.

The Paperclip software is open source — see the main paperclip repository for its license.

The documentation in this repository is licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0). You may read and share it for non-commercial purposes with attribution. Commercial use of any kind requires prior written permission from the copyright holders. See LICENSE for the full text.

S
Description
Paperclip documentation
Readme CC-BY-4.0
491 MiB
0 Stars 1 Watchers 0 Forks
Languages
JavaScript 91.1%
CSS 7.1%
HTML 1.6%
Shell 0.2%