aeat.agent._workspace module

Materialise a Claude-native operator workspace from the shipped harness data.

Per ADR R4 the workspace materialiser is DEMOTED from the primary delivery vehicle to an optional Claude-native mirror: the operating layer reaches an arbitrary MCP client through the console’s floor tool, resources, and prompts, and this materialiser is the Claude-specific enhancement that lays the same shipped harness out in the layout a Claude Code project loads natively.

The emitted layout is the Claude-native convention for an end-user project directory - never the repository’s own vaultspec developer .claude/ tree:

  • workflow skills -> .claude/skills/<name>/SKILL.md (plus each skill’s reference/ progressive-disclosure material), the standard skill layout;

  • tax-advisor personas -> .claude/agents/<name>.md, Claude Code subagent definitions;

  • operator operating rules -> .claude/rules/<name>.md, aggregated by a root CLAUDE.md that @-imports each rule so the always-on operating contract loads at session start.

This is a REPLACEMENT of the prior flat {rules,personas,skills}/ layout, not an addition (the no-legacy discipline): the flat layout is gone. It writes only the reviewed harness markdown (no secrets, no tax data) and computes no value.

class PluginManifest(**data)[source]

Bases: BaseModel

Result of materialising a Claude plugin from the shipped harness source.

skills_written / agents_written count the skills/<name>/SKILL.md and agents/<persona>.md documents written at the plugin root; persona_default is the userConfig persona default baked into the manifest (empty string = the full tool surface).

Parameters:
  • output_path (str)

  • plugin_name (str)

  • version (str)

  • skills_written (int)

  • agents_written (int)

  • persona_default (str)

output_path: str
plugin_name: str
version: str
skills_written: int
agents_written: int
persona_default: str
class MarketplaceManifest(**data)[source]

Bases: BaseModel

Result of materialising the marketplace-served tree from the harness source.

plugin_source is the relative plugins[].source the marketplace manifest points at (./plugins/aeat); plugin is the nested PluginManifest for the plugin materialised under that source, so the marketplace and the plugin it serves are one emission and cannot drift.

Parameters:
output_path: str
marketplace_name: str
plugin_source: str
plugin: PluginManifest
materialise_plugin(output_dir, *, version=None, persona_default='')[source]

Write the shipped harness under output_dir as a Claude plugin.

Emits .claude-plugin/plugin.json carrying the plugin manifest (including the userConfig persona option), the top-level skills/<name>/SKILL.md tree (plus each skill’s reference/ material), the agents/<persona>.md tree with Claude-native frontmatter, and the .mcp.json stdio server declaration, all from the single authored harness source. The version is resolved from installed package metadata when not supplied; persona_default seeds the userConfig persona default.

Return type:

PluginManifest

Returns:

PluginManifest describing the plugin written.

Parameters:
  • output_dir (Path)

  • version (str | None)

  • persona_default (str)

materialise_marketplace(output_dir, *, version=None, persona_default='')[source]

Write the marketplace-served tree under output_dir from the harness source.

Emits .claude-plugin/marketplace.json listing the aeat plugin and, under the relative plugins/aeat source it points at, the full plugin tree via materialise_plugin(). Because both come from one call, the marketplace manifest and the plugin it serves cannot drift. version and persona_default pass straight through to the plugin emission.

Return type:

MarketplaceManifest

Returns:

MarketplaceManifest describing the marketplace tree written.

Parameters:
  • output_dir (Path)

  • version (str | None)

  • persona_default (str)

class WorkspaceManifest(**data)[source]

Bases: BaseModel

Result of materialising a Claude-native operator workspace.

rules_written / personas_written / skills_written count the .claude/rules, .claude/agents, and .claude/skills documents written; the aggregating CLAUDE.md is derived from the rules and is not separately counted.

Parameters:
  • output_path (str)

  • rules_written (int)

  • personas_written (int)

  • skills_written (int)

output_path: str
rules_written: int
personas_written: int
skills_written: int
materialise_workspace(output_dir)[source]

Write the shipped harness under output_dir in the Claude-native layout.

Emits .claude/skills/<name>/SKILL.md (plus each skill’s reference/ material), .claude/agents/<persona>.md, .claude/rules/<rule>.md, and a root CLAUDE.md importing every rule.

Return type:

WorkspaceManifest

Returns:

WorkspaceManifest describing the files written.

Parameters:

output_dir (Path)