Skip to content
Back to skills

Composition Probe

ASecurity

Use when a coordinator bead's inter-bead composition needs verification before downstream beads begin

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsjavashellbashgit

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add Hellblazer/nexus --skill composition-probe --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Composition Probe?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Composition Probe
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hellblazer-composition-probe/badge)](https://www.skillsdirectory.com/skills/hellblazer-composition-probe)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: composition-probe
description: Use when a coordinator bead's inter-bead composition needs verification before downstream beads begin
effort: medium
---

# Composition Probe Skill

Validates that a coordinator bead's inter-bead composition is wired correctly before downstream beads begin.
A coordinator bead is any bead tagged `metadata.coordinator=true` (set with `bd update <id> --set-metadata coordinator=true` when a bead's implementation composes outputs from ≥2 prior beads).

## When This Skill Activates

- User invokes `/conexus:composition-probe <coordinator-bead-id>`
- Plan execution reaches a step tagged `probe: <bead-id>` in the enriched bead description
- User says "run composition probe on bead X", "check probe bead X"

## Inputs

- **Coordinator bead ID** (required) — e.g., `<bead-id>`

## Tool Budget

The dispatched subagent reads code with `Read`, `Grep` and `Glob`, writes the one probe file (`/tmp/probe-<id>.<ext>`) and runs the one pinned runner command line with `Bash`. It reads nothing else and edits no project file. Serena symbol resolution is NOT needed — the
Phase 1a hard-case spike verified CA-1 as `READ-ONLY-SUFFICIENT` against
`search_cross_corpus` in nexus's [search engine](https://github.com/Hellblazer/nexus/blob/main/src/nexus/search_engine.py). Nexus and ART coordinator targets use `Any`
at injection boundaries with runtime dict-key contracts; typed generics requiring inference were not
present in the verified corpus.

Do NOT include Serena tool instructions in the subagent prompt. If a future target requires Serena
escalation (e.g., `typing.Protocol` / `TypeVar` intensive composition), escalate to the user before
dispatching — do not silently extend the tool budget.

## Behavior

### Step 1: Read Coordinator Bead

```bash
bd show <coordinator-bead-id> --json
```

Extract:
- `description` — full bead description, including declared entry point
- `metadata.coordinator` — verify it is `true`; warn but continue if absent (may be an untagged coordinator)
- `.dependencies` (or `.waits_for`) — list of dependency bead IDs

### Step 2: Read Dependency Declared Outputs

For each dependency bead ID from Step 1:

```bash
bd show <dep-bead-id> --json
```

Extract `description` — specifically the declared output shape or return value described in the bead.
Collect as `{dep_bead_id: declared_output}` map.

### Step 3: Detect Test Runner

In the project root, check for build files in order:

```
if pyproject.toml present:    runner = "uv run pytest /tmp/probe-<id>.py -xvs"
elif pom.xml present:         runner = "<mvn> test -Dtest=<classname> --no-transfer-progress"
elif package.json present:    runner = "npm test -- /tmp/probe-<id>.ts"
else:                         surface language-detection failure to the user; halt
```

`pom.xml` counts when it sits at the root or under `service/`. `<mvn>` is the project's own Maven wrapper when its AGENTS.md or CLAUDE.md documents one (a wrapper that takes a build lease, say, so a probe run cannot collide with a concurrent build); never use a bare `mvn` or `./mvnw` where one is documented. Otherwise `<mvn>` is `./mvnw` when it exists, else `mvn`.

Map the runner to a file extension: `pytest` → `.py`, `<mvn>` → `.java`, `npm` → `.ts`. Fill the `<id>` and `<classname>` in the chosen runner; that command line is `<runner>` in Step 4.

### Step 4: Dispatch Subagent

Use the Agent tool with `subagent_type="general-purpose"`. Populate the prompt below verbatim,
substituting `<entry_point>` with the coordinator bead's entry point, `{list of dep bead IDs + their
declared outputs}` with the map from Step 2, and `<runner>` with the full runner command line from Step 3
(for a Maven project that is the `<mvn>` form, so the lease guard reaches the subagent).

---

**Pinned subagent prompt** (do not paraphrase):

> Generate a minimal (30-50 line) end-to-end smoke test against `<entry_point>` that exercises the
> composition of dependencies {list of dep bead IDs + their declared outputs}. The test should:
> - Use realistic input data (not mocks, not stubs, not defaults)
> - Assert on output shape AND intermediate value dimensionality
> - Fail fast on any exception
> - Print which dependency's contract was violated if the composition fails
>
> Write the test to `/tmp/probe-{bead_id}.{ext}` and run it with exactly `<runner>`, never another
> build or test command. Report pass/fail + which dependency (if any) violated its declared output shape.
>
> If you cannot attribute the failure to a specific dependency bead, say so explicitly rather than
> guessing.

---

### Step 5: Parse Output and Report

The subagent writes the test to `/tmp/probe-<bead-id>.<ext>` and runs it. Parse the output.

**PASS**: emit the one-line confirmation format below. The coordinator bead unblocks; downstream beads
may begin.

**FAIL**: emit the structured report below. The coordinator bead remains blocked; surface the failing
dependency for reopen.

**Unattributed failure (CA-2 fallback)**: if the subagent reports it cannot attribute the failure to a
specific dependency (e.g., NullPointerException deep in a call stack, ambiguous exception, or an explicit
"cannot attribute" statement), do NOT attempt auto-attribution. Surface the raw test output to the user,
flag the coordinator bead for manual investigation, and do not suggest a `bd reopen` target. This is the
CA-2 unattributed-failure degradation mode documented in the design RDR's Failure Modes section.

**Timeout / generation failure**: if the subagent fails to generate or run the test (dispatch timeout
>5 minutes, subagent crashes, or cannot write the test file), surface as advisory:
`> Composition probe could not be generated for <coordinator-bead-id>; manual composition check required.`
Do not block the coordinator.

**Flaky result (2/3 passes)**: if the probe is run 3 times and passes 2 of 3, surface ambiguity to the
user with the raw inconsistent outputs. Do not block, but warn. Up to 3 retries are permitted to
distinguish a real failure from flakiness; consistent failures (3/3) block.

## Output Format

### PASS

```
> Composition probe PASSED for <coordinator-bead-id> (<N> assertions, <elapsed>s). Coordinator unblocks.
```

### FAIL (attributed)

```
> Composition probe FAILED for <coordinator-bead-id>
>
> Failing dependency: <dep-bead-id> (<dep-title>)
> Assertion: <the specific assertion that broke, with file:line>
> Expected: <shape/type/value>
> Actual: <shape/type/value>
>
> Suggested: `bd reopen <dep-bead-id>` to address the contract violation before proceeding.
```

### FAIL (unattributed — CA-2 fallback)

```
> Composition probe FAILED for <coordinator-bead-id> (unattributed failure)
>
> The subagent could not attribute the failure to a specific dependency bead.
> Raw test output:
> <raw output>
>
> Manual investigation required. Do not proceed with downstream beads until the composition point
> is verified. Flag this coordinator bead for review before continuing.
```

## Relay Template

When the composition probe skill dispatches its general-purpose subagent via the Agent tool, use this
exact structure:

```markdown
## Relay: general-purpose

**Task**: Generate and run a 30-50 line composition smoke test against `<entry_point>` that exercises
the inter-bead composition for coordinator bead `<coordinator-bead-id>`.
**Bead**: none

### Input Artifacts
- nx store: [none — composition-probe does not consume T3 knowledge]
- nx memory: coordinator bead metadata from `bd show --json` (accessed via shell, not memory_get)
- nx scratch: [none — composition-probe is stateless across invocations]
- Files: `/tmp/probe-<coordinator-bead-id>.<ext>` (subagent writes the generated test here and reads source files referenced by the coordinator's entry point)
- Coordinator entry point: `<entry_point>`
- Dependency declared outputs: `{dep_bead_id: declared_output, ...}`
- Test runner: `<runner command>`

### Deliverable
Pass/fail result with attribution to the specific failing dependency bead (if failure), or explicit
"cannot attribute" statement if attribution is not possible.

### Quality Criteria
- [ ] Test is 30-50 lines
- [ ] Uses realistic input data (not mocks, not stubs, not defaults)
- [ ] Asserts on output shape AND intermediate value dimensionality
- [ ] Fails fast on any exception
- [ ] Prints which dependency's contract was violated if composition fails
- [ ] If attribution is impossible, says so explicitly rather than guessing
- [ ] Test written to `/tmp/probe-<bead-id>.<ext>` and run via the detected test runner
```

For full relay structure and optional fields, see [${CLAUDE_PLUGIN_ROOT}/resources/agent-shared/RELAY_TEMPLATE.md](../../resources/agent-shared/RELAY_TEMPLATE.md).

## Success Criteria

- [ ] Coordinator bead read and entry point + dependency IDs extracted
- [ ] Each dependency's declared output read from its bead description
- [ ] Test runner detected (pyproject.toml / pom.xml / package.json)
- [ ] Subagent dispatched with pinned prompt (verbatim — no paraphrasing)
- [ ] Tool budget enforced: subagent reads with Read, Grep, Glob, writes only the /tmp probe file and runs only the pinned runner (no Serena, no project edits)
- [ ] PASS output is one-line confirmation with assertion count and elapsed time
- [ ] FAIL output is structured report with dependency attribution and suggested `bd reopen`
- [ ] CA-2 fallback (unattributed failure) surfaces raw output without guessing attribution
- [ ] Timeout and flaky-result paths handled without silent blocking

## Agent-Specific PRODUCE

Outputs produced by this skill directly:

- **Console output**: PASS/FAIL report on stdout with attribution (see Output Format above). PASS is a one-line confirmation; FAIL is a structured report citing the failing dependency bead with a `bd reopen` suggestion; unattributed FAIL surfaces raw test output without auto-attribution.
- **Filesystem (ephemeral)**: generated test file at `/tmp/probe-<coordinator-bead-id>.<ext>` — auto-cleanup after probe run; not retained across invocations.
- **Bead state**: no direct mutation. The coordinator bead remains in its current state; the user decides whether to close, reopen, or `bd reopen` a dependency based on the probe result. The skill surfaces recommendations, not commands.
- **T1 scratch (optional)**: for repeat invocations against the same coordinator (retry path or flaky-result investigation), intermediate results may be written to T1 scratch with tag `composition-probe,<coordinator-bead-id>` for session-scoped state. Not required for a single-run invocation; use when disambiguating a 2/3 flaky-pass result.

Outputs generated by the dispatched general-purpose subagent (not by the skill directly):

- **Generated test file**: `/tmp/probe-<coordinator-bead-id>.<ext>` — the 30-50 line composition smoke test the subagent authored
- **Test output**: pytest / mvn / npm output captured by the subagent and returned to the skill for parsing
- **Attribution**: specific dependency bead ID + the assertion or exception that broke (for attributed FAILs)

## MVV Re-Scope Note

The original MVV in the RDR (Phase 3 target: a dialog-input failure in the ART codebase,
`GroundedLanguageSystem.dialog().process("ball")` expecting `IllegalArgumentException: input length 312
!= state size 65`) is **un-runnable** against the current ART codebase — that fix already shipped,
so the failure mode no longer exists and any probe run would produce a false PASS.

The Phase 3 MVV is therefore re-scoped to structural validation only:

- Skill file is syntactically valid markdown with correct YAML frontmatter
- Subagent prompt is pinned verbatim from the design RDR's Technical Design section
- Test runner detection covers the three supported languages
- Skill shape matches the Phase 1a validated pattern (Read-only tool budget)

The **catch demonstration** (actual end-to-end FAIL→catch→PASS cycle) moves to Phase 5a
(`nexus-gxr`, Synthetic retcon injection), where a synthetic composition failure is deliberately
introduced and the probe's catch is verified end-to-end against a controlled target.

## Does NOT

- Close or update the coordinator bead automatically (user decides based on probe result)
- Run the full project test suite (the probe is targeted, ~30-120 seconds)
- Use Serena for symbol resolution (Read-only tool budget per Phase 1a CA-1 finding)
- Auto-attribute failures when the subagent cannot confidently identify the failing dependency

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.