360 Secure SkillHub
360 安全技能中心

Folders

通过本地 JSON 索引记录重要目录,支持按项目标记发现文件夹,并在删除等操作前进行路径规范化和系统路径拦截;默认建议使用回收站而非永久删除。

ivangdavila
ivangdavila
热度 85.59
最近更新 2026-05-11 16:24:59
分类:效率依赖:读写文件应用场景:工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add folders
Metadata
name
Folders
description
Index important directories and perform safe folder operations with proper security checks.
metadata
{"clawdbot":{"emoji":"📂","os":["linux","darwin","win32"]}}

Folder Index

Maintain a lightweight index at ~/.config/folder-index.json to know where important things are without rescanning.

{
  "folders": [
    {"path": "/Users/alex/projects/webapp", "type": "project", "note": "Main client project"}
  ]
}

When user asks "where is X" or "find my project Y", check the index first. If not found, do targeted discovery then offer to add the result.

Discovery

When asked to find or index folders:

  • Scan likely locations: ~/projects, ~/Documents, ~/code, ~/dev, ~/work
  • Detect projects by markers: .git, package.json, pubspec.yaml, Cargo.toml, go.mod, pyproject.toml, *.sln
  • Stop at first marker (don't recurse into node_modules, vendor, build)
  • Propose what was found, don't auto-add: "Found 8 projects in ~/code. Add to index?"

Path Security

  • Canonicalize paths (resolve ~, .., symlinks) before any operation
  • Reject system paths: /, /etc, /var, /usr, /System, /Library, C:\Windows, C:\Program Files
  • Skip symlinks during traversal, report them separately

Destructive Operations

  • Use OS trash instead of permanent delete
  • State recoverability: "node_modules: recoverable with npm install"
  • Build artifacts safe to delete: node_modules, pycache, .gradle, build/, target/, Pods/, .next/

Platform Quirks

  • macOS: .DS_Store alone = effectively empty. Treat .app as single item.
  • Windows: Paths >260 chars need \\?\ prefix.
  • Network drives: Warn before bulk ops — may be slow or offline.