Product requirements

Pages as Artifact Files

Each skillsaw page goes to claude.ai as one artifact with several files, so an agent reads the Markdown of the page and not its HTML. The skills write the files with skillsaw publish, and Download .md saves the text through the viewer.

Status
Draft
Owner
Joe Gaudet
Created
Updated
One-pager
Publish each page with its Markdown, as one artifact with several files
Related
None

Summary

Today a skillsaw page on claude.ai is one HTML file, and an agent that reads it gets 103 KB of text, about 44k tokens, for the example PRD. This PRD publishes each page as one artifact with several files: the page, index.md, one Markdown file for each work item, and the styles and the scripts as files. An agent then reads about 3k tokens to write a ticket. Download .md saves through the downloads capability of the viewer. The PRD has 6 functional and 3 non-functional requirements. The text of one work item has the most risk: it can leave out a fact that a ticket needs.

Glossary

Artifact
A page on claude.ai at one link, with one file or more.
Publish folder
The folder .skillsaw/publish/<key>/ that skillsaw publish writes for one page: the files of one artifact.
Item text
The file items/WI-n.md: the context of one work item of a PRD, the same text as skillsaw markdown --item WI-n.
Viewer
The claude.ai frame that shows an artifact and gives it capabilities.
Capability
A service that the viewer gives to a page that declares it. This PRD uses downloads.

Problem and context

The artifact tools give an agent all of the HTML of a one-file page. On 2026-12-03, two agents wrote the ticket of WI-3 from the example PRD of the prd skill, published as one file. Each agent read 103 KB of text, about 44k tokens. Most of it was CSS and scripts. Three agents did the same task with the PRD as files. Each one read only items/WI-3.md: 10 KB, about 3k tokens.

The first item text left out three facts that the ticket needed: the endpoint that starts a job, the rule that the worker writes the progress after each 10 pages, and the rollout. On claude.ai, Download .md of the Markdown view does nothing, because the viewer does not let a page start a download. The one-pager gives the plan and the release steps.

Goals and non-goals

Goals

  • An agent that writes a ticket from a published PRD reads 15 KB of text or less. Today it reads 103 KB.
  • The item text has the endpoints, the rules and the rollout that a ticket needs, and names what it leaves out.
  • Download .md saves the file on claude.ai, or the page does not show it.
  • For a person, a published page looks and works the same.

Non-goals

  • A change of the look or the content of a page.
  • Hosts other than claude.ai: a page under tracker.pagesUrl stays one file.
  • The Markdown of a quality report: the report gets its text from its script.
  • An update of the links in the text of a page that is already published (FW-1).

Customers

  • Teams that use skillsaw with Claude: their agents read about one tenth of the text for one task.
  • People who read a page on claude.ai: Download .md works, or the page hides it.
  • The maintainers of skillsaw: one more command and one more folder to keep.

Internal stakeholders

None. Joe Gaudet owns and approves this PRD.

Users and scenarios

  • An agent with the ticket skill gets the link of a published PRD and writes the ticket of one work item.
  • The prd skill builds a new PRD, publishes it with its Markdown and records the link.
  • A person opens a PRD on claude.ai and downloads its Markdown for a different tool.
  • Error case: the agent has a tool for one HTML file only. It publishes index.inline.html, and an agent that reads that page reads all the HTML.

Current state

A built page has its CSS and its scripts in the page, between the skillsaw:style and skillsaw:script markers (packages/cli/src/core/runtime.ts:64). A PRD or an ADR loads Mermaid from ../_assets/, so one file on claude.ai must be the --inline copy (packages/cli/src/prd/build.ts:115). tree publish-record keeps the claude.ai link and the hash of each page (packages/cli/src/tree/tree.ts:450).

The Markdown view makes the text in the browser (packages/cli/assets/runtime/base.js:103). Download .md makes a link to the text and clicks it (packages/cli/assets/runtime/base.js:178). skillsaw markdown gives the same text with no browser (packages/cli/src/markdown/page.ts:172), but only on the computer that has the repo.

Proposed state

skillsaw publish writes the files of one artifact for a page. The skill publishes them to the link of the page, then records the link. An agent that reads the artifact reads index.md or one item text.

User interface and prior art

