agentsclimarketplace

Hook context attachment injection

Skill ychampion/cskill-agents/agents/claude-code/skills/hook-context-attachment-injection

Agent skills for coding CLIs, multi-agent runtimes, context engines, MCP extensions, and terminal tooling. Instead of using claude code's source code, give your agent skills to create your own!

Install
npx -y skills add ychampion/cskill-agents --skill hook-context-attachment-injection

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

Surface hook-provided startup context by packaging it as metadata attachments before the agent's first request.

SKILL.md

1.7 KB, as published. Nobody here has run it

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

  • Gather hook output before the first request so the initial reasoning step sees the same context as later logging and transcript paths.
  • Package hook output as metadata attachments, not as synthetic user or assistant text.
  • Keep attachment construction deterministic so retries and resumes produce the same startup context.

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)

  • Do not append startup hook context after the first model turn.
  • Do not mix hook metadata into user-authored content.
  • Do not mutate shared parent conversation state just to deliver child-specific startup hints.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.