coact.frontmatter¶
The additive coact: SKILL.md frontmatter convention and its validator.
COACT_SPEC §4 / DECISIONS D1. The standard SKILL.md frontmatter (name,
description) does not carry what COMPLETE needs to derive tools, model, MCP,
or a return contract. coact defines an optional, additive coact:
block (snake_case interior) that a skill author — or coact itself — fills in so
the skill→agent lift is mechanical and reproducible (SSOT for the extras):
coact:
tools: [Read, Grep, Glob]
model: sonnet
memory: project
mcp:
- module: ov.analyzers
functions: [score_contrast, find_tap_targets]
returns:
schema_ref: ov.schemas:UxFindings
description: Usability findings for the captured bundle
consumes: evidence_bundle
persona: |
You are a meticulous UX analyst...
The block is ignored by other tools (a skill carrying it is still a valid plain
SKILL.md). The Agent Skills spec keeps custom keys under metadata:, so a
spec-clean skill may nest the block there instead (metadata: {coact: {...}});
coact reads either, and a top-level block wins when both exist. coact reads it from the raw frontmatter because
skill.SkillMeta only retains the standard keys — so this module parses the
SKILL.md text directly rather than going through Skill.meta.
The validator is registered into skill.create.validators (additive) and also
exposed via a skill.validators entry point, so skill validate checks the
block without coact having to be the entry point.
Module Attributes
The single namespaced frontmatter key coact reads/writes. |
|
|
Functions
|
Return |
|
Parse a |
Register the coact-block validator into |
|
|
Validate a |
Classes
|
The parsed |
- coact.frontmatter.COACT_KEY = 'coact'¶
The single namespaced frontmatter key coact reads/writes.
- class coact.frontmatter.CoactMeta(tools=None, disallowed_tools=list(), model=None, memory=None, permission_mode=None, skills=list(), mcp=list(), returns=None, consumes=None, persona=None)[source]¶
Bases:
objectThe parsed
coact:block (every field optional; all default to absent).>>> m = CoactMeta.from_frontmatter({'coact': {'model': 'opus', 'tools': ['Read']}}) >>> m.model, m.tools, m.is_empty() ('opus', ['Read'], False) >>> CoactMeta.from_frontmatter({'name': 'x'}).is_empty() True >>> CoactMeta.from_frontmatter({'metadata': {'coact': {'model': 'haiku'}}}).model 'haiku'- classmethod from_frontmatter(meta)[source]¶
Build from a full frontmatter dict (reads the
coactsub-mapping).The block is the top-level
coactkey, elsemetadata.coact.- Return type:
- return_contract()[source]¶
The author-pinned
ReturnContract, if any.- Return type:
- coact.frontmatter.METADATA_KEY = 'metadata'¶
metadata.coactis read when there is no top-levelcoactblock.- Type:
The spec’s home for custom keys
- coact.frontmatter.coact_block_location(meta)[source]¶
Return
(block, path): the frontmatter’s coact block and where it was found.pathis"coact"(top level, which wins when both exist),"metadata.coact"(the Agent Skills spec’s home for custom keys), or"coact"with aNoneblock when there is none, so writers default to the top level.>>> coact_block_location({'metadata': {'coact': {'model': 'opus'}}}) ({'model': 'opus'}, 'metadata.coact') >>> coact_block_location({'coact': {'model': 'haiku'}, 'metadata': {'coact': {}}}) ({'model': 'haiku'}, 'coact') >>> coact_block_location({'name': 'x'}) (None, 'coact')
- coact.frontmatter.parse_coact_meta(source)[source]¶
Parse a
CoactMetafrom a SKILL.md path/text/Skill/frontmatter dict.Accepts the several shapes coact callers have on hand:
a
Skill(uses itssource_pathto re-read the raw frontmatter, sinceSkill.metadrops thecoactkey);a filesystem path to a skill directory or a SKILL.md file;
raw SKILL.md text;
an already-parsed frontmatter dict.
>>> parse_coact_meta("---\nname: x\ncoact:\n model: haiku\n---\nbody").model 'haiku'- Return type:
- coact.frontmatter.register_validator()[source]¶
Register the coact-block validator into
skill.create.validators(idempotent).- Return type:
- coact.frontmatter.validate_coact_block(skill_or_meta)[source]¶
Validate a
coact:block, returning issue strings (empty = valid/absent).Additive: a skill with no
coact:block passes trivially. The block is read from the top level or frommetadata.coact(seecoact_block_location()), and issues are prefixed with where it was found. Checks key spelling,model/memoryenums,mcpentry shape, and thatreturnscarries exactly one ofschema_ref/json_schema.>>> validate_coact_block({'coact': {'model': 'gpt-4'}}) ["coact.model: 'gpt-4' is not one of sonnet, opus, haiku, inherit"] >>> validate_coact_block({'coact': {'mcp': [{'functions': ['f']}]}}) ["coact.mcp[0]: missing required 'module'"] >>> validate_coact_block({'name': 'ok'}) []