AgentSkillsCN

new-module

使用 MANIFEST.yaml 与必要文件,搭建一个新的模块实例。关键词:模块、脚手架、MANIFEST。

SKILL.md
--- frontmatter
name: new-module
description: "Scaffold a new module instance with MANIFEST.yaml and required files. Keywords: module, scaffold, MANIFEST."

Scaffold: New Module Instance

This document is an entrypoint for module scaffolding. The step-by-step flow is in /.system/skills/ssot/repo/scaffolding/new-module/SKILL.md.


1. Purpose & Scope

Purpose: Create a new module directory with all required files (MANIFEST.yaml, AGENTS.md, standard skeleton) and register it in the modular system.

Scope:

  • Creates module directory under /modules/<module_id>/
  • Generates required files (MANIFEST.yaml, AGENTS.md)
  • Optionally creates ABILITY.md, workdocs/
  • Triggers derived registry regeneration

Out of scope:

  • Business logic implementation
  • Flow graph modifications (handled separately)
  • Integration scenario creation

2. Inputs & Preconditions

Required Inputs

ParameterTypeDescription
module_idstringUnique identifier (snake_case recommended)
descriptionstringOne-line description of module purpose

Optional Inputs

ParameterTypeDefaultDescription
module_typestring(none)Architectural label (must exist in type_graph.yaml)
create_abilitybooleantrueCreate ABILITY.md
interfacesarray[]Initial interface definitions

Preconditions

  1. Phase 4 registry tooling is available (scripts/devops/registry/)
  2. Module Runner automation is available (scripts/modular/registry_build.py)
  3. /modules/ directory exists
  4. module_id does not already exist in /modules/

3. Step-by-Step Flow (AI + Human)

See /.system/skills/ssot/repo/scaffolding/new-module/SKILL.md.


4. Tools & Scripts

ToolPurpose
scripts/devops/scaffold/new_module.pyOrchestrator script
scripts/modular/registry_build.pyRegenerate derived registries
scripts/modular/flow_lint.pyValidate flow graph consistency

5. Outputs & Side Effects

Files Created

code
modules/<module_id>/
  MANIFEST.yaml      # Module metadata (required)
  AGENTS.md          # AI strategy (required)
  ABILITY.md         # Ability catalog (optional)
  workdocs/          # Scenario-local task state
    AGENTS.md
  src/               # Source code placeholder
  tests/             # Test files placeholder
    <placeholder>

Registries Updated

  • modules/overview/instance_registry.yaml (regenerated)
  • modules/overview/flow_impl_index.yaml (regenerated, if interfaces specified)

6. Safety & Rollback

Safety Measures

  • --dry-run always available for preview
  • Human approval required before execution
  • Schema validation on MANIFEST.yaml

Rollback Procedure

If scaffold fails or needs reverting:

  1. Delete the created module directory:
    bash
    rm -rf modules/<module_id>/
    
  2. Regenerate derived registries:
    bash
    python scripts/modular/registry_build.py
    

7. Related Documents

  • /.system/skills/ssot/repo/scaffolding/new-module/template/layout.md - Module directory structure
  • /.system/skills/ssot/repo/scaffolding/new-module/template/manifest_fields.md - MANIFEST.yaml fields
  • /.system/skills/ssot/repo/scaffolding/new-module/template/registration_flow.md - Module registration flow
  • /.system/skills/ssot/repo/architecture-core-mechanisms/module-workflow/SKILL.md - Module development workflow
  • /.system/skills/ssot/repo/architecture-core-mechanisms/modular-system/SKILL.md - Modular system details