You are an expert Swift and Zsh developer assisting with the maintenance and
development of mas, a command-line interface for the Mac App Store.
- Name:
mas - Description: A CLI for the Mac App Store, designed for scripting & automation.
- Language: Swift 6.2 (using Swift Argument Parser)
- Target OS: macOS 13+
- Project Type: SwiftPM project
- Swift: 6.2+ (Check .swift-version)
- Xcode: 26+ (Check .xcode-version)
- macOS: 13+ (Check Package.swift)
- Private Frameworks: Uses
CommerceKitandStoreFoundationfor App Store integration only where public APIs are insufficient.
Scripts/bootstrap- Debug:
Scripts/build - Release:
Scripts/build '' -c release
- Quick Lint:
Scripts/lint -AP - Full Lint:
Scripts/lint - Format:
Scripts/format(Run repeatedly until no changes occur)
Scripts/testRefer to AGENTS.md for comprehensive guidelines. Key highlights:
- Newlines: UNIX (LF)
- Indentation: Tabs (width: 2) for Swift/Zsh; Spaces (2) for YAML; Spaces (1) for Markdown.
- Max line length: 120 characters (80 for Markdown).
- Preservation: Do not reformat, rename, or reorder code unless necessary for functionality.
- Style: ATX headings, fenced code blocks with backticks, underscore emphasis, asterisk strong.
- Language: Only
consoleandshellare allowed in code fences. - HTML: Limited to
<details>,<h1>,<summary>.
- Style: 2-space indentation, unix newlines, quoted strings only when necessary, single quotes for strings.
- Rules: Forbid non-empty braces, require document start (
---).
- Shebang:
#!/bin/zsh -Ndefgku - Setup: Start scripts with
. "${0:A:h}/_setup_script" - Preference: Use zsh builtins over external commands.
- Commands: Use
cp -candtrash(notrm).
- Structure: Organized by
AppStore/,Commands/,Models/,Utilities/. - Force Unwrapping: Avoid in
Sources/mas/. - Naming: Capitalize acronyms consistently (e.g.,
ADAM,API,JSON). - Organization: Group computed properties below stored properties.
- Error Handling: Prefer typed throws (
throws(ErrorType)), thenrethrows, then untypedthrows.
- Trunk:
main - Commits: Follow conventional commit style.
- Pre-commit: Always run
Scripts/formatandScripts/lintbefore committing.
- Framework: Swift Testing.
- Location:
Tests/MASTests/ - Naming Convention:
Sources/mas/Path/To/File.swift->Tests/MASTests/Path/To/MASTests+File.swift. - Assertions: Use force unwrapping (
!) in tests if appropriate.