AgentStack
SKILL verified MIT Self-run

Reflection2xhs

skill-phanghonghao-thu-awesome-skills-reflection2xhs · by phanghonghao

Convert a local reflection markdown file, especially `reflection.md` or `*_reflection.MD`, into a polished single-page study-note-style A4 poster workflow. Use when the user wants to turn personal paper reflections, study notes, or structured markdown summaries into a shareable visual poster. This skill is Markdown-first and defaults to using the built-in image generation capability after local p…

No reviews yet
0 installs
14 views
0.0% view→install

Install

$ agentstack add skill-phanghonghao-thu-awesome-skills-reflection2xhs

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Reflection2xhs? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Reflection2XHS

Overview

Use this skill when the user wants to turn a local reflection markdown file into a one-page study-note-style poster image. Prefer Markdown over PDF because this workflow depends on semantic structure rather than fixed page layout.

Workflow

  1. Read the local reflection markdown file.
  2. Extract:
  • title
  • subtitle / topic line
  • 3 to 6 key takeaways
  • technical highlights
  • one bottom-line summary sentence
  1. Build a stable poster prompt for image generation.
  2. Generate the poster image with the built-in image generation capability by default.
  3. Only use the local OpenAI image API path as an explicit fallback if the user asks for script-only generation and provides their own OPENAI_API_KEY.
  4. Save:
  • extracted summary json
  • prompt text
  • generated image in the source file's sibling *_xhs folder

Script

Use [scripts/reflectiontoxhs.py](scripts/reflectiontoxhs.py).

Preview prompt only:

python "C:\Users\20174\.codex\skills\reflection2xhs\scripts\reflection_to_xhs.py" --input "D:\Desktop_Files\World_Model\papers\20_locomotion\AMP\AMP_reflection.MD"

Generate prompt locally, then use built-in image generation:

python "C:\Users\20174\.codex\skills\reflection2xhs\scripts\reflection_to_xhs.py" --input "D:\Desktop_Files\World_Model\papers\20_locomotion\AMP\AMP_reflection.MD"

The generated prompt.txt is then used by the assistant's built-in image generation flow.

When the assistant uses built-in image generation, it should still place the final poster image into the same local output folder as the extracted artifacts, typically:

  • _xhs/summary.json
  • _xhs/prompt.txt
  • _xhs/poster.png

If needed, the local script can also finalize this step by copying the most recent Codex-generated PNG into the output folder:

python "C:\Users\20174\.codex\skills\reflection2xhs\scripts\reflection_to_xhs.py" --input "D:\Desktop_Files\World_Model\papers\20_locomotion\AMP\AMP_reflection.MD" --copy-latest-codex-image

Script-only image generation fallback:

$env:OPENAI_API_KEY="your_api_key"
python "C:\Users\20174\.codex\skills\reflection2xhs\scripts\reflection_to_xhs.py" --input "D:\Desktop_Files\World_Model\papers\20_locomotion\AMP\AMP_reflection.MD" --generate

Notes

  • Prefer the built-in image generation capability after Markdown extraction.
  • Use the user's own OPENAI_API_KEY only for the script-only fallback path.
  • Default model is gpt-image-1.
  • Prefer Markdown over PDF. Use PDF only as fallback when Markdown is unavailable.
  • Final image output should not remain only under the Codex generated-images cache; copy it into the source markdown's local *_xhs output folder.
  • This skill generates a poster prompt and image workflow. It does not preserve the original page layout pixel-for-pixel.

HTML Poster Layout Rules

When generating HTML posters (preferred over AI image generation for text-heavy content):

  1. Content-driven sizing: Do NOT hardcode A4 height (height: 297mm). Use width: 210mm only; let height be determined by actual content. No height: 100% on page container.
  2. No forced flex stretch: Do NOT use flex: 1 or justify-content: center on section cards — this creates uncomfortable empty interiors. Cards should be content-determined.
  3. Line-spacing fill: Use generous line-height (1.7–1.85) to distribute content evenly. Line-height has an upper limit — never exceed 1.85 just to fill space.
  4. Two-column grid: Use display: grid; grid-template-columns: 1fr 1fr for the body. Avoid align-items: stretch if it forces card height beyond content.
  5. No bottom gap: Bottom section should have margin-top: 0 to avoid dead space between content and footer.
  6. No brand keywords in image prompts: Never use "Xiaohongshu" or similar brand names in AI image generation prompts to avoid unwanted watermarks/logos.
  7. Section extraction: Support both ## N. title (markdown headers) and N. title (plain numbered) section formats.
  8. Natural rhythm: Padding, font sizes, and spacing should create a comfortable reading rhythm. Don't force elements to fill space that content doesn't naturally occupy.

Source & license

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

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

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.