Skip to content

feat(docs): add guided implementation prompts to task guides - #887

Open
aXenDeveloper wants to merge 1 commit into
canaryfrom
claude/docs-implementation-prompts
Open

aXenDeveloper wants to merge 1 commit into
canaryfrom
claude/docs-implementation-prompts

Conversation

@aXenDeveloper

Copy link
Copy Markdown
Owner

Description

What?

Guides can now declare an optional implementation field in their frontmatter. A page that has it shows a Copy implementation prompt button next to Copy Markdown. One click copies a prompt for a coding agent: it links the guide and its .md version, tells the agent to inspect the reader's project and ask a short set of questions, then implement where the reader chose. Nothing is generated by AI and the docs site asks the reader nothing.

  • Schema (apps/web/src/docs/implementation/schema.ts): a strict zod schema added to the fumadocs page schema. Fields are objective, decisions (1-6), optional constraints (up to 6) and optional related (up to 4 /docs/... links). Bad metadata fails the docs build and names the file. Pages without the field are unchanged.

  • Prompt builder (apps/web/src/docs/implementation/prompt.ts): a pure function holding the one shared agent workflow:

    • inspect before editing, and treat the guide's example plugin as an example, not the target;
    • skip questions the user already answered, offer only choices found in the project, and ask dependent questions after their answer;
    • fall back to plain numbered options when the agent has no question tool;
    • explain a missing target instead of guessing, implement without a redundant confirmation, then report.

    Links are absolute on SITE_ORIGIN.

  • Button (page-header.tsx): reuses the existing CopyButton, so it gets the same success state, screen-reader announcement and error toast. transport.ts now also returns the page URL.

  • Pilots: Threaded replies (comments), Publish notifications, and the widgets End-to-end Example. There is no reactions guide or reactions feature in the codebase, so none was enabled.

  • Contributor docs: an "Implementation prompts" section in dev/contribution.mdx, plus a pointer to it in the vitnode-docs skill.

  • Tests: 12 tests on Node's built-in runner in apps/web/src/tests/, plus a test script. apps/web had no tests, and its lint config already supports node:test, so no new dependency was needed.

Why?

A reader can paste one prompt into their coding agent and get the documented feature built into their own plugin and content type, instead of the guide's example names. Each guide keeps only a few lines of metadata, and the tutorial stays the single technical reference. The metadata does not appear in the article, the .md export, /llms.txt or /llms-full.txt.

Checks

  • pnpm typecheck and pnpm lint in apps/web pass.
  • pnpm test passes (12/12).
  • Production pnpm build in apps/web passes.
  • All changed TS/TSX files pass oxfmt --check. pnpm check in apps/web fails on the same 103 files before and after this change; none of them are touched here.
  • In headless Chromium against the dev server:
    • the button shows only on enabled pages, and Copy Markdown still works;
    • the copied prompt belongs to the current page after client navigation;
    • Enter copies when the button has keyboard focus;
    • a blocked clipboard shows the error toast;
    • there is no horizontal overflow at 360px wide, in light or dark theme.
  • The six agent scenarios (answered questions, several plugins, dependent choices, missing target, no question tool, guide differing from installed code) were reviewed against the prompt text only. The prompt has not been run through an external coding agent.

Generated by Claude Code

Guides can declare optional `implementation` frontmatter (objective,
decisions, constraints, related links), validated by the docs schema.
Pages that declare it show "Copy implementation prompt", which copies a
prompt built from one shared agent workflow: read the guide, inspect the
project, settle the page's decisions with the user, then implement.

Enabled on Threaded replies, Publish notifications and the widgets
End-to-end Example. Contributor docs explain how to author the metadata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0129cPmZegPiTUyX5NPnpdZ3
@github-actions github-actions Bot added the 💡 Feature A new feature label Oct 18, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T22:38:11.386896Z 3b99721 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 3b99721.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💡 Feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants