
command-explain-changes-mental-model
Lead line: Command that splits code changes into smaller logical chunks to build a mental model.
- GitHub stars
- 2.7K
What it does
- Adds one command,
/explain-changes-mental-model, for walking through a set of changes in your project - Covers the change set by grouping it into smaller logical chunks rather than reviewing it as a single diff
- Designed for developers who need to understand unfamiliar or large changes before reviewing or merging them
Build a mental model of changes by splitting them into smaller logical chunks.
Add marketplace
/plugin marketplace add softaworks/agent-toolkitRun it inside Claude Code once, then install the plugin below.
Install
/plugin install command-explain-changes-mental-model@agent-toolkitRun it inside Claude Code after adding the marketplace.
Files
Mental Model Builder
Analyze code changes and present them as a coherent mental model - breaking large diffs into logical chunks ordered by dependency so they can be understood incrementally.
What This Command Does
- Gather changes from the specified source (commit, branch, range, or custom input)
- Analyze and categorize changes into logical groups by theme/purpose
- Identify dependencies between change groups
- Present ordered explanation so changes can be reviewed in a sensible sequence
Usage
# Current working changes (staged + unstaged)
/mental-model
# Specific commit
/mental-model abc1234
/mental-model HEAD~3
# Branch comparison (vs main)
/mental-model feature/my-branch
# Explicit range
/mental-model main..HEAD
/mental-model origin/main...HEAD
# Custom - user will provide diff/changes in next message
/mental-model custom
Implementation Steps
When this command is invoked:
1. Determine Change Source
Parse the argument to determine what changes to analyze:
No argument provided:
- Run
git diff HEADto get all uncommitted changes (staged + unstaged) - If no changes found, report "No uncommitted changes to analyze"
Argument looks like a commit hash (7-40 hex chars):
- Run
git show <hash> --statfirst to verify it exists - Run
git show <hash>to get the full diff
Argument looks like a branch name (contains letters, no ..):
- Detect main branch: check if
mainormasterexists - Run
git diff <main-branch>...<argument>to compare
Argument contains .. (explicit range):
- Use as-is:
git diff <argument>
Argument is "custom":
- Tell the user: "Please paste or describe the changes you want me to analyze in your next message."
- Wait for user input before proceeding
2. Extract the Diff
Run the appropriate git command and capture the output:
# Example for commit
git show <hash> --no-color
# Example for range
git diff <range> --no-color
If the diff is very large (>5000 lines), use --stat first to get an overview, then selectively read the most important files.
3. Analyze and Categorize Changes
Group changes into logical categories based on:
- Purpose: What problem does this change solve?
- Layer: API, UI, business logic, data, infrastructure, tests, config
- Feature area: Authentication, payments, search, etc.
- Type: New feature, refactor, bug fix, cleanup
For each file changed, determine:
- What logical group it belongs to
- What other changes it depends on
- What changes depend on it
4. Build Dependency Graph
Identify how changes relate to each other:
- Foundation changes: Types, interfaces, schemas that other code depends on
- Implementation changes: Code that uses the foundation
- Integration changes: Code that ties implementations together
- Test/config changes: Usually depend on everything else
Order groups so that:
- Dependencies come before dependents
- Lower-level abstractions come before higher-level ones
- Core changes come before peripheral changes
5. Present the Mental Model
Output the analysis in this format:
## Mental Model: [Brief title of what these changes accomplish]
### High-Level Summary
[2-3 sentences explaining the overall goal and approach of these changes]
### Key Concepts to Understand
Before diving into the code, understand these concepts:
- **[Concept 1]**: [Brief explanation]
- **[Concept 2]**: [Brief explanation]
- **[Concept 3]**: [Brief explanation]
### Change Groups (in review order)
#### 1. [Group Name] - [Purpose]
**Files:** `file1.ts`, `file2.ts`
**Why this matters:** [Explain the purpose and context]
**Key changes:**
- [Change 1 and why]
- [Change 2 and why]
**Depends on:** Nothing (foundation)
**Enables:** [What other groups need this]
#### 2. [Group Name] - [Purpose]
**Files:** `file3.ts`, `file4.ts`
**Why this matters:** [Explain the purpose and context]
**Key changes:**
- [Change 1 and why]
- [Change 2 and why]
**Depends on:** Group 1
**Enables:** [What other groups need this]
[Continue for all groups...]
### Review Sequence
For the best understanding, review in this order:
1. **[Group 1]** - Start here because [reason]
2. **[Group 2]** - Then this because [reason]
3. **[Group 3]** - Finally this because [reason]
### Gotchas and Non-Obvious Details
- [Any tricky parts or things that might be confusing]
- [Implicit assumptions in the code]
- [Things that look wrong but are intentional]
Important Notes
- Focus on understanding, not just describing: Explain WHY changes were made, not just WHAT changed
- Use the user's domain language: If the codebase has specific terminology, use it
- Be honest about complexity: If something is genuinely complex, say so and break it down further
- Highlight the "aha moments": What insight makes everything click into place?
- Skip trivial changes: Don't waste mental bandwidth on import reordering, formatting, etc.
Error Handling
If git command fails:
- Report the specific error
- Suggest alternatives (e.g., "Did you mean branch X?")
If diff is empty:
- Report "No changes found for the specified source"
If changes are too large to analyze meaningfully:
- Provide a high-level overview first
- Offer to deep-dive into specific areas: "This is a large changeset. Want me to focus on a specific area? (e.g., 'the API changes' or 'the database migrations')"
Example Output
For a commit that adds user authentication:
## Mental Model: Adding JWT-based User Authentication
### High-Level Summary
These changes add user authentication using JWT tokens. The flow is: user submits credentials → server validates → server returns JWT → client stores and sends JWT with requests → server validates JWT on protected routes.
### Key Concepts to Understand
- **JWT (JSON Web Token)**: A signed token containing user identity, passed in Authorization header
- **Middleware pattern**: Express middleware that runs before route handlers to check auth
- **Token refresh**: Mechanism to get new tokens without re-entering credentials
### Change Groups (in review order)
#### 1. Auth Types & Interfaces - Foundation
**Files:** `src/types/auth.ts`
**Why this matters:** Defines the shape of auth data used everywhere else
**Key changes:**
- Added `User`, `TokenPayload`, `AuthResponse` types
- These types ensure consistency across the auth system
**Depends on:** Nothing
**Enables:** All other auth code
#### 2. JWT Utilities - Token Operations
**Files:** `src/utils/jwt.ts`
**Why this matters:** Core logic for creating and validating tokens
**Key changes:**
- `signToken()` - creates JWT with user data and expiration
- `verifyToken()` - validates JWT and extracts payload
**Depends on:** Auth types
**Enables:** Auth middleware, login endpoint
[etc...]
From the softaworks/agent-toolkit README
Softaworks Agent Skills
Opinionated skills shared by @leonardocouy for improving daily work efficiency with Claude Code. Skills are packaged instructions and scripts that extend agent capabilities across development, documentation, planning, and professional workflows.
Skills follow the Agent Skills format.
🧭 Quick Navigation
🚀 Installation • 📚 Available Skills • 🤖 Agents & Commands • 📖 Skill Structure • 🤝 Contributing • 📄 License • 🔗 Links
🚀 Installation
Quick Install (Recommended)
npx skills add softaworks/agent-toolkit
This method works with multiple AI coding agents (Claude Code, Codex, Cursor, AdaL, etc.)
Register as Plugin Marketplace
Run the following commands in Claude Code:
/plugin marketplace add softaworks/agent-toolkit
/plugin
Install Plugins
Option 1: Via Browse UI
- Switch to Marketplaces tab (use arrow keys or Tab)
- Select agent-toolkit, press Enter
- Browse and select the plugin(s) you want to install
- Select Install now
Option 2: Direct Install
# Install specific skill
/plugin install codex@agent-toolkit
/plugin install humanizer@agent-toolkit
# Install specific agent
/plugin install agent-codebase-pattern-finder@agent-toolkit
# Install specific command
/plugin install command-codex-plan@agent-toolkit
Option 3: Ask the Agent
Simply tell Claude Code:
Please install Skills from github.com/softaworks/agent-toolkit
Available Plugins
Each skill, agent, and command is an individual plugin that can be installed separately:
- Skills → See Available Skills for the full list
- Agents → See Agents (install as
agent-<name>@agent-toolkit) - Commands → See Slash Commands (install as
command-<name>@agent-toolkit)
Update Plugins
To update plugins to the latest version:
- Run
/pluginin Claude Code - Switch to Marketplaces tab
- Select agent-toolkit
- Choose Update marketplace
You can also Enable auto-update to get the latest versions automatically.
Manual Installation
For Claude Code (Manual) — Skills only
cp -r skills/<skill-name> ~/.claude/skills/
For claude.ai — Skills only
Add skills to project knowledge or paste SKILL.md contents into the conversation.
📚 Available Skills
| Category | Skill | Description |
|---|---|---|
| 🤖 AI Tools | codex | Advanced code analysis with GPT-5.2 |
| 🤖 AI Tools | gemini | Large-scale review (200k+ context) |
| 🤖 AI Tools | perplexity | Web search & research |
| 🔮 Meta | agent-md-refactor | Refactor bloated agent instruction files |
| 🔮 Meta | command-creator | Create Claude Code slash commands |
| 🔮 Meta | plugin-forge | Build Claude Code plugins & manifests |
| 🔮 Meta | skill-judge | Evaluate skill design quality |
| 📝 Documentation | backend-to-frontend-handoff-docs | API handoff docs for frontend |
| 📝 Documentation | c4-architecture | C4 architecture diagrams with Mermaid |
| 📝 Documentation | crafting-effective-readmes | Write effective README files |
| 📝 Documentation | draw-io | Create & edit draw.io diagrams |
| 📝 Documentation | excalidraw | Work with Excalidraw diagrams |
| 📝 Documentation | frontend-to-backend-requirements | Document API requirements |
| 📝 Documentation | marp-slide | Professional presentation slides |
| 📝 Documentation | mermaid-diagrams | Software diagrams with Mermaid |
| 📝 Documentation | writing-clearly-and-concisely | Clear, professional writing |
| 🎨 Design & Frontend | design-system-starter | Create design systems |
| 🎨 Design & Frontend | mui | Material-UI v7 patterns |
| 🎨 Design & Frontend | openapi-to-typescript | Convert OpenAPI to TypeScript |
| 🎨 Design & Frontend | react-dev | Type-safe React 18-19 with TypeScript |
| 🎨 Design & Frontend | react-useeffect | React useEffect best practices |
| 🛠️ Development | database-schema-designer | Design robust database schemas |
| 🛠️ Development | dependency-updater | Smart dependency management |
| 🛠️ Development | naming-analyzer | Suggest better variable/function names |
| 🛠️ Development | lesson-learned | Extract SE lessons from recent code changes |
| 🛠️ Development | reducing-entropy | Minimize codebase size |
| 🛠️ Development | session-handoff | Seamless AI session transfers |
| 🎯 Planning | game-changing-features | Find 10x product opportunities |
| 🎯 Planning | gepetto | Detailed implementation planning |
| 🎯 Planning | requirements-clarity | Clarify requirements before coding |
| 🎯 Planning | ship-learn-next | Turn learning into actionable reps |
| 👔 Professional | daily-meeting-update | Interactive daily standup generator |
| 👔 Professional | difficult-workplace-conversations | Navigate difficult conversations |
| 👔 Professional | feedback-mastery | Deliver constructive feedback |
| 👔 Professional | professional-communication | Technical communication guide |
| 🧪 Testing | qa-test-planner | Comprehensive QA test planning |
| 📦 Git | commit-work | High-quality git commits |
| 🔧 Utilities | datadog-cli | Debug with Datadog logs & metrics |
| 🔧 Utilities | domain-name-brainstormer | Generate & check domain names |
| 🔧 Utilities | humanizer | Remove AI writing patterns |
| 🔧 Utilities | meme-factory | Generate memes with API |
| 🔧 Utilities | jira | Natural language Jira interaction |
| 🔧 Utilities | web-to-markdown | Convert webpages to Markdown |
🤖 Agents & Commands
Requires Claude Code CLI — These agents and commands are exclusive to Claude Code users.
For full access, add the marketplace and install plugins:
/plugin marketplace add softaworks/agent-toolkit /plugin install codex@agent-toolkit
Agents
Specialized sub-agents that Claude Code can delegate tasks to:
| Agent | Description |
|---|---|
| ascii-ui-mockup-generator | Visualize UI concepts through ASCII mockups |
| codebase-pattern-finder | Find similar implementations and patterns |
| communication-excellence-coach | Email refinement, tone calibration, roleplay |
| general-purpose | Default agent for complex multi-step tasks |
| mermaid-diagram-specialist | Create flowcharts, sequence diagrams, ERDs |
| ui-ux-designer | Research-backed UI/UX design feedback |
Slash Commands
Reusable workflows invoked with /command-name:
| Command | Description |
|---|---|
/codex-plan | Create implementation plans using Codex 5.2 |
/compose-email | Draft professional emails |
/explain-changes-mental-model | Build mental model of code changes |
/explain-pr-changes | Generate PR summaries |
/sync-branch | Sync feature branch with main |
/sync-skills-readme | Update README skills table |
/viral-tweet | Optimize tweet ideas for X engagement |
📖 Skill Structure
Each skill contains:
SKILL.md- Detailed instructions for the agent (with YAML frontmatter)README.md- User-friendly documentation with examplesscripts/- Helper scripts for automation (optional)references/- Supporting documentation (optional)
🤝 Contributing
Contributions are welcome! When adding new skills:
- Follow the Agent Skills format
- Include both
SKILL.md(for agents) andREADME.md(for users) - Add YAML frontmatter to
SKILL.mdwithname:anddescription:fields - Update this README.md with a link to your skill
📄 License
MIT
🔗 Links
Details
- Marketplace
- softaworks/agent-toolkit
- Source
- dist/plugins/command-explain-changes-mental-model
- Category
- Commands
- Keywords
- commands, code-review, understanding, mental-model
- Listed since
- Apr 6, 2026
More from softaworks/agent-toolkit
All 56- command-explain-pr-changes
- command-sync-branch
- command-sync-skills-readme
- command-viral-tweet
- commit-work
- crafting-effective-readmes
- daily-meeting-update
- database-schema-designer
- datadog-cli
- dependency-updater
- design-system-starter
- difficult-workplace-conversations
- domain-name-brainstormer
- draw-io
- excalidraw
- feedback-mastery
- frontend-to-backend-requirements
- game-changing-features
- gemini
- gepetto
- humanizer
- jira
- lesson-learned
- marp-slide
Similar to command-explain-changes-mental-model
More Code Review & Quality
command-explain-pr-changesPluginsoftaworks/agent-toolkit2.7K starsGenerate comprehensive markdown summary of pull request changes with visual impact analysis.
command-codex-planPluginsoftaworks/agent-toolkit2.7K starsCreate a detailed implementation plan using Codex 5.2 with high reasoning.
plan-code-changesPluginmahidalhan/claude-hacks34 starsPlan implementation changes before coding. Structured approach to modifications.
Sequential ThinkingMCP serverspences10589 starsRecords sequential reasoning steps as a scratchpad with branching, revision, and history.
refactor-planSkillgithub/awesome-copilot13.1K installsPlan a multi-file refactor by investigating the codebase first, then stop for confirmation before any edits.
incremental-implementationSkilladdyosmani/agent-skills75.5K installsBreaks large changes into thin, verifiable slices that each leave the system working and testable.