Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Pick And Paste?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ps-honda-pick-and-paste)
---
name: pick-and-paste
description: Pick-and-paste (pap) creates an offline decision form with English or Thai controls, local drafts, Markdown copy, and JSON import and export.
metadata:
tags: [questions, decisions, html, form, diagrams]
---
# Pick and paste (pap)
Use this skill when a person needs to answer questions or confirm decisions in a portable HTML page. Start from the template and author only the data block. The inline vanilla JavaScript renders every answer control, progress count, local draft and export action. No CDN, backend or build step is used.
Choose optional views by the question the reader needs to answer. Use a flow or before/after figure for changes in steps, option text for tradeoffs, and a comparison matrix when common rows and columns clarify the differences. Use audience-specific titles and labels. Short briefings and simple comparisons can stay in chat or Markdown.
Files:
- [templates/pick-and-paste.html](templates/pick-and-paste.html): copy as the page and edit only `meta` and `pack`.
- [examples/demo-pack.html](examples/demo-pack.html): realistic Thai decision page exercising every control.
- [examples/README.md](examples/README.md): compact schema guide with a sample for every input type.
- [references/mermaid-svg.md](references/mermaid-svg.md): offline Mermaid-to-SVG guidance for diagrams that need more than flow/compare.
## Workflow
1. Copy the template to the output as `index.html`.
2. Edit the one `<script type="application/json" id="pack">` block. Do not hand-write controls or edit the renderer.
3. Give the page a stable `meta.pageId` and `meta.revision`. Bump the revision when a question's meaning changes. Set `meta.locale` to `th` for Thai controls or `en` for English. English is the default. Write the questions in the reader's language.
4. For each decision, explain the situation and why it matters, compare real options, state consequences, and give a recommendation with a one-line self-critique. Use `story`, option `pros`/`cons`/`consequence`, `recommendation`, diagrams and collapsed `evidence`.
5. Preview at desktop and 390px width. Confirm each configured control renders, conditional questions appear only when triggered, the required counter updates, and `#data-error` stays hidden.
6. Publish and link: if `report_publish_dir` and `report_base_url` are configured in `persona.toml`, copy the rendered HTML there and always return the clickable URL (or local file path when unconfigured) in the reply.
## Overview-only mode
Use a read-only overview page (for briefings, architecture summaries, or DDD maps) by setting `sections: []` and `items: []` while populating `pack.comparisonMatrix`, `meta.decided`, and `meta.informed`.
## One-shot authorization
When decisions trigger implementation, include a final question letting the owner pick the post-submit Run Mode (e.g., `Lock SPEC only` vs `Run-to-Merge-Gate`) so execution can proceed without extra round-trips.
## Pack shape
`meta` requires `pageId`, `revision`, and `title`. Optional fields include `locale`, `eyebrow`, `lead`, `basis`, `docTypes`, `recipient`, and `map: true`. `sections` is an array of `{id,title,intro,audience?}`. `items` holds the questions.
```js
{
id: "stable-kebab-id", section: "A", title: "หัวข้อการตัดสินใจ",
story: ["บริบทและตัวอย่าง", "เหตุผลที่คำตอบนี้มีผลต่อเวลา ต้นทุน หรือความเสี่ยง"],
ask: "คำถามที่ต้องตอบ", use: "จะนำคำตอบไปทำอะไรต่อ",
required: true, // defaults to true; set false for an optional question
note: {label: "หมายเหตุเพิ่มเติม", required: false}, // default note is optional; false hides it
input: {type: "single", required: true, options: [
{value: "a", label: "ทางเลือก A", pros: "ข้อดี", cons: "ข้อจำกัด", consequence: "ผลที่จะตามมา"},
{value: "b", label: "ทางเลือก B", pros: "ข้อดี", cons: "ข้อจำกัด", consequence: "ผลที่จะตามมา"}
]},
recommendation: {
answer: "a", label: "เลือกทางเลือก A", reason: "ตรงกับเป้าหมายหลัก",
selfCritique: "ข้อจำกัดคืออาจต้องใช้เวลาติดตามผลเพิ่ม"
},
figure: {type: "compare", before: {steps: ["ขั้นตอนเดิม", "รออนุมัติ"]}, after: {steps: ["ขั้นตอนใหม่", "เริ่มงาน"], changed: [1]}, caption: "ผลของการเลือก"},
evidence: ["ที่มาหรือหลักฐานที่ผู้อ่านเปิดดูได้"]
}
```
Every item needs an `input` and can have an optional note, recommendation, follow-up, figure and collapsed evidence. `required` defaults to true. A follow-up is a short or long text question shown only when its `when` answer is selected. Option prose may include `detail`, `pros`, `cons`, and `consequence`.
| `input.type` | Data fields | Example |
|---|---|---|
| `single` | `options[]` with `value,label` | `{type:"single",options:[{value:"a",label:"A"},{value:"b",label:"B"}]}` |
| `multiple` | `options[]`, optional `min,max` | `{type:"multiple",min:1,max:2,options:[{value:"mail",label:"อีเมล"},{value:"chat",label:"แชต"}]}` |
| `choice-other` | `options[]`, `other:{label,required?,placeholder?}` | `{type:"choice-other",options:[{value:"onsite",label:"อบรมที่สาขา"}],other:{label:"ระบุรูปแบบอื่น",required:true}}` |
| `text-short` | `placeholder?`, `maxLength?` | `{type:"text-short",placeholder:"ชื่อผู้รับผิดชอบ",maxLength:120}` |
| `text-long` | `placeholder?`, `maxLength?` | `{type:"text-long",placeholder:"อธิบายเงื่อนไข",maxLength:2000}` |
| `yes-no-depends` | optional `labels`; use `followUps` for depends | `{type:"yes-no-depends",followUps:[{id:"why",when:"depends",type:"text-long",label:"ขึ้นอยู่กับเงื่อนไขใด"}]}` |
| `number` | optional `min,max,step` | `{type:"number",min:1,max:50,step:1}` |
| `scale` | `min,max`, optional `step,labels` | `{type:"scale",min:1,max:5,labels:{"1":"ต่ำ","5":"สูง"}}` |
| `date` | optional ISO `min,max` | `{type:"date",min:"2027-01-01",max:"2027-12-31"}` |
| `ordering` | `options[]`; reorder with up/down buttons | `{type:"ordering",options:[{value:"cost",label:"ต้นทุน"},{value:"time",label:"เวลา"}]}` |
| `matrix` | `rows[]`, `options[]`, optional `rowNote,rowHead` | `{type:"matrix",rows:[{id:"branch-a",label:"สาขา A"}],options:[{value:"approve",label:"อนุมัติ"},{value:"change",label:"แก้ไข"},{value:"reject",label:"ไม่อนุมัติ"}],rowNote:true}` |
For conditional follow-ups use `input.followUps: [{id,when,label,type,required?,placeholder?}]`; `type` is `text-short` or `text-long`. For a choice-plus-other question, select the built-in `__other__` option and enter its text. A matrix stores each row's choice and optional row note. A question's own note is separate from its main answer.
Recommendations are one-click fill actions. Their `answer` uses the type's normal value: a string for single choice/text/date/number/scale, an array for multiple choice, an object mapping item IDs to rank numbers for ordering, and `{rows:{rowId:{value,note}}}` for a matrix. For choice-other, use `{value:"__other__",other:"ข้อความ"}`; use an answer record with `value` and `followUps` when a recommendation activates a required follow-up. A recommendation needs a visible label, reason, and one-line `selfCritique`.
Recommendations show their label and a short action button. The reader can expand the label to see the reason and critique. Supply page-specific wording in the pack's titles, questions, option labels, and priority labels. Use optional `meta.labels` to override visible page controls and accessibility labels by their English template keys, including `Priority`, `Column`, `All priorities`, `All columns`, `No matching rows.`, `Recommendation`, `Use recommendation`, `Review the recommendation`, and `Copy answers (Markdown)`. Values are plain text. Missing or blank overrides use the default from `meta.locale`.
Legacy `options[]` and `rows[] + rowChoices[]` data are still read as single choice and matrix. New pages should use `input` so the answer type is explicit.
## Comparison matrix
Use optional `pack.comparisonMatrix` when the reader needs to scan how findings or decisions apply across repos, systems, or options before answering. Keep each cell label short. Put its evidence or reasoning in `detail`, which readers can expand in place. Set `question` to the ID of a related item to link the row to its answer controls.
Define `title`, `rowLabel`, `columns` and `priorities` (each a list of `{id, label}`), and `rows`. List priorities from highest to lowest. Each row needs `label`, a `priority` ID, and `cells` keyed by column ID with `{label, detail?}` values. Add an optional `priorityReason` describing the user or delivery impact. Omit cells for unaffected columns. The matrix sorts rows by priority, preserves pack order within each level, and lets readers filter by priority or column. See [the example](examples/README.md#comparison-matrix).
Keep answer choices in `items`. Use `input.type: "matrix"` for questions that need one answer per row. For a read-only matrix, set both `sections` and `items` to empty arrays. Comparison matrix filters and expanded details stay on the page while answers use the existing Markdown and JSON formats.
## Diagrams and evidence
- `figure: {type:"flow",steps:[...],focus:0,changed:[1],caption?}` draws the `.flow` boxes.
- `figure: {type:"compare",before:{title?,steps,changed?},after:{title?,steps,changed?},caption?}` draws the `.compare` before/after view.
- `figure: {type:"svg",svg:"<svg…>",caption?}` embeds a sanitized SVG as an offline image so the figure's styles stay inside the figure.
- `evidence[]` renders in a collapsed `details` block. Keep the main decision explanation visible without opening it.
## Answers, drafts and privacy
The draft label follows the selected language. Drafts use localStorage keyed by page ID and revision. If storage is unavailable, answers stay in memory until the page closes or reloads.
Copy answers produces Markdown through `legacyCopy()` (a hidden textarea and `execCommand("copy")`) on plain-HTTP LAN pages where `navigator.clipboard` is unavailable. After the plain-HTTP copy attempt, a visible textarea contains the selected Markdown so the reader can copy manually if pasting fails. The same fallback appears if copying fails.
Download and Import use JSON with page ID, revision, question IDs, question text and structured answers. Import rejects a page ID or revision mismatch without changing current answers. It skips and reports records with changed question text or unknown IDs. A copied or downloaded answer remains a local draft until the person shares it; this page never claims it was sent or that an external tracker changed.
## Theme and layout
The template uses a light paper palette (cream, maroon and teal) with a local Sarabun/Noto Sans Thai font stack. It is self-contained and has no CDN. At 390px, cards and controls wrap; only the matrix table wrapper scrolls horizontally. Append `?selftest=1` to click every recommendation and log its completion result in the console; this changes the local draft. Use diagrams to explain a process before and after the choice, not as decoration.