Skip to content

refactor: clean the core shell and its comments - #26

Merged
ttncode merged 10 commits into
mainfrom
refactor/core-shell
Sep 16, 2026
Merged

ttncode merged 10 commits into
mainfrom
refactor/core-shell

Conversation

@ttncode

@ttncode ttncode commented Sep 16, 2026

Copy link
Copy Markdown
Owner

What this changes

PR 2 of 5 (spec: docs/superpowers/specs/2026-09-16-clean-shell-and-comments-design.md). Covers scaffold, lib/*.sh, scripts/*.sh and common/install.sh.

  • Comments: deletes comments that restate code, narrate history or repeat an ADR. Keeps short why/landmine lines.
  • Shell rules: no [ ] tests remain (all are now [[ ]]/(( ))). printf replaces echo wherever an expansion is printed. No local x="$(…)" remains.
  • Functions: long functions are split at nameable seams (cmd_add, cmd_wizard, init_project, lint_adapter_env, apply_update_patch, main in install.sh and others). Functions whose names docs cite keep their names and contracts.
  • common/install.sh: now set -euo pipefail; it was -uo pipefail. Every step in main is already guarded.
  • .git-blame-ignore-revs: added, pointing at the shfmt commit from chore(lint): shellcheck and shfmt every tracked shell file #25.

No user-visible string, exit code or generated file changes. The only exception is bash's own ${1:?} message in adapter-matrix.sh, which now names a different line number because the header got shorter.

How it was verified

  • Lint: mise run lint exits 0.
  • Tests: mise run test-runner passes 265/265.
  • Generated projects: mise run checklist exits 0 in both
    • scaffold new --api flask --web nextjs --db postgres --cache redis
    • scaffold new --api nestjs --db mongodb
  • Review: a task review found no behaviour change. Its one finding was a deleted header sentence that tests/workflows.bats cites, restored in a26f8db.

Found and left alone (pre-existing, out of scope):

  • set_release_secrets passes the private key via --body, so it is visible in ps.
  • pnpm_install runs cd unguarded.
  • The found flag in apply_service_dockerfile is dead.

Checklist

  • mise run lint passes
  • mise run test-runner passes
  • New behaviour has a test that fails without the change
  • Docs that describe changed behaviour were updated in the same commit
  • No unrelated changes

@ttncode
ttncode merged commit 9d4f6eb into main Sep 16, 2026
21 checks passed
@ttncode
ttncode deleted the refactor/core-shell branch September 16, 2026 13:55
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.

1 participant