AgentSkillsCN

Compile Team

组建团队

SKILL.md

Skill: Compile Team

Description

Assembles a complete team configuration from AI Team Library components. Resolves persona, stack, and workflow references from a composition spec, checks for dependency conflicts, merges all resolved content into a unified CLAUDE.md constitution, and produces a generation manifest recording exactly what was compiled and from where. This is the core build step in the ScribeVault pipeline (Select --> Compose --> Compile --> Scaffold --> Seed --> Export).

Trigger

  • Invoked by the /compile-team slash command.
  • Called programmatically by src/ during pipeline execution.
  • Can be run standalone for dry-run validation without writing output files.

Inputs

InputTypeRequiredDescription
composition_specYAML file pathYesThe composition defining personas, stacks, and workflows to include
library_pathDirectory pathYesRoot of the ai-team-library (contains personas/, stacks/, workflows/)
output_dirDirectory pathNoWhere to write compiled output; defaults to ./build/
validation_strictnessEnum: light, standard, strictNoValidation level; defaults to standard

Process

  1. Parse and validate the composition spec -- Load the YAML, validate against the CompositionSpec Pydantic model, and reject malformed input early.
  2. Resolve persona references -- For each persona listed in the spec, load persona.md, outputs.md, prompts.md, and any files under templates/ from the library.
  3. Resolve stack references -- For each stack listed, load conventions.md and associated skill files from stacks/{stack}/.
  4. Resolve workflow references -- Load any workflow definitions referenced in the spec from workflows/.
  5. Check for dependency conflicts -- Detect missing references, circular dependencies, duplicate persona slots, or incompatible stack combinations.
  6. Merge all resolved content into a unified CLAUDE.md -- Concatenate sections in deterministic order: project header, persona definitions, stack conventions, workflow rules, and shared instructions.
  7. Generate a generation manifest -- Record every source file consumed, its content hash, the timestamp, and the library version, producing a generation-manifest.json.

Outputs

OutputTypeDescription
compiled_claude_mdFileUnified CLAUDE.md team constitution ready for deployment
generation_manifestJSON fileRecord of every source file, content hash, and compile metadata
validation_reportTextWarnings, info messages, or errors encountered during compilation

Quality Criteria

  • Every persona referenced in the composition spec is fully resolved (persona.md, outputs.md, prompts.md all present).
  • Every stack referenced has a conventions.md loaded.
  • The compiled CLAUDE.md contains no unresolved placeholders or template variables.
  • The generation manifest lists every source file with a valid content hash.
  • Compilation is deterministic: the same inputs always produce byte-identical outputs.
  • Validation report surfaces all warnings even when compilation succeeds.

Error Conditions

ErrorCauseResolution
InvalidCompositionSpecYAML fails schema validationFix the composition YAML to match the CompositionSpec model
PersonaNotFoundPersona name in spec has no matching library folderCheck spelling; ensure the persona exists under personas/
StackNotFoundStack name in spec has no matching library folderCheck spelling; ensure the stack exists under stacks/
MissingRequiredFileA persona directory lacks persona.md or outputs.mdAdd the missing file to the persona's library directory
DependencyConflictTwo stacks or personas declare incompatible rulesRemove one conflicting entry or resolve the conflict manually
OutputDirectoryNotWritableThe output_dir path is not writableCheck filesystem permissions or choose a different path

Dependencies

  • Validate Composition skill (or inline validation via Pydantic models)
  • Access to the ai-team-library file tree (personas/, stacks/, workflows/)
  • src/ -- CompositionSpec and GenerationManifest data contracts
  • src/ -- reference implementation of the compile logic