Skip to content

2026 11 27 skill links

kubed-io[bot] edited this page Nov 27, 2026 · 1 revision

Skill Links Implementation Plan

History. Drafted 2026-11-27 for #232 (PR #236), part of epic #234, from #232's notes, which the parent approved. The design, checked against the code, is 2026-11-27-skill-links-design.md. Its "Found at plan time" list is what this plan adds to the notes. In short:

  • there are 48 links in the skills, not 37, and bare file names on 25 lines, rewritten too;
  • cross-references take one of three fixed forms, so a test can check every quoted row and section;
  • the goldens also move for the explorer's body and the prompts' rendered text.

For agentic workers: REQUIRED SUB-SKILL: Use skill://superpowers/subagent-driven-development/SKILL.md (recommended) or skill://superpowers/executing-plans/SKILL.md to implement this plan task by task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Inside a skill, links are relative to the skill's root. Across skills, and in the explorer and the prompts, a skill is named by name. No skill:// appears outside fenced code. Under Via mcp, the instructions give the address every skill reads at.

Architecture:

  • The plugin's text changes, and tests/test_skill.py gains the rule tests that hold it (PLG-76).
  • The explorer's skills: gains signing-in, so agents/get's _meta carries every skill its body names.
  • SKILL_POINTER in mcp/instructions.py gains one sentence, built from guidance.root and guidance.pointer.

Tech Stack: Python 3.11+, kubed-mcp >=0.4.4,<0.5, FastMCP, pytest, PyYAML.

Spec: the design, and the area files Task 5 edits: plugin.md and protocol.md.

Global Constraints

  • No pin moves: kubed-mcp[tasks]>=0.4.4,<0.5, and [telemetry] the same (tests/test_packaging.py).
  • The three cross-skill forms, exactly (design §1), with whitespace and line breaks collapsed: the `<skill>` skill, the `<skill>` skill, row "<words>" and the `<skill>` skill, *<Section>*. A sentence may open "The", and the first form may end 's. The explorer and the prompts may also write `<FILE>.md` in the `<skill>` skill, optionally after *<Section>* in .
  • Inside a skill: `references/<FILE>.md` in backticks, from every file, SKILL.md included. SKILL.md alone is allowed as a name.
  • Copy, exactly. The new instructions sentence (design §2), every "Becomes" in the design's §3 tables, and the explorer's skills: [driving-a-browser, building-flows, signing-in].
  • Change nothing else.
    • core/guidance.py, the hints, workspace://current's guidance, README, AGENTS, CONTRIBUTING, SKILL_HELD, SKILL_INSTALLED and READING_POINTER stay as they are.
    • mcp/tools.py and .github/ are not touched (AGENTS.md).
    • The prompts' placeholders are #192's.
    • FLOWS.md's fenced hint keeps its absolute read.
  • Budgets: each SKILL.md stays 10 to 40 lines, and driving-a-browser's up to 100 (test_the_body_stays_within_its_budget). building-flows/SKILL.md is 38 lines today.
  • Goldens: regenerated once, in Task 4's commit of its own. Tasks 2 and 3 leave them failing on exactly the fields they name.
  • No integration test (CONTRIBUTING, "Tests").
  • Spec rules (Specification.md, "Ids"): statements only, in the present tense, with no dates or issue numbers. Cite code by symbol.
  • Checks: ruff check . and pytest, as test.yml runs them. ui/ is not touched.
  • Commits: stage exact paths, never -a. docs/ is committed by the workflow on the wiki branch issue-232.

Review Focus

  1. Behind a gateway prefix, a model reading through read_resource resolves a relative link from the instructions. So the <name> pattern, not only the entry address, must carry the prefix. Task 3 pins it in test_the_instructions_carry_the_gateway_prefix. If kubed-mcp's rewrite misses <name>, stop and report it to Dr K. Don't write the prefix into the text by hand: GW-10 keeps it out of the server's own text.
  2. A row or section renamed in one skill orphans a reference in another. Tasks 1 and 2 pin it with test_every_cross_reference_names_what_is_there.
  3. A bare TROUBLESHOOTING.md in a reference resolves to the skill's root under SEP-2640, where there is no such file. Task 1 pins it with test_a_skill_names_its_own_files_from_its_root.
  4. A subagent behind the multiplex rewrite has no address for a skill missing from its skills:. Task 2 pins it with test_every_skill_an_agent_names_is_in_its_skills.
  5. An unclosed fence would hide the rest of a file from the rule test. Task 1 pins it: unfenced raises on one (test_an_unclosed_fence_is_refused).

