Skip to content

feat(skills): always-on skills injected into every new task - #4059

Draft
adboio wants to merge 2 commits into
mainfrom
posthog-code/always-on-skills-v2
Draft

feat(skills): always-on skills injected into every new task#4059
adboio wants to merge 2 commits into
mainfrom
posthog-code/always-on-skills-v2

Conversation

@adboio

@adboio adboio commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Problem

Skills only activate today when a task's prompt explicitly references them (/name or a composer skill chip). There's no way to say "apply this skill to everything I do" — the way a channel's CONTEXT.md is injected automatically, or the way a SessionStart-hook plugin (e.g. i-have-adhd) puts its instructions in context from turn one.

Refs #3735 (earlier attempt, auto-closed as stale — this supersedes it).

Changes

  • Always-on toggle on installed skills (Skills settings: switch on each card + detail panel) for user/marketplace/codex/bundled sources. Repo-source skills are excluded so behavior is identical for repo and repo-less tasks. Toggles persist in the settings store as {name, source} refs and re-resolve against the live skill list at task creation, so moved/deleted skills self-heal.
  • Cloud tasks reuse the existing skill-bundle pipeline: resolved refs are appended to the transport's skillBundles (uploaded with the first message, warm and cold paths) and a <always_on_skills> manifest of /name mentions is folded into the first message, which the sandbox's existing inliner expands into each bundle's full SKILL.md. Zero sandbox/server changes.
  • Local tasks inline each SKILL.md body into the initial prompt (read via the existing skills.readFile tRPC), with per-skill/total size caps degrading to path references.
  • The injected block is stripped from the transcript and shown as an "Always-on skills (n)" chip; prompt recall and echo dedupe strip it too.

How did you test this?

  • New unit tests: ref toggle/resolution/sanitization, both prompt builders (incl. sandbox mention-regex compatibility and size-cap degrade), saga injection for cloud (bundle upload + first-message manifest) and local (initialPrompt block), settings persistence + rehydrate sanitizer, transcript extractor.
  • Ran full suites on touched packages: @posthog/core (2863), @posthog/ui (2452), @posthog/shared (777) — all green; pnpm typecheck green across all 24 packages; biome lint packages/core clean.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Per-skill "Always-on" toggle (user/marketplace/codex/bundled sources) that
injects toggled skills into every new task's first message — like a channel's
CONTEXT.md — on both cloud and local runs.

Cloud rides the existing bundle-upload pipeline: refs append to the
transport's skillBundles and a /name manifest folds into the first message so
the sandbox's existing inliner picks them up. Local inlines SKILL.md bodies
into initialPrompt via the existing skills.readFile surface. Refs persist as
{name, source} in the settings store and re-resolve at creation, so moved or
deleted skills self-heal. The transcript collapses the injected block into an
"Always-on skills (n)" chip.

Generated-By: PostHog Code
Task-Id: 4e1d8b15-54b7-4555-a21f-150eead107f4
@trunk-io

trunk-io Bot commented Jul 31, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

Shows the skills that will be auto-injected into the next task as chips in
the new-task page's "Using:" row (beside the channel CONTEXT.md chip) and in
the channel feed composer's floating row next to the local/cloud selector.
Clicking a chip opens the skill in Settings; the X turns its always-on toggle
off globally. Chips render from the same resolution the saga uses at creation,
so stale refs never show.

Generated-By: PostHog Code
Task-Id: 4e1d8b15-54b7-4555-a21f-150eead107f4
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.

1 participant