Context Engineering Integration Plan v2
Context Engineering Integration Plan v2
Executive Summary
This plan integrates the Agent-Skills-for-Context-Engineering repository (MIT license) into CODITECT-CORE, adding 5 new agents, 8 new skills, 3 new commands, 4 new scripts, 3 new workflows, and 1 new hook.
Source Repository: external/Agent-Skills-for-Context-Engineering
Author: Muratcan Koylan
License: MIT (fully compatible)
Impact Summary
| Component Type | Current Count | New Additions | Final Count |
|---|---|---|---|
| Agents | 130 | +5 | 135 |
| Skills | 187 | +8 | 195 |
| Commands | 144 | +3 | 147 |
| Scripts | 236 | +4 | 240 |
| Workflows | 1,149 | +3 | 1,152 |
| Hooks | 41 | +1 | 42 |
| Total | 1,892 | +24 | 1,916 |
Phase 1: Foundation (Week 1)
1.1 Skill Integration (Priority: P0)
Adapt 8 skills from the external repository to CODITECT frontmatter standards.
| Skill Name | Source | Priority | Complexity | Est. Hours |
|---|---|---|---|---|
context-fundamentals | skills/context-fundamentals/ | P0 | Low | 2 |
context-degradation | skills/context-degradation/ | P0 | Medium | 3 |
context-compression | skills/context-compression/ | P0 | Medium | 3 |
memory-systems | skills/memory-systems/ | P1 | High | 4 |
context-optimization | skills/context-optimization/ | P1 | Medium | 3 |
advanced-evaluation | skills/advanced-evaluation/ | P1 | High | 4 |
tool-design | skills/tool-design/ | P2 | Low | 2 |
project-development | skills/project-development/ | P2 | Medium | 3 |
Adaptation Requirements:
- Convert to CODITECT YAML frontmatter format (see templates)
- Add
component_type: skilland required identity fields - Add
levels:section for progressive disclosure - Add
when_to_use:andwhen_not_to_use:fields - Add
composes_with:andrequires:relationships - Preserve original Python scripts in
scripts/subdirectory - Move detailed references to
references/subdirectory
1.2 Script Adaptation (Priority: P0)
Create wrapper modules for utility functions to integrate with CODITECT patterns.
| Script | Source | Integration Target | Est. Hours |
|---|---|---|---|
context_health_monitor.py | degradation_detector.py | /cx command enhancement | 3 |
compression_quality_test.py | compression_evaluator.py | Session compression | 3 |
batch_pipeline.py | pipeline_template.py | Workflow automation | 4 |
tool_docs_validator.py | description_generator.py | Component validation | 2 |
Phase 2: Agent Creation (Week 2)
2.1 New Agent Definitions (Priority: P0)
Create 5 specialized agents leveraging external utility functions.
| Agent Name | Domain | MoE Role | Base Utilities | Est. Hours |
|---|---|---|---|---|
context-health-analyst | qa | analyst | degradation_detector.py | 4 |
compression-evaluator | qa | judge | compression_evaluator.py | 4 |
llm-judge | qa | judge | evaluation_example.py | 4 |
multi-agent-coordinator | development | orchestrator | coordination.py | 5 |
tool-designer | documentation | specialist | description_generator.py | 3 |
Agent Template Enhancement:
- All agents will follow
config/frontmatter-templates/agent-template.md - Include Claude 4.5 optimization sections
- Reference skills via
composes_with: - Include invocation examples
2.2 Agent Integration Patterns
Each agent integrates with existing CODITECT patterns:
context-health-analyst
├── Invocation: /agent context-health-analyst "analyze session"
├── Composes with: context-degradation, context-fundamentals
├── Output: Health report with recommendations
└── Integration: Enhances /cx command
compression-evaluator
├── Invocation: /agent compression-evaluator "evaluate compression"
├── Composes with: context-compression, advanced-evaluation
├── Output: Probe-based quality scores
└── Integration: Session summarization workflow
llm-judge
├── Invocation: /agent llm-judge "evaluate response quality"
├── Composes with: advanced-evaluation
├── Output: Direct scoring, pairwise comparison, rubrics
└── Integration: Quality gates, PR reviews
multi-agent-coordinator
├── Invocation: /agent multi-agent-coordinator "coordinate workflow"
├── Composes with: memory-systems, context-optimization
├── Output: Orchestration plan with failure handling
└── Integration: Enhances orchestrator capabilities
tool-designer
├── Invocation: /agent tool-designer "improve command documentation"
├── Composes with: tool-design
├── Output: Validated tool descriptions
└── Integration: Component creation workflow
Phase 3: Command Integration (Week 3)
3.1 New Command Definitions (Priority: P1)
| Command | Aliases | Description | Est. Hours |
|---|---|---|---|
/context-health | /cx-health | Analyze session context health | 3 |
/evaluate-response | /eval | LLM-as-judge evaluation | 3 |
/batch-pipeline | /batch | Manage LLM batch processing | 4 |
3.2 Command Specifications
/context-health
command_name: "/context-health"
aliases: ["/cx-health", "/health"]
usage: "/context-health [--verbose] [--recommendations]"
parameters:
- name: verbose
type: boolean
default: false
description: "Show detailed metrics"
- name: recommendations
type: boolean
default: true
description: "Include improvement recommendations"
requires_confirmation: false
modifies_files: false
Functionality:
- Token utilization analysis
- Attention degradation detection (lost-in-middle)
- Context poisoning indicators
- Health score (0-1) with status (healthy/warning/degraded/critical)
- Actionable recommendations
/evaluate-response
command_name: "/evaluate-response"
aliases: ["/eval", "/judge"]
usage: "/evaluate-response <mode> [options]"
parameters:
- name: mode
type: string
required: true
enum: [direct, pairwise, rubric]
description: "Evaluation mode"
- name: criteria
type: string
default: "accuracy,completeness,clarity"
description: "Comma-separated evaluation criteria"
requires_confirmation: false
modifies_files: false
Functionality:
- Direct scoring with weighted criteria
- Pairwise comparison with position bias mitigation
- Rubric generation for domain-specific evaluation
/batch-pipeline
command_name: "/batch-pipeline"
aliases: ["/batch"]
usage: "/batch-pipeline <stage> --batch-id <id> [options]"
parameters:
- name: stage
type: string
required: true
enum: [acquire, prepare, process, parse, render, all, clean, estimate]
- name: batch-id
type: string
required: true
- name: workers
type: number
default: 5
requires_confirmation: true
modifies_files: true
Phase 4: Workflow & Hook Creation (Week 4)
4.1 New Workflows (Priority: P2)
| Workflow | Category | Est. Hours |
|---|---|---|
context-optimization-workflow.md | AI/ML | 3 |
llm-evaluation-workflow.md | AI/ML | 3 |
batch-processing-workflow.md | Automation | 3 |
4.2 New Hook (Priority: P2)
| Hook | Event | Description | Est. Hours |
|---|---|---|---|
post-session-context-health | session_end | Auto-analyze context health | 2 |
Phase 5: Template Enhancement (Week 4)
5.1 Proposed Template Improvements
Based on analysis of external repository patterns, propose backward-compatible enhancements:
Skill Template Enhancement
File: config/frontmatter-templates/skill-template.md
Additions (backward-compatible):
# NEW: Context Engineering Metadata (optional)
context_engineering:
token_budget: ~3000
attention_priority: beginning # beginning | end | distributed
compression_safe: true # Safe to compress without loss
# NEW: Quality Metrics (optional)
quality_metrics:
probe_tested: false # Has passed probe-based evaluation
coverage_score: 0 # % of use cases covered
Rationale: These additions support context-aware skill activation and quality validation without breaking existing skills.
Agent Template Enhancement
File: config/frontmatter-templates/agent-template.md
Additions (backward-compatible):
# NEW: Context Requirements (optional)
context_requirements:
min_tokens: 0
max_tokens: 8000
requires_full_history: false
attention_sensitive_regions: []
# NEW: Failure Handling (optional)
failure_handling:
retry_strategy: exponential_backoff
max_retries: 3
circuit_breaker_threshold: 5
fallback_agent: null
Rationale: Supports resilient multi-agent coordination with circuit breaker patterns.
5.2 Backward Compatibility Guarantee
All template changes are:
- ADDITIVE ONLY - No existing fields removed or renamed
- OPTIONAL - New fields have sensible defaults
- NON-BREAKING - Existing components work without modification
- VALIDATED - Schema validation passes for all existing components
Phase 6: Validation & Documentation (Week 5)
6.1 Validation Tasks
| Task | Tool | Est. Hours |
|---|---|---|
| Validate all new YAML frontmatter | Schema validator | 2 |
| Update component-counts.json | update-component-counts.py | 0.5 |
| Update component-activation-status.json | update-component-activation.py | 1 |
| Run integration tests | test-suite.py | 2 |
| Update COMPONENT-REFERENCE.md | codi-documentation-writer | 2 |
6.2 Documentation Updates
| Document | Updates Required | Est. Hours |
|---|---|---|
docs/reference/COMPONENT-REFERENCE.md | Add 24 new components | 2 |
docs/guides/MEMORY-MANAGEMENT-GUIDE.md | Add context health section | 1 |
docs/workflows/WORKFLOW-LIBRARY-INDEX.md | Add 3 new workflows | 1 |
CLAUDE.md | Update component counts | 0.5 |
Risk Assessment
| Risk | Probability | Impact | Mitigation |
|---|---|---|---|
| Template incompatibility | Low | High | All changes additive/optional |
| Skill duplication | Medium | Low | Name disambiguation |
| Agent tool conflicts | Low | Medium | Tool validation before merge |
| Performance degradation | Low | Medium | Token budget monitoring |
Success Criteria
Phase Completion Criteria
- Phase 1: 8 skills pass YAML validation
- Phase 2: 5 agents invocable via
/agent - Phase 3: 3 commands operational
- Phase 4: Workflows & hook functional
- Phase 5: Templates enhanced, backward compatible
- Phase 6: Documentation updated, tests passing
Quality Gates
- All components have valid YAML frontmatter
- All agents include Claude 4.5 optimization sections
- All skills include
when_to_useandwhen_not_to_use - Component counts updated in
config/component-counts.json - No breaking changes to existing components
Resource Allocation
Estimated Total Effort
| Phase | Hours | Primary Agent |
|---|---|---|
| Phase 1: Skills | 24 | codi-documentation-writer |
| Phase 2: Agents | 20 | orchestrator |
| Phase 3: Commands | 10 | codi-documentation-writer |
| Phase 4: Workflows | 11 | orchestrator |
| Phase 5: Templates | 4 | project-organizer |
| Phase 6: Validation | 9 | qa-reviewer |
| Total | 78 |
Agent Responsibilities
| Agent | Primary Tasks |
|---|---|
orchestrator | Phase coordination, agent creation |
codi-documentation-writer | Skill/command documentation |
project-organizer | File organization, template updates |
qa-reviewer | Validation, quality gates |
context-health-analyst (new) | Self-validation after creation |
Execution Timeline
Week 1: Foundation
├── Day 1-2: Skill migration (4 skills)
├── Day 3-4: Skill migration (4 skills)
└── Day 5: Script adaptation
Week 2: Agents
├── Day 1-2: Agent definitions (3 agents)
├── Day 3-4: Agent definitions (2 agents)
└── Day 5: Agent testing
Week 3: Commands
├── Day 1-2: Command definitions
├── Day 3: Command testing
└── Day 4-5: Integration testing
Week 4: Polish
├── Day 1-2: Workflows & hook
├── Day 3: Template enhancements
└── Day 4-5: Validation
Week 5: Documentation
├── Day 1-3: Documentation updates
├── Day 4: Final validation
└── Day 5: Release
Appendix A: File Locations
New Skills
skills/
├── context-fundamentals/SKILL.md
├── context-degradation/SKILL.md
├── context-compression/SKILL.md
├── memory-systems/SKILL.md
├── context-optimization/SKILL.md
├── advanced-evaluation/SKILL.md
├── tool-design/SKILL.md
└── project-development/SKILL.md
New Agents
agents/
├── context-health-analyst.md
├── compression-evaluator.md
├── llm-judge.md
├── multi-agent-coordinator.md
└── tool-designer.md
New Commands
commands/
├── context-health.md
├── evaluate-response.md
└── batch-pipeline.md
New Scripts
scripts/context-engineering/
├── context_health_monitor.py
├── compression_quality_test.py
├── batch_pipeline.py
└── tool_docs_validator.py
New Workflows
docs/workflows/
├── context-optimization-workflow.md
├── llm-evaluation-workflow.md
└── batch-processing-workflow.md
New Hooks
hooks/
└── post-session-context-health.md
Appendix B: Integration Dependencies
Document Status: Active Last Updated: 2025-12-27 Author: Integration Planning Agent Approved By: Pending