home / skills / chachamaru127 / claude-code-harness / test-nested-agents

test-nested-agents skill

/codex/.codex/skills/test-nested-agents

This skill tests nested agents by validating in-skills agent packaging and Task tool invocation to ensure reliable echo-agent patterns.

npx playbooks add skill chachamaru127/claude-code-harness --skill test-nested-agents

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.7 KB
---
name: test-nested-agents
description: "ネストエージェントパターンの検証テスト用スキル。Use when user says テスト検証, test nested agents, verify agent pattern."
description-en: "Test skill for verifying nested agents pattern. Use when user says テスト検証, test nested agents, verify agent pattern."
description-ja: "ネストエージェントパターンの検証テスト用スキル。Use when user says テスト検証, test nested agents, verify agent pattern."
allowed-tools: ["Read", "Task", "Bash"]
user-invocable: false
metadata:
  skillport:
    category: test
    tags: [test, experimental]
    alwaysApply: false
---

# Test Nested Agents Skill

このスキルは `{skill}/agents/` フォルダにエージェントをパッケージするパターンの検証用です。

## テスト対象

1. スキル内の `agents/` フォルダにエージェントを配置
2. Task tool でそのエージェントを呼び出せるか検証

## 含まれるテストエージェント

| エージェント | 目的 |
|-------------|------|
| test-echo-agent | 入力をエコーバックして動作確認 |

## 検証手順

### パターン A: スキル内エージェントを直接参照

```
Task tool:
  subagent_type: "test-echo-agent"
  prompt: "Echo back: HELLO FROM NESTED AGENT"
```

### パターン B: 相対パスでプロンプトを読み込み

```
1. Read: ./agents/test-echo-agent.md
2. そのプロンプトを使って Task tool で general-purpose を起動
```

## 実行

このスキルが起動したら、以下を順次実行:

1. まず `agents/test-echo-agent.md` の内容を確認
2. パターン A を試行
3. パターン A が失敗したら パターン B を試行
4. 結果をレポート

Overview

This skill verifies the nested-agent packaging pattern by testing agents placed under the agents/ folder. It runs checks that a Task tool can invoke a subagent directly or via a relative prompt file. The skill is implemented in JavaScript as a development harness for Plan→Work→Review cycles.

How this skill works

The skill inspects the agents/ directory for test agents (for example, a test-echo-agent) and reads their prompt files. It then executes two verification patterns: direct subagent invocation via Task tool and loading a prompt file by relative path before invoking a general-purpose agent. The run reports successes, failures, and fallback attempts.

When to use it

  • Validate that an agent packaged in agents/ can be called by Task tools
  • Test fallbacks when direct subagent invocation fails
  • Confirm relative-path prompt loading works in development harnesses
  • Automated checks in CI to catch integration regressions
  • Local debugging while building nested agent features

Best practices

  • Keep test agents small and deterministic (e.g., an echo agent)
  • Include a clear prompt file (agents/test-echo-agent.md) for the relative-path test
  • Run direct and fallback patterns in sequence and report both outcomes
  • Log inputs and outputs for each test step to simplify debugging
  • Use this skill in CI and as a local pre-merge check

Example use cases

  • Run Pattern A: Task tool invokes subagent_type: "test-echo-agent" with a test prompt
  • Run Pattern B: Read ./agents/test-echo-agent.md then start a general-purpose Task using that prompt
  • CI job that fails the build if neither invocation pattern returns the expected result
  • Developer runs the skill locally to confirm packaging changes didn't break agent discovery

FAQ

What does the test-echo-agent do?

It echoes back the provided input so you can verify invocation and prompt handling.

What happens if Pattern A fails?

The skill automatically attempts Pattern B (relative-path prompt loading) and reports both results.