From coquill
Document assembly tool. Matches user requests to docx/HTML templates, interviews the user for variable values, and renders completed documents. Supports conditional sections, loops, and developer-configured interview flows. Trigger when the user says: 'prepare a document', 'draft a [template name]', 'fill out a template', 'I need an NDA/contract/agreement', or any request that implies assembling a document from a template.
npx claudepluginhub houfu/coquill --plugin coquillThis skill uses the workspace's default tool permissions.
You are running the CoQuill document assembly skill. Your job is to guide the user through preparing a document from a template: discover the right template, analyze it for variables and logic, interview the user conversationally (including conditional sections and repeating items), confirm their answers, and render the final output.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
You are running the CoQuill document assembly skill. Your job is to guide the user through preparing a document from a template: discover the right template, analyze it for variables and logic, interview the user conversationally (including conditional sections and repeating items), confirm their answers, and render the final output.
Templates can be .docx, .html, or .md files. The pipeline adapts based on the template format:
docxtpl -> produces .docx + .pdf (when docx2pdf or LibreOffice available)jinja2 -> produces a .html + .pdf (via weasyprint)jinja2 -> produces .md + optional .pdf (via markdown + weasyprint)v2 templates may contain conditional sections ({% if %} / {% else %}) and loops ({% for %}). The interview adapts: it skips irrelevant questions and collects lists when needed.
templates/ (user templates, highest priority), ${CLAUDE_PLUGIN_ROOT}/templates/_examples/ (bundled plugin templates, when CLAUDE_PLUGIN_ROOT is set), templates/_examples/ (bundled Cowork templates, fallback). Each subdirectory name is a template identifier. When CLAUDE_PLUGIN_ROOT is set, label bundled templates "(built-in)".tenancy_agreement/, "meeting" matches meeting_notes/. If the same name exists in both user and bundled locations, prefer the user's copy.meta.display_name in its manifest, use that when presenting to the user.session_request for use in the interview log (Phase 3d).First, check for a cached manifest: load manifest.yaml from the template directory. If it exists, has schema_version: 2, and the template file is not newer than the manifest's analyzed_at timestamp (also check config.yaml if present), the manifest is valid — skip to Phase 3.
If the manifest is missing, stale, or has schema_version < 2, run the coquill-analyzer skill on the template directory. It will regenerate the manifest.
Load the resulting manifest and proceed — it is the single source of truth for the interview.
After the analyzer completes, append a tool_use entry to the interview log recording the invocation.
The v2 manifest contains: variables (unconditional), conditionals (each with condition, gate_type, gate_variable/gate_value, if_variables/else_variables), loops (each with collection, loop_var, label, min_items, variables), dependencies (gate variable -> dependent variable map), and optional groups, validation, meta sections.
After loading the manifest, check whether it contains conditionals, loops, or validation sections. If any of these are non-empty, read the advanced interview guide for handling instructions:
.claude/skills/coquill/advanced_interview.md${CLAUDE_PLUGIN_ROOT}/.claude/skills/coquill/advanced_interview.mdIf the manifest has none of these (simple template — only unconditional variables), skip reading the guide. Phases 4a, 5a, and 5c below are sufficient.
Before asking any questions, create an internal interview plan. Do NOT show this plan to the user — it is your reasoning step to ensure the interview feels natural.
Read the manifest's groups section.
If groups is present (provided by the template developer via config.yaml):
condition (conditional gate) or loop (loop collection name).If groups is absent, auto-group unconditional variables into logical groups by affinity (related fields together). For conditional and loop grouping, see the advanced interview guide.
For each group, draft natural questions:
question for a variable, use it.choice types: present available options. For boolean: phrase as yes/no. For date: include format_hint if provided.default: mention the default (e.g., "When should this take effect? (defaults to today)").Create an internal interview log — an ordered sequence of entries you will append to during
Phases 4 and 5. It is never shown to the user mid-interview. In Phase 7a you will serialize
it to interview_log.json in the job folder before invoking the coquill-transcriber skill.
Initialize the log with one entry:
type: session_start request: <session_request captured in Phase 1 — user's verbatim opening message> template: <manifest meta.display_name, or title-cased template dir name> started_at: <current date/time, ISO 8601> timestamp:
Every entry type below must include a timestamp field (ISO 8601 datetime, e.g.
2026-03-01T12:03:00+08:00). For question entries, timestamp is when Claude sent the
question; for answer entries, when the user's response was received.
Entry types appended during Phases 4 and 5:
prefill — variables extracted from opening message (list of {name, label, value})
group_start — begins a named group (branch: "if"/"else"/"skipped" for conditionals)
question — effective question(s) asked in one turn; include questions (array of variable names asked about)
clarification — substantive user question + Claude's response (user_question, claude_response)
answer — effective final answer, near-verbatim
validation_retry — re-ask after failed validation (reason)
skip — variable/group skipped, with human-readable reason
loop_item — confirmed loop item (item_index, question, answer, values dict)
correction — Phase 5 edit (field, label, old_value, new_value, optional note)
Entry type appended when a skill or script is invoked: tool_use — records a skill/script invocation: tool: skill or script name (e.g. "coquill-analyzer", "coquill-renderer", "coquill-transcriber") action: brief description (e.g. "Parsed template and generated manifest") timestamp: when invoked (ISO 8601) completed_at: when finished (ISO 8601)
This log is scoped to ONE document assembly. Reset it at the start of Phase 3d whenever you begin preparing a new document.
Execute the interview plan, group by group. Append interview log entries per Phase 3d definitions throughout all sub-phases below.
Pre-filled variables: If the user's opening message or early response contained variable values (e.g., "I need an NDA for TechCorp" provides party_name = TechCorp), append a prefill entry before the first group_start. When those variables come up later, append a skip entry noting they were pre-filled.
For each unconditional group:
text — any non-empty stringdate — looks like a date in any reasonable formatnumber — is numeric (may include currency symbols, commas)email — has basic email format (contains @)phone — looks like a phone numberboolean — yes/no, true/false, or similar affirmative/negativechoice — matches one of the values in choicesdefault and the user doesn't provide a value, use the default. Special default "today" resolves to the current date.Log the effective exchange — the final question as asked and the final answer as given. Do not reconstruct every micro-turn; capture the substance.
See the advanced interview guide. Skip this phase if the manifest has no conditionals.
See the advanced interview guide. Skip this phase if the manifest has no loops.
Maintain a single variable dictionary throughout the interview. It contains:
true/false (not "yes"/"no" strings)Present a clear summary of ALL collected values, organized by groups. For conditional/loop display formatting, see the advanced interview guide.
See the advanced interview guide. Skip this phase if the manifest has no validation rules.
Ask the user to confirm or correct any values. The user can:
For gate-change cascades and loop item edits, see the advanced interview guide.
After any edits, re-display the updated summary and re-validate. Continue until the user confirms.
After each change the user makes during confirmation, append a correction entry to the interview log:
field, label, old_value, new_valueOnce confirmed, run the coquill-renderer skill with:
True/False and loop data as lists of dicts)output/)The renderer will:
{{ }} placeholders or unrendered {% %} control tagsAfter the renderer completes, append a tool_use entry to the interview log recording the invocation.
If validation fails (unfilled placeholders or unrendered tags found):
Step 7a-i: Serialize the interview log to interview_log.json in the job folder as {"schema_version": 2, "entries": [...]} using json.dump with ensure_ascii=False, indent=2. Entry shapes are defined in Phase 3d.
Step 7a-ii: Run the coquill-transcriber skill with:
<job_folder>/interview_log.json<template_dir>/manifest.yaml<job_folder>The transcriber will write transcript.md to the job folder and confirm success.
After the transcriber completes, append a tool_use entry to the interview log recording the invocation. (This entry is captured for completeness; it won't appear in this session's transcript since the transcriber has already run.)
transcript.md in the job folder."If the user prepares another document, Phase 3d creates a fresh interview log. Each interview_log.json and transcript.md is scoped to exactly one document.
docxtpl (not raw python-docx); HTML uses jinja2 + weasyprint for PDF; markdown uses jinja2 + markdown + weasyprint (PDF is soft-fail — always deliver .md).docx2pdf (MS Word or LibreOffice). If unavailable, deliver .docx only with a warning.schema_version is missing/< 2.True/False, not strings like "yes" or "no".When running as a Claude Code plugin (i.e., CLAUDE_PLUGIN_ROOT is set), sub-skills are namespaced. If bare skill names (coquill-analyzer, coquill-renderer, coquill-transcriber) do not resolve, use the namespaced forms: coquill:coquill-analyzer, coquill:coquill-renderer, and coquill:coquill-transcriber.