Skip to content

feat: add context: fork to all skills and commands - #36

Closed
nucliweb wants to merge 2 commits into
addyosmani:mainfrom
nucliweb:feat/content-fork-commands
Closed

nucliweb wants to merge 2 commits into
addyosmani:mainfrom
nucliweb:feat/content-fork-commands

Conversation

@nucliweb

@nucliweb nucliweb commented Apr 7, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #35

What

Adds context: fork to the YAML frontmatter of all 20 SKILL.md files and all 7 .claude/commands/*.md slash commands.

Why

Skills and commands currently inject their instructions directly into the active conversation context. With context: fork, each skill or command runs in an isolated subagent context instead, which brings five concrete benefits:

  1. Context isolation — the skill runs free from prior conversation history
  2. Consistent, repeatable execution — same clean state on every invocation
  3. Token efficiency — execution tokens are spent in the fork, not the main session
  4. Stronger skill fidelity — harder for the agent to rationalize skipping steps
  5. Cleaner handoff — only the result surfaces back, not intermediate reasoning

Per the official docs, .claude/commands/ files and SKILL.md files share the same frontmatter spec and context: fork is valid in both.

Files changed

Commands (.claude/commands/) — 7 files
Skills (skills/*/SKILL.md) — 20 files

Adds `context: fork` to the YAML frontmatter of all SKILL.md files and
all .claude/commands/*.md slash commands so each skill and command runs
in an isolated subagent context rather than injecting instructions into
the active conversation.

Benefits: context isolation, consistent repeatable execution, token
efficiency in the main session, stronger skill fidelity, and cleaner
skill handoff.

Closes addyosmani#35
@federicobartoli

federicobartoli commented Apr 7, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks for the PR — the rationale for context: fork is solid.

However, I have some doubts after reading the docs closely.

The commands are good candidates for fork. Files like review.md ("Review the current changes across all five axes"), code-simplify.md ("Simplify recently changed code"), and ship.md ("Run through the complete pre-launch checklist") are self-contained tasks with explicit instructions — exactly what context: fork is designed for.

The SKILL.md files are a different story. They're hybrid documents — they contain process steps but also large sections of reference material ("When to Use", "Common Rationalizations", "Red Flags", "Handling Disagreements"). They don't have a self-contained task; the task comes from the command that invokes them. The docs warn:

"context: fork only makes sense for skills with explicit instructions. If your skill contains guidelines like 'use these API conventions' without a task, the subagent receives the guidelines but no actionable prompt, and returns without meaningful output."

Subagent nesting is a concern. Every command starts with Invoke the agent-skills:xxx skill. If the command runs as a fork (subagent) and the invoked skill also has context: fork, the subagent would need to spawn another subagent — but the subagent docs state: "subagents cannot spawn other subagents".

So context: fork on the commands could work well, but then the skills they invoke should probably NOT have context: fork — otherwise you hit the nesting limitation. Have you tested this interaction?

Skills are hybrid reference documents — they contain process steps but
also large sections of guidelines (When to Use, Common Rationalizations,
Red Flags) without a self-contained task prompt. context: fork is
designed for explicit task instructions, not reference material.

Additionally, commands invoke skills via the Skill tool. If both the
command and the skill had context: fork, the command's subagent would
need to spawn another subagent — which is architecturally blocked:
"subagents cannot spawn other subagents" (Claude Code docs).

context: fork remains on the 7 .claude/commands/ files, where each
file IS a self-contained task with explicit instructions.
@nucliweb

nucliweb commented Apr 7, 2026 •

Copy link
Copy Markdown
Collaborator Author

Thanks @federicobartoli, you're right on both counts.

I verified the nesting limitation in the official docs:

"This prevents infinite nesting (subagents cannot spawn other subagents)" — sub-agents docs

And the warning about guidelines-only skills also applies here — SKILL.md files are hybrid documents with reference sections (When to Use, Common Rationalizations, Red Flags) that don't form a self-contained task prompt.

I've pushed a fix: context: fork is now removed from all 20 SKILL.md files. The 7 .claude/commands/ files keep it, since each command IS a self-contained task with explicit instructions.

Good catch, learned something new about subagent architecture here.

@federicobartoli

federicobartoli commented Apr 7, 2026 •

Copy link
Copy Markdown
Collaborator

Nice fix on removing context: fork from the SKILL.md files — the PR is much cleaner now.

One more thought after looking at the individual commands: context: fork isolates the subagent from conversation history, which works great for commands that operate purely on the current codebase state but could be a problem for commands that depend on what the user discussed earlier.

Good fit for fork:

  • /review — operates on staged/recent commits, self-contained
  • /code-simplify — operates on recently changed files, self-contained
  • /ship — runs a checklist against the current codebase, self-contained

Potentially problematic:

  • /spec — the command itself says "Ask clarifying questions about the objective and target users", but the forked subagent doesn't have AskUserQuestion and can't see prior conversation where the user may have described what they want to build
  • /plan — needs to understand what to plan, which often comes from conversation context
  • /build — "Pick the next pending task from the plan" works if tasks are in a file, but if they were discussed in conversation the subagent is blind. Also loses Agent (no parallel work) and TodoWrite

Borderline:

  • /test — depends on whether the user described the bug/feature in conversation or if it's discoverable from code alone

Have you tested all seven commands with fork in a real session (not just single-prompt)? I'd be curious to hear your results. I'll take the time to test them all end-to-end on my side too.

Thanks for iterating on this — the discussion has been valuable!

@nucliweb

Copy link
Copy Markdown
Collaborator Author

Closing this in favor of the consolidated approach in #316, same direction as #272.

Rather than editing context: fork into the frontmatter of every skill and command by hand, #316 keeps the shared SKILL.md files portable (spec fields top-level, vendor config under metadata or in per-agent adapter files) and proposes a generator that emits the per-agent output from a single source of truth. The Claude Code context: fork + allowed-tools pattern from this PR is captured there as the canonical home for that guidance.

The intent here is good and still wanted, it just belongs in the per-agent config doc rather than as global frontmatter changes. Folding it into #316. Thanks!

@nucliweb nucliweb closed this Jun 23, 2026
nucliweb added a commit to nucliweb/addy-agent-skills that referenced this pull request Jun 23, 2026
Address review feedback on addyosmani#316:
- State explicitly that this supersedes the inline top-level frontmatter approach, so kind/model/temperature/max_turns/tools/context must not appear at the top level of a skill.
- Add a copy-pasteable .gemini/agents/*.md example using thinking_level instead of hardcoded temperature for Gemini 3.x.
- Update Status: addyosmani#272 and addyosmani#36 are closed in favor of this approach.
@nucliweb
nucliweb deleted the feat/content-fork-commands branch June 23, 2026 06:35
nucliweb added a commit to nucliweb/addy-agent-skills that referenced this pull request Aug 27, 2026
Address review feedback on addyosmani#316:
- State explicitly that this supersedes the inline top-level frontmatter approach, so kind/model/temperature/max_turns/tools/context must not appear at the top level of a skill.
- Add a copy-pasteable .gemini/agents/*.md example using thinking_level instead of hardcoded temperature for Gemini 3.x.
- Update Status: addyosmani#272 and addyosmani#36 are closed in favor of this approach.
tisan-das added a commit to tisan-das/agent-skills that referenced this pull request Aug 29, 2026
The corpus was deep on the control plane and near-silent on the database
plane, which is where most of the work is: the SOP's own fault-domain
census puts 408 of 521 domain-tagged tickets in D3-D6, and annotates D3
as "largest open cluster, least documented". Symptoms of that gap - the
KB reported `MCS API returned 400` as a bad `collection_id` without ever
defining a collection, and quoted `ALTER SPOOL MAP` without saying what a
spool map is or why autoscale versions one.

Add references/CE-DATA-PLANE.md: leader/follower vprocs, the map system
and spool-map versioning, the NLB's non-role, the FirstConfig ruleset,
OMS/MCS capture and replay, collections, the database hierarchy, the
three roles, the persistence contract, the documented limitations that
mimic D3/D6 defects, and triage hooks back into the SOP.

Wire it in: two new KB diagrams (2.5 account and trust boundaries - no
existing diagram drew account seams, though copy-secret is a
cross-account AssumeRole; and QueryGrid runtime topology in F6, control
path over the Site Gateway vs data path on PrivateLink 5100). Define
`collection_id` at the line reporting the 400 that names it, explain
ALTER/DROP SPOOL MAP in F9 and link registry addyosmani#36, promote EDWless from
glossary term to supported site model in 1.1, add ChangeSpace and the
PERM ceiling to 8.4, and expand the glossary.

Product limitations land in the registry as an unnumbered R7 section, so
dedup finds them with one grep without consuming numbered rows reserved
for confirmed root causes or diluting its proven-mechanism bar.

Source is internal design documentation, not code, so this is the one
corpus document that was never verified against the repos. It carries a
provenance banner, a new [design-doc] marker ranked below [current] and
above [inferred], and a conflicts section listing the unresolved OMS and
LMO acronym expansions rather than silently overwriting the corpus.

Also fixes eight KB Notes that carried <br/>, per KB 9.4.
tisan-das added a commit to tisan-das/agent-skills that referenced this pull request Aug 29, 2026
…ose ends

Self-review of the previous two commits found six problems, three of them
claims stated more confidently than the source supports.

Scope errors. The ~60 GB figure describes what is available to permanent
tables; the source never says whether that ceiling is per database, per
CE, or the whole PERM allocation, so both copies now say so instead of
asserting "the whole engine". NVMe is attributed to follower CW AMPs,
which is what the source says, not to every CW AMP. The Azure
single-SKU conclusion is relabelled [inferred] - it is drawn from two
design-doc statements, not stated by either.

Autoscale read as contradictory. "Shipped disabled" sat next to a corpus
carrying live autoscale failures (#16b, addyosmani#36, addyosmani#61) and F9/F9b documenting
the daemon in detail. Both rows now say disabled *by default*, and that
this is not the same as absent.

Maintenance contracts had drifted from what the corpus now is. KB 10.4
still listed three markers after 0 defined a fourth, and neither it nor
SKILL.md said where engine or database-object knowledge belongs. The
registry gains a rule keeping the product-limitations section outside the
#N space, so a future maintainer does not renumber design-doc rows into
the proven-mechanism space - with the promotion path if one is ever
confirmed as a defect.

Both maintenance sections now name the highest-value action available:
verifying a [design-doc] claim against code and promoting the marker,
starting with the conflicts in 12.

SCAgent was defined in the previous commit; this one makes sure the rest
of the vocabulary I introduced is reachable from the maintenance rules
that govern it.
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.

feat: use content: fork in Claude Code slash commands for isolated skill execution

2 participants