Repository navigation
refactor: tested scripts for command shell programs + real YAML frontmatter check - #120
Merged
Merged
Conversation
…tmatter as YAML (#112, #109) templates/_scripts/ now holds design-debt, debt-measure, baseline-refresh, design-pin and design-compare; map, debt, plan and verify call them. scripts/test-scripts.sh runs them against fixture projects with a fake swiftlint, from validate.sh. Fixes design-debt skipping paths with spaces. validate.sh parses frontmatter with Ruby's YAML parser; 24 list-shaped argument-hints are quoted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #112. Closes #109.
In plain words
Several commands carried 20–40 line shell programs that the AI retyped on every run, and nothing checked them. They now live in real script files, and every check run tests them against small sample projects. The validator also now reads each command's settings block the same way Claude Code does, so a broken one fails here instead of only on GitHub. Doing this turned up two real bugs, both fixed.
What changed
Scripts (#112).
templates/_scripts/, reached through the~/.claude/swiftship-templateslink for both plugin and manual installs:design-debt.shmapStep 4.4debt-measure.shdebtStep 1baseline-refresh.shdebtStep 6design-pin.shplanDesign Pindesign-compare.shverify3.7cTests.
scripts/test-scripts.shruns every script againsttests/fixtures/app, a sample app with folder and file names containing spaces, a test folder, and a token folder. It also covers an empty project, baseline growth vs new rules, and design changes.swiftlintstands in for the real one, so the tests run on GitHub's Linux machines without Xcode.validate.shruns the tests as check feat: optional ASC metadata + What's New push (Phase 5) #8.YAML check (#109).
scripts/check-frontmatter.shparses each command's and agent's settings block with Ruby's YAML parser (present on macOS and Ubuntu). It fails on:argument-hintthat isn't textBugs found along the way
map's design-debt measure split file paths on spaces. It also missed test folders likeApp Tests/. ChantFlow read 53%; the real figure is 28%, now that itsChantFlow Watch App/views are counted. Antics (13%) and Specimen (36%) are unchanged.argument-hint(e.g.[phase-number]) read as a list, not text. They're now quoted.privacy.mdhad an empty hint, now removed.Tested
./scripts/validate.shpasses, including 22 script and frontmatter tests.claude plugin validate .passes.design-debt.shanddebt-measure.shwere also run on Antics, Specimen and ChantFlow.🤖 Generated with Claude Code