Skip to content

feat(skills): add the workflow-creator skill - #7873

Merged
houko merged 2 commits into
mainfrom
feat/6934-workflow-creator-skill
Aug 24, 2026
Merged

houko merged 2 commits into
mainfrom
feat/6934-workflow-creator-skill

Conversation

@houko

@houko houko commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Closes #6934

The remaining scope item of #6934 — "PR 2: workflow-creator skill". PR 1 merged as #7857; the issue's other two items are listed under Future and are untouched here.

Premise correction: this repo has no bundled-skills directory

Skills are registry content. They ship from librefang/librefang-registry under skills/<name>/, are synced into ~/.librefang/registry/, and are installed on demand — registry_sync::fanout_registry_content says so in as many words ("Skills and plugins stay in registry — users install via dashboard"), and fans out providers, channels, MCP, agent templates and workflow templates but not skills.

The repo-root skills/ directory that the unmerged #6943 puts its copy of this skill in was deleted in #1212 and is read by nothing on main; a skills/workflow-creator/skill.toml there would never load. CONTRIBUTING.md still pointed authors at that dead skills/community/ path, which is fixed here.

So the skill itself goes to the registry: librefang/librefang-registry#105. What lands in this PR is the copy pinned in the registry snapshot plus the tests that keep it honest — workflow-creator is the one registry skill whose subject matter is this codebase, and its prose encodes limits this repo can move.

Changes

  • crates/librefang-runtime/tests/fixtures/registry/skills/workflow-creator/SKILL.md — the pinned copy of the shipped skill, and the fixture README's note on why this one entry is present when the other sixty are not.
  • crates/librefang-runtime/tests/workflow_creator_skill.rs — four tests, below.
  • crates/librefang-runtime/src/tool_runner/definitions.rs — workflow_create's step schema now advertises required_skills, session_mode and inherit_context, and its agent description covers all four StepAgent shapes rather than only bare-string and {"id": …}.
  • crates/librefang-kernel/src/kernel/handles/workflow_runner.rs — the_tool_schema_advertises_the_step_routing_fields_the_spec_accepts, a drift guard for the above. STEP_AGENT_ROUTING_KEYS becomes pub(crate) so the test reads the routing keys from their definition rather than restating them.
  • docs/src/app/agent/skills/page.mdx and its zh twin — 60 → 61 bundled skills, new Automation row.
  • CONTRIBUTING.md, changelog fragment.

Why the schema change is in scope

