AgentSkillsCN

from-things

利用 i-did-a-thing 证据日志创作博客文章——将您的成功转化为精彩故事。

SKILL.md
--- frontmatter
name: from-things
description: "Create a blog post from i-did-a-thing evidence logs — turn your wins into stories"
disable-model-invocation: true
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, WebSearch, WebFetch
argument-hint: "[log filename or search query]"

Create Post from Things

Source a blog post from one or more i-did-a-thing evidence logs. Each log already contains a Blog Seed, narrative structure, and potential angles — this skill transforms them into engaging posts.

Steps

1. Load Configuration

Read .claude/mark-my-words.local.md for blog settings. If missing:

No configuration found. Please run /mark-my-words:setup first to configure your blog settings.

Then stop.

Load Voice Profile

If the config has a default_voice set (not null), read the voice profile from .claude/voices/<default_voice>.md. If the file doesn't exist, warn the user that their default voice profile is missing and continue without a voice.

Also check if any voice profiles exist in .claude/voices/ using Glob. Store this for the interview step.

Resolve Media Directory

If the config has media_dir set (not null), resolve the full media path as <content_root>/<media_dir> and ensure the directory exists (mkdir -p). Store this path for use in visual planning and post generation.

Read .claude/i-did-a-thing.local.md to find the things directory. If missing:

No i-did-a-thing configuration found. Please run /i-did-a-thing:setup first to set up your accomplishment tracking.

Then stop.

2. Resolve Content Location

  • If source_type: remote: Check if the repo is already cloned locally. Look for a working directory at .mark-my-words-workdir/ relative to the project root. If not cloned, clone it:

    code
    git clone --branch <repo_branch> <repo_url> .mark-my-words-workdir
    

    If already cloned, pull latest changes. The content root is .mark-my-words-workdir/<content_dir>/.

  • If source_type: local: The content root is <local_path>/<content_dir>/.

3. Select Logs

If the user provided a filename or search query as an argument, find matching logs in <things_path>/logs/. Otherwise, present options:

Use AskUserQuestion:

What do you want to write about?

  • Browse recent logs (last 10)
  • Search by tag or skill
  • Find entries marked high blog potential
  • Combine multiple logs into one post

If "Browse recent":

List the 10 most recent logs from <things_path>/logs/ showing title, date, impact, and blog_potential from frontmatter. Let the user select one.

If "Search":

Ask for search criteria (tag, skill, or keyword). Use Grep to search log frontmatter and content. Present matching results and let the user select.

If "High blog potential":

Search all logs for entries with blog_potential: "high" in frontmatter. Present results.

If "Combine multiple":

Let the user select 2-5 logs to weave into a single narrative post. See references/things-bridge.md for multi-log strategies.

4. Read Selected Logs

Read the full content of selected log(s). Extract:

  • Blog Seed section — the opening hook
  • Potential angles — narrative direction options
  • Context / Action / Result — the substance
  • Reflection — personal voice and takeaway
  • Metrics — concrete numbers from frontmatter
  • Tags and skills — for post categorization

5. Choose the Narrative Angle

Use AskUserQuestion to present the potential angles from the log(s), plus standard options:

What angle should this post take?

  • <Angle 1 from log's "Potential angles">
  • <Angle 2 from log's "Potential angles">
  • Tutorial/how-to (teach what you learned)
  • Retrospective (reflect on the journey)

6. Select Voice

If voice profiles exist in .claude/voices/:

  • If a default voice is set, show it and ask if they want to use it, pick a different one, or skip voice for this post
  • If no default is set, list available voices and let them pick one or skip

7. Scan Existing Posts

Use Glob and Grep to scan the blog content directory:

  • Find all .md files in the target subdirectory
  • Extract existing tags from frontmatter across posts
  • This informs tag suggestions and maintains consistency

7.5. Plan Visuals

Only run this step if media_dir is configured.

Analyze the selected log(s) for visual content opportunities:

  • Architecture in Action section → flowcharts or system diagrams
  • Process flows (deployment pipelines, workflows, data flows) → sequence diagrams or flowcharts
  • Before/after comparisons → side-by-side images or diagrams
  • Metrics and results → tables or formatted data presentations

Use AskUserQuestion:

How should we handle visuals?

  • "Generate diagrams where they fit" — create Mermaid diagrams for architecture and flow content
  • "Also find relevant images" — diagrams plus web-searched images for visual concepts
  • "Keep it text-only" — skip visuals entirely
  • "Decide as we write" — suggest visuals inline during generation

Store the user's choice for Step 8.

8. Generate the Post

Transform the log into a blog post following the Quartz format in ../new-post/references/quartz-format.md and the transformation guide in references/things-bridge.md.

Transformation rules:

  1. Open with the Blog Seed hook, adapted to the chosen angle
  2. Rewrite the title — engaging and blog-appropriate, not resume-like
  3. Transform Context → Action → Result into narrative prose with a natural, first-person voice
  4. Include code/technical details if the log has them, using proper Quartz code blocks with language identifiers
  5. Pull metrics from frontmatter and contextualize them (not just numbers, but why they matter)
  6. Expand the Reflection into a genuine takeaway for readers
  7. Generate Quartz-compatible frontmatter:
    • title: Rewritten for a blog audience
    • date: Today's date (when the post is written)
    • description: 1-2 sentence preview for SEO/social
    • tags: Adapted from log tags, blended with existing blog tags where appropriate
    • draft: true initially
    • author: From mark-my-words config (default_author)
  8. Add visuals if planned in Step 7.5 — generate Mermaid diagrams for architecture and flow content from the log's Action section, insert image references for any downloaded images, place visuals after the text that introduces the concept. Follow placement rules from ../add-media/references/media-guide.md. If the user chose "Decide as we write", suggest visuals inline and ask before adding each one. If "Also find relevant images", use WebSearch to find and download relevant images to the media dir.

Content quality:

  • If a voice profile was selected, follow its guidance for tone, sentence patterns, vocabulary, rhetorical habits, and things to avoid. The voice shapes how you write — the transformation rules still control what you write (Blog Seed hook, narrative structure, metrics integration). Voice and transformation rules are complementary, not competing.
  • If no voice profile was selected, write in a natural, engaging voice — personal blog, not documentation
  • Use H2 for major sections, H3 for subsections (no H1 in body)
  • One idea per paragraph
  • Use callouts (> [!tip], etc.) sparingly and where they add value
  • End with a clear takeaway

9. Present for Review

Show the generated post and ask:

How's this draft?

  • Save it — I'll review and publish later
  • Edit it first — I want to refine some sections
  • Change the angle — try a different approach
  • Start over — pick different logs

If "Save it":

Continue to Step 10.

If "Edit":

Use AskUserQuestion to identify which sections to revise, then Edit the draft and present again.

If "Change angle":

Go back to Step 5.

If "Start over":

Go back to Step 3.

10. Save the File

  • Generate a filename from the title: lowercase, hyphens for spaces, no special characters
  • Write to <content_root>/<default_subdirectory>/<filename>.md
  • Tell the user the file path

11. Update Source Log Metadata

Edit the source log(s) in <things_path>/logs/ to record that a post was created. Add to the log's frontmatter:

yaml
blog_post: "<path to generated post>"
blog_post_date: <today's date>

This prevents the same log from being surfaced as "unused" in future runs.

12. Handle Git Workflow

Based on the mark-my-words git_workflow config setting:

  • ask: Use AskUserQuestion — "Would you like to commit and push this post?" with options: Yes (commit + push), Commit only (no push), No (skip git)
  • auto: Automatically git add, git commit -m "Add post: <title> (from things)", and git push
  • manual: Tell the user the file has been written and they can commit when ready

When committing, git add both the post file and any media files added to the media directory.

Only do git operations if the content is in a git repository.

13. Suggest Related Posts

Based on the source log's tags and skills, check if other logs could make good companion posts:

Based on your tags, these logs could make good follow-up posts:

  • "<log title>" — <potential angle>
  • "<log title>" — <potential angle>

Run /mark-my-words:from-things <filename> to draft one.