-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat: add productivity and optimization slash commands #1170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add two new slash commands to enhance development workflow efficiency: 1. /rec_remove_agents_mcp - Analyzes current project and installed agents/MCP servers - Provides actionable recommendations (KEEP/REMOVE/CONSIDER) - Estimates context window savings - Includes project-type specific heuristics 2. /compact_with_topic - Automatically analyzes recent conversation topics - Generates intelligent compact focus areas - Handles multiple conversation patterns (debugging, development, exploration) - Preserves essential context while reducing conversation overhead Both commands follow spec-kit conventions with: - YAML frontmatter structure - Phase-based execution flows - Comprehensive examples and error handling - Non-destructive default behavior Updated README.md with new "Productivity & Optimization Commands" section. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds two new productivity and optimization slash commands to spec-kit to enhance development workflow efficiency and context management.
Key Changes:
- Adds
/speckit.rec_remove_agents_mcpcommand for analyzing and recommending which agents/MCP servers to keep or remove - Adds
/speckit.compact_with_topiccommand for automatically analyzing conversation topics and intelligently executing/compact - Updates README.md with new "Productivity & Optimization Commands" section
- Includes comprehensive documentation in NEW_COMMANDS_SUMMARY.md
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| templates/commands/rec_remove_agents_mcp.md | New command that analyzes project configuration and provides recommendations for managing agents and MCP servers to optimize context window usage |
| templates/commands/compact_with_topic.md | New command that automatically analyzes conversation history to identify key topics and executes /compact with intelligent focus |
| README.md | Added new command table section for Productivity & Optimization Commands documenting the two new commands |
| NEW_COMMANDS_SUMMARY.md | Comprehensive documentation detailing the design, usage, and testing of the new commands |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| After compaction, briefly confirm: | ||
| - Topics preserved | ||
| - Estimated context reduction | ||
| - Any critical information that might need re-stating |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word "re-stating" should be spelled as "restating" (without hyphen). The hyphenated form is non-standard.
| - Any critical information that might need re-stating | |
| - Any critical information that might need restating |
|
|
||
| ## Outline | ||
|
|
||
| This command enhances the Claude Code `/compact` feature by automatically analyzing conversation history to identify key topics and generate an optimized compact focus area. Instead of manually determining what to preserve, this command intelligently extracts the conversation essence. |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command references "Claude Code /compact feature" which is vendor-specific. Spec-kit is designed to work with multiple AI agents (Claude Code, GitHub Copilot, Gemini CLI, Cursor, etc. - see README.md lines 137-152). The command should either:
- Be made agent-agnostic by detecting which agent is in use and adapting accordingly, or
- Be clearly documented as Claude Code-only with appropriate warnings when used with other agents
The same issue applies to line 160 where it references "Claude Code /compact command".
|
|
||
| ## Outline | ||
|
|
||
| This command analyzes the current project context and provides actionable recommendations for managing Claude Code agents and MCP servers to optimize performance and context window usage. |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command references "Claude Code agents" which is vendor-specific. Spec-kit is designed to work with multiple AI agents (Claude Code, GitHub Copilot, Gemini CLI, Cursor, etc. - see README.md lines 137-152). The command should be made agent-agnostic by referring to "AI agents" or "coding agents" rather than specifically "Claude Code agents", or it should be clearly documented as Claude Code-specific.
| This command analyzes the current project context and provides actionable recommendations for managing Claude Code agents and MCP servers to optimize performance and context window usage. | |
| This command analyzes the current project context and provides actionable recommendations for managing AI agents and MCP servers to optimize performance and context window usage. |
- Fix spelling: 're-stating' to 'restating' in compact_with_topic.md - Update vendor-specific language to agent-agnostic - Change 'Claude Code' to 'AI agents' or remove vendor references Addresses review comments from PR github#1170
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| 2. **Invoke /compact**: | ||
|
|
||
| Execute the Claude Code `/compact` command with the generated focus. |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reference to "Claude Code" is too specific to one AI agent. Following the pattern in constitution.md (line 43), this should use generic language like "the agent's /compact command" or "the built-in /compact command" to maintain agent-agnostic guidance as spec-kit is designed to work with multiple AI assistants (Claude, Gemini, etc.).
| Execute the Claude Code `/compact` command with the generated focus. | |
| Execute the agent's `/compact` command with the generated focus. |
| 2. **Invoke /compact**: | ||
|
|
||
| Execute the Claude Code `/compact` command with the generated focus. | ||
|
|
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example compact command format uses /compact directly, but this assumes the AI agent being used has a /compact command available. This may not work consistently across all agents. The command should either: (1) check if /compact is available before attempting to invoke it, or (2) provide alternative instructions for agents that don't have this built-in command. Consider adding a note in the error handling section about this dependency.
| > **Note:** The `/compact` command may not be available in all AI agents or environments. If `/compact` is not supported, manually summarize and condense the conversation using the generated focus area above, or consult your agent's documentation for equivalent compaction functionality. |
NEW_COMMANDS_SUMMARY.md
Outdated
|
|
||
| ## Overview | ||
|
|
||
| This document describes two new productivity commands added to the Spec-Kit toolkit, designed to optimize Claude Code's context management and conversation efficiency. |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reference to "Claude Code" is too specific to one AI agent. Following spec-kit conventions (see constitution.md line 43), documentation should use generic language to maintain agent-agnostic guidance as spec-kit is designed to work with multiple AI assistants. Consider rephrasing to "...designed to optimize AI agent context management and conversation efficiency."
| This document describes two new productivity commands added to the Spec-Kit toolkit, designed to optimize Claude Code's context management and conversation efficiency. | |
| This document describes two new productivity commands added to the Spec-Kit toolkit, designed to optimize AI agent context management and conversation efficiency. |
- Remove productivity commands (belong in separate PR github#1170) - Translate Korean testimonial to English - Fix Black line length to default (88) - Use full file paths in instructions (specs/[feature]/...) - Remove NEW_COMMANDS_SUMMARY.md (wrong PR) Addresses review comments from PR github#1172
- Change 'Claude Code' to agent-agnostic language - Add note about /compact command availability across agents - Update NEW_COMMANDS_SUMMARY.md to use generic AI agent terminology Addresses remaining review comments from PR github#1170
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Per contribution guidelines, this was not yet discussed. Let's hold off on major additions/rewrites until folks got a chance to discuss and approve this approach for Spec Kit. |
Summary
This PR adds two new slash commands to enhance development workflow efficiency and context management in spec-kit.
New Commands
1.
/rec_remove_agents_mcpAnalyzes current project and provides actionable recommendations for managing agents/MCP servers.
Key Features:
Use Cases:
2.
/compact_with_topicAutomatically analyzes conversation history and executes
/compactwith intelligent focus.Key Features:
Use Cases:
Design Decisions
Both commands follow established spec-kit patterns:
✅ YAML frontmatter with clear descriptions
✅ User Input section
✅ Phase-based execution flows
✅ Comprehensive examples (✅ CORRECT / ❌ WRONG format)
✅ Detailed error handling
✅ Non-destructive default behavior
Testing
Commands have been designed with:
Documentation
README.mdwith new "Productivity & Optimization Commands" sectionNEW_COMMANDS_SUMMARY.mdwith comprehensive documentationFiles Changed
AI Disclosure
This contribution was created with assistance from Claude Code (Sonnet 4.5). The implementation was:
All code and documentation were generated with human oversight and understanding of the spec-kit architecture.
Checklist
Looking forward to feedback and happy to make any adjustments! 🚀