Agent skill
capture-skill
Capture learnings, patterns, or workflows from the current conversation into a new or existing skill. Use when the user wants to save what was learned, discovered, or built during a conversation as a reusable skill for future sessions.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/03-capture-skill
SKILL.md
Capture Skill from Conversation
This skill helps you extract knowledge, patterns, and workflows from the current conversation and persist them as a reusable skill.
When to Use
- The user says "capture this as a skill" or "save this for next time"
- A useful workflow, pattern, or piece of domain knowledge emerged during the conversation
- The user wants to update an existing skill with new learnings
- The conversation uncovered non-obvious steps, gotchas, or best practices worth preserving
Capture Process
Phase 1: Identify What to Capture
Review the conversation for:
- Workflows: Multi-step processes that were figured out through trial and error
- Domain knowledge: Non-obvious facts, configurations, or constraints discovered
- Gotchas and fixes: Problems encountered and their solutions
- Patterns: Code patterns, command sequences, or templates that worked well
- Decision rationale: Why certain approaches were chosen over alternatives
CRITICAL: Double-Check Context
Before assuming the user wants to edit an existing skill mentioned in the prompt (e.g., @[.codex/skills/03-capture-skill]), clarify if they actually want to capture the process you just performed using that skill as a new skill.
- Example: "You mentioned the capture-skill directory. Do you want to edit the capture-skill itself, or capture the custom process we just did as a new, separate skill?"
Summarize what you plan to capture and confirm with the user before proceeding.
Phase 2: Decide Destination
If the user already specified a skill or the destination is obvious from context, just proceed. However, if there's any ambiguity (e.g., they mention an existing skill but the conversation was about a new process), use the AskQuestion tool (or ask conversationally) to clarify:
-
New or existing skill?
- If existing: Which skill to update? (list relevant skills from
.codex/skills/and.agent/workflows/) - If new: What should it be named?
- Warning: Don't overwrite core system skills unless explicitly told to.
- If existing: Which skill to update? (list relevant skills from
-
Storage location (for new skills):
- Project (
.codex/skills/) — shared with the repository. - Sync required: If creating/updating a skill in
.codex/skills/, ensure it is also mirrored to.agent/workflows/using theskills_to_workflowsprotocol.
- Project (
Phase 3: Draft the Skill Content
When capturing into a new skill:
- Choose a descriptive name (lowercase, hyphens, max 64 chars)
- Write a specific description including WHAT and WHEN (third person)
- Distill the conversation into concise, actionable instructions
- Include concrete examples drawn from the conversation
- Add any utility scripts or commands that were used
When updating an existing skill:
- Read the existing SKILL.md
- Identify where new learnings fit (new section, updated steps, additional examples)
- Integrate without duplicating existing content
- Preserve the existing structure and voice
Phase 4: Distillation Guidelines
The goal is to transform a messy conversation into clean, reusable instructions.
Do:
- Extract the final working approach, not the failed attempts (unless gotchas are instructive)
- Generalize from the specific case discussed (replace hardcoded values with placeholders)
- Include the "why" behind non-obvious steps
- Add context the agent wouldn't know without this conversation
- Keep it under 500 lines
Don't:
- Include conversation artifacts ("as we discussed", "you mentioned")
- Repeat information the agent already knows
- Include overly specific details that won't transfer to other situations
- Add verbose explanations where a code example suffices
Phase 5: Write and Verify
- Create/update the skill file(s)
- Verify the SKILL.md is under 500 lines
- Check that the description is specific and includes trigger terms
- Confirm with the user that the captured content is accurate
Example: Capturing a Debugging Workflow
If a conversation involved debugging a tricky deployment issue, the captured skill might look like:
---
name: debug-k8s-deployments
description: Debug Kubernetes deployment failures including CrashLoopBackOff, image pull errors, and resource limits. Use when pods are failing to start or deployments are stuck.
---
# Debug K8s Deployments
## Diagnostic Steps
1. Check pod status: `kubectl get pods -n <namespace> | grep -v Running`
2. Get events: `kubectl describe pod <pod> -n <namespace>`
3. Check logs: `kubectl logs <pod> -n <namespace> --previous`
## Common Issues
### CrashLoopBackOff
- Check if the entrypoint command exists in the container
- Verify environment variables are set (especially secrets)
- Look for OOMKilled in `describe` output → increase memory limits
### ImagePullBackOff
- Verify image tag exists: `docker manifest inspect <image>`
- Check imagePullSecrets are configured for private registries
Note how this captures the diagnostic sequence and common solutions without any conversation artifacts.
Handling Edge Cases
Conversation had multiple topics: Ask which specific learning to capture, or suggest creating separate skills for distinct topics.
Learning is too small for a skill: Suggest creating a Cursor rule (.cursor/rules/) instead, which is better suited for single-line or short guidelines.
Existing skill needs major rewrite: Confirm with the user whether to restructure the existing skill or create a new one that supersedes it.
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?