All skills
aktsmm avatar

/agentic-workflow-guide

@fb34748
by yamapanaktsmm/agent-skills26 stars
4

Design, review, and debug agent workflows, and decide when a request should use a prompt, instruction, skill, agent, or hook before escalating to multi-agent design. Use for .agent.md / .instructions.md / .prompt.md / AGENTS.md work, workflow architecture, orchestration planning, scheduled automation model allocation, or when agent workflows may be overkill. Triggers on 'agent workflow', 'create agent', 'automation models', 'ワークフロー設計', 'orchestrator'.

Use this Skill: https://skilld.dev/gh/aktsmm/agent-skills/agentic-workflow-guide

This session only. Nothing lands on disk.

referenceshooks-guide.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Hooks Guide

Hooks are deterministic lifecycle automation for agent sessions.

Use hooks when workflow behavior must run, block, ask, or inject context at a known event. Do not use hooks for guidance that can remain conversational.

When to Use

Good fit

  • block dangerous commands before execution
  • require confirmation at specific lifecycle events
  • inject standard runtime context at session start
  • run validation or formatting after successful tool use

Bad fit

  • style guidance that can live in instructions
  • role specialization that belongs in an agent
  • reusable workflows with assets that belong in a skill

Guidance vs Enforcement

Need Use
Encourage preferred behavior Prompt / Instruction / Skill / Agent
Guarantee lifecycle behavior Hook

If the requirement includes "always block", "must ask", "auto-run", or "inject at session start", evaluate Hook first.

Locations

Path Scope
.github/hooks/*.json Workspace

Prefer workspace hooks for team policy. Keep personal automation outside the repo when it should not be shared.

Lifecycle Events

Event Trigger
SessionStart First prompt of a new session
UserPromptSubmit User submits a prompt
PreToolUse Before tool invocation
PostToolUse After successful tool invocation
PreCompact Before context compaction
SubagentStart Subagent starts
SubagentStop Subagent ends
Stop Agent session ends

Minimal Shape

{
  "hooks": {
    "PreToolUse": [
      {
        "type": "command",
        "command": "./scripts/validate-tool.sh",
        "timeout": 15
      }
    ]
  }
}

Each command can define platform-specific overrides, cwd, env, and timeout.

Decision Heuristic

Choose Hook only if all of these are true:

  1. The behavior must happen at a specific lifecycle event
  2. Guidance alone is insufficient
  3. A shell command can evaluate or enforce the rule safely

If any of the three is false, prefer prompt / instruction / skill / agent.

Core Principles

  1. Keep hooks small and auditable
  2. Prefer explicit block/ask rules over opaque automation
  3. Avoid hardcoded secrets or environment-specific values
  4. Do not let long-running hooks stall normal workflow

Common Patterns

Ask before dangerous tool use

Use PreToolUse when a command or tool category needs human confirmation.

Auto-validate after edits

Use PostToolUse when formatting, linting, or policy checks should run after successful file changes.

Inject startup context

Use SessionStart when the agent should receive deterministic context before normal work begins.

Session-scoped guardrails

If the platform supports hooks that are activated only for a specific skill, command, or session, use them for safeguards that would be too noisy as always-on policy.

Good fits:

  • stricter destructive-command blocking while touching production or infrastructure
  • write-freeze rules during debugging or audit-only work
  • temporary validation that belongs to one workflow but not normal chat

Keep these hooks narrow, visible, and easy to disable when the workflow ends.

Lightweight telemetry

Hooks can also record small routing or workflow signals when you need evidence for improvement.

Good fits:

  • skill name or workflow name
  • manual vs automatic trigger
  • success, fallback, or blocked outcome
  • missing expected trigger, when the platform exposes it

Use local append-only logs or aggregated counters. Do not log prompt text, secrets, personal data, customer data, or raw tool payloads.

Anti-patterns

  • using hooks for soft preferences that belong in instructions
  • building large workflow logic inside hooks
  • creating hooks before you can name the lifecycle event they depend on
  • running slow hooks that make ordinary tasks feel broken
  • making a high-friction hook always-on when it only belongs to one risky workflow
  • collecting telemetry broadly without a concrete routing or quality question

Source: SKILL.md on GitHub

2 warnings4mo4 checks · Risk SAFE
  • Gen Agent Trust Hub4mo

    This skill is a professional development toolkit for designing, reviewing, and managing AI agent workflows. It provides structured templates, architectural guidance, and utility scripts to help users build efficient multi-agent systems following best practices like Single Responsibility and Single Source of Truth.

  • Socket4mo

    No alerts

  • Snyk4mo

    Risk: MEDIUM · 1 issue

  • Runlayer7mo

    15/58 files flagged

Signed by skilld at fb34748. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 15 hours ago.

Activeupdated last week
user-invocable
true
metadata
{
  "author": "yamapan (https://github.com/aktsmm)"
}
Other metadata
argument-hint
作りたい .agent.md / .instructions.md / .prompt.md / AGENTS.md、設計したい workflow、または困っている症状

README badge

README badge for aktsmm/agent-skills/agentic-workflow-guide