One screen changes for a person: the Markdown view of a page on claude.ai. The second figure shows what an agent reads: no person sees it. The after states are the mock-up pages of the one-pager.

Walkthrough Publish a PRD, read one item text, download the Markdown on claude.ai.
The Markdown view of a published PRD
The Markdown view with a Copy and a Download .md button. A note says that a click on Download .md does nothing in the claude.ai viewer.
  1. Download .md asks the viewer to save the file, and the page shows "Saved.".
  2. When the viewer gives no downloads capability, the page hides Download .md. Copy stays.
  3. In a browser with no viewer, the button downloads the file as before.
The tool calls for the ticket of WI-3
  1. The file list shows items/WI-3.md next to index.html.
  2. The agent reads 13 KB in place of 103 KB.
  3. The item text ends with "Not in this text", so the agent knows when to read index.md.

Prior art

Two published patterns put a Markdown copy of a page where an agent can find it.

The llms.txt proposal: a Markdown copy of each page

The proposal for an /llms.txt file and .md copies of web pages

A sketch of two files: a page at /guide/setup.html and the same page as Markdown at /guide/setup.html.md.

The proposal says that a site can give a clean Markdown copy of a page at the URL of the page with .md added.

Take: A Markdown copy next to the HTML, at a name that an agent can find with no search.

Avoid: A name that the agent must guess. The artifact lists its files, and the page names index.md in its head.

Source

HTML: the alternate link type

The HTML Living Standard, link types, rel="alternate"

A sketch of a link tag with rel alternate, the type text/markdown and the href index.md.

A link with rel="alternate" and a type names a copy of the document in a different format.

Take: One link in the head of index.html that names index.md, with the type text/markdown.

Avoid: A link only: an agent can read past it. A comment for an LLM and the read rule say the same thing in words.

Source

Requirements

A functional requirement is FR-n. A non-functional requirement is NFR-n.

FR-1One command writes the files of one artifact

skillsaw publish <page> [--json] writes the publish folder of a page, a kind index or the knowledge base, and prints its files.

  • Given the example PRD with 7 work items, built
    When the agent runs skillsaw publish on its folder with --json
    Then the output names 16 files, index.html first and index.md second
    And items/ has one file for each work item and each future work card
    And index.html loads assets/skillsaw.css and its scripts from assets/
  • Given a page that is not built
    When the agent runs skillsaw publish on it
    Then the command exits with 2 and tells the agent to run the build of its kind
  • Given a publish folder with a file from an earlier publish
    When the agent runs skillsaw publish again
    Then that file is not in the folder

FR-2An agent finds the Markdown of a published page

The head of index.html names index.md, and the read rule of the skills tells an agent to read it.

  • Given a published page with work items
    When an agent reads the first lines of index.html
    Then after the doctype and the charset, a link with rel="alternate" and a comment name index.md and items/<id>.md
    And the page opens in standards mode
  • Given a page with no Markdown, such as a quality report
    When the agent publishes it
    Then the folder has no index.md
    And index.html has no hint

FR-3The item text has what a ticket needs

The item text adds the interfaces of the items that the item waits for, the whole rollout, and a last section that names what it leaves out.

  • Given WI-3 of the example PRD, which waits for WI-2
    When the agent runs skillsaw markdown with --item WI-3
    Then the text has the POST endpoint of WI-2, the rule that the worker writes the progress after each 10 pages, and the section Rollout and migration
    And the last section, "Not in this text", names FR-1, DEC-2, WI-1 and each section that the text leaves out
    And the last line tells where the full PRD is

FR-4A link to a published page opens on claude.ai

In the publish folder, a link to a page of the repo that has a claude.ai link gets that link, with its anchor.

  • Given a PRD that links an ADR, and the ADR has a claude.ai link in tree.json
    When the agent publishes the PRD
    Then the link in index.html and in index.md is the claude.ai link of the ADR
  • Given a link to a page that has no claude.ai link
    When the agent publishes the page
    Then the link stays as it is
  • Given an index page, and a page of its rows has a claude.ai link
    When the agent publishes the index page
    Then the row of that page links to its claude.ai link

FR-5Download .md saves the Markdown on claude.ai

In the viewer, Download .md uses the downloads capability. With no capability, the page hides the button.

  • Given a published PRD in a viewer that gives the downloads capability
    When a person clicks Download .md
    Then the viewer saves a file with the name of the page and the extension .md, with the text of the view
    And the page shows "Saved."
  • Given a viewer that gives no downloads capability
    When the Markdown view opens
    Then Download .md is not shown
    But Copy works
  • Given a page that opens from a file in a browser
    When a person clicks Download .md
    Then the browser downloads the file as before

FR-6The skills publish the files

The publish procedure of skillsaw-interviews.md uses the publish folder when the agent has a tool for several files.

  • Given an agent with a tool that publishes an artifact with several files
    When a skill publishes a page
    Then the agent runs skillsaw publish, publishes each file at its as path to the link of the page, and declares downloads on the first publish
    And it runs tree publish-record before the next page
  • Given an agent with a tool for one HTML file only
    When a skill publishes a PRD, an ADR or a walkthrough
    Then the agent publishes index.inline.html

NFR-1An agent reads 15 KB or less for one ticket

Measured as the text of the tool results that an agent reads to write the ticket of one work item from a published PRD.

  • Given the example PRD published as files
    When three agents each write the ticket of WI-3
    Then each agent reads 15 KB of text or less
    And no agent reads index.html

NFR-2No data file or response goes to an artifact

The publish folder gets only the files of the page folder that the page cites, and never a .json file or responses/.

  • Given a page folder with shot.png, notes.json and responses/sam.json, and a page that cites the three
    When the agent publishes the page
    Then the folder has shot.png
    But it has no notes.json and no responses/sam.json
  • Given a design review with review.json and responses.json
    When the agent publishes it
    Then the folder has its stages and index.md, and no .json file

NFR-3The repo does not change

The publish folder is a build output. The page in docs/ and its hash in tree.json stay the same.

  • Given a repo with a built page
    When the agent publishes the page
    Then .skillsaw/publish/.gitignore has the line *
    And the page in docs/ has the same bytes as before

Data model and API changes

Data model

No stored data changes. tree.json keeps its keys: published[key] has the claude.ai link and the hash of the page in docs/, as before. The publish folder is a build output that git ignores.

API

One new command, one changed command, and one new library function.

skillsaw publish <page> [--json]Write the files of one artifact

The page is a key of the tree (prd/2026-12-03-slug, prd/index, tree), a page folder or an index.html. The command writes .skillsaw/publish/<key>/ again and removes the files of the last publish. It exits with 2 when the target is not a page of the tree, or when the page is not built. --json prints the key, the folder and each file with its as path and its path on the disk, for the Artifact tool. A small folder gives its size in KB.

Request
npx @skillsaw/cli publish docs/prd/2026-12-01-notebook-export
Response
.skillsaw/publish/prd/2026-12-01-notebook-export: 16 files, 3.6 MB
  index.html
  index.md
  assets/mermaid.LICENSE.txt
  assets/mermaid.min.js
  assets/skillsaw-1.js
  …
  items/WI-5.md
skillsaw markdown <page> --item <id>Print the context of one work item

The same text as items/<id>.md of the publish folder, except the last line: here it names the skillsaw markdown command of the full PRD. It exits with 2 when the PRD has no such item, and names the items.

Request
npx @skillsaw/cli markdown docs/prd/2026-12-01-notebook-export --item WI-3
Response
> The context of WI-3: the item, the items that it waits for, the requirements that it covers, and each part of the PRD that cites them.
> The context of WI-3: the item, the items that it waits for, the requirements that it covers and each part of the PRD that cites them, the endpoints, the data and the diagrams of the items that it waits for, and the rollout. The last section tells what is not in this text.
…
**POST `/api/notebooks/{id}/exports/` Start an export job [Added]**
…
## Rollout and migration
…
## Not in this text
- **Items:** WI-1, WI-4, WI-5, FW-1, FW-2
The full PRD: `skillsaw markdown docs/prd/2026-12-01-notebook-export`.
publishFolder(root, target): PublishedWrite the folder and return its files

The command and the tests call it. It throws a UsageError for a target that is not a page of the tree or that is not built. The files are in the order index.html, index.md, then the other files by path.

