Lifecycle hooks

From sequenzia/agent-alchemy · View interactive version

Lifecycle hooks is an AI agent skill from the GitHub repository sequenzia/agent-alchemy. Behavioral rules and lifecycle event handlers for the dev-tools package. Defines automated behaviors that trigger at specific points in the agent workflow. (converted from hooks)

How to use this skill

Skill file

Lifecycle Hooks

This skill documents the lifecycle event handlers for the dev-tools package. These hooks define automated behaviors that trigger at specific points in the agent workflow.

Session Start Hook

Event: session_start

Purpose: Cross-plugin dependency resolution for cache environments

Behavior

When a session starts, this hook runs a script that resolves cross-package references by creating symlinks in the plugin cache directory. The script:

  1. Detects whether execution is happening in a plugin cache environment (vs. local monorepo development)
  2. If in cache, iterates over sibling plugin directories under the same organization
  3. Strips the organization prefix to derive short names (e.g., agent-alchemy-claude-tools becomes claude-tools)
  4. Creates symlinks so that relative path references between packages work correctly
  5. Uses the installed plugins registry or filesystem sorting to resolve the correct version

When This Is Needed

In the original plugin system, cross-plugin references use filesystem paths like /../{short-name}/. In local development (monorepo), these paths resolve naturally because sibling directories have short names. In cache environments, the extra version subdirectory and organization-prefixed names break this convention.

Ported Context

In the ported format, this behavior may not be needed since ported files use named references (e.g., "Refer to the deep-analysis skill from the core-tools package") instead of filesystem paths. The script is preserved in references/resolve-cross-plugins.sh for environments that still need filesystem-based cross-package resolution.

Script Reference

See references/resolve-cross-plugins.sh for the full implementation.

Configuration

Integration Notes

What this component does: Defines lifecycle event handlers that run at specific workflow points, primarily handling cross-plugin dependency resolution in cache environments.

Capabilities needed:

Adaptation guidance:

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.