Make the guide state-aware and shorten the agent install prompt#45
Merged
Conversation
Field-tested with two simulated vibe-platform agent installs (Lovable-style bun fixture + mock manifest API); every change below traces to a finding. - New src/guide.ts: `guide` now inspects the project first (package manager, install state, .patchstackrc.json, build hooks, widget presence, framework) and prints a live ✔/✖ checklist with tailored commands — real site UUID substituted, framework-specific widget placement — before the full AGENT-INSTALL.md reference. Colors are TTY/NO_COLOR-gated. - Widget check verifies the userToken matches the provisioned siteUuid; a stale token (which silently no-ops) is flagged instead of passing. - scan/status/guide surface a non-default endpoint override loudly; both test agents had to read CLI source to rule out manifest redirection. - scan: fix dangling duplicate-versions list (>10 printed a bare colon), say "(npm ecosystem)" instead of "npm lockfile" (wrong for the bun node_modules walk), and name PATCHSTACK_ENVIRONMENT in the environment line. - AGENT-INSTALL.md: provisioned-ness keys off the siteUuid key (not file existence), chained-hook example, unified siteUuid/userToken naming, accurate bun path in the trust section, commit step includes the widget file. - README: 3-step install prompt (verify + scan + finish-the-checklist) that keeps the trust-critical spine inline while delegating the tail to the now-state-aware guide; refusal-mode rationale updated to match. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The new state-aware guide is comprehensive and backed by extensive, targeted tests. 🎯 Quality: 93% Elite · 📦 Size: Extra Large — strongly consider breaking this down 🛡️ Standards: no pre-flight fit check ran for this change — wire 📈 This month: Your 222nd PR — above team average · Averaging Excellent |
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.
Summary
Field-tested the AI-agent install flow with two simulated vibe-platform installs (Lovable-style bun fixture, mock manifest API, agents given only the README prompt) and rebuilt
guidearound what they hit.guideis now state-aware: it inspects the project (package manager, install state,.patchstackrc.json, build hooks, widget presence, framework) and prints a live ✔/✖ checklist with tailored commands — real site UUID substituted, framework-specific widget placement — before the fullAGENT-INSTALL.mdreference; the widget check also flags auserTokenthat doesn't match the provisionedsiteUuid, which would otherwise silently no-op.scan/status/guide(both test agents read CLI source to rule out manifest redirection), the dangling duplicate-versions list (>10 printed a bare colon) is fixed, and "npm lockfile" wording is corrected for the bunnode_moduleswalk.siteUuidkey rather than the file existing, chained-hook example, unifiedsiteUuid/userTokennaming, and the commit step includes the widget file.Test plan
npm run typecheckandnpm testgreen (143 tests, 15 new intests/guide.test.ts).🤖 Generated with Claude Code