Skip to content

Conversation

@zirubak
Copy link

@zirubak zirubak commented Nov 12, 2025

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_mcp

Analyzes current project and provides actionable recommendations for managing agents/MCP servers.

Key Features:

  • Analyzes active agents and installed MCP servers
  • Reviews usage patterns from conversation history
  • Provides structured recommendations (KEEP/REMOVE/CONSIDER)
  • Estimates context window savings
  • Project-type specific heuristics

Use Cases:

  • Optimizing context window usage
  • Cleaning up unused development tools
  • Project-specific environment setup

2. /compact_with_topic

Automatically analyzes conversation history and executes /compact with intelligent focus.

Key Features:

  • Analyzes last 30-50 messages for key topics
  • Identifies what must be preserved vs. noise
  • Generates optimized compact focus areas
  • Handles multiple conversation patterns (debugging, feature development, exploration)
  • Supports user-specified focus

Use Cases:

  • Managing long conversations (100+ messages)
  • Context window pressure relief
  • Topic transitions in development workflow

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:

  • Clear prerequisites and validation
  • Error handling for edge cases
  • Multiple usage scenarios documented
  • Example outputs provided

Documentation

  • Updated README.md with new "Productivity & Optimization Commands" section
  • Added NEW_COMMANDS_SUMMARY.md with comprehensive documentation
  • Both command files include detailed guidelines and examples

Files Changed

templates/commands/rec_remove_agents_mcp.md    (new)
templates/commands/compact_with_topic.md       (new)
README.md                                      (modified)
NEW_COMMANDS_SUMMARY.md                        (new)

AI Disclosure

This contribution was created with assistance from Claude Code (Sonnet 4.5). The implementation was:

  • Designed by analyzing existing spec-kit command patterns
  • Structured to follow project conventions and philosophy
  • Tested for consistency with spec-kit's Spec-Driven Development methodology
  • Reviewed for quality and completeness

All code and documentation were generated with human oversight and understanding of the spec-kit architecture.

Checklist

  • Follows spec-kit command structure conventions
  • Includes comprehensive documentation
  • Provides clear examples and error handling
  • Updated README.md
  • AI assistance disclosed
  • Non-destructive by default
  • Aligned with Spec-Driven Development philosophy

Looking forward to feedback and happy to make any adjustments! 🚀

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>
Copilot AI review requested due to automatic review settings November 12, 2025 23:00
@zirubak zirubak requested a review from localden as a code owner November 12, 2025 23:00
Copilot finished reviewing on behalf of zirubak November 12, 2025 23:06
Copy link
Contributor

Copilot AI left a 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_mcp command for analyzing and recommending which agents/MCP servers to keep or remove
  • Adds /speckit.compact_with_topic command 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
Copy link

Copilot AI Nov 12, 2025

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.

Suggested change
- Any critical information that might need re-stating
- Any critical information that might need restating

Copilot uses AI. Check for mistakes.

## 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.
Copy link

Copilot AI Nov 12, 2025

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:

  1. Be made agent-agnostic by detecting which agent is in use and adapting accordingly, or
  2. 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".

Copilot uses AI. Check for mistakes.

## 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.
Copy link

Copilot AI Nov 12, 2025

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
- 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
@zirubak zirubak requested a review from Copilot November 12, 2025 23:45
@zirubak zirubak closed this Nov 12, 2025
@zirubak zirubak reopened this Nov 12, 2025
Copilot finished reviewing on behalf of zirubak November 12, 2025 23:50
Copy link
Contributor

Copilot AI left a 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.
Copy link

Copilot AI Nov 12, 2025

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.).

Suggested change
Execute the Claude Code `/compact` command with the generated focus.
Execute the agent's `/compact` command with the generated focus.

Copilot uses AI. Check for mistakes.
2. **Invoke /compact**:

Execute the Claude Code `/compact` command with the generated focus.

Copy link

Copilot AI Nov 12, 2025

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.

Suggested change
> **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.

Copilot uses AI. Check for mistakes.

## 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.
Copy link

Copilot AI Nov 12, 2025

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."

Suggested change
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.

Copilot uses AI. Check for mistakes.
zirubak pushed a commit to zirubak/JH-spec-kit that referenced this pull request Nov 13, 2025
- 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
@zirubak zirubak requested a review from Copilot November 13, 2025 05:27
Copilot finished reviewing on behalf of zirubak November 13, 2025 05:32
Copy link
Contributor

Copilot AI left a 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.

@localden
Copy link
Collaborator

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.

@localden localden closed this Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants