Skip to content

[Docs]: add dedicated skill chaining guide under docs/usage #297

Description

@rosspeili

Type of fix

Other

What needs to be fixed?

Skill chaining is mentioned in fragments but never documented as a first-class usage pattern.

Current state (scattered):

  • docs/usage/gemini.md — short “Skill Chaining (Middleware)” section with one example: optimization/prompt_rewriter → optimized system context before Gemini ([Feat]: cli skillware examples command and list --examples coverage flag #126-era).
  • docs/usage/agent_loops.md — single-skill load → execute loop; examples/ollama_skills_test.py noted as multi-skill harness (model selects among tools — not the same as a deterministic host pipeline).
  • docs/skills/README.md — “Middleware” category description; individual skill pages (e.g. prompt_rewriter, token_limiter) mention orchestrator/host roles in isolation.
  • docs/vision.md / README.md — “skill chain” in vision/enterprise prose only; no operator how-to.
  • No docs/usage/skill_chaining.md (or equivalent).

Problem: Contributors and operators cannot find guidance on composing multiple skills in one workflow — especially middleware (firewall, token limiter, prompt compressor) with domain skills (mail, wallet screening, etc.). New skills like office/gmail_handler (#291) increase the need for clear chaining patterns.

Request: Add a dedicated usage guide that explains how chaining works in Skillware (host/agent owns order; each skill is deterministic execute(); no built-in chain runner in the framework; optional validate_params; context carry-forward where skills support it e.g. gmail context).

Proposed new page: docs/usage/skill_chaining.md

Content outline:

  1. Concepts — sequential host pipeline vs multi-tool LLM loop vs middleware pre/post-processing; when to use each.
  2. Rules of thumb — fail-closed middleware, untrusted input handling, secrets/env, constitution order, token budget gates.
  3. Minimal pattern — load N skills, host Python orchestrates execute() calls, pass JSON between steps (pseudocode + one small real snippet).
  4. At least 5 worked examples (progression simple → complex):
    • 2-chain (basic): optimization/prompt_rewriter → feed compressed_text into model context (extend existing gemini.md idea; provider-agnostic).
    • 2-chain (security): security/prompt_injection_firewall → sanitize untrusted text before any LLM or downstream skill (e.g. scraped page, email body).
    • 2-chain (budget): host loop + monitoring/token_limiter gate each turn before calling the model (align with examples/token_limiter_loop.py).
    • 3-chain: firewall → prompt_rewriter → domain skill input (compress only after sanitize).
    • 3-chain (agent + mail): office/gmail_handler read_message → firewall on body → agent drafts → preview_send / send with confirmation (reference gmail context carry-forward).
    • 4-chain (optional stretch): untrusted inbound → firewall → pii_masker → rewriter → LLM — document trade-offs (latency, false positives).
  5. Multi-tool vs chain — clarify examples/ollama_skills_test.py (model chooses tool) vs explicit host ordering.
  6. Cross-links — from docs/usage/README.md, docs/usage/agent_loops.md, and trim/redirect gemini.md chaining section to the new guide (keep a short pointer + link, avoid duplication).

Non-goals (this issue):

  • New framework API for chains (RFC material if ever needed).
  • New runnable examples under examples/ (optional follow-up; doc can use inline snippets referencing existing scripts where they exist).

Acceptance criteria:

  • docs/usage/skill_chaining.md published with concepts + ≥5 chain examples (2-skill and 3+ skill).
  • docs/usage/README.md indexes the new guide.
  • docs/usage/agent_loops.md links to skill chaining for multi-step workflows.
  • docs/usage/gemini.md chaining section shortened to pointer + link to new guide.
  • CHANGELOG.md [Unreleased] entry.
  • pytest tests/test_registry_docs.py passes if link/index guards apply.

Affected Page(s)

docs/usage/skill_chaining.md (new), docs/usage/README.md, docs/usage/agent_loops.md, docs/usage/gemini.md, CHANGELOG.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation.enhancementNew feature or request.examplesRunnable scripts under examples/, agent loops, or examples index.good first issueGood for newcomers.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions