Skip to content

Fix LLM rules setup and update LLM instructions - #2623

Merged
eandre merged 1 commit into
mainfrom
fix-llm-rules
Oct 26, 2026
Merged

eandre merged 1 commit into
mainfrom
fix-llm-rules

Conversation

@marcuskohlberg

@marcuskohlberg marcuskohlberg commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Fixes bugs in encore app create / encore llm-rules init rule generation and in the TS/Go LLM instructions they install (AGENTS.md, .claude/CLAUDE.md, Cursor, Copilot, Zed).

CLI (llm_rules/tool.go, app/create.go)

  • Panic fix: createApp read appResp.AppId after daemon.CreateApp failed (nil pointer). Now uses GetAppId().
  • "None" selected: skips the download, so offline users no longer see "Failed to setup LLM rules".
  • Download: checks the HTTP status (a 404/rate-limit page used to be written as the rules file), adds a 30s timeout, removes the duplicate "Downloading" line.
  • Version skew: GA builds fetch refs/tags/<version> and fall back to main, so instructions only describe tools/commands that CLI has. Trade-off: content fixes reach a CLI only from the next release on.
  • JSONC: .vscode/mcp.json and .zed/settings.json are parsed with hujson instead of failing on comments. Comments are still dropped on rewrite.
  • VS Code: no longer writes an MCP entry with an empty --app=.

Instructions (both files)

  • Remove wait_for_subscription_message and call_endpoint's retry_until. Both were reverted in Revert "cli/daemon/mcp: synchronous Pub/Sub probe + retry-aware call_endpoint" #2460 but were still advertised.
  • MCP section is editor-agnostic. It no longer assumes .mcp.json / mcp__encore-local__ / Glob/Grep/Read, drops the wrong "20 tools" count (18 on main) and the dangling "When NOT to use it" reference.
  • New Encore Cloud access section covering:
    • CLI login: whoami check, ask the user to run auth login, ENCORE_AUTH_KEY for CI.
    • Cloud MCP setup: OAuth vs API key, configs for Claude Code/Cursor/VS Code/Zed, docs link.

TS fixes

  • Missing backticks in the template literal.
  • getTodoTitle was async without a Promise return type, and its queryRow had no row generic.
  • Removed the Go-only et.Topic tip.
  • https:/// URL and browser-only credentials.
  • Apollo example used require("apollo-server"); now imports @apollo/server.
  • Test DB claim ("per-file transaction rollback") now matches the docs.
  • Smaller: hello.test.ts naming, missing Service import, Node 22+, --auth-key removed from the CLI reference.

Go fixes

  • encore.app is JSON, not CUE.
  • type FooBar struct.
  • Undefined cluster in the cache example.
  • Missing //encore:service.
  • pgx v5.
  • Clerk secrets struct + --type flags. The SDK is left on v1 to match encoredev/examples/clerk.

Testing

  • go build, go vet and go test ./cli/cmd/encore/app/ pass.
  • An ad-hoc test (not committed) checked JSONC parsing, the no-download path for "None", no .vscode without an app slug, and that a 404 returns an error.
  • The Cursor/VS Code/Zed Cloud MCP snippets follow each editor's documented format but haven't been tried in those editors.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

CLI:
- Don't panic when the daemon fails to create the app (nil appResp).
- Skip downloading instructions when no tool is selected.
- Check the HTTP status and set a timeout when downloading, so error
  pages are never written as rule files.
- Fetch instructions from the CLI's release tag, falling back to main,
  so they only describe commands and MCP tools that version has.
- Parse JSONC editor configs (.vscode/mcp.json, .zed/settings.json).
- Don't write a VS Code MCP config with an empty --app.

Instructions:
- Remove wait_for_subscription_message and retry_until, reverted in #2460.
- Make the MCP section editor-agnostic; the same text is installed for
  Cursor, VS Code, Zed and AGENTS.md, not only Claude Code.
- Add an Encore Cloud access section: CLI login and Cloud MCP setup/auth.
- Fix invalid code samples and wrong claims in the TS and Go files.
@marcuskohlberg
marcuskohlberg requested a review from eandre October 26, 2026 16:24
@eandre
eandre merged commit c288144 into main Oct 26, 2026
14 checks passed
@eandre
eandre deleted the fix-llm-rules branch October 26, 2026 17:00
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