From 05bfbc0cd8660d086782a19c73bbd30091307b28 Mon Sep 17 00:00:00 2001 From: dirtydishes Date: Tue, 26 May 2026 01:11:52 -0400 Subject: [PATCH] add turn doc template guidance --- AGENTS.md | 15 +- CLAUDE.md | 8 +- docs/turns/template.html | 319 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 337 insertions(+), 5 deletions(-) create mode 100644 docs/turns/template.html diff --git a/AGENTS.md b/AGENTS.md index cd1e980..334aa68 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -133,6 +133,8 @@ If a change does not cleanly fit either exempt or substantive buckets, ask the u Use the `impeccable` skill to structure and style the document as clean, readable HTML. For this repository, `impeccable` is the styling and layout authority for turn documents when available. Do not apply global non-repo computer-task house styling to repository turn documents. +Future turn documents must start from `docs/turns/template.html`. The template is the canonical appearance baseline for this repository: dark polished layout, lavender and pink accent colors, compact header metadata, clear section rhythm, and contained diff shells modeled after `/Users/kell/dev/islandflow/docs/turns/2026-05-20-fix-alert-flow-packet-history.html`. + If `impeccable` is unavailable or blocked by an actual tool/file error, still create a well-structured standalone HTML file. Each turn document must include these sections: @@ -157,7 +159,7 @@ For a minor update to a previous substantive change, add this section to the exi ### Rendered Diff Documentation -When turn documentation needs rendered code diffs, use `@pierre/diffs` through its ESM server-side renderer. +When turn documentation needs rendered code diffs, use Clean SSR with `@pierre/diffs` through its ESM server-side renderer. The final HTML must be readable as a static file and must not depend on client-side package loading. Use `@pierre/diffs/ssr` with Node ESM imports. Do not test, load, or diagnose this package with CommonJS `require()`, because `@pierre/diffs` is ESM and `require('@pierre/diffs/ssr')` can falsely look like an export or package failure. @@ -188,7 +190,16 @@ NODE Do not run `npx @pierre/diffs`; the package is a rendering library and does not expose a CLI executable. -Only use a clearly labeled plain diff or code-block fallback when the ESM import-and-render pattern above fails because of a real tool, install, or runtime error. Document the failure briefly in the turn document. +Diff output must follow these readability rules: + +- Use curated, relevant snippets rather than dumping an entire commit or full-file diff when a focused snippet explains the change. +- Render one file diff per `.diff-shell`, with a clear `.diff-title` naming the file and purpose. +- Insert generated SSR HTML only inside the matching `.diff-view` element from `docs/turns/template.html`. +- Never paste generated SSR output as a freestanding section body or outside the diff shell. +- Keep normal prose sections around the generated markup so the source and rendered page remain navigable. +- Mark a shell with `class="diff-shell rendered"` when SSR output is present so the fallback is hidden. + +Only use a clearly labeled plain diff or code-block fallback in the template's `
` block when the ESM import-and-render pattern above fails because of a real tool, install, or runtime error. Document the failure briefly in the turn document.
 
 ## Plan Mode Documentation
 
diff --git a/CLAUDE.md b/CLAUDE.md
index 633878c..69c2703 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -112,7 +112,7 @@ Use this decision order before creating a turn document:
 
 The minor/trivial exemptions override the general mandatory turn-document rule.
 
-For diff content in turn documentation (including "Code diffs" and "Relevant Diff Snippets"), use `@pierre/diffs` output by default. Do not run `npx @pierre/diffs`; the package is a rendering library and does not expose a CLI executable. Generate rendered diff HTML with `@pierre/diffs/ssr`, usually `preloadPatchDiff`, and insert that rendered output into the turn document. `preloadPatchDiff` expects exactly one file diff per call, so split multi-file diffs into one patch per file and concatenate the rendered HTML. If `@pierre/diffs/ssr` is unavailable because of a real tool or blocking error, use a clearly labeled plain diff/code block fallback and note why.
+For diff content in turn documentation (including "Code diffs" and "Relevant Diff Snippets"), use Clean SSR with `@pierre/diffs` output by default. Do not run `npx @pierre/diffs`; the package is a rendering library and does not expose a CLI executable. Generate rendered diff HTML with `@pierre/diffs/ssr`, usually `preloadPatchDiff`, and insert that rendered output only inside a `.diff-view` element within a `.diff-shell` from `docs/turns/template.html`. `preloadPatchDiff` expects exactly one file diff per call, so split multi-file diffs into one patch per file and render one shell per file. Use curated, relevant snippets rather than dumping an entire commit or full-file diff when a focused snippet explains the change. If `@pierre/diffs/ssr` is unavailable because of a real tool or blocking error, use the template's clearly labeled plain fallback diff block and note why.
 
 ### No turn document for minor/trivial checklist matches
 
@@ -132,7 +132,7 @@ If a change does not cleanly fit either exempt or substantive buckets, ask the u
 **"New Changes as of {time and date at which the change was made}"**
 - **Summary of changes**
 - **Why this change was made**
-- **Code diffs** (use rendered `@pierre/diffs/ssr` output by default; do not use `npx @pierre/diffs`; if unavailable, include a clearly labeled plain diff/code block and note why)
+- **Code diffs** (use Clean SSR `@pierre/diffs/ssr` output inside the template's `.diff-view` by default; do not use `npx @pierre/diffs`; if unavailable, include a clearly labeled plain fallback diff block and note why)
 - **Related issues or PRs**
 
 Additionally, add a note to each section explaining why the changes were made.
@@ -163,6 +163,8 @@ Use the `impeccable` skill to structure and style the document as clean, readabl
 
 For this repository, `impeccable` is the styling and layout authority for turn documents when available. Do not apply global non-repo computer-task house styling to repository turn documents.
 
+Future turn documents must start from `docs/turns/template.html`. The template is the canonical appearance baseline for this repository: dark polished layout, lavender and pink accent colors, compact header metadata, clear section rhythm, and contained diff shells modeled after `/Users/kell/dev/islandflow/docs/turns/2026-05-20-fix-alert-flow-packet-history.html`.
+
 If the `impeccable` skill is unavailable or blocked by an actual tool/file error, still create a well-structured standalone HTML file with:
 
 - A concise summary at the top
@@ -181,7 +183,7 @@ Each turn document must include these sections:
 2. **Changes Made**
 3. **Context**
 4. **Important Implementation Details**
-5. **Relevant Diff Snippets** (render with `@pierre/diffs/ssr` output by default; do not use `npx @pierre/diffs`; if unavailable, include a clearly labeled plain diff/code block and note why)
+5. **Relevant Diff Snippets** (render with Clean SSR `@pierre/diffs/ssr` output inside the template's `.diff-view` by default; do not use `npx @pierre/diffs`; if unavailable, include a clearly labeled plain fallback diff block and note why)
 6. **Expected Impact for End-Users**
 7. **Validation**
 8. **Issues, Limitations, and Mitigations**
diff --git a/docs/turns/template.html b/docs/turns/template.html
new file mode 100644
index 0000000..18aa8c9
--- /dev/null
+++ b/docs/turns/template.html
@@ -0,0 +1,319 @@
+
+
+
+  
+  
+  <!-- TITLE -->
+  
+  
+  
+  
+
+
+  
+
+

Dreamio turn document

+

+

+
+ + YYYY-MM-DD + Beads issue dreamio-xxx +
+
+ +
+
+

Summary

+

+
+ +
+

Changes Made

+
    +
  • +
+
+ +
+

Context

+

+
+ +
+

Important Implementation Details

+
    +
  • +
+
+ +
+

Relevant Diff Snippets

+
+ +
+

path/to/file.ext ยท short description

+
+ +
+
+
+
+

Diffs are generated with @pierre/diffs/ssr at documentation time. Each file diff stays inside its own shell so the page remains readable as a static HTML artifact.

+
+ +
+

Expected Impact for End-Users

+

+
+ +
+

Validation

+ +
    +
  • +
+
+ +
+

Issues, Limitations, and Mitigations

+
    +
  • +
+
+ +
+

Follow-up Work

+
    +
  • +
+
+
+
+ +