name: SKILL-monorepo description: > CLEO provider adapter for Anthropic Claude Code CLI. Default export is the adapter class for dynamic loading by AdapterManager. T5240 Use when: (1) calling its 2515 API functions, (2) configuring @cleocode/monorepo, (3) understanding its 1754 type definitions, (4) working with its 104 classes, (5) user mentions "@cleocode/monorepo" or asks about its API.
@cleocode/monorepo
CLEO provider adapter for Anthropic Claude Code CLI. Default export is the adapter class for dynamic loading by AdapterManager. T5240
Quick Start
npm install @cleocode/monorepo
import { checkStatuslineIntegration } from './statusline.js';
const status = checkStatuslineIntegration();
if (status === 'not_configured') {
console.log('Run cleo install to set up context monitoring');
}
API
| Function | Description |
|---|---|
checkStatuslineIntegration() |
Check if statusline integration is configured. Returns the current integration status. |
getStatuslineConfig() |
Get the statusline setup command for Claude Code settings. |
getSetupInstructions() |
Get human-readable setup instructions. |
createAdapter() |
Factory function for creating adapter instances. Used by AdapterManager's dynamic import fallback. |
readLatestTranscript() |
Read the most recent JSON or JSONL session file from providerDir and return its contents as a flat transcript string. Files are sorted in descending order by filename — this works naturally for providers that embed timestamps in filenames. The most recently named file is read first. Returns null when: - providerDir does not exist or cannot be read - No JSON/JSONL files are present - The most recent file contains no parseable turns |
createAdapter() |
Factory function for creating adapter instances. Used by AdapterManager's dynamic import fallback. |
createAdapter() |
Factory function for creating adapter instances. Used by AdapterManager's dynamic import fallback. |
createAdapter() |
Factory function for creating adapter instances. Used by AdapterManager's dynamic import fallback. |
createAdapter() |
Factory function for creating adapter instances. Used by AdapterManager's dynamic import fallback. |
buildOpenCodeAgentMarkdown() |
Build the markdown content for an OpenCode agent definition file. OpenCode agents are defined as markdown files with YAML frontmatter in the .opencode/agent/ directory. |
createAdapter() |
Factory function for creating adapter instances. Used by AdapterManager's dynamic import fallback. |
getProviderManifests() |
Get the manifests for all bundled provider adapters. |
discoverProviders() |
Discover all available provider adapters. Returns a map of provider ID to adapter factory function. |
getPlatformPaths() |
Get OS-appropriate paths for CAAMP's global directories. |
getSystemInfo() |
Get a cached system information snapshot. |
| ... | 2500 more — see API reference |
Configuration
import type { DetectionConfig } from "@cleocode/monorepo";
const config: Partial<DetectionConfig> = {
// Detection methods to try, in order.
methods: [],
// Binary name to look up on PATH (for `"binary"` method).
binary: "...",
// Directories to check for existence (for `"directory"` method).
directories: "...",
// macOS .app bundle name (for `"appBundle"` method).
appBundle: "...",
// Flatpak application ID (for `"flatpak"` method).
flatpakId: "...",
};
See references/CONFIGURATION.md for full details.
Gotchas
HookEventis deprecated: UseCanonicalHookEventfrom../hooks/types.jsfor the normalized CAAMP taxonomy. This type remains for backward compatibility with registry.json'scapabilities.hooks.supportedstring arrays.CtSkillEntryis deprecated: UseSkillLibraryEntryinstead.CtValidationResultis deprecated: UseSkillLibraryValidationResultinstead.CtValidationIssueis deprecated: UseSkillLibraryValidationIssueinstead.CtProfileDefinitionis deprecated: UseSkillLibraryProfileinstead.CtDispatchMatrixis deprecated: UseSkillLibraryDispatchMatrixinstead.CtManifestis deprecated: UseSkillLibraryManifestinstead.CtManifestSkillis deprecated: UseSkillLibraryManifestSkillinstead.getTaskPathis deprecated: Use getAccessor() from './store/data-accessor.js' instead. This function returns the database file path for legacy compatibility, but all task data access should go through the DataAccessor interface to ensure proper SQLite interaction. Example: // OLD (deprecated): const taskPath = getTaskPath(cwd); const data = await readJsonFile(taskPath); // NEW (correct): const accessor = await getAccessor(cwd); const data = await accessor.queryTasks();getClaudeAgentsDiris deprecated: Use AdapterPathProvider.getAgentInstallDir() from the active adapter instead.getClaudeMemDbPathis deprecated: Use AdapterPathProvider.getMemoryDbPath() from the active adapter instead.OnSessionStartPayloadis deprecated: UseSessionStartPayloadinstead. Kept for backward compatibility.OnSessionEndPayloadis deprecated: UseSessionEndPayloadinstead. Kept for backward compatibility.OnToolStartPayloadis deprecated: UsePreToolUsePayloadinstead. Kept for backward compatibility.OnToolCompletePayloadis deprecated: UsePostToolUsePayloadinstead. Kept for backward compatibility.OnFileChangePayloadis deprecated: UseNotificationPayloadinstead. Kept for backward compatibility.OnErrorPayloadis deprecated: UsePostToolUseFailurePayloadinstead. Kept for backward compatibility.OnPromptSubmitPayloadis deprecated: UsePromptSubmitPayloadinstead. Kept for backward compatibility.OnResponseCompletePayloadis deprecated: UseResponseCompletePayloadinstead. Kept for backward compatibility.AdapterTransportProvideris deprecated: Use Transport instead. Will be removed after unification.getRegistryPathis deprecated: Use nexus.db via getNexusDb() instead. Retained for JSON-to-SQLite migration.OnSessionStartPayloadSchemais deprecated: UseSessionStartPayloadSchema. Kept for backward compatibility.OnSessionEndPayloadSchemais deprecated: UseSessionEndPayloadSchema. Kept for backward compatibility.OnToolStartPayloadSchemais deprecated: UsePreToolUsePayloadSchema. Kept for backward compatibility.OnToolCompletePayloadSchemais deprecated: UsePostToolUsePayloadSchema. Kept for backward compatibility.OnFileChangePayloadSchemais deprecated: UseNotificationPayloadSchema. Kept for backward compatibility.OnErrorPayloadSchemais deprecated: UsePostToolUseFailurePayloadSchema. Kept for backward compatibility.OnPromptSubmitPayloadSchemais deprecated: UsePromptSubmitPayloadSchema. Kept for backward compatibility.OnResponseCompletePayloadSchemais deprecated: UseResponseCompletePayloadSchema. Kept for backward compatibility.Capabilityis deprecated: UseAgentSkillinstead.ServiceConfigis deprecated: UseAgentCardinstead.EndpointConfigis deprecated: Will be removed in v2.0.0.DiscoveryDocumentis deprecated: UseAgentCardinstead.resolveProvidersRegistryPath()throws: Error ifproviders/registry.jsoncannot be found within 8 parent levelsensureProviderInstructionFile()throws: Error if the provider ID is not found in the registryensureAllProviderInstructionFiles()throws: Error if any provider ID is not found in the registryresolveFormat()throws: Error if format flags conflictreadConfig()throws: If the file cannot be read or the format is unsupportedwriteConfig()throws: If the format is unsupportedremoveConfig()throws: If the format is unsupportedfetchWithTimeout()throws:NetworkErroron timeout or network failureensureOkResponse()throws:NetworkErrorwhenresponse.okisfalserecommendSkills()throws: Error withcodeandissuesproperties when criteria are invalidloadLibraryFromModule()throws: If the module cannot be loaded or does not implement SkillLibrarybuildLibraryFromFiles()throws: If skills.json is not found at the rootregisterSkillLibraryFromPath()throws: Error if the library cannot be loaded from the given pathcheckTaskExists()throws: SafetyError if task exists and strict mode is enabledverifyTaskWrite()throws: SafetyError if verification failsvalidateStage()throws: Error If stage is invalidsetEmbeddingProvider()throws: Error if provider dimensions do not match EMBEDDING_DIMENSIONSloadAdapterFromManifest()throws: If the module cannot be loaded or does not export a valid adapterinitializePipeline()throws: CleoError If pipeline already exists or database operation failsgetPipeline()throws: CleoError If database query failsadvanceStage()throws: CleoError If transition is invalid or prerequisites not metgetCurrentStage()throws: CleoError If database query failslistPipelines()throws: CleoError If database query failscompletePipeline()throws: CleoError If pipeline not found or not in releasable statecancelPipeline()throws: CleoError If pipeline not found or already completedgetPipelineStatistics()throws: CleoError If database query failsvalidatePipelineStage()throws: CleoError(VALIDATION_ERROR) if invalidvalidatePipelineTransition()throws: CleoError(VALIDATION_ERROR) if the transition is backwardvalidateEpicCreation()throws: CleoError(VALIDATION_ERROR) in strict mode when constraints are violated.validateChildStageCeiling()throws: CleoError(VALIDATION_ERROR) in strict mode when the child stage exceeds the epic.validateEpicStageAdvancement()throws: CleoError(VALIDATION_ERROR) in strict mode when incomplete children exist.assertLafsShape()throws:LafsViolationErrorif the envelope fails any shape invariantbindSession()throws: if a session is already bound (call unbindSession first).parseQuery()throws: CleoError with NEXUS_INVALID_SYNTAX for bad format.withRetry()throws: The last error thrown byfn, augmented withRetryContextfields (attempts,totalDelayMs).formatIsoDate()throws: Error if date format is invalid or missing T4552getProjectInfo()throws: Error If .cleo/project-info.json does not exist or is invalid JSON.resolveSkillPathsForProvider()throws: Error if provider not founddecrypt()throws: If decryption fails (wrong key, corrupted data, or machine key mismatch).resolveTemplate()throws: Error If a referenced variable is not found in any scope.checkPrerequisites()throws: CleoError If validation failsvalidateTransition()throws: CleoError If validation fails unexpectedlyexecuteTransition()throws: CleoError If transition is invalidsetStageStatus()throws: CleoError If status transition is invalidskipStage()throws: CleoError If stage cannot be skippedresolveOutputFormat()throws:LAFSFlagErrorWhenhumanFlagandjsonFlagare both truthy.assertEnvelope()throws: Error When the input does not conform to the envelope schema.assertCompliance()throws:ComplianceErrorWhen any compliance stage fails.parseLafsResponse()throws: LafsError When the envelope indicates failure (success=false).parseLafsResponse()throws: Error When the envelope is structurally invalid orrequireRegisteredErrorCodeistrueand the code is unregistered.resolveFieldExtraction()throws:LAFSFlagErrorWhen bothfieldFlagandfieldsFlagare set.resolveFlags()throws:LAFSFlagErrorWhen format or field layer flags conflict.getErrorCodeMapping()throws: Error if the error type is not a known A2A error typeExitCodeenum values: SUCCESS, GENERAL_ERROR, INVALID_INPUT, FILE_ERROR, NOT_FOUND, DEPENDENCY_ERROR, VALIDATION_ERROR, LOCK_TIMEOUT, CONFIG_ERROR, PARENT_NOT_FOUND, DEPTH_EXCEEDED, SIBLING_LIMIT, INVALID_PARENT_TYPE, CIRCULAR_REFERENCE, ORPHAN_DETECTED, HAS_CHILDREN, TASK_COMPLETED, CASCADE_FAILED, HAS_DEPENDENTS, CHECKSUM_MISMATCH, CONCURRENT_MODIFICATION, ID_COLLISION, SESSION_EXISTS, SESSION_NOT_FOUND, SCOPE_CONFLICT, SCOPE_INVALID, TASK_NOT_IN_SCOPE, TASK_CLAIMED, SESSION_REQUIRED, SESSION_CLOSE_BLOCKED, ACTIVE_TASK_REQUIRED, NOTES_REQUIRED, VERIFICATION_INIT_FAILED, GATE_UPDATE_FAILED, INVALID_GATE, INVALID_AGENT, MAX_ROUNDS_EXCEEDED, GATE_DEPENDENCY, VERIFICATION_LOCKED, ROUND_MISMATCH, CONTEXT_WARNING, CONTEXT_CAUTION, CONTEXT_CRITICAL, CONTEXT_EMERGENCY, CONTEXT_STALE, PROTOCOL_MISSING, INVALID_RETURN_MESSAGE, MANIFEST_ENTRY_MISSING, SPAWN_VALIDATION_FAILED, AUTONOMOUS_BOUNDARY, HANDOFF_REQUIRED, RESUME_FAILED, CONCURRENT_SESSION, NEXUS_NOT_INITIALIZED, NEXUS_PROJECT_NOT_FOUND, NEXUS_PERMISSION_DENIED, NEXUS_INVALID_SYNTAX, NEXUS_SYNC_FAILED, NEXUS_REGISTRY_CORRUPT, NEXUS_PROJECT_EXISTS, NEXUS_QUERY_FAILED, NEXUS_GRAPH_ERROR, NEXUS_RESERVED, LIFECYCLE_GATE_FAILED, AUDIT_MISSING, CIRCULAR_VALIDATION, LIFECYCLE_TRANSITION_INVALID, PROVENANCE_REQUIRED, ARTIFACT_TYPE_UNKNOWN, ARTIFACT_VALIDATION_FAILED, ARTIFACT_BUILD_FAILED, ARTIFACT_PUBLISH_FAILED, ARTIFACT_ROLLBACK_FAILED, PROVENANCE_CONFIG_INVALID, SIGNING_KEY_MISSING, SIGNATURE_INVALID, DIGEST_MISMATCH, ATTESTATION_INVALID, ADAPTER_NOT_FOUND, ADAPTER_INIT_FAILED, ADAPTER_HOOK_FAILED, ADAPTER_SPAWN_FAILED, ADAPTER_INSTALL_FAILED, NO_DATA, ALREADY_EXISTS, NO_CHANGE, TESTS_SKIPPED, LAFS_VIOLATIONOrchestrationLevelenum values: HITL, Prime, ProjectLead, TeamLead, EphemeralSeverityenum values: Low, Medium, High, CriticalManifestIntegrityenum values: Valid, Partial, Invalid, MissingInstructionStabilityenum values: Stable, Clarified, Revised, UnstableSessionDegradationenum values: None, Mild, Moderate, SevereAgentReliabilityenum values: High, Medium, Low, UnreliableMetricCategoryenum values: Compliance, Efficiency, Session, ImprovementMetricSourceenum values: Task, Session, Agent, System, OrchestratorAggregationPeriodenum values: Instant, Hourly, Daily, Weekly, MonthlyErrorSeverityenum values: INFO, WARNING, ERROR, CRITICALErrorCategoryenum values: GENERAL, HIERARCHY, CONCURRENCY, SESSION, VERIFICATION, CONTEXT, PROTOCOL, NEXUS, LIFECYCLE, SPECIALProtocolExitCodeenum values: SUCCESS, E_GENERAL_ERROR, E_INVALID_INPUT, E_FILE_ERROR, E_NOT_FOUND, E_DEPENDENCY_ERROR, E_VALIDATION_ERROR, E_PARENT_NOT_FOUND, E_DEPTH_EXCEEDED, E_SIBLING_LIMIT, E_CIRCULAR_REFERENCE, E_SESSION_REQUIRED, E_PROTOCOL_RESEARCH, E_PROTOCOL_CONSENSUS, E_PROTOCOL_SPECIFICATION, E_PROTOCOL_DECOMPOSITION, E_PROTOCOL_IMPLEMENTATION, E_PROTOCOL_CONTRIBUTION, E_PROTOCOL_RELEASE, E_PROTOCOL_GENERIC, E_PROTOCOL_VALIDATION, E_TESTS_SKIPPED, E_LIFECYCLE_GATE_FAILEDProtocolTypeenum values: RESEARCH, CONSENSUS, SPECIFICATION, DECOMPOSITION, IMPLEMENTATION, CONTRIBUTION, RELEASE, VALIDATION, TESTINGGateLayerenum values: SCHEMA, SEMANTIC, REFERENTIAL, PROTOCOLGateStatusenum values: PENDING, PASSED, FAILED, BLOCKED, SKIPPEDWorkflowGateNameenum values: IMPLEMENTED, TESTS_PASSED, QA_PASSED, CLEANUP_DONE, SECURITY_PASSED, DOCUMENTED
Key Types
ClaudeCodePathProvider— Path provider for Anthropic Claude Code CLI. Resolves Claude Code's standard directory layout: - Config dir: ~/.claude (or CLAUDE_HOME) - Settings: ~/.claude/settings.json (or CLAUDE_SETTINGS) - Agents: ~/.claude/agents - Memory DB: ~/.claude-mem/claude-mem.db (or CLAUDE_MEM_DB)ClaudeCodeContextMonitorProvider— Context monitor provider for Claude Code. Processes context window JSON from Claude Code and writes state files for statusline display. Also provides statusline configuration and setup instructions specific to Claude Code's settings.json.ClaudeCodeHookProvider— Hook provider for Claude Code. Claude Code registers hooks via its global config at~/.claude/settings.json. Supported handler types: command, http, prompt, agent. Event mapping is based ongetProviderHookProfile('claude-code')from CAAMP 1.9.1. Async accessors (getSupportedCanonicalEvents,getProviderProfile) call CAAMP directly when available. Since hooks are registered through the config system (managed by the install provider),registerNativeHooksandunregisterNativeHookstrack registration state without performing filesystem operations.ClaudeCodeInstallProvider— Install provider for Claude Code. Manages CLEO's integration with Claude Code by: 1. Ensuring CLAUDE.md contains -references to CLEO instruction files 2. Registering the brain observation plugin in ~/.claude/settings.jsonClaudeCodeSpawnProvider— Spawn provider for Claude Code. Spawns detached Claude CLI processes for subagent execution. Each spawn writes its prompt to a temporary file, then runsclaude --allow-insecure --no-upgrade-check <tmpFile>as a detached, unref'd child process.ClaudeCodeTaskSyncProvider— Claude Code TaskSyncProvider. Reads Claude's TodoWrite JSON state, parses [T001]-prefixed task IDs and status, and returns normalized ExternalTask[]. Optional: accepts a custom file path for testing.ClaudeCodeTransportProvider— Transport provider for Claude Code inter-agent communication.ClaudeCodeAdapter— CLEO provider adapter for Anthropic Claude Code CLI. Bridges CLEO's adapter system with Claude Code's native capabilities: - Hooks: Maps Claude Code events (SessionStart, PostToolUse, etc.) to CAAMP events - Spawn: Launches subagent processes via theclaudeCLI - Install: Manages instruction files and brain observation plugin registrationCodexHookProvider— Hook provider for Codex CLI. Codex CLI registers hooks via its configuration system at ~/.codex/. Hook handlers are shell commands or script paths that execute when the corresponding event fires. Since hooks are registered through the config system (managed by the install provider), registerNativeHooks and unregisterNativeHooks track registration state without performing filesystem operations.CodexInstallProvider— Install provider for Codex CLI. Manages CLEO's integration with Codex CLI by: 1. Ensuring AGENTS.md contains -references to CLEO instruction files
References
- references/CONFIGURATION.md — Full config options
- references/API-REFERENCE.md — Signatures, parameters, examples