Skip to content

Make the guide state-aware and shorten the agent install prompt#45

Merged
ejntaylor merged 1 commit into
mainfrom
review-connect-guide-flow
Jul 13, 2026
Merged

Make the guide state-aware and shorten the agent install prompt#45
ejntaylor merged 1 commit into
mainfrom
review-connect-guide-flow

Conversation

@ejntaylor

Copy link
Copy Markdown
Contributor

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 guide around what they hit.

  • guide is 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 full AGENT-INSTALL.md reference; the widget check also flags a userToken that doesn't match the provisioned siteUuid, which would otherwise silently no-op.
  • README prompt shrinks to 3 steps (verify + scan + finish-the-checklist), keeping the field-tested refusal defenses inline while delegating the tail to the checklist, and making the flow idempotent on re-runs.
  • CLI trust/output fixes from the field test: endpoint overrides are surfaced loudly in 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 bun node_modules walk.
  • AGENT-INSTALL.md accuracy fixes: provisioned-ness keys off the siteUuid key rather than the file existing, chained-hook example, unified siteUuid/userToken naming, and the commit step includes the widget file.

Test plan

  • npm run typecheck and npm test green (143 tests, 15 new in tests/guide.test.ts).
  • End-to-end: two background agents completed the install unaided in the fixture — round 2 ran the checklist, did only the ✖ steps, re-ran to confirm all-green, and verified with a real build.

🤖 Generated with Claude Code

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>
@coderbuds

coderbuds Bot commented Jul 13, 2026

Copy link
Copy Markdown

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 assess-change-fit into your coding agents to catch size before opening.

📈 This month: Your 222nd PR — above team average · Averaging Excellent

See how your team is trending →

@ejntaylor ejntaylor merged commit c555177 into main Jul 13, 2026
4 checks passed
@ejntaylor ejntaylor deleted the review-connect-guide-flow branch July 13, 2026 20:25
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