文件操作降级方案。当 Write/StrReplace 工具返回 Error: Aborted 或超时失败时,自动使用 Shell 命令替代。适用于大文件写入、长内容创建等场景。
From open-skillsnpx claudepluginhub fudesign2008/open-skills --plugin open-skillsThis skill uses the workspace's default tool permissions.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Generates FastAPI project templates with async routes, dependency injection, Pydantic schemas, repository patterns, middleware, and config for PostgreSQL/MongoDB backends.
当标准文件操作工具失败时,自动切换到 Shell 命令替代方案
以下情况应自动触发降级方案:
Write 工具返回 Error: AbortedStrReplace 工具返回 Error: Aborted当 Write 工具失败时,使用 Shell 的 heredoc 语法:
cat > /path/to/file << 'EOF'
文件内容...
多行内容...
EOF
注意事项:
当 StrReplace 工具失败时,使用 sed 命令:
# macOS 语法(需要 -i '')
sed -i '' 's/原内容/新内容/' /path/to/file
# 使用其他分隔符避免路径冲突
sed -i '' 's|原内容|新内容|' /path/to/file
注意事项:
-i '',Linux 只需要 -i| 或 # 作为分隔符避免路径中的 / 冲突cat >> /path/to/file << 'EOF'
追加的内容...
EOF
mkdir -p /path/to/directory && cat > /path/to/directory/file << 'EOF'
文件内容...
EOF
cat > /path/to/README.md << 'EOF'
# 标题
## 内容
- 列表项1
- 列表项2
EOF
sed -i '' 's|旧的引用路径|新的引用路径|' /path/to/config.md
sed -i '' 's|pattern1|replacement1|' /path/to/file && \
sed -i '' 's|pattern2|replacement2|' /path/to/file
Error: Aborted,立即切换到 Shell 方案| 标准工具 | Shell 替代方案 | 适用场景 |
|---|---|---|
| Write | cat > file << 'EOF' | 创建/覆盖文件 |
| StrReplace | sed -i '' 's/old/new/' | 替换文件内容 |
| Delete | rm -f file 或 rm -rf dir | 删除文件/目录 |
| 追加内容 | cat >> file << 'EOF' | 在文件末尾添加内容 |