Task 1: The skills link relatively and name each other by name

Files:

  • Modify: every plugin/skills/**/*.md listed in the design's §3, RESOURCES.md included
  • Test: tests/test_skill.py

Interfaces:

  • Produces, in tests/test_skill.py, these constants:
PLUGIN = skill_module.plugin_path()
# A skill's own file, by its path from the root, in backticks.
OWN = re.compile(r"`(references/[A-Za-z0-9_.-]+\.md)`")
# A backticked name; read only for the names in SKILLS.
NAMED = re.compile(r"`([a-z][a-z-]*)`")
# Any file name a text gives, with whatever path is in front of it.
FILE_NAME = re.compile(r"(?<![\w/.])((?:[\w.:-]+/)*[A-Z][A-Z0-9_]*\.md)")
# The three cross-skill forms (design §1), on whitespace-collapsed text.
CROSS = re.compile(r"[Tt]he `([a-z-]+)` skill(?:'s)?(?:, row \"([^\"]+)\"|, \*([^*]+)\*)?")

and these helpers:

  • unfenced(text: str) -> str drops every block from a line whose stripped text starts with three backticks to the next such line. It raises AssertionError on an unclosed fence;

  • skill_files() -> list[tuple[str, pathlib.Path]] gives (skill, path) for every *.md under each skill;

  • rows(name: str) -> list[str] gives the first cell of each body row of the tables in that skill's SKILL.md, whitespace collapsed;

  • ruled_files() -> list[pathlib.Path], the files the address rule reads: here, the skill files.

  • Step 1: Write the failing tests

def test_an_unclosed_fence_is_refused():
    assert unfenced("a\n```json\n{}\n```\nb\n") == "a\nb\n"
    with pytest.raises(AssertionError):
        unfenced("a\n```\nb\n")


@pytest.mark.parametrize("path", ruled_files(), ids=lambda p: p.relative_to(PLUGIN).as_posix())
def test_no_skill_address_outside_fenced_code(path):
    """Where a skill lives is the client's to know (PLG-76)."""
    assert "skill://" not in unfenced(path.read_text())


@pytest.mark.parametrize("name, path", skill_files(), ids=lambda v: getattr(v, "name", v))
def test_a_skill_names_its_own_files_from_its_root(name, path):
    """SEP-2640 resolves a path against the skill's root, from any file."""
    text = unfenced(path.read_text())
    own = set(OWN.findall(text))
    for named in FILE_NAME.findall(text):
        assert named == "SKILL.md" or named in own, f"{path.name} names {named}"
    for rel in own:
        assert (SKILLS_DIR / name / rel).is_file(), f"{path.name} names missing {rel}"


def test_every_cross_reference_names_what_is_there():
    found = 0
    for path in ruled_files():
        text = " ".join(unfenced(path.read_text()).split())
        for skill, row, section in CROSS.findall(text):
            found += 1
            assert skill in SKILLS, f"{path.name} names no skill `{skill}`"
            if row:
                assert any(row in cell for cell in rows(skill)), f"{path.name}: {skill} has no row {row!r}"
            if section:
                assert f"*{section}*" in body(skill), f"{path.name}: {skill} names no *{section}*"
    assert found >= 25

linked(name) reads the new forms: {(name, p) for p in OWN.findall(body(name))} together with {(n, ENTRY) for n in NAMED.findall(body(name)) if n in SKILLS}. Each of the four index tests keeps its assertion and its meaning. Their docstrings say "by its path" where they say "by address". test_the_index_points_at_references_by_their_exact_address becomes test_the_index_points_at_references_by_their_path.

addresses() adds, for each (name, path) in skill_files(), each OWN match in the file's unfenced text, as (path.relative_to(REPO).as_posix(), f"{root(name)}/{rel}"). Its docstring says so. The ADDRESS scan of the plugin still finds the fenced hint in FLOWS.md.

  • Step 2: Run them to see them fail

