Get the FREE Ultimate OpenClaw Setup Guide →

swift-package-agents-maintainer

npx machina-cli add skill gaelic-ghost/apple-dev-skills/swift-package-agents-maintainer --openclaw
Files (1)
SKILL.md
4.5 KB

Swift Package AGENTS Maintainer

Maintain one canonical AGENTS.md across Swift Package repositories. Prefer the bundled script for deterministic automation runs.

Workflow

  1. Confirm scope and mode.
  • Use --repo <path> for a single repository.
  • Use --root <path> to scan recursively for repos containing Package.swift.
  • If neither --repo nor --root is provided, scan ~/Workspace by default.
  • Use --check for read-only drift detection in recurring automation.
  • Omit --check to apply updates.
  1. Resolve the canonical file.
  • Default canonical file: assets/AGENTS.md in this skill.
  • If the user provides another canonical source, pass it with --canonical <path>.
  1. Run synchronization.
  • Command: scripts/sync_agents_md.sh [--canonical <path>] (--repo <path> | --root <path>) [--check] [--verbose]
  • In apply mode, the script creates or updates AGENTS.md in each discovered Swift package repo.
  • In check mode, the script reports drift and exits non-zero if any repo differs.
  1. Validate and report.
  • Summarize: scanned repos, unchanged repos, updated repos, and drift count.
  • For automation runs, include whether exit status indicates drift.

Defaults

  • Prefer --check for scheduled automation runs that only detect drift.
  • Prefer apply mode for user-invoked maintenance runs.
  • Treat a directory as a Swift package repo only when Package.swift is present.
  • Use ~/Workspace as the default discovery root on machines where Swift packages are stored there.
  • Use --root when your repositories live outside ~/Workspace.
  • Skip hidden/build dependency directories during scans (for example .git, any .* directory, .build, .swiftpm, node_modules).
  • Skip Xcode-protected/generated directories during scans (for example *.xcworkspace, *.xcodeproj, DerivedData).

Automation Prompting

  • Codex App automation fit: Strong. Use for recurring drift detection or scheduled apply runs.
  • Codex CLI automation fit: Strong. Use deterministic prompts that map directly to --check or apply mode.
  • Use references/automation-prompts.md for Codex App and Codex CLI templates with placeholders.
  • Keep mode, schedule, and workspace routing explicit to avoid accidental apply runs.

Troubleshooting

  • If the canonical file path is missing, stop and request or restore a valid canonical AGENTS.md.
  • If no repositories are discovered under --root, report that no Package.swift files were found.
  • If permissions block writes, rerun with an authorized workspace path or approved elevation.

Resources

scripts/

  • scripts/sync_agents_md.sh: Detect and apply canonical AGENTS.md changes across Swift package repos.

assets/

  • assets/AGENTS.md: Canonical baseline template for Swift package repositories.

references/

  • references/automation-usage.md: Suggested recurring automation modes and output expectations.
  • references/automation-prompts.md: Codex App and Codex CLI automation templates with placeholders and guardrails.

Interactive Customization Flow

  1. Load current effective customization settings first:
  • uv run python scripts/customization_config.py effective
  1. Ask targeted customization questions:
  • Use references/customization-flow.md to drive knob-by-knob questions.
  • Confirm desired behavior changes and safety constraints.
  1. Map requested changes to implementation files:
  • Update SKILL.md, references/*, and any runtime script files listed in references/customization-flow.md.
  1. Persist durable customization state:
  • Start from customization.template.yaml defaults.
  • Apply approved overrides with uv run python scripts/customization_config.py apply --input <yaml-file>.
  • Durable path: ~/.config/gaelic-ghost/apple-dev-skills/<skill-name>/customization.yaml.
  • Optional override root: APPLE_DEV_SKILLS_CONFIG_HOME.
  1. Report resulting effective configuration:
  • Re-run uv run python scripts/customization_config.py effective and summarize final active settings.
  • If the user asks to remove customization state, run uv run python scripts/customization_config.py reset.

Use references/customization-flow.md for skill-specific knobs, file mapping, guardrails, validation checks, and example requests.

Source

git clone https://github.com/gaelic-ghost/apple-dev-skills/blob/main/apple-swift-repo-tools/swift-package-agents-maintainer/SKILL.mdView on GitHub

Overview

Maintains a single AGENTS.md baseline across Swift Package repositories and applies deterministic updates with a bundled script. It supports single-repo and recursive discovery, offers a read-only drift mode (--check), and updates repositories to enforce a shared policy baseline.

How This Skill Works

Use the bundled script scripts/sync_agents_md.sh to locate targets via --repo or --root (defaulting to ~/Workspace). The workflow updates AGENTS.md to a canonical assets/AGENTS.md or a user-specified file with --canonical; in check mode it reports drift and exits non-zero.

When to Use It

  • When you need to sync AGENTS.md across multiple Swift Package repos
  • When enforcing a shared policy baseline across Swift repos
  • When detecting drift in automation and validating changes
  • When applying canonical templates or customizing the sync policy per project
  • When performing scheduled automation or CI runs that manage AGENTS.md

Quick Start

  1. Step 1: Decide the scope with --repo <path> or --root <path> (default ~/Workspace).
  2. Step 2: Run the sync command: scripts/sync_agents_md.sh [--canonical <path>] (--repo <path> | --root <path>) [--check] [--verbose].
  3. Step 3: Review the summary and, if in apply mode, commit the updated AGENTS.md files.

Best Practices

  • Prefer running with --check for drift detection in automation runs
  • Keep the canonical source at assets/AGENTS.md and use --canonical to override
  • Exclude hidden, build, and Xcode-protected directories during scans
  • Validate outcomes by reviewing the summary of scanned, updated, and drifted repos
  • Run from a known workspace root, e.g., --root or default ~/Workspace, to ensure discoverability

Example Use Cases

  • CI drift-detection of AGENTS.md across Swift packages
  • Batch-synchronize AGENTS.md in a multi-repo Swift project
  • Override canonical file with a custom path for a specific repo
  • Scan from a root path to discover all Package.swift repositories under ~/Workspace
  • Gracefully handle missing AGENTS.md by prompting for a valid canonical file

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers