@standardagents/skill 0.43.1 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -35,6 +35,15 @@ guidance into a supported coding agent. Currently:
35
35
  - Codex gets a skill folder in `$CODEX_HOME/skills` or `~/.codex/skills`
36
36
  - Claude Code gets a user subagent in `~/.claude/agents/agentbuilder.md`
37
37
 
38
+ The implementation-agnostic specification guidance is a separate skill:
39
+
40
+ ```bash
41
+ npx skills add standardagents/skills@spec
42
+ ```
43
+
44
+ The `agentbuilder` skill defers to `spec` for what the specification requires,
45
+ and it reads the published specification directly when `spec` is not installed.
46
+
38
47
  Package install:
39
48
 
40
49
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standardagents/skill",
3
- "version": "0.43.1",
3
+ "version": "0.44.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -30,6 +30,14 @@ For deeper reference material that this skill links to, see:
30
30
 
31
31
  > If the `agents/*/AGENTS.md` files don't exist in your project yet, run `pnpm exec agents scaffold` to create them.
32
32
 
33
+ ## The specification comes first
34
+
35
+ This skill covers how to build with AgentBuilder. The `spec` skill covers what the Standard Agent Specification requires, and it reads the published specification each time it runs.
36
+
37
+ - Use the `spec` skill for questions about what the specification requires or whether an agent is portable.
38
+ - If the `spec` skill is not available, read https://standardagentspec.org/llms.txt and the pages it lists. Tell the user once that `npx skills add standardagents/skills@spec` installs the skill.
39
+ - If this skill and the published specification disagree, the specification is correct. Report the disagreement to the user.
40
+
33
41
  ## Keeping this skill up to date
34
42
 
35
43
  <!-- installed-skill-version: __SKILL_VERSION__ -->
