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
| Parameter | Type | Description |
|---|---|---|
module_id | string | Unique identifier (snake_case recommended) |
description | string | One-line description of module purpose |
Optional Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
module_type | string | (none) | Architectural label (must exist in type_graph.yaml) |
create_ability | boolean | true | Create ABILITY.md |
interfaces | array | [] | Initial interface definitions |
Preconditions
- •Phase 4 registry tooling is available (
scripts/devops/registry/) - •Module Runner automation is available (
scripts/modular/registry_build.py) - •
/modules/directory exists - •
module_iddoes 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
| Tool | Purpose |
|---|---|
scripts/devops/scaffold/new_module.py | Orchestrator script |
scripts/modular/registry_build.py | Regenerate derived registries |
scripts/modular/flow_lint.py | Validate 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-runalways available for preview - •Human approval required before execution
- •Schema validation on MANIFEST.yaml
Rollback Procedure
If scaffold fails or needs reverting:
- •Delete the created module directory:
bash
rm -rf modules/<module_id>/
- •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