Skip to content

Update for better maintainability - #406

Merged
localden merged 36 commits into
mainfrom
consolidate-scripts
Sep 21, 2025
Merged

localden merged 36 commits into
mainfrom
consolidate-scripts

Conversation

@localden

Copy link
Copy Markdown
Contributor

Updates that make general QOL improvements for better project maintainability.

Copilot AI review requested due to automatic review settings September 20, 2025 18:20

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings September 20, 2025 18:52

This comment was marked as outdated.

localden and others added 2 commits September 20, 2025 11:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 20, 2025 19:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings September 20, 2025 19:27

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 20, 2025 20:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings September 20, 2025 22:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 28 out of 29 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.

Comment thread templates/plan-template.md Outdated
Comment thread scripts/bash/update-agent-context.sh Outdated
Comment thread scripts/bash/create-new-feature.sh Outdated
Comment thread scripts/powershell/create-new-feature.ps1 Outdated
localden and others added 2 commits September 20, 2025 15:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 21, 2025 02:54
localden and others added 2 commits September 20, 2025 19:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 21, 2025 04:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 29 out of 30 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

5. **Update agent file incrementally** (O(1) operation):
- Run `{SCRIPT}` for your AI assistant
- Run `{SCRIPT}`
**IMPORTANT**: Execute it exactly as specified above. Do not add or remove any arguments.

Copilot AI Sep 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instruction 'Execute it exactly as specified above' refers to something that isn't actually specified in the visible context. This could be confusing since there's no specific execution command shown above this line.

Suggested change
**IMPORTANT**: Execute it exactly as specified above. Do not add or remove any arguments.
**IMPORTANT**: When the actual script command is provided, execute it exactly as shown, without adding or removing any arguments.

Copilot uses AI. Check for mistakes.
Comment on lines +151 to +154
grep "^\*\*${field_pattern}\*\*: " "$plan_file" 2>/dev/null | \
head -1 | \
sed "s/^**${field_pattern}**: //" | \
sed "s|^\*\*${field_pattern}\*\*: ||" | \
sed 's/^[ \t]*//;s/[ \t]*$//' | \

Copilot AI Sep 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The regex pattern uses escaped asterisks \*\* which creates unnecessary complexity. Consider using a more readable approach or add a comment explaining why the asterisks need to be escaped in this context.

Copilot uses AI. Check for mistakes.
Comment thread scripts/bash/common.sh
if [[ -d "$dir" ]]; then
local dirname=$(basename "$dir")
if [[ "$dirname" =~ ^([0-9]{3})- ]]; then
local number=${BASH_REMATCH[1]}

Copilot AI Sep 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The arithmetic expansion $((10#$number)) forces base-10 interpretation to handle potential leading zeros, but this could be clearer with a comment explaining why this is necessary for proper numeric comparison.

Suggested change
local number=${BASH_REMATCH[1]}
local number=${BASH_REMATCH[1]}
# Force base-10 interpretation to handle leading zeros (e.g., "007" -> 7)

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings September 21, 2025 07:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 31 out of 32 changed files in this pull request and generated 7 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread scripts/bash/update-agent-context.sh Outdated
Comment thread scripts/powershell/update-agent-context.ps1
Comment thread scripts/bash/update-agent-context.sh
Comment thread scripts/bash/update-agent-context.sh
Comment thread scripts/bash/common.sh Outdated
Comment thread scripts/powershell/update-agent-context.ps1
Comment thread scripts/powershell/update-agent-context.ps1 Outdated
localden and others added 2 commits September 21, 2025 00:44
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 21, 2025 07:45
localden and others added 2 commits September 21, 2025 00:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 32 out of 33 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread scripts/powershell/update-agent-context.ps1
Comment thread scripts/bash/update-agent-context.sh Outdated
Comment thread src/specify_cli/__init__.py
localden and others added 2 commits September 21, 2025 00:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 21, 2025 07:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 32 out of 33 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.

Comment on lines +153 to +154
sed "s|^\*\*${field_pattern}\*\*: ||" | \
sed 's/^[ \t]*//;s/[ \t]*$//' | \

Copilot AI Sep 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple sed calls can be combined into a single sed command for better performance. Consider using: sed 's|^**'"$field_pattern"'**: ||; s/^[ \t]//; s/[ \t]$//' for improved efficiency.

Suggested change
sed "s|^\*\*${field_pattern}\*\*: ||" | \
sed 's/^[ \t]*//;s/[ \t]*$//' | \
sed "s|^\*\*${field_pattern}\*\*: ||;s/^[ \t]*//;s/[ \t]*$//" | \

Copilot uses AI. Check for mistakes.
$regex = "^\*\*$([Regex]::Escape($FieldPattern))\*\*: (.+)$"
Get-Content -LiteralPath $PlanFile | ForEach-Object {
if ($_ -match $regex) {
$val = $Matches[1].Trim()

Copilot AI Sep 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex uses $Matches[1] but the capture group is actually the second group (index 1). However, the intended capture should be $Matches[2] since the first group is the escaped field pattern and the second group (.+) contains the actual value.

Suggested change
$val = $Matches[1].Trim()
$val = $Matches[2].Trim()

Copilot uses AI. Check for mistakes.
if [ -f "$TEMPLATE" ]; then cp "$TEMPLATE" "$SPEC_FILE"; else touch "$SPEC_FILE"; fi

# Set the SPECIFY_FEATURE environment variable for the current session
export SPECIFY_FEATURE="$BRANCH_NAME"

Copilot AI Sep 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The export statement only affects the current script's environment. Consider documenting that users need to manually export this variable in their shell session, or provide instructions for persistent environment variable setup.

Copilot uses AI. Check for mistakes.
@@ -158,11 +161,11 @@ build_variant() {
mkdir -p "$base_dir/.windsurf/workflows"
generate_commands windsurf md "\$ARGUMENTS" "$base_dir/.windsurf/workflows" "$script" ;;
codex)

Copilot AI Sep 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The path change from '.codex/commands' to '.codex/prompts' should be documented in the commit message or comments, as this represents a breaking change for existing Codex integrations.

Suggested change
codex)
codex)
# BREAKING CHANGE: Codex integration path changed from '.codex/commands' to '.codex/prompts'.
# Existing Codex integrations expecting '.codex/commands' will need to be updated.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings September 21, 2025 08:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 34 out of 35 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

scripts/bash/check-prerequisites.sh:1

  • Line 62 contains PowerShell syntax in a bash script. The variable assignment should use bash syntax: has_git=$(test -d \"$REPO_ROOT/.git\" && echo \"true\" || echo \"false\")
#!/usr/bin/env bash

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread scripts/powershell/check-prerequisites.ps1 Outdated
Comment thread .github/workflows/scripts/create-release-packages.sh
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 21, 2025 08:48
@localden
localden merged commit 1a84b4b into main Sep 21, 2025
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 34 out of 35 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.

Comment on lines +26 to +28
param(
[Parameter(Position=0)]
[ValidateSet('claude','gemini','copilot','cursor','qwen','opencode','codex','windsurf')]

Copilot AI Sep 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The ValidateSet attribute should be consistent across all scripts. Consider defining this list as a constant or shared variable to ensure consistency and easier maintenance when adding new agents.

Suggested change
param(
[Parameter(Position=0)]
[ValidateSet('claude','gemini','copilot','cursor','qwen','opencode','codex','windsurf')]
# Define agent types as a constant array for consistency
$AGENT_TYPES = @('claude','gemini','copilot','cursor','qwen','opencode','codex','windsurf')
param(
[Parameter(Position=0)]
[ValidateSet($AGENT_TYPES)]

Copilot uses AI. Check for mistakes.
Comment on lines +152 to +155
check_file "$RESEARCH" "research.md"
check_file "$DATA_MODEL" "data-model.md"
check_dir "$CONTRACTS_DIR" "contracts/"
check_file "$QUICKSTART" "quickstart.md"

Copilot AI Sep 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check_file and check_dir functions are being called but are not defined in this script. These functions need to be defined or sourced from common.sh.

Copilot uses AI. Check for mistakes.
Comment on lines +129 to +135
Test-FileExists -Path $paths.RESEARCH -Description 'research.md' | Out-Null
Test-FileExists -Path $paths.DATA_MODEL -Description 'data-model.md' | Out-Null
Test-DirHasFiles -Path $paths.CONTRACTS_DIR -Description 'contracts/' | Out-Null
Test-FileExists -Path $paths.QUICKSTART -Description 'quickstart.md' | Out-Null

if ($IncludeTasks) {
Test-FileExists -Path $paths.TASKS -Description 'tasks.md' | Out-Null

Copilot AI Sep 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functions Test-FileExists and Test-DirHasFiles are being called but are not defined in this script or imported from common.ps1. These functions need to be defined or the calls should be replaced with appropriate PowerShell equivalents.

Suggested change
Test-FileExists -Path $paths.RESEARCH -Description 'research.md' | Out-Null
Test-FileExists -Path $paths.DATA_MODEL -Description 'data-model.md' | Out-Null
Test-DirHasFiles -Path $paths.CONTRACTS_DIR -Description 'contracts/' | Out-Null
Test-FileExists -Path $paths.QUICKSTART -Description 'quickstart.md' | Out-Null
if ($IncludeTasks) {
Test-FileExists -Path $paths.TASKS -Description 'tasks.md' | Out-Null
if (Test-Path $paths.RESEARCH) {
Write-Output " [x] research.md"
} else {
Write-Output " [ ] research.md (missing)"
}
if (Test-Path $paths.DATA_MODEL) {
Write-Output " [x] data-model.md"
} else {
Write-Output " [ ] data-model.md (missing)"
}
if ((Test-Path $paths.CONTRACTS_DIR) -and (Get-ChildItem -Path $paths.CONTRACTS_DIR -File -ErrorAction SilentlyContinue | Select-Object -First 1)) {
Write-Output " [x] contracts/"
} else {
Write-Output " [ ] contracts/ (missing or empty)"
}
if (Test-Path $paths.QUICKSTART) {
Write-Output " [x] quickstart.md"
} else {
Write-Output " [ ] quickstart.md (missing)"
}
if ($IncludeTasks) {
if (Test-Path $paths.TASKS) {
Write-Output " [x] tasks.md"
} else {
Write-Output " [ ] tasks.md (missing)"
}

Copilot uses AI. Check for mistakes.
Comment on lines +164 to 166
mkdir -p "$base_dir/.codex/prompts"
generate_commands codex md "\$ARGUMENTS" "$base_dir/.codex/prompts" "$script" ;;
esac

Copilot AI Sep 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The directory structure for Codex has changed from .codex/commands to .codex/prompts but this change should be documented or commented to explain why the directory structure differs from other agents.

Suggested change
mkdir -p "$base_dir/.codex/prompts"
generate_commands codex md "\$ARGUMENTS" "$base_dir/.codex/prompts" "$script" ;;
esac
# Note: Codex uses `.codex/prompts` instead of `.codex/commands` to match its expected directory structure.
# This differs from other agents, which use a `commands` subdirectory. See Codex integration docs for details.
mkdir -p "$base_dir/.codex/prompts"
generate_commands codex md "\$ARGUMENTS" "$base_dir/.codex/prompts" "$script" ;;

Copilot uses AI. Check for mistakes.
jellydn pushed a commit to jellydn/spec-kit that referenced this pull request Sep 30, 2025
@mnriem
mnriem deleted the consolidate-scripts branch February 18, 2026 22:57
TheChrisHatfield pushed a commit to TheChrisHatfield/spec-kit that referenced this pull request Aug 30, 2026
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