create-hawk-app: make GitHub optional, verify the app actually renders - #1
Merged
Conversation
Reworked after watching the skill run end to end with a real novice setup. The run surfaced several places where the skill sent the operator down a dead end or spent the user's time on a wrong diagnosis. Preflight: - Replace preflight.mjs with preflight.sh (POSIX) and preflight.ps1 (PowerShell 5.1). The old script needed Node, which is exactly what is missing when preflight matters, so it never ran once in the live session. Both twins report the same table and exit codes. - Detect Windows node/npm/gh shadowing the Linux ones under /mnt in WSL2. That produced a "WSL 1 is not supported" error that had nothing to do with the real problem. - Treat the GitHub CLI as required rather than optional: the template is private, so even a local-only app cannot be downloaded without it. - Distinguish "not signed in" from "signed in but has no access". - Accept an existing empty destination instead of refusing it. - Check for OneDrive-synced destinations on Windows. - Drop a dead ternary and the unused --json mode. Skill guidance: - State supported platforms: macOS, Linux, WSL2, native Windows. Do not assume a POSIX shell, a bash profile, or a ~/ destination. - Never try to answer a privilege prompt. Neither the agent's shell nor an in-session ! prompt can supply a sudo password or click a UAC dialog; hand the command over and verify afterwards. - Document the no-password install path that actually worked, for all platforms, with verified per-platform archive names. - Add a native-build ladder. The live run installed build-essential, 52 system packages, on the strength of an empty GitHub Releases page, when the package ships prebuilds inside the npm tarball and needed no toolchain at all. - Make preflight a gate on entering phase 4, with an inline fallback so a broken helper never ends the session. - Record absolute bin paths after a non-default install; a profile edit does not reach the running shell. - Offer the first commit at handoff. A novice does not know commits exist, so waiting to be asked leaves their work unprotected. - Name template gaps during the brief and park guesses under Open questions. preflight.ps1 is unverified on a real Windows machine; WSL interop was unavailable to test it. It is treated as a convenience, not a dependency, so a failure degrades to inline checks. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Findings from a live 2h35m run of the skill. GitHub was mandatory on every path, including the one that never leaves the computer, because the template repository was private. That forced a GitHub account on a skill whose stated audience has never programmed or used Git. Downloading a public template needs Git and nothing else: - preflight gains --github yes|no|unknown (default no) and a third report level, "Worth knowing", which reports without blocking. Only "Needs attention" still exits 1, so a machine with no gh at all can now pass. - Template access is probed with an anonymous git ls-remote. If that fails but a credentialed one succeeds, the repository has gone private again and the run says so, instead of passing on borrowed credentials and stranding the next student on a fresh machine. - The GitHub question moves to phase 1, where it decides which tools are needed; gh is installed just in time, and only on a yes. The this-computer-only path is a plain `git clone`. The app rendered as unstyled text and every check still passed, because /health returns JSON and `npm run check` builds for production while phase 7 starts the dev server. Phase 7 now runs `npm run check:render` against the server it just started and asks the user to confirm what they see before anything is called working. The Playwright rule is scoped to preflight rather than read as a ban, since not being able to see the page is what turned a one-line CSP fault into two wrong diagnoses. Git ambushed the user at the end: the commit offer was followed by a second unplanned prompt because user.name and user.email were unset, and they left with "let just skip git and build the app". Identity is now read in phase 5 and folded into a single commit question, a decline is accepted once and never re-asked, and the skill states that it stops at the receipt -- the previous run slid from handoff into building a whole feature, skipping the plan-approval gate AGENTS.md requires. Node was installed by piping curl into bash -- the pattern SKILL.md forbids and which the skill itself offered as recommended. nvm appends to ~/.bashrc below Ubuntu's non-interactive early return, so node stayed invisible to the agent's own shell and ~25 later commands carried an absolute-path prefix. The reference now fixes an install order, prefers symlinking into ~/.local/bin (already on PATH, no profile edit -- which is why the gh install caused no trouble), and requires verifying with both `bash -ic` and `bash -c`, which disagree. Also: version was 0.3.0 in .codex-plugin and 0.4.0 elsewhere; all now 0.5.0. preflight.sh verified for the no-gh, --github yes, and bad-argument cases. preflight.ps1 carries the same changes but could not be executed here -- WSL interop is disabled, so it needs a run on Windows before release. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KwyEjaCaTwhkRkTUMq9hep
tytremblay
approved these changes
Aug 28, 2026
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.
Findings from a live 2h35m run of
create-hawk-appthat produced a working app but hit three avoidable walls. None of them were the model going off-script — the skill and the template told it to do those things.1. GitHub was mandatory on every path
The template repository was private, so even the "never leaves this computer" path needed
ghand a signed-in account. SKILL.md called it "required, not optional". That forces a GitHub account on a skill whose stated audience "has never programmed or used Git".FRC2713/hawk-app-templateis now public, so downloading it needs Git and nothing else.preflight.sh/.ps1gain--github yes|no|unknown(defaultno) and a third report level, Worth knowing, that reports without blocking. Only Needs attention still exits 1.git ls-remote. If that fails but a credentialed one succeeds, the repo has gone private again and preflight says so — instead of passing on borrowed credentials and stranding the next student on a fresh machine.ghis installed just in time, only on a yes. The this-computer-only path is a plaingit clone.Verified: with
ghabsent from PATH and an empty environment, preflight now exits 0 and an anonymous clone succeeds.2. The app rendered as unstyled text and every check passed
The template shipped
security.csp: true; Astro only hashes inline styles at build time, so the dev server's inline Tailwind was blocked./healthreturns JSON andnpm run checkbuilds for production, so nothing noticed. Fixed in FRC2713/hawk-app-template#1.Here, phase 7 now runs
npm run check:renderagainst the server it just started, falls back to an inline CSP probe on older apps, and asks the user to confirm what they see before anything is called working. The "never treat Playwright browsers as initial requirements" rule is scoped to preflight rather than read as a ban — not being able to see the page is what turned a one-line fault into two confident wrong diagnoses.3. Git ambushed the user at the end
The commit offer was followed by a second unplanned prompt, because
user.name/user.emailwere unset. The user left with "let just skip git and build the app" — and the skill had no instruction for what happens next, so it improvised straight into building an entire feature, skipping the plan-approval gateAGENTS.mdrequires.Identity is now read in phase 5, folded into a single commit question, a decline is accepted once and never re-asked, and the skill states plainly that it stops at the receipt.
Also: Node installed where the agent couldn't see it
The run piped
curlintobashto install nvm — the pattern SKILL.md forbids, offered by the skill itself as recommended. nvm appends to~/.bashrcbelow Ubuntu's non-interactive early return, sonodestayed invisible to the agent's own shell and ~25 later commands carried an absolute-path prefix.platform-setup.mdnow fixes an install order, prefers symlinking into~/.local/bin(already on PATH, no profile edit — which is exactly why theghinstall caused no trouble in the same session), and requires verifying with bothbash -icandbash -c, which disagree.Plus: version was
0.3.0in.codex-pluginand0.4.0everywhere else; all now0.5.0.Verification
preflight.shexercised for: default/no-gh (exit 0),--github yeswithout gh (exit 1), no gh on PATH at all (exit 0), bad flag value (exit 2).git clone→ remove remote →npm ci→doctor→dev→check:render, all green.preflight.ps1carries the same changes but could not be executed here — WSL interop is disabled on this machine. It needs a run on Windows before release.🤖 Generated with Claude Code
https://claude.ai/code/session_01KwyEjaCaTwhkRkTUMq9hep