Skip to content
Docxcelerate

← Registry

Next steps

Generated

The node most likely to invent something, so all four prompts are set: the info prompt hands the engine the facts it may use, and the negative prompt closes off the two failures that matter in a document somebody acts on — an invented deadline and an invented way to contact you.

npx dxcl add next-steps
exports NextSteps · resolves to 1 nodes
01

Preview data

the JSON this preview was built with
{
  "actions": [
    "check the balance shown above",
    "pay online or by bank transfer",
    "tell us if anything looks wrong"
  ],
  "contact": "hello@riversideleisure.example on 0117 496 0000"
}
02

Rendered preview

the component rendered on its own
Open ↗
Rendered by Docxcelerate at build time Open ↗
03

Resolved nodes

what a renderer receives — 1 nodes
next-steps paragraph · dynamic What the reader should do next, written per document from the steps above.
04

The files

what installing writes; the selected file is the component
nodes/next-steps.node.tsx Source
import { type Paragraph as ParagraphComponent, Paragraph, useState } from "docxcelerate/template";

/**
 * The paragraph telling a reader what to do now — written per document.
 *
 * All four prompts are set, because this is the node most likely to invent
 * something. The info prompt hands the engine the facts it is allowed to use,
 * and the negative prompt closes off the two failures that matter in a document
 * somebody acts on: inventing a deadline, and inventing a way to contact you.
 *
 * Previews show the placeholder rather than calling anything, so the shape of
 * the finished document is readable before an engine exists.
 *
 * Installed by `dxcl add next-steps`.
 */

/** What this component reads. Add these fields to your document data type. */
export interface NextStepsData {
  /** What the reader has to do, in your own words. One entry per step. */
  actions: string[];
  /** How to reach you. Printed nowhere; given to the engine as fact. */
  contact: string;
}

export const NextSteps: ParagraphComponent = () => {
  const [steps] = useState((data: NextStepsData) => ({
    actions: data.actions.join("; "),
    contact: data.contact,
  }));

  return (
    <Paragraph
      id="next-steps"
      systemPrompt="You are writing on behalf of the sender, plainly and without sales language."
      generalPrompt="Tell the reader what to do next, in one short paragraph of no more than three sentences."
      infoPrompt={`The steps are: ${steps.actions}. They can reach us at ${steps.contact}.`}
      negativePrompt="Do not invent deadlines, reference numbers, phone numbers or addresses. Do not apologise."
      placeholder="What the reader should do next, written per document from the steps above."
    />
  );
};