@@ -407,7 +415,7 @@ When the new agent is a child in a graph, creating the agent file is half the jo
407
415
  - [ ] The session tools pass the [three-places check](#session-tools-must-exist-in-three-places)
408
416
  - [ ] The **owning parent side's `subagents` array** has the `SubagentRelationship` — an agent nobody declares is unreachable, and the declaration is the grant. Never put the relationship in a prompt's `tools` array (definition-time error). Declare it on the side whose turns should receive the child's traffic
409
417
  - [ ] `blocking` and `maxInstances` are chosen deliberately ([waiting style vs. lifetime](#subprompts-vs-subagents-vs-handoffs)), and `initUserMessageProperty` (and `initAttachmentsProperty` for files) are mapped so the child starts with real context instead of an empty first turn
410
- - [ ] The relationship name (`as`, defaulting to `agent`) doesn't collide with any tool name or the reserved lifecycle names (`subagents`, `subagent_create`, `subagent_message`), and appears on only one side
418
+ - [ ] The relationship name (`as`, defaulting to the unqualified part of `agent`) doesn't collide with any tool name or the reserved lifecycle names (`subagents`, `subagent_create`, `subagent_message`), and appears on only one side
411
419
  - [ ] The **parent prompt text** (for prompt-backed owning sides) says when to delegate to this child and explains `subagent_create` vs `subagent_message`
412
420
  - [ ] Side B reviewers use a model from a *different provider* than side A ([why](#session-boundary-discipline))
413
421
  - [ ] Run the dev server and check the composition view: the parent→child edge should be visible, and creating a test thread should show the child spawn and the completion payload arrive back on the owning side
@@ -684,6 +692,12 @@ This is the single biggest gap in most coding-agent-built tools. **Do not write
684
692
 
685
693
  ### Method cheat sheet
686
694
 
695
+ `state.loadModel`, `state.loadPrompt`, and `state.loadAgent` enforce package
696
+ visibility. Global code can load unpacked definitions and packed entry agents.
697
+ Packed code can load its own definitions and other packages' entry agents.
698
+ A packed model cannot fall back to a host model with the same short name.
699
+ A refused load returns the same not-found error as a missing definition.
700
+
687
701
  Discoverability reference. For full signatures, read the spec types from `node_modules/@standardagents/spec/dist/` (or browse `packages/spec/src/` on GitHub). Worked examples live in `agents/tools/AGENTS.md`.
688
702
 
689
703
  ```
@@ -720,7 +734,7 @@ await state.setValue('invocation_count', count + 1);
720
734
 
721
735
  ### Agent Skills library
722
736
 
723
- `state.skills` is the instance-GLOBAL Agent Skills library (agentskills.io SKILL.md format) — the deliberate exception to per-thread scoping: skills install once and every thread sees them. `list()` returns metadata (name + description), `get(name)` loads a SKILL.md body on demand (progressive disclosure), `readFile(name, path)` opens bundled files, and `install(files)` / `setEnabled` / `remove` manage the library. Identity always comes from SKILL.md frontmatter (`name`, `description`), validated on install.
737
+ `state.skills` uses the agentskills.io SKILL.md format. A thread sees its owner's skills and enabled skills in the admin-reviewed shared library. Owner skills shadow shared skills with the same name. `list()` returns metadata. `get(name)` loads a SKILL.md body. `readFile(name, path)` reads bundled files. `install(files)`, `setEnabled`, and `remove` require an instance admin and change that admin's private skills. Skill identity comes from SKILL.md frontmatter (`name`, `description`), validated on install.
724
738
 
725
739
  ### Sandboxed code execution
726
740
 
@@ -753,6 +767,8 @@ const run = state.runCode(
753
767
  const result = await run;
754
768
  ```
755
769
 
770
+ In a thread endpoint, `runCode` forwards functions in imports, globals, and execution arguments as callable proxies. Call `run.terminate(reason)` to stop the sandbox. A caller disconnect also stops the run. When `report` is supplied, the host receives reports during the run and `run.reports` updates as reports arrive.
771
+
756
772
  By default, `runCode()` executes the `default` export with no args. Use `execute: { fn, args }` to call a named export or pass arguments; `fn: 'default'` calls the default export with args. Use `modules` to provide local relative ES modules. The result is a status object: successful runs return `status: 'success'`, `result`, `logs`, `reports`, and `durationMs`; failed runs return an error status and an `error` object. Call `run.terminate(reason)` from your own timeout budget when needed.
757
773
 
758
774
  ### Notes on a few that are easy to misuse
@@ -842,12 +858,16 @@ PromptDefinition
842
858
  recentImageThreshold number (default 10) how many recent messages keep real images
843
859
  historyLimit number load only the newest messages (at least N, under 2N,
844
860
  the cut moving N at a time); unset loads all
845
- providerOptions Record<string, unknown> passthrough to the provider (overrides model defaults)
861
+ providerOptions Record<string, unknown> provider-specific request options
846
862
  hooks HookId[] prompt-scoped hooks (overrides agent hooks)
847
863
  ```
848
864
 
865
+ Provider options merge from model defaults to prompt overrides. Later values win. A prompt can set `reasoning.level` from 0 to 100.
866
+
849
867
  ### Composable prompts: the `tone` pattern
850
868
 
869
+ A circular prompt include raises an error that names the include chain. A prompt can include the same partial through different paths.
870
+
851
871
  `prompt` can be a string or an array of parts. Use parts to compose a shared "tone" or "persona" across many prompts so changes flow through one place.
852
872
 
853
873
  ```ts
@@ -928,7 +948,7 @@ PromptSide
928
948
  subagents SubagentRelationship[] side-owned child relationships (see cheat sheet below)
929
949
  stopOnResponse boolean (default true) stop side turn on text response without tool calls
930
950
  stopTool string stop side turn when this tool is called
931
- stopToolResponseProperty string extracted property for stop tool outcomes
951
+ stopToolResponseProperty string (optional) extracted property for stop tool outcomes
932
952
  maxSteps number per-side step cap within one turn
933
953
  sessionStop { name, messageProperty?, attachmentsProperty? } ends session with a result
934
954
  sessionFail { name, messageProperty?, attachmentsProperty? } ends session with a failure
@@ -956,7 +976,7 @@ SubagentRelationship — entry in a side's `subagents` array
956
976
  eligible; exposeAsTool: true marks it as designed
957
977
  for composition and supplies the default description
958
978
  as string relationship name — tool-surface name, registry
959
- identity, reference name; defaults to `agent`.
979
+ identity, reference name; defaults to the unqualified part of `agent`.
960
980
  Two relationships may target the same agent under
961
981
  different `as` names (aliases), each with its own
962
982
  config — e.g. work_calendar / personal_calendar
@@ -1042,6 +1062,9 @@ Hooks extend agent behavior without modifying core logic. Defined via `defineHoo
1042
1062
  | `before_store_tool_result` | Before tool result storage | Transform tool results |
1043
1063
  | `after_tool_call_success` | After successful tool call | Post-process success results |
1044
1064
  | `after_tool_call_failure` | After failed tool call | Handle/recover from errors |
1065
+ | `user_client_attached` | After a user client attaches | Handle an attached client |
1066
+ | `user_client_detached` | After a user client detaches | Handle a detached client |
1067
+ | `user_value_changed` | After a user value changes | Handle a durable user value change |
1045
1068
 
1046
1069
  > **Caution:** Hooks that filter or truncate messages must keep matching tool calls and tool results together. Separating them produces hard-to-debug failures in many models.
1047
1070
 
@@ -1071,7 +1094,7 @@ Two value types are supported:
1071
1094
  - **`text`** — simple string. Safe to render in prompts.
1072
1095
  - **`secret`** — encrypted; **MUST only be used inside tools**. Never reference a secret in prompt text and never return it to the model. A `GMAIL_API_KEY` is `secret`; a `LOCATION` is `text`.
1073
1096
 
1074
- When a thread is created, all required variables in the agent graph must be provided. The instance of a variable on a thread is called an "environment variable" or `env`. Resolution precedence (low → high): prompt → tool → agent → thread.
1097
+ When a thread is created, all required variables in the agent graph must be provided. The instance of a variable on a thread is called an "environment variable" or `env`. Resolution precedence (high → low): thread → agent → prompt → user → instance.
1075
1098
 
1076
1099
  Scoped variables (`scoped: true`) do not inherit from parent thread env — they reset for the declaring agent's subtree. Use this when a subagent must run with different config from its parent (e.g., a per-instance Slack channel ID).
1077
1100