/component-lifecycle
Unified command for the complete component lifecycle: create, improve, index, activate, and capture context in a single operation.
Purpose
Combines five separate operations into one atomic workflow:
/component-create + /component-improvement + /component-index + /component-activate + /cx
Usage
# Create new component with full lifecycle
/component-lifecycle agent my-new-agent "Description of agent"
# Create and process existing component
/component-lifecycle skill existing-skill --existing
# Full lifecycle with all options
/component-lifecycle command my-command "Command description" --commit --push
# Using aliases
/cl agent data-processor "Processes data files"
/component-full hook pre-commit-validator "Validates commits"
# Skip specific phases
/component-lifecycle agent test-agent "Test" --skip-improve
/component-lifecycle skill test-skill --existing --skip-cx
# Dry run (preview all phases)
/component-lifecycle agent test-agent "Test" --dry-run
# === MIGRATION / RELOCATION ===
# Migrate a component to another repo (creates stubs + moves code)
/component-lifecycle skill pdf-to-markdown --migrate --to coditect-research-continuum
# Migrate multiple components at once
/component-lifecycle --migrate --batch skill:pdf-to-markdown,command:pdf-to-markdown,command:udom-navigator --to coditect-research-continuum
# Deprecate a component (stub only, no target repo)
/component-lifecycle agent old-agent --deprecate --reason "Superseded by new-agent"
# Dry run migration (preview stubs and moves)
/component-lifecycle skill pdf-to-markdown --migrate --to coditect-research-continuum --dry-run
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Component type: agent, skill, command, hook, script, workflow, standard |
name | string | Yes | Component name (kebab-case) |
description | string | No | Component description (for new components) |
Options
| Option | Short | Default | Description |
|---|---|---|---|
--existing | -e | false | Process existing component (skip create) |
--skip-create | false | Skip creation phase | |
--skip-improve | false | Skip improvement phase | |
--skip-index | false | Skip indexing phase | |
--skip-activate | false | Skip activation phase | |
--skip-cx | false | Skip context capture | |
--commit | -c | false | Git commit after completion |
--push | -p | false | Push to remote (requires --commit) |
--dry-run | -n | false | Preview all phases without executing |
--verbose | -v | false | Show detailed output for each phase |
--task-id | -t | None | Task ID for tracking (e.g., F.3.1) |
--migrate | -m | false | Migrate component to another repo (creates stubs) |
--deprecate | false | Deprecate component (stub only, no target) | |
--to | None | Target repo for migration (e.g., coditect-research-continuum) | |
--reason | None | Reason for deprecation/migration | |
--batch | None | Comma-separated list of type:name pairs for batch migration | |
--keep-source | false | Keep source files after migration (don't delete) |
Lifecycle Phases
Phase 1: CREATE
Condition: New component (not --existing)
Actions:
- Generate component from template
- Apply YAML frontmatter
- Create directory structure (for skills)
- Set initial metadata
Script: scripts/component-create.sh
# Equivalent to:
/component-create <type> <name> "<description>"
Phase 2: IMPROVE
Condition: Always (unless --skip-improve)
Actions:
- Analyze component quality (component-analyzer)
- Identify missing sections
- Apply enhancements (component-enhancer)
- Validate with MoE classifier
- Update frontmatter confidence
Agents: component-analyzer, component-enhancer
# Equivalent to:
/agent component-analyzer "Analyze <path>"
/agent component-enhancer "Enhance <path>"
Phase 3: INDEX
Condition: Always (unless --skip-index)
Actions:
- Add to component database (platform.db)
- Generate embeddings
- Update FTS5 search index
- Register capabilities
- Update component counts
Script: scripts/component-indexer.py -i
# Equivalent to:
python3 scripts/component-indexer.py -i
python3 scripts/update-component-counts.py
Phase 4: ACTIVATE
Condition: Always (unless --skip-activate)
Actions:
- Register in component registry
- Enable runtime loading
- Verify activation
- Update activation status
Script: scripts/core/ensure_component_registered.py
# Equivalent to:
/component-activate <path>
python3 scripts/core/ensure_component_registered.py <path>
Phase 5: CONTEXT
Condition: Always (unless --skip-cx)
Actions:
- Extract session context
- Save component creation metadata
- Update unified_messages.jsonl
- Generate embeddings for searchability
Command: /cx
# Equivalent to:
/cx --with-component-metadata
Phase 6: MIGRATE
Condition: --migrate or --deprecate flag
Actions:
- Inventory all component files in source repo (skill, command, hook, agent, script, workflow)
- For each component type found:
a. Copy source files to target repo (if
--migrate) b. Replace source files with redirect stubs c. Update registries (framework-registry.json, component-activation-status.json) d. Update component counts - Log migration in session log with full file manifest
Stub Types Created:
| Component Type | Stub Location | Stub Content |
|---|---|---|
| Skill | skills/{name}/SKILL.md | Redirect frontmatter + "Moved to {repo}" |
| Command | commands/{name}.md | Redirect frontmatter + "Moved to {repo}" |
| Hook | hooks/{name}.py | Redirect comment + passthrough |
| Agent | agents/{name}.md | Redirect frontmatter + "Moved to {repo}" |
| Script | scripts/{name}.py | Redirect comment + import bridge |
| Workflow | workflows/{name}.yaml | Redirect metadata + "Moved to {repo}" |
Stub Frontmatter Standard:
All stubs MUST include these frontmatter fields:
---
status: relocated # or "deprecated" if --deprecate
relocated_to: coditect-research-continuum # target repo name
relocated_date: 2026-02-11
relocated_path: src/pipeline/ # path within target repo
original_path: skills/pdf-to-markdown/ # original path in this repo
reason: "Product code moved to dedicated product repository"
---
Stub Body Standard:
# {Component Name}
> **This component has been relocated to [`{target-repo}`](https://github.com/coditect-ai/{target-repo}).**
>
> **New location:** `{target-repo}/{new-path}`
> **Relocated:** {date}
> **Reason:** {reason}
This stub exists so that framework discovery (skill catalog, command index, component search)
continues to find this component and directs users to its new home.
## Usage
See the [{target-repo} README](https://github.com/coditect-ai/{target-repo}) for current usage instructions.
Registry Updates:
When migrating, the following registries are updated:
| Registry | Change |
|---|---|
config/framework-registry.json | Status → relocated, add relocated_to field |
config/component-activation-status.json | Status → relocated |
config/component-counts.json | Decrement active count, increment relocated count |
Batch Migration:
When --batch is provided, all components are migrated atomically:
/component-lifecycle --migrate --batch \
skill:pdf-to-markdown,command:pdf-to-markdown,command:udom-navigator \
--to coditect-research-continuum --commit
This creates stubs for all 3 components in a single operation and single commit.
System Prompt
Execution Directive:
When the user invokes /component-lifecycle, execute ALL phases in sequence:
def execute_component_lifecycle(type, name, description, options):
"""Execute complete component lifecycle."""
path = get_component_path(type, name)
task_id = options.get('task_id', 'F.3.1')
# Phase 1: CREATE (unless --existing or --skip-create)
if not options.existing and not options.skip_create:
print(f"📝 Phase 1: CREATE - {type}/{name}")
create_component(type, name, description)
# Phase 2: IMPROVE (unless --skip-improve)
if not options.skip_improve:
print(f"🔧 Phase 2: IMPROVE - Analyzing and enhancing")
analyze_result = invoke_agent("component-analyzer", f"Analyze {path}")
if analyze_result.score < 80:
invoke_agent("component-enhancer", f"Enhance {path}")
# Phase 3: INDEX (unless --skip-index)
if not options.skip_index:
print(f"📚 Phase 3: INDEX - Adding to database")
run_script("component-indexer.py", "-i")
run_script("update-component-counts.py")
# Phase 4: ACTIVATE (unless --skip-activate)
if not options.skip_activate:
print(f"⚡ Phase 4: ACTIVATE - Enabling component")
run_script("core/ensure_component_registered.py", path)
# Phase 5: CONTEXT (unless --skip-cx)
if not options.skip_cx:
print(f"💾 Phase 5: CONTEXT - Capturing to memory")
execute_command("/cx")
# Git workflow (if --commit)
if options.commit:
git_add(path)
git_commit(f"feat({type}): Add {name} via component-lifecycle")
if options.push:
git_push()
print(f"✅ COMPLETE: {type}/{name} lifecycle finished")
return success_summary()
Examples
Example 1: Create New Agent
/component-lifecycle agent data-processor "Processes and transforms data files"
Output:
📝 Phase 1: CREATE - agent/data-processor
✓ Created: agents/data-processor.md
✓ Applied template: agent-standard
🔧 Phase 2: IMPROVE - Analyzing and enhancing
✓ Quality score: 72% → 85%
✓ Added: Success Output, Completion Checklist
✓ MoE confidence: 0.92
📚 Phase 3: INDEX - Adding to database
✓ Indexed in platform.db
✓ Generated embeddings
✓ Component count: 2,335
⚡ Phase 4: ACTIVATE - Enabling component
✓ Registered in component_registry
✓ Activation verified
💾 Phase 5: CONTEXT - Capturing to memory
✓ Session context saved
✓ Component metadata captured
✅ COMPLETE: agent/data-processor lifecycle finished
Summary:
Component: agents/data-processor.md
Quality: 85% (Grade B)
Status: Active
Indexed: Yes
Context: Captured
Example 2: Improve Existing Skill
/component-lifecycle skill api-design-patterns --existing --commit
Output:
🔧 Phase 2: IMPROVE - Analyzing and enhancing
✓ Quality score: 68% → 88%
✓ Added: Anti-Patterns, When NOT to Use
📚 Phase 3: INDEX - Re-indexing
✓ Updated in platform.db
⚡ Phase 4: ACTIVATE - Verifying activation
✓ Already active
💾 Phase 5: CONTEXT - Capturing to memory
✓ Session context saved
📦 Git commit: abc1234
feat(skill): Improve api-design-patterns via component-lifecycle
✅ COMPLETE: skill/api-design-patterns lifecycle finished
Example 3: Dry Run
/component-lifecycle command new-command "Does something" --dry-run
Output:
🔍 DRY RUN: component-lifecycle
Would execute:
Phase 1: CREATE commands/new-command.md
Phase 2: IMPROVE with component-analyzer, component-enhancer
Phase 3: INDEX via component-indexer.py
Phase 4: ACTIVATE via ensure_component_registered.py
Phase 5: CONTEXT via /cx
No changes applied (dry run mode)
Component Type Paths
| Type | Path Pattern | Template |
|---|---|---|
agent | agents/<name>.md | agent-standard |
skill | skills/<name>/SKILL.md | skill-standard |
command | commands/<name>.md | command-standard |
hook | hooks/<name>.py | hook-standard |
script | scripts/<name>.py | script-standard |
workflow | docs/workflows/WF-<name>.md | workflow-standard |
standard | coditect-core-standards/CODITECT-STANDARD-<NAME>.md | standard-template |
Error Handling
| Phase | Error | Action |
|---|---|---|
| CREATE | Component exists | Skip or use --existing |
| IMPROVE | Score < 60% | Retry enhancement once |
| INDEX | Database locked | Retry with backoff |
| ACTIVATE | Registration fails | Log and continue |
| CONTEXT | /cx timeout | Continue without context |
Related Commands
| Command | Purpose |
|---|---|
/component-create | Create only |
/component-improve | Improve only |
/component-index | Index only |
/component-activate | Activate only |
/cx | Context capture only |
/component-analyze | Analysis only |
Success Criteria
Phase 1: Component file created (or exists if --existing)
Phase 2: Quality score >= 80%
Phase 3: Component in database with embeddings
Phase 4: Component registered and active
Phase 5: Context captured in unified_messages.jsonl
Completion Checklist
Before marking complete, verify:
- Component file exists at correct path
- YAML frontmatter valid and complete
- Quality score >= 80% (Grade B)
- Indexed in platform.db
- Registered in component_registry
- Context captured via /cx
- Git commit created (if --commit)
Standards Compliance
- CODITECT-STANDARD-AUTOMATION.md - Principle #5: Complete Execution Chain
- CODITECT-STANDARD-TASK-ID-PROTOCOL.md - Task ID in operations
- CODITECT-STANDARD-TRACK-NOMENCLATURE.md - Track F (Documentation) for docs
Changelog
| Version | Date | Changes |
|---|---|---|
| 1.1.0 | 2026-02-11 | Phase 6: MIGRATE — component relocation with stubs, batch migration, registry updates |
| 1.0.0 | 2026-01-23 | Initial unified lifecycle command |
Author: Claude Opus 4.5 + Hal Casteel Owner: AZ1.AI INC