agentleFS
samchonsamchon/ttsc/.agents/skills/typescript-go-sync/SKILL.md

typescript-go-sync

Skill359 starsChanged 18 days agoMITView on GitHub

Keeps packages/ttsc/shim synchronized with typescript-go and complete for plugin authors. Use before adding a shim re-export, bumping typescript-go, changing the shim audit, or chasing a missing compiler API.

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the generator derives it, run go run '-modfile=tools/gen_shims/go.mod' ./tools/gen_shims/main.go in packages/ttsc.

    line 13
  2. Very specific:

    Run the generator with GOWORK=off, then pnpm --filter ttsc shim:audit -fix.

    line 18

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

TypeScript-Go Shim

Each packages/ttsc/shim/<name> is a Go module re-exporting typescript-go's internal/<name>, the only compiler surface plugins can use. A missing re-export of an API in unmodified upstream is a ttsc bug.

Adding An API

  1. Find the symbol under $(go env GOMODCACHE)/github.com/microsoft/typescript-go@<version>/internal/<pkg>/.
  2. If the generator derives it, run go run '-modfile=tools/gen_shims/go.mod' ./tools/gen_shims/main.go in packages/ttsc; generated shim.go files are never edited. Otherwise list it in the directory's extra-shim.json, or write it in a file marked // gen_shims:hand-maintained, where an unexported symbol takes a bodiless //go:linkname declaration with import _ "unsafe".

Bumping typescript-go

  1. Update the identical require github.com/microsoft/typescript-go v0.0.0-<timestamp>-<hash> in every shim, packages/ttsc/go.mod, and each consumer that pins it, and refresh sums through the real module or workspace resolution. Never add permanent absolute replacements. go work sync can succeed while leaving a module stale; then set its requirements with go mod edit -require and run go mod download.
  2. Run the generator with GOWORK=off, then pnpm --filter ttsc shim:audit -fix.
  3. Fix hand-maintained files and extra-shim.json for upstream renames, signature changes, and export flips, keep previously exported enum families, and document public migrations in the AST and Checker guide.

Audit

CI runs pnpm --filter ttsc shim:audit. Accept a new gap into tools/shim_audit/baseline.json with -write-baseline only on purpose, and give every producer_exemptions entry a rationale. The audit proves only that code compiles, so add a runtime probe in packages/lint/linthost/ that walks a Checker loaded through loadProgram for each new graph-walk operation.

Consumer Validation

A shim change is proven only by a downstream plugin passing against it. Build and pack with your platform package, install the tarballs into ../typia or another consumer, and run a test that uses the API:

pnpm --filter ttsc --filter @ttsc/unplugin --filter ./packages/ttsc-linux-x64 -r --workspace-concurrency=1 build
pnpm --filter ttsc --filter @ttsc/unplugin --filter ./packages/ttsc-linux-x64 exec pnpm pack --out "../../experimental/tarballs/%s.tgz"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.