Filesystem

oimiragieo/agent-studio/.claude/skills/filesystem

作者 oimiragieo64b580eab27ba37673f042ecc12ac53413cd9dd5無授權條款收錄於 2026年10月9日更新於 2026年10月9日

File system operations guidance - read, write, search, and manage files using Claude Code's built-in tools.

AI 產生的概覽

指導代理使用內建工具讀取、寫入、搜尋與管理檔案。

功能
此技能提供使用代理內建工具進行檔案系統操作的指引。內容涵蓋讀取單一或多個檔案、建立與修改檔案、依萬用字元模式尋找檔案、搜尋檔案內容,以及基本目錄操作。它也說明建議的工作流程,例如先讀後改、平行讀取、先搜尋再編輯,並包含記錄學習、問題與決策的記憶協定。
適用情境
當代理在任務中需要讀取、建立、編輯、定位或搜尋檔案時使用。它也適合需要一致檔案處理慣例的情境,例如編輯前先讀取,或優先使用結構化搜尋工具而非原始 shell 指令。
執行需求
需要具備內建檔案工具(Read、Write、Edit、Bash、Glob、Grep)的代理環境。內容搜尋指引引用了 pnpm search:code 或 ripgrep 技能。附有可執行指令碼(scripts/main.cjs、hooks/pre-execute.cjs、hooks/post-execute.cjs),以及結構描述、規則、範本與參考檔案。

Filesystem Skill

<identity>

Filesystem Skill - Guidance for file system operations using Claude Code's built-in tools. Read, write, search, and manage files efficiently.

</identity>

<capabilities>

  • Reading single or multiple files
  • Creating or modifying files
  • Searching for files by pattern
  • Searching file contents
  • Directory navigation

</capabilities>

<instructions>

<execution_process>

Claude Code Built-in Tools

Reading Files

Read Tool: Read file contents

Read file_path="/path/to/file.txt"

Options:

  • offset: Start line (for large files)
  • limit: Number of lines to read

Finding Files

Glob Tool: Find files by pattern

Glob pattern="**/*.ts"

Common patterns:

  • **/*.ts - All TypeScript files
  • src/**/*.tsx - React components in src
  • **/test*.js - Test files anywhere

Searching Content

Primary Search: Use pnpm search:code "query" or Skill({ skill: 'ripgrep' }) for content searching. The built-in Grep tool is fallback-only.

Grep Tool: Search file contents (fallback only — prefer pnpm search:code or ripgrep skill first)

Grep pattern="function myFunc" path="/src"

Options:

  • output_mode: "content", "files_with_matches", or "count"
  • -A, -B, -C: Context lines

Writing Files

Write Tool: Create or overwrite files

Write file_path="/path/to/file.txt" content="..."

Edit Tool: Modify existing files

Edit file_path="/path/to/file.txt" old_string="..." new_string="..."

Directory Operations

Bash Tool: For directory operations

bash
# List directoryls -la /path/to/dir
# Create directorymkdir -p /path/to/new/dir
# Move/renamemv /old/path /new/path

</execution_process>

<best_practices>

Common Workflows

Reading Multiple Files

# Read files in parallel (multiple Read calls in one message)Read file_path="/src/app.ts"Read file_path="/src/config.ts"Read file_path="/src/utils.ts"

Search and Read

# 1. Find filesGlob pattern="**/*.config.ts"
# 2. Read matching filesRead file_path="/path/from/glob/result"

Find and Replace

# 1. Search for patternGrep pattern="oldFunction" path="/src"
# 2. Edit each fileEdit file_path="/src/file.ts" old_string="oldFunction" new_string="newFunction"

Best Practices

  1. Read Before Edit: Always read a file before editing it
  2. Use Glob Over Bash: Prefer Glob to find for file discovery
  3. Search Tool Hierarchy: Use pnpm search:code or Skill({ skill: 'ripgrep' }) first; use the Grep tool as fallback over raw bash grep only
  4. Parallel Reads: Read multiple files in one message for speed
  5. Verify Changes: Read file after editing to verify

</best_practices>

</instructions>

<examples>

<usage_example>

Find and read all TypeScript files:

Glob pattern="src/**/*.ts"# Then read the resultsRead file_path="/src/app.ts"

</usage_example>

<usage_example>

Search for a function and edit it:

Grep pattern="export function oldName" path="/src"# Found in /src/utils.ts:23
Edit file_path="/src/utils.ts" old_string="export function oldName" new_string="export function newName"

</usage_example>

</examples>

Rules

  • Always read files before editing
  • Use built-in tools (Read, Glob, Grep) instead of bash equivalents
  • Verify changes after editing

Memory Protocol (MANDATORY)

Before starting:

bash
cat .claude/context/memory/learnings.md

After completing:

  • New pattern -> .claude/context/memory/learnings.md
  • Issue found -> .claude/context/memory/issues.md
  • Decision made -> .claude/context/memory/decisions.md

ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

來源與署名

來源:oimiragieo/agent-studio位於.claude/skills/filesystem提交64b580e

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架