Agent skill
swift-package-agents-maintainer
Create, update, and maintain a canonical AGENTS.md (agents file) across Swift Package repositories. Use when Codex needs to update AGENTS.md for Swift packages, sync agents files for one or many Swift package repos, enforce a shared repository policy baseline, detect AGENTS.md drift in automation, or apply the canonical AGENTS.md template during repository maintenance.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/swift-package-agents-maintainer
SKILL.md
Swift Package AGENTS Maintainer
Maintain one canonical AGENTS.md across Swift Package repositories.
Prefer the bundled script for deterministic automation runs.
Workflow
- Confirm scope and mode.
- Use
--repo <path>for a single repository. - Use
--root <path>to scan recursively for repos containingPackage.swift. - If neither
--reponor--rootis provided, scan~/Workspaceby default. - Use
--checkfor read-only drift detection in recurring automation. - Omit
--checkto apply updates.
- Resolve the canonical file.
- Default canonical file:
assets/AGENTS.mdin this skill. - If the user provides another canonical source, pass it with
--canonical <path>.
- 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.mdin each discovered Swift package repo. - In check mode, the script reports drift and exits non-zero if any repo differs.
- Validate and report.
- Summarize: scanned repos, unchanged repos, updated repos, and drift count.
- For automation runs, include whether exit status indicates drift.
Defaults
- Prefer
--checkfor 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.swiftis present. - Use
~/Workspaceas the default discovery root on machines where Swift packages are stored there. - Use
--rootwhen 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
--checkor apply mode. - Use
references/automation-prompts.mdfor 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 noPackage.swiftfiles 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 canonicalAGENTS.mdchanges 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.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?