Agent skill
lifecycle-hooks
Behavioral rules and lifecycle event handlers for the core-tools package. Defines automated behaviors that trigger at specific points in the agent workflow. (converted from hooks)
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/lifecycle-hooks-sequenzia-agent-alchemy
SKILL.md
Lifecycle Hooks
This skill defines automated behaviors that trigger at specific points in the agent workflow for the core-tools package.
On before_action
Trigger: Fires before the agent executes any action (file write, shell command, etc.)
Applies when: Action matches Write|Edit|Bash
Auto-approve file operations targeting deep-analysis session and cache directories. This allows the deep-analysis workflow to write session files (checkpoints, findings, cache) without requiring manual approval for each operation.
The implementation logic is in references/auto-approve-da-session.sh. This script:
- Checks if the file operation targets
.agents/sessions/__da_live__/,.agents/sessions/exploration-cache/, or.agents/sessions/da-*/directories - Auto-approves matching operations to enable autonomous session management
- Passes through all other operations to normal permission flow
- Expected input: Action context as JSON on stdin (with
tool_nameandtool_inputfields) - Expected output: JSON permission decision or empty (no opinion)
Integration Notes
This skill documents lifecycle automation that was originally implemented as platform-specific hooks. When integrating with a specific agent platform:
- Hook registration: Map the
before_actiontrigger to the platform's pre-execution hook mechanism (e.g.,PreToolUsein Claude Code, pre-action middleware in other platforms) - Matcher pattern: The trigger should only fire for file write, file edit, and shell command actions
- Timeout: The approval script should complete within 5 seconds
- Fail-safe behavior: If the script fails or times out, fall through to normal permission flow (never block the agent)
- Path patterns: The script matches against
.agents/sessions/subdirectories specific to the deep-analysis workflow
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?