CLEO Claude Code Plugin Specification
Version: 1.0.0-draft Date: 2025-12-29 Status: Planning Architecture: Option A - CLI + Companion PluginExecutive Summary
This specification defines a Claude Code companion plugin for CLEO that provides Claude-native integration while preserving the standalone CLI tool. The plugin replaces manual CLAUDE.md injection with auto-discovered skills, adds convenient slash commands, provides autonomous agents for task analysis, and automates session lifecycle via hooks.Goals
- Replace injection workflow - Skills auto-load instead of manual CLAUDE.md updates
- Enhance Claude integration - Commands, agents, hooks for native experience
- Preserve CLI independence -
cleo/ctcommands remain available outside Claude - Maintain version sync - Plugin distributed with CLI ensures version compatibility
Non-Goals
- Converting CLEO entirely to a plugin (no standalone CLI)
- Duplicating CLI functionality in plugin code
- Supporting Claude Code versions without plugin system
Architecture Overview
Component Relationship
| Component | Source | Function |
|---|---|---|
| CLI | ~/.cleo/bin/cleo | Task operations, data management |
| Plugin Skills | ~/.claude/plugins/cleo/skills/ | Claude guidance for using CLI |
| Plugin Commands | ~/.claude/plugins/cleo/commands/ | Slash command wrappers |
| Plugin Agents | ~/.claude/plugins/cleo/agents/ | Autonomous task operations |
| Plugin Hooks | ~/.claude/plugins/cleo/hooks/ | Session lifecycle automation |
Plugin Structure
Component Specifications
1. Plugin Manifest
File:.claude-plugin/plugin.json
2. Skills
2.1 Task Management Skill
File:skills/task-management/SKILL.md
Frontmatter:
Session Management
Analysis
Session Protocol
Starting Work
ct session start- Begin sessionct dash- Review project statect focus set <id>- Focus on one task- Work on focused task
During Work
ct update <id> --notes "progress"- Track progressct focus note "status"- Session-level notesct add "Subtask" --parent <id>- Break down work
Completing Work
ct done <id>- Complete taskct focus clear- Clear focusct session end- End session
Phase Discipline
Check phase context before work:Additional Resources
Reference Files
Detailed guidance available inreferences/:
command-reference.md- Complete CLI command documentationsession-protocol.md- Detailed session workflow patternsmulti-session.md- Multi-agent coordination (v0.41.0+)phase-discipline.md- Phase workflow guidelineserror-handling.md- Complete error codes and recovery
Quick Tips
- Prefer
ct findoverct listfor discovery (99% less context) - JSON output is automatic when piped
- Use native filters (
--status,--phase) instead of jq - Escape
$as\$in notes to prevent shell interpolation
3.2 Session Command
File:commands/ct-session.md
3.3 Add Task Command
File:commands/ct-add.md
3.4 Focus Command
File:commands/ct-focus.md
3.5 Analyze Command
File:commands/ct-analyze.md
4. Agents
Important: Subagent Skill Inheritance Subagents do NOT automatically inherit skills from the parent conversation. Each agent must explicitly declare required skills in theskills: frontmatter field. All CLEO plugin agents declare skills: task-management to ensure they have access to CLI guidance.
Hooks (PreToolUse, PostToolUse) DO fire on subagent tool calls, so session lifecycle hooks will apply.
4.1 Task Planner Agent
File:agents/task-planner.md
- Summary of the planned work
- Task hierarchy visualization
- The exact CLEO commands to create tasks
- Explanation of dependencies and sequencing
- Tasks should be actionable (start with verb)
- Each task should be completable in one session
- Dependencies should reflect true blocking relationships
- Phases should align with project workflow
- No time estimates (describe scope instead)
-
Evaluate Priorities
- Which tasks are unblocked?
- What has highest leverage score?
- What aligns with current phase?
- What has been pending longest?
-
Identify Issues
- Orphaned tasks (no path to completion)
- Circular dependencies
- Stale tasks (no activity)
- Phase misalignment
-
Formulate Recommendations
- Primary recommendation with reasoning
- Alternative options
- Blockers to address
- Current state summary (tasks by status, phase progress)
- Key insights (blockers, patterns, risks)
- Recommended next task with reasoning
- Alternative options if primary is blocked
- Base recommendations on data, not assumptions
- Always verify task existence before referencing
- Provide actionable next steps
- Explain reasoning for recommendations
-
Review Activity
-
Validate Completeness
- Is focused task completed or progress noted?
- Are there uncommitted code changes?
- Are session notes up to date?
- Any tasks started but not updated?
-
Prepare for End
- Recommend completing or clearing focus
- Suggest adding session notes
- Identify any cleanup needed
- Session summary (duration, tasks touched)
- Completion checklist
- Recommended actions before ending
- Any warnings or issues
- Always check focus state before recommending end
- Verify no tasks left in inconsistent state
- Recommend notes for work in progress
- Ensure clean session termination
5.2 Session Start Hook Script
File:hooks/scripts/session-start.sh
5.3 Check Focus Hook Script
File:hooks/scripts/check-focus.sh
5.4 Session End Hook Script (Optional)
File:hooks/scripts/session-end.sh
Installation & Distribution
Distribution Strategy
The plugin is distributed as part of the CLEO CLI package:Installation Process
Theinstall.sh script will be updated to:
- Install CLI to
~/.cleo/(existing behavior) - Create symlink:
~/.claude/plugins/cleo → ~/.cleo/plugin/ - Verify Claude Code plugin system is available
- Report success with plugin activation instructions
Version Synchronization
Plugin version matches CLI version:VERSIONfile in repo rootplugin.jsonversion updated bybump-version.sh- Ensures CLI and plugin are always compatible
Migration Path
From Current Injection Workflow
Before (Current):- User runs
cleo initin project - CLAUDE.md is injected with instructions
- User’s
~/.claude/CLAUDE.mdhas TODO_Task_Management.md reference - Manual updates when CLEO upgrades
- User installs CLEO (includes plugin)
- Plugin auto-discovers in Claude Code
- Skills provide instructions automatically
- Hooks manage session lifecycle
- No CLAUDE.md injection needed
Deprecation of Injection
- Phase 1: Plugin released alongside injection (parallel support)
- Phase 2: Plugin documented as recommended approach
- Phase 3: Injection deprecated with migration guide
- Phase 4: Injection removed in future major version
Testing Strategy
Unit Tests
- Validate plugin.json schema
- Validate hooks.json schema
- Test hook scripts with mock input
- Verify skill YAML frontmatter
Integration Tests
- Plugin loads in Claude Code
- Skills trigger on expected phrases
- Commands execute correctly
- Hooks fire on events
- Agents trigger appropriately
Manual Testing Checklist
- Plugin appears in
/pluginscommand - Skill loads when discussing tasks
-
/ct-session startworks -
/ct-add "test"creates task - SessionStart hook auto-starts session
- Stop hook validates before stopping
- task-planner agent triggers on feature planning
- task-analyzer agent triggers on “what to work on”
Success Criteria
| Metric | Target |
|---|---|
| Injection replacement | 100% of injection functionality covered by skills |
| Command coverage | 5 most common operations have slash commands |
| Agent triggering | Agents trigger >90% on matching phrases |
| Hook reliability | Hooks execute successfully >99% |
| User friction | No manual CLAUDE.md updates required |
Open Questions
- Plugin marketplace: Should we publish to Claude Code marketplace?
- Standalone plugin: Should plugin be installable separately from CLI?
- MCP integration: Should we add MCP server for tool-based access?
- Multi-project: How to handle multiple CLEO projects in one session?
Appendix: File Inventory
| File | Type | Size Estimate |
|---|---|---|
.claude-plugin/plugin.json | Manifest | ~500 bytes |
skills/task-management/SKILL.md | Skill | ~1,800 words |
skills/task-management/references/command-reference.md | Reference | ~3,000 words |
skills/task-management/references/session-protocol.md | Reference | ~1,500 words |
skills/task-management/references/multi-session.md | Reference | ~2,000 words |
skills/task-management/references/phase-discipline.md | Reference | ~1,200 words |
skills/task-management/references/error-handling.md | Reference | ~1,500 words |
commands/ct.md | Command | ~300 words |
commands/ct-session.md | Command | ~350 words |
commands/ct-add.md | Command | ~400 words |
commands/ct-focus.md | Command | ~350 words |
commands/ct-analyze.md | Command | ~300 words |
agents/task-planner.md | Agent | ~600 words |
agents/task-analyzer.md | Agent | ~500 words |
agents/session-reviewer.md | Agent | ~400 words |
hooks/hooks.json | Config | ~1,000 bytes |
hooks/scripts/session-start.sh | Script | ~40 lines |
hooks/scripts/check-focus.sh | Script | ~35 lines |
hooks/scripts/session-end.sh | Script | ~25 lines |
README.md | Docs | ~500 words |
Revision History
| Version | Date | Changes |
|---|---|---|
| 1.0.0-draft | 2025-12-29 | Initial specification |
