avoiding-macos-junk-files

Use when macOS files, directories, Git repositories, CI pipelines, SCP transfers, or ZIP/TAR artifacts may contain platform metadata contamination such as ._*, .DS_Store, __MACOSX, AppleDouble, resource forks, or extended attributes.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "avoiding-macos-junk-files" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-a90393ffbd3acc018b816dccbacd6a016381ed4bb54a4fb9e94de146235972ed. Verify the upstream source and version against https://skillhub.cn/skills/user_3525f922/avoiding-macos-junk-files before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Use when macOS files, directories, Git repositories, CI pipelines, SCP transfers, or ZIP/TAR artifacts may contain platform metadata contamination such as ._*, .DS_Store, __MACOSX, AppleDouble, resource forks, or extended attributes.

0 Downloads

Introduction source: third_party · user_3525f922 · 1.0.1 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: avoiding-macos-junk-files
description: Use when macOS 文件、目录、Git 仓库、CI 流水线、SCP 传输或 ZIP/TAR 制品可能包含 ._*, .DS_Store, __MACOSX, AppleDouble, 资源叉或扩展属性等平台元数据污染。

避免 macOS 垃圾文件

使用随附 CLI 管理 macOS 元数据进入复制、Git、CI、SCP 和归档交付链路的风险。该技能阻止元数据进入交付物,不能保证 Finder 永不在本机磁盘产生元数据。

核心原则

  • 默认只检查;仅在用户明确授权并传入 --apply 时执行清理或安装仓库门禁。
  • 把 .DS_Store、._*、__MACOSX、AppleDouble、资源叉和扩展属性视为交付污染;将不确定项转为人工复核,不擅自删除。需要读取 FinderInfo、ResourceFork 与 com.apple.metadata:* 时显式使用 scan <目录> --xattrs。
  • 使用 CLI 的退出码:0 通过、1 发现策略违规、2 运行错误。
  • 不修改 macOS 全局设置、用户 Shell 配置或 Git 全局配置。

默认安全流程

  1. 先扫描:python3 scripts/macos_hygiene.py scan <目录>。需要机器可读结果时附加 --format json;需要检查传输相关扩展属性时附加 --xattrs。用 --version 记录工具版本。
  2. 仅在授权后清理高置信垃圾:先运行 clean <目录> 预览,再运行 clean <目录> --apply;人工复核项保持不动。
  3. 对 Git 仓库运行 check-git <仓库> --scope all,覆盖工作区、暂存区和已跟踪路径。
  4. 为仓库预览门禁:install-repo-guard <仓库> --ci both;确认无冲突后使用 --apply 安装本地 Hook、仓库内工具和 CI 模板。Hook 可被 --no-verify 绕过,因此必须保留 CI 门禁。
  5. 使用 stage <源目录> <暂存目录> --manifest <清单路径> 构造无污染传输副本并生成 SHA-256 清单;使用 scp <源目录> <目标> --manifest-out <清单路径> 时让工具完成暂存、复检、传输并保留可复核审计清单。仅使用受限的 SCP 选项,拒绝可执行本地命令的配置。
  6. 使用 archive create <源目录> <制品> --format zip|tar|tar.gz 创建归档;交付前运行 archive verify <制品>,验证完整性、危险路径/链接、资源限制和元数据污染。容量受限的 CI 必须按环境收紧 --max-members、--max-total-bytes、--max-member-bytes 和 --max-compression-ratio。

禁止事项

  • 不直接用 Finder 的“压缩”结果作为发布制品,除非已经通过 archive verify。
  • 不以 .gitignore 替代 Git 索引、已跟踪文件、Hook 或 CI 检查。
  • 不将未复核的资源叉、扩展属性或异常符号链接纳入 SCP 暂存区和归档。
  • 不用 --no-verify 作为放行手段;仅可用于证明 CI 仍会阻断。

验收标准

在发布、传输或合并前,确认扫描、check-git、SCP 暂存清单和归档验证均返回 0;CI 使用同一检查命令且失败时阻断流水线。随附 GitHub Actions 与 GitLab CI 模板在 Python 3.11、3.14 矩阵中执行该检查;安装后应在目标托管平台实际运行一次,并保留流水线链接或日志作为环境验收证据。归档验收检查 ZIP/TAR 内部成员路径、ZIP extra/resource-fork 记录和 TAR 内部 xattr;宿主文件本体的文件系统 xattr 不属于归档内容,也不会随此归档格式写入成员。若返回 1,先处理或隔离发现项;若返回 2,修复运行环境或输入错误后重试。

安全边界

  • 暂存和归档会创建私有临时副本;为其预留不低于有效源内容大小的本地空间,并在 CI 上用归档资源上限限制可处理的规模。
  • 本工具在单次、单线程传输上下文中固定文件描述符并复检;它不能防御拥有同一 UID 且可任意修改源目录、临时目录或运行环境的恶意本地进程。
  • --xattrs 只检测会进入交付载荷的 FinderInfo、ResourceFork 与 com.apple.metadata:*。com.apple.provenance 等宿主层属性不等同于压缩包成员污染,须由存储或传输端另行治理。

版权与联系信息

版权所有 © 侯钰熙。联系邮箱:houyuxi123@gmail.com;网站:www.houyuxi.com。

Current listing version

1.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value82/100

Highlights

  • 解决 macOS 开发者在 Git、CI、归档、传输等高频场景中的元数据污染痛点
  • 受众明确,实用性强,能有效提升交付物清洁度
Trigger Precision95/100

Highlights

  • 触发词覆盖全面,明确列出 Git、CI、SCP、ZIP/TAR 等关键场景
  • 边界清晰,不易误触或漏触
Structure and Standards78/100

Areas to improve

  • 缺少显式 'When to Use' 章节 Reported severity: Minor

    文档流程详尽但未使用标准 Phase 划分和显式使用场景标题

    Recommendation: 建议增加 'When to Use' 章节并明确划分 Phase 以提升可读性

Highlights

  • 文档结构完整,包含核心原则、安全流程、验收标准等关键部分
  • frontmatter 完整,流程描述清晰
Execution Reliability65/100

Areas to improve

  • 引用文件缺失 Reported severity: Major

    SKILL.md 引用了 scripts/macos_hygiene.py 但未传入该文件

    Recommendation: 请补全 scripts/macos_hygiene.py 文件以确保执行可靠性

Highlights

  • 工具参数说明清晰,退出码定义明确
  • 不可逆操作有 --apply 确认机制,安全边界说明充分
Evidence Verifiability (mean of the first four)80/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • www.houyuxi.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.