本文へ移動
cccskills
無料GitHub で公開

auto-skill

Evaluate current session for skill-worthy workflows and create reusable skills. Triggers on: auto-skill, create skill from session, save workflow, capture this as a skill.

インストール方法を見る

含まれるファイル(6)

  • SKILL.md9.4 KB
  • assets/.gitkeep0 B
  • references/.gitkeep0 B
  • scripts/.gitkeep0 B
  • scripts/evaluate.sh4.9 KB
  • scripts/track-tools.sh1.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Auto-Skill

Evaluate the current session and create a reusable skill from complex workflows. Enforces the Agent Skills specification and quality gates.

When This Triggers

  • User runs /auto-skill
  • Stop hook suggests it after a complex session (8+ mutating ops across 4+ tool types)
  • User says "save this as a skill", "capture this workflow", etc.

Command Router

Parse arguments after auto-skill (or /auto-skill):

User saysAction
auto-skill (no args)Run the full evaluation procedure below
auto-skill offDisable globally: touch ~/.claude/auto-skill.disable and confirm
auto-skill onEnable globally: rm -f ~/.claude/auto-skill.disable and confirm
auto-skill off --projectDisable for this project: mkdir -p .claude && touch .claude/auto-skill.disable
auto-skill on --projectEnable for this project: rm -f .claude/auto-skill.disable
auto-skill statusShow current state (see Status section below)
auto-skill pendingShow all entries in ~/.claude/auto-skill/pending.log (past suggestions the user may have missed)
auto-skill clearTruncate ~/.claude/auto-skill/pending.log after confirming with user

Status

When the user runs auto-skill status, check and report:

# Global toggle
[ -f "$HOME/.claude/auto-skill.disable" ] && echo "Global: OFF" || echo "Global: ON"

# Project toggle
[ -f ".claude/auto-skill.disable" ] && echo "Project: OFF" || echo "Project: ON"

# Hook scripts installed?
[ -x "$HOME/.claude/auto-skill/track-tools.sh" ] && echo "Hooks: installed" || echo "Hooks: not installed"

# Active session tracking?
ls /tmp/claude_autoskill_* 2>/dev/null | head -1 && echo "Tracking: active" || echo "Tracking: idle"

Report results in a brief table.

Procedure

Step 1: Evaluate the Session

Review the conversation history in the current session. Ask yourself:

  1. Was this a multi-step workflow? (3+ distinct actions, not just read/search)
  2. Is it reusable? Would someone do this again - in this project or another?
  3. Is it novel? Does an existing skill already cover this? Check with:
    ls ~/.claude/skills/ 2>/dev/null; ls .claude/skills/ 2>/dev/null
    
  4. Is it teachable? Can it be described as a clear procedure with steps?

If ANY answer is no, tell the user: "This session doesn't look like a good skill candidate" and explain which criterion failed. Stop here.

Step 2: Duplicate Detection

Before creating, check for overlapping skills:

# List existing skill names and descriptions
for f in ~/.claude/skills/*/SKILL.md .claude/skills/*/SKILL.md 2>/dev/null; do
  [ -f "$f" ] || continue
  name=$(head -10 "$f" | grep '^name:' | sed 's/name: *//')
  desc=$(head -10 "$f" | grep '^description:' | sed 's/description: *//' | tr -d '"')
  echo "$name: $desc"
done

Block if:

  • Exact name match exists
  • 60%+ word overlap in proposed name vs existing name
  • 50%+ word overlap in proposed description vs existing description

If overlap detected, suggest extending the existing skill instead.

Step 3: Draft the Skill

Propose a skill to the user with:

FieldValue
Namekebab-case, descriptive, matches what it does
Description1-2 sentences with trigger keywords
ProcedureNumbered steps extracted from the session workflow
Tools neededWhich tools the skill requires

Ask the user to confirm or adjust before creating.

Step 4: Quality Gates

Before writing, validate:

GateRequirementWhy
Name format^[a-z][a-z0-9-]*$, 1-64 charsAgent Skills spec
DescriptionNon-empty, 1-1024 chars, includes trigger phrasesSpec + discovery
ProcedureMust contain numbered steps, ## Procedure/## Steps, or checkboxesEnsures actionable content
Min content200+ characters in body (after frontmatter)Rejects trivial stubs
Licenselicense: MITclaude-mods convention
Metadatametadata.author: claude-modsclaude-mods convention
No non-standard top-level keysOnly name, description, license, compatibility, allowed-tools, metadataAgent Skills spec

If any gate fails, explain which one and help the user fix it.

Step 5: Create the Skill

Write the skill to the project's skill directory:

.claude/skills/<skill-name>/
  SKILL.md
  scripts/.gitkeep
  references/.gitkeep
  assets/.gitkeep

SKILL.md frontmatter template (Agent Skills spec compliant):

---
name: <kebab-case-name>
description: "<what it does>. Triggers on: <keyword1>, <keyword2>, <keyword3>."
license: MIT
allowed-tools: "<space-delimited tool list>"
metadata:
  author: claude-mods
---

Body structure:

# <Skill Title>

<1-2 sentence overview>

## When to Use

- <trigger condition 1>
- <trigger condition 2>

## Procedure

1. <Step one>
2. <Step two>
3. <Step three>
...

## Notes

<Edge cases, caveats, or tips>

Step 6: Verify

After creating, verify the skill:

  1. Check the file was written correctly:
    head -20 .claude/skills/<name>/SKILL.md
    
  2. Validate frontmatter has only spec-compliant top-level keys
  3. Confirm the procedure section exists and has steps
  4. Tell the user the skill is ready and how to invoke it

