PACKGEN.md is the authoritative spec for a new pack, the sibling of CODEGEN.md (body) and TESTGEN.md (test): the pack.json manifest, its config schema and how it maps onto bridges.<name>/packs.<name>, the enable switch, referencing a bridge by name, authoring a new bridge (BridgeService + CATALOG + build_bridge + the optional-dep 503 rule), acceptance criteria, a worked example, and a checklist. Add a thin OpenCode skill (.opencode/skills/packgen/SKILL.md) that walks the workflow and points at PACKGEN.md, and cross-link the contract from AGENTS.md, README.md, CODEGEN.md, and TESTGEN.md.
2.8 KiB
2.8 KiB
name, description
| name | description |
|---|---|
| Pack Generation | Author a new semif-agent skill pack (packs/<name>/) — the pack.json manifest, its skill leaves, its bridge reference, and its config schema. Use when adding a new concern/product bundle under packs/, or when adding a new bridge service to back one. |
Pack Generation
This skill walks you through adding a pack to semif-agent. The full contract
is the repository file PACKGEN.md (at the repo root, i.e. ../../../PACKGEN.md
relative to this skill). Read it before making changes — it is the source of
truth and this skill is only the workflow.
When to use
- The user wants a new concern/product bundle under
packs/<name>/. - The user wants a new third-party service backed by a bridge in
semif_agent/bridges/. - The user is adding skills that should ship as committed seeds rather than be authored at runtime.
Workflow
- Read
PACKGEN.mdin full. - Decide the concern and categories. Write one- to two-sentence, navigation-grade category descriptions — SemIf routes on them.
- Bridge check. If the pack talks to a third-party system, confirm a bridge
already fronts it in
semif_agent/bridges/registry.pyCATALOG. If not, author the bridge first (see the "Authoring a new bridge" section ofPACKGEN.md), register it inCATALOG, and give it a pack config block. - Create
packs/<name>/pack.jsonwithname,title,concern,categories,bridges,requires,enabled_by_default, and theconfigschema. Model it onpacks/essentials/pack.json(bridge-less) orpacks/simplex/pack.json(bridge-backed). - Add each leaf under
skills/<category>/<leaf>/—skill.py,manifest.json,contract.json,skill.test.py— followingCODEGEN.mdandTESTGEN.md. Do not restate those rules; follow them. - Regenerate and validate config:
python -m semif_agent.cli check-config --write-example config.example.jsonthenpython -m semif_agent.cli check-config. - Run the tests:
python3 -m pytest tests/test_packs.py tests/test_codegen.py -q(plustests/test_<name>_bridge.pyif you added a bridge). - Cross-link the pack/bridge in
AGENTS.md(andREADME.mdfor a shipped pack). - Verify a real run against the user's actual service — a passing hermetic test proves mechanics only, never the live integration.
Guardrails
- A pack is declarative and committed; never put a credential in it (secrets
live in the gitignored
secrets.json). - Bridge code stays in
semif_agent/bridges/; a pack only references a bridge by name. Never widen the gateway. concernandcategoriesare required; every category needs a description.- Regenerate
config.example.jsonfrom the schema after any schema change; the example and the live config are never hand-edited.