Hook context attachment injection

From ychampion/cskill-agents · View interactive version

Hook context attachment injection is an AI agent skill from the GitHub repository ychampion/cskill-agents. Surface hook-provided startup context by packaging it as metadata attachments before the agent's first request.

How to use this skill

Skill file

SKILL: Hook Context Attachment Injection

Domain: multi-agent

Trigger: Use when startup hooks generate extra context that a child agent should see before it makes its first model request.

Source Pattern: Distilled from reviewed startup-hook context seeding flows.

Core Method

Collect any hook-provided context while the child agent is starting, combine it into a structured metadata attachment, and inject that attachment into the initial conversation state before the query loop begins. This lets startup hooks enrich the child agent without mutating shared parent state or pretending the hook output came from the user. Keeping the payload as metadata preserves provenance and keeps the startup context easy to reason about.

Key Rules

Example Application

If a startup hook gathers repository hints and policy notes for a spawned coding agent, inject them as one metadata attachment before the child begins planning.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.