template-creator
Create or update a reusable personal Codex artifact-template skill. Use when the user invokes $template-creator or asks in natural language to create a reusable template from a reference document, presentation, spreadsheet, Google Docs, Slides, or Sheets link, ImageGen or Product Design image, email, Slack message, or Site project, or explicitly asks to edit or update a passed artifact-template skill. Do not use for one-off creation from an existing template.
SKILL.md 原文预览
Template Creator
Create or update a reference-backed template. Keep the source file, Site project, or a canonical Google Workspace URL and rendered reference image inside the skill so later use can reproduce its structure, voice, and visual system precisely.
Routing
- Manage only personal skills under
${CODEX_HOME:-~/.codex}/skills. - Create a new template by default. Use a numbered skill name instead of overwriting an existing template.
- Update only when the user explicitly asks to edit or update exactly one passed artifact-template skill. Treat that passed skill as the exact target; never choose a similarly named template.
- Do not modify an installed or bundled plugin cache. If the passed template is plugin-backed, explain that this skill can update only a personal template.
- Do not create, modify, upload, or publish a plugin. If the request also asks to share the template with a workspace, explain that this skill only manages personal templates.
- A template exists only after
create-template-skill.mjssucceeds. Never hand-author, rename, or copy a normal skill and report it as an artifact template.
Create workflow
- Require exactly one supported reference unless the user explicitly requests a batch. For a batch, complete this workflow separately for every reference:
- Document:
.docx - Presentation:
.pptx - Spreadsheet:
.xlsx - Google Workspace: one Google Docs, Google Slides, or Google Sheets URL
- ImageGen or Product Design image:
.png - Email or Slack message:
.txt - Site: an existing Site project directory
- When email or Slack content is pasted rather than attached, materialize the exact content as a temporary UTF-8
reference.txtwithout rewriting it.
- Infer a concise display name and intended-use description from the reference and request. Infer document, presentation, spreadsheet, and image from the file extension. For a Site project directory, use
site. Infergoogle-docs,google-slides, orgoogle-sheetsfrom the supplied Workspace URL; for a generic Drive share URL, use Google Drive metadata to identify the native file type and resolve its canonicaldocs.google.comURL. Ask only when the link is inaccessible or does not identify a supported native Workspace artifact. For an image, set its gallery kind toproduct-designwhen the request includes@Product Design; otherwise default toimagegen, including when the user provides only the image and this skill. Ask only when the request explicitly includes both Product Design and ImageGen and the intended target remains unclear. For.txt, determine whether the user requestedemailorslack; ask if the intended type is ambiguous. - For references other than Site projects, create
preview.pngbefore packaging:
- DOCX: use Documents to render the reference and copy its first page PNG.
- PPTX: use Presentations to render the reference and copy its first slide PNG.
- XLSX: use Spreadsheets to render the used range of the first visible non-empty sheet.
- Google Workspace: load the
google-driveskill and the matchinggoogle-docs,google-slides, orgoogle-sheetsskill from@Google Drive, inspect the native artifact, and use the file bridge below. Then: - Google Docs: export to PDF and render its first content page to
reference.png. Normally this is PDF page 1. For a tabbed Doc, Google may prepend one or more synthetic pages that contain only a tab title; skip only those consecutive tab-title separator pages and use the first page containing the first tab's actual document body. Treat that page as the artifact's first page rather than as a later-page substitution. Do not skip a real content page merely to choose a more attractive preview, and stop if the export contains no representative content page. - Google Slides: export to PDF and render only its first slide to
reference.png. - Google Sheets: identify the first visible non-empty sheet, export to XLSX, and use Spreadsheets to render that sheet's used range to
reference.png. - PNG: copy the reference PNG unchanged.
- Email or Slack: render a legible representative portion of the exact reference text on a neutral canvas. Do not paraphrase, decorate, or invent content.
- For a Google Workspace template, copy the checked
reference.pngunchanged topreview.png. - A Google Workspace URL is sufficient to activate the Google Drive workflow; do not require the user to add @Google Drive. Before entering
functions.exec, check whether the Google Drivefetchtool is callable. If it is not, usetool_searchonce to find and load the Google Drive action that fetches a native Google Doc, Sheet, or Slides file with raw-file download support, then check the callable tools again. Do not run the file bridge untilfetchis loaded, and do not report that it is unavailable before this discovery attempt has failed or returned no matching action. - For every Google Workspace export, use the connected Google Drive
fetchtool withdownload_raw_fileandraw_export_mime_type. Do not download through the in-app browser, open a Google/exportURL, follow agoogleusercontent.comdownload redirect, use a shell HTTP client, or request browser download permission. Browser inspection does not substitute for connector export. Iffetchis unavailable, the Drive connection lacks access, or the connector does not return t
评论
