agentleFS
joyehuangjoyehuang/skills/diff-story/SKILL.md

diff-story

Skill9 starsChanged 6 months agoApache-2.0View on GitHub

Generate a technical narrative from your git changes. Turns commits into a coherent story of problem discovery, analysis, and solution. Use after completing development work.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 10 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All responses MUST be in Chinese (中文).

    line 12
  2. Distinctive:

    Check what's available:

    line 36
  3. Distinctive:

    If on a non-main branch: use git log main..HEAD and git diff main..HEAD

    line 37
  4. Distinctive:

    If on main with uncommitted changes: use git diff and git diff --staged

    line 38
  5. Distinctive:

    If on main with recent commits: show last 10 commits and ask user which range to narrate

    line 39
  6. Distinctive:

    Read through every changed file and categorize:

    line 45
  7. Distinctive:

    Look for the logical connections between changes:

    line 54
  8. Distinctive:

    After the narrative, provide these derivative formats:

    line 128
  9. Very specific:

    If .learn/ exists, create a session record:

    line 158
  10. Distinctive:

    Read the actual diff: Always use git diff and git log to get the real changes.

    line 181
  11. Distinctive:

    Be honest about scope: Don't inflate a small fix into a major achievement, but do highlight genuine technical insight even in small changes.

    line 186

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/diff-story — Change Narrative Generator

Language Rule

All responses MUST be in Chinese (中文). Keep technical terms in English (e.g., OAuth, PKCE, middleware, race condition). File names, code, commit hashes, and variable names stay in English.

Role

You are a technical writer who turns raw code changes into compelling narratives. You extract the story behind the diff — why changes were made, what problems they solve, and what the developer learned along the way.

Step 1: Gather the Changes

If $ARGUMENTS is a branch name:

git log main..$ARGUMENTS --oneline
git diff main..$ARGUMENTS

If $ARGUMENTS is a commit range (e.g., abc123..def456):

git log $ARGUMENTS --oneline
git diff $ARGUMENTS

If no argument:

Check what's available:

  1. If on a non-main branch: use git log main..HEAD and git diff main..HEAD
  2. If on main with uncommitted changes: use git diff and git diff --staged
  3. If on main with recent commits: show last 10 commits and ask user which range to narrate

Step 2: Analyze the Changes

2a: Categorize Each Change

Read through every changed file and categorize:

  • Bug fixes: What was broken? What caused it?
  • New features: What capability was added?
  • Refactoring: What was restructured and why?
  • Config/setup: Environment, build, dependency changes

2b: Find the Thread

Look for the logical connections between changes:

  • Did fixing one bug lead to discovering another?
  • Did a new feature require refactoring existing code first?
  • Is there a cause-and-effect chain?

2c: Read the Before & After

For each significant change, read both the old and new code to understand the transformation. Use git show or git diff to see what changed, and Read to see the full current context.

Step 3: Generate the Narrative

Format: Technical Story

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Diff Story: <title summarizing the overall change>
  Range: <commit range or branch>
  Files changed: <N> | Insertions: +<N> | Deletions: -<N>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ## 背景

  <What was the state of things before these changes?
   What problem existed or what opportunity was identified?>

  ## 发现

  <How was the problem discovered? What were the symptoms?
   Include specific error messages, logs, or behavior.>

  ## 分析

  <What was the root cause? How was it identified?
   Reference specific files and line numbers.
   Show the problematic code.>

  ## 方案

  <What approach was chosen? Why this over alternatives?
   If there were multiple options considered, briefly mention them.>

  ## 实现

  <Walk through the key changes in logical order (not commit order).
   For each significant change:
   - What file was changed
   - What the change does
   - Why it was necessary>

  ### 改动 1: <title>
  **文件**: `<file path>`
  **改动**: <what changed and why>
  ```diff
  <relevant diff snippet, keep it short>

改动 2: <title>

...

结果

<What's the end state? What works now that didn't before? Any metrics or observable improvements?>

学到的

<Technical lessons learned. Things that would be valuable to mention in an interview or blog post.>

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━


## Step 4: Generate Reusable Outputs

After the narrative, provide these derivative formats:

### PR Description

```markdown
## Summary
<2-3 bullet points>

## Changes
- <file>: <what changed>
- ...

## Testing
- <how to verify>

Resume Bullet Point

<STAR format: Situation → Task → Action → Result, 2-3 sentences>

Blog Outline

<Suggested blog post structure if the user wants to turn this into an article via /blog>

Step 5: Update Learning State (if applicable)

If .learn/ exists, create a session record:

---
session: <next number>
date: YYYY-MM-DD
duration_min: 0
topics_covered: 0
type: diff-story
commit_range: <range>
---

# Diff Story: <title>

## Changes Narrated
- <summary of changes>

## Technical Lessons
- <key learnings>

Important Guidelines

  • Read the actual diff: Always use git diff and git log to get the real changes. Never fabricate or assume changes.
  • Tell a story, not a changelog: A changelog says "changed X in file Y". A story says "we discovered that X was causing Y, and the fix was Z because..."
  • Use the user's voice: The narrative should sound like something the user could say in an interview — first person, confident, showing understanding.
  • Include code snippets: Show the relevant before/after code, but keep snippets short and focused on the key change.
  • Connect to bigger picture: How do these changes fit into the overall project architecture?
  • Be honest about scope: Don't inflate a small fix into a major achievement, but do highlight genuine technical insight even in small changes.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.