-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
base: main
Are you sure you want to change the base?
Conversation
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
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 <[email protected]>
* 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-feature
command 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
/specify
and/plan
commands
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 <[email protected]>
- 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 <[email protected]>
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/') |
Copilot uses AI. Check for mistakes.
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: "([^"]+)"') { |
Copilot uses AI. Check for mistakes.
$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" |
Copilot uses AI. Check for mistakes.
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.
Copilot uses AI. Check for mistakes.
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 <[email protected]>
…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 <[email protected]>
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:]]*$//') |
Copilot uses AI. Check for mistakes.
|
||
# 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 "," |
Copilot uses AI. Check for mistakes.
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" |
Copilot uses AI. Check for mistakes.
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. |
Copilot uses AI. Check for mistakes.
Summary
This PR introduces a new
/cross-feature
command 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
/analyze
and/cross-feature
.Or as a metaphor,
/analyze
is vertical alignment;/cross-feature
is 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-feature
command 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 [email protected]