WorkflowCreateSpec deserialises the canonical WorkflowStep, so workflow_create has always accepted required_skills (#7721), the per-step session_mode, inherit_context, and {"type": …} agent routing — none of which its published schema mentioned. A field accepted but unadvertised is a field no model sends, and shipping a skill that documents keys the tool's own schema denies would have been a contradiction inside one deliverable. The new test asserts acceptance and advertisement together, so the two cannot drift apart in either direction.

Skill content

Written against the implementation, not the issue's sketch of it: the four agent-binding shapes and when each is right, required_skills with the three failure classes RequiredSkillReport distinguishes, the ceilings build_created_workflow enforces, param_type rather than type on input parameters, and six failure modes with the reason each is rejected — duplicate step names, a dependency on a step that does not exist, an operator node wired into a DAG, a prompt_template on a node that ignores the field, {{input}} across a fan-out, and treating a registered workflow as private when workflows have no ownership model.

Verification

  • cargo test -p librefang-runtime --test workflow_creator_skill — 4/4.
    • workflow_creator_ships_as_a_skill_md_with_no_competing_manifest pins the SKILL.md-only layout: load_all auto-converts a SKILL.md only when no skill.toml sits beside it, so adding one without also writing prompt_context.md drops the entire prompt body of a prompt-only skill with no error anywhere.
    • workflow_creator_loads_and_registers_as_a_prompt_only_skill loads it through SkillRegistry::load_all — the same path an operator's install takes, load-boundary prompt-injection scan included.
    • workflow_creator_prompt_surface_is_deterministic_across_insertion_orders renders the skill block from two registries holding identical content in opposite insertion orders and asserts byte equality (Enforce deterministic ordering for LLM-bound registries to stabilize prompt cache #3298).
    • workflow_creator_prose_matches_the_live_workflow_create_schema reads the step / per-step-timeout / total-timeout ceilings out of builtin_tool_definitions() instead of hardcoding them, so moving a limit fails CI rather than quietly making the skill wrong, and cross-checks every step key the skill teaches against the schema.
  • cargo test -p librefang-kernel --lib workflow_runner::tests — 13/13, including the new drift guard.
  • cargo test -p librefang-api --test skills_routes_test — 38/38 (the snapshot now seeds one registry/skills/ entry where it seeded none).
  • cargo test -p librefang-skills --lib registry::tests — 25/25, all_tool_definitions_is_deterministic_across_insertion_orders included.
  • cargo test -p librefang-runtime --lib tool_runner (442), --test tool_runner_workflow_write (18), --test tool_runner_workflow_readonly (11).
  • cargo clippy -p librefang-runtime --tests and -p librefang-kernel --lib --tests, both -D warnings, clean.

Notes for review

houko added 2 commits August 25, 2026 03:27
Skills are registry content: they ship from librefang/librefang-registry under `skills/<name>/` and are installed on demand, which is why this repo has no bundled-skills directory for one to land in.
The skill itself therefore goes to the registry; what lands here is the copy pinned in the registry snapshot plus the tests that keep it honest, because `workflow-creator` is the one registry skill whose subject matter is this codebase.

The body is written against the code rather than the issue's sketch of it: all four `StepAgent` shapes including `{"type": …}` find-or-spawn, `required_skills` with the three failure classes its error text distinguishes, the ceilings `build_created_workflow` enforces, and the creation-time validations an author is most likely to trip — duplicate step names, a dependency on a step that does not exist, an operator node wired into a DAG, a `prompt_template` on a node that ignores it.

Two step fields the tool already accepted are now advertised.
`WorkflowCreateSpec` deserialises the canonical `WorkflowStep`, so `workflow_create` has always taken `required_skills`, `session_mode` and `inherit_context`, and agent-type routing — none of which its published schema mentioned.
A field accepted but unadvertised is a field no model sends, and a skill documenting keys the tool's own schema denies would have shipped a contradiction.
`the_tool_schema_advertises_the_step_routing_fields_the_spec_accepts` asserts acceptance and advertisement together so they cannot drift apart in either direction.

`tests/workflow_creator_skill.rs` loads the pinned copy through `SkillRegistry::load_all` — the same path an operator's install takes, injection scan included — and checks the ceilings quoted in its prose against the live tool schema rather than hardcoded numbers, so moving a limit fails CI instead of quietly making the skill wrong.
It also pins the SKILL.md-only layout: adding a `skill.toml` beside it without a `prompt_context.md` suppresses the auto-convert and drops the entire prompt body with no error anywhere.

CONTRIBUTING pointed skill authors at `skills/community/`, a path deleted in #1212 and read by nothing since.

Closes #6934
The fragment carried only the issue number, so the release assembler would have emitted a generated line for the PR alongside the curated bullet.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying librefang-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7ef93e6
Status: ✅  Deploy successful!
Preview URL: https://5916909b.librefang-docs.pages.dev
Branch Preview URL: https://feat-6934-workflow-creator-s.librefang-docs.pages.dev

View logs

@houko
houko enabled auto-merge (squash) August 24, 2026 18:51
@github-actions github-actions Bot added area/docs Documentation and guides area/runtime Agent loop, LLM drivers, WASM sandbox area/kernel Core kernel (scheduling, RBAC, workflows) size/L 250-999 lines changed ready-for-review PR is ready for maintainer review labels Aug 24, 2026
@houko
houko merged commit ab2564b into main Aug 24, 2026
38 checks passed
@houko
houko deleted the feat/6934-workflow-creator-skill branch August 24, 2026 20:07
@houko houko mentioned this pull request Aug 30, 2026
@houko houko mentioned this pull request Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation and guides area/kernel Core kernel (scheduling, RBAC, workflows) area/runtime Agent loop, LLM drivers, WASM sandbox ready-for-review PR is ready for maintainer review size/L 250-999 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: agent-created workflows via workflow_create tool

1 participant