| name | polish-study-post |
| description | Format and create Rust study blog posts from raw memo text. Use this skill when the user pastes raw study notes, asks to format a study post, mentions "ๅๅผท" post formatting, or wants to create a new blog post from their study memo. Also triggers when the user provides a file path to an existing study post that needs polishing. |
Polish Study Post
Transform raw study memos into well-structured blog posts, or polish existing study posts.
Absolute Rule: Never Modify Original Text
The original text must NEVER be changed, reworded, or rephrased. Only markdown formatting may be added around the original text. Markdown syntax (`, >, -, #, etc.) may be added, but the words themselves must remain exactly as the author wrote them.
Handling textlint suggestions
- Template headings (
## ใฏใใใซ, etc.): Keep as-is. Ignore textlint suggestions on these
- Author's original text: Do not auto-fix. Present textlint suggestions to the user as recommendations and let them decide whether to apply each change
Workflow
Mode A: Raw memo โ New post (primary)
The user pastes raw study notes directly in the conversation or provides a raw text file.
- Read the raw memo text
- Ask the user for the post title (e.g., "Rustใฎๅๅผท[unsafe ใใฎ1]") โ suggest one based on the content
- Apply formatting rules to the memo content
- Show the formatted content to the user for review
- After approval, create the post file using the CLI:
bun run new-post -- rust "<title>"
This creates app/posts/YYYY-MM-DD_N.md with correct frontmatter (title, createdAt, category, tags) automatically. The template name corresponds to a file in scripts/templates/ (e.g., rust, gijutsu, shumi, sonota).
- Replace the body of the created file (everything after the frontmatter
---) with the formatted content
Mode B: Polish existing file
The user provides a path to an existing post file.
- Read the file
- Apply formatting rules
- Show the diff for review
- After approval, write back
Section Structure
Place content into these fixed sections based on the content flow:
## ใฏใใใซ
<!-- Study reference link + "ใ่ชญใใงใใ" -->
## ใๅๅผท
<!-- Today's study URL, session comments (mood, time, what to study today) -->
### ใกใข
<!-- Main body: notes, code, quotes, reactions -->
## ใพใจใ
<!-- Key takeaways, reflections, next study URL -->
Rules:
- If the author wrote "ใพใจใ" as plain text, convert it to
## ใพใจใ
#### subsections under ### ใกใข are author-driven; do not create them
- The first URL in the memo (the overall study reference like
doc.rust-jp.rs/book-ja/) goes in ## ใฏใใใซ
- A more specific URL (with anchors/subsections) that appears before the main notes goes in
## ใๅๅผท
- A URL at the end (after "ใพใจใ" / "ๆฌกใใ" / "ใคใใใ") goes in
## ใพใจใ
Content Classification
The raw memo is a stream of text mixing the author's thoughts with material from the study source. The core challenge is distinguishing between them. Use these heuristics:
Author comments โ - list items
The author's own thoughts, reactions, observations. Characteristics:
- Casual, first-person tone ("ใชใใปใฉ", "ใใ", "ใปใใจใใ", "็่งฃ", "ใใๅคงไบใใ")
- Short reactions or opinions
- Questions or doubts ("ใใฃใฆๅบใฆใใใใ ใฃใ", "่จๆถใญใ")
- Judgments about the material ("ไพฟๅฉใใ", "ใใใชใใปใใใใใใ", "ใฏใฝใณใผใใใช")
- Comments about their own state ("ไฝใใใฉใใชใผ", "ใคใใๅ
จ็ถ้ ญใๅใใชใ")
- ใชใใปใฉใชใ`&`ใงใใ
- ๅ
ๅใใใใฆใ
Follow-up thoughts โ - nested list items (2-space indent)
When a comment elaborates on or directly follows up the previous comment:
- ใใใใ
- ใใผ่คๆฐใฎๆๆๆจฉใใใฆใใใฃใฆ่ฉฑ
- ็็ธใฏ่ฌ
Pattern: if the raw text has a short comment followed immediately by related sub-thoughts (often with indentation or on the next line), nest them.
Study material quotes โ > block quotes
Text from the book, documentation, or reference material. Characteristics:
- Formal, explanatory tone โ reads like documentation or textbook prose
- Long sentences with technical explanations
- Often contains phrases like "ใใใจใงใ", "ใใใ ใใ", "ใใงใใใ", "ใใพใใ"
- Descriptions of how something works, rather than reactions to it
- Lists of concepts from the source (e.g., enumerated capabilities of a feature)
> `unsafe`ใฏใๅ็จใใงใใซใผใไปใฎRustใฎๅฎๅ
จๆงใใงใใฏใ็กๅนใซใใชใใใจใ็่งฃใใใฎใฏ้่ฆใชใใจใงใ
Indented lists from the source material (like feature enumerations) also become block quotes:
> ็ใใคใณใฟใๅ็
งๅคใใใใใจ
> `unsafe`ใช้ขๆฐใใกใฝใใใๅผใถใใจ
> ๅฏๅคใง้็ใชๅคๆฐใซใขใฏใปในใใใๅคๆดใใใใจ
> `unsafe`ใชใใฌใคใใๅฎ่ฃ
ใใใใจ
When uncertain
If a line could be either, look at the surrounding context:
- Does it follow a block quote and react to it? โ author comment
- Does it explain a concept in textbook-like language? โ block quote
- Still ambiguous? โ leave as-is and ask the user about the specific lines
Code Formatting
Code blocks
Raw memos contain Rust code without fences. Detect code by looking for:
let, fn, match, struct, enum, impl, use, mod, pub, trait
- Rust syntax patterns:
=>, ::, println!, vec![], type annotations
- Multiple consecutive lines that form a coherent code block
Wrap in fenced code blocks:
```rust
let robot_name = Some(String::from("Bors"));
```
- Terminal/error output uses ```bash` language identifier
- Preserve code indentation as-is
- Fix markdown escapes inside code fences (e.g.,
\* โ *)
Inline code
Wrap technical terms in backticks: Rust keywords, types, macros, functions, operators.
Examples: Rc<T>, RefCell<T>, mut, panic!, move, unsafe, Box<T>, ref, ref mut, Some, None, &
Apply inline code in both author comments and block quotes.
General Formatting
URLs
- Bare URLs โ wrap in angle brackets:
<https://example.com>
- URLs must be on their own line (for OGP card rendering). Do not place URLs on the same line as other text
- Fix broken link syntax
Block quotes
- Space after
>: > text
- Multi-line quotes:
> on each line including blank lines
Lists
- Use
- with single space: - item
- Nested: 2-space indent per level
- Blank lines before and after list blocks
Headings
- Space after
#
- Blank line before and after headings
Cleanup
- Remove trailing whitespace
- File ends with single newline
- Normalize multiple blank lines to one
- Preserve frontmatter as-is