跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
营销与销售

ai-agents-portability-campaign

Execute cross-harness hook changes for Claude Code and GitHub Copilot CLI using the settled official contract, versioned probes, generators, and runtime tests. Use for `run the portability campaign`, `port hooks to a new harness`, `copilot hook timeout regression`, or `new copilot cli release, recheck the contract`. Do NOT use for fact lookup alone (use `agent-harness-reference`) or release generation ownership (use `ai-agents-generation-and-release`).

rjmurillo · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add rjmurillo/ai-agents --skill ai-agents-portability-campaign

技能说明


name: ai-agents-portability-campaign description: Execute cross-harness hook changes for Claude Code and GitHub Copilot CLI using the settled official contract, versioned probes, generators, and runtime tests. Use for run the portability campaign, port hooks to a new harness, copilot hook timeout regression, or new copilot cli release, recheck the contract. Do NOT use for fact lookup alone (use agent-harness-reference) or release generation ownership (use ai-agents-generation-and-release). version: 1.1.0 license: MIT metadata: routing: role: front-door invoker: autoplan trigger: autoplan routes cross-harness hook port requests to ai-agents-portability-campaign user-facing: false

ai-agents Portability Campaign

This skill changes hooks. agent-harness-reference owns hook facts. ai-agents-empirical-probe-toolkit owns probe design. ai-agents-generation-and-release owns mirror generation and the release path.

Triggers

  • run the portability campaign
  • port hooks to a new harness
  • copilot hook timeout regression
  • verify the copilot runtime contract
  • new copilot cli release, recheck the contract

Process

Phase 0: Load the Settled Contract

Read:

  1. .claude/skills/agent-harness-reference/SKILL.md
  2. .claude/skills/agent-harness-reference/references/official-hook-contracts.md
  3. .claude/skills/agent-harness-reference/references/probe-evidence.md
  4. .project-toolkit/architecture/ADR-068-consolidated-hook-dispatcher.md
  5. .project-toolkit/architecture/ADR-071-plugin-hook-runtime-contract-verification.md
  6. .claude/rules/generated-artifacts.md

Do not run open-ended documentation research. Re-search or re-probe only when the reference skill's refresh rules apply.

Current load-bearing facts:

DimensionSettled contract
Event casingPascalCase compatibility events deliver snake_case payloads
StopStop is per-turn completion; SessionEnd is process lifecycle
PreCompactSupported locally and in cloud automatic compaction
MatcherSupported; PascalCase tool events use Claude-compatible tool names
PreToolUse denyTop-level permissionDecision; nonzero denies; timeout fails open
PermissionRequestbehavior accepts only allow or deny; translated ask emits nothing
Observer outputActive PostToolUse text merges into one additionalContext; dormant SessionStart, PreCompact, and UserPromptSubmit adapters discard output; unclassified events stay direct
Cloud reachOnly default-branch .github/hooks/*.json loads
Plugin pathsAnchor through plugin-root variables; do not depend on cwd

Phase 1: Classify the Source Hook

For every source registration, record:

  1. Claude event and Copilot event.
  2. Input payload fields in each harness.
  3. Matcher target and matcher syntax.
  4. Output schema.
  5. Exit, crash, timeout, and malformed-output behavior.
  6. Local CLI and cloud reach.
  7. Whether stdout is diagnostic text or documented structured host output.

Use this repository mapping:

Claude sourceCopilot targetGenerated form
PreToolUsePreToolUseActive gate dispatcher, one source shim
PostToolUsePostToolUseActive observe dispatcher, one source shim, text to additionalContext
PermissionRequestPermissionRequestSupported translation path; no current producer
SessionStartSessionStartNo current vendored source; observe/discard adapter if added
UserPromptSubmitUserPromptSubmitNo current vendored source; observe/discard adapter if added
PreCompactPreCompactNo current vendored source; observe/discard adapter if added
StopStopNo current vendored source; separate direct registrations if added
SubagentStopSubagentStopSeparate direct registrations if added
SessionEndSessionEndNo current source registration; stays direct if added until reviewed
PostToolUseFailurePostToolUseFailureDirect registration preserves exit-2 recovery context

Why Stop stays direct: Copilot parses one final JSON document from each command hook. Concatenating two decision objects makes invalid JSON and discards both. The same parser boundary applies to additionalContext, modifiedResult, and other structured outputs. The active PostToolUse merger treats successful observer stdout as ordered, flat context text and emits one additionalContext object. Failed-observer partial output is discarded. It does not merge modifiedResult or pre-structured JSON. Dormant SessionStart and PreCompact adapters discard stdout and stderr. Their direct rollback tests preserve side effects but suppress both channels. PostToolUseFailure stays direct because exit-2 stdout becomes recovery context. Copilot drops config-file UserPromptSubmit output, so its stdout is redirected to stderr in dispatcher and direct rollback modes. Memory recall uses the direct userPromptTransformed registration in .github/hooks/memory-recall.json instead (issue #4727). Stderr is not a documented model-context path. Every unclassified event stays direct until its host contract is reviewed.

Phase 2: Change Canonical Sources

Edit the smallest canonical surface:

  • Hook script: .claude/hooks/**
  • Hook registrations: .claude/settings.json
  • Event mapping: templates/platforms/copilot-cli.yaml
  • Copilot generation: build/scripts/generate_hooks*.py and build/scripts/generate_dispatcher.py
  • Runtime adapter: .claude/lib/hook_dispatch.py

Do not hand-edit src/copilot-cli/**.

Rules:

  • Keep PascalCase target events when source hooks expect snake_case payloads.
  • Keep script-side matcher checks as defense in depth.
  • Keep canonical Claude PermissionRequest output unchanged.
  • Translate only in the generated Copilot dispatcher.
  • Translate Claude approve
阅读完整来源 ↗