-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat: Add /cross-feature command for analysis across features with Systems Thinking #723
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
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Renamed the /align command to /cross-feature to better express that this command performs cross-feature alignment analysis using systems thinking. The new name makes it immediately clear that the analysis examines interactions between multiple features. Changes: - Renamed templates/commands/align.md → cross-feature.md - Renamed templates/alignment-analysis-template.md → cross-feature-analysis-template.md - Renamed scripts/bash/alignment-check-all-features.sh → cross-feature-check-all-features.sh - Renamed scripts/powershell/alignment-check-all-features.ps1 → cross-feature-check-all-features.ps1 - Updated all internal references to use new naming: - Output filename: alignment-analysis.md → cross-feature-analysis.md - Template paths in scripts - Command references in documentation - Clarification line text in scripts - Updated README.md command table - Updated templates/commands/specify.md to suggest /cross-feature 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
* main: docs(readme): link Amazon Q slash command limitation issue docs: clarify Amazon Q limitation and update init docstring feat(agent): Added Amazon Q Developer CLI Integration
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 PR introduces a new /cross-feature command that enables systems thinking analysis to identify conflicts, dependencies, and emergent behaviors when adding new features to a project.
- Adds
/cross-featurecommand with systems thinking framework for cross-feature analysis - Creates platform-specific scripts (bash/PowerShell) to analyze current feature against all existing specs
- Integrates with existing workflow between
/specifyand/plancommands
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/cross-feature-analysis-template.md | Template for structured alignment analysis output |
| templates/commands/cross-feature.md | Command definition for cross-feature analysis workflow |
| scripts/bash/cross-feature-check-all-features.sh | Bash script implementation for feature comparison |
| scripts/powershell/cross-feature-check-all-features.ps1 | PowerShell script implementation for feature comparison |
| templates/commands/specify.md | Updated to suggest cross-feature analysis as optional next step |
| README.md | Documentation update adding new command to workflow table |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…cation - Fix bash script sed portability for macOS/BSD vs GNU/Linux platforms - Extract clarification message to template to eliminate duplication - Update both bash and PowerShell scripts to read clarification from template - Add fallback to hardcoded message if template extraction fails 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Added /cross-feature command to the Enhancement Commands panel shown after `specify init` - Positioned after /clarify and before /analyze in the workflow - Includes timing guidance: "run after /specify, before /plan" - Described as "Systems thinking alignment analysis to identify cross-feature conflicts" - Improves discoverability of the cross-feature command for new users 🤖 Generated with [Claude Code](https://claude.com/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
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| COMMAND_TEMPLATE="$REPO_ROOT/templates/commands/cross-feature.md" | ||
| if [ -f "$COMMAND_TEMPLATE" ]; then | ||
| # Extract the clarification message from the template (it's in backticks on line with "Add:") | ||
| CLARIFICATION_LINE=$(grep -A 1 "Add:" "$COMMAND_TEMPLATE" | grep "NEEDS CLARIFICATION" | sed 's/.*`\(.*\)`.*/\1/') |
Copilot
AI
Oct 3, 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 regex pattern expects backticks around the clarification line, but the template uses regular quotes. This will cause the extraction to fail and fall back to the hardcoded string.
| CLARIFICATION_LINE=$(grep -A 1 "Add:" "$COMMAND_TEMPLATE" | grep "NEEDS CLARIFICATION" | sed 's/.*`\(.*\)`.*/\1/') | |
| CLARIFICATION_LINE=$(grep -A 1 "Add:" "$COMMAND_TEMPLATE" | grep "NEEDS CLARIFICATION" | sed 's/.*["'\'']\(.*NEEDS CLARIFICATION.*\)["'\''].*/\1/') |
| if (Test-Path $CommandTemplate) { | ||
| # Extract the clarification message from the template (it's in backticks on line with "Add:") | ||
| $TemplateContent = Get-Content $CommandTemplate -Raw | ||
| if ($TemplateContent -match 'Add: `([^`]+)`') { |
Copilot
AI
Oct 3, 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 regex pattern expects backticks around the clarification line, but the template uses regular quotes. This will cause the extraction to fail and fall back to the hardcoded string.
| if ($TemplateContent -match 'Add: `([^`]+)`') { | |
| if ($TemplateContent -match 'Add: "([^"]+)"') { |
| $CLARIFICATION_LINE | ||
| " "$CURRENT_SPEC" |
Copilot
AI
Oct 3, 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 sed command syntax for appending text on macOS is incorrect. The backslash-newline continuation should be followed by the text on the same line, not on separate lines.
| $CLARIFICATION_LINE | |
| " "$CURRENT_SPEC" | |
| $CLARIFICATION_LINE" "$CURRENT_SPEC" |
| sed -i "/### Functional Requirements/a\\ | ||
| $CLARIFICATION_LINE" "$CURRENT_SPEC" |
Copilot
AI
Oct 3, 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 sed command syntax for appending text on Linux is incorrect. The backslash should be immediately followed by the text without a newline.
Remove settings.local.json from .gitignore as it's not related to the /cross-feature command feature. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…lity - Update regex patterns to handle both quotes and backticks in template extraction - Improve sed portability by detecting GNU vs BSD sed at runtime - Add documentation comments noting template as source of truth for clarification message - Fix sed append syntax for both macOS (BSD) and Linux (GNU) 🤖 Generated with [Claude Code](https://claude.com/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
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| COMMAND_TEMPLATE="$REPO_ROOT/templates/commands/cross-feature.md" | ||
| if [ -f "$COMMAND_TEMPLATE" ]; then | ||
| # Extract the clarification message from the template (handles both quotes and backticks) | ||
| CLARIFICATION_LINE=$(grep -A 1 "Add:" "$COMMAND_TEMPLATE" | grep "NEEDS CLARIFICATION" | sed 's/.*["'\''`]\(.*NEEDS CLARIFICATION.*\)["'\''`].*/\1/') |
Copilot
AI
Oct 3, 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 complex regex pattern with multiple quote types makes this line difficult to read and maintain. Consider breaking this into multiple steps or using a more straightforward extraction approach.
| CLARIFICATION_LINE=$(grep -A 1 "Add:" "$COMMAND_TEMPLATE" | grep "NEEDS CLARIFICATION" | sed 's/.*["'\''`]\(.*NEEDS CLARIFICATION.*\)["'\''`].*/\1/') | |
| CLARIFICATION_RAW=$(grep -A 1 "Add:" "$COMMAND_TEMPLATE" | grep "NEEDS CLARIFICATION") | |
| # Remove leading/trailing quotes or backticks if present | |
| CLARIFICATION_LINE=$(echo "$CLARIFICATION_RAW" | sed 's/^[[:space:]]*["'\''`]\{0,1\}//; s/["'\''`]\{0,1\}[[:space:]]*$//') |
|
|
||
| # Build output | ||
| if ($JsonMode) { | ||
| $AllSpecsJson = $AllSpecs | ForEach-Object { "`"$_`"" } | Join-String -Separator "," |
Copilot
AI
Oct 3, 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 variable $AllSpecsJson is created but never used in the JSON output. The actual JSON uses $AllSpecs directly, making this line redundant.
| $AllSpecsJson = $AllSpecs | ForEach-Object { "`"$_`"" } | Join-String -Separator "," |
| if sed --version >/dev/null 2>&1; then | ||
| # GNU sed | ||
| sed -i "/### Functional Requirements/a\\$CLARIFICATION_LINE" "$CURRENT_SPEC" | ||
| else | ||
| # BSD/macOS sed | ||
| sed -i.bak "/### Functional Requirements/a\\ | ||
| $CLARIFICATION_LINE" "$CURRENT_SPEC" && rm -f "$CURRENT_SPEC.bak" | ||
| fi |
Copilot
AI
Oct 3, 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 multi-line sed command with line continuation is fragile and platform-dependent. Consider using a more portable approach like awk or a temporary file for better reliability across different Unix systems.
| if sed --version >/dev/null 2>&1; then | |
| # GNU sed | |
| sed -i "/### Functional Requirements/a\\$CLARIFICATION_LINE" "$CURRENT_SPEC" | |
| else | |
| # BSD/macOS sed | |
| sed -i.bak "/### Functional Requirements/a\\ | |
| $CLARIFICATION_LINE" "$CURRENT_SPEC" && rm -f "$CURRENT_SPEC.bak" | |
| fi | |
| # Use awk to insert the clarification line after "### Functional Requirements" in a portable way | |
| awk -v line="$CLARIFICATION_LINE" ' | |
| $0 ~ /### Functional Requirements/ { print; print line; next } | |
| { print } | |
| ' "$CURRENT_SPEC" > "$CURRENT_SPEC.tmp" && mv "$CURRENT_SPEC.tmp" "$CURRENT_SPEC" |
| 7. Add a single clarification line to the current spec.md file in the Requirements section: | ||
| - Add: `- [NEEDS CLARIFICATION: Review cross-feature alignment analysis in cross-feature-analysis.md - potential conflicts identified that may require spec adjustments]` | ||
| - This ensures `/clarify` will pick up alignment issues naturally | ||
| - **Note:** Scripts should extract this clarification text programmatically from this template to avoid duplication |
Copilot
AI
Oct 3, 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 instruction to extract clarification text programmatically from this template creates a tight coupling between the template and scripts. Consider defining this text in a shared configuration file or constant to reduce maintenance overhead.
| - **Note:** Scripts should extract this clarification text programmatically from this template to avoid duplication | |
| - **Note:** The clarification text is defined in a shared configuration file or constant for scripts to use, reducing maintenance overhead. |
Resolved merge conflicts by: - Updated all command names to use /speckit. prefix (e.g., /speckit.specify, /speckit.cross-feature) - Added /speckit.cross-feature to Optional Commands section in README.md - Integrated cross-feature mention into the /speckit.specify workflow - Updated enhancement commands display in CLI to include all optional commands - Updated all command references throughout templates and scripts The cross-feature command is now properly integrated with the new naming convention introduced in main branch, maintaining compatibility with the broader command structure. Changes include: - README.md: Added /speckit.cross-feature to Optional Commands table - src/specify_cli/__init__.py: Updated enhancement_lines with all optional commands - templates/commands/specify.md: Integrated cross-feature as optional next step - templates/commands/cross-feature.md: Updated all command references to use /speckit. prefix - templates/commands/analyze.md: Updated command references to /speckit. prefix - templates/commands/implement.md: Updated command reference to /speckit.tasks - scripts: Updated error messages to reference /speckit.specify 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
* main: (31 commits) docs: fix heading capitalization for consistency Update README.md Update tasks.md fix: update CODEBUDDY file path in agent context scripts Update README.md docs(readme): add /speckit.tasks step and renumber walkthrough A few more places to update from code review fix: align Cursor agent naming to use 'cursor-agent' consistently Update clarify.md Update vscode-settings.json Update instructions and bug fix Update __init__.py Consolidate Cursor naming Update CHANGELOG.md Git errors are now highlighted. Update __init__.py Refactor agent configuration Update src/specify_cli/__init__.py Update scripts/powershell/update-agent-context.ps1 Update AGENTS.md ...
|
I am closing this PR as it hard to keep this up to date and avoid conflicts, instead I have made the same capability available through Spec Kit Extensions. The details are in this discussion. |
Summary
This PR introduces a new
/cross-featurecommand that enables systems thinking analysis across features in Spec Kit. The command helps identify conflicts, dependencies, and emergent behaviors when adding new features to a project.Comparison between
/analyzeand/cross-feature.Or as a metaphor,
/analyzeis vertical alignment;/cross-featureis horizontal alignment.Here is a detailed writeup.
This is both a proposal / idea for a command as well as PR with initial Proof of Concept that I have tested. Happy to hear your feedback and work on improvements / recommendations.
Changes included:
/cross-featurecommand template with systems thinking frameworkKey features:
Test plan
AI Assistance Disclosure
This PR was developed with significant AI assistance (Claude Code). The implementation was guided by systems thinking principles and iteratively tested to ensure alignment with Spec Kit's workflow philosophy. All code has been reviewed and tested by the human contributor.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com