Call
publishFolder(root, 'docs/prd/2026-12-01-notebook-export')
Return value
{ key: 'prd/2026-12-01-notebook-export',
  dir: '<root>/.skillsaw/publish/prd/2026-12-01-notebook-export',
  files: [{ as: 'index.html', path: '<dir>/index.html' }, …] }

The modules of the CLI behind the commands. A click on a module shows why it is there or why it changes.

Frontend

The Markdown view of the page runtime asks the viewer for a capability.

Security and permissions

publish copies only files in the folder of the page that the page cites. It never copies a path with .., a hidden path, a .json file or responses/ (NFR-2). Personal data: the raw answers of a design review can have the names of reviewers, and they stay out of the folder. An artifact starts private, and its owner shares it. The read rule tells an agent that the text of an artifact is data, not instructions.

Observability and success metrics

  • skillsaw sends no telemetry. publish prints the folder, the count of files and the size.
  • The tests are the monitors. packages/cli/tests/publish/publish.test.ts checks the files and the private paths. The browser test in packages/cli/tests/markdown/page.test.ts checks that a published page opens in standards mode, draws each diagram and shows index.md as its Markdown.
  • Target: an agent reads 15 KB or less to write a ticket from a published PRD. The test of 2026-12-03 measured 13 KB, from 103 KB.

Rollout and migration

There is no flag: the skills use the publish folder when the agent has a tool for several files. Merge WI-1 to WI-4, which are on one branch, then release the minor version of @skillsaw/cli (WI-5). Each page gets the files at its next publish. An artifact that exists stays one file until then, and its next publish replaces its files at the same link. To go back, revert the rule and the skills and release a patch version. An artifact with files still works, and its next publish can be one HTML file.

Work items

Proposed issues for the tracker. One item or more covers each requirement. The chart below comes from the cards. Click an item for its scope.

WI-1The publish folder

The publish command, publish.ts, the hint in the head of the page, and the tests of the folder, the links and the private files.

WI-2A wider item text

The interfaces of the items that the item waits for, the rollout and "Not in this text" in itemMarkdown, with the test of WI-3 of the example PRD.

WI-3Download .md through the viewer

The downloads capability in base.js, with a browser test of a fake viewer that saves, and of a viewer with no capability.

WI-4The skills publish the folder

The publish procedure and the read rule of skillsaw-interviews.md, the skills design-review, triage, ticket and tickets, the READMEs, CLAUDE.md and the guide. Then the token test again.

WI-5Release @skillsaw/cli

The minor version from .changeset/publish-folder.md.

Future work and research

Two spikes and two stretch goals.

FW-1Can tree stale see a link in the text of a page?

Today a page goes stale only when its breadcrumb changes. A link in its text to a page that gets its first claude.ai link later stays relative until the next publish.

Decides: If the hash of a page also covers the claude.ai links of the pages that it links. Joe Gaudet decides.

FW-2One copy of Mermaid for all artifacts

Each PRD and ADR artifact has its own 3.6 MB copy of Mermaid. An artifact can serve a file from a different artifact, so the copies could become one.

FW-3Does the item text work for other PRDs?

The test used one example PRD. Run the token test on three real PRDs, and compare each ticket with a ticket from index.md.

Decides: If the item text needs more parts of the PRD. Joe Gaudet decides.

FW-4Copy the mock-ups that a PRD shows from its one-pager

A PRD screen loads a mock-up with a path such as ../../one-pagers/<dir>/ui/<name>.html. publish copies no file outside the page folder, so on claude.ai the frame is blank. The command could copy each such mock-up into the PRD artifact and change the path of the frame.

Alternatives considered

Three decisions had real alternatives.

Product decisions

DEC-1Where does an agent find the Markdown of a published page?

The agent has only the link of the artifact and the read tools.

OptionCostVerdict
Files in the same artifact: index.md and items/<id>.mdOne command, 16 files for a PRDOne link. The tools read one file. An agent reads a page that is files
Do nothing: the agent reads the HTMLAbout 44k tokens for each read of a PRDThe problem stays.
A second artifact with the Markdown onlyTwo links and two publishes for each pageThe two links can show different versions.
The Markdown in a comment of index.htmlOne fileThe tools return the whole page, so the agent reads more, not less.

