agentleFS
sohaibdevvsohaibdevv/Claude-Starter-Kit/skills/reflect/SKILL.md

reflect

Skill2 starsChanged 3 months agoMITView on GitHub

Analyze the current or recent session(s) for corrections, preferences, and implicit feedback. Extracts learnings and routes them to the right knowledge/rules file. Run when you want to capture what was learned this session.

105 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use make-bot-ui, principle-attack-the-premise and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • eryzerzSkill

    make-bot-ui

    Use when building a custom UI (page, dashboard, buttons) that should wake a Grok Bot over a webhook, when the user must provide a webhook sender key, or when exposing that UI on Tailscale.

    Also in 8 projects that use this

  • TheOnlyFusionCubeSkill

    principle-attack-the-premise

    Inventory who actually owns or exhibits the imbalance, then challenge the shared premise before writing another patch. Use when two or more fixes that share one premise have failed the same gate.

    Also in 10 projects that use this

  • TheOnlyFusionCubeSkill

    principle-test-behavior-not-implementation

    Call the system the way its consumer does and assert meaningful observable output; avoid mocks or assertions that only mirror internal calls. Use when when writing or evaluating tests.

    Also in 10 projects that use this

  • shishivSkill

    setup-pstack

    Configure pstack delegation against the active Pi host. Use for /skill:setup-pstack, "configure pstack models", or checking delegation readiness.

    Also in 13 projects that use this

  • finograficSkill

    figure-it-out

    Design an auditable playbook when no narrower one fits: a large migration, an ambitious multi-part change, or work a human reviews after stepping away. Scales rigor to the task, runs a hypothesis loop, and logs decisions via show-me-your-work. Use for /figure-it-out, 'figure it out', a large migration, or when no narrower playbook applies.

    Also in 19 projects that use this

  • shishivSkill

    automate-me

    Use for \"automate me\", \"create/update/refresh my -mode skill\", \"turn/capture my preferences or working style into a skill\", or wanting agents to follow how the user works. Drafts or revises a personal -mode skill via create-skill + unslop, optionally pulling fresh evidence from recent transcripts.

    Also in 16 projects that use this

  • +1 more from shishiv

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 13 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 97 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    First: Read LEARNINGS.md (in this skill's directory) before proceeding.

    line 10
  2. Distinctive:

    Run the extraction script to get candidate learnings from session JSONL.

    line 20
  3. Very specific:

    If $ARGUMENTS is empty, it analyzes the latest session.

    line 26
  4. Distinctive:

    If no pairs found -- tell user "Nothing to reflect on" and stop

    line 28
  5. Distinctive:

    If pairs found -- capture the output and proceed to Phase 2

    line 29
  6. Distinctive:

    If it matches a previously rejected learning (same topic + target file): skip silently.

    line 45
  7. Distinctive:

    If it *contradicts* a previously rejected learning (opposite of what was rejected): flag as potential reversal — present to user with …

    line 46
  8. Distinctive:

    Exception: if the learning contradicts a rejected entry (Claude keeps making the same mistake), promote immediately to rule on 2nd …

    line 81
  9. Very specific:

    Problem routing: Read ~/claude-assistant/knowledge/problems/00-overview.md to match findings against the user's problems.

    line 106
  10. Distinctive:

    If Phase 2 flagged contradictions:

    line 125
  11. Distinctive:

    If feedback counters flagged unhealthy rules:

    line 136
  12. Distinctive:

    Ask: "Action on flagged rules?

    line 146
  13. Distinctive:

    After listing all findings, ask:

    line 150
  14. Distinctive:

    If no real learnings found: tell user "Analyzed N pairs, no actionable learnings found" and stop.

    line 154
  15. Distinctive:

    When user discards findings:

    line 158
  16. Distinctive:

    Ask: "Brief reason? (or Enter to skip)"

    line 160
  17. Very specific:

    If adding to a problem file's Insights Log, use format: ### YYYY-MM-DD — Session Reflection

    line 178
  18. Very specific:

    Commit with message reflect: capture session learnings

    line 184

“Common” is measured: kept by at least 6 in 10 of the 97 edited versions of this file we could read. “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

/reflect — Session Learning System

First: Read LEARNINGS.md (in this skill's directory) before proceeding.

You are running a 4-phase reflection workflow. Follow each phase in order.

Arguments: $ARGUMENTS


Phase 1: Extract

Run the extraction script to get candidate learnings from session JSONL.

python3 ~/claude-assistant/scripts/extract-learnings.py $ARGUMENTS

If $ARGUMENTS is empty, it analyzes the latest session. Pass --since YYYY-MM-DD or --file <path> to customize scope.

  • If no pairs found -- tell user "Nothing to reflect on" and stop
  • If pairs found -- capture the output and proceed to Phase 2

Phase 2: Analyze

For each candidate pair from Phase 1, determine:

  1. Is this a real learning? ~40% are normal conversation — skip those. Look for:
    • Corrections ("no, do X instead", "actually...", "wrong")
    • Preferences ("always use...", "I prefer...", "from now on...")
    • Tool rejections with feedback (user denied + said why)
    • Workflow patterns (user repeatedly does something a specific way)
    • Implicit feedback (user rephrases, asks again, provides what Claude should have known)
  2. Check rejections — Read ~/claude-assistant/knowledge/self/rejections.md. For each candidate:
    • If it matches a previously rejected learning (same topic + target file): skip silently. Note in output: "Skipped: matches rejected learning from [date]"
    • If it contradicts a previously rejected learning (opposite of what was rejected): flag as potential reversal — present to user with context from the rejection log
  3. Classify and route each real learning using the routing table below.
  4. Check for duplicates — Read the target file and verify the learning isn't already captured.
  5. Scan for contradictions — For each proposed change with a target file: a. Read the target file b. Read up to 5 related files: same directory + shared tags (YAML tags field) + wiki-linked files c. Scan for statements that directly contradict the proposed change d. If contradiction found, flag it for Phase 3 conflict resolution:
    CONFLICT with [file.md:line]:
      Existing: "[quoted text]"
      Proposed: "[new learning]"
    e. Update feedback counters — If the contradiction traces to a specific existing rule/learning entry, increment its harmful counter in ~/claude-assistant/state/rule-feedback.json
  6. Update feedback counters — Read ~/claude-assistant/state/rule-feedback.json (create if missing). For each finding:

    a. If a correction contradicts an existing rule -- increment harmful for that rule:

    • Key format: "<relative-path>::<section or first 60 chars of rule>"

    b. If the session had no corrections in an area covered by a rule, and the rule was relevant to work done this session -- increment helpful

    c. Write updated counters back to ~/claude-assistant/state/rule-feedback.json

    d. Flag unhealthy rules for Phase 3:

    • harmful >= 3 -- flag: "This rule has been contradicted 3 times. Review or remove?"
    • harmful / (helpful + harmful) > 0.5 with 4+ total signals -- flag as unreliable
    • helpful >= 5 with harmful == 0 -- mark as "stable" (note in output, no action needed)
  7. For multi-session scans (--since): Track if the same learning appears across 2+ sessions. Flag for promotion:
    • 2+ occurrences -- suggest knowledge file if not already there
    • 3+ occurrences -- flag for promotion to rule
    • Exception: if the learning contradicts a rejected entry (Claude keeps making the same mistake), promote immediately to rule on 2nd occurrence

Routing Table

CategoryTarget File
Task/operational correction~/.claude/rules/tasks.md
Communication preference~/.claude/rules/communication.md
Session management~/.claude/rules/sessions.md
Security/git correction~/.claude/rules/security.md
Delegation pattern~/.claude/rules/delegation.md
Development standard~/.claude/rules/development.md
Research convention~/.claude/rules/research.md
User profile update~/claude-assistant/knowledge/user/profile.md
User goals update~/claude-assistant/knowledge/user/goals.md
Self-knowledge~/claude-assistant/knowledge/self/identity.md
Problem insight~/claude-assistant/knowledge/problems/NN-*.md Insights Log
Project state change~/claude-assistant/knowledge/projects/<project>.md
Global convention~/.claude/CLAUDE.md
Recurring pattern (3+ sessions)~/.claude/rules/ (new file or existing)
Actionable work identifiedSQLite via sqlite3 ~/claude-assistant/tasks.db then python3 ~/claude-assistant/scripts/db.py export
MEMORY.md state changeMEMORY.md (sparingly)

Routing priority: Rules files > Knowledge files > MEMORY.md > CLAUDE.md

Problem routing: Read ~/claude-assistant/knowledge/problems/00-overview.md to match findings against the user's problems.


Phase 3: Present

Show each finding to the user in this format:

## Finding N: [short title]
- **Evidence:** "[what user said]" (in response to "[what Claude said]")
- **Category:** [from routing table]
- **Target:** `path/to/file.md`
- **Proposed change:** [exact text to add/edit]
- **Already captured?** Yes/No

Conflict Resolution

If Phase 2 flagged contradictions:

CONFLICT with [file.md:line]:
  Existing: "[quoted text from file]"
  Proposed: "[the new learning]"
  Resolve: keep existing (k), replace (r), or note both (b)

Flagged Rules

If feedback counters flagged unhealthy rules:

## Flagged Rules

### [rule key]
- Counters: helpful=N, harmful=N
- Recommendation: review / remove / keep with caveat

Ask: "Action on flagged rules? (r)emove, (e)dit, (k)eep, or (s)kip"

User Decision

After listing all findings, ask:

Apply all (a), select by number (e.g. 1,3,5), or discard (d)?

If no real learnings found: tell user "Analyzed N pairs, no actionable learnings found" and stop.

Rejection Logging

When user discards findings:

  1. Ask: "Brief reason? (or Enter to skip)"
  2. Append to ~/claude-assistant/knowledge/self/rejections.md:
    ### YYYY-MM-DD — Rejected
    - **Proposed:** [the learning]
    - **Target:** `path/to/file.md`
    - **Reason:** [user's reason, or "(not provided)"]

Phase 4: Apply

For each approved finding:

  1. Read the target file
  2. Edit with the proposed change (use Edit tool, not Write)
  3. Update YAML frontmatter last_reviewed to today's date (if present)
  4. If adding to a problem file's Insights Log, use format: ### YYYY-MM-DD — Session Reflection

After all edits:

  1. Summarize what was changed: | File | Change | table
  2. Stage ~/claude-assistant/state/rule-feedback.json if counters were updated
  3. Commit with message reflect: capture session learnings

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.