Acceptance: Item Markdown Editor
Feature ID: item-markdown-editor
Spec: ./spec.md
Last updated: 2026-05-15
A reviewer running through this checklist before signing off the PR should be able to tick every box.
Add flow
- Open the dashboard for any work, hit "Add item", scroll to the new
"Content (Markdown)" field, type
# Hello\n\nWorld, submit. - After the success toast, navigate to the work's data repo on
GitHub. The new item directory contains
<slug>.mdwhose body is literally# Hello\n\nWorld. - The same item's
<slug>.ymlcarries a top-levelmarkdown:key with the same content. - Add a second item with the markdown field left blank. Confirm the
generated
<slug>.mdmatches the pre-existing stub (# <Name>\n\n<Description>\n\n[<url>](<url>)). - Toggle "Preview" while typing. Confirm the rendered preview appears below the textarea and matches GFM expectations (headings, lists, tables, code fences).
Edit flow
- On any item card, open the dropdown menu. A new "Edit content" entry sits below "Edit display".
- Click it. The dialog opens with the current
markdownbody pre-filled. Confirm it matches what's on disk in the data repo. - Make no edits and click "Update item". No new commit lands on the data repo (server returns success without pushing).
- Edit the body, leave "Create Pull Request" off, click "Update item".
A new direct commit lands on default with message
Update <name> content. The<slug>.mdfile content matches the saved body; the YAMLmarkdownfield matches too. - Edit the body again with "Create Pull Request" on. A PR is
opened with title
Update content for <name> - <timestamp>and a body that mentions content was updated.
API contract
-
POST /api/works/:id/items/submitaccepts an optionalmarkdownfield. Old clients that omit it still succeed. -
PUT /api/works/:id/items/updateacceptsmarkdown. Old clients that omit it still succeed. - Sending
markdownlonger than 100,000 chars returns HTTP 400 with amaxLengthvalidation error, before any git work is performed.
Tests & quality
-
packages/agent/src/items-generator/dto/dto.spec.tsincludes passing cases for the newmarkdownfield on both DTOs. -
pnpm lintandpnpm type-checkare green at the monorepo root.
Site render
- Trigger a site regeneration for a work whose item has authored
markdown. Visit the item-detail page on the generated site and
confirm the new body renders via the existing
next-mdx-remote-based item-detail renderer.