Skip to main content

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 TypeCurrent CountNew AdditionsFinal Count
Agents130+5135
Skills187+8195
Commands144+3147
Scripts236+4240
Workflows1,149+31,152
Hooks41+142
Total1,892+241,916

Phase 1: Foundation (Week 1)

1.1 Skill Integration (Priority: P0)

Adapt 8 skills from the external repository to CODITECT frontmatter standards.

Skill NameSourcePriorityComplexityEst. Hours
context-fundamentalsskills/context-fundamentals/P0Low2
context-degradationskills/context-degradation/P0Medium3
context-compressionskills/context-compression/P0Medium3
memory-systemsskills/memory-systems/P1High4
context-optimizationskills/context-optimization/P1Medium3
advanced-evaluationskills/advanced-evaluation/P1High4
tool-designskills/tool-design/P2Low2
project-developmentskills/project-development/P2Medium3

Adaptation Requirements:

  1. Convert to CODITECT YAML frontmatter format (see templates)
  2. Add component_type: skill and required identity fields
  3. Add levels: section for progressive disclosure
  4. Add when_to_use: and when_not_to_use: fields
  5. Add composes_with: and requires: relationships
  6. Preserve original Python scripts in scripts/ subdirectory
  7. Move detailed references to references/ subdirectory

1.2 Script Adaptation (Priority: P0)

Create wrapper modules for utility functions to integrate with CODITECT patterns.

ScriptSourceIntegration TargetEst. Hours
context_health_monitor.pydegradation_detector.py/cx command enhancement3
compression_quality_test.pycompression_evaluator.pySession compression3
batch_pipeline.pypipeline_template.pyWorkflow automation4
tool_docs_validator.pydescription_generator.pyComponent validation2

Phase 2: Agent Creation (Week 2)

2.1 New Agent Definitions (Priority: P0)

Create 5 specialized agents leveraging external utility functions.

Agent NameDomainMoE RoleBase UtilitiesEst. Hours
context-health-analystqaanalystdegradation_detector.py4
compression-evaluatorqajudgecompression_evaluator.py4
llm-judgeqajudgeevaluation_example.py4
multi-agent-coordinatordevelopmentorchestratorcoordination.py5
tool-designerdocumentationspecialistdescription_generator.py3

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)

CommandAliasesDescriptionEst. Hours
/context-health/cx-healthAnalyze session context health3
/evaluate-response/evalLLM-as-judge evaluation3
/batch-pipeline/batchManage LLM batch processing4

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)

WorkflowCategoryEst. Hours
context-optimization-workflow.mdAI/ML3
llm-evaluation-workflow.mdAI/ML3
batch-processing-workflow.mdAutomation3

4.2 New Hook (Priority: P2)

HookEventDescriptionEst. Hours
post-session-context-healthsession_endAuto-analyze context health2

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

TaskToolEst. Hours
Validate all new YAML frontmatterSchema validator2
Update component-counts.jsonupdate-component-counts.py0.5
Update component-activation-status.jsonupdate-component-activation.py1
Run integration teststest-suite.py2
Update COMPONENT-REFERENCE.mdcodi-documentation-writer2

6.2 Documentation Updates

DocumentUpdates RequiredEst. Hours
docs/reference/COMPONENT-REFERENCE.mdAdd 24 new components2
docs/guides/MEMORY-MANAGEMENT-GUIDE.mdAdd context health section1
docs/workflows/WORKFLOW-LIBRARY-INDEX.mdAdd 3 new workflows1
CLAUDE.mdUpdate component counts0.5

Risk Assessment

RiskProbabilityImpactMitigation
Template incompatibilityLowHighAll changes additive/optional
Skill duplicationMediumLowName disambiguation
Agent tool conflictsLowMediumTool validation before merge
Performance degradationLowMediumToken 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_use and when_not_to_use
  • Component counts updated in config/component-counts.json
  • No breaking changes to existing components

Resource Allocation

Estimated Total Effort

PhaseHoursPrimary Agent
Phase 1: Skills24codi-documentation-writer
Phase 2: Agents20orchestrator
Phase 3: Commands10codi-documentation-writer
Phase 4: Workflows11orchestrator
Phase 5: Templates4project-organizer
Phase 6: Validation9qa-reviewer
Total78

Agent Responsibilities

AgentPrimary Tasks
orchestratorPhase coordination, agent creation
codi-documentation-writerSkill/command documentation
project-organizerFile organization, template updates
qa-reviewerValidation, 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