This is an automated email from the ASF dual-hosted git repository. luigidemasi pushed a commit to branch fix/126-skill-classification in repository https://gitbox.apache.org/repos/asf/camel-kit.git
commit ad22b4f39ee66a1bd3518d3fa3c658dccf60eb08 Author: Luigi De Masi <[email protected]> AuthorDate: Fri Nov 27 10:05:48 2026 +0100 Fix #126: Define which core skills developers can invoke Co-authored-by: OpenAI Codex <[email protected]> --- CONTRIBUTING.md | 11 ++-- docs/architecture.md | 61 ++++++++------------- docs/commands.md | 44 ++++++++------- docs/modules/ROOT/pages/contributing.adoc | 10 ++-- docs/modules/ROOT/pages/skills.adoc | 62 ++++++++++++++-------- .../main/resources/skills/camel-verify/SKILL.md | 4 +- .../resources/workflow/camel-kit-workflow.yaml | 10 +++- .../camel/kit/workflow/SkillPackCompilerTest.java | 25 ++++++--- 8 files changed, 131 insertions(+), 96 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bbcdb7de..90d2c989 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -375,11 +375,14 @@ Each guide in `guides/` is a self-contained markdown file loaded by the agent wh ### 4. Register the Skill -- **If user-facing:** update the workflow manifest and generated-command/skill tests; each target emits the surface its registry supports -- **If internal:** update the parent skill's SKILL.md to reference your new guides -- Update `docs/commands.md` if user-facing +Register every core skill under `skills` in the [workflow manifest](kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml). The comments above +that section explain how to choose its status. Match the source `user_invocable` value in `SKILL.md`. -See [Architecture Guide](docs/architecture.md#10-how-to-add-a-skill) for the full process. +- For a public skill, set `generated_command` to its `user_facing` command, document it in + [the command reference](docs/commands.md#slash-commands), and check its entry point on all eight targets. +- For an internal skill, set `generated_command: null` and reference its instructions or guides from the caller. + +Skills contributed by a pack use the [pack descriptor](docs/modules/ROOT/pages/contributing.adoc#skill-packs). ### 5. Add Agent Traits (Optional) diff --git a/docs/architecture.md b/docs/architecture.md index 423ae84e..33b95788 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -34,7 +34,9 @@ A skill is a directory containing a manifest file (`SKILL.md`) and an optional ` The contributor guide includes the [pack descriptor and runnable example](modules/ROOT/pages/contributing.adoc#skill-packs). -**Core workflow manifest:** `kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml` is the source of truth for skill visibility and generated slash-command stubs. The `SKILL.md` frontmatter must match the manifest. +The [core workflow manifest](../kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml) defines the classification criteria immediately above +`skills`. Each public skill names its command. The compiled catalog and agent descriptor determine how +`init` exposes that command. ### SKILL.md Format @@ -57,45 +59,28 @@ user_invocable: false | `guides/optional-guide.md` | When condition X | Supplementary guide | ``` -**Note:** Only `camel-start` sets `user_invocable: true` in the shared source — it is the single auto-discovered entry point (meta-router). Pipeline and standalone skills (Tier 1/2) are invoked through generated command stubs on slash-command agents and through native project skill selection on Codex CLI and GitHub Copilot CLI. Internal skills are dispatched only by pipeline skills. - -The frontmatter fields: -- `name` -- skill identifier, used in cross-references -- `description` -- trigger keywords that help agents match user intent to the correct skill -- `user_invocable` -- `true` for `camel-start` (meta-router) only in the shared source. Pipeline and standalone skills (Tier 1/2) still have generated entry points despite `user_invocable: false`: slash-command stubs for most agents and project skills for Codex CLI and GitHub Copilot CLI. Internal skills (`camel-verify`, `camel-design`, `camel-implement`, `camel-test`) are dispatched only by pipeline skills - -Agent-specific generators may add runtime aliases to copied skill files. For example, Copilot, Pi, and Qwen generated -copies add `user-invocable` alongside Camel-Kit's source `user_invocable` metadata. Codex generated copies -adapt exact `/camel-*` skill invocations to native `$camel-*` mentions while leaving file paths unchanged. - -Bob 2 generated copies set both invocation fields to `true` for skills referenced by -`user_facing: true` commands in the workflow manifest. Bob Shell uses those native -skills through `/skills` and `$camel-*`; Bob IDE exposes them through `/camel-*`. -Verified Shell 2.0.2 and IDE 2.1.0 skip migrating a same-name command stub when -`SKILL.md` already exists. Internal helpers retain `false` for both fields. -The Shell `/` menu contains built-in commands and MCP prompts. -Legacy command stubs remain installed for compatibility, and the native Ship skill -retains the same CLI delegation contract. See [Bob setup](user-guide.md#bob-shell-202). +The `name` identifies the skill and `description` tells the assistant when to use it. The core source +frontmatter must match the manifest. Only the router sets `user_invocable: true`. For example, +`camel-plan` sets it to `false` and still has a public entry point. See +[how the eight targets expose skills](modules/ROOT/pages/skills.adoc#entry-points). ### All Skills -| Skill | Source User-Invocable | Loaded By | Purpose | +| Skill | Manifest status | Workflow caller or use | Purpose | |-------|---------------|-----------|---------| -| `camel-start` | Yes | -- | Meta-router and primary entry point: detects intent, loads appropriate pipeline | -| `camel-brainstorm` | No | `camel-start` (greenfield) | Orchestrate design phase: interview user, produce the pipeline design spec | -| `camel-plan` | No | `camel-brainstorm` (after design approval) | Produce detailed implementation plan from approved design spec | -| `camel-execute` | No | `camel-plan` (auto-invoked after planning) | Environment probe, adversarial pre-filter, then ordered spec and quality review per task | -| `camel-migrate` | No | `camel-start` (migration) | Vendor-aware risk, retirement, and safe-seam analysis plus design; hands an approved design to `camel-plan`. In direct mode, implements route files under Iron Laws 1 and 2 with inline validation and user-authorized runtime check | -| `camel-verify` | No | `camel-execute` (internal role: subagent where supported, inline otherwise) | 3-phase runtime verification loop (build, Citrus tests, report) — runs inside execute, not as a standalone pipeline stage | -| `camel-ship` | No | -- (standalone CLI delegate) | **Technology Preview.** Forwards to the configured local Ship command; the controller owns stages, run state, and oversight | -| `camel-design` | No | `camel-brainstorm` | Guides for component selection, EIP catalog, and flow design assembly | -| `camel-implement` | No | `camel-execute` | Guides for YAML generation, properties, Docker Compose, DataMapper | -| `camel-validate` | No | `camel-execute` or direct invocation | Tier 1 quality gate: schema validation, endpoint verification, security analysis | -| `camel-test` | No | `camel-execute` | Guides for route analysis and test generation with Citrus + Testcontainers | -| `camel-knowledge` | No | Direct invocation; pipeline skills as needed | Routes questions to knowledge MCP tools | -| `camel-debug` | No | `camel-start` (ad-hoc troubleshooting) | Standalone debugging: STOP → PRESERVE → DIAGNOSE → FIX → GUARD workflow | - -**Note:** Only `camel-start` has `user_invocable: true` in its shared source metadata; the Bob 2 generated override described above exposes all nine public commands. Pipeline and standalone skills still have generated entry points despite `user_invocable: false`: slash-command stubs for most agents and project skills for Codex CLI and GitHub Copilot CLI. Internal skills (`camel-verify`, `camel-design`, `camel-implement`, `camel-test`) are dispatched only by pipeline skills. +| `camel-start` | `router` | -- | Meta-router and primary entry point: detects intent, loads appropriate pipeline | +| `camel-brainstorm` | `pipeline` | `camel-start` (greenfield) | Orchestrate design phase: interview user, produce the pipeline design spec | +| `camel-plan` | `pipeline` | `camel-brainstorm` (after design approval) | Produce detailed implementation plan from approved design spec | +| `camel-execute` | `pipeline` | `camel-plan` (auto-invoked after planning) | Environment probe, adversarial pre-filter, then ordered spec and quality review per task | +| `camel-migrate` | `pipeline` | `camel-start` (migration) | Vendor-aware risk, retirement, and safe-seam analysis plus design; hands an approved design to `camel-plan`. In direct mode, implements route files under Iron Laws 1 and 2 with inline validation and user-authorized runtime check | +| `camel-verify` | `internal` | `camel-execute` (internal role: subagent where supported, inline otherwise) | 3-phase runtime verification loop (build, Citrus tests, report) — runs inside execute, not as a standalone pipeline stage | +| `camel-ship` | `standalone` | -- (standalone CLI delegate) | **Technology Preview.** Forwards to the configured local Ship command; the controller owns stages, run state, and oversight | +| `camel-design` | `internal` | `camel-brainstorm` | Guides for component selection, EIP catalog, and flow design assembly | +| `camel-implement` | `internal` | `camel-execute` | Guides for YAML generation, properties, Docker Compose, DataMapper | +| `camel-validate` | `pipeline` | `camel-execute` or direct invocation | Tier 1 quality gate: schema validation, endpoint verification, security analysis | +| `camel-test` | `internal` | `camel-execute` | Guides for route analysis and test generation with Citrus + Testcontainers | +| `camel-knowledge` | `standalone` | Direct invocation; pipeline skills as needed | Routes questions to knowledge MCP tools | +| `camel-debug` | `standalone` | `camel-start` (ad-hoc troubleshooting) | Standalone debugging: STOP → PRESERVE → DIAGNOSE → FIX → GUARD workflow | ### Shared Guides @@ -999,11 +984,9 @@ user_invocable: false | `guides/main-guide.md` | Always | Primary instruction guide | ``` -**Note:** Only `camel-start` should have `user_invocable: true` in the shared source. All other source skills have `user_invocable: false`; the Bob 2 generator overrides both invocation fields for public command skills. Generated command stubs and Codex/Copilot project skills still work independently of this metadata; Qwen generation also emits its equivalent hyphenated `user-invocable` field. - 3. **Write guide files** in `guides/`. Each guide is a self-contained markdown instruction file loaded by the agent when the skill is active. -4. **Update the workflow manifest first:** add or modify the entry in `kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml`. Set `generated_stub: true` only for commands that should be emitted into each agent's commands directory. Add or update the corresponding skill entry, stage/artifact metadata, transitions, and MCP tool allowlists if the workflow contract changes. +4. **Register every core skill** in the [workflow manifest](../kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml) using the criteria above `skills`. Set `generated_command` to the public command name or to `null` for an internal helper. Update stages, artifacts, transitions and MCP tool allowlists when they change. 5. **If registering generated command or skill entry points:** update agent-specific guidance only where the command needs custom behavior beyond the generated stub or project skill. The default generator creates command stubs from the manifest. Agent templates still need updates when they contain human-readable command tables, custom modes, policies, or sub-agent dispatch: - Claude Code: update `templates/claude/claude-md.md` diff --git a/docs/commands.md b/docs/commands.md index 96f2e098..fc45057b 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -1,6 +1,6 @@ # Camel-Kit Command Reference -This document is the reference for all Camel-Kit commands: the `camel-kit` CLI, slash commands used inside most AI coding assistants, and native project skills used by Codex CLI and GitHub Copilot CLI. +This guide covers the `camel-kit` CLI and the skills you can invoke in your coding assistant. The `--ai bob2` target exposes the nine public workflows through native skills: `$camel-*` in Bob Shell and `/camel-*` in Bob IDE. Legacy command stubs remain @@ -27,8 +27,9 @@ retains its single CLI invocation with the supplied options. - [/camel-migrate](#camel-migrate) - [/camel-validate](#camel-validate) - [/camel-ship](#camel-ship) + - [/camel-knowledge](#camel-knowledge) - [/camel-debug](#camel-debug) - - [/camel-verify (internal)](#camel-verify) + - [camel-verify (internal)](#camel-verify) - [Command Cheat Sheet](#command-cheat-sheet) --- @@ -612,11 +613,14 @@ camel-kit doc unstale docs/camel-kit/001-order-processing/implementation-plan.md ## Slash Commands -These commands are used inside your AI coding assistant after project initialization. The entry point is `/camel-start`, which routes to the right pipeline skill. Skills are organized into tiers: +Start with `/camel-start` to route a request, or invoke any of the nine public skills directly. +The examples below use slash commands. See the [entry points for each assistant](modules/ROOT/pages/skills.adoc#entry-points) +for Bob Shell and Codex `$camel-*` mentions, Pi `/skill:camel-*` commands and other native forms. -The machine-readable source of truth for command names, generated stubs, skill visibility, pipeline stages, transitions, artifacts, and MCP tool filters is `kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml`. Command generation and Doctor read the effective workflow from the built skill catalog. Update the core workflow YAML before changing this reference text or the corresponding core skill frontmatter. +The [core workflow manifest](../kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml) defines the classification. Command generation and +Doctor use the effective workflow from the built skill catalog. -**Tier 1 — Pipeline:** `/camel-brainstorm`, `/camel-migrate`, `/camel-plan`, `/camel-execute`, `/camel-validate` — five skills implementing a four-stage pipeline, with brainstorm and migrate as alternative Design-stage entries. Invoke them via the `/camel-start` decision tree or directly via slash command. +**Tier 1 — Pipeline:** `/camel-brainstorm`, `/camel-migrate`, `/camel-plan`, `/camel-execute`, `/camel-validate` — five skills implementing a four-stage pipeline, with brainstorm and migrate as alternative Design-stage entries. Invoke them via the `/camel-start` decision tree or directly with the inputs for that stage. **Tier 2 — Standalone utilities:** `/camel-ship`, `/camel-knowledge`, `/camel-debug` — can be invoked at any point. Ship delegates to a separate local controller and does not use the manual pipeline state as its run state. @@ -788,7 +792,7 @@ first. Markdown-only plans remain supported for older artifacts. - **Code quality review** -- checks constitution rules, security, and anti-patterns - If review fails, the implementer fixes and re-submits until both reviews pass 4. **Cross-cutting review** -- after all tasks complete, reviews all generated routes together for consistency -5. **Verification phase** -- dispatches `/camel-verify` internally (build, Citrus tests, report). Verification failures are reported but do not block completion +5. **Verification phase** -- dispatches `camel-verify` internally (build, Citrus tests, report). Verification failures are reported but do not block completion 6. **Completion summary** -- writes the execution report and reports task, review, and verification outcomes After `/camel-execute` completes, the pipeline continues to `/camel-validate` as the final quality gate. @@ -804,12 +808,12 @@ After `/camel-execute` completes, the pipeline continues to `/camel-validate` as **Orchestrated internal skills:** -During execution, `/camel-execute` dispatches these internal skills as needed. They are never invoked directly by the user: +During execution, `/camel-execute` supplies the context for three internal helpers. | Internal Skill | Role | |---|---| | `camel-implement` | Generate Camel YAML DSL routes from the approved design spec and implementation plan | -| `/camel-verify` | Runtime verification loop: build, start, diagnose errors, apply fixes | +| `camel-verify` | Runtime verification loop: build, start, diagnose errors, apply fixes | | `camel-test` | Generate Citrus integration tests | --- @@ -1108,6 +1112,14 @@ GitHub Copilot CLI now uses its native `.github/skills/` surface exclusively. Ol --- +### /camel-knowledge + +Ask a documentation, component, release or security advisory question, for example +`/camel-knowledge Which options does the Kafka component support?` The skill uses the Knowledge MCP server +to return findings with sources. Brainstorm and Execute can also use it during a pipeline. + +--- + ### /camel-debug **Purpose:** Ad-hoc troubleshooting for broken Camel routes outside of a pipeline run. Follows a structured STOP → PRESERVE → DIAGNOSE → FIX → GUARD workflow. @@ -1132,7 +1144,7 @@ GitHub Copilot CLI now uses its native `.github/skills/` surface exclusively. Ol 4. **FIX** -- explain the proposed fix, apply minimal targeted changes, and verify the fix resolves the issue. A direct user request to fix authorizes normal in-scope repair; a diagnosis-only request pauses for approval before changing files. Up to 5 fix attempts are allowed before escalating. 5. **GUARD** -- suggest a preventive measure (test, validation rule, CI check) to prevent recurrence. -**Error classification:** Reuses the same structured error taxonomy as `/camel-verify`: +**Error classification:** Reuses the same structured error taxonomy as `camel-verify`: | Category | Examples | Fix Target | |---|---|---| @@ -1151,22 +1163,16 @@ Normal actions independently selected by the shipped debug workflow from validat --- -### /camel-verify - -> **Internal skill** -- dispatched automatically by `/camel-execute`. Not intended for standalone use. For quality checks after the pipeline completes, use `/camel-validate`. +### camel-verify -**Purpose:** Runtime verification feedback loop that builds, starts, diagnoses errors, applies fixes, and retries until the application runs correctly or the iteration limit is reached. - -**When to use:** This skill is invoked internally by `/camel-execute` during its verification phase. Users should not run it directly; use `/camel-validate` for post-pipeline quality validation. +`/camel-execute` supplies the generated application and tests to `camel-verify` and incorporates its build and +test results into the execution report. For a broken route outside Execute, use `/camel-debug`. +For a static quality check, use `/camel-validate`. **Produces:** - Verification report (printed to console) - Fixes applied to project files (pom.xml, route YAML, properties, etc.) -**Example:** - -No direct user invocation. `/camel-execute` dispatches this skill internally during its verification phase. - **How it works (3-phase loop):** 1. **Build Verification** -- compiles Spring Boot and Quarkus projects with `./mvnw`; Camel Main runs its startup smoke test instead. Classifies failures and auto-fixes missing dependencies/version conflicts or routes to internal implementation/validation handling. Up to 15 iterations. diff --git a/docs/modules/ROOT/pages/contributing.adoc b/docs/modules/ROOT/pages/contributing.adoc index a3c9eef2..c915d10b 100644 --- a/docs/modules/ROOT/pages/contributing.adoc +++ b/docs/modules/ROOT/pages/contributing.adoc @@ -82,10 +82,12 @@ plain and descriptive. A skill is a directory under `kit/camel-kit-core/src/main/resources/skills/` with a `SKILL.md` manifest (YAML front matter with `name`, `description` and `user_invocable`, then the steps and a guide table) and a `guides/` directory -of instruction files loaded on demand. Every skill is registered in the workflow manifest -`camel-kit-workflow.yaml`, which drives the generated command stubs, the trait application and the structural tests: -a user-facing skill with its `generated_command`, documented in the command reference; an internal skill with -`status: internal` and `generated_command: null`, referenced from the guide table of the skill that dispatches it. Shared +of instruction files loaded on demand. Register every core skill in the +https://github.com/apache/camel-kit/blob/main/kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml[core workflow manifest]. +Use the criteria above `skills` to choose its status. For a public entry, name its `user_facing` command in +`generated_command`, add it to the command reference and check xref:skills.adoc#entry-points[each assistant's entry point]. +For an internal helper, set `generated_command: null` and reference its instructions or guides from the calling skill. +Pack contributions use the <<skill-packs,pack descriptor>>. Shared guides under `skills/shared/` feed several skills, so check every caller before editing one. Agent-specific behaviour goes into trait files under `templates/traits/<agent>/`, which need no code registration. See xref:skills.adoc[] for the structure and the tiers. diff --git a/docs/modules/ROOT/pages/skills.adoc b/docs/modules/ROOT/pages/skills.adoc index 9bbabb45..f23784a3 100644 --- a/docs/modules/ROOT/pages/skills.adoc +++ b/docs/modules/ROOT/pages/skills.adoc @@ -28,12 +28,39 @@ xref:getting-started.adoc#existing-project[how to compare or accept a proposed f | Utility | `camel-debug` | `/camel-debug` | Troubleshooting of a broken route outside a pipeline |=== -Four internal skills are dispatched by the pipeline skills and have no command stub: `camel-design` (component -selection, EIP catalog, design assembly), `camel-implement` (YAML routes, properties, Docker Compose, DataMapper), -`camel-test` (Citrus integration tests) and `camel-verify` (build, test, diagnose and repair at runtime). They are -the composition primitives the stages assemble. `camel-ship` is the outlier of its tier: its manifest is a short -delegate that invokes the registered `camel-kit ship` command once and does not follow the guide-based structure -described below. +Four internal helpers supply the pipeline's instructions. Brainstorm uses `camel-design` for design choices. +Execute uses `camel-implement` for routes and configuration, `camel-test` for Citrus tests, and +`camel-verify` to build and test the resulting application and record the outcome in the execution report. +Use `camel-debug` to investigate a failure outside Execute and `camel-validate` for a static quality check. + +[[entry-points]] +== Invoking a public skill + +The nine public skills have an entry point on each supported assistant. For example, to debug a broken route: + +[cols="1,2,3"] +|=== +| Assistant | Example | How the entry is installed + +| Claude Code | `/camel-debug` | Native skill under `.claude/skills/` in the development snapshot. +See xref:agents.adoc#claude-native-skills[Claude skill discovery and upgrades]. +| IBM Bob 2 | `$camel-debug` in Bob Shell, `/camel-debug` in Bob IDE | Native picker entries under `.bob/skills/`. +Kit also writes legacy command stubs. Bob Shell lists public skills in `/skills`. +| Antigravity | `/camel-debug` or ask for `camel-debug` by name | Native skill under `.agents/skills/`. +| Codex CLI | `$camel-debug` | Native skill under `.agents/skills/`. Open `/skills` to browse. +| GitHub Copilot CLI | Ask Copilot to use the `camel-debug` skill | Native skill under `.github/skills/`. +| OpenCode | `/camel-debug` | Command stub under `.opencode/commands/` loads the matching skill. +| Qwen Code | `/camel-debug` | Command stub under `.qwen/commands/`. Qwen loads `/camel-ship` directly +from its native skill so it can dispatch Ship work. +| Pi | `/skill:camel-debug` | Native skill under `.pi/skills/` in a trusted project. Kit also generates +`/camel-debug` and the other public prompt shortcuts except Ship. Use `/skill:camel-ship` to preserve quoted arguments. +|=== + +Kit generates command stubs only for public skills. Claude, Bob Shell and Qwen expose the nine public entries +in their command or skill pickers. Antigravity and Codex also list the four installed helpers, as do +Copilot's `skill list` inventory and OpenCode's command list. Pi omits the helpers from the model's skill list +but still accepts an explicit `/skill:camel-verify`. Use the calling workflow for these helpers so they receive +their inputs and return their results to the right stage. [[workflow-hooks]] == Running a required workflow hook @@ -123,18 +150,11 @@ user_invocable: false --- ---- -In the shared source only `camel-start` sets `user_invocable: true`: it is the auto-discovered entry point. The -pipeline and utility skills still get entry points, generated per agent: slash-command stubs where the agent uses -them, and native project skills on Claude Code _(development snapshot only)_, Codex CLI and GitHub Copilot CLI. -Generated copies may add runtime aliases: Copilot, Pi and Qwen add a hyphenated `user-invocable` field, Codex -rewrites `+/camel-*+` invocations to `+$camel-*+` mentions. Bob 2 sets both fields to `true` for the nine public -skills, so that Bob Shell lists them in `/skills` and the `+$camel-*+` picker. Claude Code sets -`user-invocable: true` for all nine public skills and discovers them from `.claude/skills/` without command stubs. -Internal skills keep `false` everywhere; on Claude Code, -Copilot and Pi the four internal skills also get `disable-model-invocation: true`, which keeps the model from -selecting them while the pipeline skills still read their guides as files. See -xref:agents.adoc#claude-native-skills[native skill discovery on Claude Code]. The front matter must match the -workflow manifest; a test enforces it. +In the core source only `camel-start` sets `user_invocable: true`. The +https://github.com/apache/camel-kit/blob/main/kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml[workflow manifest] records each skill's status and public command. +The installed front matter depends on the assistant. For example, Bob 2 and Claude mark all nine public +skills `user-invocable: true`. Claude, Copilot and Pi mark the four internal helpers +`disable-model-invocation: true`. See <<entry-points>> for explicit invocation. [[progressive]] == Progressive disclosure @@ -194,6 +214,6 @@ registration. [[adding]] == Adding a skill -Create the directory with its manifest and guides, register the skill in the workflow manifest, and, for a -user-invocable skill, in the templates of all eight agents and in the command reference. Run -`ShippedAssetStructureTest` after any skill, template or trait change. See xref:contributing.adoc[]. +Register every core skill in the workflow manifest and check its generated entry points on all eight targets. +Run `ShippedAssetStructureTest` after any skill, template or trait change. +See xref:contributing.adoc#skills[adding a core skill] and xref:contributing.adoc#skill-packs[contributing a pack]. diff --git a/kit/camel-kit-core/src/main/resources/skills/camel-verify/SKILL.md b/kit/camel-kit-core/src/main/resources/skills/camel-verify/SKILL.md index bfc3a315..87a3eefa 100644 --- a/kit/camel-kit-core/src/main/resources/skills/camel-verify/SKILL.md +++ b/kit/camel-kit-core/src/main/resources/skills/camel-verify/SKILL.md @@ -1,6 +1,6 @@ --- name: camel-verify -description: Build, test, diagnose, and fix a Camel application iteratively. +description: Internal runtime verification for camel-execute. Builds and tests the generated integration and reports the result to Execute. user_invocable: false --- @@ -17,7 +17,7 @@ Maven compilation and Citrus testing retry up to 15 times; Camel Main startup re ## Invocation - **Internal only** — run by `camel-execute` after all implementation tasks, in an isolated subagent where supported or inline otherwise -- This skill is NOT user-invocable. It runs as part of the execute phase, not as a standalone pipeline stage. +- If selected directly for a failure outside Execute, direct the user to `/camel-debug`. Start the verification loop only when Execute dispatches it. ## Prerequisites diff --git a/kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml b/kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml index 9acfae26..2a06b4c1 100644 --- a/kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml +++ b/kit/camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml @@ -94,10 +94,18 @@ commands: generated_stub: false user_facing: false tier: internal - description: "Build, test, diagnose, and fix a Camel application iteratively." + description: "Internal runtime verification for camel-execute. Builds and tests the generated integration and reports the result to Execute." standalone: false chained: true +# Classify each core skill by the task a developer can start with it. +# router: selects the workflow for a request whose next stage is undecided. +# pipeline: performs a named stage, entered directly with its inputs or by handoff. +# standalone: delivers a result independently of the manual pipeline, even when a stage also uses it. +# internal: supplies guides or performs work whose inputs and result belong to a calling workflow. +# A public skill names its user_facing command in generated_command. Internal skills use null. +# Only the core router sets user_invocable in its source frontmatter to true. Each host exposes +# public commands through native skills or stubs. Its picker may also list installed internal guides. skills: - name: camel-start user_invocable: true diff --git a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/workflow/SkillPackCompilerTest.java b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/workflow/SkillPackCompilerTest.java index cb61b8b9..c7cd0afb 100644 --- a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/workflow/SkillPackCompilerTest.java +++ b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/workflow/SkillPackCompilerTest.java @@ -61,15 +61,28 @@ class SkillPackCompilerTest { """; @Test - void defaultCatalogPreservesPublicCommandsInternalSkillsAndCoreResources() throws Exception { + void defaultCatalogPreservesSkillClassificationAndCoreResources() throws Exception { var catalog = SkillCatalog.bundled(); WorkflowManifest workflow = catalog.manifest().workflow(); assertEquals(WorkflowManifestLoader.load(WorkflowManifestLoader.DEFAULT_RESOURCE), workflow); - assertEquals(Set.of("camel-start", "camel-brainstorm", "camel-plan", "camel-migrate", "camel-execute", - "camel-validate", "camel-debug", "camel-ship", "camel-knowledge"), - workflow.generatedCommandStubs().stream().map(c -> c.name()).collect(Collectors.toSet())); - assertEquals(Set.of("camel-test", "camel-design", "camel-implement", "camel-verify"), workflow.skills().stream() - .filter(s -> "internal".equals(s.status())).map(s -> s.name()).collect(Collectors.toSet())); + var skillsByStatus = workflow.skills().stream().collect(Collectors.groupingBy( + WorkflowManifest.WorkflowSkill::status, + Collectors.mapping(WorkflowManifest.WorkflowSkill::name, Collectors.toSet()))); + assertEquals(Map.of( + "router", Set.of("camel-start"), + "pipeline", + Set.of("camel-brainstorm", "camel-migrate", "camel-plan", "camel-execute", "camel-validate"), + "standalone", Set.of("camel-debug", "camel-ship", "camel-knowledge"), + "internal", Set.of("camel-design", "camel-implement", "camel-test", "camel-verify")), skillsByStatus); + var publicSkills = workflow.skills().stream().filter(skill -> !"internal".equals(skill.status())) + .map(WorkflowManifest.WorkflowSkill::name).collect(Collectors.toSet()); + assertEquals(publicSkills, workflow.generatedCommandStubs().stream() + .map(WorkflowManifest.WorkflowCommand::name).collect(Collectors.toSet())); + assertEquals(publicSkills, workflow.commands().stream().filter(WorkflowManifest.WorkflowCommand::userFacing) + .map(WorkflowManifest.WorkflowCommand::skill).collect(Collectors.toSet())); + assertEquals(Set.of("camel-start"), + workflow.skills().stream().filter(WorkflowManifest.WorkflowSkill::userInvocable) + .map(WorkflowManifest.WorkflowSkill::name).collect(Collectors.toSet())); assertEquals("camel-validate/SKILL.md", catalog.manifest().contributions().get("step/validate/report/timestamp").path()); assertTrue(content(catalog, "camel-validate/SKILL.md").contains("Use the current date and time"));
