Skill: Extend Octane core
Use this when changing core runtime, compiler, AST/TSRX transforms, SSR, hydration, or public octane APIs.
Read first
AGENTS.md
.rulesync/rules/core-engineering.md
README.md
docs/differences-from-react.md
- Owning source comments and nearby tests
Required preflight
Before editing, write down:
- the consumer-observable contract and invariants;
- affected execution modes (dev/prod, client/server, render/hydrate, error/abort);
- hot paths and expected call frequency;
- a credible failing behavioral test for a bug, or a relevant benchmark baseline
for an optimization.
Assume framework-fundamental code is performance-sensitive until the call graph
shows otherwise. Use the performance-audit skill alongside this skill whenever
the change can affect per-component, per-render, per-node, compiler-output, SSR,
hydration, scheduling, reconciliation, or bundle costs.
Every change lands with a regression test
No exceptions, and not only for bug fixes. Core code multiplies across every
Octane application, so each change ships with a test that would catch the
regression it could introduce.
- Bug fix: the test reproduces the report and fails before the fix.
- New behavior: the test pins the new contract, and a separate one pins the
neighbouring behavior the change could have disturbed.
- Refactor or optimization: behavior is supposed to be identical, so the test
pins the behavior being preserved. "The existing tests still pass" is not
enough on its own; if no existing test would have caught the breakage you were
worried about, that gap is the test to add.
A test only counts once you have seen it fail. Break the implementation
deliberately, confirm the test goes red, then restore. If it stays green it is
not protecting anything.
Cover the execution modes the change actually reaches: dev and prod compile,
client and server, render and hydrate, and the error, abort, and cleanup paths.
Assert consumer-observable behavior, never internals; .rulesync/rules/testing.md
sets the observation boundary and the harness to use.
Exact render counts, allocation identity, and codegen size are optimization
claims, so they belong in the benchmark ratio system with semantic controls
rather than in a correctness test.
Decide owner
- Client behavior/hooks/events/refs/scheduler/context/Suspense/transitions/reconciler:
packages/octane/src/runtime.ts
- SSR/server render:
packages/octane/src/runtime.server.ts, packages/octane/src/server/index.ts
- Compiler/AST/TSRX lowering/Vite/Volar:
packages/octane/src/compiler/*
- Public API:
packages/octane/src/index.ts, constants.ts, README/types/tests
- Vite metaframework behavior:
packages/vite-plugin-octane/*
Compiler/AST workflow
- Add a minimal
.tsrx or .tsx fixture under packages/octane/tests/_fixtures/.
- Add the regression test: assert runtime behavior, or emitted behavior through the public compiler path.
- Inspect
compile.js and any @tsrx/core AST assumptions.
- Preserve source-location/dev diagnostics where applicable.
- Ensure generated code still works with hook-slot injection and server/client paths.
Runtime workflow
- Add the regression test before patching, and watch it fail.
- Identify whether behavior is mount, update, deletion, hydration, event delegation, scheduling, or effect flushing.
- Read nearby runtime comments; treat them as design spec.
- Preserve intentional divergences from React.
- For React parity, use conformance or differential harness appropriately.
Public API workflow
- Update exports, and add a test covering the new or changed surface.
- Update README/docs if user-facing.
- Add changeset unless docs/test-only.
- Consider ecosystem binding impacts and aliases in
vitest.config.js.
Validation
- New/changed targeted tests.
- Nearby core tests.
pnpm typecheck for API/compiler TS changes.
pnpm test for broad runtime/compiler changes when feasible.
- The relevant benchmark suite before and after performance-sensitive changes,
using the same environment, warmup, iterations, and semantic controls.
pnpm format:files <path...> while iterating and
pnpm format:files:check <path...> for a scoped check.
Risk checks
- Does the change alter hook slot stability?
- Does it change SSR/hydration consistency?
- Does it change event semantics from native to synthetic? If yes, likely wrong.
- Does it add React controlled-input behavior? If yes, likely intentional divergence violation.
- Does keyed reconciliation preserve final DOM and survivor identity?
- Are
tsrx and tsx/jsx paths both considered?
Adversarial self-review
Inspect the complete diff after validation. Try applicable empty, large,
repeated, nested, reordered, reentrant, error, abort, cleanup, and hydration
cases. Trace each allocation and retained reference through release, inspect
adjacent fast paths and every changed caller, compare with a simpler design, and
remove complexity that does not justify its permanent cost. Resolve findings and
repeat the review on the final diff.
The handoff must report the contract, correctness evidence, measured baseline and
candidate deltas (or why trustworthy measurement was impossible), self-review
improvements, and residual risk.
1---2name: octane-core-extend-43description: Change Octane's runtime, compiler, scheduler, reconciler, SSR, or hydration engine. Use before editing packages/octane/src. Covers the observable contract, hot-path analysis, and the performance evidence required before handoff.4---56# Skill: Extend Octane core78Use this when changing core runtime, compiler, AST/TSRX transforms, SSR, hydration, or public `octane` APIs.910## Read first1112- `AGENTS.md`13- `.rulesync/rules/core-engineering.md`14- `README.md`15- `docs/differences-from-react.md`16- Owning source comments and nearby tests1718## Required preflight1920Before editing, write down:2122- the consumer-observable contract and invariants;23- affected execution modes (dev/prod, client/server, render/hydrate, error/abort);24- hot paths and expected call frequency;25- a credible failing behavioral test for a bug, or a relevant benchmark baseline26 for an optimization.2728Assume framework-fundamental code is performance-sensitive until the call graph29shows otherwise. Use the `performance-audit` skill alongside this skill whenever30the change can affect per-component, per-render, per-node, compiler-output, SSR,31hydration, scheduling, reconciliation, or bundle costs.3233## Every change lands with a regression test3435No exceptions, and not only for bug fixes. Core code multiplies across every36Octane application, so each change ships with a test that would catch the37regression it could introduce.3839- **Bug fix**: the test reproduces the report and fails before the fix.40- **New behavior**: the test pins the new contract, and a separate one pins the41 neighbouring behavior the change could have disturbed.42- **Refactor or optimization**: behavior is supposed to be identical, so the test43 pins the behavior being preserved. "The existing tests still pass" is not44 enough on its own; if no existing test would have caught the breakage you were45 worried about, that gap is the test to add.4647A test only counts once you have seen it fail. Break the implementation48deliberately, confirm the test goes red, then restore. If it stays green it is49not protecting anything.5051Cover the execution modes the change actually reaches: dev and prod compile,52client and server, render and hydrate, and the error, abort, and cleanup paths.53Assert consumer-observable behavior, never internals; `.rulesync/rules/testing.md`54sets the observation boundary and the harness to use.5556Exact render counts, allocation identity, and codegen size are optimization57claims, so they belong in the benchmark ratio system with semantic controls58rather than in a correctness test.5960## Decide owner6162- Client behavior/hooks/events/refs/scheduler/context/Suspense/transitions/reconciler: `packages/octane/src/runtime.ts`63- SSR/server render: `packages/octane/src/runtime.server.ts`, `packages/octane/src/server/index.ts`64- Compiler/AST/TSRX lowering/Vite/Volar: `packages/octane/src/compiler/*`65- Public API: `packages/octane/src/index.ts`, `constants.ts`, README/types/tests66- Vite metaframework behavior: `packages/vite-plugin-octane/*`6768## Compiler/AST workflow69701. Add a minimal `.tsrx` or `.tsx` fixture under `packages/octane/tests/_fixtures/`.712. Add the regression test: assert runtime behavior, or emitted behavior through the public compiler path.723. Inspect `compile.js` and any `@tsrx/core` AST assumptions.734. Preserve source-location/dev diagnostics where applicable.745. Ensure generated code still works with hook-slot injection and server/client paths.7576## Runtime workflow77781. Add the regression test before patching, and watch it fail.792. Identify whether behavior is mount, update, deletion, hydration, event delegation, scheduling, or effect flushing.803. Read nearby runtime comments; treat them as design spec.814. Preserve intentional divergences from React.825. For React parity, use conformance or differential harness appropriately.8384## Public API workflow85861. Update exports, and add a test covering the new or changed surface.872. Update README/docs if user-facing.883. Add changeset unless docs/test-only.894. Consider ecosystem binding impacts and aliases in `vitest.config.js`.9091## Validation9293- New/changed targeted tests.94- Nearby core tests.95- `pnpm typecheck` for API/compiler TS changes.96- `pnpm test` for broad runtime/compiler changes when feasible.97- The relevant benchmark suite before and after performance-sensitive changes,98 using the same environment, warmup, iterations, and semantic controls.99- `pnpm format:files <path...>` while iterating and100 `pnpm format:files:check <path...>` for a scoped check.101102## Risk checks103104- Does the change alter hook slot stability?105- Does it change SSR/hydration consistency?106- Does it change event semantics from native to synthetic? If yes, likely wrong.107- Does it add React controlled-input behavior? If yes, likely intentional divergence violation.108- Does keyed reconciliation preserve final DOM and survivor identity?109- Are `tsrx` and `tsx/jsx` paths both considered?110111## Adversarial self-review112113Inspect the complete diff after validation. Try applicable empty, large,114repeated, nested, reordered, reentrant, error, abort, cleanup, and hydration115cases. Trace each allocation and retained reference through release, inspect116adjacent fast paths and every changed caller, compare with a simpler design, and117remove complexity that does not justify its permanent cost. Resolve findings and118repeat the review on the final diff.119120The handoff must report the contract, correctness evidence, measured baseline and121candidate deltas (or why trustworthy measurement was impossible), self-review122improvements, and residual risk.