Run: pytest tests/test_skill.py -p no:randomly Expected: FAIL.

  • test_no_skill_address_outside_fenced_code fails for 15 skill files: every one but FILES.md, READING_PAGES.md, SITE_DATA.md, ADMIN_UI.md, LIVE_VIEW.md and WORKSPACE_CONFIG.md.

  • test_a_skill_names_its_own_files_from_its_root fails on the bare names and the absolute paths.

  • test_every_cross_reference_names_what_is_there fails found >= 25.

  • The index tests fail: linked finds no references/ path yet.

  • Step 3: Rewrite the skills, by the design's §3:

    • the 17 same-skill links and every bare file name (25 lines; the test finds them all) become `references/<FILE>.md`;
    • the 31 cross-skill links take the "Becomes" form in the table, with the words around each reworded only as far as the sentence needs;
    • in RESOURCES.md, the skill://selenium-flow/<skill>/SKILL.md row goes. Under the table, add: "The five skills, driving-a-browser, building-flows, signing-in, using-the-admin-ui and deploying-the-server, are resources too: each a SKILL.md with its references beside it, at the address the server's instructions give."

    Rows 4 and 18 keep their short restatement. Rewrap a paragraph only where a line passes 100 characters.

  • Step 4: Run the tests to see them pass

Run: pytest tests/test_skill.py tests/test_flowdoc.py tests/test_guidance.py -p no:randomly Expected: PASS. test_there_are_addresses_to_check still counts more than 10, and test_every_address_named_anywhere_reads reads every relative path resolved. That is the unit form of the live check.

  • Step 5: Run the checks

Run: ruff check . and pytest Expected: both clean, tests/test_golden.py included. Skill texts, sizes and digests are stood in from disk, and no heading or frontmatter changed. If a plugin golden moves here, stop: a heading or a description changed, which this plan doesn't intend.

  • Step 6: Commit
git add plugin/skills tests/test_skill.py
git commit -m "Skills: link a skill's own pages by relative path, and other skills by name (#232)"

Task 2: The explorer and the prompts name skills by name

Files:

  • Modify: plugin/agents/explorer.md (frontmatter skills: and Before anything)
  • Modify: plugin/commands/build_flow.md, plugin/commands/repair_flow.md (their links only)
  • Test: tests/test_skill.py, tests/test_explorer.py, tests/test_agents_extension.py

