Architecture overview
Camel Kit combines two mechanisms to give coding agents accurate and economical access to the Apache Camel ecosystem. Skills are Markdown instruction files that carry the process knowledge: how to design a flow, how to generate YAML, how to validate a route. MCP servers carry the data knowledge: which components exist for a Camel version, which options they accept, whether an endpoint or a Citrus test action is valid. Around them sit a generated instruction file per agent and an optional code intelligence layer.
Repository and release boundaries
kit/ contains the CLI, skills, graph and JBang plugin. knowledge/ contains the standalone Knowledge MCP server and its schema, embedding, indexer and index modules. The root pom.xml is a shared build parent and aggregator, and docs/ is the Antora component for both products. Java packages use org.apache.camel.kit; Maven modules use org.apache.camel.
Kit and Knowledge keep independent versions and releases. Their runtime boundary remains MCP: Kit configures an exact tested server artifact, and Knowledge also serves clients that do not use Kit. Product dependencies belong to their own POMs. The shared parent has its own published version; a product release references a released parent. Index data has separate compatible release channels, automatic client discovery and an optional exact version pin. See releasing and Knowledge MCP for these contracts.
The workflow contract lives in kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml. It defines the command names and aliases, the generated command stubs, skill visibility, pipeline stages, artifacts, transitions, MCP servers and their allowed tools. The generators read it for command stubs and tool filters, and tests check the skill front matter against it.
Four layers
| Layer | What it holds | Where |
|---|---|---|
1. Agent instructions | The cross-agent equalization layer: a routing table from user intent to the right command, the seven Iron Laws, and the MCP setup; the development snapshot adds fifteen Camel YAML DSL rules that the agent sees even before a skill is loaded (see Camel YAML DSL guidance below) |
|
2. Skills | Fifteen skills in four tiers (entry, pipeline, utilities, internal) plus the shared guides: structured prompts with step-by-step procedures, tool calls, conditions and guide imports, loaded progressively |
|
3. MCP servers | Two local servers by default (development snapshot; released versions include all three) (Camel catalog for verification and validation, Knowledge for documentation search), with an optional third (Citrus for test guidance, enabled via | The agent’s MCP configuration file, generated by |
4. Graph CLI (optional) | Nine parsers and two post-processors build the project graph. Catalog-selected adapters interpret migration types. Core skills can fall back to source inspection. A pack step can require a parser or adapter. |
|
See Skills system, MCP servers, Knowledge MCP, Graph intelligence and Forage configuration catalog for each layer.
Build-time skill packs
A distribution selects pack modules when it builds Kit. The core workflow manifest supplies the existing commands, stages, artifacts and MCP tools. Core owns routing, workflow orchestration, the Ship delegate and shared files. The bundled developer-tasks pack owns the complete classified skill trees for validation, debugging, knowledge, design guides, implementation guides, testing, verification, Citrus and prototypes. Their paths remain stable for callers and overlays. The skill inventory lists the entry points. Additional packs can supply skills, files, Java provider bindings and instructions for a named step. An instructions-only pack needs a descriptor and its Markdown resource.
During Maven’s process-classes phase, the compiler reads the selected descriptors, checks their contracts and dependencies, resolves explicit replacements and exclusions, then binds step instructions into the owning skill. It checks literal references to declared guides in the surviving Markdown and removes unused step markers. It records each effective contribution’s ID, owner, contract, requirements and installed path or provider in catalog.json. A workflow skill’s requires lists its explicitly declared dependencies. The contribution’s requires also includes references found in its Markdown. The catalog loader validates the combined list. Shared reference material can ship without a skill linking to it. The manifest and the resolved files travel together in one archive. The package and resource enumeration order has no precedence.
init installs the catalog’s files and generates host entry points from its workflow. The assistant reads the composed instructions at the declared step. Additional public skills supplied by extension packs appear in the installed camel-start decision tree and in host instructions that list direct commands. Doctor checks the commands, skills and supporting files against the same catalog. The default selection exposes eleven public commands and keeps the four internal skills available to their callers. An executable step names one bundled skill or Java provider, the supported targets and its required checks. The assistant supplies the source scope, selected target and evidence paths. Kit resolves the handler and binds the request to the SHA-256 of each file. Both kinds of handler use the same request and result. The provider chooses its helper calls and their order. Kit checks the returned binding and required evidence against the caller’s current files. The assistant uses that outcome to sequence ordinary stages. A direct call returns to its caller. Ship’s controller owns its durable state and stage transitions. See handling a pending or failed hook.
The committed ownership ledger records the installed content after host-specific changes. A catalog switch retires matching files after generating the replacement assets. An owned file can become a directory of guides or a directory of owned guides can become one file. A project file in the way stops the switch during preview or init. Both operations check that the displaced files can be removed. Doctor and init identify an interrupted switch by its recovery directory. See recovering an existing project.
The working report-review pack adds one check where camel-validate prepares its report.
Camel YAML DSL guidance
The development snapshot includes fifteen Camel 4.22 YAML DSL rules in the generated agent instructions. These rules cover placement and value types, routeConfiguration, HTTP and mail headers, dependency loading, and ActiveMQ acknowledgement modes. The maintained rule list lives in the shared template. The four agent-specific templates each maintain a copy.
Coverage by agent:
-
Claude Code, Bob 2, OpenCode: Use the shared template (
templates/shared/agents-md.md). By default, these agents load the rules from their entry file (CLAUDE.md,AGENTS.md) immediately when the project is opened, before any skill invocation. Bob Shell skips the projectAGENTS.mdin restricted mode when folder trust is enabled and the folder is untrusted. -
Qwen: Uses the shared template. With project trust enabled, Qwen reads both
QWEN.mdandAGENTS.mdat project open. The fifteen rules are inAGENTS.md; the generatedQWEN.mdpoints readers there. -
Antigravity, Codex CLI, GitHub Copilot CLI, Pi: Use agent-specific templates (
templates/{antigravity,codex,copilot,pi}/agents-md.md) that include the same rule set. Loading behavior varies:-
Antigravity and Codex CLI: Rules are available from
AGENTS.mdwhen the project is opened. -
GitHub Copilot CLI: Copilot discovers the fifteen rules in the repository-root
AGENTS.mdalongside its repository-wide.github/copilot-instructions.md. -
Pi: Pi loads the root
AGENTS.mdas project context at startup, before project trust or skill invocation.
-
Schema validation vs. runtime verification:
Rule 4 calls for schema validation after the final edit. Use camel_validate_yaml_dsl or, with the validate plugin installed, run camel validate yaml <file>. This validates the route against the Camel YAML DSL schema and catches structural errors, type mismatches, and invalid placements. However, passing the schema check does not guarantee the route will run successfully.
Rule 5 makes this explicit: the configured runtime must be launched and all endpoints exercised before the integration is declared working. Schema validation is a static check; runtime verification requires:
-
Starting the application (Camel Main via the run script, Spring Boot via
./mvnw spring-boot:run, or Quarkus via./mvnw quarkus:dev) -
Reading the startup log for errors, warnings, and successful endpoint bindings
-
Exercising every endpoint with actual requests or events to verify the integration behavior
This distinction ensures that syntactically valid YAML routes are also functionally correct and that environment dependencies, service connectivity, and runtime configuration are validated before the work is considered complete.
The prompt is the product
In the agent-run workflow the generated instructions own the integration behaviour. The compiled CLI supplies initialization and configuration (init), the workspace check (doctor), pipeline document staleness (doc), pipeline IDs (nextId), wave analysis (plan analyze) and the graph; it supports the prompt-owned workflow rather than replacing it. This makes the behaviour portable across the eight supported agents, readable (the instructions an agent follows are plain files in the project), customizable by editing Markdown, and version-configurable through the distribution pins and live catalog queries.
The deliberate exception is Ship, a Technology Preview: /camel-ship is a short delegate to the registered camel-kit ship command, and the workflow controller (stages, run state, oversight, evidence, guarded publication) is compiled code. Eligible hosts relay controller-issued tasks to read-only native subagents and submit the results; the controller keeps the candidate writes, the validation and the publication. See Ship workflow (Technology Preview).
Progressive disclosure and context isolation
Skills load in three levels: the routing surface of camel-start is always present; a skill’s SKILL.md is loaded when the skill is invoked; its guides are loaded only when the instructions reference them. Catalog data is never loaded wholesale: the agent queries the MCP servers for the artifacts a design actually uses. Together these keep the context small enough for constrained models and keep every component verifiable.
Where the agent supports subagents, research, implementation and review run in isolated contexts and only structured summaries flow back to the orchestrator: the catalog researcher verifies a wave’s artifacts and returns a short summary, and reviewers return reports rather than their traces. Runtime verification is isolated on the same terms where the agent’s trait allows it; Qwen Code and OpenCode keep it in their primary executor by design, so its build output stays in that session. Single-conversation agents run every role inline and record the missing isolation.
The orchestration model
brainstorm or migrate -> approved design (package)
plan -> implementation plan
execute -> artifacts, execution report with verification evidence
validate -> validation report The approved design is the only user gate of a chained run; planning, execution and validation follow automatically. For a migration the same gate covers the complete package, runbook included, without authorizing any of the runbook’s operational actions. Execute starts with an environment probe and can enter a bounded re-plan loop (at most three rounds) that modifies only the affected flow sections of the design. Both entries produce the same design specification contract, so plan and execute work identically afterwards; the plan never consumes the migration runbook. See Stages, approval gate and Iron Laws and Environment-in-the-loop.
Three concerns are kept apart in the shipped assets: a skill is a workflow with steps and exit criteria, a persona is a role with a perspective, an output format and composition rules (integration architect, catalog researcher, code quality reviewer, and so on), and a command is the user-facing entry point. Personas never invoke other personas; composition is the job of skills or of the user, and the dispatch depth is one.
One skill set, eight agents
All targets use the same skills, Iron Laws, constitution rules, MCP tool calls and output formats. What differs is handled by templates and traits: the dispatch mechanism (subagents, modes or inline execution), the tool restriction model, the file reading patterns, the parallelization strategy and the configuration format. init reads the agent’s descriptor from the capability registry (kit/camel-kit-core/src/main/resources/agents/registry/), copies the skills, renders the dispatch block and the MCP configuration, and appends the agent’s traits: instruction fragments under templates/traits/<agent>/ that TraitApplicator adds to the generated skill files between idempotent comment sentinels, so re-running init never duplicates them. Each persona is installed as a complete role file in the agent’s persona directory. See Supported AI agents for what each target gets.
Skills, generated instruction files, MCP configuration templates and the active documents are tested as contract surfaces: ResourceConsistencyTest fails the build on stale command names, configuration files, graph access patterns, Knowledge tool names or Iron Law counts, and ShippedAssetStructureTest checks that every manifest skill, guide reference, trait, dispatch template and generated MCP configuration resolves.
Design decisions worth knowing
- DataMapper consistency
-
XSLT generation used to vary between runs because the model re-derived XPaths from the same schema each time. The canonicalize stage now pre-computes the source XPaths and target elements once, at design time, and the implementation uses them verbatim. For model-generated code, an exact template per case beats one template with conditional rules.
- Version alignment
-
distribution.propertiesships the defaults,initpersists the selected runtime and versions in.camel-kit/config.properties, and every catalog call is bound to those values. Users override with-pflags or a-cfile. - Constitution and Iron Laws
-
The constitution’s eight rules say what makes a good route; the seven Iron Laws say when and how the pipeline enforces quality. Iron Law 2 incorporates the constitution; the two are complementary, not overlapping. See Constitution and Iron Laws.
- Graph queries in the CLI, not in MCP
-
Graph analysis moved out of an MCP server into
camel-kit graphbecause a local process call is faster than a round-trip, and a generated project then needs only its MCP servers (two by default; three with--with-citrus-mcp).