You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore: apply shfmt and fix shellcheck warnings in scripts/bash #4805
scripts/bash/*.sh currently passes CI only because lint.yml runs shellcheck at --severity=error. At default severity there are 8 findings, and shfmt -d reports differences in all 6 files.
SC2155 (declare and assign separately): common.sh:71, create-new-feature.sh:217, create-new-feature.sh:254
SC1091 (sourced file not followed): check-prerequisites.sh:97, create-new-feature.sh:194, resolve-template.sh:6, setup-plan.sh:28, setup-tasks.sh:23
shfmt: formatting differs under the repo's .editorconfig (4-space indent)
Proposed: a behavior-neutral PR limited to scripts/bash, with no CI changes. Tightening the CI severity or adding a shfmt check can be a follow-up, as the comment in lint.yml already suggests.
AI disclosure: drafted with Claude Code (Claude Sonnet 5.5), acting on behalf of @jlec. Findings come from running shellcheck and shfmt locally.
scripts/bash/*.sh currently passes CI only because lint.yml runs shellcheck at --severity=error. At default severity there are 8 findings, and shfmt -d reports differences in all 6 files.
Proposed: a behavior-neutral PR limited to scripts/bash, with no CI changes. Tightening the CI severity or adding a shfmt check can be a follow-up.
The issue also identifies SC2155 findings in common.sh and create-new-feature.sh, SC1091 findings in five scripts, and formatting differences under the repository's .editorconfig 4-space indentation.
Restated
Bring the six Bash scripts under scripts/bash into the repository's configured shfmt style and address the reported non-error shellcheck findings, while preserving behavior and leaving CI policy unchanged.
The repository already runs shellcheck in .github/workflows/lint.yml, but limits it to --severity=error; the workflow comment explicitly says style findings such as SC2155 are deferred to a follow-up — [source: .github/workflows/lint.yml] (confidence: high, cited).
The repository's .editorconfig specifies four-space indentation for shell files, giving shfmt a documented formatting target — [source: .editorconfig] (confidence: high, cited).
The affected surface is the six tracked scripts in scripts/bash: check-prerequisites.sh, common.sh, create-new-feature.sh, resolve-template.sh, setup-plan.sh, and setup-tasks.sh — [source: scripts/bash/*.sh] (confidence: high, cited).
The issue reports eight default-severity shellcheck findings and shfmt differences in all six scripts; those findings are not independently reproduced in this assessment environment — [source: chore: apply shfmt and fix shellcheck warnings in scripts/bash #4805] (confidence: medium, cited).
Market & Context
The immediate alternative is to leave the scripts unchanged while CI continues to enforce only error-severity shellcheck findings; this avoids churn but preserves known style and analysis warnings — [source: .github/workflows/lint.yml, chore: apply shfmt and fix shellcheck warnings in scripts/bash #4805] (confidence: high, cited).
No external market or competitor context is relevant to this repository-maintenance request — [source: assessment scope] (confidence: medium, cited).
The lint workflow currently checks shellcheck error severity and does not run shfmt, so this cleanup alone would not enforce continued formatting or default-severity cleanliness — [source: .github/workflows/lint.yml] (confidence: high, cited).
Formatting and warning cleanup can create review noise or accidental behavior changes in shell scripts if the tool version or source-resolution assumptions differ from the reported environment — [source: chore: apply shfmt and fix shellcheck warnings in scripts/bash #4805, .editorconfig] (confidence: medium, cited).
Without a CI check for shfmt or default shellcheck severity, the cleanup may regress later — [source: .github/workflows/lint.yml] (confidence: high, cited).
Feature assessment — apply-shfmt-shellcheck · Stage 3/5: Problem
Problem Definition: Apply shfmt and fix shellcheck warnings in scripts/bash
Slug: apply-shfmt-shellcheck
Created: 2026-10-01T17:45:16Z
Inputs used: intake.md and research.md
Problem Statement
Spec Kit maintainers receive actionable formatting and default-severity shellcheck findings across the Bash tooling, but the current lint workflow only blocks error-severity findings and does not check shfmt. This leaves known maintainability issues unresolved and makes the repository's stated shell formatting convention difficult to verify consistently.
Affected Users & Stakeholders
Users: contributors modifying or reviewing scripts/bash — they encounter inconsistent formatting and warnings during local analysis.
Users: maintainers operating Spec Kit's shell tooling — they carry review and regression risk from warnings that CI does not currently surface.
Stakeholders: repository maintainers — they decide whether a behavior-neutral cleanup is worth accepting.
Stakeholders: downstream project users — they may be affected if shell-script cleanup accidentally changes execution behavior.
Goals
Reduce the reported default-severity shellcheck findings in the six Bash scripts.
Align the six scripts with the repository's four-space shell formatting convention.
Preserve existing script behavior and keep the change limited to scripts/bash.
Improve confidence that future maintenance work starts from a clean, readable baseline.
Non-Goals
Changing lint workflow severity or adding a shfmt CI check.
Refactoring shell-script behavior, interfaces, or unrelated scripts.
Adding new shell functionality or changing generated project output.
Claiming that warning cleanup alone provides complete shell-script correctness.
Success Metrics
shfmt -d reports no differences for the six affected scripts under the repository's .editorconfig convention (baseline: issue reports differences in all six; exact command/version unknown).
The eight issue-reported default-severity findings are resolved or explicitly justified without introducing new findings (baseline: eight reported; independent reproduction pending).
The diff is confined to scripts/bash (baseline: proposed scope).
Cost of Inaction
Known style and analysis warnings remain in the shell tooling while CI continues to report only error-severity shellcheck findings. Contributors must interpret avoidable warnings locally, and later cleanup becomes more difficult to review or may accumulate formatting drift.
Open Questions
[NEEDS CLARIFICATION: What exact shfmt version and invocation define the expected output?]
[NEEDS CLARIFICATION: Which behavior and smoke checks are sufficient for all six scripts?]
[NEEDS CLARIFICATION: How should SC1091 source-resolution findings be addressed?]
Concept: Apply shfmt and fix shellcheck warnings in scripts/bash
Slug: apply-shfmt-shellcheck
Created: 2026-10-01T17:45:16Z
Recommended option: Targeted cleanup with regression checks
Options
Option A — Targeted cleanup with regression checks
+- Sketch: Format the six scripts/bash files to the repository convention, address the eight reported warnings using behavior-neutral changes or documented source-resolution handling, and run focused lint plus representative deterministic checks before review.
+- Appetite: small
+- Trade-offs: Directly addresses the reported maintenance problem with limited scope and reviewable risk; it does not prevent future regressions because CI policy remains unchanged.
+- Rabbit holes: Shell source-path handling may expose assumptions about invocation directories; formatting can obscure a semantic change if the diff is not carefully reviewed.
Option B — Cleanup plus enforcement
+- Sketch: Perform the targeted cleanup and also make CI enforce shfmt and broader shellcheck coverage so the baseline stays clean.
+- Appetite: medium
+- Trade-offs: Provides durable enforcement and clearer contributor feedback; expands scope beyond the issue's behavior-neutral, scripts-only proposal and may require tool-version pinning or workflow maintenance.
+- Rabbit holes: CI portability, formatter version drift, and newly surfaced warnings outside the six scripts.
Option C — Do nothing / defer
+- Sketch: Leave the scripts and lint policy unchanged, accepting the reported warnings until a future maintenance pass or enforcement project.
+- Appetite: small
+- Trade-offs: Avoids immediate churn and behavior risk; preserves known maintainability debt and inconsistent local tooling results.
+- Rabbit holes: Deferred cleanup may grow, and later changes may mix formatting with functional edits.
Recommendation
Recommend Option A. It matches the issue's stated scope, addresses measurable reported findings, and keeps the likely change budget small while requiring evidence of behavior neutrality. Option B is a reasonable follow-up but should be assessed separately because it changes CI policy; Option C does not improve the documented baseline.
Out of Scope (for the recommended option)
Changes to .github/workflows/lint.yml or any CI severity/enforcement policy.
Formatting or warning cleanup outside scripts/bash.
Functional refactors, interface changes, or new shell features.
Broad shellcheck configuration changes that mask unrelated findings.
Assumptions to Validate
The issue's shfmt invocation and version can be reproduced or a repository-compatible formatter version can be identified.
SC1091 can be handled without weakening meaningful source validation.
Existing focused tests or smoke checks cover the affected script entry points sufficiently to detect behavior changes.
The issue identifies concrete findings across all six Bash scripts and a documented formatting convention, though user-facing impact is not demonstrated.
Evidence strength
adequate
The issue, lint workflow, editor configuration, and script inventory support the maintenance problem; exact tool versions and independent reproduction remain unknown.
Value vs. inaction
adequate
Cleanup would reduce known review and maintenance friction, while inaction preserves warnings; the value is primarily maintainability rather than an observed runtime defect.
Feasibility / appetite
adequate
A scripts-only cleanup is plausibly small and has a clear lightweight option, but source-resolution handling and behavior coverage need confirmation.
Strategic fit
adequate
The proposal supports repository maintainability and follows existing lint conventions without changing product scope; no stronger project-level strategy evidence was found.
Risk posture
weak
The main risks are identified, but the exact formatter/toolchain and sufficient behavior regression coverage are not yet established.
Verdict & Rationale
Needs clarification. The maintenance problem is credible and the targeted concept is appropriately bounded, but the assessment should not hand off to specification until the exact shfmt baseline, SC1091 treatment, and deterministic behavior checks are confirmed. These gaps are material because a behavior-neutral shell cleanup can still alter execution semantics, and the current CI does not enforce the proposed baseline.
If needs-clarification
Blocking questions:
[NEEDS CLARIFICATION: Which exact shfmt version, flags, and shellcheck invocation produced the reported results?]
[NEEDS CLARIFICATION: What focused regression or smoke checks cover each affected script and demonstrate behavior neutrality?]
[NEEDS CLARIFICATION: Should SC1091 be resolved by source-path configuration, annotations, or script changes without suppressing meaningful diagnostics?]
+- Revisit stage: research
Activity
Good "git" signature for claude with ED25519 key SHA256:L4c7gVsourKE4…
chore(scripts): apply shfmt and fix shellcheck warnings in scripts/bash
github-actions commentedon Oct 1, 2026
Feature assessment — apply-shfmt-shellcheck · Stage 1/5: Intake
Idea Intake: Apply shfmt and fix shellcheck warnings in scripts/bash
Idea (as captured)
The issue also identifies SC2155 findings in
common.shandcreate-new-feature.sh, SC1091 findings in five scripts, and formatting differences under the repository's.editorconfig4-space indentation.Restated
Bring the six Bash scripts under
scripts/bashinto the repository's configured shfmt style and address the reported non-error shellcheck findings, while preserving behavior and leaving CI policy unchanged.Origin & Context
First-Glance Unknowns
github-actions commentedon Oct 1, 2026
Feature assessment — apply-shfmt-shellcheck · Stage 2/5: Research
Idea Research: Apply shfmt and fix shellcheck warnings in scripts/bash
Users & Demand
Prior Art
.github/workflows/lint.yml, but limits it to--severity=error; the workflow comment explicitly says style findings such as SC2155 are deferred to a follow-up — [source:.github/workflows/lint.yml] (confidence: high, cited)..editorconfigspecifies four-space indentation for shell files, giving shfmt a documented formatting target — [source:.editorconfig] (confidence: high, cited).scripts/bash:check-prerequisites.sh,common.sh,create-new-feature.sh,resolve-template.sh,setup-plan.sh, andsetup-tasks.sh— [source:scripts/bash/*.sh] (confidence: high, cited).Market & Context
.github/workflows/lint.yml, chore: apply shfmt and fix shellcheck warnings in scripts/bash #4805] (confidence: high, cited).Data & Constraints
scripts/bash, and excludes CI changes — [source: chore: apply shfmt and fix shellcheck warnings in scripts/bash #4805] (confidence: high, cited)..github/workflows/lint.yml] (confidence: high, cited).common.sh:71,create-new-feature.sh:217, andcreate-new-feature.sh:254, plus SC1091 in five scripts — [source: chore: apply shfmt and fix shellcheck warnings in scripts/bash #4805] (confidence: high, cited).Evidence Against the Idea
.editorconfig] (confidence: medium, cited)..github/workflows/lint.yml] (confidence: high, cited).Gaps & Open Questions
Sources
github/spec-kit#4805(host: github.com, policy: allowlisted).github/workflows/lint.yml(repository source).editorconfig(repository source)scripts/bash/*.sh(repository source)github-actions commentedon Oct 1, 2026
Feature assessment — apply-shfmt-shellcheck · Stage 3/5: Problem
Problem Definition: Apply shfmt and fix shellcheck warnings in scripts/bash
Problem Statement
Spec Kit maintainers receive actionable formatting and default-severity shellcheck findings across the Bash tooling, but the current lint workflow only blocks error-severity findings and does not check shfmt. This leaves known maintainability issues unresolved and makes the repository's stated shell formatting convention difficult to verify consistently.
Affected Users & Stakeholders
scripts/bash— they encounter inconsistent formatting and warnings during local analysis.Goals
scripts/bash.Non-Goals
Success Metrics
shfmt -dreports no differences for the six affected scripts under the repository's.editorconfigconvention (baseline: issue reports differences in all six; exact command/version unknown).scripts/bash(baseline: proposed scope).Cost of Inaction
Known style and analysis warnings remain in the shell tooling while CI continues to report only error-severity shellcheck findings. Contributors must interpret avoidable warnings locally, and later cleanup becomes more difficult to review or may accumulate formatting drift.
Open Questions
github-actions commentedon Oct 1, 2026
Feature assessment — apply-shfmt-shellcheck · Stage 4/5: Concept
Concept: Apply shfmt and fix shellcheck warnings in scripts/bash
Options
Option A — Targeted cleanup with regression checks
+- Sketch: Format the six
scripts/bashfiles to the repository convention, address the eight reported warnings using behavior-neutral changes or documented source-resolution handling, and run focused lint plus representative deterministic checks before review.+- Appetite: small
+- Trade-offs: Directly addresses the reported maintenance problem with limited scope and reviewable risk; it does not prevent future regressions because CI policy remains unchanged.
+- Rabbit holes: Shell source-path handling may expose assumptions about invocation directories; formatting can obscure a semantic change if the diff is not carefully reviewed.
Option B — Cleanup plus enforcement
+- Sketch: Perform the targeted cleanup and also make CI enforce shfmt and broader shellcheck coverage so the baseline stays clean.
+- Appetite: medium
+- Trade-offs: Provides durable enforcement and clearer contributor feedback; expands scope beyond the issue's behavior-neutral, scripts-only proposal and may require tool-version pinning or workflow maintenance.
+- Rabbit holes: CI portability, formatter version drift, and newly surfaced warnings outside the six scripts.
Option C — Do nothing / defer
+- Sketch: Leave the scripts and lint policy unchanged, accepting the reported warnings until a future maintenance pass or enforcement project.
+- Appetite: small
+- Trade-offs: Avoids immediate churn and behavior risk; preserves known maintainability debt and inconsistent local tooling results.
+- Rabbit holes: Deferred cleanup may grow, and later changes may mix formatting with functional edits.
Recommendation
Recommend Option A. It matches the issue's stated scope, addresses measurable reported findings, and keeps the likely change budget small while requiring evidence of behavior neutrality. Option B is a reasonable follow-up but should be assessed separately because it changes CI policy; Option C does not improve the documented baseline.
Out of Scope (for the recommended option)
.github/workflows/lint.ymlor any CI severity/enforcement policy.scripts/bash.Assumptions to Validate
github-actions commentedon Oct 1, 2026
Feature assessment — apply-shfmt-shellcheck · Stage 5/5: Decision — verdict needs-clarification
Decision: Apply shfmt and fix shellcheck warnings in scripts/bash
Scorecard
Verdict & Rationale
Needs clarification. The maintenance problem is credible and the targeted concept is appropriately bounded, but the assessment should not hand off to specification until the exact shfmt baseline, SC1091 treatment, and deterministic behavior checks are confirmed. These gaps are material because a behavior-neutral shell cleanup can still alter execution semantics, and the current CI does not enforce the proposed baseline.
If needs-clarification
+- Revisit stage: research
refactor(scripts): apply shfmt and fix shellcheck warnings in scripts…