Skip to content

Agent abstraction Phase A: introduce CodingAgent protocol (behavior-preserving) #166

@dhilgaertner

Description

@dhilgaertner

Summary

Phase A of the agent-abstraction work scoped by #150. Introduce a CodingAgent protocol and route all Claude Code call sites through it — zero user-visible change, zero new features. Lays the foundation for Phases B and C.

Context

Full design in docs/agent-abstraction-spec.md §12 Phase A. Non-trivially informed by Codex CLI research and an audit of ~435 claude references across the codebase.

The existing Packages/CrowClaude/ is already a Claude-specific Swift package containing ClaudeLauncher. It's the natural home for ClaudeCodeAgent.

Checklist

  • Define CodingAgent, AgentKind, AgentRegistry, StateSignalSource, AgentStateTransition, HookConfigWriter protocols in CrowCore (or a new CrowAgent package)
  • Implement ClaudeCodeAgent in Packages/CrowClaude/; register it in AgentRegistry
  • Rename ClaudeStateAgentActivityState; .claudeLaunched.agentLaunched; onLaunchClaudeonLaunchAgent
  • Update TerminalReadinessTests for the rename
  • Move HookConfigGenerator from Sources/Crow/App/ into Packages/CrowClaude/ as ClaudeHookConfigWriter
  • Move the hook-event state-machine logic out of AppDelegate.hook-event into a ClaudeHookSignalSource in CrowClaude; AppDelegate consumes AgentStateTransition values
  • Wrap ClaudeLauncher.generatePrompt/launchCommand behind ClaudeCodeAgent
  • swift test passes across every package; launching a session looks identical; hook state transitions unchanged

Non-goals

  • No Codex code
  • No user-visible UI change
  • No Session model change (that's Phase B)

Parent: #150

Metadata

Metadata

Assignees

Labels

refactorCode refactoring and cleanup

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions