add: Grok transfer lesson — same weatherwise program on a second model - #4
Open
rdtiv wants to merge 7 commits into
Open
add: Grok transfer lesson — same weatherwise program on a second model#4rdtiv wants to merge 7 commits into
rdtiv wants to merge 7 commits into
Conversation
Port the Grok mission skill, dual-driver rule, and landed.sh from 1269j. Drop 1269j site-law, operator-exec, and Vercel app-root text. Ignore both drivers' worktree roots so git clean -x cannot wipe live checkouts.
Install openai as a root dep, add grok* npm scripts, and teach check-docs.ts that grok-*.ts belong to docs/grok.md. Extract fromAnthropic/fromResponses so one usage.csv can price both vendors.
A store:false grok-4.6 call reported input_tokens as the full prompt and cached_tokens as a subset. Ledger input_tokens stays the remainder.
usage.ts is built by docs/typescript.md. Putting fromResponses and logGrokCall there forced the Claude tutorial to reprint them. Those helpers belong in src/grok-usage.ts / docs/grok.md instead.
docs/grok.md builds src/grok-*.ts. Ledger helpers live in grok-usage.ts so the Claude TypeScript document does not reprint them. Existing series docs only get a nav banner. Same usage.csv columns, same WeatherRequest.
Raise the project floor to Node 22 so Claude and Grok share one install. CI is 22.x and 24.x. grok.md now installs openai and adds each script the same way typescript.md does, instead of claiming they already exist.
This was referenced Aug 14, 2026
Replace they/theirs/someone/the owner with Claude, Grok, xAI, and your program. Plant the two ideas in §0 with what to type and what you will see. Add first-call failure table, checkpoints, and a restart ritual when flipping MEMORY.
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.
Closes #3.
A reader who finished
docs/typescript.mdrebuilds the same weather assistant against Grok. Transfer document, not a second 13-part course.What this is
docs/grok.mdownssrc/grok-*.ts. Claude’sdocs/typescript.md/src/usage.tsstay Claude (series-nav banner only).src/grok-usage.tsand write the same 15-columnusage.csv.fromResponsessubtractscached_tokenssoinput_tokensstays the uncached remainder.openai+ Responses API (baseURL: https://api.x.ai/v1). Not the AI SDK.npm install openaiand add eachgrok*script the same way the TypeScript lesson adds Claude scripts.Verify
npm run typechecknpm run verify:docs(both documents)Live-probed 2026-08-14 (
grok-4.6): Responses streaming,responses.parse+zodTextFormat,function_call.argumentsas a JSON string,web_search_callis server-side (loop onlyfunction_call),prompt_cache_keyis a first-class field.Do not merge unless you want this on
main. Operator owns merge.Does not touch issue #1 / PR #2 /
.claude/worktrees/.