/passageway:create-passageway-connectorfrom passageway
Create a passageway connector, a small program that lists the items of a source and prints their text as JSON Lines. Use when the user wants passageway to index a new source such as a folder, an API, a database or a wiki.
Ships in passageway. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A connector is any program that tells passageway what exists in a source, what is in it and, optionally, what changed. passageway runs it as <command> <mode>, reads one JSON object per line from stdout, and stores nothing from a call that fails. Reference: https://getpassageway.com/reference/connector-protocol/. The whole documentation as one file: https://getpassageway.com/llms-full.txt; the index https://getpassageway.com/llms.txt lists every page with its markdown address. Fetch the page for what you touch before acting on it.
#!/usr/bin/env python3
"""A passageway connector for a folder of .txt files. Setting: FOLDER."""
import hashlib
import json
import os
import sys
from pathlib import Path
folder = Path(os.environ["FOLDER"]).resolve()
files = sorted(p for p in folder.rglob("*.txt") if p.is_file())
def item_id(path):
return path.relative_to(folder).as_posix()
def version(path):
return hashlib.sha256(path.read_bytes()).hexdigest()[:12]
def emit(record):
print(json.dumps(record))
mode = sys.argv[1]
if mode == "check":
emit({"ok": True, "count": len(files)})
elif mode == "list":
for p in files:
emit({"id": item_id(p), "version": version(p)})
elif mode == "fetch":
wanted = {json.loads(line)["id"] for line in sys.stdin if line.strip()}
for p in files:
if item_id(p) in wanted:
emit({"id": item_id(p), "title": p.stem, "url": p.as_uri(), "version": version(p),
"sections": [{"heading": None, "text": p.read_text(encoding="utf-8")}]})
# "changed" is optional: print nothing, and edits show up at the next reconcile.
Adapt it. Keep the four modes. Choose the id and the version as decided in step 1. Cut an item into sections that are natural units (a heading and its text); passageway splits very long ones itself. Optional fields shape the ranking and the answer: weight (a multiplier, default 1.0), path (a breadcrumb), labels, links (ids of related items) and updated.
In Python you can drop the plumbing (mode dispatch, stdin ids, all-or-nothing output, exit codes, item validation) with passageway-sdk: subclass Connector, implement versions() and fetch(ids), call main(). The same folder connector with the SDK, the install line and the API are in https://getpassageway.com/guides/write-a-connector/ and https://getpassageway.com/reference/sdk/. Show the user the plain script if they want to see the protocol, and offer the SDK version for Python.
Test it with the shared contract check. It runs check, list, fetch and changed against your connector and checks the rules below.
import sys
from pathlib import Path
from passageway.protocol import Connector
from passageway.testing.contract import check_connector
def test_my_connector(tmp_path):
(tmp_path / "a.txt").write_text("A note about lighthouses.")
script = str(Path(__file__).with_name("my_connector.py"))
check_connector(Connector("mine", [sys.executable, script], env={"FOLDER": str(tmp_path)}))
passageway must be importable where pytest runs: uv add --dev passageway, or run uv run --with passageway pytest.
For a connector in another language, run each mode by hand and compare with the rules.
5. Register it in ~/.config/passageway/passageway.toml:
[[connector]]
name = "mine" # starts with a-z or 0-9, then a-z, 0-9, _ or -; it names the index file
command = ["/path/to/python", "/path/to/my_connector.py"]
env = { FOLDER = "/path/to/notes" }
secrets = { TOKEN = "env:MY_TOKEN" } # references to environment variables, never values
A connector runs with an empty environment except PATH and HOME, so use an absolute interpreter path, and name every variable it needs in env or secrets.
6. Run it and check GET /health. The human starts the server and runs the request; you read the output, never the password. degraded means the connector failed; the human adds the bearer header to see the error text and tells you what it says.
list is the truth for deletions: print every existing item. If the listing can be incomplete, exit non-zero instead of printing less. passageway refuses a reconcile that would delete more than a set share of a source.fetch prints only the ids it is asked for and skips ids that no longer exist.changed is optional. Without it, edits appear at the next reconcile (every 30 minutes by default).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub getpassageway/passageway --plugin passageway7 skills in this plugin
/passagewayRetrieval for Claude over MCP. Use when the user wants to install, configure, run or extend passageway: index their sources with connectors, ask the recall tool a question, or write a new connector./passageway-add-sourceAdd a source to a running passageway: write the [[connector]] for a folder of markdown, Trilium, Confluence or Wikipedia into passageway.toml, with secrets as env: references, then restart and check /health. Use when the user wants passageway to index something, or when the index is empty after connecting Claude Code./passageway-connectConnect Claude Code to a running passageway server: set its URL and password once, so the prompt hook adds relevant passages from the user's sources automatically and the recall MCP tool is registered. Use when the user wants to connect, check or remove the passageway hook or MCP server in Claude Code.Other plugins' skills for the same job