Interfaces:

  • Consumes: Task 1's unfenced, ruled_files, CROSS, NAMED and SKILLS.
  • Produces: ruled_files() also returns plugin/agents/*.md and plugin/commands/*.md, and:
# A file in another skill, as the explorer and the prompts name it, with an optional section.
IN_SKILL = re.compile(r"(?:\*([^*]+)\* in )?`([A-Z][A-Z0-9_]*\.md)` in the `([a-z-]+)` skill")
  • Step 1: Write the failing tests

In tests/test_skill.py:

@pytest.mark.parametrize("path", sorted((PLUGIN / "agents").glob("*.md")), ids=lambda p: p.name)
def test_every_skill_an_agent_names_is_in_its_skills(path):
    """`_meta` skills are where a subagent finds an address (PLG-40, PLG-76)."""
    _, front, text = path.read_text().split("---", 2)
    listed = yaml.safe_load(front)["skills"]
    named = {n for n in NAMED.findall(text) if n in SKILLS}
    assert named and named <= set(listed), sorted(named - set(listed))
    assert set(listed) <= set(SKILLS)


def test_a_file_named_in_another_skill_is_there():
    found = 0
    for path in [*(PLUGIN / "agents").glob("*.md"), *(PLUGIN / "commands").glob("*.md")]:
        text = " ".join(unfenced(path.read_text()).split())
        for section, page, skill in IN_SKILL.findall(text):
            found += 1
            file = SKILLS_DIR / skill / "references" / page
            assert file.is_file(), f"{path.name}: no {page} in {skill}"
            if section:
                assert f"## {section}\n" in file.read_text(), f"{path.name}: no *{section}* in {page}"
    assert found >= 5

test_every_cross_reference_names_what_is_there keeps its body and now reads the agent and the prompts too.

In tests/test_explorer.py:

  • SKILLS gains "signing-in": f"{NAMESPACE}signing-in/SKILL.md", and its comment names all three.
  • test_it_loads_strictly asserts front()["skills"] == ["driving-a-browser", "building-flows", "signing-in"].
  • test_it_names_the_skill_by_uri becomes test_it_names_each_skill_by_name:
async def test_it_names_each_skill_by_name(server):  # spec test 4, PLG-76
    text = body()
    assert all(f"`{name}`" in text for name in SKILLS) and "skill://" not in text
    async with Client(server.mcp.server) as client:
        got = await request(client, "agents/get", name="explorer")
    assert got["_meta"]["io.kubed/agent"]["skills"] == SKILLS
    assert got["instructions"] == text
  • test_every_uri_it_names_is_served drops the two skill:// entries from its expected set, and drops the NAMESPACE branch of its loop.

In tests/test_agents_extension.py, test_get_returns_the_detail's map gains "signing-in": "skill://selenium-flow/signing-in/SKILL.md".

  • Step 2: Run them to see them fail

Run: pytest tests/test_skill.py tests/test_explorer.py tests/test_agents_extension.py -p no:randomly Expected: FAIL.

  • test_no_skill_address_outside_fenced_code fails on the three files.

  • test_every_skill_an_agent_names_is_in_its_skills fails: named is empty.

  • test_a_file_named_in_another_skill_is_there fails found >= 5.

  • The explorer's skills assertions fail on two against three.

  • Step 3: Rewrite them, by the design's §3 table for the seven addresses:

    • explorer.md Before anything reads: "Read the driving-a-browser skill before any browser call, and FLOWS.md in the building-flows skill before your first save_flow. Read SECRETS.md in the signing-in skill only when the hand-off names a sign-in." The rest of the paragraph stays;
    • explorer.md's frontmatter: skills: [driving-a-browser, building-flows, signing-in];
    • in the prompts, only the four addresses change. Each sentence around one stays as it is.
  • Step 4: Run the tests to see them pass

Run: pytest tests/test_skill.py tests/test_explorer.py tests/test_agents_extension.py tests/test_prompts.py -p no:randomly Expected: PASS.

  • Step 5: Run the checks

Run: ruff check . and pytest Expected: lint clean. In pytest, only the eight tests/test_golden.py::test_the_plugin_surface* cases fail. Each fails on the explorer's frontmatter wherever it is recorded (agents/list, agents/get, the agents folder's index and directory rows), on agents/get's instructions and _meta skills, and on prompts/get's text. Task 4 regenerates them.

  • Step 6: Commit
git add plugin/agents/explorer.md plugin/commands/build_flow.md plugin/commands/repair_flow.md \
  tests/test_skill.py tests/test_explorer.py tests/test_agents_extension.py
git commit -m "Explorer and prompts: name skills by name; the explorer loads signing-in (#232)"

Task 3: The mcp instructions give every skill's address

Files:

  • Modify: kubed/selenium_flow/mcp/instructions.py (SKILL_POINTER, the import)
  • Test: tests/test_resources.py

Interfaces:

  • Consumes: guidance.root(skill: str) -> str and guidance.pointer(page: str) -> str, as they are.

  • Produces: SKILL_POINTER, rendered, ends with the design §2 sentence, exactly.

  • Step 1: Write the failing tests in tests/test_resources.py

PATTERN = "skill://selenium-flow/<name>/SKILL.md"
EXAMPLE = "skill://selenium-flow/building-flows/references/FLOWS.md"


def test_the_mcp_pointer_gives_every_skill_its_address():  # PLG-58, PROT-29
    for reads in (True, False):
        text = instructions.instructions(reads)
        assert PATTERN in text and "references/FLOWS.md in building-flows is " + EXAMPLE in text
    for via in ("extension", "local"):
        assert "<name>" not in instructions.instructions(True, via=via)

test_the_instructions_carry_the_gateway_prefix asserts, under each of the two prefix headers:

        assert "sf+" + PATTERN in c.instructions and "sf+" + EXAMPLE in c.instructions

test_the_skill_line_follows_via stays as it is: extension and local still carry no skill://.

  • Step 2: Run them to see them fail

Run: pytest tests/test_resources.py -k "pointer or prefix" -p no:randomly Expected: FAIL. PATTERN is not in the instructions.

  • Step 3: Implement it. instructions.py also imports pointer and root from ..core.guidance. SKILL_POINTER's last line, "call; it ships with this server, so it describes this version of it.", goes on into:
call; it ships with this server, so it describes this version of it. Every \
skill this server has reads at {root('<name>')}/SKILL.md, and a path a skill \
names is from that folder: references/FLOWS.md in building-flows is \
{pointer('FLOWS.md')}.

The quotes inside the braces are single: before 3.12 an f-string's expression may not reuse its own quote. The text still goes through .format(how=...). Neither <name> nor the addresses hold a brace.

  • Step 4: Run the tests to see them pass

Run: pytest tests/test_resources.py tests/test_guidance.py -p no:randomly Expected: PASS. If the prefix assertion fails while test_the_mcp_pointer_gives_every_skill_its_address passes, kubed-mcp's rewrite does not reach <name>. Stop and report (Review Focus 1).

  • Step 5: Run the checks

Run: ruff check . and pytest Expected: lint clean. Only the plugin golden cases fail: Task 2's, and the four mcp ones (auto-on, auto-off, legacy-on, legacy-off) on initialize.instructions too.

  • Step 6: Commit
git add kubed/selenium_flow/mcp/instructions.py tests/test_resources.py
git commit -m "Instructions: under mcp, say where every skill and its pages read (#232)"

Task 4: Regenerate the plugin goldens

Files:

  • Modify: the eight tests/golden/plugin-*.json

  • Step 1: Regenerate

Run: GOLDEN_UPDATE=1 pytest tests/test_golden.py

  • Step 2: Read the diff

Run: git diff --stat tests/golden and git diff tests/golden Expected: exactly the eight plugin-*.json files, and in them only these changes:

  • signing-in in the explorer's frontmatter skills, wherever it is recorded, and in agents/get's _meta skills;
  • the explorer's instructions;
  • the two prompts' prompts/get text;
  • in the four mcp files, initialize.instructions, which gains the sentence.

Any other change means a task went beyond the plan. Find it before committing.

  • Step 3: Run the checks

Run: ruff check . and pytest Expected: both clean.

  • Step 4: Commit, the goldens alone
git add tests/golden/plugin-*.json
git commit -m "Goldens: the explorer loads signing-in, links by name, and the mcp pointer (#232)"

Task 5: The spec, the design's History and the changelog

Files:

  • Modify: docs/superpowers/specs/plugin.md (PLG-9, -10, -11, -14, -41, -45, -47, -53, -54, -58, -62, -71, -73; new PLG-76 after PLG-11)
  • Modify: docs/superpowers/specs/protocol.md (PROT-29)
  • Modify: docs/superpowers/plans/2026-11-27-skill-links-design.md (its History header only)
  • Modify: CHANGELOG.md ([Unreleased])

Interfaces:

  • Consumes: Tasks 1 to 4, as built. Check each statement against the code before you write it.

  • Step 1: Edit the area files by the design's "The spec, id by id" table. PLG-76 states §1's rules and its three forms, and cites PLG-11 for its tests. PLG-58 and PROT-29 quote no sentence: they say what the pointer gives. PROT-30, PROT-31 and PLG-59 stay as they are.

  • Step 2: Add the changelog line at the top of [Unreleased]:

- Skills link their own pages by relative path and name other skills by name, so they read behind a gateway that rewrites `skill://` addresses and in a local install; the explorer also loads `signing-in` (#232).
  • Step 3: In the design's History header, say that PR #236 built it, and anything Tasks 1 to 4 found that differs from the design.

  • Step 4: Run the checks

Run: ruff check . and pytest Expected: both clean, tests/test_wiki.py included.

  • Step 5: Commit
git add docs CHANGELOG.md
git commit -m "Spec: PLG-76, links in the plugin by path and by name; the mcp pointer's pattern (#232)"

After the tasks

  • The live check (#232's "Done when"), on the image the epic deploys for this PR. Read these with resources/read, each at the address its relative link resolves to:

    • skill://selenium-flow/signing-in/references/SECRETS.md, from signing-in/SKILL.md;
    • skill://selenium-flow/using-the-admin-ui/references/AGENT_AS_ADMIN.md, from ADMIN_UI.md;
    • skill://selenium-flow/driving-a-browser/references/TROUBLESHOOTING.md, from INTERACTION.md.

    Then open one connection with Sf-Resource-Prefix: sf+ and read the instructions' pattern. The PR gives the image tag and what each read returned.

  • The PR says that the extension-aware pointer, PROT-30 and PROT-31 wait for the kubed-mcp 0.5 sub-issue, and that #192 inherits the prompts' new links.

Clone this wiki locally