Skip to content

fix(ship): read test command from CLAUDE.md instead of hardcoding Rails+Node commands - #1102

Closed
JiayuuWang wants to merge 1 commit into
garrytan:mainfrom
JiayuuWang:contribot/fix-ship-step5-platform-agnostic-tests
Closed

JiayuuWang wants to merge 1 commit into
garrytan:mainfrom
JiayuuWang:contribot/fix-ship-step5-platform-agnostic-tests

Conversation

@JiayuuWang

Copy link
Copy Markdown
Contributor

Summary

Issue #1069 — /ship Step 5 hardcodes bin/test-lane + npm run test regardless of detected framework.

Step 4's TEST_BOOTSTRAP correctly detects the runtime, but Step 5 ignores it and unconditionally runs both commands. This violates the project's own platform-agnostic design rule in CLAUDE.md:

Skills must NEVER hardcode framework-specific commands, file patterns, or directory structures. Instead:

  1. Read CLAUDE.md for project-specific config (test commands, eval commands, etc.)
  2. If missing, AskUserQuestion — let the user tell you or let gstack search the repo
  3. Persist the answer to CLAUDE.md so we never have to ask again

In a Django project, bin/test-lane (Rails-specific) and npm run test (Node-specific) both fail silently with non-existent commands. The issue reporter hit this while shipping a Django app.

Fix

Replaced the hardcoded dual-command block in ship/SKILL.md.tmpl Step 5 with a CLAUDE.md-first lookup (matching TEST_COVERAGE_AUDIT_SHIP's existing pattern):

grep -A2 '## Testing' CLAUDE.md 2>/dev/null | head -20
  • If ## Testing section exists with a run command: use that command
  • If missing: search the project for the appropriate test command
  • If no test framework found: print "No test framework detected — skipping Step 5." and continue to Step 6

This ensures the test execution follows the same platform-agnostic pattern that the coverage audit already uses.

Test plan

  • Verify ship/SKILL.md.tmpl no longer contains hardcoded bin/test-lane or npm run test in Step 5
  • Run /ship in a non-Rails, non-Node project — Step 5 should read CLAUDE.md for the test command
  • Run /ship in a Rails project — should still find and execute the correct test command
  • Verify the skip message appears when no test framework is detected

🤖 Generated with Claude Code

…ls+Node commands

Issue garrytan#1069 — /ship Step 5 hardcodes `bin/test-lane` + `npm run test`
regardless of detected framework. Step 4's TEST_BOOTSTRAP correctly detects
the runtime, but Step 5 ignores it and runs both commands unconditionally.
This violates the project's own platform-agnostic design rule in CLAUDE.md:
"Skills must NEVER hardcode framework-specific commands."

Fixed by replacing the hardcoded dual-command block with a CLAUDE.md-first
lookup (matching TEST_COVERAGE_AUDIT_SHIP's pattern). Falls back to project
search for the appropriate test command. Prints "No test framework detected"
and skips if nothing is found — instead of failing with non-existent commands.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
time-attack pushed a commit to time-attack/gstack that referenced this pull request Jul 14, 2026
time-attack pushed a commit to time-attack/gstack that referenced this pull request Jul 14, 2026
@time-attack

Copy link
Copy Markdown
Contributor

@16francej — recommend closing this PR because it changes an obsolete ship template. Issue #1069 is the active tracker for trusted test-command discovery; please carry this PR’s project-configuration precedence insight and contributor attribution there, together with the useful stack-detection cases from #842.

time-attack pushed a commit to time-attack/gstack that referenced this pull request Jul 22, 2026
@capy-ai

capy-ai Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for this, @JiayuuWang. The fix is now on main: ship/SKILL.md.tmpl no longer hardcodes bin/test-lane or npm run test (already on main as of v1.91.16.0). Closing as superseded; if you still see the problem on the latest gstack, please open an issue with ./setup --status output.

@capy-ai capy-ai Bot closed this Oct 3, 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