本文へ移動
cccskills
無料GitHub で公開

quarto

Formatting, structure, and execution rules for Quarto markdown documents. Trigger when: - Writing, editing, or rendering Quarto documents, reports, presentations, or websites. - Files matching the pattern **/*.qmd are in the workspace or referenced. - Tasks involve: quarto render, quarto preview, knitr, jupyter. - Prompt contains keywords: quarto, qmd, yaml header, code chunk, callout, cross-reference.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md12.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Quarto (.qmd) Authoring Rules

Quarto is a superset of Pandoc Markdown. It prioritizes semantic structure over visual formatting.

Golden Rule: Never use raw HTML tags (<div>, <img>, <br>) unless absolutely necessary. Use Pandoc Fenced Divs and Spans.

Official Documentation: quarto.org/docs is the authoritative reference. Consult it for edge cases, advanced features, or when this skill lacks specifics.


1. Block Structure (Fenced Divs)

Quarto uses Fenced Divs (:::) to define layout, callouts, and structural blocks. More colons (:::::) enable nesting.

Callouts (Alerts)

Convert standard Markdown blockquotes (>) into semantic callouts.

TypeSyntaxUse Case
Note::: {.callout-note}Non-critical info
Tip::: {.callout-tip}Best practices/optimizations
Important::: {.callout-important}Key constraints
Warning::: {.callout-warning}Failure modes
Caution::: {.callout-caution}Data loss risks

Features:

  • Title: Use a ## heading inside, or the title="..." attribute.
  • Collapse: Add collapse="true" for expandable callouts (collapsed by default).
  • Appearance: appearance="simple" or appearance="minimal" for alternate styles.
  • Icons: icon=false to suppress the default icon.
::: {.callout-caution collapse="true" appearance="simple"}

## Warning Title

Collapsible content.
:::

Multi-Column Layouts

Do not use HTML tables or CSS grids for layout. Use Quarto layout divs.

:::: {.columns}

::: {.column width="40%"}
Left content (e.g., text)
:::

::: {.column width="60%"}
Right content (e.g., image or code)
:::

::::

Tabsets

Group content into switchable tabs using the .panel-tabset class.

::: {.panel-tabset}

## Python

Python code here...

## R

R code here...

:::

Layout Classes

Control content width using column classes:

ClassWidth
.column-bodyDefault text column
.column-pageExtends into page margins
.column-screenFull viewport width
.column-marginRight margin (for notes, asides)
::: {.column-margin}
This appears in the margin.
:::

::: {.column-page}
![Wide figure](wide.png)
:::

2. Cross-Referencing (Strict)

Quarto requires specific ID prefixes for automatic numbering. Do not manually number sections, figures, or tables.

The Prefix Rule

You MUST use these prefixes in curly braces {#...} to enable referencing:

ElementPrefixExample IDReference Syntax
Figuresfig-{#fig-arch}@fig-arch
Tablestbl-{#tbl-stats}@tbl-stats
Sectionssec-{#sec-deploy}@sec-deploy
Equationseq-{#eq-perf}@eq-perf
Listingslst-{#lst-main}@lst-main
Theoremsthm-{#thm-main}@thm-main
Lemmaslem-{#lem-helper}@lem-helper
Corollariescor-{#cor-result}@cor-result
Propositionsprp-{#prp-claim}@prp-claim
Conjecturescnj-{#cnj-open}@cnj-open
Definitionsdef-{#def-term}@def-term
Examplesexm-{#exm-basic}@exm-basic
Exercisesexr-{#exr-prob1}@exr-prob1
Solutionssol-{#sol-ans}@sol-ans
Algorithmsalg-{#alg-sort}@alg-sort

LaTeX Warning: Avoid underscores (_) in IDs. They cause issues when rendering to PDF.

Reserved Prefixes (full list): fig, tbl, lst, tip, nte, wrn, imp, cau, thm, lem, cor, prp, cnj, def, exm, exr, sol, rem, alg, eq, sec

Wrong: See [Figure 1](#figure-1) Right: See @fig-arch

Figure Syntax

Images require an ID and a caption (the alt text) to be treated as a Figure.

![System Architecture Diagram](images/arch.png){#fig-arch}

Subfigures use a parent div with layout-ncol:

::: {#fig-panels layout-ncol=2}

![First](a.png){#fig-first}

![Second](b.png){#fig-second}

Panel caption here.
:::

Table Syntax

Tables must have a caption definition (: ...) and an ID to be referenceable.

| Component | Status |
| :-------- | :----- |
| API       | Stable |

: System Status {#tbl-status}

Column Widths: Use tbl-colwidths to control proportions:

: Caption {#tbl-id tbl-colwidths="[60,40]"}

Grid Tables

For complex cells (lists, code blocks, multiple paragraphs), use grid tables:

+---------------+---------------+
| Fruit | Advantages |
+===============+===============+
| Bananas | - Portable |
| | - Bright |
+---------------+---------------+
| Oranges | - Vitamin C |
| | - Tasty |
+---------------+---------------+

: Grid table with lists {#tbl-grid}

3. Code Blocks & Execution

Distinguish between Display Code and Executable Code.

Display Only (Standard Markdown)

Use standard triple backticks for static snippets.

```rust
fn main() { ... }
```

Executable Code (Computation)

Use curly braces {python} to indicate the engine should execute the block. Use hash-pipes #| for options.

```{python}
#| label: fig-plot
#| fig-cap: "Performance metrics"
#| echo: false

import matplotlib.pyplot as plt
plt.plot([1,2,3])
```

Execution Options

Options can be set globally (in YAML execute: block) or per-cell (with #|).

OptionValuesEffect
evaltrue, falseWhether to run the code
echotrue, false, fencedShow source code in output
outputtrue, false, asisShow/suppress output; asis = raw markdown
warningtrue, falseShow/hide warnings
errortrue, falseAllow errors (true continues on error)
includetrue, falseInclude cell in output at all
code-foldtrue, false, showCollapsible source code

4. Diagrams (Mermaid)

Do not use images for diagrams if they can be defined as code. Quarto renders Mermaid natively.

```{mermaid}
%%| label: fig-flow
%%| fig-cap: "Authentication Flow"

sequenceDiagram
    User->>API: Request
    API-->>User: Response
```

5. Metadata & Configuration (YAML)

Document Header

Every .qmd file should start with YAML frontmatter.

---
title: "Technical Specification"
author: "Engineering Team"
date: last-modified
format:
  html:
    toc: true
    number-sections: true
    code-fold: true
    theme: cosmo
  pdf:
    toc: true
    number-sections: true
---

Global Execution Options

execute:
  echo: true # Show code by default
  warning: false # Hide warnings
  freeze: auto # Only re-execute changed documents

Project Configuration (_quarto.yml)

For multi-document projects (books, websites):

project:
  type: book # or: website, manuscript, default

book:
  title: "My Book"
  chapters:
    - index.qmd
    - intro.qmd
    - part: "Main Content"
      chapters:
        - chapter1.qmd
        - chapter2.qmd

6. Shortcodes (Special Features)

Use Quarto shortcodes {{< ... >}} for special elements.

ShortcodePurpose
{{< pagebreak >}}Force a page break (PDF/Docx)
{{< include _file.qmd >}}Embed another file (partial)
{{< embed notebook.ipynb#cell >}}Embed output from another notebook/qmd
{{< video src >}}Embed video players
{{< var version >}}Insert variable from _variables.yml
{{< meta title >}}Insert value from document metadata
{{< env VAR_NAME >}}Insert environment variable

Include/Embed Rules:

  • Shortcodes must appear on their own line, surrounded by blank lines.
  • Use absolute paths from project root for reliability.

7. Citations & Bibliography

Quarto uses Pandoc citation syntax with a bibliography file.

YAML Setup:

---
bibliography: references.bib
csl: apa.csl # Optional: citation style
---

Citation Syntax:

SyntaxRenders As
[@smith2023](Smith 2023)
@smith2023Smith (2023) inline
[@smith2023, p. 42](Smith 2023, p. 42)
[-@smith2023](2023) — suppress author
[@a; @b]Multiple citations

8. Raw Format Blocks

Embed format-specific content (ignored in other formats):

```{=latex}
\begin{center}
LaTeX-only content
\end{center}
```
```{=html}
<details><summary>HTML-only</summary>Content</details>
```

Inline: Use `\LaTeX`{=latex} for inline raw content.


9. Inline Spans

Apply attributes to inline text using [text]{.class #id key="value"}.

This is [important text]{.highlight} with inline styling.

Anti-Patterns

Anti-PatternDescriptionRemedy
Raw HTML<div class="alert">Use ::: {.callout-note}
Hardcoded Numbers"As seen in Figure 3"Use "As seen in @fig-xyz"
Manual TOCWriting out a list of linksUse toc: true in YAML
Remote ImagesHotlinking imagesDownload to /images or use repo-relative paths
Empty LinesUsing <br> for spacingUse CSS classes or margin attributes
Underscores in IDs{#my_figure_1}Use hyphens: {#my-figure-1}

Migration Checklist (Markdown → Quarto)

  1. Header: Add YAML frontmatter with title, format, and toc.
  2. Alerts: Regex replace > **Note:** with ::: {.callout-note} blocks.
  3. Images: Add {#fig-name} to all image links that need captions.
  4. Links: Convert local section links [Link](#heading) to @sec-heading.
  5. Diagrams: Convert static diagram images to mermaid blocks where possible.
  6. IDs: Replace underscores with hyphens in all identifiers.
  7. Tabsets: Convert manual tab implementations to ::: {.panel-tabset}.
  8. Citations: Convert manual citations to [@key] with a .bib file.
  9. Project: For multi-file docs, create _quarto.yml to define structure.

Output Formats

Quarto supports multiple output formats via the format: key:

FormatValueNotes
HTMLhtmlDefault, interactive
PDFpdfRequires LaTeX
WorddocxMS Word
PresentationrevealjsSlides via Reveal.js
BookbookMulti-chapter (in _quarto.yml)
TypsttypstModern PDF alternative
format:
  html: default
  pdf:
    documentclass: article
  revealjs:
    theme: dark

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

ai-audit

無料

SOP for auditing AI-generated code. Trigger when: - Reviewing, refactoring, or cleaning up AI-generated code to prevent regressions or hallucinated APIs. - Prompt contains: /ai-audit, code audit, AI cleanup, common flaws.

日本語の概要は準備中です。原文の説明を表示しています。

nrdxp/predicate102026年9月1日 更新

api-audit

無料

Protocol for auditing API surface coherence and type safety. Trigger when: - Evaluating API designs, interface type safety, or design elegance. - Prompt contains: /api-audit, API surface, API coherence, type safety.

日本語の概要は準備中です。原文の説明を表示しています。

nrdxp/predicate102026年9月1日 更新

boundary

無料

Normative sufficiency conditions for Initial Boundary Conditions (IBCs) and the SOP for the cheap-tier boundary refinement loop (/boundary). Trigger when: - Crafting, auditing, or refining a prompt/IBC destined for an expensive (architect-class) model or an autonomous worker dispatch. - Evaluating whether a task frame is sufficient to bound an agent walk. - Prompt contains: /boundary, IBC, initial boundary condition, boundary contract, sufficiency conditions, worker prompt, prompt refinement.

日本語の概要は準備中です。原文の説明を表示しています。

nrdxp/predicate102026年9月1日 更新

campaign

無料

SOP for the architect-tier campaign workflow (/campaign): exhaustive survey, mitigation planning, tiered orchestration, and reconciliation. Trigger when: - Running a multi-workstream initiative where an expensive architect-tier council surveys, plans, emits worker prompts, and judges landed work. - Conducting production-readiness assessments that fan out into autonomous mitigation dispatches across model tiers. - Prompt contains: /campaign, campaign workflow, survey, orchestrate, reconcile, premise freshness, tier routing, worker IBC, scratch.

日本語の概要は準備中です。原文の説明を表示しています。

nrdxp/predicate102026年9月1日 更新

chronicle

無料

Maintain and update the persistent project chronicle (docs/chronicle.md). Trigger when: - The human requests a history summary or chronicle update. - Starting work on a new codebase and needing context on its evolution. - Prompt contains keywords: /chronicle, chronicle, project history, git log summary, history summary.

日本語の概要は準備中です。原文の説明を表示しています。

nrdxp/predicate102026年9月1日 更新

Rules, conventions, and constraints for formatting git commit messages and committing at logical boundaries. Trigger when: - Drafting, revising, or validating git commit messages. - Pausing at commit boundaries under the CORE or CONTINUE workflows. - Evaluating whether a changeset should be split into multiple commits. - Prompt contains keywords: commit message, git commit, conventional commits, commit hygiene, commit guidelines, logical boundary, spaghetti diff, atomic commit, commit boundary.

日本語の概要は準備中です。原文の説明を表示しています。

nrdxp/predicate102026年9月1日 更新

nrdxp のスキルをすべて見る

このスキルの問題を報告する