Revisit if: The artifact tools give the text of a page as Markdown by themselves.

Technical decisions

DEC-2Which files of the page folder go to the artifact?

A page folder can have mock-ups, images, data files and raw responses.

OptionCostVerdict
The files that the page cites, with no .json file and no responses/A scan of the quoted paths of the page and of each HTML file that it copiesThe page works, and no raw response goes out. NFR-2
All the files of the page folderNo scanCopies review.json and the responses, which can have the names of reviewers.

Revisit if: A page needs a data file to draw itself.

DEC-3How does Download .md work in the viewer?

The viewer does not let a page start a download.

OptionCostVerdict
The downloads capability, and no button when the viewer gives noneOne declaration at the first publishThe person gets the file. The design review does the same. FR-5
No Download .md in the viewer: Copy onlyNo codeThe person must paste the text into a file.

Revisit if: The viewer lets a page start a download with no capability.

Risks

RiskLikelihoodImpactMitigation
The item text leaves out a fact that a ticket needsMediumHigh"Not in this text" names each part that it leaves out. FW-3 measures more PRDs. In the test, no agent said that the rollback with the flag stops working after WI-5 removes the old endpoint.
An agent reads index.html, not index.mdLowMediumThe hint in the head, the read rule and the file list. In the test, 3 of 3 agents read only items/WI-3.md.
The publish folder copies private dataLowHighNo .json file and no responses/, with a test.
The viewer or the Artifact tool stops the support for several filesLowMediumThe publish procedure publishes one HTML file. Only the agent reads more.
A PRD screen that shows a mock-up of its one-pager is blank on claude.ai: the mock-up is in a different artifactHighLowThe screen names the one-pager, which has the mock-up. FW-4 copies the mock-up into the PRD artifact.
A link in the text of a page stays relative on claude.aiMediumLowPublish the page again after the first publish of the page that it links. FW-1.

Open questions

  • Must the item text say when a rollback stops working, such as the flag of the example PRD after WI-5? Joe Gaudet answers before the status is Approved.

Interview record

Each question of the interview with its answer and its source. The owner asked for no questions, so each gap uses the recommended option, as an assumption.

QuestionAnswerSource
What is the result for the user?An agent that reads a published page reads its Markdown, not its HTML.One-pager
Is the one-pager approved?No: it is in review. The PRD stays Draft until the owner approves it.One-pager
How much text does an agent read today, and with the files?103 KB for one HTML file. 13 KB with the files, in three of three runs.Token test of 2026-12-03
Which facts did the first item text leave out?The endpoint that starts a job, the rule of the progress, and the rollout.Token test of 2026-12-03
Which parts of skillsaw change?All of them: the CLI, the rules, the skills and the docs.User
Which compliance regimes apply?None: prd.regimes is not in the config.Code: .skillsaw/config.json
What is the team of each work item?CLI, Runtime or Skills: the parts of the repo. One maintainer does all of them.Assumption: no questions
What is the estimate of each work item?From the size of the change on the branch: 5, 3, 2, 2 and 1 points.Assumption: no questions
What is the target for the text that an agent reads?15 KB or less, with room above the 13 KB of the test.Assumption: no questions
Does the viewer ask the person before it saves a file?Usually yes: the viewer shows a confirmation, and the person can decline. The page then shows "Not saved."The downloads capability guide of claude.ai
Is the work started?WI-1 to WI-4 are built on the branch claude/amazing-cannon-mvd7s9. No pull request exists.Code

Changelog

DateAuthorChange
2026-12-03Joe Gaudet (agent)First draft.
2026-12-03Joe Gaudet (agent)WI-1 to WI-4 are built on the branch claude/amazing-cannon-mvd7s9, in the commits 4040258 and e643cd0.
2026-12-03Joe Gaudet (agent)The viewer asks before it saves a file: the open question is closed. Added the risk of a blank mock-up on claude.ai, and FW-4.
2026-12-03Joe Gaudet (agent)FR-4: a row of an index page gets the claude.ai link of its page. The first publish of the index pages showed that the rows kept relative links.

The prd skill of skillsaw wrote this page. The HTML in this file is the source of truth. The diagrams are the Mermaid sources in it.