feat(kyberforge): add agent-author skill for Claude Code and Copilot CLI agents

## Why

skill-author explicitly excludes agent definition files ("Do not use to author
agent definition files"). No factory skill existed to create or improve the
.md / .agent.md files that define Claude Code subagents and Copilot CLI agents
in a plugin, project, or user scope. This fills that gap.

## Implementation Notes

Single-root scaffold convention: new-agent.sh <name> <root> derives both
provider file paths from the root by convention — plugin scope (plugin.json
present) writes both files into <root>/agents/; non-plugin scope writes
.claude/agents/<name>.md and .github/agents/<name>.agent.md. This keeps
input minimal while always generating both provider files. See ADR-0015.

Routing is file-level (not directory-level like skill-author): neither file
exists → create flow; at least one exists → improve flow; scaffold is a
file-by-file no-op so retries are safe.

No companion agent-audit skill — inline validation in the close step covers
the simpler agent field contract. agent-audit is tracked as a follow-on.

## Impact

Closes the skill-author gap for agent definitions. Follow-ons tracked in
Gitea #11: agent-audit skill and --copilot-dest override flag for non-standard
Copilot project paths.

---
ADR: docs/adr/0015-agent-author-dual-provider-scaffold.md
Refs: #10
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-27 15:07:33 +00:00
parent 83e1a50a51
commit ba68b09c87
13 changed files with 936 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
# assets/
## templates/
Annotated agent definition templates copied by `scripts/new-agent.sh` when scaffolding a new agent.
- **`claude-code.md`** — Claude Code agent definition template. Includes all supported frontmatter fields (required and optional) with inline guidance comments and `FILL IN:` placeholders. Notes which fields are silently ignored for plugin agents.
- **`copilot.agent.md`** — Copilot CLI agent definition template. Uses Copilot-specific fields (`target`, `user-invocable`, `disable-model-invocation`, Copilot tool aliases). Explicitly excludes Claude Code-only fields.

View File

@@ -0,0 +1,66 @@
---
# Claude Code agent definition
# Fill in all FILL IN: placeholders. Remove or uncomment optional fields as needed.
name: AGENT_NAME
# Required. Lowercase letters and hyphens only. Must be unique within the scope.
# Duplicate names are silently discarded — no warning is emitted.
description: FILL IN: Action-first description of what this agent does and when to invoke it.
# Required. The primary signal for autonomous delegation.
# Start with a verb: "Reviews...", "Analyzes...", "Generates..."
# Include "Use proactively" to trigger automatic invocation.
# Be specific about the triggering condition and domain.
# Example: "Reviews pull request diffs for security issues. Use proactively after code changes."
# tools: Read Bash Grep
# Optional. Space-separated allowlist. Omit to inherit all tools from parent.
# Use Agent(type1,type2) to restrict which subagent types this agent can spawn.
# Omit Agent entirely to prevent this agent from spawning subagents.
# Never available to subagents regardless of tools field:
# AskUserQuestion, EnterPlanMode, ExitPlanMode, ScheduleWakeup
# model: sonnet
# Optional. Aliases: sonnet, opus, haiku, fable. Or full model ID.
# Omit to inherit from the main session.
# Resolution order: CLAUDE_CODE_SUBAGENT_MODEL env var → per-invocation param → this field → session model.
# effort: medium
# Optional. low / medium / high / xhigh / max. Overrides session effort level for this agent.
# maxTurns: 20
# Optional. Integer cap on agentic turns. Prevents runaway on bounded tasks.
# memory: project
# Optional. user / project / local. Enables cross-session MEMORY.md (first 200 lines loaded at startup).
# Auto-enables Read/Write/Edit tools.
# isolation: worktree
# Optional. Set to "worktree" to run in an isolated temporary git worktree.
# Auto-cleaned if no changes are made.
# color: blue
# Optional. UI color: red, blue, green, yellow, purple, orange, pink, cyan.
# background: false
# Optional. Set true to force background execution.
# NOTE: hooks, mcpServers, and permissionMode are silently ignored for plugin agents.
# Those fields only work in .claude/agents/ or ~/.claude/agents/.
---
FILL IN: System prompt body. Write as a direct role instruction.
You are a FILL IN: role description. When invoked, FILL IN: primary action.
## Inputs
FILL IN: What inputs does this agent expect? (files, context, parameters)
## Process
FILL IN: Steps the agent takes. Be specific about ordering if it matters.
## Output
FILL IN: What does the agent produce? Format, location, structure.

View File

@@ -0,0 +1,58 @@
---
# GitHub Copilot CLI agent definition
# File extension MUST be .agent.md — a plain .md file is not picked up by Copilot.
# Fill in all FILL IN: placeholders. Remove or uncomment optional fields as needed.
name: AGENT_NAME
# Required. Kebab-case identifier. Home-directory version wins on name collision.
description: FILL IN: Action-first description of what this agent does and when to invoke it.
# Required. Used by the runtime for automatic agent selection — quality matters.
# Start with a verb: "Reviews...", "Analyzes...", "Generates..."
# Example: "Reviews pull request diffs for security issues."
# tools: ["read", "search", "edit"]
# Optional. Array of tool names. Omit = all available tools. [] = no tools.
# Copilot tool aliases (use these, not Claude Code names):
# execute — run shell commands (aliases: shell, Bash, powershell)
# read — read file contents (aliases: Read, NotebookRead)
# edit — modify files (aliases: Edit, MultiEdit, Write, NotebookEdit)
# search — search files (aliases: Grep, Glob)
# agent — invoke sub-agents (aliases: custom-agent, Task)
# web — web search and fetch (aliases: WebSearch, WebFetch)
# For MCP tools: "server-name/tool-name" or "server-name/*"
# target: github-copilot
# Optional. Which runtime loads this file.
# vscode — VS Code Copilot only
# github-copilot — Copilot CLI / cloud agents only
# both (default) — loaded by both runtimes
# user-invocable: true
# Optional. Set false to hide from manual invocation (auto-select only).
# disable-model-invocation: false
# Optional. Set true to require explicit user invocation; prevents auto-selection.
# model: claude-sonnet-4-5
# Optional. Model to run this agent on.
# DO NOT include these Claude Code-only fields:
# maxTurns, isolation, memory, permissionMode, effort, hooks, mcpServers
---
FILL IN: System prompt body. Should match the Claude Code version — the agent's task is the same across providers.
You are a FILL IN: role description. When invoked, FILL IN: primary action.
## Inputs
FILL IN: What inputs does this agent expect? (files, context, parameters)
## Process
FILL IN: Steps the agent takes. Be specific about ordering if it matters.
## Output
FILL IN: What does the agent produce? Format, location, structure.