# Coarse Write

> Coarse pipeline steps 14-15 — write the final review markdown to reviews/ in refine.ink format from verified cache files, then convert to PDF using PyMuPDF.

- **Type:** Skill
- **Install:** `agentstack add skill-felipe-so-coarse-ink-claude-code-coarse-write`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Felipe-SO](https://agentstack.voostack.com/s/felipe-so)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Felipe-SO](https://github.com/Felipe-SO)
- **Source:** https://github.com/Felipe-SO/coarse-ink-claude-code/tree/main/.claude/skills/coarse-write

## Install

```sh
agentstack add skill-felipe-so-coarse-ink-claude-code-coarse-write
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# /coarse-write — Write Final Review

**Usage**: `/coarse-write `

Argument (`$ARGUMENTS`) is the paper slug (e.g. `my-paper`). All paths are relative
to the workspace root `d:/Dropbox/Research/Coarse Reviewer/`.

## Path setup

- `CLASSIFICATION` = `.coarse_cache/_classification.json`
- `OVERVIEW_JSON` = `.coarse_cache/_overview.json`
- `COMMENTS_VERIFIED` = `.coarse_cache/_comments_verified.json`
- `OUTPUT` = `reviews/-review.md`
- `OUTPUT_PDF` = `reviews/-review.pdf`

**Re-read `CLASSIFICATION`, `OVERVIEW_JSON`, and `COMMENTS_VERIFIED` before writing.**

---

## Step 14 — Write Output

Write the final review to `OUTPUT` using the Write tool. Use this exact format:

```markdown
# {title}

**Date**: {today's date as MM/DD/YYYY}
**Domain**: {domain}
**Taxonomy**: {taxonomy}
**Filter**: Active comments

---

## Overall Feedback

Here are some overall reactions to the document.

{assessment paragraph if non-empty}

**{Issue 1 title}**

{Issue 1 body}

**{Issue 2 title}**

{Issue 2 body}

[... all overview issues ...]

**Recommendation**: {recommendation text}

**Key revision targets**:
1. {target 1}
2. {target 2}
[... only if recommendation is not "accept" ...]

**Status**: [Pending]

---

## Detailed Comments ({N})

### 1. {comment 1 title}

**Status**: [Pending]

**Quote**:
> {verbatim quote — prefix every line with "> " for multi-line quotes}

**Feedback**:
{feedback text}

---

### 2. {comment 2 title}
[...]
```

After writing, confirm the file exists with the Read tool and print the path.

See `reference_review.md` in the workspace root for a gold-standard example
showing the expected depth, tone, and format.

---

## Step 15 — Convert to PDF (PyMuPDF)

Run this Python one-liner to convert `OUTPUT` to `OUTPUT_PDF`:

```bash
python -c "
import fitz, markdown, pathlib, sys
sys.stdout.reconfigure(encoding='utf-8')
md = pathlib.Path('OUTPUT').read_text(encoding='utf-8')
body = markdown.markdown(md, extensions=['extra'])
html = '''
body{font-family:Georgia,serif;font-size:11pt;line-height:1.55;color:#1a1a1a}
h1{font-size:15pt;line-height:1.3;margin-bottom:6pt}
h2{font-size:13pt;margin-top:18pt;border-bottom:.5pt solid #bbb;padding-bottom:2pt}
h3{font-size:11pt;margin-top:14pt}
blockquote{border-left:2pt solid #999;margin:8pt 0;padding:2pt 10pt;color:#444;font-style:italic;background:#f8f8f8}
hr{border:none;border-top:.5pt solid #ddd;margin:16pt 0}
p{margin:6pt 0}
strong{font-weight:bold}
''' + body + ''''''
story = fitz.Story(html=html)
writer = fitz.DocumentWriter('OUTPUT_PDF')
mediabox = fitz.paper_rect('a4')
where = mediabox + (40, 50, -40, -50)
more = 1
while more:
    dev = writer.begin_page(mediabox)
    more, _ = story.place(where)
    story.draw(dev)
    writer.end_page()
writer.close()
print('PDF written: OUTPUT_PDF')
"
```

Replace `OUTPUT` and `OUTPUT_PDF` with the actual paths before running.

Requires: `markdown` and `PyMuPDF` (both are project dependencies — install once with
`uv pip install markdown pymupdf`).

If PyMuPDF is unavailable, fall back to Chrome headless:
```bash
"C:/Program Files/Google/Chrome/Application/chrome.exe" \
  --headless --disable-gpu --print-to-pdf-no-header \
  --print-to-pdf="OUTPUT_PDF" "OUTPUT_HTML"
```
(requires first converting OUTPUT to HTML with the `markdown` package)

---

Done. Report the path to both `OUTPUT` and `OUTPUT_PDF`.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Felipe-SO](https://github.com/Felipe-SO)
- **Source:** [Felipe-SO/coarse-ink-claude-code](https://github.com/Felipe-SO/coarse-ink-claude-code)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** yes
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-felipe-so-coarse-ink-claude-code-coarse-write
- Seller: https://agentstack.voostack.com/s/felipe-so
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
