Skip to content

Prompts and skills page, generated from the source - #79

Merged
JacobStephens2 merged 2 commits into
mainfrom
issue-68
Sep 26, 2026
Merged

JacobStephens2 merged 2 commits into
mainfrom
issue-68

Conversation

@JacobStephens2

Copy link
Copy Markdown
Owner

Summary

A Prompts and skills page at /prompts/, generated from the same code the binary runs.

 src/
 ├── session.rs        # run(): Command::new("claude").args(claude_args(...))
+│                      # claude_args(): the one shared definition of the arguments
 ├── plugin.rs         # SKILLS, now pub, read by the renderer too
+└── prompts_page.rs   # #[cfg(test)] renderer + golden-file test
 site/
 ├── index.html        # press line skill labels → /prompts/#skill-<name>
 ├── main.js           # fills the commit label from /commit.txt
+└── prompts/index.html  # page; fragment between generated markers
render()
  command line   claude_args("<plugin dir>", None | "<session id>", "<prompt>")
  prompts        prompt::fresh / continuation (no PR, open PR) / conflict_repair / ci_fix_repair / resume
                 with <Issue URL>, <base>, <branch>, <pull request URL>, <failing check> …  → <mark class="ph">
                 each: one line on when it's sent + link to the unit (/#unit-N)
  skills         walk plugin::SKILLS, every file raw, SKILL.md first; each links its unit
  licence        skills/LICENSE raw, link to pr/CREDITS.md

test prompts_page_shows_what_the_binary_sends
  no site/ dir (crates.io package)   → skip with a message
  UPDATE_PROMPTS_PAGE=1              → rewrite the fragment
  fragment != render()               → fail with line diff + "Regenerate it with: UPDATE_PROMPTS_PAGE=1 cargo test prompts_page"

The page includes the fragment literally, between marker comments in site/prompts/index.html, because the site has no build step or server-side includes. The commit label is filled in by main.js from the commit.txt that publish.sh writes. Without it (locally, or JS off) the label reads "As of the commit of main this copy of the site comes from".

Evidence

Page (1440 and 390 wide, with a stand-in commit.txt):

top 1440
CI-fix Repair at 390
tdd skill at 1440

Golden file:

  • Before: the prompt changed without regenerating → cargo test fails:
    site/prompts/index.html is out of date with the prompts, the claude arguments or the skills:
       67 - … Build on them; don't start over.
       67 + … Build on them.
    Regenerate it with: UPDATE_PROMPTS_PAGE=1 cargo test prompts_page
    
    The same happens after editing skills/tdd/tests.md.
    After: UPDATE_PROMPTS_PAGE=1 cargo test prompts_page rewrites the fragment, and cargo test passes again.
  • Packaged crate: I unpacked cargo package and ran the tests with their own target dir: skipping: no …/thirdshift-0.2.0/site (the crates.io package leaves it out) … ok. tests/packaging.rs passes.
  • Prefactor: claude_args produces the same arguments in the same order. All Run tests pass unchanged: cargo test gives 14 suites ok, and clippy is clean.
  • Links: I checked every /prompts/#skill-* link on the home page, and every /#unit-N and in-page link on /prompts/, against the ids that exist.

Merge Danger

Door: two-way

Blast Radius: site

Only /prompts/ and the home page's skill labels change what visitors see. The binary's behaviour doesn't change: the session arguments are only refactored. From now on, any PR that changes a prompt, the claude arguments or a skill must regenerate the page, or cargo test fails. That is intended.

Unaddressed findings

Standards

  • Skill-to-unit mapping and unit names are duplicated across prompts_page.rs and site/index.html. The site has no templating. A new skill without a unit panics the renderer; renaming a unit is rare and shows on review.
  • Placeholder constants are repeated in the PLACEHOLDERS array, and highlighted marks any <base>-style text. No prompt's fixed text uses those tokens (<run-id> isn't one). A unit test covers escaping versus highlighting.
  • The u64::MAX issue-number sentinel is only swapped after #. Every prompt uses the number only as Closes #<n>. The review confirmed there are no stray occurrences.
  • The regeneration command is written out in three places (the UPDATE constant, the marker comment and the README). They are plain strings for different readers. I didn't think a macro for them was worth it.
  • The hand-written LCS diff might be speculative generality. The spec asks for the failure to show a diff, and the crate has no diff dependency.
  • The header mark and footer markup are copied from the home page. That is expected on a static site with no build step.

Spec

Closes #68

🤖 Generated with Claude Code

JacobStephens2 and others added 2 commits September 26, 2026 14:20
The claude session arguments move into session::claude_args, which the
session runs with and the page's renderer reads. The renderer, test-only in
src/prompts_page.rs, renders every prompt with highlighted placeholders, the
command line, and every embedded Factory skill raw into the fragment in
site/prompts/index.html. A golden-file test fails with a diff and the update
command when the fragment is stale, and skips when site/ is absent, as in the
crates.io package. The home page's skill labels link to the page's anchors,
and the page links back to the units and shows the published commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lback label

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JacobStephens2
JacobStephens2 merged commit 24dc1f9 into main Sep 26, 2026
13 checks passed
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.

Prompts and skills page, generated from the source

1 participant