Pending Log

Because systemMessage output from the Stop hook is delivered to Claude (not directly to the user), suggestions often die silently when the user's next prompt doesn't invite them to be mentioned. To solve this, the hook also appends a line to ~/.claude/auto-skill/pending.log each time it fires:

2026-04-24T19:28:03+10:00|9dc8576c|/x/forge/axiom|12|5|28|Write(4) Edit(3) Bash(3)

Fields (pipe-delimited):

#FieldExample
1ISO8601 timestamp2026-04-24T19:28:03+10:00
2Short session ID9dc8576c
3CWD when suggestion fired/x/forge/axiom
4Mutating op count12
5Unique tool type count5
6Total tool calls28
7Top-6 tool histogramWrite(4) Edit(3) Bash(3)

/sync reads this log at session start and surfaces any entries from the last 72 hours under a "Skill Suggestions" section — the one place the user will reliably see them.

Viewing and clearing

  • auto-skill pending — cat ~/.claude/auto-skill/pending.log (or show "no pending suggestions" if absent/empty)
  • auto-skill clear — truncate after confirming with the user

Per-Project Disable

touch .claude/auto-skill.disable    # Disable Stop hook suggestions
rm .claude/auto-skill.disable       # Re-enable

The skill itself can always be invoked manually regardless of this setting.

Hook Setup

Auto-skill uses two hooks for automatic suggestions. These are installed globally:

~/.claude/auto-skill/
  track-tools.sh     # PostToolUse: counts tool calls per session
  evaluate.sh        # Stop: suggests skill creation if complex enough

Both hooks fail silently - they will never produce error output or block Claude.

Hook Configuration

Add to ~/.claude/settings.json (merge with existing hooks):

{
  "hooks": {
    "PostToolUse": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "bash \"$HOME/.claude/auto-skill/track-tools.sh\"",
        "timeout": 2
      }]
    }],
    "Stop": [{
      "hooks": [{
        "type": "command",
        "command": "bash \"$HOME/.claude/auto-skill/evaluate.sh\"",
        "timeout": 5
      }]
    }]
  }
}

Suggestion Gates

The Stop hook only suggests skill creation when ALL of these pass:

GateThresholdRationale
Mutating ops8+High bar reduces noise from routine edits
Tool diversity4+ distinct typesWrite+Edit+Bash+Agent = workflow; Write*20 = repetitive
No non-harness skill loadedSkill tool absent OR only harness skillsIf following a domain skill, work isn't novel. Harness skills (sync, save, introspect, auto-skill, setperms, tool-discovery) are whitelisted — they're bootstrap/meta, not recipes.
Per-sessionOnce per sessionNever nags on resume/continue
Not disabledNo .disable fileGlobal or per-project toggle

Read-only tools (Read, Glob, Grep, LS, Task*) are excluded from counts.

Design Decisions

  • Stop hook, not in-loop: Claude Code doesn't expose the agent loop. The Stop hook fires while context is still in memory, which is the best we can get.
  • systemMessage output: The Stop hook outputs JSON that Claude Code displays to the user. Non-blocking, dismissible.
  • Diversity over volume: Tool type count matters more than raw call count. A 20-file rename isn't a skill; a workflow using Write+Edit+Bash+Agent probably is.
  • Per-session cooldown: Uses a temp file keyed by session ID. No harsh time-based cooldown - each new session gets a fresh chance.
  • 500-line cap on tracking: Prevents runaway sessions from filling /tmp.
  • Silent failures: Both hooks wrap everything in 2>/dev/null and always exit 0.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Primary accessibility skill for VS Code. REQUIRED for new feature and contribution work, and also applies to updates of existing UI. Covers accessibility help dialogs, accessible views, verbosity settings, signals, ARIA announcements, keyboard navigation, and ARIA labels/roles.

日本語の概要は準備中です。原文の説明を表示しています。

jcasnellie69/homelab-config22026年10月12日 更新

Use this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like "map this codebase", "document this architecture", "onboard me to this repo", or "create codebase docs". Do not trigger for routine feature implementation, bug fixes, or narrow code edits unless the user asks for repository-level discovery.

日本語の概要は準備中です。原文の説明を表示しています。

jcasnellie69/homelab-config22026年10月12日 更新

Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.

日本語の概要は準備中です。原文の説明を表示しています。

jcasnellie69/homelab-config22026年10月12日 更新

Add educational comments to the file specified, or prompt asking for file to comment if one is not provided.

日本語の概要は準備中です。原文の説明を表示しています。

jcasnellie69/homelab-config22026年10月12日 更新

Use when adding, modifying, or reviewing VS Code configuration policies. Covers the full policy lifecycle from registration to export to platform-specific artifacts. Run on ANY change that adds a `policy:` field to a configuration property.

日本語の概要は準備中です。原文の説明を表示しています。

jcasnellie69/homelab-config22026年10月12日 更新

Patterns and techniques for adding governance, safety, and trust controls to AI agent systems. Use this skill when: - Building AI agents that call external tools (APIs, databases, file systems) - Implementing policy-based access controls for agent tool usage - Adding semantic intent classification to detect dangerous prompts - Creating trust scoring systems for multi-agent workflows - Building audit trails for agent actions and decisions - Enforcing rate limits, content filters, or tool restrictions on agents - Working with any agent framework (PydanticAI, CrewAI, OpenAI Agents, LangChain, AutoGen)

日本語の概要は準備中です。原文の説明を表示しています。

jcasnellie69/homelab-config22026年10月12日 更新

jcasnellie69 のスキルをすべて見る

このスキルの問題を報告する