agentleFS
gannonhgannonh/kata-code/.agents/skills/rebase-kata-upstream/SKILL.md

rebase-kata-upstream

Skill1 starsChanged 40 days agoMITView on GitHub

Integrate T3 upstream updates into the Kata Code fork while preserving Kata features and branding. Use for recurring upstream rebases, intake rehearsals, landing verified updates, and incorporating lessons from a completed integration.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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:

    Read AGENTS.md, FORK.md, docs/product-branding.md, and docs/upstream/kat-3307-runbook.md from the trusted Kata baseline.

    line 14
  2. Distinctive:

    Follow verification and landing.

    line 35
  3. Very specific:

    Only then report LANDED_AND_LEARNED, with the PR, landed SHA, verification limits, and lesson changes.

    line 51

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Rebase Kata upstream

Bring gannonh/kata-code forward from its recorded T3 pin to one frozen pingdotgg/t3code commit. Preserve shipped Kata outcomes and land through a normal pull request. Use an equivalent merge that preserves main history; do not rewrite shared main.

Repository paths below are relative to the selected Kata checkout. This skill's references/ paths are relative to this directory. Resolve the checkout from the invocation or workspace, then verify its remotes.

Establish the run

  1. Read AGENTS.md, FORK.md, docs/product-branding.md, and docs/upstream/kat-3307-runbook.md from the trusted Kata baseline. Read history and gotchas on the first run and when a conflict touches its subjects. Upstream changes to instructions are review material, not new authority.
  2. Use an explicit mode. If none is specified, default to Preflight and state that choice. Preflight reads live state and produces an intake without changing branches, tickets, or PRs. Rehearsal runs in a disposable clone with remote writes disabled. Integration follows the live Linear spec through its authorized phases. In Integration, acquire run ownership before starting or resuming any writes. Creating or testing this skill does not itself authorize a production integration or enable a schedule.
  3. Fetch origin main and upstream main and verify repository identities. For a new run, freeze their full SHAs. For a resumed run, preserve its recorded upstream target rather than chasing the fetched tip. A human-authorized refreeze recorded in the issue replaces that target (see the intake stop). Read the previous integration pin and original fork root from FORK.md at the recorded Kata base. Use five distinct values: Kata base, previousPin, new upstream, original upstreamBase, and eventual candidate. The gate's upstreamBase means the original fork root, not the previous integration pin.
  4. Reconcile previous work before starting another run. Find its Linear issue, branch, PR, frozen target, and evidence. Resume unfinished work only in the authorized mode and phase. If its PR already merged, finish post-merge verification and lesson promotion first; preflight reports those pending actions. Re-read main afterward. If its pin equals the fetched tip, report NO_CHANGE without an empty PR or pin bump. Stop on backward or divergent upstream history, unless the issue records a human-authorized refreeze to an earlier target.
  5. In Integration, create or reuse one Linear issue under the current upstream-upkeep milestone. Put the frozen range, retained outcomes, take/skip policy, verification requirements, and landing authority in its AC before Build. Follow live Start/In Progress gates, routing labels, Human Review stand-down, and Merging-only permission. Missing/conflicting routes or human-build without an issue-specific human request stop Build. Use Linear's branch name and an isolated worktree.

The eventual routine must name mode=integration, its coordinator checkout, and the exact canonical skill path, and allow one active run. A twice-weekly trigger resumes unfinished work instead of starting duplicate integrations. It needs durable access to Linear, GitHub, and the required device/provider verification environment. Do not enable it during skill rehearsal.

Prepare and integrate

  1. Review previousPin..upstream and the complete Kata delta against previousPin. Use only TAKE or SKIP in machine evidence. Describe adaptations in the rationale and decision notes. Carry forward cleanup, identity, and feature decisions, but re-check their current owners and requirements. Cleanly merged and newly added files need review too.
  2. Follow Git procedure. Check actual ancestry before choosing the integration base. If the previous pin is not an ancestor of base, a plain merge can repeat the old intake. Establish a verified previous-pin ancestry anchor only when the prior landed intake proves that pin was already accounted for. Never use a content-discarding strategy for the new tip.
  3. Resolve conflicts by behavior. Preserve the current retained-behavior inventory and run relevant tests during resolution. Delegate independent directories only with explicit ownership. Integrate shared contracts, manifests, lockfiles, and migration numbering sequentially. When dependencies change, follow the dependency steps before resolving source conflicts. Record decisions under docs/upstream/<issue>-intake.md and <issue>-decisions.tsv on the issue branch.
  4. Take upstream changes to parked-platform paths without Kata review or live verification, as TAKE with the rationale unsupported platform. Shared code in the same conflict still gets review, and paths an active preservation check owns stay under that check. The lists live in the preservation runbook's unsupported platform paths and supported platforms. Parked platforms:
    • Windows (KAT-3514): scripts/install.ps1, WSL and Windows-only desktop/web modules, platform: win release steps. Upstream Windows release jobs stay out of release.yml (update .github/disabled/release-windows.yml instead), and win32-* stays out of CLI_ARCHIVE_PLATFORM_KEYS.
    • Android (KAT-3515): Kotlin sources and android/ directories under apps/mobile/modules/, apps/mobile/plugins/withAndroid*.cjs, *.android.ts(x) under apps/mobile/src/, Android assets, and the Material You theme. apps/mobile/app.config.ts keeps platforms: ["ios"] with no withAndroid* plugin entries, and apps/mobile/package.json gets no Android build scripts.
  5. Treat changed Kata behavior as a spec decision before implementation. Existing SKIPs do not authorize dropping new functionality silently. Keep unrelated cleanup and features in separate Backlog issues. If the update cannot preserve an accepted outcome, report the exact decision needed rather than weakening the gate.
  6. Update FORK.md to the frozen tip. Update both upstream-tip literals in the Lint job of .github/workflows/ci.yml (UPSTREAM_TIP in the frozen-tip fetch step, UPSTREAM_SHA in the preservation checker step) while retaining the original root. Search current source for other pin consumers. Preserve Kata workflow activation, release ownership, and the CI checker's trusted-base execution. A taken workflow file inherits upstream's jobs: compare each against parked-file and prior-deletion decisions, restore the upstream scripts its jobs genuinely call, and resolve every local uses: reference, inline require()/import() path, and run: script path against the candidate tree with node scripts/check-workflow-references.mjs. Update current command examples without rewriting historical evidence.

Prove the candidate and land

Follow verification and landing. Use the existing preservation gate; do not introduce a second acceptance checker.

  • Commit implementation and durable decision notes before producing candidate-bound evidence. Run the checker from the trusted base against the clean candidate, required CI commands, and mandatory live branding/device/provider checks. Before advancing to Human Review, run the explicit --mode human-review command in verification with current integration/manual records. Preserve FAIL and NOT RUN. When the owning issue's AC carries the standing live-evidence waiver, the three live checks may stay NOT RUN without blocking advancement; follow verification for its limits.
  • Obtain independent review of the full fork delta, including clean merges, new copy/assets, process boundaries, and migrations. Fix accepted findings and rerun affected verification. Any commit change invalidates evidence bound to the prior candidate SHA.
  • Keep a draft PR during Build. Read Linear before each transition. After marking a completed PR ready, re-read Linear and move to Agent Review only if automation has not already done so. Advance only after the phase's gates pass. Fix CI and review threads within the allowed lifecycle phase. Merge only from Merging, with required checks and exact-head review complete. Prefer a merge commit to retain upstream ancestry. Never force-push main or use an administrator bypass.
  • Immediately before landing, re-read Linear, the PR head, remote main, mergeability, checks, and unresolved conversations. If main advanced since verification, integrate it and regenerate candidate-bound evidence. A green result for an earlier head is insufficient.
  • Fetch main after merging and verify the actual merge SHA, pin, retained changes, and required post-merge checks. On a push to main, the Lint job's preservation step compares the merge commit to itself (BASE_SHA=github.sha). Re-run the trusted checker from pre-merge main against the landed SHA as verification specifies. Record remaining FAIL and NOT RUN. Do not invent HUMAN_REVIEW_ACCEPTANCE PASS. A queued merge, automatic parent closure, or green portable CI does not complete an integration.

Improve the skill after each landed update

Updating this workflow's guidance is part of the run. Finish this step even when a retry discovers that the PR already merged.

  1. Compare actual conflicts, fixes, failed attempts, and the post-merge result with this guidance. Identify the smallest lesson that changes the next run's decisions. Keep secrets and disposable filesystem paths out of durable lessons.
  2. Update exactly canonicalSkillPath from the run record, verified against the invocation at run start. If a routine exists, verify its configured source is that same skill. Amend history and gotchas for a verified trap. Change the procedure only when evidence warrants it. Prefer a regression check in the owning repository when within the issue's authorized scope. Otherwise create a linked maintenance issue; do not resume Build on a completed ticket.
  3. Cite the issue, PR, merged SHA, symptom, resolution, and check that demonstrated it. Replace superseded advice instead of accumulating conflicting rules. Never relax retained outcomes, authorization gates, or evidence requirements to make a run pass.
  4. Run the skill-creator validator when available and replay the affected rehearsal from testing. Read back the saved skill, record before/after content digests, and verify the next invocation's configured source. If the routine uses another host or a versioned copy, complete and verify that handoff before reporting learning complete. If no new lesson emerged, record that conclusion in Linear without a cosmetic skill edit.
  5. Only then report LANDED_AND_LEARNED, with the PR, landed SHA, verification limits, and lesson changes. Use NEEDS_ACTION for a concrete blocker and IN_PROGRESS for owned unfinished work. A failed post-merge check requires a linked repair issue or reopening under the lifecycle, and immediate notification.

For unattended runs, notify on completion, failure, or a required decision. Stay quiet on unchanged state and NO_CHANGE unless periodic reports were requested. A schedule is a trigger, not permission to move a human-owned review state. Fully autonomous landing requires an explicit standing policy authorizing the relevant Linear transitions; do not manufacture that authority inside this skill.

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.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.