Agent Skills › ZhanlinCui/Agent-Skills-Hunter

ZhanlinCui/Agent-Skills-Hunter

GitHub

用于并行处理多个相互独立的任务。当存在3个以上不同根因的失败或独立子系统问题时,为每个问题域分派专用Agent并发工作,以节省时间并提高效率。

51 skills 166

Install All Skills

npx skills add ZhanlinCui/Agent-Skills-Hunter --all -g -y
More Options

List skills in collection

npx skills add ZhanlinCui/Agent-Skills-Hunter --list

Skills in Collection (51)

用于并行处理多个相互独立的任务。当存在3个以上不同根因的失败或独立子系统问题时,为每个问题域分派专用Agent并发工作,以节省时间并提高效率。
多个测试文件因不同根因失败 多个独立子系统出现故障 任务间无共享状态或依赖关系
agent/dispatching-parallel-agents/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill dispatching-parallel-agents -g -y
SKILL.md
Frontmatter
{
    "name": "dispatching-parallel-agents",
    "description": "Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies"
}

Dispatching Parallel Agents

Overview

When you have multiple unrelated failures (different test files, different subsystems, different bugs), investigating them sequentially wastes time. Each investigation is independent and can happen in parallel.

Core principle: Dispatch one agent per independent problem domain. Let them work concurrently.

When to Use

digraph when_to_use {
    "Multiple failures?" [shape=diamond];
    "Are they independent?" [shape=diamond];
    "Single agent investigates all" [shape=box];
    "One agent per problem domain" [shape=box];
    "Can they work in parallel?" [shape=diamond];
    "Sequential agents" [shape=box];
    "Parallel dispatch" [shape=box];

    "Multiple failures?" -> "Are they independent?" [label="yes"];
    "Are they independent?" -> "Single agent investigates all" [label="no - related"];
    "Are they independent?" -> "Can they work in parallel?" [label="yes"];
    "Can they work in parallel?" -> "Parallel dispatch" [label="yes"];
    "Can they work in parallel?" -> "Sequential agents" [label="no - shared state"];
}

Use when:

  • 3+ test files failing with different root causes
  • Multiple subsystems broken independently
  • Each problem can be understood without context from others
  • No shared state between investigations

Don't use when:

  • Failures are related (fix one might fix others)
  • Need to understand full system state
  • Agents would interfere with each other

The Pattern

1. Identify Independent Domains

Group failures by what's broken:

  • File A tests: Tool approval flow
  • File B tests: Batch completion behavior
  • File C tests: Abort functionality

Each domain is independent - fixing tool approval doesn't affect abort tests.

2. Create Focused Agent Tasks

Each agent gets:

  • Specific scope: One test file or subsystem
  • Clear goal: Make these tests pass
  • Constraints: Don't change other code
  • Expected output: Summary of what you found and fixed

3. Dispatch in Parallel

// In Claude Code / AI environment
Task("Fix agent-tool-abort.test.ts failures")
Task("Fix batch-completion-behavior.test.ts failures")
Task("Fix tool-approval-race-conditions.test.ts failures")
// All three run concurrently

4. Review and Integrate

When agents return:

  • Read each summary
  • Verify fixes don't conflict
  • Run full test suite
  • Integrate all changes

Agent Prompt Structure

Good agent prompts are:

  1. Focused - One clear problem domain
  2. Self-contained - All context needed to understand the problem
  3. Specific about output - What should the agent return?
Fix the 3 failing tests in src/agents/agent-tool-abort.test.ts:

1. "should abort tool with partial output capture" - expects 'interrupted at' in message
2. "should handle mixed completed and aborted tools" - fast tool aborted instead of completed
3. "should properly track pendingToolCount" - expects 3 results but gets 0

These are timing/race condition issues. Your task:

1. Read the test file and understand what each test verifies
2. Identify root cause - timing issues or actual bugs?
3. Fix by:
   - Replacing arbitrary timeouts with event-based waiting
   - Fixing bugs in abort implementation if found
   - Adjusting test expectations if testing changed behavior

Do NOT just increase timeouts - find the real issue.

Return: Summary of what you found and what you fixed.

Common Mistakes

❌ Too broad: "Fix all the tests" - agent gets lost ✅ Specific: "Fix agent-tool-abort.test.ts" - focused scope

❌ No context: "Fix the race condition" - agent doesn't know where ✅ Context: Paste the error messages and test names

❌ No constraints: Agent might refactor everything ✅ Constraints: "Do NOT change production code" or "Fix tests only"

❌ Vague output: "Fix it" - you don't know what changed ✅ Specific: "Return summary of root cause and changes"

When NOT to Use

Related failures: Fixing one might fix others - investigate together first Need full context: Understanding requires seeing entire system Exploratory debugging: You don't know what's broken yet Shared state: Agents would interfere (editing same files, using same resources)

Real Example from Session

Scenario: 6 test failures across 3 files after major refactoring

Failures:

  • agent-tool-abort.test.ts: 3 failures (timing issues)
  • batch-completion-behavior.test.ts: 2 failures (tools not executing)
  • tool-approval-race-conditions.test.ts: 1 failure (execution count = 0)

Decision: Independent domains - abort logic separate from batch completion separate from race conditions

Dispatch:

Agent 1 → Fix agent-tool-abort.test.ts
Agent 2 → Fix batch-completion-behavior.test.ts
Agent 3 → Fix tool-approval-race-conditions.test.ts

Results:

  • Agent 1: Replaced timeouts with event-based waiting
  • Agent 2: Fixed event structure bug (threadId in wrong place)
  • Agent 3: Added wait for async tool execution to complete

Integration: All fixes independent, no conflicts, full suite green

Time saved: 3 problems solved in parallel vs sequentially

Key Benefits

  1. Parallelization - Multiple investigations happen simultaneously
  2. Focus - Each agent has narrow scope, less context to track
  3. Independence - Agents don't interfere with each other
  4. Speed - 3 problems solved in time of 1

Verification

After agents return:

  1. Review each summary - Understand what changed
  2. Check for conflicts - Did agents edit same code?
  3. Run full suite - Verify all fixes work together
  4. Spot check - Agents can make systematic errors

Real-World Impact

From debugging session (2025-10-03):

  • 6 failures across 3 files
  • 3 agents dispatched in parallel
  • All investigations completed concurrently
  • All fixes integrated successfully
  • Zero conflicts between agent changes
用于在当前会话中执行包含独立任务的实施计划。通过为每个任务分派全新的子代理,并在完成后依次进行规范合规性和代码质量的两阶段审查,实现高质量、快速迭代的开发流程。
拥有明确的实施计划且任务相对独立 需要在当前会话内完成开发以避免上下文切换
agent/subagent-driven-development/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill subagent-driven-development -g -y
SKILL.md
Frontmatter
{
    "name": "subagent-driven-development",
    "description": "Use when executing implementation plans with independent tasks in the current session"
}

Subagent-Driven Development

Execute plan by dispatching fresh subagent per task, with two-stage review after each: spec compliance review first, then code quality review.

Core principle: Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration

When to Use

digraph when_to_use {
    "Have implementation plan?" [shape=diamond];
    "Tasks mostly independent?" [shape=diamond];
    "Stay in this session?" [shape=diamond];
    "subagent-driven-development" [shape=box];
    "executing-plans" [shape=box];
    "Manual execution or brainstorm first" [shape=box];

    "Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
    "Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
    "Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
    "Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
    "Stay in this session?" -> "subagent-driven-development" [label="yes"];
    "Stay in this session?" -> "executing-plans" [label="no - parallel session"];
}

vs. Executing Plans (parallel session):

  • Same session (no context switch)
  • Fresh subagent per task (no context pollution)
  • Two-stage review after each task: spec compliance first, then code quality
  • Faster iteration (no human-in-loop between tasks)

The Process

digraph process {
    rankdir=TB;

    subgraph cluster_per_task {
        label="Per Task";
        "Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
        "Implementer subagent asks questions?" [shape=diamond];
        "Answer questions, provide context" [shape=box];
        "Implementer subagent implements, tests, commits, self-reviews" [shape=box];
        "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [shape=box];
        "Spec reviewer subagent confirms code matches spec?" [shape=diamond];
        "Implementer subagent fixes spec gaps" [shape=box];
        "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [shape=box];
        "Code quality reviewer subagent approves?" [shape=diamond];
        "Implementer subagent fixes quality issues" [shape=box];
        "Mark task complete in TodoWrite" [shape=box];
    }

    "Read plan, extract all tasks with full text, note context, create TodoWrite" [shape=box];
    "More tasks remain?" [shape=diamond];
    "Dispatch final code reviewer subagent for entire implementation" [shape=box];
    "Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];

    "Read plan, extract all tasks with full text, note context, create TodoWrite" -> "Dispatch implementer subagent (./implementer-prompt.md)";
    "Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
    "Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
    "Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";
    "Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
    "Implementer subagent implements, tests, commits, self-reviews" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)";
    "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" -> "Spec reviewer subagent confirms code matches spec?";
    "Spec reviewer subagent confirms code matches spec?" -> "Implementer subagent fixes spec gaps" [label="no"];
    "Implementer subagent fixes spec gaps" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [label="re-review"];
    "Spec reviewer subagent confirms code matches spec?" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="yes"];
    "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" -> "Code quality reviewer subagent approves?";
    "Code quality reviewer subagent approves?" -> "Implementer subagent fixes quality issues" [label="no"];
    "Implementer subagent fixes quality issues" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="re-review"];
    "Code quality reviewer subagent approves?" -> "Mark task complete in TodoWrite" [label="yes"];
    "Mark task complete in TodoWrite" -> "More tasks remain?";
    "More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
    "More tasks remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"];
    "Dispatch final code reviewer subagent for entire implementation" -> "Use superpowers:finishing-a-development-branch";
}

Prompt Templates

  • ./implementer-prompt.md - Dispatch implementer subagent
  • ./spec-reviewer-prompt.md - Dispatch spec compliance reviewer subagent
  • ./code-quality-reviewer-prompt.md - Dispatch code quality reviewer subagent

Example Workflow

You: I'm using Subagent-Driven Development to execute this plan.

[Read plan file once: docs/plans/feature-plan.md]
[Extract all 5 tasks with full text and context]
[Create TodoWrite with all tasks]

Task 1: Hook installation script

[Get Task 1 text and context (already extracted)]
[Dispatch implementation subagent with full task text + context]

Implementer: "Before I begin - should the hook be installed at user or system level?"

You: "User level (~/.config/superpowers/hooks/)"

Implementer: "Got it. Implementing now..."
[Later] Implementer:
  - Implemented install-hook command
  - Added tests, 5/5 passing
  - Self-review: Found I missed --force flag, added it
  - Committed

[Dispatch spec compliance reviewer]
Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra

[Get git SHAs, dispatch code quality reviewer]
Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.

[Mark Task 1 complete]

Task 2: Recovery modes

[Get Task 2 text and context (already extracted)]
[Dispatch implementation subagent with full task text + context]

Implementer: [No questions, proceeds]
Implementer:
  - Added verify/repair modes
  - 8/8 tests passing
  - Self-review: All good
  - Committed

[Dispatch spec compliance reviewer]
Spec reviewer: ❌ Issues:
  - Missing: Progress reporting (spec says "report every 100 items")
  - Extra: Added --json flag (not requested)

[Implementer fixes issues]
Implementer: Removed --json flag, added progress reporting

[Spec reviewer reviews again]
Spec reviewer: ✅ Spec compliant now

[Dispatch code quality reviewer]
Code reviewer: Strengths: Solid. Issues (Important): Magic number (100)

[Implementer fixes]
Implementer: Extracted PROGRESS_INTERVAL constant

[Code reviewer reviews again]
Code reviewer: ✅ Approved

[Mark Task 2 complete]

...

[After all tasks]
[Dispatch final code-reviewer]
Final reviewer: All requirements met, ready to merge

Done!

Advantages

vs. Manual execution:

  • Subagents follow TDD naturally
  • Fresh context per task (no confusion)
  • Parallel-safe (subagents don't interfere)
  • Subagent can ask questions (before AND during work)

vs. Executing Plans:

  • Same session (no handoff)
  • Continuous progress (no waiting)
  • Review checkpoints automatic

Efficiency gains:

  • No file reading overhead (controller provides full text)
  • Controller curates exactly what context is needed
  • Subagent gets complete information upfront
  • Questions surfaced before work begins (not after)

Quality gates:

  • Self-review catches issues before handoff
  • Two-stage review: spec compliance, then code quality
  • Review loops ensure fixes actually work
  • Spec compliance prevents over/under-building
  • Code quality ensures implementation is well-built

Cost:

  • More subagent invocations (implementer + 2 reviewers per task)
  • Controller does more prep work (extracting all tasks upfront)
  • Review loops add iterations
  • But catches issues early (cheaper than debugging later)

Red Flags

Never:

  • Skip reviews (spec compliance OR code quality)
  • Proceed with unfixed issues
  • Dispatch multiple implementation subagents in parallel (conflicts)
  • Make subagent read plan file (provide full text instead)
  • Skip scene-setting context (subagent needs to understand where task fits)
  • Ignore subagent questions (answer before letting them proceed)
  • Accept "close enough" on spec compliance (spec reviewer found issues = not done)
  • Skip review loops (reviewer found issues = implementer fixes = review again)
  • Let implementer self-review replace actual review (both are needed)
  • Start code quality review before spec compliance is ✅ (wrong order)
  • Move to next task while either review has open issues

If subagent asks questions:

  • Answer clearly and completely
  • Provide additional context if needed
  • Don't rush them into implementation

If reviewer finds issues:

  • Implementer (same subagent) fixes them
  • Reviewer reviews again
  • Repeat until approved
  • Don't skip the re-review

If subagent fails task:

  • Dispatch fix subagent with specific instructions
  • Don't try to fix manually (context pollution)

Integration

Required workflow skills:

  • superpowers:writing-plans - Creates the plan this skill executes
  • superpowers:requesting-code-review - Code review template for reviewer subagents
  • superpowers:finishing-a-development-branch - Complete development after all tasks

Subagents should use:

  • superpowers:test-driven-development - Subagents follow TDD for each task

Alternative workflow:

  • superpowers:executing-plans - Use for parallel session instead of same-session execution
强制要求在回复或行动前检查并调用相关技能。即使概率低至1%也必须触发,禁止自行判断跳过。需先声明使用目的,按流程执行技能内容,防止因随意行动导致效率低下。
收到用户消息时 需要澄清问题时 探索代码库前 获取信息前
agent/using-superpowers/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill using-superpowers -g -y
SKILL.md
Frontmatter
{
    "name": "using-superpowers",
    "description": "Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions"
}
If you think there is even a 1% chance a skill might apply to what you are doing, you ABSOLUTELY MUST invoke the skill.

IF A SKILL APPLIES TO YOUR TASK, YOU DO NOT HAVE A CHOICE. YOU MUST USE IT.

This is not negotiable. This is not optional. You cannot rationalize your way out of this. </EXTREMELY-IMPORTANT>

How to Access Skills

In Claude Code: Use the Skill tool. When you invoke a skill, its content is loaded and presented to you—follow it directly. Never use the Read tool on skill files.

In other environments: Check your platform's documentation for how skills are loaded.

Using Skills

The Rule

Invoke relevant or requested skills BEFORE any response or action. Even a 1% chance a skill might apply means that you should invoke the skill to check. If an invoked skill turns out to be wrong for the situation, you don't need to use it.

digraph skill_flow {
    "User message received" [shape=doublecircle];
    "Might any skill apply?" [shape=diamond];
    "Invoke Skill tool" [shape=box];
    "Announce: 'Using [skill] to [purpose]'" [shape=box];
    "Has checklist?" [shape=diamond];
    "Create TodoWrite todo per item" [shape=box];
    "Follow skill exactly" [shape=box];
    "Respond (including clarifications)" [shape=doublecircle];

    "User message received" -> "Might any skill apply?";
    "Might any skill apply?" -> "Invoke Skill tool" [label="yes, even 1%"];
    "Might any skill apply?" -> "Respond (including clarifications)" [label="definitely not"];
    "Invoke Skill tool" -> "Announce: 'Using [skill] to [purpose]'";
    "Announce: 'Using [skill] to [purpose]'" -> "Has checklist?";
    "Has checklist?" -> "Create TodoWrite todo per item" [label="yes"];
    "Has checklist?" -> "Follow skill exactly" [label="no"];
    "Create TodoWrite todo per item" -> "Follow skill exactly";
}

Red Flags

These thoughts mean STOP—you're rationalizing:

Thought Reality
"This is just a simple question" Questions are tasks. Check for skills.
"I need more context first" Skill check comes BEFORE clarifying questions.
"Let me explore the codebase first" Skills tell you HOW to explore. Check first.
"I can check git/files quickly" Files lack conversation context. Check for skills.
"Let me gather information first" Skills tell you HOW to gather information.
"This doesn't need a formal skill" If a skill exists, use it.
"I remember this skill" Skills evolve. Read current version.
"This doesn't count as a task" Action = task. Check for skills.
"The skill is overkill" Simple things become complex. Use it.
"I'll just do this one thing first" Check BEFORE doing anything.
"This feels productive" Undisciplined action wastes time. Skills prevent this.
"I know what that means" Knowing the concept ≠ using the skill. Invoke it.

Skill Priority

When multiple skills could apply, use this order:

  1. Process skills first (brainstorming, debugging) - these determine HOW to approach the task
  2. Implementation skills second (frontend-design, mcp-builder) - these guide execution

"Let's build X" → brainstorming first, then implementation skills. "Fix this bug" → debugging first, then domain-specific skills.

Skill Types

Rigid (TDD, debugging): Follow exactly. Don't adapt away discipline.

Flexible (patterns): Adapt principles to context.

The skill itself tells you which.

User Instructions

Instructions say WHAT, not HOW. "Add X" or "Fix Y" doesn't mean skip workflows.

将测试驱动开发应用于技能文档编写。通过先运行基线测试观察失败,再编写文档使测试通过,最后重构消除漏洞,确保技能有效解决智能体行为问题。
创建新技能 编辑现有技能 部署前验证技能有效性
agent/writing-skills/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill writing-skills -g -y
SKILL.md
Frontmatter
{
    "name": "writing-skills",
    "description": "Use when creating new skills, editing existing skills, or verifying skills work before deployment"
}

Writing Skills

Overview

Writing skills IS Test-Driven Development applied to process documentation.

Personal skills live in agent-specific directories (~/.claude/skills for Claude Code, ~/.codex/skills for Codex)

You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes).

Core principle: If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing.

REQUIRED BACKGROUND: You MUST understand superpowers:test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.

Official guidance: For Anthropic's official skill authoring best practices, see anthropic-best-practices.md. This document provides additional patterns and guidelines that complement the TDD-focused approach in this skill.

What is a Skill?

A skill is a reference guide for proven techniques, patterns, or tools. Skills help future Claude instances find and apply effective approaches.

Skills are: Reusable techniques, patterns, tools, reference guides

Skills are NOT: Narratives about how you solved a problem once

TDD Mapping for Skills

TDD Concept Skill Creation
Test case Pressure scenario with subagent
Production code Skill document (SKILL.md)
Test fails (RED) Agent violates rule without skill (baseline)
Test passes (GREEN) Agent complies with skill present
Refactor Close loopholes while maintaining compliance
Write test first Run baseline scenario BEFORE writing skill
Watch it fail Document exact rationalizations agent uses
Minimal code Write skill addressing those specific violations
Watch it pass Verify agent now complies
Refactor cycle Find new rationalizations → plug → re-verify

The entire skill creation process follows RED-GREEN-REFACTOR.

When to Create a Skill

Create when:

  • Technique wasn't intuitively obvious to you
  • You'd reference this again across projects
  • Pattern applies broadly (not project-specific)
  • Others would benefit

Don't create for:

  • One-off solutions
  • Standard practices well-documented elsewhere
  • Project-specific conventions (put in CLAUDE.md)
  • Mechanical constraints (if it's enforceable with regex/validation, automate it—save documentation for judgment calls)

Skill Types

Technique

Concrete method with steps to follow (condition-based-waiting, root-cause-tracing)

Pattern

Way of thinking about problems (flatten-with-flags, test-invariants)

Reference

API docs, syntax guides, tool documentation (office docs)

Directory Structure

skills/
  skill-name/
    SKILL.md              # Main reference (required)
    supporting-file.*     # Only if needed

Flat namespace - all skills in one searchable namespace

Separate files for:

  1. Heavy reference (100+ lines) - API docs, comprehensive syntax
  2. Reusable tools - Scripts, utilities, templates

Keep inline:

  • Principles and concepts
  • Code patterns (< 50 lines)
  • Everything else

SKILL.md Structure

Frontmatter (YAML):

  • Only two fields supported: name and description
  • Max 1024 characters total
  • name: Use letters, numbers, and hyphens only (no parentheses, special chars)
  • description: Third-person, describes ONLY when to use (NOT what it does)
    • Start with "Use when..." to focus on triggering conditions
    • Include specific symptoms, situations, and contexts
    • NEVER summarize the skill's process or workflow (see CSO section for why)
    • Keep under 500 characters if possible
---
name: Skill-Name-With-Hyphens
description: Use when [specific triggering conditions and symptoms]
---

# Skill Name

## Overview
What is this? Core principle in 1-2 sentences.

## When to Use
[Small inline flowchart IF decision non-obvious]

Bullet list with SYMPTOMS and use cases
When NOT to use

## Core Pattern (for techniques/patterns)
Before/after code comparison

## Quick Reference
Table or bullets for scanning common operations

## Implementation
Inline code for simple patterns
Link to file for heavy reference or reusable tools

## Common Mistakes
What goes wrong + fixes

## Real-World Impact (optional)
Concrete results

Claude Search Optimization (CSO)

Critical for discovery: Future Claude needs to FIND your skill

1. Rich Description Field

Purpose: Claude reads description to decide which skills to load for a given task. Make it answer: "Should I read this skill right now?"

Format: Start with "Use when..." to focus on triggering conditions

CRITICAL: Description = When to Use, NOT What the Skill Does

The description should ONLY describe triggering conditions. Do NOT summarize the skill's process or workflow in the description.

Why this matters: Testing revealed that when a description summarizes the skill's workflow, Claude may follow the description instead of reading the full skill content. A description saying "code review between tasks" caused Claude to do ONE review, even though the skill's flowchart clearly showed TWO reviews (spec compliance then code quality).

When the description was changed to just "Use when executing implementation plans with independent tasks" (no workflow summary), Claude correctly read the flowchart and followed the two-stage review process.

The trap: Descriptions that summarize workflow create a shortcut Claude will take. The skill body becomes documentation Claude skips.

# ❌ BAD: Summarizes workflow - Claude may follow this instead of reading skill
description: Use when executing plans - dispatches subagent per task with code review between tasks

# ❌ BAD: Too much process detail
description: Use for TDD - write test first, watch it fail, write minimal code, refactor

# ✅ GOOD: Just triggering conditions, no workflow summary
description: Use when executing implementation plans with independent tasks in the current session

# ✅ GOOD: Triggering conditions only
description: Use when implementing any feature or bugfix, before writing implementation code

Content:

  • Use concrete triggers, symptoms, and situations that signal this skill applies
  • Describe the problem (race conditions, inconsistent behavior) not language-specific symptoms (setTimeout, sleep)
  • Keep triggers technology-agnostic unless the skill itself is technology-specific
  • If skill is technology-specific, make that explicit in the trigger
  • Write in third person (injected into system prompt)
  • NEVER summarize the skill's process or workflow
# ❌ BAD: Too abstract, vague, doesn't include when to use
description: For async testing

# ❌ BAD: First person
description: I can help you with async tests when they're flaky

# ❌ BAD: Mentions technology but skill isn't specific to it
description: Use when tests use setTimeout/sleep and are flaky

# ✅ GOOD: Starts with "Use when", describes problem, no workflow
description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently

# ✅ GOOD: Technology-specific skill with explicit trigger
description: Use when using React Router and handling authentication redirects

2. Keyword Coverage

Use words Claude would search for:

  • Error messages: "Hook timed out", "ENOTEMPTY", "race condition"
  • Symptoms: "flaky", "hanging", "zombie", "pollution"
  • Synonyms: "timeout/hang/freeze", "cleanup/teardown/afterEach"
  • Tools: Actual commands, library names, file types

3. Descriptive Naming

Use active voice, verb-first:

  • creating-skills not skill-creation
  • condition-based-waiting not async-test-helpers

4. Token Efficiency (Critical)

Problem: getting-started and frequently-referenced skills load into EVERY conversation. Every token counts.

Target word counts:

  • getting-started workflows: <150 words each
  • Frequently-loaded skills: <200 words total
  • Other skills: <500 words (still be concise)

Techniques:

Move details to tool help:

# ❌ BAD: Document all flags in SKILL.md
search-conversations supports --text, --both, --after DATE, --before DATE, --limit N

# ✅ GOOD: Reference --help
search-conversations supports multiple modes and filters. Run --help for details.

Use cross-references:

# ❌ BAD: Repeat workflow details
When searching, dispatch subagent with template...
[20 lines of repeated instructions]

# ✅ GOOD: Reference other skill
Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.

Compress examples:

# ❌ BAD: Verbose example (42 words)
your human partner: "How did we handle authentication errors in React Router before?"
You: I'll search past conversations for React Router authentication patterns.
[Dispatch subagent with search query: "React Router authentication error handling 401"]

# ✅ GOOD: Minimal example (20 words)
Partner: "How did we handle auth errors in React Router?"
You: Searching...
[Dispatch subagent → synthesis]

Eliminate redundancy:

  • Don't repeat what's in cross-referenced skills
  • Don't explain what's obvious from command
  • Don't include multiple examples of same pattern

Verification:

wc -w skills/path/SKILL.md
# getting-started workflows: aim for <150 each
# Other frequently-loaded: aim for <200 total

Name by what you DO or core insight:

  • condition-based-waiting > async-test-helpers
  • using-skills not skill-usage
  • flatten-with-flags > data-structure-refactoring
  • root-cause-tracing > debugging-techniques

Gerunds (-ing) work well for processes:

  • creating-skills, testing-skills, debugging-with-logs
  • Active, describes the action you're taking

4. Cross-Referencing Other Skills

When writing documentation that references other skills:

Use skill name only, with explicit requirement markers:

  • ✅ Good: **REQUIRED SUB-SKILL:** Use superpowers:test-driven-development
  • ✅ Good: **REQUIRED BACKGROUND:** You MUST understand superpowers:systematic-debugging
  • ❌ Bad: See skills/testing/test-driven-development (unclear if required)
  • ❌ Bad: @skills/testing/test-driven-development/SKILL.md (force-loads, burns context)

Why no @ links: @ syntax force-loads files immediately, consuming 200k+ context before you need them.

Flowchart Usage

digraph when_flowchart {
    "Need to show information?" [shape=diamond];
    "Decision where I might go wrong?" [shape=diamond];
    "Use markdown" [shape=box];
    "Small inline flowchart" [shape=box];

    "Need to show information?" -> "Decision where I might go wrong?" [label="yes"];
    "Decision where I might go wrong?" -> "Small inline flowchart" [label="yes"];
    "Decision where I might go wrong?" -> "Use markdown" [label="no"];
}

Use flowcharts ONLY for:

  • Non-obvious decision points
  • Process loops where you might stop too early
  • "When to use A vs B" decisions

Never use flowcharts for:

  • Reference material → Tables, lists
  • Code examples → Markdown blocks
  • Linear instructions → Numbered lists
  • Labels without semantic meaning (step1, helper2)

See @graphviz-conventions.dot for graphviz style rules.

Visualizing for your human partner: Use render-graphs.js in this directory to render a skill's flowcharts to SVG:

./render-graphs.js ../some-skill           # Each diagram separately
./render-graphs.js ../some-skill --combine # All diagrams in one SVG

Code Examples

One excellent example beats many mediocre ones

Choose most relevant language:

  • Testing techniques → TypeScript/JavaScript
  • System debugging → Shell/Python
  • Data processing → Python

Good example:

  • Complete and runnable
  • Well-commented explaining WHY
  • From real scenario
  • Shows pattern clearly
  • Ready to adapt (not generic template)

Don't:

  • Implement in 5+ languages
  • Create fill-in-the-blank templates
  • Write contrived examples

You're good at porting - one great example is enough.

File Organization

Self-Contained Skill

defense-in-depth/
  SKILL.md    # Everything inline

When: All content fits, no heavy reference needed

Skill with Reusable Tool

condition-based-waiting/
  SKILL.md    # Overview + patterns
  example.ts  # Working helpers to adapt

When: Tool is reusable code, not just narrative

Skill with Heavy Reference

pptx/
  SKILL.md       # Overview + workflows
  pptxgenjs.md   # 600 lines API reference
  ooxml.md       # 500 lines XML structure
  scripts/       # Executable tools

When: Reference material too large for inline

The Iron Law (Same as TDD)

NO SKILL WITHOUT A FAILING TEST FIRST

This applies to NEW skills AND EDITS to existing skills.

Write skill before testing? Delete it. Start over. Edit skill without testing? Same violation.

No exceptions:

  • Not for "simple additions"
  • Not for "just adding a section"
  • Not for "documentation updates"
  • Don't keep untested changes as "reference"
  • Don't "adapt" while running tests
  • Delete means delete

REQUIRED BACKGROUND: The superpowers:test-driven-development skill explains why this matters. Same principles apply to documentation.

Testing All Skill Types

Different skill types need different test approaches:

Discipline-Enforcing Skills (rules/requirements)

Examples: TDD, verification-before-completion, designing-before-coding

Test with:

  • Academic questions: Do they understand the rules?
  • Pressure scenarios: Do they comply under stress?
  • Multiple pressures combined: time + sunk cost + exhaustion
  • Identify rationalizations and add explicit counters

Success criteria: Agent follows rule under maximum pressure

Technique Skills (how-to guides)

Examples: condition-based-waiting, root-cause-tracing, defensive-programming

Test with:

  • Application scenarios: Can they apply the technique correctly?
  • Variation scenarios: Do they handle edge cases?
  • Missing information tests: Do instructions have gaps?

Success criteria: Agent successfully applies technique to new scenario

Pattern Skills (mental models)

Examples: reducing-complexity, information-hiding concepts

Test with:

  • Recognition scenarios: Do they recognize when pattern applies?
  • Application scenarios: Can they use the mental model?
  • Counter-examples: Do they know when NOT to apply?

Success criteria: Agent correctly identifies when/how to apply pattern

Reference Skills (documentation/APIs)

Examples: API documentation, command references, library guides

Test with:

  • Retrieval scenarios: Can they find the right information?
  • Application scenarios: Can they use what they found correctly?
  • Gap testing: Are common use cases covered?

Success criteria: Agent finds and correctly applies reference information

Common Rationalizations for Skipping Testing

Excuse Reality
"Skill is obviously clear" Clear to you ≠ clear to other agents. Test it.
"It's just a reference" References can have gaps, unclear sections. Test retrieval.
"Testing is overkill" Untested skills have issues. Always. 15 min testing saves hours.
"I'll test if problems emerge" Problems = agents can't use skill. Test BEFORE deploying.
"Too tedious to test" Testing is less tedious than debugging bad skill in production.
"I'm confident it's good" Overconfidence guarantees issues. Test anyway.
"Academic review is enough" Reading ≠ using. Test application scenarios.
"No time to test" Deploying untested skill wastes more time fixing it later.

All of these mean: Test before deploying. No exceptions.

Bulletproofing Skills Against Rationalization

Skills that enforce discipline (like TDD) need to resist rationalization. Agents are smart and will find loopholes when under pressure.

Psychology note: Understanding WHY persuasion techniques work helps you apply them systematically. See persuasion-principles.md for research foundation (Cialdini, 2021; Meincke et al., 2025) on authority, commitment, scarcity, social proof, and unity principles.

Close Every Loophole Explicitly

Don't just state the rule - forbid specific workarounds:

```markdown Write code before test? Delete it. ``` ```markdown Write code before test? Delete it. Start over.

No exceptions:

  • Don't keep it as "reference"
  • Don't "adapt" it while writing tests
  • Don't look at it
  • Delete means delete
</Good>

### Address "Spirit vs Letter" Arguments

Add foundational principle early:

```markdown
**Violating the letter of the rules is violating the spirit of the rules.**

This cuts off entire class of "I'm following the spirit" rationalizations.

Build Rationalization Table

Capture rationalizations from baseline testing (see Testing section below). Every excuse agents make goes in the table:

| Excuse | Reality |
|--------|---------|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after" | Tests passing immediately prove nothing. |
| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |

Create Red Flags List

Make it easy for agents to self-check when rationalizing:

## Red Flags - STOP and Start Over

- Code before test
- "I already manually tested it"
- "Tests after achieve the same purpose"
- "It's about spirit not ritual"
- "This is different because..."

**All of these mean: Delete code. Start over with TDD.**

Update CSO for Violation Symptoms

Add to description: symptoms of when you're ABOUT to violate the rule:

description: use when implementing any feature or bugfix, before writing implementation code

RED-GREEN-REFACTOR for Skills

Follow the TDD cycle:

RED: Write Failing Test (Baseline)

Run pressure scenario with subagent WITHOUT the skill. Document exact behavior:

  • What choices did they make?
  • What rationalizations did they use (verbatim)?
  • Which pressures triggered violations?

This is "watch the test fail" - you must see what agents naturally do before writing the skill.

GREEN: Write Minimal Skill

Write skill that addresses those specific rationalizations. Don't add extra content for hypothetical cases.

Run same scenarios WITH skill. Agent should now comply.

REFACTOR: Close Loopholes

Agent found new rationalization? Add explicit counter. Re-test until bulletproof.

Testing methodology: See @testing-skills-with-subagents.md for the complete testing methodology:

  • How to write pressure scenarios
  • Pressure types (time, sunk cost, authority, exhaustion)
  • Plugging holes systematically
  • Meta-testing techniques

Anti-Patterns

❌ Narrative Example

"In session 2025-10-03, we found empty projectDir caused..." Why bad: Too specific, not reusable

❌ Multi-Language Dilution

example-js.js, example-py.py, example-go.go Why bad: Mediocre quality, maintenance burden

❌ Code in Flowcharts

step1 [label="import fs"];
step2 [label="read file"];

Why bad: Can't copy-paste, hard to read

❌ Generic Labels

helper1, helper2, step3, pattern4 Why bad: Labels should have semantic meaning

STOP: Before Moving to Next Skill

After writing ANY skill, you MUST STOP and complete the deployment process.

Do NOT:

  • Create multiple skills in batch without testing each
  • Move to next skill before current one is verified
  • Skip testing because "batching is more efficient"

The deployment checklist below is MANDATORY for EACH skill.

Deploying untested skills = deploying untested code. It's a violation of quality standards.

Skill Creation Checklist (TDD Adapted)

IMPORTANT: Use TodoWrite to create todos for EACH checklist item below.

RED Phase - Write Failing Test:

  • Create pressure scenarios (3+ combined pressures for discipline skills)
  • Run scenarios WITHOUT skill - document baseline behavior verbatim
  • Identify patterns in rationalizations/failures

GREEN Phase - Write Minimal Skill:

  • Name uses only letters, numbers, hyphens (no parentheses/special chars)
  • YAML frontmatter with only name and description (max 1024 chars)
  • Description starts with "Use when..." and includes specific triggers/symptoms
  • Description written in third person
  • Keywords throughout for search (errors, symptoms, tools)
  • Clear overview with core principle
  • Address specific baseline failures identified in RED
  • Code inline OR link to separate file
  • One excellent example (not multi-language)
  • Run scenarios WITH skill - verify agents now comply

REFACTOR Phase - Close Loopholes:

  • Identify NEW rationalizations from testing
  • Add explicit counters (if discipline skill)
  • Build rationalization table from all test iterations
  • Create red flags list
  • Re-test until bulletproof

Quality Checks:

  • Small flowchart only if decision non-obvious
  • Quick reference table
  • Common mistakes section
  • No narrative storytelling
  • Supporting files only for tools or heavy reference

Deployment:

  • Commit skill to git and push to your fork (if configured)
  • Consider contributing back via PR (if broadly useful)

Discovery Workflow

How future Claude finds your skill:

  1. Encounters problem ("tests are flaky")
  2. Finds SKILL (description matches)
  3. Scans overview (is this relevant?)
  4. Reads patterns (quick reference table)
  5. Loads example (only when implementing)

Optimize for this flow - put searchable terms early and often.

The Bottom Line

Creating skills IS TDD for process documentation.

Same Iron Law: No skill without failing test first. Same cycle: RED (baseline) → GREEN (write skill) → REFACTOR (close loopholes). Same benefits: Better quality, fewer surprises, bulletproof results.

If you follow TDD for code, follow it for skills. It's the same discipline applied to documentation.

用于创建基于p5.js的算法艺术,通过生成随机性和交互参数探索实现。涵盖算法哲学构思与代码表达,强调计算美学、粒子系统和噪声场等元素,避免版权风险。
用户请求使用代码创作艺术 生成式艺术需求 算法艺术项目 流场或粒子系统开发
creative/algorithmic-art/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill algorithmic-art -g -y
SKILL.md
Frontmatter
{
    "name": "algorithmic-art",
    "license": "Complete terms in LICENSE.txt",
    "description": "Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations."
}

Algorithmic philosophies are computational aesthetic movements that are then expressed through code. Output .md files (philosophy), .html files (interactive viewer), and .js files (generative algorithms).

This happens in two steps:

  1. Algorithmic Philosophy Creation (.md file)
  2. Express by creating p5.js generative art (.html + .js files)

First, undertake this task:

ALGORITHMIC PHILOSOPHY CREATION

To begin, create an ALGORITHMIC PHILOSOPHY (not static images or templates) that will be interpreted through:

  • Computational processes, emergent behavior, mathematical beauty
  • Seeded randomness, noise fields, organic systems
  • Particles, flows, fields, forces
  • Parametric variation and controlled chaos

THE CRITICAL UNDERSTANDING

  • What is received: Some subtle input or instructions by the user to take into account, but use as a foundation; it should not constrain creative freedom.
  • What is created: An algorithmic philosophy/generative aesthetic movement.
  • What happens next: The same version receives the philosophy and EXPRESSES IT IN CODE - creating p5.js sketches that are 90% algorithmic generation, 10% essential parameters.

Consider this approach:

  • Write a manifesto for a generative art movement
  • The next phase involves writing the algorithm that brings it to life

The philosophy must emphasize: Algorithmic expression. Emergent behavior. Computational beauty. Seeded variation.

HOW TO GENERATE AN ALGORITHMIC PHILOSOPHY

Name the movement (1-2 words): "Organic Turbulence" / "Quantum Harmonics" / "Emergent Stillness"

Articulate the philosophy (4-6 paragraphs - concise but complete):

To capture the ALGORITHMIC essence, express how this philosophy manifests through:

  • Computational processes and mathematical relationships?
  • Noise functions and randomness patterns?
  • Particle behaviors and field dynamics?
  • Temporal evolution and system states?
  • Parametric variation and emergent complexity?

CRITICAL GUIDELINES:

  • Avoid redundancy: Each algorithmic aspect should be mentioned once. Avoid repeating concepts about noise theory, particle dynamics, or mathematical principles unless adding new depth.
  • Emphasize craftsmanship REPEATEDLY: The philosophy MUST stress multiple times that the final algorithm should appear as though it took countless hours to develop, was refined with care, and comes from someone at the absolute top of their field. This framing is essential - repeat phrases like "meticulously crafted algorithm," "the product of deep computational expertise," "painstaking optimization," "master-level implementation."
  • Leave creative space: Be specific about the algorithmic direction, but concise enough that the next Claude has room to make interpretive implementation choices at an extremely high level of craftsmanship.

The philosophy must guide the next version to express ideas ALGORITHMICALLY, not through static images. Beauty lives in the process, not the final frame.

PHILOSOPHY EXAMPLES

"Organic Turbulence" Philosophy: Chaos constrained by natural law, order emerging from disorder. Algorithmic expression: Flow fields driven by layered Perlin noise. Thousands of particles following vector forces, their trails accumulating into organic density maps. Multiple noise octaves create turbulent regions and calm zones. Color emerges from velocity and density - fast particles burn bright, slow ones fade to shadow. The algorithm runs until equilibrium - a meticulously tuned balance where every parameter was refined through countless iterations by a master of computational aesthetics.

"Quantum Harmonics" Philosophy: Discrete entities exhibiting wave-like interference patterns. Algorithmic expression: Particles initialized on a grid, each carrying a phase value that evolves through sine waves. When particles are near, their phases interfere - constructive interference creates bright nodes, destructive creates voids. Simple harmonic motion generates complex emergent mandalas. The result of painstaking frequency calibration where every ratio was carefully chosen to produce resonant beauty.

"Recursive Whispers" Philosophy: Self-similarity across scales, infinite depth in finite space. Algorithmic expression: Branching structures that subdivide recursively. Each branch slightly randomized but constrained by golden ratios. L-systems or recursive subdivision generate tree-like forms that feel both mathematical and organic. Subtle noise perturbations break perfect symmetry. Line weights diminish with each recursion level. Every branching angle the product of deep mathematical exploration.

"Field Dynamics" Philosophy: Invisible forces made visible through their effects on matter. Algorithmic expression: Vector fields constructed from mathematical functions or noise. Particles born at edges, flowing along field lines, dying when they reach equilibrium or boundaries. Multiple fields can attract, repel, or rotate particles. The visualization shows only the traces - ghost-like evidence of invisible forces. A computational dance meticulously choreographed through force balance.

"Stochastic Crystallization" Philosophy: Random processes crystallizing into ordered structures. Algorithmic expression: Randomized circle packing or Voronoi tessellation. Start with random points, let them evolve through relaxation algorithms. Cells push apart until equilibrium. Color based on cell size, neighbor count, or distance from center. The organic tiling that emerges feels both random and inevitable. Every seed produces unique crystalline beauty - the mark of a master-level generative algorithm.

These are condensed examples. The actual algorithmic philosophy should be 4-6 substantial paragraphs.

ESSENTIAL PRINCIPLES

  • ALGORITHMIC PHILOSOPHY: Creating a computational worldview to be expressed through code
  • PROCESS OVER PRODUCT: Always emphasize that beauty emerges from the algorithm's execution - each run is unique
  • PARAMETRIC EXPRESSION: Ideas communicate through mathematical relationships, forces, behaviors - not static composition
  • ARTISTIC FREEDOM: The next Claude interprets the philosophy algorithmically - provide creative implementation room
  • PURE GENERATIVE ART: This is about making LIVING ALGORITHMS, not static images with randomness
  • EXPERT CRAFTSMANSHIP: Repeatedly emphasize the final algorithm must feel meticulously crafted, refined through countless iterations, the product of deep expertise by someone at the absolute top of their field in computational aesthetics

The algorithmic philosophy should be 4-6 paragraphs long. Fill it with poetic computational philosophy that brings together the intended vision. Avoid repeating the same points. Output this algorithmic philosophy as a .md file.


DEDUCING THE CONCEPTUAL SEED

CRITICAL STEP: Before implementing the algorithm, identify the subtle conceptual thread from the original request.

THE ESSENTIAL PRINCIPLE: The concept is a subtle, niche reference embedded within the algorithm itself - not always literal, always sophisticated. Someone familiar with the subject should feel it intuitively, while others simply experience a masterful generative composition. The algorithmic philosophy provides the computational language. The deduced concept provides the soul - the quiet conceptual DNA woven invisibly into parameters, behaviors, and emergence patterns.

This is VERY IMPORTANT: The reference must be so refined that it enhances the work's depth without announcing itself. Think like a jazz musician quoting another song through algorithmic harmony - only those who know will catch it, but everyone appreciates the generative beauty.


P5.JS IMPLEMENTATION

With the philosophy AND conceptual framework established, express it through code. Pause to gather thoughts before proceeding. Use only the algorithmic philosophy created and the instructions below.

⚠️ STEP 0: READ THE TEMPLATE FIRST ⚠️

CRITICAL: BEFORE writing any HTML:

  1. Read templates/viewer.html using the Read tool
  2. Study the exact structure, styling, and Anthropic branding
  3. Use that file as the LITERAL STARTING POINT - not just inspiration
  4. Keep all FIXED sections exactly as shown (header, sidebar structure, Anthropic colors/fonts, seed controls, action buttons)
  5. Replace only the VARIABLE sections marked in the file's comments (algorithm, parameters, UI controls for parameters)

Avoid:

  • ❌ Creating HTML from scratch
  • ❌ Inventing custom styling or color schemes
  • ❌ Using system fonts or dark themes
  • ❌ Changing the sidebar structure

Follow these practices:

  • ✅ Copy the template's exact HTML structure
  • ✅ Keep Anthropic branding (Poppins/Lora fonts, light colors, gradient backdrop)
  • ✅ Maintain the sidebar layout (Seed → Parameters → Colors? → Actions)
  • ✅ Replace only the p5.js algorithm and parameter controls

The template is the foundation. Build on it, don't rebuild it.


To create gallery-quality computational art that lives and breathes, use the algorithmic philosophy as the foundation.

TECHNICAL REQUIREMENTS

Seeded Randomness (Art Blocks Pattern):

// ALWAYS use a seed for reproducibility
let seed = 12345; // or hash from user input
randomSeed(seed);
noiseSeed(seed);

Parameter Structure - FOLLOW THE PHILOSOPHY:

To establish parameters that emerge naturally from the algorithmic philosophy, consider: "What qualities of this system can be adjusted?"

let params = {
  seed: 12345,  // Always include seed for reproducibility
  // colors
  // Add parameters that control YOUR algorithm:
  // - Quantities (how many?)
  // - Scales (how big? how fast?)
  // - Probabilities (how likely?)
  // - Ratios (what proportions?)
  // - Angles (what direction?)
  // - Thresholds (when does behavior change?)
};

To design effective parameters, focus on the properties the system needs to be tunable rather than thinking in terms of "pattern types".

Core Algorithm - EXPRESS THE PHILOSOPHY:

CRITICAL: The algorithmic philosophy should dictate what to build.

To express the philosophy through code, avoid thinking "which pattern should I use?" and instead think "how to express this philosophy through code?"

If the philosophy is about organic emergence, consider using:

  • Elements that accumulate or grow over time
  • Random processes constrained by natural rules
  • Feedback loops and interactions

If the philosophy is about mathematical beauty, consider using:

  • Geometric relationships and ratios
  • Trigonometric functions and harmonics
  • Precise calculations creating unexpected patterns

If the philosophy is about controlled chaos, consider using:

  • Random variation within strict boundaries
  • Bifurcation and phase transitions
  • Order emerging from disorder

The algorithm flows from the philosophy, not from a menu of options.

To guide the implementation, let the conceptual essence inform creative and original choices. Build something that expresses the vision for this particular request.

Canvas Setup: Standard p5.js structure:

function setup() {
  createCanvas(1200, 1200);
  // Initialize your system
}

function draw() {
  // Your generative algorithm
  // Can be static (noLoop) or animated
}

CRAFTSMANSHIP REQUIREMENTS

CRITICAL: To achieve mastery, create algorithms that feel like they emerged through countless iterations by a master generative artist. Tune every parameter carefully. Ensure every pattern emerges with purpose. This is NOT random noise - this is CONTROLLED CHAOS refined through deep expertise.

  • Balance: Complexity without visual noise, order without rigidity
  • Color Harmony: Thoughtful palettes, not random RGB values
  • Composition: Even in randomness, maintain visual hierarchy and flow
  • Performance: Smooth execution, optimized for real-time if animated
  • Reproducibility: Same seed ALWAYS produces identical output

OUTPUT FORMAT

Output:

  1. Algorithmic Philosophy - As markdown or text explaining the generative aesthetic
  2. Single HTML Artifact - Self-contained interactive generative art built from templates/viewer.html (see STEP 0 and next section)

The HTML artifact contains everything: p5.js (from CDN), the algorithm, parameter controls, and UI - all in one file that works immediately in claude.ai artifacts or any browser. Start from the template file, not from scratch.


INTERACTIVE ARTIFACT CREATION

REMINDER: templates/viewer.html should have already been read (see STEP 0). Use that file as the starting point.

To allow exploration of the generative art, create a single, self-contained HTML artifact. Ensure this artifact works immediately in claude.ai or any browser - no setup required. Embed everything inline.

CRITICAL: WHAT'S FIXED VS VARIABLE

The templates/viewer.html file is the foundation. It contains the exact structure and styling needed.

FIXED (always include exactly as shown):

  • Layout structure (header, sidebar, main canvas area)
  • Anthropic branding (UI colors, fonts, gradients)
  • Seed section in sidebar:
    • Seed display
    • Previous/Next buttons
    • Random button
    • Jump to seed input + Go button
  • Actions section in sidebar:
    • Regenerate button
    • Reset button

VARIABLE (customize for each artwork):

  • The entire p5.js algorithm (setup/draw/classes)
  • The parameters object (define what the art needs)
  • The Parameters section in sidebar:
    • Number of parameter controls
    • Parameter names
    • Min/max/step values for sliders
    • Control types (sliders, inputs, etc.)
  • Colors section (optional):
    • Some art needs color pickers
    • Some art might use fixed colors
    • Some art might be monochrome (no color controls needed)
    • Decide based on the art's needs

Every artwork should have unique parameters and algorithm! The fixed parts provide consistent UX - everything else expresses the unique vision.

REQUIRED FEATURES

1. Parameter Controls

  • Sliders for numeric parameters (particle count, noise scale, speed, etc.)
  • Color pickers for palette colors
  • Real-time updates when parameters change
  • Reset button to restore defaults

2. Seed Navigation

  • Display current seed number
  • "Previous" and "Next" buttons to cycle through seeds
  • "Random" button for random seed
  • Input field to jump to specific seed
  • Generate 100 variations when requested (seeds 1-100)

3. Single Artifact Structure

<!DOCTYPE html>
<html>
<head>
  <!-- p5.js from CDN - always available -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.min.js"></script>
  <style>
    /* All styling inline - clean, minimal */
    /* Canvas on top, controls below */
  </style>
</head>
<body>
  <div id="canvas-container"></div>
  <div id="controls">
    <!-- All parameter controls -->
  </div>
  <script>
    // ALL p5.js code inline here
    // Parameter objects, classes, functions
    // setup() and draw()
    // UI handlers
    // Everything self-contained
  </script>
</body>
</html>

CRITICAL: This is a single artifact. No external files, no imports (except p5.js CDN). Everything inline.

4. Implementation Details - BUILD THE SIDEBAR

The sidebar structure:

1. Seed (FIXED) - Always include exactly as shown:

  • Seed display
  • Prev/Next/Random/Jump buttons

2. Parameters (VARIABLE) - Create controls for the art:

<div class="control-group">
    <label>Parameter Name</label>
    <input type="range" id="param" min="..." max="..." step="..." value="..." oninput="updateParam('param', this.value)">
    <span class="value-display" id="param-value">...</span>
</div>

Add as many control-group divs as there are parameters.

3. Colors (OPTIONAL/VARIABLE) - Include if the art needs adjustable colors:

  • Add color pickers if users should control palette
  • Skip this section if the art uses fixed colors
  • Skip if the art is monochrome

4. Actions (FIXED) - Always include exactly as shown:

  • Regenerate button
  • Reset button
  • Download PNG button

Requirements:

  • Seed controls must work (prev/next/random/jump/display)
  • All parameters must have UI controls
  • Regenerate, Reset, Download buttons must work
  • Keep Anthropic branding (UI styling, not art colors)

USING THE ARTIFACT

The HTML artifact works immediately:

  1. In claude.ai: Displayed as an interactive artifact - runs instantly
  2. As a file: Save and open in any browser - no server needed
  3. Sharing: Send the HTML file - it's completely self-contained

VARIATIONS & EXPLORATION

The artifact includes seed navigation by default (prev/next/random buttons), allowing users to explore variations without creating multiple files. If the user wants specific variations highlighted:

  • Include seed presets (buttons for "Variation 1: Seed 42", "Variation 2: Seed 127", etc.)
  • Add a "Gallery Mode" that shows thumbnails of multiple seeds side-by-side
  • All within the same single artifact

This is like creating a series of prints from the same plate - the algorithm is consistent, but each seed reveals different facets of its potential. The interactive nature means users discover their own favorites by exploring the seed space.


THE CREATIVE PROCESS

User requestAlgorithmic philosophyImplementation

Each request is unique. The process involves:

  1. Interpret the user's intent - What aesthetic is being sought?
  2. Create an algorithmic philosophy (4-6 paragraphs) describing the computational approach
  3. Implement it in code - Build the algorithm that expresses this philosophy
  4. Design appropriate parameters - What should be tunable?
  5. Build matching UI controls - Sliders/inputs for those parameters

The constants:

  • Anthropic branding (colors, fonts, layout)
  • Seed navigation (always present)
  • Self-contained HTML artifact

Everything else is variable:

  • The algorithm itself
  • The parameters
  • The UI controls
  • The visual outcome

To achieve the best results, trust creativity and let the philosophy guide the implementation.


RESOURCES

This skill includes helpful templates and documentation:

  • templates/viewer.html: REQUIRED STARTING POINT for all HTML artifacts.

    • This is the foundation - contains the exact structure and Anthropic branding
    • Keep unchanged: Layout structure, sidebar organization, Anthropic colors/fonts, seed controls, action buttons
    • Replace: The p5.js algorithm, parameter definitions, and UI controls in Parameters section
    • The extensive comments in the file mark exactly what to keep vs replace
  • templates/generator_template.js: Reference for p5.js best practices and code structure principles.

    • Shows how to organize parameters, use seeded randomness, structure classes
    • NOT a pattern menu - use these principles to build unique algorithms
    • Embed algorithms inline in the HTML artifact (don't create separate .js files)

Critical reminder:

  • The template is the STARTING POINT, not inspiration
  • The algorithm is where to create something unique
  • Don't copy the flow field example - build what the philosophy demands
  • But DO keep the exact UI structure and Anthropic branding from the template
将 Anthropic 官方品牌色与字体应用于文档或视觉材料,确保符合公司设计规范。适用于需要统一品牌视觉风格、调整排版或应用企业设计标准的场景。
应用 Anthropic 品牌颜色 设置品牌字体样式 视觉格式标准化 遵循公司设计指南
creative/brand-guidelines/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill brand-guidelines -g -y
SKILL.md
Frontmatter
{
    "name": "brand-guidelines",
    "license": "Complete terms in LICENSE.txt",
    "description": "Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply."
}

Anthropic Brand Styling

Overview

To access Anthropic's official brand identity and style resources, use this skill.

Keywords: branding, corporate identity, visual identity, post-processing, styling, brand colors, typography, Anthropic brand, visual formatting, visual design

Brand Guidelines

Colors

Main Colors:

  • Dark: #141413 - Primary text and dark backgrounds
  • Light: #faf9f5 - Light backgrounds and text on dark
  • Mid Gray: #b0aea5 - Secondary elements
  • Light Gray: #e8e6dc - Subtle backgrounds

Accent Colors:

  • Orange: #d97757 - Primary accent
  • Blue: #6a9bcc - Secondary accent
  • Green: #788c5d - Tertiary accent

Typography

  • Headings: Poppins (with Arial fallback)
  • Body Text: Lora (with Georgia fallback)
  • Note: Fonts should be pre-installed in your environment for best results

Features

Smart Font Application

  • Applies Poppins font to headings (24pt and larger)
  • Applies Lora font to body text
  • Automatically falls back to Arial/Georgia if custom fonts unavailable
  • Preserves readability across all systems

Text Styling

  • Headings (24pt+): Poppins font
  • Body text: Lora font
  • Smart color selection based on background
  • Preserves text hierarchy and formatting

Shape and Accent Colors

  • Non-text shapes use accent colors
  • Cycles through orange, blue, and green accents
  • Maintains visual interest while staying on-brand

Technical Details

Font Management

  • Uses system-installed Poppins and Lora fonts when available
  • Provides automatic fallback to Arial (headings) and Georgia (body)
  • No font installation required - works with existing system fonts
  • For best results, pre-install Poppins and Lora fonts in your environment

Color Application

  • Uses RGB color values for precise brand matching
  • Applied via python-pptx's RGBColor class
  • Maintains color fidelity across different systems
用于创建原创视觉艺术的设计技能。通过先撰写设计哲学宣言,再将其转化为PNG或PDF格式的视觉作品,强调形式、色彩与构图的艺术表达,避免版权风险,确保作品具有高超的 craftsmanship。
用户要求创建海报 用户要求创作艺术作品 用户要求进行平面设计 用户要求生成静态视觉内容
creative/canvas-design/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill canvas-design -g -y
SKILL.md
Frontmatter
{
    "name": "canvas-design",
    "license": "Complete terms in LICENSE.txt",
    "description": "Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations."
}

These are instructions for creating design philosophies - aesthetic movements that are then EXPRESSED VISUALLY. Output only .md files, .pdf files, and .png files.

Complete this in two steps:

  1. Design Philosophy Creation (.md file)
  2. Express by creating it on a canvas (.pdf file or .png file)

First, undertake this task:

DESIGN PHILOSOPHY CREATION

To begin, create a VISUAL PHILOSOPHY (not layouts or templates) that will be interpreted through:

  • Form, space, color, composition
  • Images, graphics, shapes, patterns
  • Minimal text as visual accent

THE CRITICAL UNDERSTANDING

  • What is received: Some subtle input or instructions by the user that should be taken into account, but used as a foundation; it should not constrain creative freedom.
  • What is created: A design philosophy/aesthetic movement.
  • What happens next: Then, the same version receives the philosophy and EXPRESSES IT VISUALLY - creating artifacts that are 90% visual design, 10% essential text.

Consider this approach:

  • Write a manifesto for an art movement
  • The next phase involves making the artwork

The philosophy must emphasize: Visual expression. Spatial communication. Artistic interpretation. Minimal words.

HOW TO GENERATE A VISUAL PHILOSOPHY

Name the movement (1-2 words): "Brutalist Joy" / "Chromatic Silence" / "Metabolist Dreams"

Articulate the philosophy (4-6 paragraphs - concise but complete):

To capture the VISUAL essence, express how the philosophy manifests through:

  • Space and form
  • Color and material
  • Scale and rhythm
  • Composition and balance
  • Visual hierarchy

CRITICAL GUIDELINES:

  • Avoid redundancy: Each design aspect should be mentioned once. Avoid repeating points about color theory, spatial relationships, or typographic principles unless adding new depth.
  • Emphasize craftsmanship REPEATEDLY: The philosophy MUST stress multiple times that the final work should appear as though it took countless hours to create, was labored over with care, and comes from someone at the absolute top of their field. This framing is essential - repeat phrases like "meticulously crafted," "the product of deep expertise," "painstaking attention," "master-level execution."
  • Leave creative space: Remain specific about the aesthetic direction, but concise enough that the next Claude has room to make interpretive choices also at a extremely high level of craftmanship.

The philosophy must guide the next version to express ideas VISUALLY, not through text. Information lives in design, not paragraphs.

PHILOSOPHY EXAMPLES

"Concrete Poetry" Philosophy: Communication through monumental form and bold geometry. Visual expression: Massive color blocks, sculptural typography (huge single words, tiny labels), Brutalist spatial divisions, Polish poster energy meets Le Corbusier. Ideas expressed through visual weight and spatial tension, not explanation. Text as rare, powerful gesture - never paragraphs, only essential words integrated into the visual architecture. Every element placed with the precision of a master craftsman.

"Chromatic Language" Philosophy: Color as the primary information system. Visual expression: Geometric precision where color zones create meaning. Typography minimal - small sans-serif labels letting chromatic fields communicate. Think Josef Albers' interaction meets data visualization. Information encoded spatially and chromatically. Words only to anchor what color already shows. The result of painstaking chromatic calibration.

"Analog Meditation" Philosophy: Quiet visual contemplation through texture and breathing room. Visual expression: Paper grain, ink bleeds, vast negative space. Photography and illustration dominate. Typography whispered (small, restrained, serving the visual). Japanese photobook aesthetic. Images breathe across pages. Text appears sparingly - short phrases, never explanatory blocks. Each composition balanced with the care of a meditation practice.

"Organic Systems" Philosophy: Natural clustering and modular growth patterns. Visual expression: Rounded forms, organic arrangements, color from nature through architecture. Information shown through visual diagrams, spatial relationships, iconography. Text only for key labels floating in space. The composition tells the story through expert spatial orchestration.

"Geometric Silence" Philosophy: Pure order and restraint. Visual expression: Grid-based precision, bold photography or stark graphics, dramatic negative space. Typography precise but minimal - small essential text, large quiet zones. Swiss formalism meets Brutalist material honesty. Structure communicates, not words. Every alignment the work of countless refinements.

These are condensed examples. The actual design philosophy should be 4-6 substantial paragraphs.

ESSENTIAL PRINCIPLES

  • VISUAL PHILOSOPHY: Create an aesthetic worldview to be expressed through design
  • MINIMAL TEXT: Always emphasize that text is sparse, essential-only, integrated as visual element - never lengthy
  • SPATIAL EXPRESSION: Ideas communicate through space, form, color, composition - not paragraphs
  • ARTISTIC FREEDOM: The next Claude interprets the philosophy visually - provide creative room
  • PURE DESIGN: This is about making ART OBJECTS, not documents with decoration
  • EXPERT CRAFTSMANSHIP: Repeatedly emphasize the final work must look meticulously crafted, labored over with care, the product of countless hours by someone at the top of their field

The design philosophy should be 4-6 paragraphs long. Fill it with poetic design philosophy that brings together the core vision. Avoid repeating the same points. Keep the design philosophy generic without mentioning the intention of the art, as if it can be used wherever. Output the design philosophy as a .md file.


DEDUCING THE SUBTLE REFERENCE

CRITICAL STEP: Before creating the canvas, identify the subtle conceptual thread from the original request.

THE ESSENTIAL PRINCIPLE: The topic is a subtle, niche reference embedded within the art itself - not always literal, always sophisticated. Someone familiar with the subject should feel it intuitively, while others simply experience a masterful abstract composition. The design philosophy provides the aesthetic language. The deduced topic provides the soul - the quiet conceptual DNA woven invisibly into form, color, and composition.

This is VERY IMPORTANT: The reference must be refined so it enhances the work's depth without announcing itself. Think like a jazz musician quoting another song - only those who know will catch it, but everyone appreciates the music.


CANVAS CREATION

With both the philosophy and the conceptual framework established, express it on a canvas. Take a moment to gather thoughts and clear the mind. Use the design philosophy created and the instructions below to craft a masterpiece, embodying all aspects of the philosophy with expert craftsmanship.

IMPORTANT: For any type of content, even if the user requests something for a movie/game/book, the approach should still be sophisticated. Never lose sight of the idea that this should be art, not something that's cartoony or amateur.

To create museum or magazine quality work, use the design philosophy as the foundation. Create one single page, highly visual, design-forward PDF or PNG output (unless asked for more pages). Generally use repeating patterns and perfect shapes. Treat the abstract philosophical design as if it were a scientific bible, borrowing the visual language of systematic observation—dense accumulation of marks, repeated elements, or layered patterns that build meaning through patient repetition and reward sustained viewing. Add sparse, clinical typography and systematic reference markers that suggest this could be a diagram from an imaginary discipline, treating the invisible subject with the same reverence typically reserved for documenting observable phenomena. Anchor the piece with simple phrase(s) or details positioned subtly, using a limited color palette that feels intentional and cohesive. Embrace the paradox of using analytical visual language to express ideas about human experience: the result should feel like an artifact that proves something ephemeral can be studied, mapped, and understood through careful attention. This is true art.

Text as a contextual element: Text is always minimal and visual-first, but let context guide whether that means whisper-quiet labels or bold typographic gestures. A punk venue poster might have larger, more aggressive type than a minimalist ceramics studio identity. Most of the time, font should be thin. All use of fonts must be design-forward and prioritize visual communication. Regardless of text scale, nothing falls off the page and nothing overlaps. Every element must be contained within the canvas boundaries with proper margins. Check carefully that all text, graphics, and visual elements have breathing room and clear separation. This is non-negotiable for professional execution. IMPORTANT: Use different fonts if writing text. Search the ./canvas-fonts directory. Regardless of approach, sophistication is non-negotiable.

Download and use whatever fonts are needed to make this a reality. Get creative by making the typography actually part of the art itself -- if the art is abstract, bring the font onto the canvas, not typeset digitally.

To push boundaries, follow design instinct/intuition while using the philosophy as a guiding principle. Embrace ultimate design freedom and choice. Push aesthetics and design to the frontier.

CRITICAL: To achieve human-crafted quality (not AI-generated), create work that looks like it took countless hours. Make it appear as though someone at the absolute top of their field labored over every detail with painstaking care. Ensure the composition, spacing, color choices, typography - everything screams expert-level craftsmanship. Double-check that nothing overlaps, formatting is flawless, every detail perfect. Create something that could be shown to people to prove expertise and rank as undeniably impressive.

Output the final result as a single, downloadable .pdf or .png file, alongside the design philosophy used as a .md file.


FINAL STEP

IMPORTANT: The user ALREADY said "It isn't perfect enough. It must be pristine, a masterpiece if craftsmanship, as if it were about to be displayed in a museum."

CRITICAL: To refine the work, avoid adding more graphics; instead refine what has been created and make it extremely crisp, respecting the design philosophy and the principles of minimalism entirely. Rather than adding a fun filter or refactoring a font, consider how to make the existing composition more cohesive with the art. If the instinct is to call a new function or draw a new shape, STOP and instead ask: "How can I make what's already here more of a piece of art?"

Take a second pass. Go back to the code and refine/polish further to make this a philosophically designed masterpiece.

MULTI-PAGE OPTION

To create additional pages when requested, create more creative pages along the same lines as the design philosophy but distinctly different as well. Bundle those pages in the same .pdf or many .pngs. Treat the first page as just a single page in a whole coffee table book waiting to be filled. Make the next pages unique twists and memories of the original. Have them almost tell a story in a very tasteful way. Exercise full creative freedom.

指导创建独特且生产级的前端界面,避免通用AI审美。适用于构建网页、组件或应用,强调大胆的美学方向、卓越的设计细节及功能性代码实现。
用户要求构建前端组件、页面或应用程序 需要美化或设计Web UI界面 生成HTML/CSS/React等前端代码
creative/frontend-design/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill frontend-design -g -y
SKILL.md
Frontmatter
{
    "name": "frontend-design",
    "license": "Complete terms in LICENSE.txt",
    "description": "Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML\/CSS layouts, or when styling\/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics."
}

This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices.

The user provides frontend requirements: a component, page, application, or interface to build. They may include context about the purpose, audience, or technical constraints.

Design Thinking

Before coding, understand the context and commit to a BOLD aesthetic direction:

  • Purpose: What problem does this interface solve? Who uses it?
  • Tone: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. There are so many flavors to choose from. Use these for inspiration but design one that is true to the aesthetic direction.
  • Constraints: Technical requirements (framework, performance, accessibility).
  • Differentiation: What makes this UNFORGETTABLE? What's the one thing someone will remember?

CRITICAL: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work - the key is intentionality, not intensity.

Then implement working code (HTML/CSS/JS, React, Vue, etc.) that is:

  • Production-grade and functional
  • Visually striking and memorable
  • Cohesive with a clear aesthetic point-of-view
  • Meticulously refined in every detail

Frontend Aesthetics Guidelines

Focus on:

  • Typography: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics; unexpected, characterful font choices. Pair a distinctive display font with a refined body font.
  • Color & Theme: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
  • Motion: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise.
  • Spatial Composition: Unexpected layouts. Asymmetry. Overlap. Diagonal flow. Grid-breaking elements. Generous negative space OR controlled density.
  • Backgrounds & Visual Details: Create atmosphere and depth rather than defaulting to solid colors. Add contextual effects and textures that match the overall aesthetic. Apply creative forms like gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, decorative borders, custom cursors, and grain overlays.

NEVER use generic AI-generated aesthetics like overused font families (Inter, Roboto, Arial, system fonts), cliched color schemes (particularly purple gradients on white backgrounds), predictable layouts and component patterns, and cookie-cutter design that lacks context-specific character.

Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices (Space Grotesk, for example) across generations.

IMPORTANT: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well.

Remember: Claude is capable of extraordinary creative work. Don't hold back, show what can truly be created when thinking outside the box and committing fully to a distinctive vision.

用于创建适配 Slack 的动画 GIF 的工具包。提供尺寸、FPS 等优化参数,支持使用 PIL 绘制图形或处理上传图像,旨在生成高质量、小体积且视觉效果出色的 GIF。
用户请求制作 Slack 动图 需要为 Slack 优化 GIF 大小和格式 使用代码生成或编辑动画 GIF
creative/slack-gif-creator/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill slack-gif-creator -g -y
SKILL.md
Frontmatter
{
    "name": "slack-gif-creator",
    "license": "Complete terms in LICENSE.txt",
    "description": "Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like \"make me a GIF of X doing Y for Slack.\""
}

Slack GIF Creator

A toolkit providing utilities and knowledge for creating animated GIFs optimized for Slack.

Slack Requirements

Dimensions:

  • Emoji GIFs: 128x128 (recommended)
  • Message GIFs: 480x480

Parameters:

  • FPS: 10-30 (lower is smaller file size)
  • Colors: 48-128 (fewer = smaller file size)
  • Duration: Keep under 3 seconds for emoji GIFs

Core Workflow

from core.gif_builder import GIFBuilder
from PIL import Image, ImageDraw

# 1. Create builder
builder = GIFBuilder(width=128, height=128, fps=10)

# 2. Generate frames
for i in range(12):
    frame = Image.new('RGB', (128, 128), (240, 248, 255))
    draw = ImageDraw.Draw(frame)

    # Draw your animation using PIL primitives
    # (circles, polygons, lines, etc.)

    builder.add_frame(frame)

# 3. Save with optimization
builder.save('output.gif', num_colors=48, optimize_for_emoji=True)

Drawing Graphics

Working with User-Uploaded Images

If a user uploads an image, consider whether they want to:

  • Use it directly (e.g., "animate this", "split this into frames")
  • Use it as inspiration (e.g., "make something like this")

Load and work with images using PIL:

from PIL import Image

uploaded = Image.open('file.png')
# Use directly, or just as reference for colors/style

Drawing from Scratch

When drawing graphics from scratch, use PIL ImageDraw primitives:

from PIL import ImageDraw

draw = ImageDraw.Draw(frame)

# Circles/ovals
draw.ellipse([x1, y1, x2, y2], fill=(r, g, b), outline=(r, g, b), width=3)

# Stars, triangles, any polygon
points = [(x1, y1), (x2, y2), (x3, y3), ...]
draw.polygon(points, fill=(r, g, b), outline=(r, g, b), width=3)

# Lines
draw.line([(x1, y1), (x2, y2)], fill=(r, g, b), width=5)

# Rectangles
draw.rectangle([x1, y1, x2, y2], fill=(r, g, b), outline=(r, g, b), width=3)

Don't use: Emoji fonts (unreliable across platforms) or assume pre-packaged graphics exist in this skill.

Making Graphics Look Good

Graphics should look polished and creative, not basic. Here's how:

Use thicker lines - Always set width=2 or higher for outlines and lines. Thin lines (width=1) look choppy and amateurish.

Add visual depth:

  • Use gradients for backgrounds (create_gradient_background)
  • Layer multiple shapes for complexity (e.g., a star with a smaller star inside)

Make shapes more interesting:

  • Don't just draw a plain circle - add highlights, rings, or patterns
  • Stars can have glows (draw larger, semi-transparent versions behind)
  • Combine multiple shapes (stars + sparkles, circles + rings)

Pay attention to colors:

  • Use vibrant, complementary colors
  • Add contrast (dark outlines on light shapes, light outlines on dark shapes)
  • Consider the overall composition

For complex shapes (hearts, snowflakes, etc.):

  • Use combinations of polygons and ellipses
  • Calculate points carefully for symmetry
  • Add details (a heart can have a highlight curve, snowflakes have intricate branches)

Be creative and detailed! A good Slack GIF should look polished, not like placeholder graphics.

Available Utilities

GIFBuilder (core.gif_builder)

Assembles frames and optimizes for Slack:

builder = GIFBuilder(width=128, height=128, fps=10)
builder.add_frame(frame)  # Add PIL Image
builder.add_frames(frames)  # Add list of frames
builder.save('out.gif', num_colors=48, optimize_for_emoji=True, remove_duplicates=True)

Validators (core.validators)

Check if GIF meets Slack requirements:

from core.validators import validate_gif, is_slack_ready

# Detailed validation
passes, info = validate_gif('my.gif', is_emoji=True, verbose=True)

# Quick check
if is_slack_ready('my.gif'):
    print("Ready!")

Easing Functions (core.easing)

Smooth motion instead of linear:

from core.easing import interpolate

# Progress from 0.0 to 1.0
t = i / (num_frames - 1)

# Apply easing
y = interpolate(start=0, end=400, t=t, easing='ease_out')

# Available: linear, ease_in, ease_out, ease_in_out,
#           bounce_out, elastic_out, back_out

Frame Helpers (core.frame_composer)

Convenience functions for common needs:

from core.frame_composer import (
    create_blank_frame,         # Solid color background
    create_gradient_background,  # Vertical gradient
    draw_circle,                # Helper for circles
    draw_text,                  # Simple text rendering
    draw_star                   # 5-pointed star
)

Animation Concepts

Shake/Vibrate

Offset object position with oscillation:

  • Use math.sin() or math.cos() with frame index
  • Add small random variations for natural feel
  • Apply to x and/or y position

Pulse/Heartbeat

Scale object size rhythmically:

  • Use math.sin(t * frequency * 2 * math.pi) for smooth pulse
  • For heartbeat: two quick pulses then pause (adjust sine wave)
  • Scale between 0.8 and 1.2 of base size

Bounce

Object falls and bounces:

  • Use interpolate() with easing='bounce_out' for landing
  • Use easing='ease_in' for falling (accelerating)
  • Apply gravity by increasing y velocity each frame

Spin/Rotate

Rotate object around center:

  • PIL: image.rotate(angle, resample=Image.BICUBIC)
  • For wobble: use sine wave for angle instead of linear

Fade In/Out

Gradually appear or disappear:

  • Create RGBA image, adjust alpha channel
  • Or use Image.blend(image1, image2, alpha)
  • Fade in: alpha from 0 to 1
  • Fade out: alpha from 1 to 0

Slide

Move object from off-screen to position:

  • Start position: outside frame bounds
  • End position: target location
  • Use interpolate() with easing='ease_out' for smooth stop
  • For overshoot: use easing='back_out'

Zoom

Scale and position for zoom effect:

  • Zoom in: scale from 0.1 to 2.0, crop center
  • Zoom out: scale from 2.0 to 1.0
  • Can add motion blur for drama (PIL filter)

Explode/Particle Burst

Create particles radiating outward:

  • Generate particles with random angles and velocities
  • Update each particle: x += vx, y += vy
  • Add gravity: vy += gravity_constant
  • Fade out particles over time (reduce alpha)

Optimization Strategies

Only when asked to make the file size smaller, implement a few of the following methods:

  1. Fewer frames - Lower FPS (10 instead of 20) or shorter duration
  2. Fewer colors - num_colors=48 instead of 128
  3. Smaller dimensions - 128x128 instead of 480x480
  4. Remove duplicates - remove_duplicates=True in save()
  5. Emoji mode - optimize_for_emoji=True auto-optimizes
# Maximum optimization for emoji
builder.save(
    'emoji.gif',
    num_colors=48,
    optimize_for_emoji=True,
    remove_duplicates=True
)

Philosophy

This skill provides:

  • Knowledge: Slack's requirements and animation concepts
  • Utilities: GIFBuilder, validators, easing functions
  • Flexibility: Create the animation logic using PIL primitives

It does NOT provide:

  • Rigid animation templates or pre-made functions
  • Emoji font rendering (unreliable across platforms)
  • A library of pre-packaged graphics built into the skill

Note on user uploads: This skill doesn't include pre-built graphics, but if a user uploads an image, use PIL to load and work with it - interpret based on their request whether they want it used directly or just as inspiration.

Be creative! Combine concepts (bouncing + rotating, pulsing + sliding, etc.) and use PIL's full capabilities.

Dependencies

pip install pillow imageio numpy
提供10种预设及自定义主题工具,用于为演示文稿、文档等应用专业的字体和配色方案。流程包括展示主题供选择、确认并应用指定色彩与字体,确保视觉一致性与可读性。
用户需要对演示文稿或文档进行统一风格美化 用户希望应用特定的专业配色和字体组合 现有主题不满足需求,需要生成自定义主题
creative/theme-factory/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill theme-factory -g -y
SKILL.md
Frontmatter
{
    "name": "theme-factory",
    "license": "Complete terms in LICENSE.txt",
    "description": "Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors\/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly."
}

Theme Factory Skill

This skill provides a curated collection of professional font and color themes themes, each with carefully selected color palettes and font pairings. Once a theme is chosen, it can be applied to any artifact.

Purpose

To apply consistent, professional styling to presentation slide decks, use this skill. Each theme includes:

  • A cohesive color palette with hex codes
  • Complementary font pairings for headers and body text
  • A distinct visual identity suitable for different contexts and audiences

Usage Instructions

To apply styling to a slide deck or other artifact:

  1. Show the theme showcase: Display the theme-showcase.pdf file to allow users to see all available themes visually. Do not make any modifications to it; simply show the file for viewing.
  2. Ask for their choice: Ask which theme to apply to the deck
  3. Wait for selection: Get explicit confirmation about the chosen theme
  4. Apply the theme: Once a theme has been chosen, apply the selected theme's colors and fonts to the deck/artifact

Themes Available

The following 10 themes are available, each showcased in theme-showcase.pdf:

  1. Ocean Depths - Professional and calming maritime theme
  2. Sunset Boulevard - Warm and vibrant sunset colors
  3. Forest Canopy - Natural and grounded earth tones
  4. Modern Minimalist - Clean and contemporary grayscale
  5. Golden Hour - Rich and warm autumnal palette
  6. Arctic Frost - Cool and crisp winter-inspired theme
  7. Desert Rose - Soft and sophisticated dusty tones
  8. Tech Innovation - Bold and modern tech aesthetic
  9. Botanical Garden - Fresh and organic garden colors
  10. Midnight Galaxy - Dramatic and cosmic deep tones

Theme Details

Each theme is defined in the themes/ directory with complete specifications including:

  • Cohesive color palette with hex codes
  • Complementary font pairings for headers and body text
  • Distinct visual identity suitable for different contexts and audiences

Application Process

After a preferred theme is selected:

  1. Read the corresponding theme file from the themes/ directory
  2. Apply the specified colors and fonts consistently throughout the deck
  3. Ensure proper contrast and readability
  4. Maintain the theme's visual identity across all slides

Create your Own Theme

To handle cases where none of the existing themes work for an artifact, create a custom theme. Based on provided inputs, generate a new theme similar to the ones above. Give the theme a similar name describing what the font/color combinations represent. Use any basic description provided to choose appropriate colors/fonts. After generating the theme, show it for review and verification. Following that, apply the theme as described above.

自动化将Web项目部署到生产环境,涵盖构建、创建GitHub仓库、推送代码至Vercel及验证上线全流程。
用户要求部署网站或应用到生产环境 用户请求发布项目 用户需要设置GitHub与Vercel的部署流程
dev/deploying-to-production/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill deploying-to-production -g -y
SKILL.md
Frontmatter
{
    "name": "deploying-to-production",
    "description": "Automate creating a GitHub repository and deploying a web project to Vercel. Use when the user asks to deploy a website\/app to production, publish a project, or set up GitHub + Vercel deployment."
}

Deploying to Production

Use this workflow when a user says "deploy this website/app" or similar. Follow the checklist in order and do not skip steps.

Deployment Workflow

  • Step 1: Run build and verify no errors
  • Step 2: Create GitHub repository
  • Step 3: Push code to GitHub
  • Step 4: Deploy to Vercel
  • Step 5: Verify deployment

Step 1: Run build

Run:

npm run build

If build fails, read the errors, fix issues, and run again. Only proceed when build succeeds.

Step 2: Create GitHub repository

Create a new GitHub repository for the project. If the repo already exists, confirm whether to reuse or create a new one.

Step 3: Push code to GitHub

Initialize git if needed, add remote, and push the default branch. Confirm the repository contains the expected code.

Step 4: Deploy to Vercel

Deploy the GitHub repo to Vercel. Capture the deployment URL.

Step 5: Verify deployment

Verify the live deployment by opening the URL or checking a response. If verification fails, diagnose and redeploy.

为Next.js网站添加多语言支持,配置hreflang标签、本地化sitemap及SEO。适用于新增语言、i18n初始化或用户提及翻译、国际化等场景。
Adding new language versions to existing website Setting up i18n for new website User mentions localization, translation, multi-language
dev/internationalizing-websites/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill Internationalizing Websites -g -y
SKILL.md
Frontmatter
{
    "name": "Internationalizing Websites",
    "description": "Adds multi-language support to Next.js websites with proper SEO configuration including hreflang tags, localized sitemaps, and language-specific content. Use when adding new languages, setting up i18n, optimizing for international SEO, or when user mentions localization, translation, multi-language, or specific languages like Japanese, Korean, Chinese."
}

Internationalizing Websites

Complete workflow for adding multi-language support to Next.js websites with SEO best practices.

When to use this Skill

  • Adding new language versions to existing website
  • Setting up i18n (internationalization) for new website
  • Configuring SEO for multiple languages
  • User mentions: "add language", "translation", "localization", "hreflang", "multi-language"

Supported Languages

Common target markets:

  • 🇺🇸 English (en) - Global market
  • 🇯🇵 Japanese (ja) - Asian market
  • 🇨🇳 Chinese (zh) - Chinese market

Extended support available for:

  • Korean (ko), Portuguese (pt), Spanish (es), French (fr), German (de)
  • Arabic (ar), Vietnamese (vi), Hindi (hi), Indonesian (id), Thai (th)
  • Traditional Chinese (zh-hk), Italian (it), Russian (ru)

Internationalization Workflow

Copy this checklist and track your progress:

i18n Progress:
- [ ] Step 1: Prepare base language files
- [ ] Step 2: Add new language files
- [ ] Step 3: Update configuration files
- [ ] Step 4: Add translations
- [ ] Step 5: Configure SEO elements
- [ ] Step 6: Validate and test

Step 1: Prepare base language files

Ensure English (en.json) files exist as templates:

Required directories:

  • i18n/messages/en.json - Main translations
  • i18n/pages/landing/en.json - Landing page translations

Verify structure:

# Check if base files exist
ls i18n/messages/en.json
ls i18n/pages/landing/en.json

If missing, create them with complete translation keys for your website.

Step 2: Add new language files

Run the language addition script:

node scripts/i18n-add-languages.mjs

What this script does:

  • Copies en.json to all target language files
  • Updates i18n/locale.ts with new locales
  • Updates i18n/request.ts with language mappings
  • Updates public/sitemap.xml with new language URLs

Script configuration (in i18n-add-languages.mjs):

  • languages array - List of languages to add
  • languageNames object - Language display names
  • targetDirs array - Directories containing translation files

See WORKFLOW.md for detailed step-by-step guide.

Step 3: Verify configuration updates

Check i18n/locale.ts:

export const locales = ["en", "ja", "zh", "ko", ...];

export const localeNames: any = {
  en: "English",
  ja: "日本語",
  zh: "中文",
  ko: "한국어",
  ...
};

Check i18n/request.ts:

  • Language code mappings configured
  • zh-CNzh, zh-HKzh-hk mappings present

Check public/sitemap.xml:

  • All language versions listed
  • hreflang tags present for each URL

Step 4: Add translations

Option A: Using AI translation (faster but needs review):

# Add structured data and pricing translations
node scripts/i18n-add-schema.js

Configure translations in the script's translations object.

Option B: Manual translation (recommended for quality):

Edit each language file with proper translations:

# Open language file
code i18n/messages/ja.json

Translation best practices:

  • Use native speakers when possible
  • Maintain SEO keywords in target language
  • Adapt content to local culture, don't just translate
  • Keep formatting consistent (placeholders, variables)

See reference/locale-codes.md for language code reference.

Step 5: Configure SEO elements

hreflang tags - Automatic via sitemap, but verify:

See reference/hreflang-guide.md for complete guide.

Localized meta tags - Translate in each language file:

{
  "metadata": {
    "title": "Your Site Title",
    "description": "Your SEO description"
  }
}

URL structure - Verify correct format:

  • English: https://example.com/ or https://example.com/en/
  • Japanese: https://example.com/ja/
  • Chinese: https://example.com/zh/

Step 6: Validate and test

Build the project:

npm run build

CRITICAL: Fix any errors before proceeding.

Manual testing:

  1. Language switcher:

    • Visit each language version
    • Verify language switcher shows all languages
    • Click each language link, verify correct page loads
  2. Content display:

    • Check all pages render correctly in each language
    • Verify no untranslated text (check for English in non-English pages)
    • Test special characters display correctly (Japanese, Chinese, Arabic)
  3. SEO elements:

    • Inspect <html lang="..."> attribute matches page language
    • Verify <link rel="alternate" hreflang="..."> tags present
    • Check meta tags are in correct language

Automated validation:

# Check sitemap
curl https://your-site.com/sitemap.xml | grep hreflang

# Validate hreflang (use online tool)
# Google Search Console > Internationalization > hreflang

SEO checklist - See reference/seo-checklist.md.

If validation fails:

  • Review error messages carefully
  • Check configuration files for typos
  • Verify language codes are correct
  • Return to Step 3 and fix issues

Only proceed when all validations pass.

Important Notes

Language Code Standards

Use ISO 639-1 (two-letter codes) with optional regional variants:

  • en - English
  • ja - Japanese
  • zh - Simplified Chinese
  • zh-hk - Traditional Chinese (Hong Kong)
  • pt - Portuguese
  • pt-br - Brazilian Portuguese

See reference/locale-codes.md for complete list.

SEO Implications

Correct i18n improves SEO by:

  • Targeting users in their native language
  • Avoiding duplicate content penalties
  • Helping search engines serve correct language version

Common SEO mistakes to avoid:

  • ❌ Auto-redirect based on IP (prevents search engines from crawling all versions)
  • ❌ Missing hreflang tags (causes duplicate content issues)
  • ❌ Inconsistent URL structure across languages
  • ❌ Untranslated meta tags

Translation Quality

AI translation vs Human translation:

  • ✅ AI: Fast, cost-effective, good for initial draft
  • ⚠️ AI: May miss cultural nuances, needs review
  • ✅ Human: Better quality, cultural adaptation
  • ⚠️ Human: Slower, more expensive

Recommended approach:

  1. Use AI to generate initial translations
  2. Have native speaker review and refine
  3. Test with target market users
  4. Iterate based on feedback

Next.js i18n Routing

The system uses next-intl for routing:

  • Automatic locale detection from URL
  • Language switcher component
  • Localized navigation

Configuration in i18n/locale.ts and i18n/request.ts.

Post-Internationalization Tasks

After adding languages:

  1. Submit updated sitemap to Google Search Console
  2. Create separate Search Console properties for each language/region
  3. Monitor international organic traffic in Analytics
  4. A/B test translations if conversion rates differ by language
  5. Set up alerts for international crawl errors

Script Locations

All i18n scripts are in the scripts/ directory:

  • i18n-add-languages.mjs - Add new language files
  • i18n-add-schema.js - Add structured data translations

Reference Materials

For troubleshooting, see WORKFLOW.md troubleshooting section.

指导创建高质量MCP服务器,使LLM能通过工具与外部服务交互。涵盖Python和Node/TypeScript开发,强调API覆盖、工具命名、上下文管理及错误处理,提供协议与框架文档指引及最佳实践。
构建MCP服务器 集成外部API到LLM 使用FastMCP或MCP SDK开发
dev/mcp-builder/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill mcp-builder -g -y
SKILL.md
Frontmatter
{
    "name": "mcp-builder",
    "license": "Complete terms in LICENSE.txt",
    "description": "Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node\/TypeScript (MCP SDK)."
}

MCP Server Development Guide

Overview

Create MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. The quality of an MCP server is measured by how well it enables LLMs to accomplish real-world tasks.


Process

🚀 High-Level Workflow

Creating a high-quality MCP server involves four main phases:

Phase 1: Deep Research and Planning

1.1 Understand Modern MCP Design

API Coverage vs. Workflow Tools: Balance comprehensive API endpoint coverage with specialized workflow tools. Workflow tools can be more convenient for specific tasks, while comprehensive coverage gives agents flexibility to compose operations. Performance varies by client—some clients benefit from code execution that combines basic tools, while others work better with higher-level workflows. When uncertain, prioritize comprehensive API coverage.

Tool Naming and Discoverability: Clear, descriptive tool names help agents find the right tools quickly. Use consistent prefixes (e.g., github_create_issue, github_list_repos) and action-oriented naming.

Context Management: Agents benefit from concise tool descriptions and the ability to filter/paginate results. Design tools that return focused, relevant data. Some clients support code execution which can help agents filter and process data efficiently.

Actionable Error Messages: Error messages should guide agents toward solutions with specific suggestions and next steps.

1.2 Study MCP Protocol Documentation

Navigate the MCP specification:

Start with the sitemap to find relevant pages: https://modelcontextprotocol.io/sitemap.xml

Then fetch specific pages with .md suffix for markdown format (e.g., https://modelcontextprotocol.io/specification/draft.md).

Key pages to review:

  • Specification overview and architecture
  • Transport mechanisms (streamable HTTP, stdio)
  • Tool, resource, and prompt definitions

1.3 Study Framework Documentation

Recommended stack:

  • Language: TypeScript (high-quality SDK support and good compatibility in many execution environments e.g. MCPB. Plus AI models are good at generating TypeScript code, benefiting from its broad usage, static typing and good linting tools)
  • Transport: Streamable HTTP for remote servers, using stateless JSON (simpler to scale and maintain, as opposed to stateful sessions and streaming responses). stdio for local servers.

Load framework documentation:

For TypeScript (recommended):

  • TypeScript SDK: Use WebFetch to load https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md
  • ⚡ TypeScript Guide - TypeScript patterns and examples

For Python:

  • Python SDK: Use WebFetch to load https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.md
  • 🐍 Python Guide - Python patterns and examples

1.4 Plan Your Implementation

Understand the API: Review the service's API documentation to identify key endpoints, authentication requirements, and data models. Use web search and WebFetch as needed.

Tool Selection: Prioritize comprehensive API coverage. List endpoints to implement, starting with the most common operations.


Phase 2: Implementation

2.1 Set Up Project Structure

See language-specific guides for project setup:

2.2 Implement Core Infrastructure

Create shared utilities:

  • API client with authentication
  • Error handling helpers
  • Response formatting (JSON/Markdown)
  • Pagination support

2.3 Implement Tools

For each tool:

Input Schema:

  • Use Zod (TypeScript) or Pydantic (Python)
  • Include constraints and clear descriptions
  • Add examples in field descriptions

Output Schema:

  • Define outputSchema where possible for structured data
  • Use structuredContent in tool responses (TypeScript SDK feature)
  • Helps clients understand and process tool outputs

Tool Description:

  • Concise summary of functionality
  • Parameter descriptions
  • Return type schema

Implementation:

  • Async/await for I/O operations
  • Proper error handling with actionable messages
  • Support pagination where applicable
  • Return both text content and structured data when using modern SDKs

Annotations:

  • readOnlyHint: true/false
  • destructiveHint: true/false
  • idempotentHint: true/false
  • openWorldHint: true/false

Phase 3: Review and Test

3.1 Code Quality

Review for:

  • No duplicated code (DRY principle)
  • Consistent error handling
  • Full type coverage
  • Clear tool descriptions

3.2 Build and Test

TypeScript:

  • Run npm run build to verify compilation
  • Test with MCP Inspector: npx @modelcontextprotocol/inspector

Python:

  • Verify syntax: python -m py_compile your_server.py
  • Test with MCP Inspector

See language-specific guides for detailed testing approaches and quality checklists.


Phase 4: Create Evaluations

After implementing your MCP server, create comprehensive evaluations to test its effectiveness.

Load ✅ Evaluation Guide for complete evaluation guidelines.

4.1 Understand Evaluation Purpose

Use evaluations to test whether LLMs can effectively use your MCP server to answer realistic, complex questions.

4.2 Create 10 Evaluation Questions

To create effective evaluations, follow the process outlined in the evaluation guide:

  1. Tool Inspection: List available tools and understand their capabilities
  2. Content Exploration: Use READ-ONLY operations to explore available data
  3. Question Generation: Create 10 complex, realistic questions
  4. Answer Verification: Solve each question yourself to verify answers

4.3 Evaluation Requirements

Ensure each question is:

  • Independent: Not dependent on other questions
  • Read-only: Only non-destructive operations required
  • Complex: Requiring multiple tool calls and deep exploration
  • Realistic: Based on real use cases humans would care about
  • Verifiable: Single, clear answer that can be verified by string comparison
  • Stable: Answer won't change over time

4.4 Output Format

Create an XML file with this structure:

<evaluation>
  <qa_pair>
    <question>Find discussions about AI model launches with animal codenames. One model needed a specific safety designation that uses the format ASL-X. What number X was being determined for the model named after a spotted wild cat?</question>
    <answer>3</answer>
  </qa_pair>
<!-- More qa_pairs... -->
</evaluation>

Reference Files

📚 Documentation Library

Load these resources as needed during development:

Core MCP Documentation (Load First)

  • MCP Protocol: Start with sitemap at https://modelcontextprotocol.io/sitemap.xml, then fetch specific pages with .md suffix
  • 📋 MCP Best Practices - Universal MCP guidelines including:
    • Server and tool naming conventions
    • Response format guidelines (JSON vs Markdown)
    • Pagination best practices
    • Transport selection (streamable HTTP vs stdio)
    • Security and error handling standards

SDK Documentation (Load During Phase 1/2)

  • Python SDK: Fetch from https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.md
  • TypeScript SDK: Fetch from https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md

Language-Specific Implementation Guides (Load During Phase 2)

  • 🐍 Python Implementation Guide - Complete Python/FastMCP guide with:

    • Server initialization patterns
    • Pydantic model examples
    • Tool registration with @mcp.tool
    • Complete working examples
    • Quality checklist
  • ⚡ TypeScript Implementation Guide - Complete TypeScript guide with:

    • Project structure
    • Zod schema patterns
    • Tool registration with server.registerTool
    • Complete working examples
    • Quality checklist

Evaluation Guide (Load During Phase 4)

  • ✅ Evaluation Guide - Complete evaluation creation guide with:
    • Question creation guidelines
    • Answer verification strategies
    • XML format specifications
    • Example questions and answers
    • Running an evaluation with the provided scripts
指导用户创建或更新Skill的指南。提供Skill构建原则,包括精简上下文、设定自由度及文件结构规范,帮助扩展Claude的专业知识与工作流能力。
用户想要创建新的Skill 用户需要更新现有Skill
dev/skill-creator/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill skill-creator -g -y
SKILL.md
Frontmatter
{
    "name": "skill-creator",
    "license": "Complete terms in LICENSE.txt",
    "description": "Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations."
}

Skill Creator

This skill provides guidance for creating effective skills.

About Skills

Skills are modular, self-contained packages that extend Claude's capabilities by providing specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific domains or tasks—they transform Claude from a general-purpose agent into a specialized agent equipped with procedural knowledge that no model can fully possess.

What Skills Provide

  1. Specialized workflows - Multi-step procedures for specific domains
  2. Tool integrations - Instructions for working with specific file formats or APIs
  3. Domain expertise - Company-specific knowledge, schemas, business logic
  4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks

Core Principles

Concise is Key

The context window is a public good. Skills share the context window with everything else Claude needs: system prompt, conversation history, other Skills' metadata, and the actual user request.

Default assumption: Claude is already very smart. Only add context Claude doesn't already have. Challenge each piece of information: "Does Claude really need this explanation?" and "Does this paragraph justify its token cost?"

Prefer concise examples over verbose explanations.

Set Appropriate Degrees of Freedom

Match the level of specificity to the task's fragility and variability:

High freedom (text-based instructions): Use when multiple approaches are valid, decisions depend on context, or heuristics guide the approach.

Medium freedom (pseudocode or scripts with parameters): Use when a preferred pattern exists, some variation is acceptable, or configuration affects behavior.

Low freedom (specific scripts, few parameters): Use when operations are fragile and error-prone, consistency is critical, or a specific sequence must be followed.

Think of Claude as exploring a path: a narrow bridge with cliffs needs specific guardrails (low freedom), while an open field allows many routes (high freedom).

Anatomy of a Skill

Every skill consists of a required SKILL.md file and optional bundled resources:

skill-name/
├── SKILL.md (required)
│   ├── YAML frontmatter metadata (required)
│   │   ├── name: (required)
│   │   └── description: (required)
│   └── Markdown instructions (required)
└── Bundled Resources (optional)
    ├── scripts/          - Executable code (Python/Bash/etc.)
    ├── references/       - Documentation intended to be loaded into context as needed
    └── assets/           - Files used in output (templates, icons, fonts, etc.)

SKILL.md (required)

Every SKILL.md consists of:

  • Frontmatter (YAML): Contains name and description fields. These are the only fields that Claude reads to determine when the skill gets used, thus it is very important to be clear and comprehensive in describing what the skill is, and when it should be used.
  • Body (Markdown): Instructions and guidance for using the skill. Only loaded AFTER the skill triggers (if at all).

Bundled Resources (optional)

Scripts (scripts/)

Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.

  • When to include: When the same code is being rewritten repeatedly or deterministic reliability is needed
  • Example: scripts/rotate_pdf.py for PDF rotation tasks
  • Benefits: Token efficient, deterministic, may be executed without loading into context
  • Note: Scripts may still need to be read by Claude for patching or environment-specific adjustments
References (references/)

Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking.

  • When to include: For documentation that Claude should reference while working
  • Examples: references/finance.md for financial schemas, references/mnda.md for company NDA template, references/policies.md for company policies, references/api_docs.md for API specifications
  • Use cases: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides
  • Benefits: Keeps SKILL.md lean, loaded only when Claude determines it's needed
  • Best practice: If files are large (>10k words), include grep search patterns in SKILL.md
  • Avoid duplication: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files.
Assets (assets/)

Files not intended to be loaded into context, but rather used within the output Claude produces.

  • When to include: When the skill needs files that will be used in the final output
  • Examples: assets/logo.png for brand assets, assets/slides.pptx for PowerPoint templates, assets/frontend-template/ for HTML/React boilerplate, assets/font.ttf for typography
  • Use cases: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified
  • Benefits: Separates output resources from documentation, enables Claude to use files without loading them into context

What to Not Include in a Skill

A skill should only contain essential files that directly support its functionality. Do NOT create extraneous documentation or auxiliary files, including:

  • README.md
  • INSTALLATION_GUIDE.md
  • QUICK_REFERENCE.md
  • CHANGELOG.md
  • etc.

The skill should only contain the information needed for an AI agent to do the job at hand. It should not contain auxilary context about the process that went into creating it, setup and testing procedures, user-facing documentation, etc. Creating additional documentation files just adds clutter and confusion.

Progressive Disclosure Design Principle

Skills use a three-level loading system to manage context efficiently:

  1. Metadata (name + description) - Always in context (~100 words)
  2. SKILL.md body - When skill triggers (<5k words)
  3. Bundled resources - As needed by Claude (Unlimited because scripts can be executed without reading into context window)

Progressive Disclosure Patterns

Keep SKILL.md body to the essentials and under 500 lines to minimize context bloat. Split content into separate files when approaching this limit. When splitting out content into other files, it is very important to reference them from SKILL.md and describe clearly when to read them, to ensure the reader of the skill knows they exist and when to use them.

Key principle: When a skill supports multiple variations, frameworks, or options, keep only the core workflow and selection guidance in SKILL.md. Move variant-specific details (patterns, examples, configuration) into separate reference files.

Pattern 1: High-level guide with references

# PDF Processing

## Quick start

Extract text with pdfplumber:
[code example]

## Advanced features

- **Form filling**: See [FORMS.md](FORMS.md) for complete guide
- **API reference**: See [REFERENCE.md](REFERENCE.md) for all methods
- **Examples**: See [EXAMPLES.md](EXAMPLES.md) for common patterns

Claude loads FORMS.md, REFERENCE.md, or EXAMPLES.md only when needed.

Pattern 2: Domain-specific organization

For Skills with multiple domains, organize content by domain to avoid loading irrelevant context:

bigquery-skill/
├── SKILL.md (overview and navigation)
└── reference/
    ├── finance.md (revenue, billing metrics)
    ├── sales.md (opportunities, pipeline)
    ├── product.md (API usage, features)
    └── marketing.md (campaigns, attribution)

When a user asks about sales metrics, Claude only reads sales.md.

Similarly, for skills supporting multiple frameworks or variants, organize by variant:

cloud-deploy/
├── SKILL.md (workflow + provider selection)
└── references/
    ├── aws.md (AWS deployment patterns)
    ├── gcp.md (GCP deployment patterns)
    └── azure.md (Azure deployment patterns)

When the user chooses AWS, Claude only reads aws.md.

Pattern 3: Conditional details

Show basic content, link to advanced content:

# DOCX Processing

## Creating documents

Use docx-js for new documents. See [DOCX-JS.md](DOCX-JS.md).

## Editing documents

For simple edits, modify the XML directly.

**For tracked changes**: See [REDLINING.md](REDLINING.md)
**For OOXML details**: See [OOXML.md](OOXML.md)

Claude reads REDLINING.md or OOXML.md only when the user needs those features.

Important guidelines:

  • Avoid deeply nested references - Keep references one level deep from SKILL.md. All reference files should link directly from SKILL.md.
  • Structure longer reference files - For files longer than 100 lines, include a table of contents at the top so Claude can see the full scope when previewing.

Skill Creation Process

Skill creation involves these steps:

  1. Understand the skill with concrete examples
  2. Plan reusable skill contents (scripts, references, assets)
  3. Initialize the skill (run init_skill.py)
  4. Edit the skill (implement resources and write SKILL.md)
  5. Package the skill (run package_skill.py)
  6. Iterate based on real usage

Follow these steps in order, skipping only if there is a clear reason why they are not applicable.

Step 1: Understanding the Skill with Concrete Examples

Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill.

To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback.

For example, when building an image-editor skill, relevant questions include:

  • "What functionality should the image-editor skill support? Editing, rotating, anything else?"
  • "Can you give some examples of how this skill would be used?"
  • "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?"
  • "What would a user say that should trigger this skill?"

To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness.

Conclude this step when there is a clear sense of the functionality the skill should support.

Step 2: Planning the Reusable Skill Contents

To turn concrete examples into an effective skill, analyze each example by:

  1. Considering how to execute on the example from scratch
  2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly

Example: When building a pdf-editor skill to handle queries like "Help me rotate this PDF," the analysis shows:

  1. Rotating a PDF requires re-writing the same code each time
  2. A scripts/rotate_pdf.py script would be helpful to store in the skill

Example: When designing a frontend-webapp-builder skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:

  1. Writing a frontend webapp requires the same boilerplate HTML/React each time
  2. An assets/hello-world/ template containing the boilerplate HTML/React project files would be helpful to store in the skill

Example: When building a big-query skill to handle queries like "How many users have logged in today?" the analysis shows:

  1. Querying BigQuery requires re-discovering the table schemas and relationships each time
  2. A references/schema.md file documenting the table schemas would be helpful to store in the skill

To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.

Step 3: Initializing the Skill

At this point, it is time to actually create the skill.

Skip this step only if the skill being developed already exists, and iteration or packaging is needed. In this case, continue to the next step.

When creating a new skill from scratch, always run the init_skill.py script. The script conveniently generates a new template skill directory that automatically includes everything a skill requires, making the skill creation process much more efficient and reliable.

Usage:

scripts/init_skill.py <skill-name> --path <output-directory>

The script:

  • Creates the skill directory at the specified path
  • Generates a SKILL.md template with proper frontmatter and TODO placeholders
  • Creates example resource directories: scripts/, references/, and assets/
  • Adds example files in each directory that can be customized or deleted

After initialization, customize or remove the generated SKILL.md and example files as needed.

Step 4: Edit the Skill

When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Include information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively.

Learn Proven Design Patterns

Consult these helpful guides based on your skill's needs:

  • Multi-step processes: See references/workflows.md for sequential workflows and conditional logic
  • Specific output formats or quality standards: See references/output-patterns.md for template and example patterns

These files contain established best practices for effective skill design.

Start with Reusable Skill Contents

To begin implementation, start with the reusable resources identified above: scripts/, references/, and assets/ files. Note that this step may require user input. For example, when implementing a brand-guidelines skill, the user may need to provide brand assets or templates to store in assets/, or documentation to store in references/.

Added scripts must be tested by actually running them to ensure there are no bugs and that the output matches what is expected. If there are many similar scripts, only a representative sample needs to be tested to ensure confidence that they all work while balancing time to completion.

Any example files and directories not needed for the skill should be deleted. The initialization script creates example files in scripts/, references/, and assets/ to demonstrate structure, but most skills won't need all of them.

Update SKILL.md

Writing Guidelines: Always use imperative/infinitive form.

Frontmatter

Write the YAML frontmatter with name and description:

  • name: The skill name
  • description: This is the primary triggering mechanism for your skill, and helps Claude understand when to use the skill.
    • Include both what the Skill does and specific triggers/contexts for when to use it.
    • Include all "when to use" information here - Not in the body. The body is only loaded after triggering, so "When to Use This Skill" sections in the body are not helpful to Claude.
    • Example description for a docx skill: "Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. Use when Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks"

Do not include any other fields in YAML frontmatter.

Body

Write instructions for using the skill and its bundled resources.

Step 5: Packaging a Skill

Once development of the skill is complete, it must be packaged into a distributable .skill file that gets shared with the user. The packaging process automatically validates the skill first to ensure it meets all requirements:

scripts/package_skill.py <path/to/skill-folder>

Optional output directory specification:

scripts/package_skill.py <path/to/skill-folder> ./dist

The packaging script will:

  1. Validate the skill automatically, checking:

    • YAML frontmatter format and required fields
    • Skill naming conventions and directory structure
    • Description completeness and quality
    • File organization and resource references
  2. Package the skill if validation passes, creating a .skill file named after the skill (e.g., my-skill.skill) that includes all files and maintains the proper directory structure for distribution. The .skill file is a zip file with a .skill extension.

If validation fails, the script will report the errors and exit without creating a package. Fix any validation errors and run the packaging command again.

Step 6: Iterate

After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.

Iteration workflow:

  1. Use the skill on real tasks
  2. Notice struggles or inefficiencies
  3. Identify how SKILL.md or bundled resources should be updated
  4. Implement changes and test again
用于在claude.ai构建复杂多组件前端HTML Artifact的工具集。支持React、Tailwind CSS及shadcn/ui,通过脚本初始化项目、开发并打包为单文件HTML,适用于需状态管理或路由的复杂场景。
需要创建复杂的交互式前端界面 要求使用React和shadcn/ui组件库 生成包含状态管理或路由功能的Web应用
dev/web-artifacts-builder/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill web-artifacts-builder -g -y
SKILL.md
Frontmatter
{
    "name": "web-artifacts-builder",
    "license": "Complete terms in LICENSE.txt",
    "description": "Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\/ui). Use for complex artifacts requiring state management, routing, or shadcn\/ui components - not for simple single-file HTML\/JSX artifacts."
}

Web Artifacts Builder

To build powerful frontend claude.ai artifacts, follow these steps:

  1. Initialize the frontend repo using scripts/init-artifact.sh
  2. Develop your artifact by editing the generated code
  3. Bundle all code into a single HTML file using scripts/bundle-artifact.sh
  4. Display artifact to user
  5. (Optional) Test the artifact

Stack: React 18 + TypeScript + Vite + Parcel (bundling) + Tailwind CSS + shadcn/ui

Design & Style Guidelines

VERY IMPORTANT: To avoid what is often referred to as "AI slop", avoid using excessive centered layouts, purple gradients, uniform rounded corners, and Inter font.

Quick Start

Step 1: Initialize Project

Run the initialization script to create a new React project:

bash scripts/init-artifact.sh <project-name>
cd <project-name>

This creates a fully configured project with:

  • ✅ React + TypeScript (via Vite)
  • ✅ Tailwind CSS 3.4.1 with shadcn/ui theming system
  • ✅ Path aliases (@/) configured
  • ✅ 40+ shadcn/ui components pre-installed
  • ✅ All Radix UI dependencies included
  • ✅ Parcel configured for bundling (via .parcelrc)
  • ✅ Node 18+ compatibility (auto-detects and pins Vite version)

Step 2: Develop Your Artifact

To build the artifact, edit the generated files. See Common Development Tasks below for guidance.

Step 3: Bundle to Single HTML File

To bundle the React app into a single HTML artifact:

bash scripts/bundle-artifact.sh

This creates bundle.html - a self-contained artifact with all JavaScript, CSS, and dependencies inlined. This file can be directly shared in Claude conversations as an artifact.

Requirements: Your project must have an index.html in the root directory.

What the script does:

  • Installs bundling dependencies (parcel, @parcel/config-default, parcel-resolver-tspaths, html-inline)
  • Creates .parcelrc config with path alias support
  • Builds with Parcel (no source maps)
  • Inlines all assets into single HTML using html-inline

Step 4: Share Artifact with User

Finally, share the bundled HTML file in conversation with the user so they can view it as an artifact.

Step 5: Testing/Visualizing the Artifact (Optional)

Note: This is a completely optional step. Only perform if necessary or requested.

To test/visualize the artifact, use available tools (including other Skills or built-in tools like Playwright or Puppeteer). In general, avoid testing the artifact upfront as it adds latency between the request and when the finished artifact can be seen. Test later, after presenting the artifact, if requested or if issues arise.

Reference

用于通过Playwright测试本地Web应用的工具包。支持管理服务器生命周期、验证前端功能、调试UI行为及捕获截图和日志。建议将辅助脚本作为黑盒调用,遵循先侦察后操作的流程,并注意等待网络空闲状态。
需要自动化测试本地Web应用界面 需要调试前端UI行为或捕获浏览器截图 需要验证动态Web应用的前端功能
dev/webapp-testing/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill webapp-testing -g -y
SKILL.md
Frontmatter
{
    "name": "webapp-testing",
    "license": "Complete terms in LICENSE.txt",
    "description": "Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs."
}

Web Application Testing

To test local web applications, write native Python Playwright scripts.

Helper Scripts Available:

  • scripts/with_server.py - Manages server lifecycle (supports multiple servers)

Always run scripts with --help first to see usage. DO NOT read the source until you try running the script first and find that a customized solution is abslutely necessary. These scripts can be very large and thus pollute your context window. They exist to be called directly as black-box scripts rather than ingested into your context window.

Decision Tree: Choosing Your Approach

User task → Is it static HTML?
    ├─ Yes → Read HTML file directly to identify selectors
    │         ├─ Success → Write Playwright script using selectors
    │         └─ Fails/Incomplete → Treat as dynamic (below)
    │
    └─ No (dynamic webapp) → Is the server already running?
        ├─ No → Run: python scripts/with_server.py --help
        │        Then use the helper + write simplified Playwright script
        │
        └─ Yes → Reconnaissance-then-action:
            1. Navigate and wait for networkidle
            2. Take screenshot or inspect DOM
            3. Identify selectors from rendered state
            4. Execute actions with discovered selectors

Example: Using with_server.py

To start a server, run --help first, then use the helper:

Single server:

python scripts/with_server.py --server "npm run dev" --port 5173 -- python your_automation.py

Multiple servers (e.g., backend + frontend):

python scripts/with_server.py \
  --server "cd backend && python server.py" --port 3000 \
  --server "cd frontend && npm run dev" --port 5173 \
  -- python your_automation.py

To create an automation script, include only Playwright logic (servers are managed automatically):

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True) # Always launch chromium in headless mode
    page = browser.new_page()
    page.goto('http://localhost:5173') # Server already running and ready
    page.wait_for_load_state('networkidle') # CRITICAL: Wait for JS to execute
    # ... your automation logic
    browser.close()

Reconnaissance-Then-Action Pattern

  1. Inspect rendered DOM:

    page.screenshot(path='/tmp/inspect.png', full_page=True)
    content = page.content()
    page.locator('button').all()
    
  2. Identify selectors from inspection results

  3. Execute actions using discovered selectors

Common Pitfall

Don't inspect the DOM before waiting for networkidle on dynamic apps ✅ Do wait for page.wait_for_load_state('networkidle') before inspection

Best Practices

  • Use bundled scripts as black boxes - To accomplish a task, consider whether one of the scripts available in scripts/ can help. These scripts handle common, complex workflows reliably without cluttering the context window. Use --help to see usage, then invoke directly.
  • Use sync_playwright() for synchronous scripts
  • Always close the browser when done
  • Use descriptive selectors: text=, role=, CSS selectors, or IDs
  • Add appropriate waits: page.wait_for_selector() or page.wait_for_timeout()

Reference Files

  • examples/ - Examples showing common patterns:
    • element_discovery.py - Discovering buttons, links, and inputs on a page
    • static_html_automation.py - Using file:// URLs for local HTML
    • console_logging.py - Capturing console logs during automation
引导用户通过结构化流程协作撰写文档。包含上下文收集、迭代优化和读者测试三阶段,帮助用户高效转移背景信息、完善内容并确保文档对读者友好。适用于技术规格、提案等文档创作。
用户提到编写文档或提案 用户创建技术规格或决策文档 用户开始大型写作任务
docs/doc-coauthoring/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill doc-coauthoring -g -y
SKILL.md
Frontmatter
{
    "name": "doc-coauthoring",
    "description": "Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks."
}

Doc Co-Authoring Workflow

This skill provides a structured workflow for guiding users through collaborative document creation. Act as an active guide, walking users through three stages: Context Gathering, Refinement & Structure, and Reader Testing.

When to Offer This Workflow

Trigger conditions:

  • User mentions writing documentation: "write a doc", "draft a proposal", "create a spec", "write up"
  • User mentions specific doc types: "PRD", "design doc", "decision doc", "RFC"
  • User seems to be starting a substantial writing task

Initial offer: Offer the user a structured workflow for co-authoring the document. Explain the three stages:

  1. Context Gathering: User provides all relevant context while Claude asks clarifying questions
  2. Refinement & Structure: Iteratively build each section through brainstorming and editing
  3. Reader Testing: Test the doc with a fresh Claude (no context) to catch blind spots before others read it

Explain that this approach helps ensure the doc works well when others read it (including when they paste it into Claude). Ask if they want to try this workflow or prefer to work freeform.

If user declines, work freeform. If user accepts, proceed to Stage 1.

Stage 1: Context Gathering

Goal: Close the gap between what the user knows and what Claude knows, enabling smart guidance later.

Initial Questions

Start by asking the user for meta-context about the document:

  1. What type of document is this? (e.g., technical spec, decision doc, proposal)
  2. Who's the primary audience?
  3. What's the desired impact when someone reads this?
  4. Is there a template or specific format to follow?
  5. Any other constraints or context to know?

Inform them they can answer in shorthand or dump information however works best for them.

If user provides a template or mentions a doc type:

  • Ask if they have a template document to share
  • If they provide a link to a shared document, use the appropriate integration to fetch it
  • If they provide a file, read it

If user mentions editing an existing shared document:

  • Use the appropriate integration to read the current state
  • Check for images without alt-text
  • If images exist without alt-text, explain that when others use Claude to understand the doc, Claude won't be able to see them. Ask if they want alt-text generated. If so, request they paste each image into chat for descriptive alt-text generation.

Info Dumping

Once initial questions are answered, encourage the user to dump all the context they have. Request information such as:

  • Background on the project/problem
  • Related team discussions or shared documents
  • Why alternative solutions aren't being used
  • Organizational context (team dynamics, past incidents, politics)
  • Timeline pressures or constraints
  • Technical architecture or dependencies
  • Stakeholder concerns

Advise them not to worry about organizing it - just get it all out. Offer multiple ways to provide context:

  • Info dump stream-of-consciousness
  • Point to team channels or threads to read
  • Link to shared documents

If integrations are available (e.g., Slack, Teams, Google Drive, SharePoint, or other MCP servers), mention that these can be used to pull in context directly.

If no integrations are detected and in Claude.ai or Claude app: Suggest they can enable connectors in their Claude settings to allow pulling context from messaging apps and document storage directly.

Inform them clarifying questions will be asked once they've done their initial dump.

During context gathering:

  • If user mentions team channels or shared documents:

    • If integrations available: Inform them the content will be read now, then use the appropriate integration
    • If integrations not available: Explain lack of access. Suggest they enable connectors in Claude settings, or paste the relevant content directly.
  • If user mentions entities/projects that are unknown:

    • Ask if connected tools should be searched to learn more
    • Wait for user confirmation before searching
  • As user provides context, track what's being learned and what's still unclear

Asking clarifying questions:

When user signals they've done their initial dump (or after substantial context provided), ask clarifying questions to ensure understanding:

Generate 5-10 numbered questions based on gaps in the context.

Inform them they can use shorthand to answer (e.g., "1: yes, 2: see #channel, 3: no because backwards compat"), link to more docs, point to channels to read, or just keep info-dumping. Whatever's most efficient for them.

Exit condition: Sufficient context has been gathered when questions show understanding - when edge cases and trade-offs can be asked about without needing basics explained.

Transition: Ask if there's any more context they want to provide at this stage, or if it's time to move on to drafting the document.

If user wants to add more, let them. When ready, proceed to Stage 2.

Stage 2: Refinement & Structure

Goal: Build the document section by section through brainstorming, curation, and iterative refinement.

Instructions to user: Explain that the document will be built section by section. For each section:

  1. Clarifying questions will be asked about what to include
  2. 5-20 options will be brainstormed
  3. User will indicate what to keep/remove/combine
  4. The section will be drafted
  5. It will be refined through surgical edits

Start with whichever section has the most unknowns (usually the core decision/proposal), then work through the rest.

Section ordering:

If the document structure is clear: Ask which section they'd like to start with.

Suggest starting with whichever section has the most unknowns. For decision docs, that's usually the core proposal. For specs, it's typically the technical approach. Summary sections are best left for last.

If user doesn't know what sections they need: Based on the type of document and template, suggest 3-5 sections appropriate for the doc type.

Ask if this structure works, or if they want to adjust it.

Once structure is agreed:

Create the initial document structure with placeholder text for all sections.

If access to artifacts is available: Use create_file to create an artifact. This gives both Claude and the user a scaffold to work from.

Inform them that the initial structure with placeholders for all sections will be created.

Create artifact with all section headers and brief placeholder text like "[To be written]" or "[Content here]".

Provide the scaffold link and indicate it's time to fill in each section.

If no access to artifacts: Create a markdown file in the working directory. Name it appropriately (e.g., decision-doc.md, technical-spec.md).

Inform them that the initial structure with placeholders for all sections will be created.

Create file with all section headers and placeholder text.

Confirm the filename has been created and indicate it's time to fill in each section.

For each section:

Step 1: Clarifying Questions

Announce work will begin on the [SECTION NAME] section. Ask 5-10 clarifying questions about what should be included:

Generate 5-10 specific questions based on context and section purpose.

Inform them they can answer in shorthand or just indicate what's important to cover.

Step 2: Brainstorming

For the [SECTION NAME] section, brainstorm [5-20] things that might be included, depending on the section's complexity. Look for:

  • Context shared that might have been forgotten
  • Angles or considerations not yet mentioned

Generate 5-20 numbered options based on section complexity. At the end, offer to brainstorm more if they want additional options.

Step 3: Curation

Ask which points should be kept, removed, or combined. Request brief justifications to help learn priorities for the next sections.

Provide examples:

  • "Keep 1,4,7,9"
  • "Remove 3 (duplicates 1)"
  • "Remove 6 (audience already knows this)"
  • "Combine 11 and 12"

If user gives freeform feedback (e.g., "looks good" or "I like most of it but...") instead of numbered selections, extract their preferences and proceed. Parse what they want kept/removed/changed and apply it.

Step 4: Gap Check

Based on what they've selected, ask if there's anything important missing for the [SECTION NAME] section.

Step 5: Drafting

Use str_replace to replace the placeholder text for this section with the actual drafted content.

Announce the [SECTION NAME] section will be drafted now based on what they've selected.

If using artifacts: After drafting, provide a link to the artifact.

Ask them to read through it and indicate what to change. Note that being specific helps learning for the next sections.

If using a file (no artifacts): After drafting, confirm completion.

Inform them the [SECTION NAME] section has been drafted in [filename]. Ask them to read through it and indicate what to change. Note that being specific helps learning for the next sections.

Key instruction for user (include when drafting the first section): Provide a note: Instead of editing the doc directly, ask them to indicate what to change. This helps learning of their style for future sections. For example: "Remove the X bullet - already covered by Y" or "Make the third paragraph more concise".

Step 6: Iterative Refinement

As user provides feedback:

  • Use str_replace to make edits (never reprint the whole doc)
  • If using artifacts: Provide link to artifact after each edit
  • If using files: Just confirm edits are complete
  • If user edits doc directly and asks to read it: mentally note the changes they made and keep them in mind for future sections (this shows their preferences)

Continue iterating until user is satisfied with the section.

Quality Checking

After 3 consecutive iterations with no substantial changes, ask if anything can be removed without losing important information.

When section is done, confirm [SECTION NAME] is complete. Ask if ready to move to the next section.

Repeat for all sections.

Near Completion

As approaching completion (80%+ of sections done), announce intention to re-read the entire document and check for:

  • Flow and consistency across sections
  • Redundancy or contradictions
  • Anything that feels like "slop" or generic filler
  • Whether every sentence carries weight

Read entire document and provide feedback.

When all sections are drafted and refined: Announce all sections are drafted. Indicate intention to review the complete document one more time.

Review for overall coherence, flow, completeness.

Provide any final suggestions.

Ask if ready to move to Reader Testing, or if they want to refine anything else.

Stage 3: Reader Testing

Goal: Test the document with a fresh Claude (no context bleed) to verify it works for readers.

Instructions to user: Explain that testing will now occur to see if the document actually works for readers. This catches blind spots - things that make sense to the authors but might confuse others.

Testing Approach

If access to sub-agents is available (e.g., in Claude Code):

Perform the testing directly without user involvement.

Step 1: Predict Reader Questions

Announce intention to predict what questions readers might ask when trying to discover this document.

Generate 5-10 questions that readers would realistically ask.

Step 2: Test with Sub-Agent

Announce that these questions will be tested with a fresh Claude instance (no context from this conversation).

For each question, invoke a sub-agent with just the document content and the question.

Summarize what Reader Claude got right/wrong for each question.

Step 3: Run Additional Checks

Announce additional checks will be performed.

Invoke sub-agent to check for ambiguity, false assumptions, contradictions.

Summarize any issues found.

Step 4: Report and Fix

If issues found: Report that Reader Claude struggled with specific issues.

List the specific issues.

Indicate intention to fix these gaps.

Loop back to refinement for problematic sections.


If no access to sub-agents (e.g., claude.ai web interface):

The user will need to do the testing manually.

Step 1: Predict Reader Questions

Ask what questions people might ask when trying to discover this document. What would they type into Claude.ai?

Generate 5-10 questions that readers would realistically ask.

Step 2: Setup Testing

Provide testing instructions:

  1. Open a fresh Claude conversation: https://claude.ai
  2. Paste or share the document content (if using a shared doc platform with connectors enabled, provide the link)
  3. Ask Reader Claude the generated questions

For each question, instruct Reader Claude to provide:

  • The answer
  • Whether anything was ambiguous or unclear
  • What knowledge/context the doc assumes is already known

Check if Reader Claude gives correct answers or misinterprets anything.

Step 3: Additional Checks

Also ask Reader Claude:

  • "What in this doc might be ambiguous or unclear to readers?"
  • "What knowledge or context does this doc assume readers already have?"
  • "Are there any internal contradictions or inconsistencies?"

Step 4: Iterate Based on Results

Ask what Reader Claude got wrong or struggled with. Indicate intention to fix those gaps.

Loop back to refinement for any problematic sections.


Exit Condition (Both Approaches)

When Reader Claude consistently answers questions correctly and doesn't surface new gaps or ambiguities, the doc is ready.

Final Review

When Reader Testing passes: Announce the doc has passed Reader Claude testing. Before completion:

  1. Recommend they do a final read-through themselves - they own this document and are responsible for its quality
  2. Suggest double-checking any facts, links, or technical details
  3. Ask them to verify it achieves the impact they wanted

Ask if they want one more review, or if the work is done.

If user wants final review, provide it. Otherwise: Announce document completion. Provide a few final tips:

  • Consider linking this conversation in an appendix so readers can see how the doc was developed
  • Use appendices to provide depth without bloating the main doc
  • Update the doc as feedback is received from real readers

Tips for Effective Guidance

Tone:

  • Be direct and procedural
  • Explain rationale briefly when it affects user behavior
  • Don't try to "sell" the approach - just execute it

Handling Deviations:

  • If user wants to skip a stage: Ask if they want to skip this and write freeform
  • If user seems frustrated: Acknowledge this is taking longer than expected. Suggest ways to move faster
  • Always give user agency to adjust the process

Context Management:

  • Throughout, if context is missing on something mentioned, proactively ask
  • Don't let gaps accumulate - address them as they come up

Artifact Management:

  • Use create_file for drafting full sections
  • Use str_replace for all edits
  • Provide artifact link after every change
  • Never use artifacts for brainstorming lists - that's just conversation

Quality over Speed:

  • Don't rush through stages
  • Each iteration should make meaningful improvements
  • The goal is a document that actually works for readers
提供.docx文件的创建、编辑和分析能力。支持文本提取、原始XML访问、基于docx-js的新文档生成,以及使用Document库进行基础或红线条款编辑,适用于法律、学术等复杂文档处理。
需要创建新的Word文档 需要修改或编辑现有文档内容 需要分析文档中的修订痕迹或评论 需要从.docx文件中提取纯文本或元数据
docs/docx/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill docx -g -y
SKILL.md
Frontmatter
{
    "name": "docx",
    "license": "Proprietary. LICENSE.txt has complete terms",
    "description": "Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks"
}

DOCX creation, editing, and analysis

Overview

A user may ask you to create, edit, or analyze the contents of a .docx file. A .docx file is essentially a ZIP archive containing XML files and other resources that you can read or edit. You have different tools and workflows available for different tasks.

Workflow Decision Tree

Reading/Analyzing Content

Use "Text extraction" or "Raw XML access" sections below

Creating New Document

Use "Creating a new Word document" workflow

Editing Existing Document

  • Your own document + simple changes Use "Basic OOXML editing" workflow

  • Someone else's document Use "Redlining workflow" (recommended default)

  • Legal, academic, business, or government docs Use "Redlining workflow" (required)

Reading and analyzing content

Text extraction

If you just need to read the text contents of a document, you should convert the document to markdown using pandoc. Pandoc provides excellent support for preserving document structure and can show tracked changes:

# Convert document to markdown with tracked changes
pandoc --track-changes=all path-to-file.docx -o output.md
# Options: --track-changes=accept/reject/all

Raw XML access

You need raw XML access for: comments, complex formatting, document structure, embedded media, and metadata. For any of these features, you'll need to unpack a document and read its raw XML contents.

Unpacking a file

python ooxml/scripts/unpack.py <office_file> <output_directory>

Key file structures

  • word/document.xml - Main document contents
  • word/comments.xml - Comments referenced in document.xml
  • word/media/ - Embedded images and media files
  • Tracked changes use <w:ins> (insertions) and <w:del> (deletions) tags

Creating a new Word document

When creating a new Word document from scratch, use docx-js, which allows you to create Word documents using JavaScript/TypeScript.

Workflow

  1. MANDATORY - READ ENTIRE FILE: Read docx-js.md (~500 lines) completely from start to finish. NEVER set any range limits when reading this file. Read the full file content for detailed syntax, critical formatting rules, and best practices before proceeding with document creation.
  2. Create a JavaScript/TypeScript file using Document, Paragraph, TextRun components (You can assume all dependencies are installed, but if not, refer to the dependencies section below)
  3. Export as .docx using Packer.toBuffer()

Editing an existing Word document

When editing an existing Word document, use the Document library (a Python library for OOXML manipulation). The library automatically handles infrastructure setup and provides methods for document manipulation. For complex scenarios, you can access the underlying DOM directly through the library.

Workflow

  1. MANDATORY - READ ENTIRE FILE: Read ooxml.md (~600 lines) completely from start to finish. NEVER set any range limits when reading this file. Read the full file content for the Document library API and XML patterns for directly editing document files.
  2. Unpack the document: python ooxml/scripts/unpack.py <office_file> <output_directory>
  3. Create and run a Python script using the Document library (see "Document Library" section in ooxml.md)
  4. Pack the final document: python ooxml/scripts/pack.py <input_directory> <office_file>

The Document library provides both high-level methods for common operations and direct DOM access for complex scenarios.

Redlining workflow for document review

This workflow allows you to plan comprehensive tracked changes using markdown before implementing them in OOXML. CRITICAL: For complete tracked changes, you must implement ALL changes systematically.

Batching Strategy: Group related changes into batches of 3-10 changes. This makes debugging manageable while maintaining efficiency. Test each batch before moving to the next.

Principle: Minimal, Precise Edits When implementing tracked changes, only mark text that actually changes. Repeating unchanged text makes edits harder to review and appears unprofessional. Break replacements into: [unchanged text] + [deletion] + [insertion] + [unchanged text]. Preserve the original run's RSID for unchanged text by extracting the <w:r> element from the original and reusing it.

Example - Changing "30 days" to "60 days" in a sentence:

# BAD - Replaces entire sentence
'<w:del><w:r><w:delText>The term is 30 days.</w:delText></w:r></w:del><w:ins><w:r><w:t>The term is 60 days.</w:t></w:r></w:ins>'

# GOOD - Only marks what changed, preserves original <w:r> for unchanged text
'<w:r w:rsidR="00AB12CD"><w:t>The term is </w:t></w:r><w:del><w:r><w:delText>30</w:delText></w:r></w:del><w:ins><w:r><w:t>60</w:t></w:r></w:ins><w:r w:rsidR="00AB12CD"><w:t> days.</w:t></w:r>'

Tracked changes workflow

  1. Get markdown representation: Convert document to markdown with tracked changes preserved:

    pandoc --track-changes=all path-to-file.docx -o current.md
    
  2. Identify and group changes: Review the document and identify ALL changes needed, organizing them into logical batches:

    Location methods (for finding changes in XML):

    • Section/heading numbers (e.g., "Section 3.2", "Article IV")
    • Paragraph identifiers if numbered
    • Grep patterns with unique surrounding text
    • Document structure (e.g., "first paragraph", "signature block")
    • DO NOT use markdown line numbers - they don't map to XML structure

    Batch organization (group 3-10 related changes per batch):

    • By section: "Batch 1: Section 2 amendments", "Batch 2: Section 5 updates"
    • By type: "Batch 1: Date corrections", "Batch 2: Party name changes"
    • By complexity: Start with simple text replacements, then tackle complex structural changes
    • Sequential: "Batch 1: Pages 1-3", "Batch 2: Pages 4-6"
  3. Read documentation and unpack:

    • MANDATORY - READ ENTIRE FILE: Read ooxml.md (~600 lines) completely from start to finish. NEVER set any range limits when reading this file. Pay special attention to the "Document Library" and "Tracked Change Patterns" sections.
    • Unpack the document: python ooxml/scripts/unpack.py <file.docx> <dir>
    • Note the suggested RSID: The unpack script will suggest an RSID to use for your tracked changes. Copy this RSID for use in step 4b.
  4. Implement changes in batches: Group changes logically (by section, by type, or by proximity) and implement them together in a single script. This approach:

    • Makes debugging easier (smaller batch = easier to isolate errors)
    • Allows incremental progress
    • Maintains efficiency (batch size of 3-10 changes works well)

    Suggested batch groupings:

    • By document section (e.g., "Section 3 changes", "Definitions", "Termination clause")
    • By change type (e.g., "Date changes", "Party name updates", "Legal term replacements")
    • By proximity (e.g., "Changes on pages 1-3", "Changes in first half of document")

    For each batch of related changes:

    a. Map text to XML: Grep for text in word/document.xml to verify how text is split across <w:r> elements.

    b. Create and run script: Use get_node to find nodes, implement changes, then doc.save(). See "Document Library" section in ooxml.md for patterns.

    Note: Always grep word/document.xml immediately before writing a script to get current line numbers and verify text content. Line numbers change after each script run.

  5. Pack the document: After all batches are complete, convert the unpacked directory back to .docx:

    python ooxml/scripts/pack.py unpacked reviewed-document.docx
    
  6. Final verification: Do a comprehensive check of the complete document:

    • Convert final document to markdown:
      pandoc --track-changes=all reviewed-document.docx -o verification.md
      
    • Verify ALL changes were applied correctly:
      grep "original phrase" verification.md  # Should NOT find it
      grep "replacement phrase" verification.md  # Should find it
      
    • Check that no unintended changes were introduced

Converting Documents to Images

To visually analyze Word documents, convert them to images using a two-step process:

  1. Convert DOCX to PDF:

    soffice --headless --convert-to pdf document.docx
    
  2. Convert PDF pages to JPEG images:

    pdftoppm -jpeg -r 150 document.pdf page
    

    This creates files like page-1.jpg, page-2.jpg, etc.

Options:

  • -r 150: Sets resolution to 150 DPI (adjust for quality/size balance)
  • -jpeg: Output JPEG format (use -png for PNG if preferred)
  • -f N: First page to convert (e.g., -f 2 starts from page 2)
  • -l N: Last page to convert (e.g., -l 5 stops at page 5)
  • page: Prefix for output files

Example for specific range:

pdftoppm -jpeg -r 150 -f 2 -l 5 document.pdf page  # Converts only pages 2-5

Code Style Guidelines

IMPORTANT: When generating code for DOCX operations:

  • Write concise code
  • Avoid verbose variable names and redundant operations
  • Avoid unnecessary print statements

Dependencies

Required dependencies (install if not available):

  • pandoc: sudo apt-get install pandoc (for text extraction)
  • docx: npm install -g docx (for creating new documents)
  • LibreOffice: sudo apt-get install libreoffice (for PDF conversion)
  • Poppler: sudo apt-get install poppler-utils (for pdftoppm to convert PDF to images)
  • defusedxml: pip install defusedxml (for secure XML parsing)
根据仓库元数据和用户输入,生成中英双语的 GitHub Release 文档(README.md 和 README.zh.md),并指导 git add、commit 及 push 操作。
编写或润色 README 文件 创建双语文档 准备 GitHub Release 提及 release assistant 或 README 生成
docs/github-release-assistant/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill github-release-assistant -g -y
SKILL.md
Frontmatter
{
    "name": "github-release-assistant",
    "description": "Generate bilingual GitHub release documentation (README.md + README.zh.md) from repo metadata and user input, and guide release prep with git add\/commit\/push. Use when the user asks to write or polish README files, create bilingual docs, prepare a GitHub release, or mentions release assistant\/README generation."
}

GitHub Release Assistant

Overview

Generate polished README files in English and Chinese using repo facts plus a small config file, following a concise “Redmax-style” layout. Produce README.md + README.zh.md, then optionally guide a clean git commit and push.

Workflow

  1. Collect repo facts from config.json, README.md, PROJECT_STRUCTURE.md, requirements*.txt, and docs/.
  2. Ask for missing details or have the user fill release_assistant.json (see assets/release_config.example.json).
  3. Run the generator script to write README files.
  4. Review the diff with the user and refine content if needed.
  5. If requested, stage/commit/push changes with explicit confirmation.

Quick Start

  • Create or edit release_assistant.json in the repo root (optional but recommended).
  • Run: python3 /Users/cuizhanlin/.codex/skills/github-release-assistant/scripts/generate_release_readme.py --project-root <repo> --language both --overwrite
  • Verify README.md and README.zh.md.

Git Workflow (Commit + Push)

  • Run git status and git diff to show changes.
  • Ask for confirmation before git add, git commit, and git push.
  • Propose a concise commit message (e.g., docs: add bilingual README), and wait for approval.

Resources

  • Script: scripts/generate_release_readme.py.
  • Templates: assets/readme_template_en.md, assets/readme_template_zh.md.
  • Config example: assets/release_config.example.json.
  • Style cues: references/redmax_style.md.
  • Outline guide: references/readme_outline.md.
该技能用于撰写各类公司内部沟通内容,如状态报告、领导层更新、FAQ、新闻通讯等。通过识别通信类型并加载对应示例指南文件,遵循特定格式和语气要求生成内容,确保符合公司规范。
需要撰写3P更新(进度、计划、问题) 需要编写公司新闻通讯 需要回答常见问题FAQ 需要提交状态报告 需要起草领导层更新 需要发布项目更新 需要编写事故报告
docs/internal-comms/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill internal-comms -g -y
SKILL.md
Frontmatter
{
    "name": "internal-comms",
    "license": "Complete terms in LICENSE.txt",
    "description": "A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.)."
}

When to use this skill

To write internal communications, use this skill for:

  • 3P updates (Progress, Plans, Problems)
  • Company newsletters
  • FAQ responses
  • Status reports
  • Leadership updates
  • Project updates
  • Incident reports

How to use this skill

To write any internal communication:

  1. Identify the communication type from the request
  2. Load the appropriate guideline file from the examples/ directory:
    • examples/3p-updates.md - For Progress/Plans/Problems team updates
    • examples/company-newsletter.md - For company-wide newsletters
    • examples/faq-answers.md - For answering frequently asked questions
    • examples/general-comms.md - For anything else that doesn't explicitly match one of the above
  3. Follow the specific instructions in that file for formatting, tone, and content gathering

If the communication type doesn't match any existing guideline, ask for clarification or more context about the desired format.

Keywords

3P updates, company newsletter, company comms, weekly update, faqs, common questions, updates, internal comms

提供PDF处理工具包,支持文本与表格提取、文档合并拆分、元数据读取、页面旋转及表单填写。适用于批量生成、分析和程序化处理PDF文件。
需要提取PDF中的文本或表格内容 请求合并、拆分或旋转PDF文档 需要创建新的PDF文件或填充PDF表单
docs/pdf/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill pdf -g -y
SKILL.md
Frontmatter
{
    "name": "pdf",
    "license": "Proprietary. LICENSE.txt has complete terms",
    "description": "Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging\/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale."
}

PDF Processing Guide

Overview

This guide covers essential PDF processing operations using Python libraries and command-line tools. For advanced features, JavaScript libraries, and detailed examples, see reference.md. If you need to fill out a PDF form, read forms.md and follow its instructions.

Quick Start

from pypdf import PdfReader, PdfWriter

# Read a PDF
reader = PdfReader("document.pdf")
print(f"Pages: {len(reader.pages)}")

# Extract text
text = ""
for page in reader.pages:
    text += page.extract_text()

Python Libraries

pypdf - Basic Operations

Merge PDFs

from pypdf import PdfWriter, PdfReader

writer = PdfWriter()
for pdf_file in ["doc1.pdf", "doc2.pdf", "doc3.pdf"]:
    reader = PdfReader(pdf_file)
    for page in reader.pages:
        writer.add_page(page)

with open("merged.pdf", "wb") as output:
    writer.write(output)

Split PDF

reader = PdfReader("input.pdf")
for i, page in enumerate(reader.pages):
    writer = PdfWriter()
    writer.add_page(page)
    with open(f"page_{i+1}.pdf", "wb") as output:
        writer.write(output)

Extract Metadata

reader = PdfReader("document.pdf")
meta = reader.metadata
print(f"Title: {meta.title}")
print(f"Author: {meta.author}")
print(f"Subject: {meta.subject}")
print(f"Creator: {meta.creator}")

Rotate Pages

reader = PdfReader("input.pdf")
writer = PdfWriter()

page = reader.pages[0]
page.rotate(90)  # Rotate 90 degrees clockwise
writer.add_page(page)

with open("rotated.pdf", "wb") as output:
    writer.write(output)

pdfplumber - Text and Table Extraction

Extract Text with Layout

import pdfplumber

with pdfplumber.open("document.pdf") as pdf:
    for page in pdf.pages:
        text = page.extract_text()
        print(text)

Extract Tables

with pdfplumber.open("document.pdf") as pdf:
    for i, page in enumerate(pdf.pages):
        tables = page.extract_tables()
        for j, table in enumerate(tables):
            print(f"Table {j+1} on page {i+1}:")
            for row in table:
                print(row)

Advanced Table Extraction

import pandas as pd

with pdfplumber.open("document.pdf") as pdf:
    all_tables = []
    for page in pdf.pages:
        tables = page.extract_tables()
        for table in tables:
            if table:  # Check if table is not empty
                df = pd.DataFrame(table[1:], columns=table[0])
                all_tables.append(df)

# Combine all tables
if all_tables:
    combined_df = pd.concat(all_tables, ignore_index=True)
    combined_df.to_excel("extracted_tables.xlsx", index=False)

reportlab - Create PDFs

Basic PDF Creation

from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas

c = canvas.Canvas("hello.pdf", pagesize=letter)
width, height = letter

# Add text
c.drawString(100, height - 100, "Hello World!")
c.drawString(100, height - 120, "This is a PDF created with reportlab")

# Add a line
c.line(100, height - 140, 400, height - 140)

# Save
c.save()

Create PDF with Multiple Pages

from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak
from reportlab.lib.styles import getSampleStyleSheet

doc = SimpleDocTemplate("report.pdf", pagesize=letter)
styles = getSampleStyleSheet()
story = []

# Add content
title = Paragraph("Report Title", styles['Title'])
story.append(title)
story.append(Spacer(1, 12))

body = Paragraph("This is the body of the report. " * 20, styles['Normal'])
story.append(body)
story.append(PageBreak())

# Page 2
story.append(Paragraph("Page 2", styles['Heading1']))
story.append(Paragraph("Content for page 2", styles['Normal']))

# Build PDF
doc.build(story)

Command-Line Tools

pdftotext (poppler-utils)

# Extract text
pdftotext input.pdf output.txt

# Extract text preserving layout
pdftotext -layout input.pdf output.txt

# Extract specific pages
pdftotext -f 1 -l 5 input.pdf output.txt  # Pages 1-5

qpdf

# Merge PDFs
qpdf --empty --pages file1.pdf file2.pdf -- merged.pdf

# Split pages
qpdf input.pdf --pages . 1-5 -- pages1-5.pdf
qpdf input.pdf --pages . 6-10 -- pages6-10.pdf

# Rotate pages
qpdf input.pdf output.pdf --rotate=+90:1  # Rotate page 1 by 90 degrees

# Remove password
qpdf --password=mypassword --decrypt encrypted.pdf decrypted.pdf

pdftk (if available)

# Merge
pdftk file1.pdf file2.pdf cat output merged.pdf

# Split
pdftk input.pdf burst

# Rotate
pdftk input.pdf rotate 1east output rotated.pdf

Common Tasks

Extract Text from Scanned PDFs

# Requires: pip install pytesseract pdf2image
import pytesseract
from pdf2image import convert_from_path

# Convert PDF to images
images = convert_from_path('scanned.pdf')

# OCR each page
text = ""
for i, image in enumerate(images):
    text += f"Page {i+1}:\n"
    text += pytesseract.image_to_string(image)
    text += "\n\n"

print(text)

Add Watermark

from pypdf import PdfReader, PdfWriter

# Create watermark (or load existing)
watermark = PdfReader("watermark.pdf").pages[0]

# Apply to all pages
reader = PdfReader("document.pdf")
writer = PdfWriter()

for page in reader.pages:
    page.merge_page(watermark)
    writer.add_page(page)

with open("watermarked.pdf", "wb") as output:
    writer.write(output)

Extract Images

# Using pdfimages (poppler-utils)
pdfimages -j input.pdf output_prefix

# This extracts all images as output_prefix-000.jpg, output_prefix-001.jpg, etc.

Password Protection

from pypdf import PdfReader, PdfWriter

reader = PdfReader("input.pdf")
writer = PdfWriter()

for page in reader.pages:
    writer.add_page(page)

# Add password
writer.encrypt("userpassword", "ownerpassword")

with open("encrypted.pdf", "wb") as output:
    writer.write(output)

Quick Reference

Task Best Tool Command/Code
Merge PDFs pypdf writer.add_page(page)
Split PDFs pypdf One page per file
Extract text pdfplumber page.extract_text()
Extract tables pdfplumber page.extract_tables()
Create PDFs reportlab Canvas or Platypus
Command line merge qpdf qpdf --empty --pages ...
OCR scanned PDFs pytesseract Convert to image first
Fill PDF forms pdf-lib or pypdf (see forms.md) See forms.md

Next Steps

  • For advanced pypdfium2 usage, see reference.md
  • For JavaScript libraries (pdf-lib), see reference.md
  • If you need to fill out a PDF form, follow the instructions in forms.md
  • For troubleshooting guides, see reference.md
用于创建、编辑和分析PPTX演示文稿。支持文本提取、XML底层操作及设计元素处理。提供无模板新建流程,强调基于内容的设计策略与字体规范。
用户要求创建新的PPT文件 需要修改或编辑现有PPT内容 请求分析PPT布局或元数据 添加评论或演讲者备注 提取PPT中的文本或主题样式
docs/pptx/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill pptx -g -y
SKILL.md
Frontmatter
{
    "name": "pptx",
    "license": "Proprietary. LICENSE.txt has complete terms",
    "description": "Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks"
}

PPTX creation, editing, and analysis

Overview

A user may ask you to create, edit, or analyze the contents of a .pptx file. A .pptx file is essentially a ZIP archive containing XML files and other resources that you can read or edit. You have different tools and workflows available for different tasks.

Reading and analyzing content

Text extraction

If you just need to read the text contents of a presentation, you should convert the document to markdown:

# Convert document to markdown
python -m markitdown path-to-file.pptx

Raw XML access

You need raw XML access for: comments, speaker notes, slide layouts, animations, design elements, and complex formatting. For any of these features, you'll need to unpack a presentation and read its raw XML contents.

Unpacking a file

python ooxml/scripts/unpack.py <office_file> <output_dir>

Note: The unpack.py script is located at skills/pptx/ooxml/scripts/unpack.py relative to the project root. If the script doesn't exist at this path, use find . -name "unpack.py" to locate it.

Key file structures

  • ppt/presentation.xml - Main presentation metadata and slide references
  • ppt/slides/slide{N}.xml - Individual slide contents (slide1.xml, slide2.xml, etc.)
  • ppt/notesSlides/notesSlide{N}.xml - Speaker notes for each slide
  • ppt/comments/modernComment_*.xml - Comments for specific slides
  • ppt/slideLayouts/ - Layout templates for slides
  • ppt/slideMasters/ - Master slide templates
  • ppt/theme/ - Theme and styling information
  • ppt/media/ - Images and other media files

Typography and color extraction

When given an example design to emulate: Always analyze the presentation's typography and colors first using the methods below:

  1. Read theme file: Check ppt/theme/theme1.xml for colors (<a:clrScheme>) and fonts (<a:fontScheme>)
  2. Sample slide content: Examine ppt/slides/slide1.xml for actual font usage (<a:rPr>) and colors
  3. Search for patterns: Use grep to find color (<a:solidFill>, <a:srgbClr>) and font references across all XML files

Creating a new PowerPoint presentation without a template

When creating a new PowerPoint presentation from scratch, use the html2pptx workflow to convert HTML slides to PowerPoint with accurate positioning.

Design Principles

CRITICAL: Before creating any presentation, analyze the content and choose appropriate design elements:

  1. Consider the subject matter: What is this presentation about? What tone, industry, or mood does it suggest?
  2. Check for branding: If the user mentions a company/organization, consider their brand colors and identity
  3. Match palette to content: Select colors that reflect the subject
  4. State your approach: Explain your design choices before writing code

Requirements:

  • ✅ State your content-informed design approach BEFORE writing code
  • ✅ Use web-safe fonts only: Arial, Helvetica, Times New Roman, Georgia, Courier New, Verdana, Tahoma, Trebuchet MS, Impact
  • ✅ Create clear visual hierarchy through size, weight, and color
  • ✅ Ensure readability: strong contrast, appropriately sized text, clean alignment
  • ✅ Be consistent: repeat patterns, spacing, and visual language across slides

Color Palette Selection

Choosing colors creatively:

  • Think beyond defaults: What colors genuinely match this specific topic? Avoid autopilot choices.
  • Consider multiple angles: Topic, industry, mood, energy level, target audience, brand identity (if mentioned)
  • Be adventurous: Try unexpected combinations - a healthcare presentation doesn't have to be green, finance doesn't have to be navy
  • Build your palette: Pick 3-5 colors that work together (dominant colors + supporting tones + accent)
  • Ensure contrast: Text must be clearly readable on backgrounds

Example color palettes (use these to spark creativity - choose one, adapt it, or create your own):

  1. Classic Blue: Deep navy (#1C2833), slate gray (#2E4053), silver (#AAB7B8), off-white (#F4F6F6)
  2. Teal & Coral: Teal (#5EA8A7), deep teal (#277884), coral (#FE4447), white (#FFFFFF)
  3. Bold Red: Red (#C0392B), bright red (#E74C3C), orange (#F39C12), yellow (#F1C40F), green (#2ECC71)
  4. Warm Blush: Mauve (#A49393), blush (#EED6D3), rose (#E8B4B8), cream (#FAF7F2)
  5. Burgundy Luxury: Burgundy (#5D1D2E), crimson (#951233), rust (#C15937), gold (#997929)
  6. Deep Purple & Emerald: Purple (#B165FB), dark blue (#181B24), emerald (#40695B), white (#FFFFFF)
  7. Cream & Forest Green: Cream (#FFE1C7), forest green (#40695B), white (#FCFCFC)
  8. Pink & Purple: Pink (#F8275B), coral (#FF574A), rose (#FF737D), purple (#3D2F68)
  9. Lime & Plum: Lime (#C5DE82), plum (#7C3A5F), coral (#FD8C6E), blue-gray (#98ACB5)
  10. Black & Gold: Gold (#BF9A4A), black (#000000), cream (#F4F6F6)
  11. Sage & Terracotta: Sage (#87A96B), terracotta (#E07A5F), cream (#F4F1DE), charcoal (#2C2C2C)
  12. Charcoal & Red: Charcoal (#292929), red (#E33737), light gray (#CCCBCB)
  13. Vibrant Orange: Orange (#F96D00), light gray (#F2F2F2), charcoal (#222831)
  14. Forest Green: Black (#191A19), green (#4E9F3D), dark green (#1E5128), white (#FFFFFF)
  15. Retro Rainbow: Purple (#722880), pink (#D72D51), orange (#EB5C18), amber (#F08800), gold (#DEB600)
  16. Vintage Earthy: Mustard (#E3B448), sage (#CBD18F), forest green (#3A6B35), cream (#F4F1DE)
  17. Coastal Rose: Old rose (#AD7670), beaver (#B49886), eggshell (#F3ECDC), ash gray (#BFD5BE)
  18. Orange & Turquoise: Light orange (#FC993E), grayish turquoise (#667C6F), white (#FCFCFC)

Visual Details Options

Geometric Patterns:

  • Diagonal section dividers instead of horizontal
  • Asymmetric column widths (30/70, 40/60, 25/75)
  • Rotated text headers at 90° or 270°
  • Circular/hexagonal frames for images
  • Triangular accent shapes in corners
  • Overlapping shapes for depth

Border & Frame Treatments:

  • Thick single-color borders (10-20pt) on one side only
  • Double-line borders with contrasting colors
  • Corner brackets instead of full frames
  • L-shaped borders (top+left or bottom+right)
  • Underline accents beneath headers (3-5pt thick)

Typography Treatments:

  • Extreme size contrast (72pt headlines vs 11pt body)
  • All-caps headers with wide letter spacing
  • Numbered sections in oversized display type
  • Monospace (Courier New) for data/stats/technical content
  • Condensed fonts (Arial Narrow) for dense information
  • Outlined text for emphasis

Chart & Data Styling:

  • Monochrome charts with single accent color for key data
  • Horizontal bar charts instead of vertical
  • Dot plots instead of bar charts
  • Minimal gridlines or none at all
  • Data labels directly on elements (no legends)
  • Oversized numbers for key metrics

Layout Innovations:

  • Full-bleed images with text overlays
  • Sidebar column (20-30% width) for navigation/context
  • Modular grid systems (3×3, 4×4 blocks)
  • Z-pattern or F-pattern content flow
  • Floating text boxes over colored shapes
  • Magazine-style multi-column layouts

Background Treatments:

  • Solid color blocks occupying 40-60% of slide
  • Gradient fills (vertical or diagonal only)
  • Split backgrounds (two colors, diagonal or vertical)
  • Edge-to-edge color bands
  • Negative space as a design element

Layout Tips

When creating slides with charts or tables:

  • Two-column layout (PREFERRED): Use a header spanning the full width, then two columns below - text/bullets in one column and the featured content in the other. This provides better balance and makes charts/tables more readable. Use flexbox with unequal column widths (e.g., 40%/60% split) to optimize space for each content type.
  • Full-slide layout: Let the featured content (chart/table) take up the entire slide for maximum impact and readability
  • NEVER vertically stack: Do not place charts/tables below text in a single column - this causes poor readability and layout issues

Workflow

  1. MANDATORY - READ ENTIRE FILE: Read html2pptx.md completely from start to finish. NEVER set any range limits when reading this file. Read the full file content for detailed syntax, critical formatting rules, and best practices before proceeding with presentation creation.
  2. Create an HTML file for each slide with proper dimensions (e.g., 720pt × 405pt for 16:9)
    • Use <p>, <h1>-<h6>, <ul>, <ol> for all text content
    • Use class="placeholder" for areas where charts/tables will be added (render with gray background for visibility)
    • CRITICAL: Rasterize gradients and icons as PNG images FIRST using Sharp, then reference in HTML
    • LAYOUT: For slides with charts/tables/images, use either full-slide layout or two-column layout for better readability
  3. Create and run a JavaScript file using the html2pptx.js library to convert HTML slides to PowerPoint and save the presentation
    • Use the html2pptx() function to process each HTML file
    • Add charts and tables to placeholder areas using PptxGenJS API
    • Save the presentation using pptx.writeFile()
  4. Visual validation: Generate thumbnails and inspect for layout issues
    • Create thumbnail grid: python scripts/thumbnail.py output.pptx workspace/thumbnails --cols 4
    • Read and carefully examine the thumbnail image for:
      • Text cutoff: Text being cut off by header bars, shapes, or slide edges
      • Text overlap: Text overlapping with other text or shapes
      • Positioning issues: Content too close to slide boundaries or other elements
      • Contrast issues: Insufficient contrast between text and backgrounds
    • If issues found, adjust HTML margins/spacing/colors and regenerate the presentation
    • Repeat until all slides are visually correct

Editing an existing PowerPoint presentation

When edit slides in an existing PowerPoint presentation, you need to work with the raw Office Open XML (OOXML) format. This involves unpacking the .pptx file, editing the XML content, and repacking it.

Workflow

  1. MANDATORY - READ ENTIRE FILE: Read ooxml.md (~500 lines) completely from start to finish. NEVER set any range limits when reading this file. Read the full file content for detailed guidance on OOXML structure and editing workflows before any presentation editing.
  2. Unpack the presentation: python ooxml/scripts/unpack.py <office_file> <output_dir>
  3. Edit the XML files (primarily ppt/slides/slide{N}.xml and related files)
  4. CRITICAL: Validate immediately after each edit and fix any validation errors before proceeding: python ooxml/scripts/validate.py <dir> --original <file>
  5. Pack the final presentation: python ooxml/scripts/pack.py <input_directory> <office_file>

Creating a new PowerPoint presentation using a template

When you need to create a presentation that follows an existing template's design, you'll need to duplicate and re-arrange template slides before then replacing placeholder context.

Workflow

  1. Extract template text AND create visual thumbnail grid:

    • Extract text: python -m markitdown template.pptx > template-content.md
    • Read template-content.md: Read the entire file to understand the contents of the template presentation. NEVER set any range limits when reading this file.
    • Create thumbnail grids: python scripts/thumbnail.py template.pptx
    • See Creating Thumbnail Grids section for more details
  2. Analyze template and save inventory to a file:

    • Visual Analysis: Review thumbnail grid(s) to understand slide layouts, design patterns, and visual structure
    • Create and save a template inventory file at template-inventory.md containing:
      # Template Inventory Analysis
      **Total Slides: [count]**
      **IMPORTANT: Slides are 0-indexed (first slide = 0, last slide = count-1)**
      
      ## [Category Name]
      - Slide 0: [Layout code if available] - Description/purpose
      - Slide 1: [Layout code] - Description/purpose
      - Slide 2: [Layout code] - Description/purpose
      [... EVERY slide must be listed individually with its index ...]
      
    • Using the thumbnail grid: Reference the visual thumbnails to identify:
      • Layout patterns (title slides, content layouts, section dividers)
      • Image placeholder locations and counts
      • Design consistency across slide groups
      • Visual hierarchy and structure
    • This inventory file is REQUIRED for selecting appropriate templates in the next step
  3. Create presentation outline based on template inventory:

    • Review available templates from step 2.
    • Choose an intro or title template for the first slide. This should be one of the first templates.
    • Choose safe, text-based layouts for the other slides.
    • CRITICAL: Match layout structure to actual content:
      • Single-column layouts: Use for unified narrative or single topic
      • Two-column layouts: Use ONLY when you have exactly 2 distinct items/concepts
      • Three-column layouts: Use ONLY when you have exactly 3 distinct items/concepts
      • Image + text layouts: Use ONLY when you have actual images to insert
      • Quote layouts: Use ONLY for actual quotes from people (with attribution), never for emphasis
      • Never use layouts with more placeholders than you have content
      • If you have 2 items, don't force them into a 3-column layout
      • If you have 4+ items, consider breaking into multiple slides or using a list format
    • Count your actual content pieces BEFORE selecting the layout
    • Verify each placeholder in the chosen layout will be filled with meaningful content
    • Select one option representing the best layout for each content section.
    • Save outline.md with content AND template mapping that leverages available designs
    • Example template mapping:
      # Template slides to use (0-based indexing)
      # WARNING: Verify indices are within range! Template with 73 slides has indices 0-72
      # Mapping: slide numbers from outline -> template slide indices
      template_mapping = [
          0,   # Use slide 0 (Title/Cover)
          34,  # Use slide 34 (B1: Title and body)
          34,  # Use slide 34 again (duplicate for second B1)
          50,  # Use slide 50 (E1: Quote)
          54,  # Use slide 54 (F2: Closing + Text)
      ]
      
  4. Duplicate, reorder, and delete slides using rearrange.py:

    • Use the scripts/rearrange.py script to create a new presentation with slides in the desired order:
      python scripts/rearrange.py template.pptx working.pptx 0,34,34,50,52
      
    • The script handles duplicating repeated slides, deleting unused slides, and reordering automatically
    • Slide indices are 0-based (first slide is 0, second is 1, etc.)
    • The same slide index can appear multiple times to duplicate that slide
  5. Extract ALL text using the inventory.py script:

    • Run inventory extraction:

      python scripts/inventory.py working.pptx text-inventory.json
      
    • Read text-inventory.json: Read the entire text-inventory.json file to understand all shapes and their properties. NEVER set any range limits when reading this file.

    • The inventory JSON structure:

        {
          "slide-0": {
            "shape-0": {
              "placeholder_type": "TITLE",  // or null for non-placeholders
              "left": 1.5,                  // position in inches
              "top": 2.0,
              "width": 7.5,
              "height": 1.2,
              "paragraphs": [
                {
                  "text": "Paragraph text",
                  // Optional properties (only included when non-default):
                  "bullet": true,           // explicit bullet detected
                  "level": 0,               // only included when bullet is true
                  "alignment": "CENTER",    // CENTER, RIGHT (not LEFT)
                  "space_before": 10.0,     // space before paragraph in points
                  "space_after": 6.0,       // space after paragraph in points
                  "line_spacing": 22.4,     // line spacing in points
                  "font_name": "Arial",     // from first run
                  "font_size": 14.0,        // in points
                  "bold": true,
                  "italic": false,
                  "underline": false,
                  "color": "FF0000"         // RGB color
                }
              ]
            }
          }
        }
      
    • Key features:

      • Slides: Named as "slide-0", "slide-1", etc.
      • Shapes: Ordered by visual position (top-to-bottom, left-to-right) as "shape-0", "shape-1", etc.
      • Placeholder types: TITLE, CENTER_TITLE, SUBTITLE, BODY, OBJECT, or null
      • Default font size: default_font_size in points extracted from layout placeholders (when available)
      • Slide numbers are filtered: Shapes with SLIDE_NUMBER placeholder type are automatically excluded from inventory
      • Bullets: When bullet: true, level is always included (even if 0)
      • Spacing: space_before, space_after, and line_spacing in points (only included when set)
      • Colors: color for RGB (e.g., "FF0000"), theme_color for theme colors (e.g., "DARK_1")
      • Properties: Only non-default values are included in the output
  6. Generate replacement text and save the data to a JSON file Based on the text inventory from the previous step:

    • CRITICAL: First verify which shapes exist in the inventory - only reference shapes that are actually present
    • VALIDATION: The replace.py script will validate that all shapes in your replacement JSON exist in the inventory
      • If you reference a non-existent shape, you'll get an error showing available shapes
      • If you reference a non-existent slide, you'll get an error indicating the slide doesn't exist
      • All validation errors are shown at once before the script exits
    • IMPORTANT: The replace.py script uses inventory.py internally to identify ALL text shapes
    • AUTOMATIC CLEARING: ALL text shapes from the inventory will be cleared unless you provide "paragraphs" for them
    • Add a "paragraphs" field to shapes that need content (not "replacement_paragraphs")
    • Shapes without "paragraphs" in the replacement JSON will have their text cleared automatically
    • Paragraphs with bullets will be automatically left aligned. Don't set the alignment property on when "bullet": true
    • Generate appropriate replacement content for placeholder text
    • Use shape size to determine appropriate content length
    • CRITICAL: Include paragraph properties from the original inventory - don't just provide text
    • IMPORTANT: When bullet: true, do NOT include bullet symbols (•, -, *) in text - they're added automatically
    • ESSENTIAL FORMATTING RULES:
      • Headers/titles should typically have "bold": true
      • List items should have "bullet": true, "level": 0 (level is required when bullet is true)
      • Preserve any alignment properties (e.g., "alignment": "CENTER" for centered text)
      • Include font properties when different from default (e.g., "font_size": 14.0, "font_name": "Lora")
      • Colors: Use "color": "FF0000" for RGB or "theme_color": "DARK_1" for theme colors
      • The replacement script expects properly formatted paragraphs, not just text strings
      • Overlapping shapes: Prefer shapes with larger default_font_size or more appropriate placeholder_type
    • Save the updated inventory with replacements to replacement-text.json
    • WARNING: Different template layouts have different shape counts - always check the actual inventory before creating replacements

    Example paragraphs field showing proper formatting:

    "paragraphs": [
      {
        "text": "New presentation title text",
        "alignment": "CENTER",
        "bold": true
      },
      {
        "text": "Section Header",
        "bold": true
      },
      {
        "text": "First bullet point without bullet symbol",
        "bullet": true,
        "level": 0
      },
      {
        "text": "Red colored text",
        "color": "FF0000"
      },
      {
        "text": "Theme colored text",
        "theme_color": "DARK_1"
      },
      {
        "text": "Regular paragraph text without special formatting"
      }
    ]
    

    Shapes not listed in the replacement JSON are automatically cleared:

    {
      "slide-0": {
        "shape-0": {
          "paragraphs": [...] // This shape gets new text
        }
        // shape-1 and shape-2 from inventory will be cleared automatically
      }
    }
    

    Common formatting patterns for presentations:

    • Title slides: Bold text, sometimes centered
    • Section headers within slides: Bold text
    • Bullet lists: Each item needs "bullet": true, "level": 0
    • Body text: Usually no special properties needed
    • Quotes: May have special alignment or font properties
  7. Apply replacements using the replace.py script

    python scripts/replace.py working.pptx replacement-text.json output.pptx
    

    The script will:

    • First extract the inventory of ALL text shapes using functions from inventory.py
    • Validate that all shapes in the replacement JSON exist in the inventory
    • Clear text from ALL shapes identified in the inventory
    • Apply new text only to shapes with "paragraphs" defined in the replacement JSON
    • Preserve formatting by applying paragraph properties from the JSON
    • Handle bullets, alignment, font properties, and colors automatically
    • Save the updated presentation

    Example validation errors:

    ERROR: Invalid shapes in replacement JSON:
      - Shape 'shape-99' not found on 'slide-0'. Available shapes: shape-0, shape-1, shape-4
      - Slide 'slide-999' not found in inventory
    
    ERROR: Replacement text made overflow worse in these shapes:
      - slide-0/shape-2: overflow worsened by 1.25" (was 0.00", now 1.25")
    

Creating Thumbnail Grids

To create visual thumbnail grids of PowerPoint slides for quick analysis and reference:

python scripts/thumbnail.py template.pptx [output_prefix]

Features:

  • Creates: thumbnails.jpg (or thumbnails-1.jpg, thumbnails-2.jpg, etc. for large decks)
  • Default: 5 columns, max 30 slides per grid (5×6)
  • Custom prefix: python scripts/thumbnail.py template.pptx my-grid
    • Note: The output prefix should include the path if you want output in a specific directory (e.g., workspace/my-grid)
  • Adjust columns: --cols 4 (range: 3-6, affects slides per grid)
  • Grid limits: 3 cols = 12 slides/grid, 4 cols = 20, 5 cols = 30, 6 cols = 42
  • Slides are zero-indexed (Slide 0, Slide 1, etc.)

Use cases:

  • Template analysis: Quickly understand slide layouts and design patterns
  • Content review: Visual overview of entire presentation
  • Navigation reference: Find specific slides by their visual appearance
  • Quality check: Verify all slides are properly formatted

Examples:

# Basic usage
python scripts/thumbnail.py presentation.pptx

# Combine options: custom name, columns
python scripts/thumbnail.py template.pptx analysis --cols 4

Converting Slides to Images

To visually analyze PowerPoint slides, convert them to images using a two-step process:

  1. Convert PPTX to PDF:

    soffice --headless --convert-to pdf template.pptx
    
  2. Convert PDF pages to JPEG images:

    pdftoppm -jpeg -r 150 template.pdf slide
    

    This creates files like slide-1.jpg, slide-2.jpg, etc.

Options:

  • -r 150: Sets resolution to 150 DPI (adjust for quality/size balance)
  • -jpeg: Output JPEG format (use -png for PNG if preferred)
  • -f N: First page to convert (e.g., -f 2 starts from page 2)
  • -l N: Last page to convert (e.g., -l 5 stops at page 5)
  • slide: Prefix for output files

Example for specific range:

pdftoppm -jpeg -r 150 -f 2 -l 5 template.pdf slide  # Converts only pages 2-5

Code Style Guidelines

IMPORTANT: When generating code for PPTX operations:

  • Write concise code
  • Avoid verbose variable names and redundant operations
  • Avoid unnecessary print statements

Dependencies

Required dependencies (should already be installed):

  • markitdown: pip install "markitdown[pptx]" (for text extraction from presentations)
  • pptxgenjs: npm install -g pptxgenjs (for creating presentations via html2pptx)
  • playwright: npm install -g playwright (for HTML rendering in html2pptx)
  • react-icons: npm install -g react-icons react react-dom (for icons)
  • sharp: npm install -g sharp (for SVG rasterization and image processing)
  • LibreOffice: sudo apt-get install libreoffice (for PDF conversion)
  • Poppler: sudo apt-get install poppler-utils (for pdftoppm to convert PDF to images)
  • defusedxml: pip install defusedxml (for secure XML parsing)
用于Excel文件的创建、编辑与分析,支持公式计算、格式化及数据可视化。涵盖财务建模规范(如颜色编码、数字格式)、零错误公式要求及数据源文档化标准,确保模型专业性与准确性。
用户请求创建新的电子表格文件 用户需要读取或分析现有Excel数据 用户要求修改包含公式的Excel文件 用户需要进行财务建模或数据可视化 用户需要重新计算Excel中的公式
docs/xlsx/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill xlsx -g -y
SKILL.md
Frontmatter
{
    "name": "xlsx",
    "license": "Proprietary. LICENSE.txt has complete terms",
    "description": "Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas"
}

Requirements for Outputs

All Excel files

Zero Formula Errors

  • Every Excel model MUST be delivered with ZERO formula errors (#REF!, #DIV/0!, #VALUE!, #N/A, #NAME?)

Preserve Existing Templates (when updating templates)

  • Study and EXACTLY match existing format, style, and conventions when modifying files
  • Never impose standardized formatting on files with established patterns
  • Existing template conventions ALWAYS override these guidelines

Financial models

Color Coding Standards

Unless otherwise stated by the user or existing template

Industry-Standard Color Conventions

  • Blue text (RGB: 0,0,255): Hardcoded inputs, and numbers users will change for scenarios
  • Black text (RGB: 0,0,0): ALL formulas and calculations
  • Green text (RGB: 0,128,0): Links pulling from other worksheets within same workbook
  • Red text (RGB: 255,0,0): External links to other files
  • Yellow background (RGB: 255,255,0): Key assumptions needing attention or cells that need to be updated

Number Formatting Standards

Required Format Rules

  • Years: Format as text strings (e.g., "2024" not "2,024")
  • Currency: Use $#,##0 format; ALWAYS specify units in headers ("Revenue ($mm)")
  • Zeros: Use number formatting to make all zeros "-", including percentages (e.g., "$#,##0;($#,##0);-")
  • Percentages: Default to 0.0% format (one decimal)
  • Multiples: Format as 0.0x for valuation multiples (EV/EBITDA, P/E)
  • Negative numbers: Use parentheses (123) not minus -123

Formula Construction Rules

Assumptions Placement

  • Place ALL assumptions (growth rates, margins, multiples, etc.) in separate assumption cells
  • Use cell references instead of hardcoded values in formulas
  • Example: Use =B5*(1+$B$6) instead of =B5*1.05

Formula Error Prevention

  • Verify all cell references are correct
  • Check for off-by-one errors in ranges
  • Ensure consistent formulas across all projection periods
  • Test with edge cases (zero values, negative numbers)
  • Verify no unintended circular references

Documentation Requirements for Hardcodes

  • Comment or in cells beside (if end of table). Format: "Source: [System/Document], [Date], [Specific Reference], [URL if applicable]"
  • Examples:
    • "Source: Company 10-K, FY2024, Page 45, Revenue Note, [SEC EDGAR URL]"
    • "Source: Company 10-Q, Q2 2025, Exhibit 99.1, [SEC EDGAR URL]"
    • "Source: Bloomberg Terminal, 8/15/2025, AAPL US Equity"
    • "Source: FactSet, 8/20/2025, Consensus Estimates Screen"

XLSX creation, editing, and analysis

Overview

A user may ask you to create, edit, or analyze the contents of an .xlsx file. You have different tools and workflows available for different tasks.

Important Requirements

LibreOffice Required for Formula Recalculation: You can assume LibreOffice is installed for recalculating formula values using the recalc.py script. The script automatically configures LibreOffice on first run

Reading and analyzing data

Data analysis with pandas

For data analysis, visualization, and basic operations, use pandas which provides powerful data manipulation capabilities:

import pandas as pd

# Read Excel
df = pd.read_excel('file.xlsx')  # Default: first sheet
all_sheets = pd.read_excel('file.xlsx', sheet_name=None)  # All sheets as dict

# Analyze
df.head()      # Preview data
df.info()      # Column info
df.describe()  # Statistics

# Write Excel
df.to_excel('output.xlsx', index=False)

Excel File Workflows

CRITICAL: Use Formulas, Not Hardcoded Values

Always use Excel formulas instead of calculating values in Python and hardcoding them. This ensures the spreadsheet remains dynamic and updateable.

❌ WRONG - Hardcoding Calculated Values

# Bad: Calculating in Python and hardcoding result
total = df['Sales'].sum()
sheet['B10'] = total  # Hardcodes 5000

# Bad: Computing growth rate in Python
growth = (df.iloc[-1]['Revenue'] - df.iloc[0]['Revenue']) / df.iloc[0]['Revenue']
sheet['C5'] = growth  # Hardcodes 0.15

# Bad: Python calculation for average
avg = sum(values) / len(values)
sheet['D20'] = avg  # Hardcodes 42.5

✅ CORRECT - Using Excel Formulas

# Good: Let Excel calculate the sum
sheet['B10'] = '=SUM(B2:B9)'

# Good: Growth rate as Excel formula
sheet['C5'] = '=(C4-C2)/C2'

# Good: Average using Excel function
sheet['D20'] = '=AVERAGE(D2:D19)'

This applies to ALL calculations - totals, percentages, ratios, differences, etc. The spreadsheet should be able to recalculate when source data changes.

Common Workflow

  1. Choose tool: pandas for data, openpyxl for formulas/formatting
  2. Create/Load: Create new workbook or load existing file
  3. Modify: Add/edit data, formulas, and formatting
  4. Save: Write to file
  5. Recalculate formulas (MANDATORY IF USING FORMULAS): Use the recalc.py script
    python recalc.py output.xlsx
    
  6. Verify and fix any errors:
    • The script returns JSON with error details
    • If status is errors_found, check error_summary for specific error types and locations
    • Fix the identified errors and recalculate again
    • Common errors to fix:
      • #REF!: Invalid cell references
      • #DIV/0!: Division by zero
      • #VALUE!: Wrong data type in formula
      • #NAME?: Unrecognized formula name

Creating new Excel files

# Using openpyxl for formulas and formatting
from openpyxl import Workbook
from openpyxl.styles import Font, PatternFill, Alignment

wb = Workbook()
sheet = wb.active

# Add data
sheet['A1'] = 'Hello'
sheet['B1'] = 'World'
sheet.append(['Row', 'of', 'data'])

# Add formula
sheet['B2'] = '=SUM(A1:A10)'

# Formatting
sheet['A1'].font = Font(bold=True, color='FF0000')
sheet['A1'].fill = PatternFill('solid', start_color='FFFF00')
sheet['A1'].alignment = Alignment(horizontal='center')

# Column width
sheet.column_dimensions['A'].width = 20

wb.save('output.xlsx')

Editing existing Excel files

# Using openpyxl to preserve formulas and formatting
from openpyxl import load_workbook

# Load existing file
wb = load_workbook('existing.xlsx')
sheet = wb.active  # or wb['SheetName'] for specific sheet

# Working with multiple sheets
for sheet_name in wb.sheetnames:
    sheet = wb[sheet_name]
    print(f"Sheet: {sheet_name}")

# Modify cells
sheet['A1'] = 'New Value'
sheet.insert_rows(2)  # Insert row at position 2
sheet.delete_cols(3)  # Delete column 3

# Add new sheet
new_sheet = wb.create_sheet('NewSheet')
new_sheet['A1'] = 'Data'

wb.save('modified.xlsx')

Recalculating formulas

Excel files created or modified by openpyxl contain formulas as strings but not calculated values. Use the provided recalc.py script to recalculate formulas:

python recalc.py <excel_file> [timeout_seconds]

Example:

python recalc.py output.xlsx 30

The script:

  • Automatically sets up LibreOffice macro on first run
  • Recalculates all formulas in all sheets
  • Scans ALL cells for Excel errors (#REF!, #DIV/0!, etc.)
  • Returns JSON with detailed error locations and counts
  • Works on both Linux and macOS

Formula Verification Checklist

Quick checks to ensure formulas work correctly:

Essential Verification

  • Test 2-3 sample references: Verify they pull correct values before building full model
  • Column mapping: Confirm Excel columns match (e.g., column 64 = BL, not BK)
  • Row offset: Remember Excel rows are 1-indexed (DataFrame row 5 = Excel row 6)

Common Pitfalls

  • NaN handling: Check for null values with pd.notna()
  • Far-right columns: FY data often in columns 50+
  • Multiple matches: Search all occurrences, not just first
  • Division by zero: Check denominators before using / in formulas (#DIV/0!)
  • Wrong references: Verify all cell references point to intended cells (#REF!)
  • Cross-sheet references: Use correct format (Sheet1!A1) for linking sheets

Formula Testing Strategy

  • Start small: Test formulas on 2-3 cells before applying broadly
  • Verify dependencies: Check all cells referenced in formulas exist
  • Test edge cases: Include zero, negative, and very large values

Interpreting recalc.py Output

The script returns JSON with error details:

{
  "status": "success",           // or "errors_found"
  "total_errors": 0,              // Total error count
  "total_formulas": 42,           // Number of formulas in file
  "error_summary": {              // Only present if errors found
    "#REF!": {
      "count": 2,
      "locations": ["Sheet1!B5", "Sheet1!C10"]
    }
  }
}

Best Practices

Library Selection

  • pandas: Best for data analysis, bulk operations, and simple data export
  • openpyxl: Best for complex formatting, formulas, and Excel-specific features

Working with openpyxl

  • Cell indices are 1-based (row=1, column=1 refers to cell A1)
  • Use data_only=True to read calculated values: load_workbook('file.xlsx', data_only=True)
  • Warning: If opened with data_only=True and saved, formulas are replaced with values and permanently lost
  • For large files: Use read_only=True for reading or write_only=True for writing
  • Formulas are preserved but not evaluated - use recalc.py to update values

Working with pandas

  • Specify data types to avoid inference issues: pd.read_excel('file.xlsx', dtype={'id': str})
  • For large files, read specific columns: pd.read_excel('file.xlsx', usecols=['A', 'C', 'E'])
  • Handle dates properly: pd.read_excel('file.xlsx', parse_dates=['date_column'])

Code Style Guidelines

IMPORTANT: When generating Python code for Excel operations:

  • Write minimal, concise Python code without unnecessary comments
  • Avoid verbose variable names and redundant operations
  • Avoid unnecessary print statements

For Excel files themselves:

  • Add comments to cells with complex formulas or important assumptions
  • Document data sources for hardcoded values
  • Include notes for key calculations and model sections
用于开发分支完成后的集成引导。先验证测试,再提供合并、创建PR、保留或删除四个选项,并执行相应操作及清理工作区,确保代码安全整合。
开发实现已完成 所有测试通过需决定集成方式 需要结束当前开发分支
git-workflow/finishing-a-development-branch/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill finishing-a-development-branch -g -y
SKILL.md
Frontmatter
{
    "name": "finishing-a-development-branch",
    "description": "Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup"
}

Finishing a Development Branch

Overview

Guide completion of development work by presenting clear options and handling chosen workflow.

Core principle: Verify tests → Present options → Execute choice → Clean up.

Announce at start: "I'm using the finishing-a-development-branch skill to complete this work."

The Process

Step 1: Verify Tests

Before presenting options, verify tests pass:

# Run project's test suite
npm test / cargo test / pytest / go test ./...

If tests fail:

Tests failing (<N> failures). Must fix before completing:

[Show failures]

Cannot proceed with merge/PR until tests pass.

Stop. Don't proceed to Step 2.

If tests pass: Continue to Step 2.

Step 2: Determine Base Branch

# Try common base branches
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null

Or ask: "This branch split from main - is that correct?"

Step 3: Present Options

Present exactly these 4 options:

Implementation complete. What would you like to do?

1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work

Which option?

Don't add explanation - keep options concise.

Step 4: Execute Choice

Option 1: Merge Locally

# Switch to base branch
git checkout <base-branch>

# Pull latest
git pull

# Merge feature branch
git merge <feature-branch>

# Verify tests on merged result
<test command>

# If tests pass
git branch -d <feature-branch>

Then: Cleanup worktree (Step 5)

Option 2: Push and Create PR

# Push branch
git push -u origin <feature-branch>

# Create PR
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
<2-3 bullets of what changed>

## Test Plan
- [ ] <verification steps>
EOF
)"

Then: Cleanup worktree (Step 5)

Option 3: Keep As-Is

Report: "Keeping branch . Worktree preserved at ."

Don't cleanup worktree.

Option 4: Discard

Confirm first:

This will permanently delete:
- Branch <name>
- All commits: <commit-list>
- Worktree at <path>

Type 'discard' to confirm.

Wait for exact confirmation.

If confirmed:

git checkout <base-branch>
git branch -D <feature-branch>

Then: Cleanup worktree (Step 5)

Step 5: Cleanup Worktree

For Options 1, 2, 4:

Check if in worktree:

git worktree list | grep $(git branch --show-current)

If yes:

git worktree remove <worktree-path>

For Option 3: Keep worktree.

Quick Reference

Option Merge Push Keep Worktree Cleanup Branch
1. Merge locally - -
2. Create PR - -
3. Keep as-is - - -
4. Discard - - - ✓ (force)

Common Mistakes

Skipping test verification

  • Problem: Merge broken code, create failing PR
  • Fix: Always verify tests before offering options

Open-ended questions

  • Problem: "What should I do next?" → ambiguous
  • Fix: Present exactly 4 structured options

Automatic worktree cleanup

  • Problem: Remove worktree when might need it (Option 2, 3)
  • Fix: Only cleanup for Options 1 and 4

No confirmation for discard

  • Problem: Accidentally delete work
  • Fix: Require typed "discard" confirmation

Red Flags

Never:

  • Proceed with failing tests
  • Merge without verifying tests on result
  • Delete work without confirmation
  • Force-push without explicit request

Always:

  • Verify tests before offering options
  • Present exactly 4 options
  • Get typed confirmation for Option 4
  • Clean up worktree for Options 1 & 4 only

Integration

Called by:

  • subagent-driven-development (Step 7) - After all tasks complete
  • executing-plans (Step 5) - After all batches complete

Pairs with:

  • using-git-worktrees - Cleans up worktree created by that skill
用于创建隔离的Git工作区以并行开发。通过智能目录选择、安全验证(如.gitignore检查)及自动环境配置,确保分支工作独立且干净。
需要与当前工作区隔离的特征开发 执行实现计划前需独立环境
git-workflow/using-git-worktrees/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill using-git-worktrees -g -y
SKILL.md
Frontmatter
{
    "name": "using-git-worktrees",
    "description": "Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification"
}

Using Git Worktrees

Overview

Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.

Core principle: Systematic directory selection + safety verification = reliable isolation.

Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace."

Directory Selection Process

Follow this priority order:

1. Check Existing Directories

# Check in priority order
ls -d .worktrees 2>/dev/null     # Preferred (hidden)
ls -d worktrees 2>/dev/null      # Alternative

If found: Use that directory. If both exist, .worktrees wins.

2. Check CLAUDE.md

grep -i "worktree.*director" CLAUDE.md 2>/dev/null

If preference specified: Use it without asking.

3. Ask User

If no directory exists and no CLAUDE.md preference:

No worktree directory found. Where should I create worktrees?

1. .worktrees/ (project-local, hidden)
2. ~/.config/superpowers/worktrees/<project-name>/ (global location)

Which would you prefer?

Safety Verification

For Project-Local Directories (.worktrees or worktrees)

MUST verify directory is ignored before creating worktree:

# Check if directory is ignored (respects local, global, and system gitignore)
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null

If NOT ignored:

Per Jesse's rule "Fix broken things immediately":

  1. Add appropriate line to .gitignore
  2. Commit the change
  3. Proceed with worktree creation

Why critical: Prevents accidentally committing worktree contents to repository.

For Global Directory (~/.config/superpowers/worktrees)

No .gitignore verification needed - outside project entirely.

Creation Steps

1. Detect Project Name

project=$(basename "$(git rev-parse --show-toplevel)")

2. Create Worktree

# Determine full path
case $LOCATION in
  .worktrees|worktrees)
    path="$LOCATION/$BRANCH_NAME"
    ;;
  ~/.config/superpowers/worktrees/*)
    path="~/.config/superpowers/worktrees/$project/$BRANCH_NAME"
    ;;
esac

# Create worktree with new branch
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"

3. Run Project Setup

Auto-detect and run appropriate setup:

# Node.js
if [ -f package.json ]; then npm install; fi

# Rust
if [ -f Cargo.toml ]; then cargo build; fi

# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi

# Go
if [ -f go.mod ]; then go mod download; fi

4. Verify Clean Baseline

Run tests to ensure worktree starts clean:

# Examples - use project-appropriate command
npm test
cargo test
pytest
go test ./...

If tests fail: Report failures, ask whether to proceed or investigate.

If tests pass: Report ready.

5. Report Location

Worktree ready at <full-path>
Tests passing (<N> tests, 0 failures)
Ready to implement <feature-name>

Quick Reference

Situation Action
.worktrees/ exists Use it (verify ignored)
worktrees/ exists Use it (verify ignored)
Both exist Use .worktrees/
Neither exists Check CLAUDE.md → Ask user
Directory not ignored Add to .gitignore + commit
Tests fail during baseline Report failures + ask
No package.json/Cargo.toml Skip dependency install

Common Mistakes

Skipping ignore verification

  • Problem: Worktree contents get tracked, pollute git status
  • Fix: Always use git check-ignore before creating project-local worktree

Assuming directory location

  • Problem: Creates inconsistency, violates project conventions
  • Fix: Follow priority: existing > CLAUDE.md > ask

Proceeding with failing tests

  • Problem: Can't distinguish new bugs from pre-existing issues
  • Fix: Report failures, get explicit permission to proceed

Hardcoding setup commands

  • Problem: Breaks on projects using different tools
  • Fix: Auto-detect from project files (package.json, etc.)

Example Workflow

You: I'm using the using-git-worktrees skill to set up an isolated workspace.

[Check .worktrees/ - exists]
[Verify ignored - git check-ignore confirms .worktrees/ is ignored]
[Create worktree: git worktree add .worktrees/auth -b feature/auth]
[Run npm install]
[Run npm test - 47 passing]

Worktree ready at /Users/jesse/myproject/.worktrees/auth
Tests passing (47 tests, 0 failures)
Ready to implement auth feature

Red Flags

Never:

  • Create worktree without verifying it's ignored (project-local)
  • Skip baseline test verification
  • Proceed with failing tests without asking
  • Assume directory location when ambiguous
  • Skip CLAUDE.md check

Always:

  • Follow directory priority: existing > CLAUDE.md > ask
  • Verify directory is ignored for project-local
  • Auto-detect and run project setup
  • Verify clean test baseline

Integration

Called by:

  • brainstorming (Phase 4) - REQUIRED when design is approved and implementation follows
  • Any skill needing isolated workspace

Pairs with:

  • finishing-a-development-branch - REQUIRED for cleanup after work complete
  • executing-plans or subagent-driven-development - Work happens in this worktree
每日资讯日报生成器,通过三阶段工作流获取元数据、生成摘要并输出日报。支持增量抓取与双层去重,自动维护信源状态。新增日期范围选择功能以优化工作量,并支持添加新信源时自动分析网页生成方法文件。
每日新闻 资讯日报 信息监控 新闻聚合 daily news 生成日报
integration/daily-news/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill daily-news -g -y
SKILL.md
Frontmatter
{
    "name": "daily-news",
    "description": "每日资讯日报生成器。三阶段工作流:获取元数据、生成摘要、输出日报。\n触发场景:每日新闻、资讯日报、信息监控、新闻聚合、daily news、生成日报。\n也用于添加新信源(自动分析网页并生成 method 文件)。"
}

Daily News

三阶段工作流:获取元数据生成摘要输出日报

工作目录

首次运行询问工作目录路径(如 ~/daily-news),后续记住。

<workspace>/
├── profile.yaml          # 用户画像(关于我、关注什么)
├── settings.yaml         # 日报设置(语言、格式偏好)
├── methods/              # 信源获取方法
├── data/news.db          # SQLite 数据库
└── output/YYYY-MM-DD.md  # 日报输出

初始化:

mkdir -p <workspace>/methods <workspace>/data <workspace>/output
cp references/examples/settings.example.yaml <workspace>/settings.yaml
cp references/examples/profile.example.yaml <workspace>/profile.yaml
python3 scripts/db.py init --db <workspace>/data/news.db

初始化完成后:

  1. 将工作目录写入用户的 ~/.claude/CLAUDE.md,追加一行:
    - daily-news skill 的项目目录在:<workspace>
    
    这样后续新会话无需再询问目录位置。
  2. 询问用户是否需要调整画像。

阶段 0:选择抓取日期范围(新增)

在执行抓取前,询问用户日期范围,从源头减少非必要工作量。

日期范围选项

请选择抓取时间范围:
1. 今天(默认)                    → published_at >= 今天
2. 昨天                            → published_at >= 昨天
3. 最近3天                         → published_at >= 3天前
4. 最近7天                         → published_at >= 7天前
5. 从上次抓取至今(增量)          → published_at >= last_fetched_date
6. 自定义日期范围                  → 输入开始日期

增量抓取逻辑

每个信源独立追踪抓取日期

# methods/twitter-karpathy.yaml
source_id: twitter-karpathy
...

# 自动维护的元数据
last_fetched_date: "2026-01-27"    # 上次抓取日期
last_fetched_count: 5               # 上次抓取数量
total_items_fetched: 127            # 累计总数

数据库记录

  • source_status 表:快速查询上次抓取日期
  • source_sync_log 表:详细同步日志

日期筛选执行流程

# 1. 获取上次抓取日期
python3 scripts/db.py source-status --db <db> --source <source_id>

# 2. 执行增量抓取
# 在 method 执行时传入 since 参数

# 3. 记录同步日志
python3 scripts/db.py add-items-incremental \
  --db <db> \
  --source <source_id> \
  --items '<json>' \
  --since "2026-01-27"

阶段 1:获取元数据(增量优化)

遍历 <workspace>/methods/ 目录,执行每个 method 文件。

增量抓取检查

对每个 method,执行前检查:

# 1. 读取 method 文件中的 last_fetched_date
python3 -c "
import yaml
with open('methods/<source>.yaml') as f:
    config = yaml.safe_load(f)
print(config.get('last_fetched_date', 'never'))
"

# 2. 或查询数据库
python3 scripts/db.py source-status --db <db> --source <source_id>

根据日期范围执行

情况 A:method 有上次日期,且用户选择"增量"

# 只抓取 last_fetched_date 之后的内容
# 在 method 执行时传入 since 参数

情况 B:method 首次抓取,或用户选择"今天/最近N天"

# 使用用户指定的日期范围

双层去重机制

第一层:抓取时过滤(阶段 1)

# 在 method 执行时,只返回 published_at > since 的内容

第二层:入库前检查(阶段 1.5)

# 批量检查 URL 是否已存在
python3 scripts/db.py check-existing \
  --db <db> \
  --urls '["url1", "url2", ...]'

# 返回已存在的 URL 列表

第三层:数据库 UNIQUE 约束(最终保护)

-- items 表的 url 字段有 UNIQUE 约束
INSERT INTO items ...  -- 重复 URL 会触发 IntegrityError

入库并记录

python3 scripts/db.py add-items-incremental \
  --db <db> \
  --source <source_id> \
  --items '<json>' \
  --since "2026-01-27"

此命令会:

  1. 批量检查 URL 是否存在(预去重)
  2. 插入新条目
  3. 记录同步日志到 source_sync_log
  4. 更新 source_status 表的 last_fetched_date
  5. 更新 method 文件的元数据字段

Browser MCP 检查与自动配置

执行前先检查是否有信源需要 Browser MCP(extends: browser-smartdetail_method: browser):

如果有,执行以下检查流程:

1. 检查 MCP 是否已配置

# 检查 ~/.claude.json 中是否有 browsermcp 配置
grep -q '"browsermcp"' ~/.claude.json && echo "configured" || echo "not configured"

如果未配置,自动添加:

# 读取现有配置,在 mcpServers 中添加 browsermcp
# 使用 Python 或 jq 修改 JSON
python3 -c "
import json
config_path = '$HOME/.claude.json'
with open(config_path, 'r') as f:
    config = json.load(f)
if 'mcpServers' not in config:
    config['mcpServers'] = {}
if 'browsermcp' not in config['mcpServers']:
    config['mcpServers']['browsermcp'] = {
        'command': 'npx',
        'args': ['@browsermcp/mcp@latest'],
        'type': 'stdio'
    }
    with open(config_path, 'w') as f:
        json.dump(config, f, indent=2)
    print('Browser MCP 配置已添加,请重启 Claude Code 生效')
else:
    print('Browser MCP 已配置')
"

2. 测试连接状态

调用 mcp__browsermcp__browser_snapshot 测试连接

判断结果:

  • 返回包含 Page URL: → 已连接,继续执行
  • 返回 No connection to browser extension → 未连接
  • 返回 mcp__browsermcp__browser_snapshot is not a function 或类似错误 → MCP 未加载

3. 根据状态处理

MCP 未加载(刚添加配置):

Browser MCP 配置已添加。请:
1. 重启 Claude Code(Ctrl+C 退出后重新运行)
2. 重启后再次运行日报生成

MCP 已加载但未连接:

Browser MCP 未连接到浏览器。请:
1. 安装 Chrome 扩展:https://chromewebstore.google.com/detail/bjfgambnhccakkhmkepdoekmckoijdlc
2. 在 Chrome 中点击扩展图标,点击 "Connect" 按钮
3. 然后重新运行

或者跳过这些信源,只处理 RSS/WebFetch 信源?

用户可选择跳过或等待连接后继续。

必须使用 mcp__browsermcp__*,因为它复用用户浏览器的登录态,可访问需要登录的内容。其他浏览器工具(playwright/chrome-devtools)会启动独立实例,无法使用已登录的账号。

Method 执行逻辑

读取 method 文件的元数据,根据 extends 字段决定执行方式:

有 extends(引用通用方法):

# extends: rss(最快,有 RSS 源时首选)
python3 references/methods/rss.py --url "<source_url>"

# extends: webfetch-smart(快,适用大多数网站)
# 读取 references/methods/webfetch-smart.md 按指引操作

# extends: browser-smart(Browser MCP,JS渲染/需登录)
# 读取 references/methods/browser-smart.md 按指引操作
# 注意:需要用户先点击 Browser MCP 扩展连接

无 extends(完整定制):

  • *.py: 直接执行 python3 <file>
  • *.md: 读取内容,按指引操作浏览器

入库

python3 scripts/db.py add-items \
  --db <workspace>/data/news.db \
  --source <source_id> \
  --items '<JSON>'

阶段 2:生成摘要

python3 scripts/db.py list-pending --db <workspace>/data/news.db

对每条内容,根据 method 文件的 detail_method 字段获取正文:

detail_method 获取方式
fetch WebFetch 工具(快)
browser Browser MCP(慢,需手动连接)
未指定 默认 fetch

references/prompts/summary.md 生成摘要,更新数据库:

python3 scripts/db.py update-summary \
  --db <workspace>/data/news.db \
  --id <item_id> \
  --data '<摘要JSON>'

阶段 3:生成日报

python3 scripts/db.py list-today --db <workspace>/data/news.db

读取 <workspace>/profile.yaml,按 references/prompts/report.md 生成日报。 输出到 <workspace>/output/YYYY-MM-DD.md


用户画像

画像用于评估内容相关度,自然语言描述,没有固定格式。

首次设置

初始化时已创建空白 profile.yaml,询问用户是否需要调整:

  • 你是做什么的?
  • 最近在关注什么?
  • 有什么不想看的?

根据回答更新 <workspace>/profile.yaml

更新画像

用户说"更新画像"时:

  • 询问最近有什么变化
  • 工作方向?新的兴趣点?
  • 更新 profile.yaml

画像格式

about: |
  (关于我:身份、工作)

focus: |
  (当前关注:最近在意的话题)

low_priority: |
  (不太关心:降低优先级的内容)

添加信源

按优先级依次尝试:

  1. 检查 RSS

    • 尝试 /feed/rss/atom.xml 等常见路径
    • 或检查页面 <link rel="alternate" type="application/rss+xml">
    • 有则用 extends: rss
  2. 测试 WebFetch

    • 用 WebFetch 工具获取页面,看能否提取文章列表
    • 成功则用 extends: webfetch-smart
  3. 使用浏览器

    • WebFetch 失败(JS 渲染/反爬/需登录)
    • extends: browser-smart
    • 使用 Browser MCP,直接用用户浏览器的登录态

创建 method 文件,详见 references/schemas/method.md


参考资料

资料 路径 加载时机
Method 规范 references/schemas/method.md 添加信源时
摘要提示词 references/prompts/summary.md 阶段 2
日报提示词 references/prompts/report.md 阶段 3
通用方法 references/methods/ 阶段 1(被 extends 引用)
日报设置示例 references/examples/settings.example.yaml 初始化
画像格式参考 references/examples/profile.example.yaml 初始化时
网站模板 references/website-template/ 创建网站时
Method 元数据示例 references/examples/method-with-metadata.example.yaml 增量抓取配置参考

数据库命令参考

增量抓取相关

# 批量检查 URL 是否已存在
python3 scripts/db.py check-existing --db <db> --urls '["url1", "url2"]'

# 增量添加条目(自动记录日志)
python3 scripts/db.py add-items-incremental \
  --db <db> --source <id> --items '<json>' --since "2026-01-27"

# 查看信源同步状态
python3 scripts/db.py source-status --db <db> --source <id>

# 查看同步日志
python3 scripts/db.py sync-log --db <db> --source <id> --limit 10

数据库迁移

# 升级到 V2(添加增量抓取支持)
sqlite3 <db> < scripts/migrate_v2.sql

依赖

pip install pyyaml feedparser requests beautifulsoup4

浏览器方式(browser-smart)使用 Browser MCP,需安装 Chrome 扩展。


网站部署(可选)

日报生成后,可自动部署到网站。

快速开始

使用内置网站模板:

# 复制模板到工作目录
cp -r references/website-template <workspace>/website
cd <workspace>/website
python3 build.py

目录结构

<workspace>/
├── output/              # 日报 Markdown 输出
└── website/             # 网站项目
    ├── build.py         # 构建脚本(来自模板)
    ├── dist/            # 生成的静态网站
    └── README.md        # 部署指南

模板位置

  • 模板路径: references/website-template/
  • 包含文件:
    • build.py - 将 Markdown 转换为终端风格 HTML
    • README.md - 部署指南

模板特点

  • 终端风格 - 黑色 header + 白色内容区
  • 响应式设计 - 适配手机和桌面
  • 日期导航 - 支持历史日报切换
  • 零依赖 - 纯 Python,无需第三方库

部署平台支持

  • Cloudflare Pages(推荐)
  • GitHub Pages
  • Vercel
  • Netlify
  • 任何静态托管服务

首次创建网站

选择"创建网站"时自动执行:

  1. 复制模板:

    cp -r references/website-template <workspace>/website
    cd <workspace>/website
    python3 build.py
    
  2. 初始化 Git:

    git init
    git add -A
    git commit -m "Initial commit"
    gh repo create daily-news-web --public --source=. --push
    
  3. 配置 Cloudflare Pages:

    • Build command: python3 build.py
    • Build output: dist

日报生成后的流程

阶段 3 完成后,检查是否存在 website 目录:

情况 A:website 不存在

询问用户是否需要创建网站:

日报已生成:output/2026-01-28.md

是否需要部署到网站?
1. 是,创建网站(Cloudflare Pages)
2. 否,仅保存 Markdown

情况 B:website 已存在

询问用户如何更新:

日报已生成:output/2026-01-28.md

网站更新选项:
1. 立即构建并推送(自动部署到 Cloudflare)
2. 仅构建,稍后手动推送
3. 不更新网站

自动推送命令

选择"立即构建并推送"时执行:

cd <workspace>/website
python3 build.py
git add -A
git commit -m "Add daily report for $(date +%Y-%m-%d)"
git push origin main

Cloudflare Pages 检测到 main 分支推送后自动重新部署。

手动推送流程

如果用户选择稍后手动推送:

# 随时手动执行
cd <workspace>/website
python3 build.py                    # 重新构建网站
git add -A
git commit -m "Add report for YYYY-MM-DD"
git push origin main                # 触发 Cloudflare 部署

网站配置

首次创建网站时需配置:

  1. GitHub 仓库:推送 website 目录到 GitHub
  2. Cloudflare Pages
    • 连接 GitHub 仓库
    • Build command: python3 build.py
    • Build output: dist
  3. 自定义域名(可选):在 Cloudflare Pages 设置中添加

详细配置见 <workspace>/website/README.md

自定义模板

如需修改网站样式,编辑 <workspace>/website/build.py 中的 CSS 变量。

原始模板保留在 references/website-template/ 供参考。

自动同步项目中的Agents.md、claude.md和gemini.md文件,确保多AI Agent配置内容一致。支持递归扫描、智能合并及实时监听变更,提供手动执行与后台守护两种模式,避免重复维护。
用户需要保持多个AI配置文件内容一致 修改任一Agent文档后需自动同步其余文件 初始化项目时批量生成缺失的Agent配置文件
integration/doc-sync-tool/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill doc-sync-tool -g -y
SKILL.md
Frontmatter
{
    "name": "doc-sync-tool",
    "description": "自动同步项目中的 Agents.md、claude.md 和 gemini.md 文件,保持内容一致性。支持自动监听和手动触发。"
}

文档同步工具 (Doc Sync Tool)

功能说明

这个工具用于自动同步项目中的 AI Agent 配置文档,确保 Agents.mdclaude.mdgemini.md 三个文件内容保持一致。

核心功能

  1. 自动发现: 递归扫描当前目录下所有文件夹,查找这三个文档
  2. 智能同步: 发现任意一个文档时,自动创建/更新其余两个
  3. 文件监听: 实时监听文件变化,自动同步最新内容
  4. 手动触发: 支持命令行手动执行同步

使用场景

  • 在多个 AI Agent 之间共享相同的项目配置
  • 自动保持不同 AI 的工作指令一致
  • 避免手动维护多个相同文档的麻烦

使用方法

安装依赖

cd /Users/ben/Downloads/go\ to\ wild/auto-website-system/_skills/doc-sync-tool
pnpm install

手动同步(单次执行)

# 在项目根目录执行
node /Users/ben/Downloads/go\ to\ wild/auto-website-system/_skills/doc-sync-tool/sync.js

# 或者使用 npm script
pnpm run sync

自动监听(持续运行)

# 启动文件监听服务
node /Users/ben/Downloads/go\ to\ wild/auto-website-system/_skills/doc-sync-tool/watch.js

# 或者使用 npm script
pnpm run watch

后台运行(推荐)

# 使用 PM2 在后台运行
pm2 start /Users/ben/Downloads/go\ to\ wild/auto-website-system/_skills/doc-sync-tool/watch.js --name doc-sync

# 查看状态
pm2 status

# 停止服务
pm2 stop doc-sync

工作原理

  1. 扫描阶段: 递归遍历指定目录,查找 Agents.mdclaude.mdgemini.md 文件
  2. 分组阶段: 将同一文件夹下的这三个文件归为一组
  3. 同步阶段:
    • 如果某组只有一个文件,复制内容创建其余两个
    • 如果某组有多个文件,选择最新修改的作为源,同步到其他文件
  4. 监听阶段 (watch 模式): 持续监听文件变化,触发同步

配置选项

可以在 sync.js 中修改以下配置:

const CONFIG = {
  targetFiles: ['Agents.md', 'claude.md', 'gemini.md'],  // 目标文件列表
  scanPath: process.cwd(),                                // 扫描路径(默认当前目录)
  excludeDirs: ['node_modules', '.git', '.next', 'dist'] // 排除目录
};

注意事项

  • 工具会自动跳过 node_modules.git.nextdist 等目录
  • 同步时会保留文件的原始格式和内容
  • 建议在 Git 仓库中使用,方便追踪文件变化
  • 监听模式会持续运行,建议使用 PM2 管理进程

故障排除

权限问题

chmod +x sync.js watch.js

Node.js 版本要求

需要 Node.js 14+ 版本

依赖安装失败

rm -rf node_modules package-lock.json
pnpm install
通过浏览器自动化与Claude Code交互,查询Google NotebookLM文档。支持认证管理、笔记库维护及基于Gemini的源依据回答,减少幻觉。
用户提及NotebookLM或分享其URL 要求查询笔记或文档内容 希望向NotebookLM添加新文档
integration/notebooklm/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill notebooklm -g -y
SKILL.md
Frontmatter
{
    "name": "notebooklm",
    "description": "Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses."
}

NotebookLM Research Assistant Skill

Interact with Google NotebookLM to query documentation with Gemini's source-grounded answers. Each question opens a fresh browser session, retrieves the answer exclusively from your uploaded documents, and closes.

When to Use This Skill

Trigger when user:

  • Mentions NotebookLM explicitly
  • Shares NotebookLM URL (https://notebooklm.google.com/notebook/...)
  • Asks to query their notebooks/documentation
  • Wants to add documentation to NotebookLM library
  • Uses phrases like "ask my NotebookLM", "check my docs", "query my notebook"

⚠️ CRITICAL: Add Command - Smart Discovery

When user wants to add a notebook without providing details:

SMART ADD (Recommended): Query the notebook first to discover its content:

# Step 1: Query the notebook about its content
python scripts/run.py ask_question.py --question "What is the content of this notebook? What topics are covered? Provide a complete overview briefly and concisely" --notebook-url "[URL]"

# Step 2: Use the discovered information to add it
python scripts/run.py notebook_manager.py add --url "[URL]" --name "[Based on content]" --description "[Based on content]" --topics "[Based on content]"

MANUAL ADD: If user provides all details:

  • --url - The NotebookLM URL
  • --name - A descriptive name
  • --description - What the notebook contains (REQUIRED!)
  • --topics - Comma-separated topics (REQUIRED!)

NEVER guess or use generic descriptions! If details missing, use Smart Add to discover them.

Critical: Always Use run.py Wrapper

NEVER call scripts directly. ALWAYS use python scripts/run.py [script]:

# ✅ CORRECT - Always use run.py:
python scripts/run.py auth_manager.py status
python scripts/run.py notebook_manager.py list
python scripts/run.py ask_question.py --question "..."

# ❌ WRONG - Never call directly:
python scripts/auth_manager.py status  # Fails without venv!

The run.py wrapper automatically:

  1. Creates .venv if needed
  2. Installs all dependencies
  3. Activates environment
  4. Executes script properly

Core Workflow

Step 1: Check Authentication Status

python scripts/run.py auth_manager.py status

If not authenticated, proceed to setup.

Step 2: Authenticate (One-Time Setup)

# Browser MUST be visible for manual Google login
python scripts/run.py auth_manager.py setup

Important:

  • Browser is VISIBLE for authentication
  • Browser window opens automatically
  • User must manually log in to Google
  • Tell user: "A browser window will open for Google login"

Step 3: Manage Notebook Library

# List all notebooks
python scripts/run.py notebook_manager.py list

# BEFORE ADDING: Ask user for metadata if unknown!
# "What does this notebook contain?"
# "What topics should I tag it with?"

# Add notebook to library (ALL parameters are REQUIRED!)
python scripts/run.py notebook_manager.py add \
  --url "https://notebooklm.google.com/notebook/..." \
  --name "Descriptive Name" \
  --description "What this notebook contains" \  # REQUIRED - ASK USER IF UNKNOWN!
  --topics "topic1,topic2,topic3"  # REQUIRED - ASK USER IF UNKNOWN!

# Search notebooks by topic
python scripts/run.py notebook_manager.py search --query "keyword"

# Set active notebook
python scripts/run.py notebook_manager.py activate --id notebook-id

# Remove notebook
python scripts/run.py notebook_manager.py remove --id notebook-id

Quick Workflow

  1. Check library: python scripts/run.py notebook_manager.py list
  2. Ask question: python scripts/run.py ask_question.py --question "..." --notebook-id ID

Step 4: Ask Questions

# Basic query (uses active notebook if set)
python scripts/run.py ask_question.py --question "Your question here"

# Query specific notebook
python scripts/run.py ask_question.py --question "..." --notebook-id notebook-id

# Query with notebook URL directly
python scripts/run.py ask_question.py --question "..." --notebook-url "https://..."

# Show browser for debugging
python scripts/run.py ask_question.py --question "..." --show-browser

Follow-Up Mechanism (CRITICAL)

Every NotebookLM answer ends with: "EXTREMELY IMPORTANT: Is that ALL you need to know?"

Required Claude Behavior:

  1. STOP - Do not immediately respond to user
  2. ANALYZE - Compare answer to user's original request
  3. IDENTIFY GAPS - Determine if more information needed
  4. ASK FOLLOW-UP - If gaps exist, immediately ask:
    python scripts/run.py ask_question.py --question "Follow-up with context..."
    
  5. REPEAT - Continue until information is complete
  6. SYNTHESIZE - Combine all answers before responding to user

Script Reference

Authentication Management (auth_manager.py)

python scripts/run.py auth_manager.py setup    # Initial setup (browser visible)
python scripts/run.py auth_manager.py status   # Check authentication
python scripts/run.py auth_manager.py reauth   # Re-authenticate (browser visible)
python scripts/run.py auth_manager.py clear    # Clear authentication

Notebook Management (notebook_manager.py)

python scripts/run.py notebook_manager.py add --url URL --name NAME --description DESC --topics TOPICS
python scripts/run.py notebook_manager.py list
python scripts/run.py notebook_manager.py search --query QUERY
python scripts/run.py notebook_manager.py activate --id ID
python scripts/run.py notebook_manager.py remove --id ID
python scripts/run.py notebook_manager.py stats

Question Interface (ask_question.py)

python scripts/run.py ask_question.py --question "..." [--notebook-id ID] [--notebook-url URL] [--show-browser]

Data Cleanup (cleanup_manager.py)

python scripts/run.py cleanup_manager.py                    # Preview cleanup
python scripts/run.py cleanup_manager.py --confirm          # Execute cleanup
python scripts/run.py cleanup_manager.py --preserve-library # Keep notebooks

Environment Management

The virtual environment is automatically managed:

  • First run creates .venv automatically
  • Dependencies install automatically
  • Chromium browser installs automatically
  • Everything isolated in skill directory

Manual setup (only if automatic fails):

python -m venv .venv
source .venv/bin/activate  # Linux/Mac
pip install -r requirements.txt
python -m patchright install chromium

Data Storage

All data stored in ~/.claude/skills/notebooklm/data/:

  • library.json - Notebook metadata
  • auth_info.json - Authentication status
  • browser_state/ - Browser cookies and session

Security: Protected by .gitignore, never commit to git.

Configuration

Optional .env file in skill directory:

HEADLESS=false           # Browser visibility
SHOW_BROWSER=false       # Default browser display
STEALTH_ENABLED=true     # Human-like behavior
TYPING_WPM_MIN=160       # Typing speed
TYPING_WPM_MAX=240
DEFAULT_NOTEBOOK_ID=     # Default notebook

Decision Flow

User mentions NotebookLM
    ↓
Check auth → python scripts/run.py auth_manager.py status
    ↓
If not authenticated → python scripts/run.py auth_manager.py setup
    ↓
Check/Add notebook → python scripts/run.py notebook_manager.py list/add (with --description)
    ↓
Activate notebook → python scripts/run.py notebook_manager.py activate --id ID
    ↓
Ask question → python scripts/run.py ask_question.py --question "..."
    ↓
See "Is that ALL you need?" → Ask follow-ups until complete
    ↓
Synthesize and respond to user

Troubleshooting

Problem Solution
ModuleNotFoundError Use run.py wrapper
Authentication fails Browser must be visible for setup! --show-browser
Rate limit (50/day) Wait or switch Google account
Browser crashes python scripts/run.py cleanup_manager.py --preserve-library
Notebook not found Check with notebook_manager.py list

Best Practices

  1. Always use run.py - Handles environment automatically
  2. Check auth first - Before any operations
  3. Follow-up questions - Don't stop at first answer
  4. Browser visible for auth - Required for manual login
  5. Include context - Each question is independent
  6. Synthesize answers - Combine multiple responses

Limitations

  • No session persistence (each question = new browser)
  • Rate limits on free Google accounts (50 queries/day)
  • Manual upload required (user must add docs to NotebookLM)
  • Browser overhead (few seconds per question)

Resources (Skill Structure)

Important directories and files:

  • scripts/ - All automation scripts (ask_question.py, notebook_manager.py, etc.)
  • data/ - Local storage for authentication and notebook library
  • references/ - Extended documentation:
    • api_reference.md - Detailed API documentation for all scripts
    • troubleshooting.md - Common issues and solutions
    • usage_patterns.md - Best practices and workflow examples
  • .venv/ - Isolated Python environment (auto-created on first run)
  • .gitignore - Protects sensitive data from being committed
统一处理所有联网任务。根据需求智能选择搜索、抓取或浏览器交互,遵循轻量优先原则。内置依赖检测与登录态持久化,支持动态页面及社交媒体内容获取,确保信息真实高效。
用户要求搜索信息 查看网页内容 访问需要登录的网站 操作网页界面 抓取社交媒体内容 读取动态渲染页面
integration/web-access/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill web-access -g -y
SKILL.md
Frontmatter
{
    "name": "web-access",
    "license": "MIT",
    "version": "1.1.0",
    "changelog": [
        {
            "date": 1773100800,
            "changes": [
                "新增\"浏览哲学\"框架:三个核心判断(我需要什么\/够了吗\/遇到阻碍怎么办)",
                "社交媒体\/内容平台直走浏览器 CDP,跳过 WebFetch",
                "新增视频内容采帧分析能力(seek + screenshot)",
                "完善 already-running 状态处理:必须验证后才能使用",
                "细化 wait 命令使用时机说明",
                "新增 screenshot --annotate 作为 snapshot -i 失效时的升级方案"
            ],
            "version": "1.1.0"
        },
        {
            "date": 1735689600,
            "changes": [
                "初始版本"
            ],
            "version": "1.0.0"
        }
    ],
    "description": "所有联网操作必须通过此 skill 处理,包括:搜索、网页抓取、登录后操作、动态页面交互等。\n触发场景:用户要求搜索信息、查看网页内容、访问需要登录的网站、操作网页界面、抓取社交媒体内容(小红书、微博、推特等)、读取动态渲染页面、以及任何需要真实浏览器环境的网络任务。\n"
}

web-access Skill

首次安装

用户首次使用时,执行以下流程:

Step 1:运行环境探测

bash ~/.claude/skills/web-access/scripts/check-deps.sh

Step 2:AI 根据输出处理缺失依赖

探测脚本只报告事实,安装决策由 AI 完成。缺什么装什么,Chrome 缺失时提示用户手动下载(无法自动安装)。

Step 3:安装完成后,向用户说明以下内容

web-access 已就绪。凡是联网的需求直接说就行,我会自动选最合适的方式:

  • 只需要搜索结果 → 直接搜,最快
  • 需要看完整页面 → 抓取页面内容,不启动浏览器
  • 需要登录或动态页面 → 自动启动浏览器,登录一次后持久保存

Windows 用户需要 Git Bash 环境(安装 Git for Windows 即可)。

浏览哲学

像人一样浏览,不像机器人一样执行程序。

人类浏览网页时不会在开始前列出完整步骤,而是带着目标进入,边看边判断,遇到阻碍就解决,发现内容不够就深入——全程围绕「我要拿到什么」做决策。这个 skill 的所有行为都应遵循这个逻辑。

三个核心判断:

① 我需要什么? — 任务驱动,先想清楚目标信息的性质,再选最轻且能直达的方式。不要用重型工具做轻量任务,也不要用轻量工具面对它覆盖不到的内容。

② 够了吗? — 拿到的信息能完成任务,就是够了。不过度采集,不为了"完整"而浪费代价。大概了解一个视频,几帧就够;理解一篇文章,读文字就够;不需要全页截图去做能用 accessibility tree 完成的事。

③ 遇到阻碍怎么办? — 在层内解决,不退回,不打扰用户。弹窗、登录墙、广告、加载失败——像人一样判断这个阻碍是否真的挡住了目标内容:挡住了就处理,没挡住就绕过去继续。只有在确认无法自行解决时才告知用户。

信息获取通道选择

  • 先评估任务,再选通道:根据「目标信息的性质、什么工具能直接拿到」决定起点,选最轻且能直达的方案。
  • 确保信息的真实性,一手信息优于二手信息:搜索引擎和聚合平台是信息发现入口。当多次搜索尝试后没有质的改进时,升级到更根本的获取方式:定位一手来源(官网、官方平台、原始页面)。
场景 通道
只需搜索摘要或关键词结果,或需要发现信息来源 WebSearch
URL 已知,静态公开页面 WebFetch
社交媒体、内容平台(微信公众号、微博、小红书、X/Twitter 等) 浏览器 CDP(直接,跳过 WebFetch)
需要动态内容、登录态、交互操作,或需要像人一样在浏览器内自由导航探索 浏览器 CDP

浏览器 CDP 不要求 URL 已知——可从任意入口出发,通过页面内搜索、点击、跳转等方式找到目标内容。

WebFetch 请求时加 header Accept: text/markdown, text/html,支持该协议的网站直接返回 Markdown,省约 80% token。失败(空内容 / 403 / JS 渲染)时升级到浏览器层。

降级禁止:进入更重的通道后,不得回头用轻量工具完成同一目标——等同于重走已知不通的路。浏览器层遇到阻碍应在层内解决(如处理登录),而不是绕回。唯一例外:浏览器操作中衍生的新子目标,可重新选择通道。

进入浏览器层后,区分任务性质:

  • 操作型(导航、填表、点击):用 accessibility tree 感知界面,无法识别时才截图辅助
  • 内容型(读帖子、看资讯、分析页面):accessibility tree 读文字结构,同时判断图片是否承载核心信息——是则提取图片 URL 定向读取

图片判断:社交媒体、图文博客、截图类内容,默认图片有价值,主动去取;工具类、导航类页面,默认 accessibility tree 够用。

浏览器 CDP 模式

启动

bash ~/.claude/skills/web-access/scripts/ensure-browser.sh
  • Browser ready on port 9222 → 脚本自己启动的,状态可信,直接用(任务结束后关闭)
  • already running → 检测到残留进程,状态不可信,必须验证:运行 agent-browser --cdp 9222 open about:blank,成功则可用;失败则执行 close 后重新 ensure(任务结束后不关闭)
  • ERROR 或 agent-browser 无响应 → 执行 bash ~/.claude/skills/web-access/scripts/close-browser.sh 后重新运行

⚠️ 严禁降级:只用 agent-browser CDP 模式,不切换到其他浏览器工具。Playwright MCP 底层同为 playwright-core + launchPersistentContext,能力等效,但 profile 路径不同——切换会丢失已有登录态,需重新登录。

常用命令

agent-browser --cdp 9222 open <url>           # 打开页面
agent-browser --cdp 9222 snapshot -i          # 可交互元素(操作用)
agent-browser --cdp 9222 snapshot             # 完整无障碍树(读文字用)
agent-browser --cdp 9222 click @ref-123       # 点击元素
agent-browser --cdp 9222 fill @ref-123 "内容" # 填写输入框
agent-browser --cdp 9222 wait load networkidle  # 仅用于 click/fill 触发导航后;open 已内置等待,勿在 open 后使用
agent-browser --cdp 9222 scroll down 3000     # 触发懒加载
agent-browser --cdp 9222 screenshot /tmp/x.png
agent-browser --cdp 9222 screenshot --annotate      # snapshot -i ref 失效时的升级方案,见 references/commands.md
agent-browser --cdp 9222 eval "<js>"          # 执行 JS,用于提取 DOM 信息

图片提取

判断内容在图片里时,用 eval 从 DOM 直接拿图片 URL,再定向打开截图读取——比全页截图精准得多。

需要知道的两个技术细节:

  • 懒加载:未进入视口的图片 naturalWidth 为 0,eval 前先 scroll 到底才能拿到完整列表
  • 过滤噪声naturalWidth > 200 排除图标和头像,留下内容图
agent-browser --cdp 9222 scroll down 3000
agent-browser --cdp 9222 eval "JSON.stringify(Array.from(document.querySelectorAll('img')).map((img,i)=>({i,src:img.src,w:img.naturalWidth,h:img.naturalHeight})).filter(x=>x.w>200))"
# 对每张目标图片:
agent-browser --cdp 9222 open <img_url>
agent-browser --cdp 9222 screenshot /tmp/img_n.png
# 用 Read tool 读取截图内容

视频内容获取

CDP headed 模式下浏览器真实渲染,截图可捕获当前视频帧。核心能力:seek 到任意时间点截图,可对视频内容进行离散采样分析。

# 获取总时长,制定采样计划
agent-browser --cdp 9222 eval "document.querySelector('video').duration"
# seek + 播放 + 截图
agent-browser --cdp 9222 eval "var v=document.querySelector('video'); v.currentTime=60; v.play()"
sleep 2
agent-browser --cdp 9222 screenshot /tmp/frame.png
# 全屏截图画面更清晰
agent-browser --cdp 9222 eval "document.querySelector('video').requestFullscreen()"

采帧粒度(仅供参考,具体视频具体分析:大概了解 → 30-60s 间隔;理解叙事 → 10s;精细分析 → 1-2s)由任务需求自行判断,无需用户指定。

登录判断

登录判断的核心问题只有一个:目标内容拿到了吗?

打开页面后,先尝试获取目标内容,持续执行。在此过程中,结合两方面信息做判断:

  1. 领域知识:对该网站的了解——X/Twitter 的最新时间线、小红书的私密内容、微博的完整评论等,这类内容通常需要登录才能获取完整数据
  2. 页面实际反馈:内容是否符合预期?是降级版(如热门帖代替最新帖)?是否有明显缺失?

即使页面显示了登录提示,只要目标内容已经拿到,就不需要打扰用户登录。

只有当确认目标内容无法获取时,才推断:登录是否能解决这个问题?若推断成立,告知用户:

"当前页面在未登录状态下无法获取[具体内容],请在已打开的 Chrome 窗口中登录 [网站名],完成后告诉我继续。"

登录完成后无需重启浏览器,直接继续原任务。

任务结束

ensure-browser.sh 返回 Browser ready(本次启动)→ 关闭浏览器(必须用此脚本,勿直接 kill,否则会留下崩溃窗口):

bash ~/.claude/skills/web-access/scripts/close-browser.sh

特殊任务规则

核实任务

核实的目标是一手来源,而非更多的二手报道——多个媒体引用同一个错误会造成循环印证假象。

搜索用于定位来源,不用于证明真伪。找到来源后,直接访问读取原文。

信息类型 一手来源
政策/法规 发布机构官网
企业公告 公司官方新闻页
学术声明 原始论文/机构官网

找不到官网时:权威媒体的原创报道(非转载)可作为次级依据,但需向用户说明:"未找到官方原文,以下核实来自[媒体名]报道,存在转述误差可能。"

工具能力边界理解

对任何工具(MCP、CLI、库)的能力有疑问时,如果没有足够的知识把握,先查官方文档,如无足够文档介绍,可考虑查看源码,再作判断,不猜测、不把不确定性转移给用户。

References 索引

文件 何时加载
references/commands.md 需要不常用命令时(drag、storage、pdf 等)
references/login-flow.md 需要了解登录流程细节时
将Markdown文章发布至X(Twitter) Premium Articles。自动解析格式、上传封面、转换富文本并插入图片,严格遵循“先文后图”策略及高效浏览器自动化原则,最终保存为草稿。
用户希望将Markdown文件或URL发布到X(Twitter)文章编辑器 提及'publish to X', 'post article to Twitter', 'X article' 寻求X Premium文章发布协助
integration/x-article-publisher/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill x-article-publisher -g -y
SKILL.md
Frontmatter
{
    "name": "x-article-publisher",
    "description": "Publish Markdown articles to X (Twitter) Articles editor with proper formatting. Use when user wants to publish a Markdown file\/URL to X Articles, or mentions \"publish to X\", \"post article to Twitter\", \"X article\", or wants help with X Premium article publishing. Handles cover image upload and converts Markdown to rich text automatically."
}

X Article Publisher

Publish Markdown content to X (Twitter) Articles editor, preserving formatting with rich text conversion.

Prerequisites

  • Playwright MCP for browser automation
  • User logged into X with Premium Plus subscription
  • Python 3.9+ with dependencies: pip install Pillow pyobjc-framework-Cocoa

Scripts

Located in ~/.claude/skills/x-article-publisher/scripts/:

parse_markdown.py

Parse Markdown and extract structured data:

python parse_markdown.py <markdown_file> [--output json|html] [--html-only]

Returns JSON with: title, cover_image, content_images (with block_index for positioning), html, total_blocks

copy_to_clipboard.py

Copy image or HTML to system clipboard:

# Copy image (with optional compression)
python copy_to_clipboard.py image /path/to/image.jpg [--quality 80]

# Copy HTML for rich text paste
python copy_to_clipboard.py html --file /path/to/content.html

Workflow

Strategy: "先文后图" (Text First, Images Later)

For articles with multiple images, paste ALL text content first, then insert images at correct positions using block index.

  1. Parse Markdown with Python script → get title, images with block_index, HTML
  2. Navigate to X Articles editor
  3. Upload cover image (first image)
  4. Fill title
  5. Copy HTML to clipboard (Python) → Paste with Cmd+V
  6. Insert content images at positions specified by block_index
  7. Save as draft (NEVER auto-publish)

高效执行原则 (Efficiency Guidelines)

目标: 最小化操作之间的等待时间,实现流畅的自动化体验。

1. 避免不必要的 browser_snapshot

大多数浏览器操作(click, type, press_key 等)都会在返回结果中包含页面状态。不要在每次操作后单独调用 browser_snapshot,直接使用操作返回的页面状态即可。

❌ 错误做法:
browser_click → browser_snapshot → 分析 → browser_click → browser_snapshot → ...

✅ 正确做法:
browser_click → 从返回结果中获取页面状态 → browser_click → ...

2. 避免不必要的 browser_wait_for

只在以下情况使用 browser_wait_for

  • 等待图片上传完成(textGone="正在上传媒体"
  • 等待页面初始加载(极少数情况)

不要使用 browser_wait_for 来等待按钮或输入框出现 - 它们在页面加载完成后立即可用。

3. 并行执行独立操作

当两个操作没有依赖关系时,可以在同一个消息中并行调用多个工具:

✅ 可以并行:
- 填写标题 (browser_type) + 复制HTML到剪贴板 (Bash)
- 解析Markdown生成JSON + 生成HTML文件

❌ 不能并行(有依赖):
- 必须先点击create才能上传封面图
- 必须先粘贴内容才能插入图片

4. 连续执行浏览器操作

每个浏览器操作返回的页面状态包含所有需要的元素引用。直接使用这些引用进行下一步操作:

# 理想流程(每步直接执行,不额外等待):
browser_navigate → 从返回状态找create按钮 → browser_click(create)
→ 从返回状态找上传按钮 → browser_click(上传) → browser_file_upload
→ 从返回状态找应用按钮 → browser_click(应用)
→ 从返回状态找标题框 → browser_type(标题)
→ 点击编辑器 → browser_press_key(Meta+v)
→ ...

5. 准备工作前置

在开始浏览器操作之前,先完成所有准备工作:

  1. 解析 Markdown 获取 JSON 数据
  2. 生成 HTML 文件到 /tmp/
  3. 记录 title、cover_image、content_images 等信息

这样浏览器操作阶段可以连续执行,不需要中途停下来处理数据。

Step 1: Parse Markdown (Python)

Use parse_markdown.py to extract all structured data:

python ~/.claude/skills/x-article-publisher/scripts/parse_markdown.py /path/to/article.md

Output JSON:

{
  "title": "Article Title",
  "cover_image": "/path/to/first-image.jpg",
  "content_images": [
    {"path": "/path/to/img2.jpg", "block_index": 5, "after_text": "context for debugging..."},
    {"path": "/path/to/img3.jpg", "block_index": 12, "after_text": "another context..."}
  ],
  "html": "<p>Content...</p><h2>Section</h2>...",
  "total_blocks": 45
}

Key fields:

  • block_index: The image should be inserted AFTER block element at this index (0-indexed)
  • total_blocks: Total number of block elements in the HTML
  • after_text: Kept for reference/debugging only, NOT for positioning

Save HTML to temp file for clipboard:

python parse_markdown.py article.md --html-only > /tmp/article_html.html

Step 2: Open X Articles Editor

browser_navigate: https://x.com/compose/articles

重要: 页面加载后会显示草稿列表,不是编辑器。需要:

  1. 等待页面加载完成: 使用 browser_snapshot 检查页面状态
  2. 立即点击 "create" 按钮: 不要等待 "添加标题" 等编辑器元素,它们只有点击 create 后才出现
  3. 等待编辑器加载: 点击 create 后,等待编辑器元素出现
# 1. 导航到页面
browser_navigate: https://x.com/compose/articles

# 2. 获取页面快照,找到 create 按钮
browser_snapshot

# 3. 点击 create 按钮(通常 ref 类似 "create" 或带有 create 标签)
browser_click: element="create button", ref=<create_button_ref>

# 4. 现在编辑器应该打开了,可以继续上传封面图等操作

注意: 不要使用 browser_wait_for text="添加标题" 来等待页面加载,因为这个文本只有在点击 create 后才出现,会导致超时。

If login needed, prompt user to log in manually.

Step 3: Upload Cover Image

  1. Click "添加照片或视频" button
  2. Use browser_file_upload with the cover image path (from JSON output)
  3. Verify image uploaded

Step 4: Fill Title

  • Find textbox with "添加标题" placeholder
  • Use browser_type to input title (from JSON output)

Step 5: Paste Text Content (Python Clipboard)

Copy HTML to system clipboard using Python, then paste:

# Copy HTML to clipboard
python ~/.claude/skills/x-article-publisher/scripts/copy_to_clipboard.py html --file /tmp/article_html.html

Then in browser:

browser_click on editor textbox
browser_press_key: Meta+v

This preserves all rich text formatting (H2, bold, links, lists).

Step 6: Insert Content Images (Block Index Positioning)

关键改进: 使用 block_index 精确定位,而非依赖文字匹配。

定位原理

粘贴 HTML 后,编辑器中的内容结构为一系列块元素(段落、标题、引用等)。每张图片的 block_index 表示它应该插入在第 N 个块元素之后。

操作步骤

  1. 获取所有块元素: 使用 browser_snapshot 获取编辑器内容,找到 textbox 下的所有子元素
  2. 按索引定位: 根据 block_index 点击对应的块元素
  3. 粘贴图片: 复制图片到剪贴板后粘贴

For each content image (from content_images array):

# 1. Copy image to clipboard (with compression)
python ~/.claude/skills/x-article-publisher/scripts/copy_to_clipboard.py image /path/to/img.jpg --quality 85
# 2. Click the block element at block_index
# Example: if block_index=5, click the 6th block element (0-indexed)
browser_click on the element at position block_index in the editor

# 3. Paste image
browser_press_key: Meta+v

# 4. Wait for upload (use short time, returns immediately when done)
browser_wait_for textGone="正在上传媒体" time=2

定位策略

在 browser_snapshot 返回的结构中,编辑器内容通常是:

textbox [ref=xxx]:
  generic [ref=block0]:  # block_index 0
    - paragraph content
  heading [ref=block1]:   # block_index 1
    - h2 content
  generic [ref=block2]:  # block_index 2
    - paragraph content
  ...

要在 block_index=5 后插入图片:

  1. 找到编辑器 textbox 下的第 6 个子元素(索引从0开始)
  2. 点击该元素
  3. 粘贴图片

注意: 每插入一张图片后,后续图片的实际位置会偏移。建议按 block_index 从大到小的顺序插入图片,这样先插入的图片不会影响后续图片的索引。

反向插入示例

如果有3张图片,block_index 分别为 5, 12, 27:

  1. 先插入 block_index=27 的图片
  2. 再插入 block_index=12 的图片
  3. 最后插入 block_index=5 的图片

这样每次插入都不会影响前面已经定位好的位置。

Step 7: Save Draft

  1. Verify content pasted (check word count indicator)
  2. Draft auto-saves, or click Save button if needed
  3. Click "预览" to verify formatting
  4. Report: "Draft saved. Review and publish manually."

Critical Rules

  1. NEVER publish - Only save draft
  2. First image = cover - Upload first image as cover image
  3. Rich text conversion - Always convert Markdown to HTML before pasting
  4. Use clipboard API - Paste via clipboard for proper formatting
  5. Block index positioning - Use block_index for precise image placement
  6. Reverse order insertion - Insert images from highest to lowest block_index
  7. H1 title handling - H1 is used as title only, not included in body

Supported Formatting

  • H2 headers (## )
  • Blockquotes (> )
  • Code blocks (...) - converted to blockquotes since X doesn't support <pre><code>
  • Bold text (**)
  • Hyperlinks (text)
  • Ordered lists (1. 2. 3.)
  • Unordered lists (- )
  • Paragraphs

Example Flow

User: "Publish /path/to/article.md to X"

# Step 1: Parse Markdown
python ~/.claude/skills/x-article-publisher/scripts/parse_markdown.py /path/to/article.md > /tmp/article.json
python ~/.claude/skills/x-article-publisher/scripts/parse_markdown.py /path/to/article.md --html-only > /tmp/article_html.html
  1. Navigate to https://x.com/compose/articles
  2. Upload cover image (browser_file_upload for cover only)
  3. Fill title (from JSON: title)
  4. Copy & paste HTML:
    python ~/.claude/skills/x-article-publisher/scripts/copy_to_clipboard.py html --file /tmp/article_html.html
    
    Then: browser_press_key Meta+v
  5. For each content image, in reverse order of block_index:
    python copy_to_clipboard.py image /path/to/img.jpg --quality 85
    
    • Click block element at block_index position
    • browser_press_key Meta+v
    • Wait until upload complete
  6. Verify in preview
  7. "Draft saved. Please review and publish manually."

Best Practices

为什么用 block_index 而非文字匹配?

  1. 精确定位: 不依赖文字内容,即使多处文字相似也能正确定位
  2. 可靠性: 索引是确定性的,不会因为文字相似而混淆
  3. 调试方便: after_text 仍保留用于人工核验

为什么用 Python 而非浏览器内 JavaScript?

  1. 本地处理更可靠: Python 直接操作系统剪贴板,不受浏览器沙盒限制
  2. 图片压缩: 上传前压缩图片 (--quality 85),减少上传时间
  3. 代码复用: 脚本固定不变,无需每次重新编写转换逻辑
  4. 调试方便: 脚本可单独测试,问题易定位

等待策略

关键理解: browser_wait_fortextGone 参数会在文字消失时立即返回time 只是最大等待时间,不是固定等待时间。

  • ❌ 保守等待: time=5time=10,如果上传只需2秒,剩余时间全浪费
  • ✅ 短间隔轮询: time=2,条件满足立即返回,最多等2秒
# 正确用法:短 time 值,条件满足立即返回
browser_wait_for textGone="正在上传媒体" time=2

# 错误用法:固定长时间等待
browser_wait_for time=5  # 无条件等待5秒,浪费时间

原则: 不要预设"需要等多久",而是设置一个合理的最大值,让条件检测尽快返回。

图片插入效率

每张图片的浏览器操作从5步减少到2步:

  • 旧: 点击 → 添加媒体 → 媒体 → 添加照片 → file_upload
  • 新: 点击段落 → Meta+v

封面图 vs 内容图

  • 封面图: 使用 browser_file_upload(因为有专门的上传按钮)
  • 内容图: 使用 Python 剪贴板 + 粘贴(更高效)
用于在Obsidian等应用中创建和编辑JSON Canvas文件(.canvas)。支持生成节点、边、分组及连接,适用于绘制思维导图、流程图或可视化画布。
用户请求创建或编辑.canvas文件 需要生成思维导图、流程图或可视化画布 提及Obsidian中的Canvas功能
obsidian/json-canvas/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill json-canvas -g -y
SKILL.md
Frontmatter
{
    "name": "json-canvas",
    "description": "Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian."
}

JSON Canvas Skill

This skill enables skills-compatible agents to create and edit valid JSON Canvas files (.canvas) used in Obsidian and other applications.

Overview

JSON Canvas is an open file format for infinite canvas data. Canvas files use the .canvas extension and contain valid JSON following the JSON Canvas Spec 1.0.

File Structure

A canvas file contains two top-level arrays:

{
  "nodes": [],
  "edges": []
}
  • nodes (optional): Array of node objects
  • edges (optional): Array of edge objects connecting nodes

Nodes

Nodes are objects placed on the canvas. There are four node types:

  • text - Text content with Markdown
  • file - Reference to files/attachments
  • link - External URL
  • group - Visual container for other nodes

Z-Index Ordering

Nodes are ordered by z-index in the array:

  • First node = bottom layer (displayed below others)
  • Last node = top layer (displayed above others)

Generic Node Attributes

All nodes share these attributes:

Attribute Required Type Description
id Yes string Unique identifier for the node
type Yes string Node type: text, file, link, or group
x Yes integer X position in pixels
y Yes integer Y position in pixels
width Yes integer Width in pixels
height Yes integer Height in pixels
color No canvasColor Node color (see Color section)

Text Nodes

Text nodes contain Markdown content.

{
  "id": "6f0ad84f44ce9c17",
  "type": "text",
  "x": 0,
  "y": 0,
  "width": 400,
  "height": 200,
  "text": "# Hello World\n\nThis is **Markdown** content."
}
Attribute Required Type Description
text Yes string Plain text with Markdown syntax

File Nodes

File nodes reference files or attachments (images, videos, PDFs, notes, etc.).

{
  "id": "a1b2c3d4e5f67890",
  "type": "file",
  "x": 500,
  "y": 0,
  "width": 400,
  "height": 300,
  "file": "Attachments/diagram.png"
}
{
  "id": "b2c3d4e5f6789012",
  "type": "file",
  "x": 500,
  "y": 400,
  "width": 400,
  "height": 300,
  "file": "Notes/Project Overview.md",
  "subpath": "#Implementation"
}
Attribute Required Type Description
file Yes string Path to file within the system
subpath No string Link to heading or block (starts with #)

Link Nodes

Link nodes display external URLs.

{
  "id": "c3d4e5f678901234",
  "type": "link",
  "x": 1000,
  "y": 0,
  "width": 400,
  "height": 200,
  "url": "https://obsidian.md"
}
Attribute Required Type Description
url Yes string External URL

Group Nodes

Group nodes are visual containers for organizing other nodes.

{
  "id": "d4e5f6789012345a",
  "type": "group",
  "x": -50,
  "y": -50,
  "width": 1000,
  "height": 600,
  "label": "Project Overview",
  "color": "4"
}
{
  "id": "e5f67890123456ab",
  "type": "group",
  "x": 0,
  "y": 700,
  "width": 800,
  "height": 500,
  "label": "Resources",
  "background": "Attachments/background.png",
  "backgroundStyle": "cover"
}
Attribute Required Type Description
label No string Text label for the group
background No string Path to background image
backgroundStyle No string Background rendering style

Background Styles

Value Description
cover Fills entire width and height of node
ratio Maintains aspect ratio of background image
repeat Repeats image as pattern in both directions

Edges

Edges are lines connecting nodes.

{
  "id": "f67890123456789a",
  "fromNode": "6f0ad84f44ce9c17",
  "toNode": "a1b2c3d4e5f67890"
}
{
  "id": "0123456789abcdef",
  "fromNode": "6f0ad84f44ce9c17",
  "fromSide": "right",
  "fromEnd": "none",
  "toNode": "b2c3d4e5f6789012",
  "toSide": "left",
  "toEnd": "arrow",
  "color": "1",
  "label": "leads to"
}
Attribute Required Type Default Description
id Yes string - Unique identifier for the edge
fromNode Yes string - Node ID where connection starts
fromSide No string - Side where edge starts
fromEnd No string none Shape at edge start
toNode Yes string - Node ID where connection ends
toSide No string - Side where edge ends
toEnd No string arrow Shape at edge end
color No canvasColor - Line color
label No string - Text label for the edge

Side Values

Value Description
top Top edge of node
right Right edge of node
bottom Bottom edge of node
left Left edge of node

End Shapes

Value Description
none No endpoint shape
arrow Arrow endpoint

Colors

The canvasColor type can be specified in two ways:

Hex Colors

{
  "color": "#FF0000"
}

Preset Colors

{
  "color": "1"
}
Preset Color
"1" Red
"2" Orange
"3" Yellow
"4" Green
"5" Cyan
"6" Purple

Note: Specific color values for presets are intentionally undefined, allowing applications to use their own brand colors.

Complete Examples

Simple Canvas with Text and Connections

{
  "nodes": [
    {
      "id": "8a9b0c1d2e3f4a5b",
      "type": "text",
      "x": 0,
      "y": 0,
      "width": 300,
      "height": 150,
      "text": "# Main Idea\n\nThis is the central concept."
    },
    {
      "id": "1a2b3c4d5e6f7a8b",
      "type": "text",
      "x": 400,
      "y": -100,
      "width": 250,
      "height": 100,
      "text": "## Supporting Point A\n\nDetails here."
    },
    {
      "id": "2b3c4d5e6f7a8b9c",
      "type": "text",
      "x": 400,
      "y": 100,
      "width": 250,
      "height": 100,
      "text": "## Supporting Point B\n\nMore details."
    }
  ],
  "edges": [
    {
      "id": "3c4d5e6f7a8b9c0d",
      "fromNode": "8a9b0c1d2e3f4a5b",
      "fromSide": "right",
      "toNode": "1a2b3c4d5e6f7a8b",
      "toSide": "left"
    },
    {
      "id": "4d5e6f7a8b9c0d1e",
      "fromNode": "8a9b0c1d2e3f4a5b",
      "fromSide": "right",
      "toNode": "2b3c4d5e6f7a8b9c",
      "toSide": "left"
    }
  ]
}

Project Board with Groups

{
  "nodes": [
    {
      "id": "5e6f7a8b9c0d1e2f",
      "type": "group",
      "x": 0,
      "y": 0,
      "width": 300,
      "height": 500,
      "label": "To Do",
      "color": "1"
    },
    {
      "id": "6f7a8b9c0d1e2f3a",
      "type": "group",
      "x": 350,
      "y": 0,
      "width": 300,
      "height": 500,
      "label": "In Progress",
      "color": "3"
    },
    {
      "id": "7a8b9c0d1e2f3a4b",
      "type": "group",
      "x": 700,
      "y": 0,
      "width": 300,
      "height": 500,
      "label": "Done",
      "color": "4"
    },
    {
      "id": "8b9c0d1e2f3a4b5c",
      "type": "text",
      "x": 20,
      "y": 50,
      "width": 260,
      "height": 80,
      "text": "## Task 1\n\nImplement feature X"
    },
    {
      "id": "9c0d1e2f3a4b5c6d",
      "type": "text",
      "x": 370,
      "y": 50,
      "width": 260,
      "height": 80,
      "text": "## Task 2\n\nReview PR #123",
      "color": "2"
    },
    {
      "id": "0d1e2f3a4b5c6d7e",
      "type": "text",
      "x": 720,
      "y": 50,
      "width": 260,
      "height": 80,
      "text": "## Task 3\n\n~~Setup CI/CD~~"
    }
  ],
  "edges": []
}

Research Canvas with Files and Links

{
  "nodes": [
    {
      "id": "1e2f3a4b5c6d7e8f",
      "type": "text",
      "x": 300,
      "y": 200,
      "width": 400,
      "height": 200,
      "text": "# Research Topic\n\n## Key Questions\n\n- How does X affect Y?\n- What are the implications?",
      "color": "5"
    },
    {
      "id": "2f3a4b5c6d7e8f9a",
      "type": "file",
      "x": 0,
      "y": 0,
      "width": 250,
      "height": 150,
      "file": "Literature/Paper A.pdf"
    },
    {
      "id": "3a4b5c6d7e8f9a0b",
      "type": "file",
      "x": 0,
      "y": 200,
      "width": 250,
      "height": 150,
      "file": "Notes/Meeting Notes.md",
      "subpath": "#Key Insights"
    },
    {
      "id": "4b5c6d7e8f9a0b1c",
      "type": "link",
      "x": 0,
      "y": 400,
      "width": 250,
      "height": 100,
      "url": "https://example.com/research"
    },
    {
      "id": "5c6d7e8f9a0b1c2d",
      "type": "file",
      "x": 750,
      "y": 150,
      "width": 300,
      "height": 250,
      "file": "Attachments/diagram.png"
    }
  ],
  "edges": [
    {
      "id": "6d7e8f9a0b1c2d3e",
      "fromNode": "2f3a4b5c6d7e8f9a",
      "fromSide": "right",
      "toNode": "1e2f3a4b5c6d7e8f",
      "toSide": "left",
      "label": "supports"
    },
    {
      "id": "7e8f9a0b1c2d3e4f",
      "fromNode": "3a4b5c6d7e8f9a0b",
      "fromSide": "right",
      "toNode": "1e2f3a4b5c6d7e8f",
      "toSide": "left",
      "label": "informs"
    },
    {
      "id": "8f9a0b1c2d3e4f5a",
      "fromNode": "4b5c6d7e8f9a0b1c",
      "fromSide": "right",
      "toNode": "1e2f3a4b5c6d7e8f",
      "toSide": "left",
      "toEnd": "arrow",
      "color": "6"
    },
    {
      "id": "9a0b1c2d3e4f5a6b",
      "fromNode": "1e2f3a4b5c6d7e8f",
      "fromSide": "right",
      "toNode": "5c6d7e8f9a0b1c2d",
      "toSide": "left",
      "label": "visualized by"
    }
  ]
}

Flowchart

{
  "nodes": [
    {
      "id": "a0b1c2d3e4f5a6b7",
      "type": "text",
      "x": 200,
      "y": 0,
      "width": 150,
      "height": 60,
      "text": "**Start**",
      "color": "4"
    },
    {
      "id": "b1c2d3e4f5a6b7c8",
      "type": "text",
      "x": 200,
      "y": 100,
      "width": 150,
      "height": 60,
      "text": "Step 1:\nGather data"
    },
    {
      "id": "c2d3e4f5a6b7c8d9",
      "type": "text",
      "x": 200,
      "y": 200,
      "width": 150,
      "height": 80,
      "text": "**Decision**\n\nIs data valid?",
      "color": "3"
    },
    {
      "id": "d3e4f5a6b7c8d9e0",
      "type": "text",
      "x": 400,
      "y": 200,
      "width": 150,
      "height": 60,
      "text": "Process data"
    },
    {
      "id": "e4f5a6b7c8d9e0f1",
      "type": "text",
      "x": 0,
      "y": 200,
      "width": 150,
      "height": 60,
      "text": "Request new data",
      "color": "1"
    },
    {
      "id": "f5a6b7c8d9e0f1a2",
      "type": "text",
      "x": 400,
      "y": 320,
      "width": 150,
      "height": 60,
      "text": "**End**",
      "color": "4"
    }
  ],
  "edges": [
    {
      "id": "a6b7c8d9e0f1a2b3",
      "fromNode": "a0b1c2d3e4f5a6b7",
      "fromSide": "bottom",
      "toNode": "b1c2d3e4f5a6b7c8",
      "toSide": "top"
    },
    {
      "id": "b7c8d9e0f1a2b3c4",
      "fromNode": "b1c2d3e4f5a6b7c8",
      "fromSide": "bottom",
      "toNode": "c2d3e4f5a6b7c8d9",
      "toSide": "top"
    },
    {
      "id": "c8d9e0f1a2b3c4d5",
      "fromNode": "c2d3e4f5a6b7c8d9",
      "fromSide": "right",
      "toNode": "d3e4f5a6b7c8d9e0",
      "toSide": "left",
      "label": "Yes",
      "color": "4"
    },
    {
      "id": "d9e0f1a2b3c4d5e6",
      "fromNode": "c2d3e4f5a6b7c8d9",
      "fromSide": "left",
      "toNode": "e4f5a6b7c8d9e0f1",
      "toSide": "right",
      "label": "No",
      "color": "1"
    },
    {
      "id": "e0f1a2b3c4d5e6f7",
      "fromNode": "e4f5a6b7c8d9e0f1",
      "fromSide": "top",
      "fromEnd": "none",
      "toNode": "b1c2d3e4f5a6b7c8",
      "toSide": "left",
      "toEnd": "arrow"
    },
    {
      "id": "f1a2b3c4d5e6f7a8",
      "fromNode": "d3e4f5a6b7c8d9e0",
      "fromSide": "bottom",
      "toNode": "f5a6b7c8d9e0f1a2",
      "toSide": "top"
    }
  ]
}

ID Generation

Node and edge IDs must be unique strings. Obsidian generates 16-character hexadecimal IDs:

"id": "6f0ad84f44ce9c17"
"id": "a3b2c1d0e9f8g7h6"
"id": "1234567890abcdef"

This format is a 16-character lowercase hex string (64-bit random value).

Layout Guidelines

Positioning

  • Coordinates can be negative (canvas extends infinitely)
  • x increases to the right
  • y increases downward
  • Position refers to top-left corner of node

Recommended Sizes

Node Type Suggested Width Suggested Height
Small text 200-300 80-150
Medium text 300-450 150-300
Large text 400-600 300-500
File preview 300-500 200-400
Link preview 250-400 100-200
Group Varies Varies

Spacing

  • Leave 20-50px padding inside groups
  • Space nodes 50-100px apart for readability
  • Align nodes to grid (multiples of 10 or 20) for cleaner layouts

Validation Rules

  1. All id values must be unique across nodes and edges
  2. fromNode and toNode must reference existing node IDs
  3. Required fields must be present for each node type
  4. type must be one of: text, file, link, group
  5. backgroundStyle must be one of: cover, ratio, repeat
  6. fromSide, toSide must be one of: top, right, bottom, left
  7. fromEnd, toEnd must be one of: none, arrow
  8. Color presets must be "1" through "6" or valid hex color

References

用于创建和编辑 Obsidian Bases (.base) 文件,支持配置视图、过滤器、公式及摘要。适用于构建笔记数据库视图或处理相关 YAML 配置的场景。
用户提到需要创建或编辑 .base 文件 用户希望为 Obsidian 笔记设置数据库式视图(如表格、卡片) 用户询问关于 Bases、过滤条件、公式或摘要的配置方法
obsidian/obsidian-bases/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill obsidian-bases -g -y
SKILL.md
Frontmatter
{
    "name": "obsidian-bases",
    "description": "Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian."
}

Obsidian Bases Skill

This skill enables skills-compatible agents to create and edit valid Obsidian Bases (.base files) including views, filters, formulas, and all related configurations.

Overview

Obsidian Bases are YAML-based files that define dynamic views of notes in an Obsidian vault. A Base file can contain multiple views, global filters, formulas, property configurations, and custom summaries.

File Format

Base files use the .base extension and contain valid YAML. They can also be embedded in Markdown code blocks.

Complete Schema

# Global filters apply to ALL views in the base
filters:
  # Can be a single filter string
  # OR a recursive filter object with and/or/not
  and: []
  or: []
  not: []

# Define formula properties that can be used across all views
formulas:
  formula_name: 'expression'

# Configure display names and settings for properties
properties:
  property_name:
    displayName: "Display Name"
  formula.formula_name:
    displayName: "Formula Display Name"
  file.ext:
    displayName: "Extension"

# Define custom summary formulas
summaries:
  custom_summary_name: 'values.mean().round(3)'

# Define one or more views
views:
  - type: table | cards | list | map
    name: "View Name"
    limit: 10                    # Optional: limit results
    groupBy:                     # Optional: group results
      property: property_name
      direction: ASC | DESC
    filters:                     # View-specific filters
      and: []
    order:                       # Properties to display in order
      - file.name
      - property_name
      - formula.formula_name
    summaries:                   # Map properties to summary formulas
      property_name: Average

Filter Syntax

Filters narrow down results. They can be applied globally or per-view.

Filter Structure

# Single filter
filters: 'status == "done"'

# AND - all conditions must be true
filters:
  and:
    - 'status == "done"'
    - 'priority > 3'

# OR - any condition can be true
filters:
  or:
    - 'file.hasTag("book")'
    - 'file.hasTag("article")'

# NOT - exclude matching items
filters:
  not:
    - 'file.hasTag("archived")'

# Nested filters
filters:
  or:
    - file.hasTag("tag")
    - and:
        - file.hasTag("book")
        - file.hasLink("Textbook")
    - not:
        - file.hasTag("book")
        - file.inFolder("Required Reading")

Filter Operators

Operator Description
== equals
!= not equal
> greater than
< less than
>= greater than or equal
<= less than or equal
&& logical and
|| logical or
! logical not

Properties

Three Types of Properties

  1. Note properties - From frontmatter: note.author or just author
  2. File properties - File metadata: file.name, file.mtime, etc.
  3. Formula properties - Computed values: formula.my_formula

File Properties Reference

Property Type Description
file.name String File name
file.basename String File name without extension
file.path String Full path to file
file.folder String Parent folder path
file.ext String File extension
file.size Number File size in bytes
file.ctime Date Created time
file.mtime Date Modified time
file.tags List All tags in file
file.links List Internal links in file
file.backlinks List Files linking to this file
file.embeds List Embeds in the note
file.properties Object All frontmatter properties

The this Keyword

  • In main content area: refers to the base file itself
  • When embedded: refers to the embedding file
  • In sidebar: refers to the active file in main content

Formula Syntax

Formulas compute values from properties. Defined in the formulas section.

formulas:
  # Simple arithmetic
  total: "price * quantity"
  
  # Conditional logic
  status_icon: 'if(done, "✅", "⏳")'
  
  # String formatting
  formatted_price: 'if(price, price.toFixed(2) + " dollars")'
  
  # Date formatting
  created: 'file.ctime.format("YYYY-MM-DD")'
  
  # Complex expressions
  days_old: '((now() - file.ctime) / 86400000).round(0)'

Functions Reference

Global Functions

Function Signature Description
date() date(string): date Parse string to date. Format: YYYY-MM-DD HH:mm:ss
duration() duration(string): duration Parse duration string
now() now(): date Current date and time
today() today(): date Current date (time = 00:00:00)
if() if(condition, trueResult, falseResult?) Conditional
min() min(n1, n2, ...): number Smallest number
max() max(n1, n2, ...): number Largest number
number() number(any): number Convert to number
link() link(path, display?): Link Create a link
list() list(element): List Wrap in list if not already
file() file(path): file Get file object
image() image(path): image Create image for rendering
icon() icon(name): icon Lucide icon by name
html() html(string): html Render as HTML
escapeHTML() escapeHTML(string): string Escape HTML characters

Any Type Functions

Function Signature Description
isTruthy() any.isTruthy(): boolean Coerce to boolean
isType() any.isType(type): boolean Check type
toString() any.toString(): string Convert to string

Date Functions & Fields

Fields: date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond

Function Signature Description
date() date.date(): date Remove time portion
format() date.format(string): string Format with Moment.js pattern
time() date.time(): string Get time as string
relative() date.relative(): string Human-readable relative time
isEmpty() date.isEmpty(): boolean Always false for dates

Date Arithmetic

# Duration units: y/year/years, M/month/months, d/day/days, 
#                 w/week/weeks, h/hour/hours, m/minute/minutes, s/second/seconds

# Add/subtract durations
"date + \"1M\""           # Add 1 month
"date - \"2h\""           # Subtract 2 hours
"now() + \"1 day\""       # Tomorrow
"today() + \"7d\""        # A week from today

# Subtract dates for millisecond difference
"now() - file.ctime"

# Complex duration arithmetic
"now() + (duration('1d') * 2)"

String Functions

Field: string.length

Function Signature Description
contains() string.contains(value): boolean Check substring
containsAll() string.containsAll(...values): boolean All substrings present
containsAny() string.containsAny(...values): boolean Any substring present
startsWith() string.startsWith(query): boolean Starts with query
endsWith() string.endsWith(query): boolean Ends with query
isEmpty() string.isEmpty(): boolean Empty or not present
lower() string.lower(): string To lowercase
title() string.title(): string To Title Case
trim() string.trim(): string Remove whitespace
replace() string.replace(pattern, replacement): string Replace pattern
repeat() string.repeat(count): string Repeat string
reverse() string.reverse(): string Reverse string
slice() string.slice(start, end?): string Substring
split() string.split(separator, n?): list Split to list

Number Functions

Function Signature Description
abs() number.abs(): number Absolute value
ceil() number.ceil(): number Round up
floor() number.floor(): number Round down
round() number.round(digits?): number Round to digits
toFixed() number.toFixed(precision): string Fixed-point notation
isEmpty() number.isEmpty(): boolean Not present

List Functions

Field: list.length

Function Signature Description
contains() list.contains(value): boolean Element exists
containsAll() list.containsAll(...values): boolean All elements exist
containsAny() list.containsAny(...values): boolean Any element exists
filter() list.filter(expression): list Filter by condition (uses value, index)
map() list.map(expression): list Transform elements (uses value, index)
reduce() list.reduce(expression, initial): any Reduce to single value (uses value, index, acc)
flat() list.flat(): list Flatten nested lists
join() list.join(separator): string Join to string
reverse() list.reverse(): list Reverse order
slice() list.slice(start, end?): list Sublist
sort() list.sort(): list Sort ascending
unique() list.unique(): list Remove duplicates
isEmpty() list.isEmpty(): boolean No elements

File Functions

Function Signature Description
asLink() file.asLink(display?): Link Convert to link
hasLink() file.hasLink(otherFile): boolean Has link to file
hasTag() file.hasTag(...tags): boolean Has any of the tags
hasProperty() file.hasProperty(name): boolean Has property
inFolder() file.inFolder(folder): boolean In folder or subfolder

Link Functions

Function Signature Description
asFile() link.asFile(): file Get file object
linksTo() link.linksTo(file): boolean Links to file

Object Functions

Function Signature Description
isEmpty() object.isEmpty(): boolean No properties
keys() object.keys(): list List of keys
values() object.values(): list List of values

Regular Expression Functions

Function Signature Description
matches() regexp.matches(string): boolean Test if matches

View Types

Table View

views:
  - type: table
    name: "My Table"
    order:
      - file.name
      - status
      - due_date
    summaries:
      price: Sum
      count: Average

Cards View

views:
  - type: cards
    name: "Gallery"
    order:
      - file.name
      - cover_image
      - description

List View

views:
  - type: list
    name: "Simple List"
    order:
      - file.name
      - status

Map View

Requires latitude/longitude properties and the Maps community plugin.

views:
  - type: map
    name: "Locations"
    # Map-specific settings for lat/lng properties

Default Summary Formulas

Name Input Type Description
Average Number Mathematical mean
Min Number Smallest number
Max Number Largest number
Sum Number Sum of all numbers
Range Number Max - Min
Median Number Mathematical median
Stddev Number Standard deviation
Earliest Date Earliest date
Latest Date Latest date
Range Date Latest - Earliest
Checked Boolean Count of true values
Unchecked Boolean Count of false values
Empty Any Count of empty values
Filled Any Count of non-empty values
Unique Any Count of unique values

Complete Examples

Task Tracker Base

filters:
  and:
    - file.hasTag("task")
    - 'file.ext == "md"'

formulas:
  days_until_due: 'if(due, ((date(due) - today()) / 86400000).round(0), "")'
  is_overdue: 'if(due, date(due) < today() && status != "done", false)'
  priority_label: 'if(priority == 1, "🔴 High", if(priority == 2, "🟡 Medium", "🟢 Low"))'

properties:
  status:
    displayName: Status
  formula.days_until_due:
    displayName: "Days Until Due"
  formula.priority_label:
    displayName: Priority

views:
  - type: table
    name: "Active Tasks"
    filters:
      and:
        - 'status != "done"'
    order:
      - file.name
      - status
      - formula.priority_label
      - due
      - formula.days_until_due
    groupBy:
      property: status
      direction: ASC
    summaries:
      formula.days_until_due: Average

  - type: table
    name: "Completed"
    filters:
      and:
        - 'status == "done"'
    order:
      - file.name
      - completed_date

Reading List Base

filters:
  or:
    - file.hasTag("book")
    - file.hasTag("article")

formulas:
  reading_time: 'if(pages, (pages * 2).toString() + " min", "")'
  status_icon: 'if(status == "reading", "📖", if(status == "done", "✅", "📚"))'
  year_read: 'if(finished_date, date(finished_date).year, "")'

properties:
  author:
    displayName: Author
  formula.status_icon:
    displayName: ""
  formula.reading_time:
    displayName: "Est. Time"

views:
  - type: cards
    name: "Library"
    order:
      - cover
      - file.name
      - author
      - formula.status_icon
    filters:
      not:
        - 'status == "dropped"'

  - type: table
    name: "Reading List"
    filters:
      and:
        - 'status == "to-read"'
    order:
      - file.name
      - author
      - pages
      - formula.reading_time

Project Notes Base

filters:
  and:
    - file.inFolder("Projects")
    - 'file.ext == "md"'

formulas:
  last_updated: 'file.mtime.relative()'
  link_count: 'file.links.length'
  
summaries:
  avgLinks: 'values.filter(value.isType("number")).mean().round(1)'

properties:
  formula.last_updated:
    displayName: "Updated"
  formula.link_count:
    displayName: "Links"

views:
  - type: table
    name: "All Projects"
    order:
      - file.name
      - status
      - formula.last_updated
      - formula.link_count
    summaries:
      formula.link_count: avgLinks
    groupBy:
      property: status
      direction: ASC

  - type: list
    name: "Quick List"
    order:
      - file.name
      - status

Daily Notes Index

filters:
  and:
    - file.inFolder("Daily Notes")
    - '/^\d{4}-\d{2}-\d{2}$/.matches(file.basename)'

formulas:
  word_estimate: '(file.size / 5).round(0)'
  day_of_week: 'date(file.basename).format("dddd")'

properties:
  formula.day_of_week:
    displayName: "Day"
  formula.word_estimate:
    displayName: "~Words"

views:
  - type: table
    name: "Recent Notes"
    limit: 30
    order:
      - file.name
      - formula.day_of_week
      - formula.word_estimate
      - file.mtime

Embedding Bases

Embed in Markdown files:

![[MyBase.base]]

<!-- Specific view -->
![[MyBase.base#View Name]]

YAML Quoting Rules

  • Use single quotes for formulas containing double quotes: 'if(done, "Yes", "No")'
  • Use double quotes for simple strings: "My View Name"
  • Escape nested quotes properly in complex expressions

Common Patterns

Filter by Tag

filters:
  and:
    - file.hasTag("project")

Filter by Folder

filters:
  and:
    - file.inFolder("Notes")

Filter by Date Range

filters:
  and:
    - 'file.mtime > now() - "7d"'

Filter by Property Value

filters:
  and:
    - 'status == "active"'
    - 'priority >= 3'

Combine Multiple Conditions

filters:
  or:
    - and:
        - file.hasTag("important")
        - 'status != "done"'
    - and:
        - 'priority == 1'
        - 'due != ""'

References

Obsidian智能笔记助手,整合MCP实现日记、知识捕获与回顾。严格遵循PARA结构,强制在AI专用区追加写入,限制元数据字段,提供MCP配置引导及连接检测流程。
用户提到obsidian、日记、笔记、知识库、capture、review 用户输入/daily、/capture或/review命令
obsidian/obsidian-helper/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill obsidian-helper -g -y
SKILL.md
Frontmatter
{
    "name": "obsidian-helper",
    "author": "Claude Code",
    "version": "1.4.0",
    "description": "Obsidian 智能笔记助手。当用户提到 obsidian、日记、笔记、知识库、capture、review 时激活。\n\n【激活后必须执行】:\n1. 先完整阅读本 SKILL.md 文件\n2. 理解 AI 写入三条硬规矩(00_Inbox\/AI\/、追加式、白名单字段)\n3. 按 STEP 0 → STEP 1 → ... 顺序执行\n4. 不要跳过任何步骤,不要自作主张\n\n【禁止行为】:\n- 禁止不读 SKILL.md 就开始工作\n- 禁止跳过用户确认步骤\n- 禁止在非 00_Inbox\/AI\/ 位置创建新笔记(除非用户明确指定)\n"
}

Obsidian Helper - 智能笔记助手

这是一个与 Obsidian MCP 深度整合的智能助手,提供三大核心功能来提升你的笔记效率。


⚡ 首次使用必读:自动检测与配置引导

执行任何功能前,Claude 必须先执行 STEP 0

STEP 0: MCP 连接检测(每次会话首次使用时执行)
├─ 尝试调用 obsidian_list_files_in_vault()
├─ 如果成功 → 继续执行用户请求的功能
└─ 如果失败 → 进入【配置引导流程】

配置引导流程(全中文提示)

当 MCP 连接失败时,Claude 必须向用户显示以下引导信息:


检测到 Obsidian MCP 未连接,我来帮你配置!

📋 配置步骤

第一步:安装 Obsidian 插件

  1. 打开 Obsidian → 设置 → 第三方插件
  2. 关闭「安全模式」
  3. 点击「浏览」,搜索 Local REST API
  4. 安装并启用该插件

第二步:获取 API Key

  1. 在 Obsidian 设置中找到 Local REST API 插件设置
  2. 点击「Copy API Key」复制你的 API Key
  3. 记下端口号(默认是 27124

第三步:配置 Claude Code MCP

在终端运行以下命令,将 你的API_KEY 替换为刚才复制的 Key:

# 创建 MCP 配置目录(如果不存在)
mkdir -p ~/.claude

# 添加 Obsidian MCP 配置
cat >> ~/.claude/mcp.json << 'EOF'
{
  "mcpServers": {
    "mcp-obsidian": {
      "command": "npx",
      "args": ["-y", "mcp-obsidian"],
      "env": {
        "OBSIDIAN_API_KEY": "你的API_KEY",
        "OBSIDIAN_HOST": "https://127.0.0.1:27124"
      }
    }
  }
}
EOF

或者手动编辑 ~/.claude/mcp.json

{
  "mcpServers": {
    "mcp-obsidian": {
      "command": "npx",
      "args": ["-y", "mcp-obsidian"],
      "env": {
        "OBSIDIAN_API_KEY": "你的API_KEY",
        "OBSIDIAN_HOST": "https://127.0.0.1:27124"
      }
    }
  }
}

第四步:重启 Claude Code

# 完全退出 Claude Code,然后重新启动
claude

第五步:验证连接

重启后,再次输入你想要的命令(如 /daily),我会自动验证连接是否成功。


❓ 常见问题

问题 解决方案
插件找不到 确保 Obsidian 版本 ≥ 1.0.0
连接被拒绝 检查 Obsidian 是否正在运行
API Key 无效 重新在插件设置中复制 Key
端口冲突 在插件设置中修改端口,并更新 mcp.json

需要帮助? 告诉我你遇到的具体错误信息,我来帮你解决。


连接成功后的提示

当 MCP 连接成功时,Claude 应该简短确认:

✅ Obsidian 已连接!检测到你的知识库,现在开始执行 [功能名称]...

🎯 核心功能概览

命令 功能 使用场景
/daily 智能日记助手 每日开始时,快速启动一天
/capture <主题> 知识捕获 随时记录想法、笔记
/review [period] 周期回顾 定期总结复盘

🏗️ 推荐 Vault 结构(PARA + Zettelkasten)

Vault/
├── 00_Inbox/                 # 随手记
│   └── AI/                   # 【重要】AI 专用落地区
├── 10_Projects/              # 有截止时间的项目
├── 20_Areas/                 # 长期领域(学习/健康/职业)
├── 30_Resources/             # 资料库
│   └── Products/             # 产品卡片
├── 40_Zettels/               # 永久笔记(结论/洞见)
├── 90_Archive/               # 归档
├── 99_System/Templates/      # 模板
└── Daily Notes/              # 日记

⚠️ AI 写入三条硬规矩

Claude 必须遵守以下规则:

规则 1: AI 专用落地区

新建笔记默认位置: 00_Inbox/AI/
用户确认后才移动到其他位置

规则 2: 追加式写入

✅ 用 obsidian_append_content 追加
✅ 用 obsidian_patch_content 在指定标题下追加
❌ 不要重写整篇笔记

规则 3: Properties 白名单

# 只允许写这些字段,不能发明新字段
---
type: note | product | project | zettel
title: ""
tags: []
status: active | done | archived
created: {{date}}
---

📋 功能一:/daily - 智能日记助手

触发条件

  • 用户输入 /daily
  • 用户说「开始今天的日记」「今日日记」「daily note」

执行流程

STEP 0: MCP 连接检测(见上方)

STEP 1: 获取日记信息
├─ 尝试 obsidian_get_periodic_note(period: "daily")
├─ 如果失败,使用 obsidian_list_files_in_dir("Daily Notes") 查找今日文件
├─ 使用 obsidian_get_recent_periodic_notes 或手动获取昨日日记
└─ 检查日记是否已存在

STEP 2: 分析昨日内容
├─ 读取昨日日记内容
├─ 提取未完成的 TODO(正则匹配 `- \[ \]`)
├─ 识别重要事项
└─ 生成简要总结

STEP 3: 生成今日日记
├─ 如果今日日记不存在,创建新日记
├─ 使用标准模板结构
├─ 自动填入:
│   ├─ 昨日未完成事项 → 今日待办
│   ├─ 日期和星期(中文格式)
│   └─ 基础模板结构
└─ 使用 obsidian_append_content 写入

STEP 4: 向用户报告
├─ 显示日记创建/更新状态
├─ 列出继承的未完成任务数量
└─ 询问是否需要补充内容

日记模板结构

---
date: {{YYYY-MM-DD}}
tags: [daily]
---

# {{星期}}, {{月}} {{日}}, {{年}}

## 今日重点

> [!tip] Focus
>

## 任务

### 从昨日继承
{{yesterday_incomplete_todos}}

### 必须完成
- [ ]

### 应该完成
- [ ]

### 可以完成
- [ ]

## 今日笔记

### 上午


### 下午


### 晚间


## 想法与灵感


## 今日创建的链接


## 晚间反思

### 顺利的地方


### 可以改进的地方


### 感恩

使用示例

用户输入: /daily开始今日日记

Claude 执行:

  1. 检测 MCP 连接 ✓
  2. 获取今日日记(如 2026-01-19)
  3. 获取昨日日记,提取未完成事项
  4. 创建/更新今日日记
  5. 回复:「✅ 今日日记已创建!从昨日继承了 X 项未完成任务。」

📋 功能二:/capture - 快速知识捕获

触发条件

  • 用户输入 /capture <主题>/capture <主题> <内容>
  • 用户说「记录一下」「捕获」「添加笔记」「capture」

执行流程

STEP 0: MCP 连接检测

STEP 1: 解析用户输入
├─ 提取主题关键词(第一个词或引号内容)
├─ 提取要记录的内容(主题之后的所有文本)
└─ 如果只有主题没有内容,询问用户要记录什么

STEP 2: 搜索现有笔记
├─ 使用 obsidian_simple_search(query: 主题) 搜索
├─ 分析搜索结果的相关性
└─ 按相关度排序

STEP 3: 决策与执行
├─ 情况A:找到高度相关笔记(标题包含主题)
│   ├─ 告诉用户:「找到相关笔记《XXX》,是否追加到此笔记?」
│   ├─ 用户确认后,使用 obsidian_patch_content 追加
│   └─ 追加格式:## {{时间戳}} 捕获\n{{内容}}
│
├─ 情况B:找到部分相关笔记
│   ├─ 列出最相关的 3 个笔记
│   ├─ 询问:「选择追加到哪个笔记,或创建新笔记?」
│   └─ 根据用户选择执行
│
└─ 情况C:未找到相关笔记
    ├─ 告诉用户:「未找到相关笔记,将创建新笔记」
    ├─ 询问存放位置(列出现有文件夹)
    └─ 使用 obsidian_append_content 创建

STEP 4: 确认完成
└─ 显示:「✅ 已保存到《XXX》」

捕获内容格式

## 2026-01-19 14:30 捕获

{{用户输入的内容}}

---

使用示例

示例 1:

用户: /capture API设计 RESTful API 应该使用名词而非动词

Claude: 搜索 → 找到「API设计最佳实践.md」→ 询问确认 → 追加内容

示例 2:

用户: /capture 新想法

Claude: 「你想记录什么内容?」→ 用户输入 → 搜索 → 处理


📋 功能三:/review - 周期回顾生成器

触发条件

  • 用户输入 /review/review weekly/review monthly
  • 用户说「周回顾」「月度总结」「复盘」「review」

执行流程

STEP 0: MCP 连接检测

STEP 1: 确定回顾周期
├─ 解析参数:daily / weekly(默认)/ monthly
└─ 计算时间范围

STEP 2: 收集数据
├─ 获取周期内的日记文件
│   ├─ 尝试 obsidian_get_recent_periodic_notes
│   └─ 备选:obsidian_list_files_in_dir + 日期过滤
├─ 使用 obsidian_batch_get_file_contents 批量读取
├─ 使用 obsidian_get_recent_changes 获取活跃文件
└─ 提取所有相关内容

STEP 3: 分析内容
├─ 统计任务完成情况
│   ├─ 已完成:匹配 `- \[x\]`
│   └─ 未完成:匹配 `- \[ \]`
├─ 提取重要事件和成就
├─ 识别高频主题词
├─ 发现知识关联
└─ 生成洞察

STEP 4: 生成报告
├─ 使用对应周期的模板
├─ 填充统计数据
├─ 添加分析内容
├─ 保存到 Daily Notes/ 文件夹
│   ├─ 周报:YYYY-WXX 周回顾.md
│   └─ 月报:YYYY-MM 月度回顾.md
└─ 使用 obsidian_append_content 写入

STEP 5: 展示结果
├─ 显示回顾摘要
├─ 列出关键数据
└─ 询问是否需要修改或补充

周回顾模板

# {{年}}-W{{周}} 周回顾 | {{日期范围}}

## 📊 数据概览
| 指标 | 数值 |
|------|------|
| 📝 笔记数量 | {{count}} |
| ✅ 完成任务 | {{completed}} |
| ⏳ 未完成任务 | {{incomplete}} |
| 📂 活跃文件 | {{active}} |

## 🏆 本周成就
{{achievements}}

## 📋 任务总结

### ✅ 已完成
{{completed_list}}

### ⏳ 待继续
{{incomplete_list}}

## 💡 关键洞察
{{insights}}

## 🔗 知识连接
本周涉及的主要主题:{{themes}}

## 🎯 下周重点
1.
2.
3.

## 📝 反思
### 做得好的地方

### 可以改进的地方

---
*生成时间: {{timestamp}}*

🔧 配置选项

用户可以在 Obsidian 库中创建 _config/obsidian-helper.md 自定义配置:

# Obsidian Helper 配置

## 日记设置
- 日记文件夹: Daily Notes/
- 日记格式: YYYY-MM-DD
- 周回顾格式: YYYY-[W]ww

## 捕获设置
- 默认捕获文件夹: Resources/
- 自动添加时间戳: true

## 回顾设置
- 默认回顾周期: weekly
- 回顾保存位置: Daily Notes/

Claude 在执行功能前,应检查是否存在此配置文件并读取设置。


🛠️ 技术实现

依赖的 MCP 工具

工具 用途 必需
obsidian_list_files_in_vault 检测连接、列出库结构
obsidian_list_files_in_dir 列出目录文件
obsidian_get_file_contents 读取文件内容
obsidian_batch_get_file_contents 批量读取
obsidian_simple_search 文本搜索
obsidian_append_content 创建/追加内容
obsidian_patch_content 精确编辑
obsidian_get_periodic_note 获取周期笔记
obsidian_get_recent_periodic_notes 最近周期笔记
obsidian_get_recent_changes 最近修改

错误处理策略

错误类型 处理方式
MCP 未连接 显示完整配置引导(见上方)
文件不存在 自动创建
API 不可用 使用备选方法(如直接文件操作)
搜索无结果 提示创建新笔记

📚 快速参考

/daily                    → 启动今日日记,继承昨日未完成
/capture <主题>           → 快速捕获到相关笔记
/capture <主题> <内容>    → 捕获指定内容
/review                   → 生成周回顾(默认)
/review daily             → 生成日回顾
/review weekly            → 生成周回顾
/review monthly           → 生成月回顾

🆘 帮助命令

当用户输入以下内容时,显示帮助信息:

  • obsidian help
  • obsidian 帮助
  • /daily help
  • 怎么用 obsidian helper

显示内容:

📖 Obsidian Helper 使用指南

🗓️ /daily - 智能日记
   自动创建今日日记,继承昨日未完成任务

📝 /capture <主题> [内容] - 知识捕获
   快速记录想法到相关笔记
   示例:/capture API设计 REST要用名词

📊 /review [weekly|monthly] - 周期回顾
   自动分析笔记,生成回顾报告

⚙️ 配置问题?
   输入「配置 obsidian」查看 MCP 配置指南

Obsidian Helper v1.1.0 - 让笔记更智能

用于创建和编辑符合 Obsidian 语法的 Markdown 文件,支持双链、嵌入、调用块、属性等特有功能。适用于处理 .md 文件或涉及维基链接、标签等场景。
用户要求创建或编辑 Obsidian 笔记 提及 wikilinks, callouts, frontmatter, tags, embeds 处理包含 Obsidian 特有语法的 .md 文件
obsidian/obsidian-markdown/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill obsidian-markdown -g -y
SKILL.md
Frontmatter
{
    "name": "obsidian-markdown",
    "description": "Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes."
}

Obsidian Flavored Markdown Skill

This skill enables skills-compatible agents to create and edit valid Obsidian Flavored Markdown, including all Obsidian-specific syntax extensions.

Overview

Obsidian uses a combination of Markdown flavors:

Basic Formatting

Paragraphs and Line Breaks

This is a paragraph.

This is another paragraph (blank line between creates separate paragraphs).

For a line break within a paragraph, add two spaces at the end  
or use Shift+Enter.

Headings

# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6

Text Formatting

Style Syntax Example Output
Bold **text** or __text__ **Bold** Bold
Italic *text* or _text_ *Italic* Italic
Bold + Italic ***text*** ***Both*** Both
Strikethrough ~~text~~ ~~Striked~~ Striked
Highlight ==text== ==Highlighted== ==Highlighted==
Inline code `code` `code` code

Escaping Formatting

Use backslash to escape special characters:

\*This won't be italic\*
\#This won't be a heading
1\. This won't be a list item

Common characters to escape: \*, \_, \#, \`, \|, \~

Internal Links (Wikilinks)

Basic Links

[[Note Name]]
[[Note Name.md]]
[[Note Name|Display Text]]

Link to Headings

[[Note Name#Heading]]
[[Note Name#Heading|Custom Text]]
[[#Heading in same note]]
[[##Search all headings in vault]]

Link to Blocks

[[Note Name#^block-id]]
[[Note Name#^block-id|Custom Text]]

Define a block ID by adding ^block-id at the end of a paragraph:

This is a paragraph that can be linked to. ^my-block-id

For lists and quotes, add the block ID on a separate line:

> This is a quote
> With multiple lines

^quote-id

Search Links

[[##heading]]     Search for headings containing "heading"
[[^^block]]       Search for blocks containing "block"

Markdown-Style Links

[Display Text](Note%20Name.md)
[Display Text](Note%20Name.md#Heading)
[Display Text](https://example.com)
[Note](obsidian://open?vault=VaultName&file=Note.md)

Note: Spaces must be URL-encoded as %20 in Markdown links.

Embeds

Embed Notes

![[Note Name]]
![[Note Name#Heading]]
![[Note Name#^block-id]]

Embed Images

![[image.png]]
![[image.png|640x480]]    Width x Height
![[image.png|300]]        Width only (maintains aspect ratio)

External Images

![Alt text](https://example.com/image.png)
![Alt text|300](https://example.com/image.png)

Embed Audio

![[audio.mp3]]
![[audio.ogg]]

Embed PDF

![[document.pdf]]
![[document.pdf#page=3]]
![[document.pdf#height=400]]

Embed Lists

![[Note#^list-id]]

Where the list has been defined with a block ID:

- Item 1
- Item 2
- Item 3

^list-id

Embed Search Results

```query
tag:#project status:done
```

Callouts

Basic Callout

> [!note]
> This is a note callout.

> [!info] Custom Title
> This callout has a custom title.

> [!tip] Title Only

Foldable Callouts

> [!faq]- Collapsed by default
> This content is hidden until expanded.

> [!faq]+ Expanded by default
> This content is visible but can be collapsed.

Nested Callouts

> [!question] Outer callout
> > [!note] Inner callout
> > Nested content

Supported Callout Types

Type Aliases Description
note - Blue, pencil icon
abstract summary, tldr Teal, clipboard icon
info - Blue, info icon
todo - Blue, checkbox icon
tip hint, important Cyan, flame icon
success check, done Green, checkmark icon
question help, faq Yellow, question mark
warning caution, attention Orange, warning icon
failure fail, missing Red, X icon
danger error Red, zap icon
bug - Red, bug icon
example - Purple, list icon
quote cite Gray, quote icon

Custom Callouts (CSS)

.callout[data-callout="custom-type"] {
  --callout-color: 255, 0, 0;
  --callout-icon: lucide-alert-circle;
}

Lists

Unordered Lists

- Item 1
- Item 2
  - Nested item
  - Another nested
- Item 3

* Also works with asterisks
+ Or plus signs

Ordered Lists

1. First item
2. Second item
   1. Nested numbered
   2. Another nested
3. Third item

1) Alternative syntax
2) With parentheses

Task Lists

- [ ] Incomplete task
- [x] Completed task
- [ ] Task with sub-tasks
  - [ ] Subtask 1
  - [x] Subtask 2

Quotes

> This is a blockquote.
> It can span multiple lines.
>
> And include multiple paragraphs.
>
> > Nested quotes work too.

Code

Inline Code

Use `backticks` for inline code.
Use double backticks for ``code with a ` backtick inside``.

Code Blocks

```
Plain code block
```

```javascript
// Syntax highlighted code block
function hello() {
  console.log("Hello, world!");
}
```

```python
# Python example
def greet(name):
    print(f"Hello, {name}!")
```

Nesting Code Blocks

Use more backticks or tildes for the outer block:

````markdown
Here's how to create a code block:
```js
console.log("Hello")
```
````

Tables

| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1   | Cell 2   | Cell 3   |
| Cell 4   | Cell 5   | Cell 6   |

Alignment

| Left     | Center   | Right    |
|:---------|:--------:|---------:|
| Left     | Center   | Right    |

Using Pipes in Tables

Escape pipes with backslash:

| Column 1 | Column 2 |
|----------|----------|
| [[Link\|Display]] | ![[Image\|100]] |

Math (LaTeX)

Inline Math

This is inline math: $e^{i\pi} + 1 = 0$

Block Math

$$
\begin{vmatrix}
a & b \\
c & d
\end{vmatrix} = ad - bc
$$

Common Math Syntax

$x^2$              Superscript
$x_i$              Subscript
$\frac{a}{b}$      Fraction
$\sqrt{x}$         Square root
$\sum_{i=1}^{n}$   Summation
$\int_a^b$         Integral
$\alpha, \beta$    Greek letters

Diagrams (Mermaid)

```mermaid
graph TD
    A[Start] --> B{Decision}
    B -->|Yes| C[Do this]
    B -->|No| D[Do that]
    C --> E[End]
    D --> E
```

Sequence Diagrams

```mermaid
sequenceDiagram
    Alice->>Bob: Hello Bob
    Bob-->>Alice: Hi Alice
```

Linking in Diagrams

```mermaid
graph TD
    A[Biology]
    B[Chemistry]
    A --> B
    class A,B internal-link;
```

Footnotes

This sentence has a footnote[^1].

[^1]: This is the footnote content.

You can also use named footnotes[^note].

[^note]: Named footnotes still appear as numbers.

Inline footnotes are also supported.^[This is an inline footnote.]

Comments

This is visible %%but this is hidden%% text.

%%
This entire block is hidden.
It won't appear in reading view.
%%

Horizontal Rules

---
***
___
- - -
* * *

Properties (Frontmatter)

Properties use YAML frontmatter at the start of a note:

---
title: My Note Title
date: 2024-01-15
tags:
  - project
  - important
aliases:
  - My Note
  - Alternative Name
cssclasses:
  - custom-class
status: in-progress
rating: 4.5
completed: false
due: 2024-02-01T14:30:00
---

Property Types

Type Example
Text title: My Title
Number rating: 4.5
Checkbox completed: true
Date date: 2024-01-15
Date & Time due: 2024-01-15T14:30:00
List tags: [one, two] or YAML list
Links related: "[[Other Note]]"

Default Properties

  • tags - Note tags
  • aliases - Alternative names for the note
  • cssclasses - CSS classes applied to the note

Tags

#tag
#nested/tag
#tag-with-dashes
#tag_with_underscores

In frontmatter:
---
tags:
  - tag1
  - nested/tag2
---

Tags can contain:

  • Letters (any language)
  • Numbers (not as first character)
  • Underscores _
  • Hyphens -
  • Forward slashes / (for nesting)

HTML Content

Obsidian supports HTML within Markdown:

<div class="custom-container">
  <span style="color: red;">Colored text</span>
</div>

<details>
  <summary>Click to expand</summary>
  Hidden content here.
</details>

<kbd>Ctrl</kbd> + <kbd>C</kbd>

Complete Example

---
title: Project Alpha
date: 2024-01-15
tags:
  - project
  - active
status: in-progress
priority: high
---

# Project Alpha

## Overview

This project aims to [[improve workflow]] using modern techniques.

> [!important] Key Deadline
> The first milestone is due on ==January 30th==.

## Tasks

- [x] Initial planning
- [x] Resource allocation
- [ ] Development phase
  - [ ] Backend implementation
  - [ ] Frontend design
- [ ] Testing
- [ ] Deployment

## Technical Notes

The main algorithm uses the formula $O(n \log n)$ for sorting.

```python
def process_data(items):
    return sorted(items, key=lambda x: x.priority)
```

## Architecture

```mermaid
graph LR
    A[Input] --> B[Process]
    B --> C[Output]
    B --> D[Cache]
```

## Related Documents

- ![[Meeting Notes 2024-01-10#Decisions]]
- [[Budget Allocation|Budget]]
- [[Team Members]]

## References

For more details, see the official documentation[^1].

[^1]: https://example.com/docs

%%
Internal notes:
- Review with team on Friday
- Consider alternative approaches
%%

References

将代码项目转换为结构化 Obsidian 知识库。需先读 SKILL.md,经用户确认输出路径后,按流程扫描项目、分析代码并生成文档。禁止跳过确认或擅自决定位置。
obsidian 项目文档 知识库 分析项目 转换项目
obsidian/project-to-obsidian/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill project-to-obsidian -g -y
SKILL.md
Frontmatter
{
    "name": "project-to-obsidian",
    "author": "Claude Code",
    "version": "1.4.0",
    "description": "将代码项目转换为 Obsidian 知识库。当用户提到 obsidian、项目文档、知识库、分析项目、转换项目 时激活。\n\n【激活后必须执行】:\n1. 先完整阅读本 SKILL.md 文件\n2. 理解 AI 写入规则(默认到 00_Inbox\/AI\/、追加式、统一 Schema)\n3. 执行 STEP 0: 使用 AskUserQuestion 询问用户确认\n4. 用户确认后才开始 STEP 1 项目扫描\n5. 严格按 STEP 0 → 1 → 2 → 3 → 4 顺序执行\n\n【禁止行为】:\n- 禁止不读 SKILL.md 就开始分析项目\n- 禁止跳过 STEP 0 用户确认\n- 禁止直接在 30_Resources 创建(先到 00_Inbox\/AI\/)\n- 禁止自作主张决定输出位置\n"
}

Project to Obsidian - 项目知识库生成器

将任意代码项目转换为结构化的 Obsidian 知识库,让项目知识可搜索、可链接、可扩展。


🎯 核心功能

命令 功能 说明
/p2o <项目路径> 完整转换 分析项目并生成完整 Obsidian 库
/p2o <路径> --quick 快速概览 只生成项目概览和结构
/p2o <路径> --api API 文档 专注生成 API/函数文档
/p2o <路径> --arch 架构文档 生成架构和设计文档

⚡ 执行流程

用户意图: "把这个项目转成知识库" / /p2o
              ↓
┌─────────────────────────────────────────────────────────┐
│  PHASE 0: 用户确认(必须)                                │
│                                                         │
│  Claude 使用 AskUserQuestion 工具询问:                   │
│                                                         │
│  "检测到你想将项目转换为 Obsidian 知识库,请确认:"        │
│                                                         │
│  📁 项目路径: /path/to/project                           │
│                                                         │
│  选择输出方式:                                           │
│  [1] 写入 Obsidian vault(需要 MCP)                     │
│  [2] 创建本地文件夹                                       │
│  [3] 输出到项目 /docs 目录                                │
│  [4] 取消                                                │
│                                                         │
│  用户选择后才继续执行。                                    │
└─────────────────────────────────────────────────────────┘
              ↓
        用户确认后
              ↓
┌─────────────────────────────────────────────────────────┐
│  PHASE 1: 项目扫描                                       │
│  ├─ 读取项目结构 (Glob + Bash ls/find)                   │
│  ├─ 识别项目类型 (package.json/Cargo.toml/go.mod 等)     │
│  ├─ 检测主要语言和框架                                    │
│  └─ 生成文件清单                                         │
└─────────────────────────────────────────────────────────┘
              ↓
┌─────────────────────────────────────────────────────────┐
│  PHASE 2: 代码分析                                       │
│  ├─ 读取关键文件 (入口、配置、核心模块)                    │
│  ├─ 提取:                                               │
│  │   ├─ 函数/类/接口定义                                 │
│  │   ├─ API 端点                                        │
│  │   ├─ 依赖关系                                        │
│  │   ├─ 配置项                                          │
│  │   └─ 注释和文档字符串                                 │
│  └─ 构建代码知识图谱                                     │
└─────────────────────────────────────────────────────────┘
              ↓
┌─────────────────────────────────────────────────────────┐
│  PHASE 3: 文档生成                                       │
│  ├─ 生成 Obsidian 目录结构                               │
│  ├─ 创建各类文档:                                       │
│  │   ├─ 00-项目概览.md (MOC)                            │
│  │   ├─ 01-快速开始.md                                  │
│  │   ├─ 02-架构设计.md                                  │
│  │   ├─ 03-API文档/                                     │
│  │   ├─ 04-模块说明/                                    │
│  │   ├─ 05-配置参考.md                                  │
│  │   └─ 06-开发指南.md                                  │
│  └─ 添加双向链接 [[]] 和标签 #tag                        │
└─────────────────────────────────────────────────────────┘
              ↓
┌─────────────────────────────────────────────────────────┐
│  PHASE 4: 输出到 Obsidian                                │
│  ├─ 方式A: 写入 00_Inbox/AI/{{项目名}}/ (推荐,先落地)    │
│  ├─ 方式B: 写入 30_Resources/Projects/{{项目名}}/        │
│  └─ 方式C: 创建本地文件夹                                 │
└─────────────────────────────────────────────────────────┘
              ↓
         完成报告

⚠️ AI 写入规则(必须遵守)

规则 1: 默认落地到 AI 专区

首选位置: 00_Inbox/AI/{{项目名}}-知识库/
用户确认后可移动到: 30_Resources/Projects/

规则 2: 使用追加式写入

✅ obsidian_append_content - 创建新文件
✅ obsidian_patch_content - 追加到指定位置
❌ 不要覆盖已存在的笔记

规则 3: 统一 Properties Schema

# 项目文档统一使用以下字段
---
type: project-doc          # project-doc | api | module | architecture
project: "{{项目名}}"
source: "{{项目路径}}"
language: ""               # typescript | python | go | rust | java
framework: ""              # react | express | fastapi | gin
tags: []
created: {{date}}
---

规则 4: 生成 Dataview 索引

在项目概览中自动添加 Dataview 查询:
- 模块列表
- API 端点列表
- 最近修改

📋 详细执行步骤

STEP 0: 用户确认(必须先执行)

当 skill 被触发时,Claude 必须首先使用 AskUserQuestion 工具询问用户:

AskUserQuestion:
  question: "检测到你想将项目转换为 Obsidian 知识库"
  header: "确认"
  options:
    - label: "写入 Obsidian vault"
      description: "使用 MCP 直接写入你的 Obsidian 库(推荐)"
    - label: "创建本地文件夹"
      description: "在指定位置创建新的知识库文件夹"
    - label: "输出到 /docs"
      description: "在当前项目目录下创建 docs/obsidian/"
    - label: "取消"
      description: "不执行转换"

用户选择「取消」时,立即停止,不执行后续步骤。

用户确认后,继续显示项目信息并询问生成模式:

AskUserQuestion:
  question: "选择生成模式"
  header: "模式"
  options:
    - label: "完整模式"
      description: "生成全部文档:概览、架构、API、模块说明"
    - label: "快速模式"
      description: "只生成项目概览和目录结构"
    - label: "API 文档"
      description: "专注生成 API/接口文档"

STEP 1: 项目扫描

# Claude 执行的分析逻辑

# 1. 获取项目结构
使用 Glob 工具扫描:
- **/*.{js,ts,py,go,rs,java,rb,php,swift,kt}  # 代码文件
- **/package.json, **/Cargo.toml, **/go.mod   # 项目配置
- **/*.{md,txt}                                # 文档
- **/.env*, **/config.*                        # 配置文件

# 2. 识别项目类型
检测标志文件:
- package.json → Node.js/前端项目
- Cargo.toml → Rust 项目
- go.mod → Go 项目
- pyproject.toml/setup.py → Python 项目
- pom.xml/build.gradle → Java 项目
- Gemfile → Ruby 项目

# 3. 识别框架
检测特征:
- next.config.* → Next.js
- vite.config.* → Vite
- tsconfig.json → TypeScript
- Dockerfile → Docker 化项目
- .github/workflows → CI/CD

STEP 3: 代码分析

对每个关键文件,Claude 需要提取:

├─ 入口文件 (main.*, index.*, app.*)
│   ├─ 应用初始化流程
│   ├─ 路由配置
│   └─ 中间件设置
│
├─ API/路由文件
│   ├─ 端点路径
│   ├─ HTTP 方法
│   ├─ 请求参数
│   └─ 响应格式
│
├─ 模型/类型定义
│   ├─ 数据结构
│   ├─ 接口定义
│   └─ 类型别名
│
├─ 服务/业务逻辑
│   ├─ 核心函数
│   ├─ 业务流程
│   └─ 外部调用
│
└─ 配置文件
    ├─ 环境变量
    ├─ 功能开关
    └─ 第三方配置

STEP 4: 生成 Obsidian 结构

生成的 Obsidian 目录结构:

{{项目名}}-知识库/
├─ 00-项目概览.md          # MOC - 主入口
├─ 01-快速开始.md          # 安装、运行、基本使用
├─ 02-架构设计/
│   ├─ 整体架构.md
│   ├─ 目录结构.md
│   └─ 技术栈.md
├─ 03-API文档/
│   ├─ _API索引.md         # API MOC
│   ├─ 用户相关.md
│   ├─ 订单相关.md
│   └─ ...
├─ 04-模块说明/
│   ├─ _模块索引.md        # 模块 MOC
│   ├─ 核心模块.md
│   ├─ 工具函数.md
│   └─ ...
├─ 05-配置参考.md          # 环境变量、配置项
├─ 06-开发指南/
│   ├─ 本地开发.md
│   ├─ 测试指南.md
│   └─ 部署流程.md
└─ _templates/             # Obsidian 模板
    ├─ 新功能模板.md
    └─ Bug记录模板.md

📝 文档模板

项目概览模板 (MOC)

---
tags: [project, moc, {{项目类型}}]
created: {{日期}}
---

# {{项目名}} 知识库

> {{一句话描述}}

## 🚀 快速导航

- [[01-快速开始|快速开始]] - 5 分钟上手
- [[02-架构设计/整体架构|架构设计]] - 了解系统设计
- [[03-API文档/_API索引|API 文档]] - 接口参考

## 📊 项目信息

| 属性 | 值 |
|------|-----|
| 语言 | {{主语言}} |
| 框架 | {{框架}} |
| 版本 | {{版本}} |
| 仓库 | {{仓库地址}} |

## 🗂️ 目录结构

{{项目结构树}}


## 🔗 核心模块

{{模块链接列表}}

## 📅 最近更新

- {{更新记录}}

---
*由 project-to-obsidian 自动生成*

API 文档模板

---
tags: [api, {{模块}}]
endpoint: {{路径}}
method: {{方法}}
---

# {{API名称}}

> {{描述}}

## 请求

```http
{{方法}} {{路径}}

参数

参数 类型 必填 说明
{{参数表}}

请求示例

{{请求示例}}

响应

成功响应

{{响应示例}}

相关

  • [[{{相关API}}]]
  • [[{{相关模块}}]]

### 模块说明模板

```markdown
---
tags: [module, {{标签}}]
path: {{文件路径}}
---

# {{模块名}}

> {{模块描述}}

## 职责

{{职责说明}}

## 核心函数

### `{{函数名}}`

```{{语言}}
{{函数签名}}

参数: {{参数说明}}

返回: {{返回说明}}

示例:

{{使用示例}}

依赖关系

graph LR
    {{模块}} --> {{依赖1}}
    {{模块}} --> {{依赖2}}

相关模块

  • [[{{相关模块1}}]]
  • [[{{相关模块2}}]]

---

## 🔧 输出选项

### 选项 1: 输出到 Obsidian Vault (推荐)

如果检测到 Obsidian MCP 可用: ├─ 询问用户选择目标 vault ├─ 在 vault 中创建项目文件夹 ├─ 使用 obsidian_append_content 写入文件 └─ 完成后可直接使用 obsidian-helper 功能


### 选项 2: 创建本地文件夹

├─ 询问输出路径 ├─ 创建 {{项目名}}-knowledge-base/ 文件夹 ├─ 使用 Write 工具写入所有文件 └─ 提示用户在 Obsidian 中打开该文件夹


### 选项 3: 输出到项目 /docs

├─ 在项目目录创建 /docs/obsidian/ 文件夹 ├─ 写入所有文档 ├─ 添加 .gitignore 排除(可选) └─ 文档与代码同步版本控制


---

## 🎯 使用示例

### 示例 1: 完整转换

用户: /p2o /Users/jun/Projects/my-api

Claude:

  1. 扫描项目... 检测到 Node.js + Express 项目
  2. 分析代码... 找到 15 个 API 端点,8 个核心模块
  3. 询问:输出到哪里?
    • [1] 当前 Obsidian vault (Projects/ 文件夹)
    • [2] 新建文件夹
    • [3] 项目内 /docs
  4. 用户选择 [1]
  5. 生成文档到 Obsidian vault
  6. 完成!生成了 23 个笔记文件

### 示例 2: 快速概览

用户: /p2o ~/code/rust-project --quick

Claude:

  1. 快速扫描项目结构
  2. 生成:
    • 项目概览.md
    • 目录结构.md
    • 技术栈.md
  3. 输出 3 个文件到指定位置

### 示例 3: 只生成 API 文档

用户: /p2o ./backend --api

Claude:

  1. 扫描 API 路由文件
  2. 提取所有端点
  3. 生成 API 文档集合
  4. 输出到 Obsidian

---

## 🔗 与其他工具集成

### 与 obsidian-helper 集成

生成的知识库完全兼容 obsidian-helper:

/daily → 在日记中记录「今天研究了 [[my-api-知识库/03-API文档/用户认证|用户认证 API]]」

/capture API设计 发现了一个新的设计模式 → 自动链接到相关 API 文档

/review weekly → 回顾中包含项目相关笔记的修改


### 与 MCP 工具集成

生成后可使用 MCP 工具: ├─ obsidian_simple_search - 搜索项目文档 ├─ obsidian_patch_content - 更新文档 ├─ obsidian_get_file_contents - 读取文档 └─ obsidian_append_content - 添加新文档


---

## ⚙️ 配置选项

在目标 vault 创建 `_config/project-to-obsidian.md` 自定义:

```markdown
# Project to Obsidian 配置

## 生成选项
- 生成 Mermaid 图表: true
- 生成代码示例: true
- 提取注释: true
- 最大文件大小: 100KB

## 忽略规则
- 忽略文件夹: node_modules, .git, dist, build, __pycache__
- 忽略文件: *.min.js, *.map, *.lock

## 输出设置
- 默认输出位置: Projects/
- 文档语言: zh-CN
- 链接样式: wiki-link

🚨 错误处理

情况 处理
项目路径不存在 提示用户检查路径
项目太大 (>1000 文件) 建议使用 --quick 模式或指定子目录
无法识别项目类型 询问用户手动指定语言/框架
MCP 未连接 自动切换到本地文件输出
写入失败 回滚并提示错误原因

📚 支持的项目类型

语言/框架 识别标志 特殊处理
Node.js package.json 提取 scripts, dependencies
TypeScript tsconfig.json 提取类型定义
Python pyproject.toml, setup.py 提取 docstrings
Go go.mod 提取包结构
Rust Cargo.toml 提取 crate 结构
Java pom.xml, build.gradle 提取类和接口
React/Vue/Angular 框架配置 提取组件结构
Express/FastAPI/Gin 路由文件 提取 API 端点

📎 快速参考

/p2o <路径>              → 完整转换项目到 Obsidian
/p2o <路径> --quick      → 快速生成概览
/p2o <路径> --api        → 只生成 API 文档
/p2o <路径> --arch       → 只生成架构文档
/p2o <路径> -o <输出>    → 指定输出位置

Project to Obsidian v1.0.0 - 让代码知识可视化

在创意工作前协助将想法转化为完整设计。通过逐步提问明确需求,提供多种方案并推荐最优解,分块展示设计细节以获取反馈,最终输出文档并准备实施环境。
创建新功能 构建组件 添加功能 修改行为
planning/brainstorming/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill brainstorming -g -y
SKILL.md
Frontmatter
{
    "name": "brainstorming",
    "description": "You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation."
}

Brainstorming Ideas Into Designs

Overview

Help turn ideas into fully formed designs and specs through natural collaborative dialogue.

Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design in small sections (200-300 words), checking after each section whether it looks right so far.

The Process

Understanding the idea:

  • Check out the current project state first (files, docs, recent commits)
  • Ask questions one at a time to refine the idea
  • Prefer multiple choice questions when possible, but open-ended is fine too
  • Only one question per message - if a topic needs more exploration, break it into multiple questions
  • Focus on understanding: purpose, constraints, success criteria

Exploring approaches:

  • Propose 2-3 different approaches with trade-offs
  • Present options conversationally with your recommendation and reasoning
  • Lead with your recommended option and explain why

Presenting the design:

  • Once you believe you understand what you're building, present the design
  • Break it into sections of 200-300 words
  • Ask after each section whether it looks right so far
  • Cover: architecture, components, data flow, error handling, testing
  • Be ready to go back and clarify if something doesn't make sense

After the Design

Documentation:

  • Write the validated design to docs/plans/YYYY-MM-DD-<topic>-design.md
  • Use elements-of-style:writing-clearly-and-concisely skill if available
  • Commit the design document to git

Implementation (if continuing):

  • Ask: "Ready to set up for implementation?"
  • Use superpowers:using-git-worktrees to create isolated workspace
  • Use superpowers:writing-plans to create detailed implementation plan

Key Principles

  • One question at a time - Don't overwhelm with multiple questions
  • Multiple choice preferred - Easier to answer than open-ended when possible
  • YAGNI ruthlessly - Remove unnecessary features from all designs
  • Explore alternatives - Always propose 2-3 approaches before settling
  • Incremental validation - Present design in sections, validate each
  • Be flexible - Go back and clarify when something doesn't make sense
生成面向AI代理的结构化会话摘要,用于跨会话上下文延续。适用于结束编码调试、用户要求总结或上下文过长时,输出机器可读的交接文档,避免重复解释和重试失败路径。
用户说compact, summarize session, save context或wrap up 上下文窗口超过50%且任务进行中 即将切换任务或暂停前 调试或实现会话结束时
planning/chat-compactor/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill chat-compactor -g -y
SKILL.md
Frontmatter
{
    "name": "chat-compactor",
    "description": "Generate structured session summaries optimized for future AI agent consumption. Use when (1) ending a coding\/debugging session, (2) user says \"compact\", \"summarize session\", \"save context\", or \"wrap up\", (3) context window is getting long and continuity matters, (4) before switching tasks or taking a break. Produces machine-readable handoff documents that let the next session start fluently without re-explaining."
}

Chat Compactor

Generate structured summaries optimized for AI agent continuity across sessions.

Why This Exists

Human-written summaries and ad-hoc AI summaries lose critical context:

  • Decision rationale gets lost (why X, not Y)
  • Dead ends get forgotten (agent re-tries failed approaches)
  • Implicit knowledge isn't captured (file locations, naming conventions, gotchas)
  • State is unclear (what's done, what's pending, what's blocked)

This skill produces agent-optimized handoff documents that prime the next session.

Output Format

Generate a markdown file with this structure:

# Session: [Brief Title]
Date: [YYYY-MM-DD]
Duration: ~[X] messages

## Context Snapshot
[1-2 sentences: What project/task, what state it's in right now]

## What Was Accomplished
- [Concrete outcome 1]
- [Concrete outcome 2]

## Key Decisions & Rationale
| Decision | Why | Alternatives Rejected |
|----------|-----|----------------------|
| [Choice] | [Reason] | [What didn't work and why] |

## Current State
- **Working**: [files/features that are functional]
- **Broken/Blocked**: [what's not working and why]
- **Modified files**: [list with brief note on changes]

## Dead Ends (Don't Retry)
- ❌ [Approach that failed] — [why it failed]

## Next Steps (Prioritized)
1. [ ] [Most important next action]
2. [ ] [Second priority]

## Environment & Gotchas
- [Any setup notes, versions, quirks discovered]

## Key Code/Commands Reference
[Only if there are non-obvious commands or snippets the next session needs]

Workflow

  1. Scan conversation for: decisions, outcomes, failures, file changes, blockers
  2. Identify the "handoff moment" — what would a fresh agent need to continue?
  3. Generate structured summary using format above
  4. Save to file: session-[topic]-[date].md in project root or /home/claude/sessions/

Compaction Triggers

Invoke this skill when:

  • User says: "compact", "wrap up", "save session", "summarize for next time"
  • Context window exceeds ~50% capacity and task is ongoing
  • Before major context switches
  • End of debugging/implementation session

Quality Criteria

Good compactions are:

  • Scannable: Next agent gets orientation in <30 seconds
  • Actionable: Clear next steps, not vague summaries
  • Defensive: Dead ends documented to prevent re-exploration
  • Minimal: No fluff, every line earns its tokens

Anti-Patterns

Avoid:

  • Narrative prose ("First we tried X, then Y, then Z...")
  • Redundant context (don't repeat what's in code comments)
  • Vague summaries ("Made good progress on the feature")
  • Missing failure documentation (most valuable part!)

Example Trigger & Response

User: "Let's wrap up, compact this session"

Agent:

  1. Reviews conversation for key decisions, outcomes, failures
  2. Generates structured markdown per format above
  3. Saves to session-[topic]-[date].md
  4. Confirms: "Session compacted to session-auth-refactor-2025-01-06.md — ready for next time."
用于在独立会话中执行已编写的实现计划。核心原则是分批执行并设置审查节点,每批完成后报告结果等待反馈,遇到阻塞时立即停止请求协助,最后调用子技能完成分支收尾。
拥有书面实现计划需分步执行 需要带审查检查点的任务执行流程
planning/executing-plans/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill executing-plans -g -y
SKILL.md
Frontmatter
{
    "name": "executing-plans",
    "description": "Use when you have a written implementation plan to execute in a separate session with review checkpoints"
}

Executing Plans

Overview

Load plan, review critically, execute tasks in batches, report for review between batches.

Core principle: Batch execution with checkpoints for architect review.

Announce at start: "I'm using the executing-plans skill to implement this plan."

The Process

Step 1: Load and Review Plan

  1. Read plan file
  2. Review critically - identify any questions or concerns about the plan
  3. If concerns: Raise them with your human partner before starting
  4. If no concerns: Create TodoWrite and proceed

Step 2: Execute Batch

Default: First 3 tasks

For each task:

  1. Mark as in_progress
  2. Follow each step exactly (plan has bite-sized steps)
  3. Run verifications as specified
  4. Mark as completed

Step 3: Report

When batch complete:

  • Show what was implemented
  • Show verification output
  • Say: "Ready for feedback."

Step 4: Continue

Based on feedback:

  • Apply changes if needed
  • Execute next batch
  • Repeat until complete

Step 5: Complete Development

After all tasks complete and verified:

  • Announce: "I'm using the finishing-a-development-branch skill to complete this work."
  • REQUIRED SUB-SKILL: Use superpowers:finishing-a-development-branch
  • Follow that skill to verify tests, present options, execute choice

When to Stop and Ask for Help

STOP executing immediately when:

  • Hit a blocker mid-batch (missing dependency, test fails, instruction unclear)
  • Plan has critical gaps preventing starting
  • You don't understand an instruction
  • Verification fails repeatedly

Ask for clarification rather than guessing.

When to Revisit Earlier Steps

Return to Review (Step 1) when:

  • Partner updates the plan based on your feedback
  • Fundamental approach needs rethinking

Don't force through blockers - stop and ask.

Remember

  • Review plan critically first
  • Follow plan steps exactly
  • Don't skip verifications
  • Reference skills when plan says to
  • Between batches: just report and wait
  • Stop when blocked, don't guess
实现类Manus的文件式规划,通过持久化task_plan.md、findings.md和progress.md作为工作记忆。适用于复杂多步骤任务或需多次工具调用的场景,确保关键信息不丢失并规范错误处理流程。
启动复杂的多步骤任务 执行研究项目 需要超过5次工具调用的操作
planning/planning-with-files/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill planning-with-files -g -y
SKILL.md
Frontmatter
{
    "name": "planning-with-files",
    "hooks": {
        "Stop": [
            {
                "hooks": [
                    {
                        "type": "command",
                        "command": "${CLAUDE_PLUGIN_ROOT}\/scripts\/check-complete.sh"
                    }
                ]
            }
        ],
        "PreToolUse": [
            {
                "hooks": [
                    {
                        "type": "command",
                        "command": "cat task_plan.md 2>\/dev\/null | head -30 || true"
                    }
                ],
                "matcher": "Write|Edit|Bash"
            }
        ],
        "PostToolUse": [
            {
                "hooks": [
                    {
                        "type": "command",
                        "command": "echo '[planning-with-files] File updated. If this completes a phase, update task_plan.md status.'"
                    }
                ],
                "matcher": "Write|Edit"
            }
        ],
        "SessionStart": [
            {
                "hooks": [
                    {
                        "type": "command",
                        "command": "echo '[planning-with-files] Ready. Auto-activates for complex tasks, or invoke manually with \/planning-with-files'"
                    }
                ]
            }
        ]
    },
    "version": "2.1.2",
    "description": "Implements Manus-style file-based planning for complex tasks. Creates task_plan.md, findings.md, and progress.md. Use when starting complex multi-step tasks, research projects, or any task requiring >5 tool calls.",
    "allowed-tools": [
        "Read",
        "Write",
        "Edit",
        "Bash",
        "Glob",
        "Grep",
        "WebFetch",
        "WebSearch"
    ],
    "user-invocable": true
}

Planning with Files

Work like Manus: Use persistent markdown files as your "working memory on disk."

Important: Where Files Go

When using this skill:

  • Templates are stored in the skill directory at ${CLAUDE_PLUGIN_ROOT}/templates/
  • Your planning files (task_plan.md, findings.md, progress.md) should be created in your project directory — the folder where you're working
Location What Goes There
Skill directory (${CLAUDE_PLUGIN_ROOT}/) Templates, scripts, reference docs
Your project directory task_plan.md, findings.md, progress.md

This ensures your planning files live alongside your code, not buried in the skill installation folder.

Quick Start

Before ANY complex task:

  1. Create task_plan.md in your project — Use templates/task_plan.md as reference
  2. Create findings.md in your project — Use templates/findings.md as reference
  3. Create progress.md in your project — Use templates/progress.md as reference
  4. Re-read plan before decisions — Refreshes goals in attention window
  5. Update after each phase — Mark complete, log errors

Note: All three planning files should be created in your current working directory (your project root), not in the skill's installation folder.

The Core Pattern

Context Window = RAM (volatile, limited)
Filesystem = Disk (persistent, unlimited)

→ Anything important gets written to disk.

File Purposes

File Purpose When to Update
task_plan.md Phases, progress, decisions After each phase
findings.md Research, discoveries After ANY discovery
progress.md Session log, test results Throughout session

Critical Rules

1. Create Plan First

Never start a complex task without task_plan.md. Non-negotiable.

2. The 2-Action Rule

"After every 2 view/browser/search operations, IMMEDIATELY save key findings to text files."

This prevents visual/multimodal information from being lost.

3. Read Before Decide

Before major decisions, read the plan file. This keeps goals in your attention window.

4. Update After Act

After completing any phase:

  • Mark phase status: in_progresscomplete
  • Log any errors encountered
  • Note files created/modified

5. Log ALL Errors

Every error goes in the plan file. This builds knowledge and prevents repetition.

## Errors Encountered
| Error | Attempt | Resolution |
|-------|---------|------------|
| FileNotFoundError | 1 | Created default config |
| API timeout | 2 | Added retry logic |

6. Never Repeat Failures

if action_failed:
    next_action != same_action

Track what you tried. Mutate the approach.

The 3-Strike Error Protocol

ATTEMPT 1: Diagnose & Fix
  → Read error carefully
  → Identify root cause
  → Apply targeted fix

ATTEMPT 2: Alternative Approach
  → Same error? Try different method
  → Different tool? Different library?
  → NEVER repeat exact same failing action

ATTEMPT 3: Broader Rethink
  → Question assumptions
  → Search for solutions
  → Consider updating the plan

AFTER 3 FAILURES: Escalate to User
  → Explain what you tried
  → Share the specific error
  → Ask for guidance

Read vs Write Decision Matrix

Situation Action Reason
Just wrote a file DON'T read Content still in context
Viewed image/PDF Write findings NOW Multimodal → text before lost
Browser returned data Write to file Screenshots don't persist
Starting new phase Read plan/findings Re-orient if context stale
Error occurred Read relevant file Need current state to fix
Resuming after gap Read all planning files Recover state

The 5-Question Reboot Test

If you can answer these, your context management is solid:

Question Answer Source
Where am I? Current phase in task_plan.md
Where am I going? Remaining phases
What's the goal? Goal statement in plan
What have I learned? findings.md
What have I done? progress.md

When to Use This Pattern

Use for:

  • Multi-step tasks (3+ steps)
  • Research tasks
  • Building/creating projects
  • Tasks spanning many tool calls
  • Anything requiring organization

Skip for:

  • Simple questions
  • Single-file edits
  • Quick lookups

Templates

Copy these templates to start:

Scripts

Helper scripts for automation:

  • scripts/init-session.sh — Initialize all planning files
  • scripts/check-complete.sh — Verify all phases complete

Advanced Topics

Anti-Patterns

Don't Do Instead
Use TodoWrite for persistence Create task_plan.md file
State goals once and forget Re-read plan before decisions
Hide errors and retry silently Log errors to plan file
Stuff everything in context Store large content in files
Start executing immediately Create plan file FIRST
Repeat failed actions Track attempts, mutate approach
Create files in skill directory Create files in your project
用于为多步骤任务编写详细的TDD实施计划。将任务拆分为2-5分钟的微小步骤,包含精确文件路径、代码和命令,确保零上下文工程师也能执行。
收到明确的需求规格说明 准备进行复杂的多步功能开发前
planning/writing-plans/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill writing-plans -g -y
SKILL.md
Frontmatter
{
    "name": "writing-plans",
    "description": "Use when you have a spec or requirements for a multi-step task, before touching code"
}

Writing Plans

Overview

Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.

Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.

Announce at start: "I'm using the writing-plans skill to create the implementation plan."

Context: This should be run in a dedicated worktree (created by brainstorming skill).

Save plans to: docs/plans/YYYY-MM-DD-<feature-name>.md

Bite-Sized Task Granularity

Each step is one action (2-5 minutes):

  • "Write the failing test" - step
  • "Run it to make sure it fails" - step
  • "Implement the minimal code to make the test pass" - step
  • "Run the tests and make sure they pass" - step
  • "Commit" - step

Plan Document Header

Every plan MUST start with this header:

# [Feature Name] Implementation Plan

> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.

**Goal:** [One sentence describing what this builds]

**Architecture:** [2-3 sentences about approach]

**Tech Stack:** [Key technologies/libraries]

---

Task Structure

### Task N: [Component Name]

**Files:**
- Create: `exact/path/to/file.py`
- Modify: `exact/path/to/existing.py:123-145`
- Test: `tests/exact/path/to/test.py`

**Step 1: Write the failing test**

```python
def test_specific_behavior():
    result = function(input)
    assert result == expected

Step 2: Run test to verify it fails

Run: pytest tests/path/test.py::test_name -v Expected: FAIL with "function not defined"

Step 3: Write minimal implementation

def function(input):
    return expected

Step 4: Run test to verify it passes

Run: pytest tests/path/test.py::test_name -v Expected: PASS

Step 5: Commit

git add tests/path/test.py src/path/file.py
git commit -m "feat: add specific feature"

## Remember
- Exact file paths always
- Complete code in plan (not "add validation")
- Exact commands with expected output
- Reference relevant skills with @ syntax
- DRY, YAGNI, TDD, frequent commits

## Execution Handoff

After saving the plan, offer execution choice:

**"Plan complete and saved to `docs/plans/<filename>.md`. Two execution options:**

**1. Subagent-Driven (this session)** - I dispatch fresh subagent per task, review between tasks, fast iteration

**2. Parallel Session (separate)** - Open new session with executing-plans, batch execution with checkpoints

**Which approach?"**

**If Subagent-Driven chosen:**
- **REQUIRED SUB-SKILL:** Use superpowers:subagent-driven-development
- Stay in this session
- Fresh subagent per task + code review

**If Parallel Session chosen:**
- Guide them to open new session in worktree
- **REQUIRED SUB-SKILL:** New session uses superpowers:executing-plans
用于接收代码审查反馈。强调技术严谨性,要求在实施前验证建议的合理性。禁止盲目执行或表演性同意,需先澄清模糊点、评估技术影响,必要时进行有理有据的反驳,确保实现正确性而非社交礼貌。
收到代码审查反馈 审查意见不明确或技术存疑 需要决定是否实施审查建议
quality/receiving-code-review/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill receiving-code-review -g -y
SKILL.md
Frontmatter
{
    "name": "receiving-code-review",
    "description": "Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation"
}

Code Review Reception

Overview

Code review requires technical evaluation, not emotional performance.

Core principle: Verify before implementing. Ask before assuming. Technical correctness over social comfort.

The Response Pattern

WHEN receiving code review feedback:

1. READ: Complete feedback without reacting
2. UNDERSTAND: Restate requirement in own words (or ask)
3. VERIFY: Check against codebase reality
4. EVALUATE: Technically sound for THIS codebase?
5. RESPOND: Technical acknowledgment or reasoned pushback
6. IMPLEMENT: One item at a time, test each

Forbidden Responses

NEVER:

  • "You're absolutely right!" (explicit CLAUDE.md violation)
  • "Great point!" / "Excellent feedback!" (performative)
  • "Let me implement that now" (before verification)

INSTEAD:

  • Restate the technical requirement
  • Ask clarifying questions
  • Push back with technical reasoning if wrong
  • Just start working (actions > words)

Handling Unclear Feedback

IF any item is unclear:
  STOP - do not implement anything yet
  ASK for clarification on unclear items

WHY: Items may be related. Partial understanding = wrong implementation.

Example:

your human partner: "Fix 1-6"
You understand 1,2,3,6. Unclear on 4,5.

❌ WRONG: Implement 1,2,3,6 now, ask about 4,5 later
✅ RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding."

Source-Specific Handling

From your human partner

  • Trusted - implement after understanding
  • Still ask if scope unclear
  • No performative agreement
  • Skip to action or technical acknowledgment

From External Reviewers

BEFORE implementing:
  1. Check: Technically correct for THIS codebase?
  2. Check: Breaks existing functionality?
  3. Check: Reason for current implementation?
  4. Check: Works on all platforms/versions?
  5. Check: Does reviewer understand full context?

IF suggestion seems wrong:
  Push back with technical reasoning

IF can't easily verify:
  Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?"

IF conflicts with your human partner's prior decisions:
  Stop and discuss with your human partner first

your human partner's rule: "External feedback - be skeptical, but check carefully"

YAGNI Check for "Professional" Features

IF reviewer suggests "implementing properly":
  grep codebase for actual usage

  IF unused: "This endpoint isn't called. Remove it (YAGNI)?"
  IF used: Then implement properly

your human partner's rule: "You and reviewer both report to me. If we don't need this feature, don't add it."

Implementation Order

FOR multi-item feedback:
  1. Clarify anything unclear FIRST
  2. Then implement in this order:
     - Blocking issues (breaks, security)
     - Simple fixes (typos, imports)
     - Complex fixes (refactoring, logic)
  3. Test each fix individually
  4. Verify no regressions

When To Push Back

Push back when:

  • Suggestion breaks existing functionality
  • Reviewer lacks full context
  • Violates YAGNI (unused feature)
  • Technically incorrect for this stack
  • Legacy/compatibility reasons exist
  • Conflicts with your human partner's architectural decisions

How to push back:

  • Use technical reasoning, not defensiveness
  • Ask specific questions
  • Reference working tests/code
  • Involve your human partner if architectural

Signal if uncomfortable pushing back out loud: "Strange things are afoot at the Circle K"

Acknowledging Correct Feedback

When feedback IS correct:

✅ "Fixed. [Brief description of what changed]"
✅ "Good catch - [specific issue]. Fixed in [location]."
✅ [Just fix it and show in the code]

❌ "You're absolutely right!"
❌ "Great point!"
❌ "Thanks for catching that!"
❌ "Thanks for [anything]"
❌ ANY gratitude expression

Why no thanks: Actions speak. Just fix it. The code itself shows you heard the feedback.

If you catch yourself about to write "Thanks": DELETE IT. State the fix instead.

Gracefully Correcting Your Pushback

If you pushed back and were wrong:

✅ "You were right - I checked [X] and it does [Y]. Implementing now."
✅ "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."

❌ Long apology
❌ Defending why you pushed back
❌ Over-explaining

State the correction factually and move on.

Common Mistakes

Mistake Fix
Performative agreement State requirement or just act
Blind implementation Verify against codebase first
Batch without testing One at a time, test each
Assuming reviewer is right Check if breaks things
Avoiding pushback Technical correctness > comfort
Partial implementation Clarify all items first
Can't verify, proceed anyway State limitation, ask for direction

Real Examples

Performative Agreement (Bad):

Reviewer: "Remove legacy code"
❌ "You're absolutely right! Let me remove that..."

Technical Verification (Good):

Reviewer: "Remove legacy code"
✅ "Checking... build target is 10.15+, this API needs 13+. Need legacy for backward compat. Current impl has wrong bundle ID - fix it or drop pre-13 support?"

YAGNI (Good):

Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
✅ "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"

Unclear Item (Good):

your human partner: "Fix items 1-6"
You understand 1,2,3,6. Unclear on 4,5.
✅ "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."

GitHub Thread Replies

When replying to inline review comments on GitHub, reply in the comment thread (gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies), not as a top-level PR comment.

The Bottom Line

External feedback = suggestions to evaluate, not orders to follow.

Verify. Question. Then implement.

No performative agreement. Technical rigor always.

在完成子任务、重大功能开发或合并前,通过调用代码审查代理来验证工作质量。遵循早期频繁审查原则,获取Git SHA后分发审查任务,并根据反馈修复关键问题,防止错误累积。
完成子任务驱动开发中的单个任务后 实现主要功能后 准备合并到主分支前 遇到技术瓶颈需要新视角时 重构前或修复复杂Bug后
quality/requesting-code-review/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill requesting-code-review -g -y
SKILL.md
Frontmatter
{
    "name": "requesting-code-review",
    "description": "Use when completing tasks, implementing major features, or before merging to verify work meets requirements"
}

Requesting Code Review

Dispatch superpowers:code-reviewer subagent to catch issues before they cascade.

Core principle: Review early, review often.

When to Request Review

Mandatory:

  • After each task in subagent-driven development
  • After completing major feature
  • Before merge to main

Optional but valuable:

  • When stuck (fresh perspective)
  • Before refactoring (baseline check)
  • After fixing complex bug

How to Request

1. Get git SHAs:

BASE_SHA=$(git rev-parse HEAD~1)  # or origin/main
HEAD_SHA=$(git rev-parse HEAD)

2. Dispatch code-reviewer subagent:

Use Task tool with superpowers:code-reviewer type, fill template at code-reviewer.md

Placeholders:

  • {WHAT_WAS_IMPLEMENTED} - What you just built
  • {PLAN_OR_REQUIREMENTS} - What it should do
  • {BASE_SHA} - Starting commit
  • {HEAD_SHA} - Ending commit
  • {DESCRIPTION} - Brief summary

3. Act on feedback:

  • Fix Critical issues immediately
  • Fix Important issues before proceeding
  • Note Minor issues for later
  • Push back if reviewer is wrong (with reasoning)

Example

[Just completed Task 2: Add verification function]

You: Let me request code review before proceeding.

BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
HEAD_SHA=$(git rev-parse HEAD)

[Dispatch superpowers:code-reviewer subagent]
  WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
  PLAN_OR_REQUIREMENTS: Task 2 from docs/plans/deployment-plan.md
  BASE_SHA: a7981ec
  HEAD_SHA: 3df7661
  DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types

[Subagent returns]:
  Strengths: Clean architecture, real tests
  Issues:
    Important: Missing progress indicators
    Minor: Magic number (100) for reporting interval
  Assessment: Ready to proceed

You: [Fix progress indicators]
[Continue to Task 3]

Integration with Workflows

Subagent-Driven Development:

  • Review after EACH task
  • Catch issues before they compound
  • Fix before moving to next task

Executing Plans:

  • Review after each batch (3 tasks)
  • Get feedback, apply, continue

Ad-Hoc Development:

  • Review before merge
  • Review when stuck

Red Flags

Never:

  • Skip review because "it's simple"
  • Ignore Critical issues
  • Proceed with unfixed Important issues
  • Argue with valid technical feedback

If reviewer wrong:

  • Push back with technical reasoning
  • Show code/tests that prove it works
  • Request clarification

See template at: requesting-code-review/code-reviewer.md

用于处理任何技术故障、测试失败或意外行为。强调必须先进行根因调查,严禁盲目修复。包含四个阶段:仔细解读错误、复现问题、检查变更及多组件诊断,确保在理解根本原因前不提出任何解决方案。
遇到代码Bug 测试用例失败 系统出现意外行为 构建或集成问题
quality/systematic-debugging/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill systematic-debugging -g -y
SKILL.md
Frontmatter
{
    "name": "systematic-debugging",
    "description": "Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes"
}

Systematic Debugging

Overview

Random fixes waste time and create new bugs. Quick patches mask underlying issues.

Core principle: ALWAYS find root cause before attempting fixes. Symptom fixes are failure.

Violating the letter of this process is violating the spirit of debugging.

The Iron Law

NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST

If you haven't completed Phase 1, you cannot propose fixes.

When to Use

Use for ANY technical issue:

  • Test failures
  • Bugs in production
  • Unexpected behavior
  • Performance problems
  • Build failures
  • Integration issues

Use this ESPECIALLY when:

  • Under time pressure (emergencies make guessing tempting)
  • "Just one quick fix" seems obvious
  • You've already tried multiple fixes
  • Previous fix didn't work
  • You don't fully understand the issue

Don't skip when:

  • Issue seems simple (simple bugs have root causes too)
  • You're in a hurry (rushing guarantees rework)
  • Manager wants it fixed NOW (systematic is faster than thrashing)

The Four Phases

You MUST complete each phase before proceeding to the next.

Phase 1: Root Cause Investigation

BEFORE attempting ANY fix:

  1. Read Error Messages Carefully

    • Don't skip past errors or warnings
    • They often contain the exact solution
    • Read stack traces completely
    • Note line numbers, file paths, error codes
  2. Reproduce Consistently

    • Can you trigger it reliably?
    • What are the exact steps?
    • Does it happen every time?
    • If not reproducible → gather more data, don't guess
  3. Check Recent Changes

    • What changed that could cause this?
    • Git diff, recent commits
    • New dependencies, config changes
    • Environmental differences
  4. Gather Evidence in Multi-Component Systems

    WHEN system has multiple components (CI → build → signing, API → service → database):

    BEFORE proposing fixes, add diagnostic instrumentation:

    For EACH component boundary:
      - Log what data enters component
      - Log what data exits component
      - Verify environment/config propagation
      - Check state at each layer
    
    Run once to gather evidence showing WHERE it breaks
    THEN analyze evidence to identify failing component
    THEN investigate that specific component
    

    Example (multi-layer system):

    # Layer 1: Workflow
    echo "=== Secrets available in workflow: ==="
    echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
    
    # Layer 2: Build script
    echo "=== Env vars in build script: ==="
    env | grep IDENTITY || echo "IDENTITY not in environment"
    
    # Layer 3: Signing script
    echo "=== Keychain state: ==="
    security list-keychains
    security find-identity -v
    
    # Layer 4: Actual signing
    codesign --sign "$IDENTITY" --verbose=4 "$APP"
    

    This reveals: Which layer fails (secrets → workflow ✓, workflow → build ✗)

  5. Trace Data Flow

    WHEN error is deep in call stack:

    See root-cause-tracing.md in this directory for the complete backward tracing technique.

    Quick version:

    • Where does bad value originate?
    • What called this with bad value?
    • Keep tracing up until you find the source
    • Fix at source, not at symptom

Phase 2: Pattern Analysis

Find the pattern before fixing:

  1. Find Working Examples

    • Locate similar working code in same codebase
    • What works that's similar to what's broken?
  2. Compare Against References

    • If implementing pattern, read reference implementation COMPLETELY
    • Don't skim - read every line
    • Understand the pattern fully before applying
  3. Identify Differences

    • What's different between working and broken?
    • List every difference, however small
    • Don't assume "that can't matter"
  4. Understand Dependencies

    • What other components does this need?
    • What settings, config, environment?
    • What assumptions does it make?

Phase 3: Hypothesis and Testing

Scientific method:

  1. Form Single Hypothesis

    • State clearly: "I think X is the root cause because Y"
    • Write it down
    • Be specific, not vague
  2. Test Minimally

    • Make the SMALLEST possible change to test hypothesis
    • One variable at a time
    • Don't fix multiple things at once
  3. Verify Before Continuing

    • Did it work? Yes → Phase 4
    • Didn't work? Form NEW hypothesis
    • DON'T add more fixes on top
  4. When You Don't Know

    • Say "I don't understand X"
    • Don't pretend to know
    • Ask for help
    • Research more

Phase 4: Implementation

Fix the root cause, not the symptom:

  1. Create Failing Test Case

    • Simplest possible reproduction
    • Automated test if possible
    • One-off test script if no framework
    • MUST have before fixing
    • Use the superpowers:test-driven-development skill for writing proper failing tests
  2. Implement Single Fix

    • Address the root cause identified
    • ONE change at a time
    • No "while I'm here" improvements
    • No bundled refactoring
  3. Verify Fix

    • Test passes now?
    • No other tests broken?
    • Issue actually resolved?
  4. If Fix Doesn't Work

    • STOP
    • Count: How many fixes have you tried?
    • If < 3: Return to Phase 1, re-analyze with new information
    • If ≥ 3: STOP and question the architecture (step 5 below)
    • DON'T attempt Fix #4 without architectural discussion
  5. If 3+ Fixes Failed: Question Architecture

    Pattern indicating architectural problem:

    • Each fix reveals new shared state/coupling/problem in different place
    • Fixes require "massive refactoring" to implement
    • Each fix creates new symptoms elsewhere

    STOP and question fundamentals:

    • Is this pattern fundamentally sound?
    • Are we "sticking with it through sheer inertia"?
    • Should we refactor architecture vs. continue fixing symptoms?

    Discuss with your human partner before attempting more fixes

    This is NOT a failed hypothesis - this is a wrong architecture.

Red Flags - STOP and Follow Process

If you catch yourself thinking:

  • "Quick fix for now, investigate later"
  • "Just try changing X and see if it works"
  • "Add multiple changes, run tests"
  • "Skip the test, I'll manually verify"
  • "It's probably X, let me fix that"
  • "I don't fully understand but this might work"
  • "Pattern says X but I'll adapt it differently"
  • "Here are the main problems: [lists fixes without investigation]"
  • Proposing solutions before tracing data flow
  • "One more fix attempt" (when already tried 2+)
  • Each fix reveals new problem in different place

ALL of these mean: STOP. Return to Phase 1.

If 3+ fixes failed: Question the architecture (see Phase 4.5)

your human partner's Signals You're Doing It Wrong

Watch for these redirections:

  • "Is that not happening?" - You assumed without verifying
  • "Will it show us...?" - You should have added evidence gathering
  • "Stop guessing" - You're proposing fixes without understanding
  • "Ultrathink this" - Question fundamentals, not just symptoms
  • "We're stuck?" (frustrated) - Your approach isn't working

When you see these: STOP. Return to Phase 1.

Common Rationalizations

Excuse Reality
"Issue is simple, don't need process" Simple issues have root causes too. Process is fast for simple bugs.
"Emergency, no time for process" Systematic debugging is FASTER than guess-and-check thrashing.
"Just try this first, then investigate" First fix sets the pattern. Do it right from the start.
"I'll write test after confirming fix works" Untested fixes don't stick. Test first proves it.
"Multiple fixes at once saves time" Can't isolate what worked. Causes new bugs.
"Reference too long, I'll adapt the pattern" Partial understanding guarantees bugs. Read it completely.
"I see the problem, let me fix it" Seeing symptoms ≠ understanding root cause.
"One more fix attempt" (after 2+ failures) 3+ failures = architectural problem. Question pattern, don't fix again.

Quick Reference

Phase Key Activities Success Criteria
1. Root Cause Read errors, reproduce, check changes, gather evidence Understand WHAT and WHY
2. Pattern Find working examples, compare Identify differences
3. Hypothesis Form theory, test minimally Confirmed or new hypothesis
4. Implementation Create test, fix, verify Bug resolved, tests pass

When Process Reveals "No Root Cause"

If systematic investigation reveals issue is truly environmental, timing-dependent, or external:

  1. You've completed the process
  2. Document what you investigated
  3. Implement appropriate handling (retry, timeout, error message)
  4. Add monitoring/logging for future investigation

But: 95% of "no root cause" cases are incomplete investigation.

Supporting Techniques

These techniques are part of systematic debugging and available in this directory:

  • root-cause-tracing.md - Trace bugs backward through call stack to find original trigger
  • defense-in-depth.md - Add validation at multiple layers after finding root cause
  • condition-based-waiting.md - Replace arbitrary timeouts with condition polling

Related skills:

  • superpowers:test-driven-development - For creating failing test case (Phase 4, Step 1)
  • superpowers:verification-before-completion - Verify fix worked before claiming success

Real-World Impact

From debugging sessions:

  • Systematic approach: 15-30 minutes to fix
  • Random fixes approach: 2-3 hours of thrashing
  • First-time fix rate: 95% vs 40%
  • New bugs introduced: Near zero vs common
指导遵循TDD原则:先写失败测试,再写最小代码通过,最后重构。强制禁止无测试先写生产代码,适用于新功能、修复及重构,排除原型和配置场景。
实现新功能 修复Bug 代码重构
quality/test-driven-development/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill test-driven-development -g -y
SKILL.md
Frontmatter
{
    "name": "test-driven-development",
    "description": "Use when implementing any feature or bugfix, before writing implementation code"
}

Test-Driven Development (TDD)

Overview

Write the test first. Watch it fail. Write minimal code to pass.

Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.

Violating the letter of the rules is violating the spirit of the rules.

When to Use

Always:

  • New features
  • Bug fixes
  • Refactoring
  • Behavior changes

Exceptions (ask your human partner):

  • Throwaway prototypes
  • Generated code
  • Configuration files

Thinking "skip TDD just this once"? Stop. That's rationalization.

The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Write code before the test? Delete it. Start over.

No exceptions:

  • Don't keep it as "reference"
  • Don't "adapt" it while writing tests
  • Don't look at it
  • Delete means delete

Implement fresh from tests. Period.

Red-Green-Refactor

digraph tdd_cycle {
    rankdir=LR;
    red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"];
    verify_red [label="Verify fails\ncorrectly", shape=diamond];
    green [label="GREEN\nMinimal code", shape=box, style=filled, fillcolor="#ccffcc"];
    verify_green [label="Verify passes\nAll green", shape=diamond];
    refactor [label="REFACTOR\nClean up", shape=box, style=filled, fillcolor="#ccccff"];
    next [label="Next", shape=ellipse];

    red -> verify_red;
    verify_red -> green [label="yes"];
    verify_red -> red [label="wrong\nfailure"];
    green -> verify_green;
    verify_green -> refactor [label="yes"];
    verify_green -> green [label="no"];
    refactor -> verify_green [label="stay\ngreen"];
    verify_green -> next;
    next -> red;
}

RED - Write Failing Test

Write one minimal test showing what should happen.

```typescript test('retries failed operations 3 times', async () => { let attempts = 0; const operation = () => { attempts++; if (attempts < 3) throw new Error('fail'); return 'success'; };

const result = await retryOperation(operation);

expect(result).toBe('success'); expect(attempts).toBe(3); });

Clear name, tests real behavior, one thing
</Good>

<Bad>
```typescript
test('retry works', async () => {
  const mock = jest.fn()
    .mockRejectedValueOnce(new Error())
    .mockRejectedValueOnce(new Error())
    .mockResolvedValueOnce('success');
  await retryOperation(mock);
  expect(mock).toHaveBeenCalledTimes(3);
});

Vague name, tests mock not code </Bad>

Requirements:

  • One behavior
  • Clear name
  • Real code (no mocks unless unavoidable)

Verify RED - Watch It Fail

MANDATORY. Never skip.

npm test path/to/test.test.ts

Confirm:

  • Test fails (not errors)
  • Failure message is expected
  • Fails because feature missing (not typos)

Test passes? You're testing existing behavior. Fix test.

Test errors? Fix error, re-run until it fails correctly.

GREEN - Minimal Code

Write simplest code to pass the test.

```typescript async function retryOperation(fn: () => Promise): Promise { for (let i = 0; i < 3; i++) { try { return await fn(); } catch (e) { if (i === 2) throw e; } } throw new Error('unreachable'); } ``` Just enough to pass ```typescript async function retryOperation( fn: () => Promise, options?: { maxRetries?: number; backoff?: 'linear' | 'exponential'; onRetry?: (attempt: number) => void; } ): Promise { // YAGNI } ``` Over-engineered

Don't add features, refactor other code, or "improve" beyond the test.

Verify GREEN - Watch It Pass

MANDATORY.

npm test path/to/test.test.ts

Confirm:

  • Test passes
  • Other tests still pass
  • Output pristine (no errors, warnings)

Test fails? Fix code, not test.

Other tests fail? Fix now.

REFACTOR - Clean Up

After green only:

  • Remove duplication
  • Improve names
  • Extract helpers

Keep tests green. Don't add behavior.

Repeat

Next failing test for next feature.

Good Tests

Quality Good Bad
Minimal One thing. "and" in name? Split it. test('validates email and domain and whitespace')
Clear Name describes behavior test('test1')
Shows intent Demonstrates desired API Obscures what code should do

Why Order Matters

"I'll write tests after to verify it works"

Tests written after code pass immediately. Passing immediately proves nothing:

  • Might test wrong thing
  • Might test implementation, not behavior
  • Might miss edge cases you forgot
  • You never saw it catch the bug

Test-first forces you to see the test fail, proving it actually tests something.

"I already manually tested all the edge cases"

Manual testing is ad-hoc. You think you tested everything but:

  • No record of what you tested
  • Can't re-run when code changes
  • Easy to forget cases under pressure
  • "It worked when I tried it" ≠ comprehensive

Automated tests are systematic. They run the same way every time.

"Deleting X hours of work is wasteful"

Sunk cost fallacy. The time is already gone. Your choice now:

  • Delete and rewrite with TDD (X more hours, high confidence)
  • Keep it and add tests after (30 min, low confidence, likely bugs)

The "waste" is keeping code you can't trust. Working code without real tests is technical debt.

"TDD is dogmatic, being pragmatic means adapting"

TDD IS pragmatic:

  • Finds bugs before commit (faster than debugging after)
  • Prevents regressions (tests catch breaks immediately)
  • Documents behavior (tests show how to use code)
  • Enables refactoring (change freely, tests catch breaks)

"Pragmatic" shortcuts = debugging in production = slower.

"Tests after achieve the same goals - it's spirit not ritual"

No. Tests-after answer "What does this do?" Tests-first answer "What should this do?"

Tests-after are biased by your implementation. You test what you built, not what's required. You verify remembered edge cases, not discovered ones.

Tests-first force edge case discovery before implementing. Tests-after verify you remembered everything (you didn't).

30 minutes of tests after ≠ TDD. You get coverage, lose proof tests work.

Common Rationalizations

Excuse Reality
"Too simple to test" Simple code breaks. Test takes 30 seconds.
"I'll test after" Tests passing immediately prove nothing.
"Tests after achieve same goals" Tests-after = "what does this do?" Tests-first = "what should this do?"
"Already manually tested" Ad-hoc ≠ systematic. No record, can't re-run.
"Deleting X hours is wasteful" Sunk cost fallacy. Keeping unverified code is technical debt.
"Keep as reference, write tests first" You'll adapt it. That's testing after. Delete means delete.
"Need to explore first" Fine. Throw away exploration, start with TDD.
"Test hard = design unclear" Listen to test. Hard to test = hard to use.
"TDD will slow me down" TDD faster than debugging. Pragmatic = test-first.
"Manual test faster" Manual doesn't prove edge cases. You'll re-test every change.
"Existing code has no tests" You're improving it. Add tests for existing code.

Red Flags - STOP and Start Over

  • Code before test
  • Test after implementation
  • Test passes immediately
  • Can't explain why test failed
  • Tests added "later"
  • Rationalizing "just this once"
  • "I already manually tested it"
  • "Tests after achieve the same purpose"
  • "It's about spirit not ritual"
  • "Keep as reference" or "adapt existing code"
  • "Already spent X hours, deleting is wasteful"
  • "TDD is dogmatic, I'm being pragmatic"
  • "This is different because..."

All of these mean: Delete code. Start over with TDD.

Example: Bug Fix

Bug: Empty email accepted

RED

test('rejects empty email', async () => {
  const result = await submitForm({ email: '' });
  expect(result.error).toBe('Email required');
});

Verify RED

$ npm test
FAIL: expected 'Email required', got undefined

GREEN

function submitForm(data: FormData) {
  if (!data.email?.trim()) {
    return { error: 'Email required' };
  }
  // ...
}

Verify GREEN

$ npm test
PASS

REFACTOR Extract validation for multiple fields if needed.

Verification Checklist

Before marking work complete:

  • Every new function/method has a test
  • Watched each test fail before implementing
  • Each test failed for expected reason (feature missing, not typo)
  • Wrote minimal code to pass each test
  • All tests pass
  • Output pristine (no errors, warnings)
  • Tests use real code (mocks only if unavoidable)
  • Edge cases and errors covered

Can't check all boxes? You skipped TDD. Start over.

When Stuck

Problem Solution
Don't know how to test Write wished-for API. Write assertion first. Ask your human partner.
Test too complicated Design too complicated. Simplify interface.
Must mock everything Code too coupled. Use dependency injection.
Test setup huge Extract helpers. Still complex? Simplify design.

Debugging Integration

Bug found? Write failing test reproducing it. Follow TDD cycle. Test proves fix and prevents regression.

Never fix bugs without a test.

Testing Anti-Patterns

When adding mocks or test utilities, read @testing-anti-patterns.md to avoid common pitfalls:

  • Testing mock behavior instead of real behavior
  • Adding test-only methods to production classes
  • Mocking without understanding dependencies

Final Rule

Production code → test exists and failed first
Otherwise → not TDD

No exceptions without your human partner's permission.

强制在宣称工作完成、修复或测试通过前,必须运行验证命令并获取实时证据。禁止无依据断言,要求先执行后确认,确保所有声明均有实际输出支撑,杜绝虚假完工报告。
准备提交代码或创建PR 宣称任务已完成或已修复 声称测试或构建成功
quality/verification-before-completion/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill verification-before-completion -g -y
SKILL.md
Frontmatter
{
    "name": "verification-before-completion",
    "description": "Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always"
}

Verification Before Completion

Overview

Claiming work is complete without verification is dishonesty, not efficiency.

Core principle: Evidence before claims, always.

Violating the letter of this rule is violating the spirit of this rule.

The Iron Law

NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE

If you haven't run the verification command in this message, you cannot claim it passes.

The Gate Function

BEFORE claiming any status or expressing satisfaction:

1. IDENTIFY: What command proves this claim?
2. RUN: Execute the FULL command (fresh, complete)
3. READ: Full output, check exit code, count failures
4. VERIFY: Does output confirm the claim?
   - If NO: State actual status with evidence
   - If YES: State claim WITH evidence
5. ONLY THEN: Make the claim

Skip any step = lying, not verifying

Common Failures

Claim Requires Not Sufficient
Tests pass Test command output: 0 failures Previous run, "should pass"
Linter clean Linter output: 0 errors Partial check, extrapolation
Build succeeds Build command: exit 0 Linter passing, logs look good
Bug fixed Test original symptom: passes Code changed, assumed fixed
Regression test works Red-green cycle verified Test passes once
Agent completed VCS diff shows changes Agent reports "success"
Requirements met Line-by-line checklist Tests passing

Red Flags - STOP

  • Using "should", "probably", "seems to"
  • Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
  • About to commit/push/PR without verification
  • Trusting agent success reports
  • Relying on partial verification
  • Thinking "just this once"
  • Tired and wanting work over
  • ANY wording implying success without having run verification

Rationalization Prevention

Excuse Reality
"Should work now" RUN the verification
"I'm confident" Confidence ≠ evidence
"Just this once" No exceptions
"Linter passed" Linter ≠ compiler
"Agent said success" Verify independently
"I'm tired" Exhaustion ≠ excuse
"Partial check is enough" Partial proves nothing
"Different words so rule doesn't apply" Spirit over letter

Key Patterns

Tests:

✅ [Run test command] [See: 34/34 pass] "All tests pass"
❌ "Should pass now" / "Looks correct"

Regression tests (TDD Red-Green):

✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass)
❌ "I've written a regression test" (without red-green verification)

Build:

✅ [Run build] [See: exit 0] "Build passes"
❌ "Linter passed" (linter doesn't check compilation)

Requirements:

✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
❌ "Tests pass, phase complete"

Agent delegation:

✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
❌ Trust agent report

Why This Matters

From 24 failure memories:

  • your human partner said "I don't believe you" - trust broken
  • Undefined functions shipped - would crash
  • Missing requirements shipped - incomplete features
  • Time wasted on false completion → redirect → rework
  • Violates: "Honesty is a core value. If you lie, you'll be replaced."

When To Apply

ALWAYS before:

  • ANY variation of success/completion claims
  • ANY expression of satisfaction
  • ANY positive statement about work state
  • Committing, PR creation, task completion
  • Moving to next task
  • Delegating to agents

Rule applies to:

  • Exact phrases
  • Paraphrases and synonyms
  • Implications of success
  • ANY communication suggesting completion/correctness

The Bottom Line

No shortcuts for verification.

Run the command. Read the output. THEN claim the result.

This is non-negotiable.

基于Google官方文档的SEO指南,涵盖搜索优化、结构化数据(如VideoObject)、技术SEO及Search Console使用,协助提升网站在Google中的可见性和排名。
用户询问如何优化网站在Google搜索结果中的排名 需要配置结构化数据或解决爬虫索引问题 咨询Search Console报告解读或移动优先索引策略
seo/google-official-seo-guide/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill google-official-seo-guide -g -y
SKILL.md
Frontmatter
{
    "name": "google-official-seo-guide",
    "description": "Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation"
}

Google Official SEO Guide

Comprehensive assistance with Google Search optimization, SEO best practices, and search visibility improvements based on official Google documentation.

When to Use This Skill

This skill should be triggered when users ask about:

SEO & Search Optimization

  • Improving website ranking in Google Search
  • Implementing SEO best practices
  • Optimizing meta tags, titles, and descriptions
  • Fixing crawling or indexing issues
  • Understanding how Google Search works

Structured Data & Rich Results

  • Adding VideoObject, BroadcastEvent, or Clip structured data
  • Implementing schema.org markup for rich results
  • Creating sitemaps and robots.txt files
  • Setting up breadcrumb navigation
  • Configuring hreflang for multi-language sites

Technical SEO

  • Mobile-first indexing optimization
  • JavaScript SEO and rendering issues
  • Managing duplicate content with canonical tags
  • Configuring robots meta tags
  • URL structure and internal linking

Search Console & Monitoring

  • Using Google Search Console reports
  • Debugging search visibility issues
  • Monitoring crawl errors and indexing status
  • Analyzing search performance metrics

Content & Links

  • Writing effective anchor text
  • Internal and external linking strategies
  • Avoiding spam policies violations
  • Managing site migrations and redirects

Key Concepts

The Three Stages of Google Search

  1. Crawling: Googlebot discovers and fetches pages from the web
  2. Indexing: Google analyzes page content and stores it in the index
  3. Serving: Google returns relevant results for user queries

Important SEO Principles

  • Mobile-First Indexing: Google primarily uses the mobile version of content for indexing and ranking
  • Canonical URLs: Specify the preferred version of duplicate or similar pages
  • Structured Data: Use schema.org markup to help Google understand your content
  • Search Essentials: Technical, content, and spam requirements for Google Search eligibility

Common Structured Data Types

  • VideoObject: For video content and features
  • BroadcastEvent: For livestream videos (LIVE badge)
  • Clip: For video key moments/timestamps
  • SeekToAction: For auto-detected key moments in videos

Quick Reference

Example 1: Basic VideoObject Structured Data

{
  "@context": "https://schema.org",
  "@type": "VideoObject",
  "name": "Video title",
  "description": "Video description",
  "thumbnailUrl": [
    "https://example.com/photos/1x1/photo.jpg",
    "https://example.com/photos/4x3/photo.jpg",
    "https://example.com/photos/16x9/photo.jpg"
  ],
  "uploadDate": "2024-03-31T08:00:00+08:00",
  "duration": "PT1M54S",
  "contentUrl": "https://example.com/video.mp4",
  "embedUrl": "https://example.com/embed/123"
}

Use this for: Adding basic video metadata to help Google understand and display your videos in search results.


Example 2: LIVE Badge with BroadcastEvent

{
  "@context": "https://schema.org",
  "@type": "VideoObject",
  "name": "Livestream title",
  "uploadDate": "2024-10-27T14:00:00+00:00",
  "publication": {
    "@type": "BroadcastEvent",
    "isLiveBroadcast": true,
    "startDate": "2024-10-27T14:00:00+00:00",
    "endDate": "2024-10-27T14:37:14+00:00"
  }
}

Use this for: Enabling the LIVE badge on livestream videos in Google Search results.


Example 3: Video Key Moments with Clip

{
  "@context": "https://schema.org",
  "@type": "VideoObject",
  "name": "Cat video",
  "hasPart": [
    {
      "@type": "Clip",
      "name": "Cat jumps",
      "startOffset": 30,
      "endOffset": 45,
      "url": "https://example.com/video?t=30"
    },
    {
      "@type": "Clip",
      "name": "Cat misses the fence",
      "startOffset": 111,
      "endOffset": 150,
      "url": "https://example.com/video?t=111"
    }
  ]
}

Use this for: Manually specifying important timestamps/chapters in your video for the key moments feature.


Example 4: Good Anchor Text Practices

<!-- Bad: Too generic -->
<a href="https://example.com">Click here</a> to learn more.

<!-- Better: Descriptive and contextual -->
For a full list of cheese available for purchase, see the
<a href="https://example.com">list of cheese types</a>.

<!-- Bad: Too many adjacent links -->
I've written about cheese
<a href="/page1">so</a>
<a href="/page2">many</a>
<a href="/page3">times</a>.

<!-- Better: Spaced out with context -->
I've written about cheese so many times this year:
the <a href="/blue-cheese">controversy over blue cheese</a>,
the <a href="/oldest-brie">world's oldest brie</a>, and
<a href="/boy-and-cheese">A Boy and His Cheese</a>.

Use this for: Creating effective internal and external links that help both users and Google understand your content.


Example 5: Crawlable Links

<!-- Recommended: Google can crawl these -->
<a href="https://example.com">Link text</a>
<a href="/products/category/shoes">Link text</a>
<a href="./products/category/shoes">Link text</a>

<!-- Not recommended: May not be crawled -->
<a routerLink="products/category">Link text</a>
<a onclick="goto('https://example.com')">Link text</a>
<span href="https://example.com">Link text</span>

Use this for: Ensuring your links are discoverable and crawlable by Googlebot.


Example 6: Mobile and Desktop hreflang for Separate URLs

<!-- Mobile version (https://m.example.com/) -->
<link rel="canonical" href="https://example.com/">
<link rel="alternate" hreflang="es" href="https://m.example.com/es/">
<link rel="alternate" hreflang="fr" href="https://m.example.com/fr/">

<!-- Desktop version (https://example.com/) -->
<link rel="canonical" href="https://example.com/">
<link rel="alternate" media="only screen and (max-width: 640px)"
      href="https://m.example.com/">
<link rel="alternate" hreflang="es" href="https://example.com/es/">
<link rel="alternate" hreflang="fr" href="https://example.com/fr/">

Use this for: Properly configuring separate mobile URLs (m-dot sites) with internationalization support.


Example 7: robots meta tags

<!-- Don't index this page -->
<meta name="robots" content="noindex">

<!-- Don't follow links on this page -->
<meta name="robots" content="nofollow">

<!-- Don't index and don't follow -->
<meta name="robots" content="noindex, nofollow">

<!-- Don't show snippet in search results -->
<meta name="robots" content="nosnippet">

Use this for: Controlling how Google crawls and indexes specific pages.


Example 8: InteractionStatistic for Video Views

{
  "@context": "https://schema.org",
  "@type": "VideoObject",
  "name": "Video title",
  "interactionStatistic": {
    "@type": "InteractionCounter",
    "interactionType": { "@type": "WatchAction" },
    "userInteractionCount": 12345
  }
}

Use this for: Displaying the number of views/watches for your video content.


Example 9: External Links with Attribution

<!-- Citing sources with proper attribution -->
<p>
According to a recent study from Swiss researchers,
Emmental cheese wheels exposed to music had a milder flavor,
with the full findings available in
<a href="https://example.com/cheese-study">
  Cheese in Surround Sound—a culinary art experiment
</a>.
</p>

<!-- Use nofollow when you don't trust the source -->
<a href="https://untrusted-site.com" rel="nofollow">
  Untrusted content
</a>

<!-- Sponsored links must be marked -->
<a href="https://partner-site.com" rel="sponsored">
  Partner content
</a>

Use this for: Properly linking to external sources while maintaining SEO best practices.


Example 10: Mobile-First Indexing Checklist

<!-- Ensure same robots meta tags on mobile and desktop -->
<meta name="robots" content="index, follow">

<!-- Use same structured data on both versions -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Example Corp"
}
</script>

<!-- Ensure images have proper alt text on mobile -->
<img src="product.jpg" alt="Blue ceramic vase, 12 inches tall">

<!-- Use same title and meta description -->
<title>Product Name - Category | Site Name</title>
<meta name="description" content="High-quality product description">

Use this for: Ensuring your mobile site is properly optimized for Google's mobile-first indexing.

Reference Files

This skill includes comprehensive documentation organized into the following categories:

apis.md (1 page)

Content: Getting started with Google Search Console, monitoring tools, and APIs.

Key Topics:

  • Setting up Search Console
  • Reports for SEO specialists and marketers
  • Reports for web developers
  • Managing site performance

When to use: Setting up monitoring, accessing Search Console features, understanding available reports.


appearance.md (58 pages)

Content: Visual elements and rich results in Google Search.

Key Topics:

  • Visual Elements Gallery (text results, rich results, images, videos)
  • Attribution elements (favicon, site name, breadcrumbs)
  • Structured data features
  • Search result optimization
  • Title links and snippets

When to use: Optimizing how your content appears in search results, implementing rich results, understanding search UI elements.


crawling.md

Content: How Google discovers, crawls, and accesses web content.

Key Topics:

  • Googlebot behavior and user agents
  • Crawl budget and optimization
  • robots.txt configuration
  • Managing crawl rate
  • Handling special file types

When to use: Debugging crawling issues, optimizing crawl efficiency, controlling what Google crawls.


fundamentals.md

Content: Core concepts and essential SEO knowledge.

Key Topics:

  • How Google Search works (crawling, indexing, serving)
  • SEO starter guide
  • Search Essentials
  • Creating helpful content
  • Site organization and URL structure

When to use: Learning SEO basics, understanding Google Search fundamentals, starting a new project.


guides.md

Content: Detailed how-to guides for specific SEO tasks.

Key Topics:

  • Link best practices
  • Mobile-first indexing
  • Internationalization
  • Site migrations
  • Duplicate content management
  • JavaScript SEO

When to use: Implementing specific SEO features, solving technical SEO challenges, following best practices.


indexing.md

Content: How Google indexes content and troubleshooting indexing issues.

Key Topics:

  • Canonical URLs
  • Meta tags (robots, noindex, etc.)
  • Sitemaps
  • Status codes and redirects
  • Removing content from Google

When to use: Fixing indexing problems, managing duplicate content, controlling what gets indexed.


other.md

Content: Additional topics and specialized information.

Key Topics:

  • Google Search policies
  • Spam prevention
  • Algorithm updates
  • Advanced features

When to use: Understanding policies, avoiding penalties, staying current with Google changes.


specialty.md

Content: Structured data and specialized search features.

Key Topics:

  • VideoObject structured data
  • BroadcastEvent (LIVE badge)
  • Clip and SeekToAction (key moments)
  • Other schema.org types
  • Rich result guidelines
  • Troubleshooting structured data

When to use: Implementing video features, adding structured data, enabling rich results, debugging markup errors.

Working with This Skill

For Beginners

Start with fundamentals.md to understand:

  • How Google Search works (crawling → indexing → serving)
  • Basic SEO principles
  • Search Essentials requirements

Then review guides.md for practical implementation:

  • Creating good anchor text
  • Mobile optimization
  • Basic structured data

Pro tip: Use the Quick Reference examples above as templates for common tasks.


For SEO Specialists & Marketers

Focus on these areas:

  1. appearance.md: Optimize how your content displays in search results
  2. guides.md: Implement link strategies, mobile optimization, internationalization
  3. indexing.md: Manage canonical URLs, sitemaps, and content removal
  4. apis.md: Monitor performance with Search Console

Common workflows:

  • Site audit: Check crawling.md + indexing.md
  • Rich results: Use specialty.md for structured data
  • International expansion: Follow guides.md hreflang patterns
  • Link building: Apply guides.md anchor text best practices

For Web Developers

Priority reading:

  1. fundamentals.md: Understand the technical foundation
  2. crawling.md: Optimize Googlebot access and crawl efficiency
  3. indexing.md: Implement proper meta tags and redirects
  4. specialty.md: Add structured data for rich features

Common tasks:

  • JavaScript apps: See guides.md JavaScript SEO section
  • Video content: Use specialty.md VideoObject examples
  • Site migration: Follow guides.md migration patterns
  • Debugging: Use indexing.md for troubleshooting

For Advanced Users

Explore specialized topics:

  • Structured data mastery: Deep dive into specialty.md
  • Crawl optimization: Advanced techniques in crawling.md
  • Policy compliance: Review other.md spam policies
  • International SEO: Complex hreflang setups in guides.md

Advanced patterns:

  • Multi-region sites with separate mobile URLs
  • Dynamic structured data with JavaScript
  • Large-scale site migrations
  • Custom crawl budget management

Common Pitfalls to Avoid

Spam Policy Violations

  • ❌ Keyword stuffing in content or meta tags
  • ❌ Hidden text or links
  • ❌ Buying/selling links for ranking
  • ❌ Cloaking (showing different content to Google vs users)
  • ✅ See other.md for complete spam policies

Mobile-First Indexing Issues

  • ❌ Different content on mobile vs desktop
  • ❌ Blocking resources on mobile
  • ❌ Missing structured data on mobile
  • ✅ See guides.md mobile-first section

Structured Data Mistakes

  • ❌ Using unsupported formats or properties
  • ❌ Missing required fields
  • ❌ Different URLs in mobile vs desktop markup
  • ✅ Validate with Rich Results Test tool

Link Problems

  • ❌ Generic anchor text ("click here")
  • ❌ Non-crawlable JavaScript links
  • ❌ Too many links chained together
  • ✅ See guides.md link best practices

Tips & Best Practices

SEO Fundamentals

  1. Create unique, descriptive titles and meta descriptions for each page
  2. Use meaningful heading structure (H1, H2, H3)
  3. Optimize images with descriptive alt text
  4. Ensure fast page load times (especially on mobile)
  5. Build a logical site structure with clear navigation

Technical SEO

  1. Submit and maintain an XML sitemap
  2. Use robots.txt appropriately (crawl control, not indexing control)
  3. Implement canonical tags for duplicate content
  4. Use HTTPS for security
  5. Ensure mobile-friendliness (responsive design recommended)

Content Strategy

  1. Focus on creating helpful, people-first content
  2. Match user intent with your content
  3. Keep content fresh and up-to-date
  4. Use natural language, avoid keyword stuffing
  5. Build internal links with descriptive anchor text

Monitoring & Maintenance

  1. Set up Search Console and verify ownership
  2. Monitor crawl errors and indexing issues regularly
  3. Track search performance metrics
  4. Test structured data with validation tools
  5. Stay informed about Google Search updates

Resources

Official Tools

  • Google Search Console: Monitor and optimize search presence
  • Rich Results Test: Validate structured data markup
  • Mobile-Friendly Test: Check mobile optimization
  • Page Speed Insights: Analyze performance

Documentation Links

  • Most documentation preserves links to official Google resources
  • Use reference files for detailed explanations and examples
  • Code examples include proper syntax highlighting

Notes

  • This skill was automatically generated from official Google Search documentation
  • Reference files preserve structure and examples from source docs
  • Quick reference patterns are extracted from real-world usage examples
  • All examples follow Google's official guidelines and best practices

Updating

To refresh this skill with updated documentation:

  1. Re-run the documentation scraper with the same configuration
  2. The skill will be rebuilt with the latest official information
  3. Check for new features, deprecated patterns, or policy changes
修复因对比度问题导致的 Lighthouse/PSI 无障碍“!”错误,解决 CSS 滤镜、OKLCH 颜色及低透明度引发的 SEO 性能调试与修复。
PSI/Lighthouse 显示“!”或数值异常 color-contrast 审计失败 getImageData 报错
seo/web-performance-seo/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill web-performance-seo -g -y
SKILL.md
Frontmatter
{
    "name": "web-performance-seo",
    "description": "Fix PageSpeed Insights\/Lighthouse accessibility \"!\" errors caused by contrast audit failures (CSS filters, OKLCH\/OKLAB, low opacity, gradient text, image backgrounds). Use for accessibility-driven SEO\/performance debugging and remediation."
}

Web Performance SEO: Accessibility Contrast Error Fix

When to use

  • PSI/Lighthouse accessibility shows "!" or error instead of a numeric score
  • color-contrast audit errors or getImageData failures
  • Need to improve accessibility signals that impact SEO

Workflow

  1. Reproduce
    • Run Lighthouse or PSI; capture failing audit names.
  2. Scan code for common triggers
    • CSS filters/backdrop blur, mix-blend-mode
    • OKLCH/OKLAB colors
    • Low opacity backgrounds (< 0.4)
    • Gradient text with color: transparent
    • Text over images without opaque overlays
  3. Fix in priority order
    • Remove filters/blend modes
    • Convert OKLCH/OKLAB to HSL/RGB
    • Raise opacity thresholds
    • Add solid-color fallback for gradient text
    • Add overlay behind text on images
  4. Verify locally with Lighthouse/axe
  5. Verify in PSI after deployment

Fast scan commands

rg -n "backdrop-blur|filter:|mix-blend-mode" .
rg -n "oklch|oklab" .
rg -n "/10|/20|/30|opacity-25|opacity-0" .
rg -n "background-clip.*text|color.*transparent" .

Fix patterns

Remove filters (critical)

// Before
<div className="bg-card/50 backdrop-blur-sm">...</div>
// After
<div className="bg-card/80">...</div>

Convert OKLCH/OKLAB to HSL/RGB

/* Before */
:root { --primary: oklch(0.55 0.22 264); }
/* After */
:root { --primary: hsl(250, 60%, 50%); }

Raise opacity thresholds

  • Backgrounds >= 0.4 (prefer >= 0.6)
  • Replace /10 -> /40, /20 -> /40, /30 -> /60

Gradient text fallback

.title { color: #111111; }
@media (prefers-contrast: no-preference) {
  .title.with-gradient {
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
@media (forced-colors: active) {
  .title.with-gradient { background: none; color: CanvasText; }
}

Overlay for text on images

<div className="relative">
  <img src="/hero.jpg" alt="Hero" />
  <div className="absolute inset-0 bg-black/60"></div>
  <h1 className="relative text-white">Title</h1>
</div>

Acceptance criteria

  • Accessibility score is numeric (not "!")
  • color-contrast audit passes or lists actionable items
  • Contrast ratios >= 4.5:1 for normal text, >= 3:1 for large text

Notes

  • "!" indicates audit failure, not a low score.
  • Always test locally before waiting for PSI updates.
将项目部署至 Vercel,自动打包、检测框架并返回预览与认领链接。适用于用户请求部署应用、发布生产版本或获取部署链接等场景。
Deploy my app Deploy this to production Create a preview deployment Deploy and give me the link Push this live
vercel/vercel-deploy/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill vercel-deploy -g -y
SKILL.md
Frontmatter
{
    "name": "vercel-deploy",
    "metadata": {
        "author": "vercel",
        "version": "1.0.0"
    },
    "description": "Deploy applications and websites to Vercel. Use this skill when the user requests deployment actions such as \"Deploy my app\", \"Deploy this to production\", \"Create a preview deployment\", \"Deploy and give me the link\", or \"Push this live\". No authentication required - returns preview URL and claimable deployment link."
}

Vercel Deploy

Deploy any project to Vercel instantly. No authentication required.

How It Works

  1. Packages your project into a tarball (excludes node_modules and .git)
  2. Auto-detects framework from package.json
  3. Uploads to deployment service
  4. Returns Preview URL (live site) and Claim URL (transfer to your Vercel account)

Usage

bash /mnt/skills/user/vercel-deploy/scripts/deploy.sh [path]

Arguments:

  • path - Directory to deploy, or a .tgz file (defaults to current directory)

Examples:

# Deploy current directory
bash /mnt/skills/user/vercel-deploy/scripts/deploy.sh

# Deploy specific project
bash /mnt/skills/user/vercel-deploy/scripts/deploy.sh /path/to/project

# Deploy existing tarball
bash /mnt/skills/user/vercel-deploy/scripts/deploy.sh /path/to/project.tgz

Output

Preparing deployment...
Detected framework: nextjs
Creating deployment package...
Deploying...
✓ Deployment successful!

Preview URL: https://skill-deploy-abc123.vercel.app
Claim URL:   https://vercel.com/claim-deployment?code=...

The script also outputs JSON to stdout for programmatic use:

{
  "previewUrl": "https://skill-deploy-abc123.vercel.app",
  "claimUrl": "https://vercel.com/claim-deployment?code=...",
  "deploymentId": "dpl_...",
  "projectId": "prj_..."
}

Framework Detection

The script auto-detects frameworks from package.json. Supported frameworks include:

  • React: Next.js, Gatsby, Create React App, Remix, React Router
  • Vue: Nuxt, Vitepress, Vuepress, Gridsome
  • Svelte: SvelteKit, Svelte, Sapper
  • Other Frontend: Astro, Solid Start, Angular, Ember, Preact, Docusaurus
  • Backend: Express, Hono, Fastify, NestJS, Elysia, h3, Nitro
  • Build Tools: Vite, Parcel
  • And more: Blitz, Hydrogen, RedwoodJS, Storybook, Sanity, etc.

For static HTML projects (no package.json), framework is set to null.

Static HTML Projects

For projects without a package.json:

  • If there's a single .html file not named index.html, it gets renamed automatically
  • This ensures the page is served at the root URL (/)

Present Results to User

Always show both URLs:

✓ Deployment successful!

Preview URL: https://skill-deploy-abc123.vercel.app
Claim URL:   https://vercel.com/claim-deployment?code=...

View your site at the Preview URL.
To transfer this deployment to your Vercel account, visit the Claim URL.

Troubleshooting

Network Egress Error

If deployment fails due to network restrictions (common on claude.ai), tell the user:

Deployment failed due to network restrictions. To fix this:

1. Go to https://claude.ai/settings/capabilities
2. Add *.vercel.com to the allowed domains
3. Try deploying again
提供Vercel官方React与Next.js性能优化指南,涵盖消除瀑布流、包体积优化等45条规则。适用于编写、审查或重构代码时确保最佳实践,提升应用加载速度与运行效率。
编写新的React组件或Next.js页面 实现数据获取逻辑 审查代码以发现性能问题 重构现有代码以提升性能 优化打包体积或加载时间
vercel/vercel-react-best-practices/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill vercel-react-best-practices -g -y
SKILL.md
Frontmatter
{
    "name": "vercel-react-best-practices",
    "license": "MIT",
    "metadata": {
        "author": "vercel",
        "version": "1.0.0"
    },
    "description": "React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements."
}

Vercel React Best Practices

Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Writing new React components or Next.js pages
  • Implementing data fetching (client or server-side)
  • Reviewing code for performance issues
  • Refactoring existing React/Next.js code
  • Optimizing bundle size or load times

Rule Categories by Priority

Priority Category Impact Prefix
1 Eliminating Waterfalls CRITICAL async-
2 Bundle Size Optimization CRITICAL bundle-
3 Server-Side Performance HIGH server-
4 Client-Side Data Fetching MEDIUM-HIGH client-
5 Re-render Optimization MEDIUM rerender-
6 Rendering Performance MEDIUM rendering-
7 JavaScript Performance LOW-MEDIUM js-
8 Advanced Patterns LOW advanced-

Quick Reference

1. Eliminating Waterfalls (CRITICAL)

  • async-defer-await - Move await into branches where actually used
  • async-parallel - Use Promise.all() for independent operations
  • async-dependencies - Use better-all for partial dependencies
  • async-api-routes - Start promises early, await late in API routes
  • async-suspense-boundaries - Use Suspense to stream content

2. Bundle Size Optimization (CRITICAL)

  • bundle-barrel-imports - Import directly, avoid barrel files
  • bundle-dynamic-imports - Use next/dynamic for heavy components
  • bundle-defer-third-party - Load analytics/logging after hydration
  • bundle-conditional - Load modules only when feature is activated
  • bundle-preload - Preload on hover/focus for perceived speed

3. Server-Side Performance (HIGH)

  • server-cache-react - Use React.cache() for per-request deduplication
  • server-cache-lru - Use LRU cache for cross-request caching
  • server-serialization - Minimize data passed to client components
  • server-parallel-fetching - Restructure components to parallelize fetches
  • server-after-nonblocking - Use after() for non-blocking operations

4. Client-Side Data Fetching (MEDIUM-HIGH)

  • client-swr-dedup - Use SWR for automatic request deduplication
  • client-event-listeners - Deduplicate global event listeners

5. Re-render Optimization (MEDIUM)

  • rerender-defer-reads - Don't subscribe to state only used in callbacks
  • rerender-memo - Extract expensive work into memoized components
  • rerender-dependencies - Use primitive dependencies in effects
  • rerender-derived-state - Subscribe to derived booleans, not raw values
  • rerender-functional-setstate - Use functional setState for stable callbacks
  • rerender-lazy-state-init - Pass function to useState for expensive values
  • rerender-transitions - Use startTransition for non-urgent updates

6. Rendering Performance (MEDIUM)

  • rendering-animate-svg-wrapper - Animate div wrapper, not SVG element
  • rendering-content-visibility - Use content-visibility for long lists
  • rendering-hoist-jsx - Extract static JSX outside components
  • rendering-svg-precision - Reduce SVG coordinate precision
  • rendering-hydration-no-flicker - Use inline script for client-only data
  • rendering-activity - Use Activity component for show/hide
  • rendering-conditional-render - Use ternary, not && for conditionals

7. JavaScript Performance (LOW-MEDIUM)

  • js-batch-dom-css - Group CSS changes via classes or cssText
  • js-index-maps - Build Map for repeated lookups
  • js-cache-property-access - Cache object properties in loops
  • js-cache-function-results - Cache function results in module-level Map
  • js-cache-storage - Cache localStorage/sessionStorage reads
  • js-combine-iterations - Combine multiple filter/map into one loop
  • js-length-check-first - Check array length before expensive comparison
  • js-early-exit - Return early from functions
  • js-hoist-regexp - Hoist RegExp creation outside loops
  • js-min-max-loop - Use loop for min/max instead of sort
  • js-set-map-lookups - Use Set/Map for O(1) lookups
  • js-tosorted-immutable - Use toSorted() for immutability

8. Advanced Patterns (LOW)

  • advanced-event-handler-refs - Store event handlers in refs
  • advanced-use-latest - useLatest for stable callback refs

How to Use

Read individual rule files for detailed explanations and code examples:

rules/async-parallel.md
rules/bundle-barrel-imports.md
rules/_sections.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

用于审查Web界面代码是否符合设计规范。通过获取最新指南,检查指定文件并输出格式化的合规性问题,支持UI审查、无障碍审计等场景。
review my UI check accessibility audit design review UX check my site against best practices
vercel/vercel-web-design-guidelines/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill web-design-guidelines -g -y
SKILL.md
Frontmatter
{
    "name": "web-design-guidelines",
    "metadata": {
        "author": "vercel",
        "version": "1.0.0",
        "argument-hint": "<file-or-pattern>"
    },
    "description": "Review UI code for Web Interface Guidelines compliance. Use when asked to \"review my UI\", \"check accessibility\", \"audit design\", \"review UX\", or \"check my site against best practices\"."
}

Web Interface Guidelines

Review files for compliance with Web Interface Guidelines.

How It Works

  1. Fetch the latest guidelines from the source URL below
  2. Read the specified files (or prompt user for files/pattern)
  3. Check against all rules in the fetched guidelines
  4. Output findings in the terse file:line format

Guidelines Source

Fetch fresh guidelines before each review:

https://raw.githubusercontent.com/vercel-labs/web-interface-guidelines/main/command.md

Use WebFetch to retrieve the latest rules. The fetched content contains all the rules and output format instructions.

Usage

When a user provides a file or pattern argument:

  1. Fetch guidelines from the source URL above
  2. Read the specified files
  3. Apply all rules from the fetched guidelines
  4. Output findings using the format specified in the guidelines

If no files specified, ask the user which files to review.

提供全面的Web和移动端UI/UX设计指南,涵盖50+风格、97种配色及无障碍规范。用于组件设计、代码审查、配色选型及构建落地页或仪表盘,确保高可用性与美观性。
设计新UI组件或页面 选择配色方案与字体 审查代码中的UX问题 构建着陆页或仪表盘 实施无障碍访问要求
creative/ui-ux-pro-max/SKILL.md
npx skills add ZhanlinCui/Agent-Skills-Hunter --skill ui-ux-pro-max -g -y
SKILL.md
Frontmatter
{
    "name": "ui-ux-pro-max",
    "description": "UI\/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn\/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI\/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn\/ui MCP for component search and examples."
}

UI/UX Pro Max - Design Intelligence

Comprehensive design guide for web and mobile applications. Contains 50+ styles, 97 color palettes, 57 font pairings, 99 UX guidelines, and 25 chart types across 9 technology stacks. Searchable database with priority-based recommendations.

When to Apply

Reference these guidelines when:

  • Designing new UI components or pages
  • Choosing color palettes and typography
  • Reviewing code for UX issues
  • Building landing pages or dashboards
  • Implementing accessibility requirements

Rule Categories by Priority

Priority Category Impact Domain
1 Accessibility CRITICAL ux
2 Touch & Interaction CRITICAL ux
3 Performance HIGH ux
4 Layout & Responsive HIGH ux
5 Typography & Color MEDIUM typography, color
6 Animation MEDIUM ux
7 Style Selection MEDIUM style, product
8 Charts & Data LOW chart

Quick Reference

1. Accessibility (CRITICAL)

  • color-contrast - Minimum 4.5:1 ratio for normal text
  • focus-states - Visible focus rings on interactive elements
  • alt-text - Descriptive alt text for meaningful images
  • aria-labels - aria-label for icon-only buttons
  • keyboard-nav - Tab order matches visual order
  • form-labels - Use label with for attribute

2. Touch & Interaction (CRITICAL)

  • touch-target-size - Minimum 44x44px touch targets
  • hover-vs-tap - Use click/tap for primary interactions
  • loading-buttons - Disable button during async operations
  • error-feedback - Clear error messages near problem
  • cursor-pointer - Add cursor-pointer to clickable elements

3. Performance (HIGH)

  • image-optimization - Use WebP, srcset, lazy loading
  • reduced-motion - Check prefers-reduced-motion
  • content-jumping - Reserve space for async content

4. Layout & Responsive (HIGH)

  • viewport-meta - width=device-width initial-scale=1
  • readable-font-size - Minimum 16px body text on mobile
  • horizontal-scroll - Ensure content fits viewport width
  • z-index-management - Define z-index scale (10, 20, 30, 50)

5. Typography & Color (MEDIUM)

  • line-height - Use 1.5-1.75 for body text
  • line-length - Limit to 65-75 characters per line
  • font-pairing - Match heading/body font personalities

6. Animation (MEDIUM)

  • duration-timing - Use 150-300ms for micro-interactions
  • transform-performance - Use transform/opacity, not width/height
  • loading-states - Skeleton screens or spinners

7. Style Selection (MEDIUM)

  • style-match - Match style to product type
  • consistency - Use same style across all pages
  • no-emoji-icons - Use SVG icons, not emojis

8. Charts & Data (LOW)

  • chart-type - Match chart type to data type
  • color-guidance - Use accessible color palettes
  • data-table - Provide table alternative for accessibility

How to Use

Search specific domains using the CLI tool below.


Prerequisites

Check if Python is installed:

python3 --version || python --version

If Python is not installed, install it based on user's OS:

macOS:

brew install python3

Ubuntu/Debian:

sudo apt update && sudo apt install python3

Windows:

winget install Python.Python.3.12

How to Use This Skill

When user requests UI/UX work (design, build, create, implement, review, fix, improve), follow this workflow:

Step 1: Analyze User Requirements

Extract key information from user request:

  • Product type: SaaS, e-commerce, portfolio, dashboard, landing page, etc.
  • Style keywords: minimal, playful, professional, elegant, dark mode, etc.
  • Industry: healthcare, fintech, gaming, education, etc.
  • Stack: React, Vue, Next.js, or default to html-tailwind

Step 2: Generate Design System (REQUIRED)

Always start with --design-system to get comprehensive recommendations with reasoning:

python3 skills/ui-ux-pro-max/scripts/search.py "<product_type> <industry> <keywords>" --design-system [-p "Project Name"]

This command:

  1. Searches 5 domains in parallel (product, style, color, landing, typography)
  2. Applies reasoning rules from ui-reasoning.csv to select best matches
  3. Returns complete design system: pattern, style, colors, typography, effects
  4. Includes anti-patterns to avoid

Example:

python3 skills/ui-ux-pro-max/scripts/search.py "beauty spa wellness service" --design-system -p "Serenity Spa"

Step 2b: Persist Design System (Master + Overrides Pattern)

To save the design system for hierarchical retrieval across sessions, add --persist:

python3 skills/ui-ux-pro-max/scripts/search.py "<query>" --design-system --persist -p "Project Name"

This creates:

  • design-system/MASTER.md — Global Source of Truth with all design rules
  • design-system/pages/ — Folder for page-specific overrides

With page-specific override:

python3 skills/ui-ux-pro-max/scripts/search.py "<query>" --design-system --persist -p "Project Name" --page "dashboard"

This also creates:

  • design-system/pages/dashboard.md — Page-specific deviations from Master

How hierarchical retrieval works:

  1. When building a specific page (e.g., "Checkout"), first check design-system/pages/checkout.md
  2. If the page file exists, its rules override the Master file
  3. If not, use design-system/MASTER.md exclusively

Context-aware retrieval prompt:

I am building the [Page Name] page. Please read design-system/MASTER.md.
Also check if design-system/pages/[page-name].md exists.
If the page file exists, prioritize its rules.
If not, use the Master rules exclusively.
Now, generate the code...

Step 3: Supplement with Detailed Searches (as needed)

After getting the design system, use domain searches to get additional details:

python3 skills/ui-ux-pro-max/scripts/search.py "<keyword>" --domain <domain> [-n <max_results>]

When to use detailed searches:

Need Domain Example
More style options style --domain style "glassmorphism dark"
Chart recommendations chart --domain chart "real-time dashboard"
UX best practices ux --domain ux "animation accessibility"
Alternative fonts typography --domain typography "elegant luxury"
Landing structure landing --domain landing "hero social-proof"

Step 4: Stack Guidelines (Default: html-tailwind)

Get implementation-specific best practices. If user doesn't specify a stack, default to html-tailwind.

python3 skills/ui-ux-pro-max/scripts/search.py "<keyword>" --stack html-tailwind

Available stacks: html-tailwind, react, nextjs, vue, svelte, swiftui, react-native, flutter, shadcn, jetpack-compose


Search Reference

Available Domains

Domain Use For Example Keywords
product Product type recommendations SaaS, e-commerce, portfolio, healthcare, beauty, service
style UI styles, colors, effects glassmorphism, minimalism, dark mode, brutalism
typography Font pairings, Google Fonts elegant, playful, professional, modern
color Color palettes by product type saas, ecommerce, healthcare, beauty, fintech, service
landing Page structure, CTA strategies hero, hero-centric, testimonial, pricing, social-proof
chart Chart types, library recommendations trend, comparison, timeline, funnel, pie
ux Best practices, anti-patterns animation, accessibility, z-index, loading
react React/Next.js performance waterfall, bundle, suspense, memo, rerender, cache
web Web interface guidelines aria, focus, keyboard, semantic, virtualize
prompt AI prompts, CSS keywords (style name)

Available Stacks

Stack Focus
html-tailwind Tailwind utilities, responsive, a11y (DEFAULT)
react State, hooks, performance, patterns
nextjs SSR, routing, images, API routes
vue Composition API, Pinia, Vue Router
svelte Runes, stores, SvelteKit
swiftui Views, State, Navigation, Animation
react-native Components, Navigation, Lists
flutter Widgets, State, Layout, Theming
shadcn shadcn/ui components, theming, forms, patterns
jetpack-compose Composables, Modifiers, State Hoisting, Recomposition

Example Workflow

User request: "Làm landing page cho dịch vụ chăm sóc da chuyên nghiệp"

Step 1: Analyze Requirements

  • Product type: Beauty/Spa service
  • Style keywords: elegant, professional, soft
  • Industry: Beauty/Wellness
  • Stack: html-tailwind (default)

Step 2: Generate Design System (REQUIRED)

python3 skills/ui-ux-pro-max/scripts/search.py "beauty spa wellness service elegant" --design-system -p "Serenity Spa"

Output: Complete design system with pattern, style, colors, typography, effects, and anti-patterns.

Step 3: Supplement with Detailed Searches (as needed)

# Get UX guidelines for animation and accessibility
python3 skills/ui-ux-pro-max/scripts/search.py "animation accessibility" --domain ux

# Get alternative typography options if needed
python3 skills/ui-ux-pro-max/scripts/search.py "elegant luxury serif" --domain typography

Step 4: Stack Guidelines

python3 skills/ui-ux-pro-max/scripts/search.py "layout responsive form" --stack html-tailwind

Then: Synthesize design system + detailed searches and implement the design.


Output Formats

The --design-system flag supports two output formats:

# ASCII box (default) - best for terminal display
python3 skills/ui-ux-pro-max/scripts/search.py "fintech crypto" --design-system

# Markdown - best for documentation
python3 skills/ui-ux-pro-max/scripts/search.py "fintech crypto" --design-system -f markdown

Tips for Better Results

  1. Be specific with keywords - "healthcare SaaS dashboard" > "app"
  2. Search multiple times - Different keywords reveal different insights
  3. Combine domains - Style + Typography + Color = Complete design system
  4. Always check UX - Search "animation", "z-index", "accessibility" for common issues
  5. Use stack flag - Get implementation-specific best practices
  6. Iterate - If first search doesn't match, try different keywords

Common Rules for Professional UI

These are frequently overlooked issues that make UI look unprofessional:

Icons & Visual Elements

Rule Do Don't
No emoji icons Use SVG icons (Heroicons, Lucide, Simple Icons) Use emojis like 🎨 🚀 ⚙️ as UI icons
Stable hover states Use color/opacity transitions on hover Use scale transforms that shift layout
Correct brand logos Research official SVG from Simple Icons Guess or use incorrect logo paths
Consistent icon sizing Use fixed viewBox (24x24) with w-6 h-6 Mix different icon sizes randomly

Interaction & Cursor

Rule Do Don't
Cursor pointer Add cursor-pointer to all clickable/hoverable cards Leave default cursor on interactive elements
Hover feedback Provide visual feedback (color, shadow, border) No indication element is interactive
Smooth transitions Use transition-colors duration-200 Instant state changes or too slow (>500ms)

Light/Dark Mode Contrast

Rule Do Don't
Glass card light mode Use bg-white/80 or higher opacity Use bg-white/10 (too transparent)
Text contrast light Use #0F172A (slate-900) for text Use #94A3B8 (slate-400) for body text
Muted text light Use #475569 (slate-600) minimum Use gray-400 or lighter
Border visibility Use border-gray-200 in light mode Use border-white/10 (invisible)

Layout & Spacing

Rule Do Don't
Floating navbar Add top-4 left-4 right-4 spacing Stick navbar to top-0 left-0 right-0
Content padding Account for fixed navbar height Let content hide behind fixed elements
Consistent max-width Use same max-w-6xl or max-w-7xl Mix different container widths

Pre-Delivery Checklist

Before delivering UI code, verify these items:

Visual Quality

  • No emojis used as icons (use SVG instead)
  • All icons from consistent icon set (Heroicons/Lucide)
  • Brand logos are correct (verified from Simple Icons)
  • Hover states don't cause layout shift
  • Use theme colors directly (bg-primary) not var() wrapper

Interaction

  • All clickable elements have cursor-pointer
  • Hover states provide clear visual feedback
  • Transitions are smooth (150-300ms)
  • Focus states visible for keyboard navigation

Light/Dark Mode

  • Light mode text has sufficient contrast (4.5:1 minimum)
  • Glass/transparent elements visible in light mode
  • Borders visible in both modes
  • Test both modes before delivery

Layout

  • Floating elements have proper spacing from edges
  • No content hidden behind fixed navbars
  • Responsive at 375px, 768px, 1024px, 1440px
  • No horizontal scroll on mobile

Accessibility

  • All images have alt text
  • Form inputs have labels
  • Color is not the only indicator
  • prefers-reduced-motion respected

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-08 18:36
浙ICP备14020137号-1 $Carte des visiteurs$