agentleFS
DemchaAVDemchaAV/graphcompose-ai-flow/skills/workflows/create-template/SKILL.md

create-template

Skill4 starsChanged 3 months agoMITView on GitHub

Turn a document reference — a screenshot, PDF, or design image of a CV, invoice, proposal, cover letter, report, certificate — into a maintainable GraphCompose Java template, then render, compare against the reference, and iterate until it is ready for approval. Use when the user supplies a reference and asks to recreate, rebuild, or generate it with GraphCompose: "create this document", "recreate this screenshot", "make this CV with GraphCompose", "build a template from this reference", "turn this PDF into a template".

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If a template already exists and they want it changed, use revise-template.

    line 21
  2. Very specific:

    When the loop stops, report: what the document is and where it lives.

    line 70

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create a GraphCompose template from a reference

Reconstruct the document with semantic GraphCompose primitives — sections, rows, weights, anchors, layer stacks. Never draw it with raw coordinates: a coordinate drawing matches one reference at one size and is unmaintainable the moment anything changes.

The work is four phases. Each has its own reference page with the commands and the rules; this page is the order and the contract between them. Read a phase's page when you reach it, not all four at once — what you do not load is context the loop gets to spend on the real mismatch.

When this applies

The user supplies a reference image or PDF and wants it as a template. If a template already exists and they want it changed, use revise-template.

First, check nothing already does this

node scripts/templates.mjs --json

One command, no model, and it can end the task before it starts. If the user named a published template — "use Northline", "another one like the mint CV" — or a bundle's docKind and preview match what they are asking for, offer that instead: node scripts/templates.mjs inspect <id>, then node scripts/use-template.mjs <id> --target <their-project>. Reuse is a file copy; reconstruction is the whole loop, and it lands near the approved layout rather than on it.

Two things this does not mean. A reference the user supplied is still a reference: do not talk them out of a new template because something in the catalog is roughly similar. And a request to change a published template's layout is revise-template on its source project, not a reuse — see Template Reuse First.

The four phases

PhaseProducesPage
1. Set up — preflight, workspace, import the reference, settle the page size, open revision-001a project with reference/reference.png, a measured page, a first DRAFTcreate-1-setup.md
2. Analyse — measure the reference in one call, describe it as regions with roles, flow and data, and resolve the assets it namesvisual-analysis.json, <doc-kind>-data.json (+ overflow dataset when it flows), asset-request.json, assets-manifest.json, architecture-plan.jsoncreate-2-analyse.md
3. Author — check the plan and manifest are complete (check-analysis --for authoring), then write the template against the pinned pack's allow-listthe template class, the spec providercreate-3-author.md
4. Loop — render, measure, classify, fix one cause, repeat until the loop says stoprevisions with reviews, and a verdictcreate-4-loop.md

Three rules hold across all four:

  • Anything a script can decide is decided by a script. Version, workspace, page size, the diff, the evidence, the loop verdict. Where a page below names a command, run it rather than working the answer out; the one-call batching rule in phase 2 is about exactly this cost.
  • Every render is a revision. node scripts/pass.mjs --project <id> --open "<what this pass fixes>" opens the next one with the sources carried forward; re-rendering the same revision is how a loop hides ten measurements in one folder.
  • Loop until the tool says stop. READY_FOR_APPROVAL, CONVERGENCE_LIMIT_REACHED and BLOCKED are the three places the loop ends on its own, and iterate-status is what says which. A successful render is not one of them.

The stop, and the report

When the loop stops, report: what the document is and where it lives; the parity verdict and the remaining mismatches, honestly; the paths to output.pdf and output.png; that it is waiting for approval. End with the metrics block (node scripts/telemetry/run-metrics.mjs report --project <id> --status <verdict>) when it is available — and say nothing about it when it is not. Do not approve on the user's behalf; approve-template runs when they say so.

Judgement calls

  • Do not open a revision for an ambiguous request. One clarifying question first: which document kind, how many pages, is the sample content real or placeholder.
  • First render will not match. That is expected — the loop is the method, not a fallback for a bad first attempt.
  • A reference that cannot be reproduced is a report, not a bodge. If parity needs an API that does not exist, stop with GRAPHCOMPOSE_API_LIMITATION naming the API and what was tried — never fake the appearance with hardcoded offsets that break on the next content change. If it is a fact about the line the user can accept (a typeface no bundled family reproduces), record it once with node scripts/limitations.mjs accept … and the loop routes around it.

Related

  • ../references/workspace.md — roots, version, skill pack
  • ../references/authoring-rules.md — the non-negotiables
  • ../references/iteration-loop.md — bounds, failure categories, the render record, accepted limitations
  • ../review-template/SKILL.md · ../revise-template/SKILL.md · ../approve-template/SKILL.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.