Agent skill

Sake Command Patterns

by kattouf in kattouf/Sake

A skill your agent uses when writing or modifying Sake commands, CommandGroups, SakeApp files, or SakeApp/ directory code.

MITAuto-check passedMobile

Install Sake Command Patterns

skills CLI
$ npx skills add kattouf/Sake --skill sake-command-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kattouf/Sake sake-command-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kattouf/Sake.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/sake-command-patterns .claude/skills/sake-command-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sake-command-patterns
GitHub stars
116
Token cost
~1.1k tokens
SKILL.md length
143 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when writing or modifying Sake commands, CommandGroups, SakeApp files, or SakeApp/ directory code.

  • Modifying Sake commands
  • SKILL.md covers Command Struct, Visibility Rules, CommandGroup & @CommandGroup… and Dependencies, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • SakeApp/ directory code

What it does

Sake Command Patterns is an agent skill from kattouf/Sake. Use when writing or modifying Sake commands, CommandGroups, SakeApp files, or SakeApp/ directory code. Covers Command struct, dependencies, skipIf, context, storage, subprocess patterns, argument parsing.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile. It works with Bash. The repository describes itself as: 🍶 Swift-based utility for managing project commands, inspired by Make. The licence is MIT.

When your agent uses it

  • Modifying Sake commands
  • SakeApp/ directory code

Example prompts

  • “/sake-command-patterns”

What it can do on your machine

Read from SKILL.md and the folder at commit 80a3e98. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are swift).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sake Command Patterns loads about 1.1k tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 143 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from kattouf/Sake at commit 80a3e98, republished under its MIT licence (© kattouf). 143 words, ~1,090 tokens.

Download SKILL.mdSave it as .claude/skills/sake-command-patterns/SKILL.md (or your agent's skills folder).
name
sake-command-patterns
description
Use when writing or modifying Sake commands, CommandGroups, SakeApp files, or SakeApp/ directory code. Covers Command struct, dependencies, skipIf, context, storage, subprocess patterns, argument parsing.

Sake Command Patterns

Reference for writing commands in the Sake framework.

Command Struct

Command is a Sendable struct with async/throws closures:

swift
public struct Command: Sendable {
    let description: String?
    let dependencies: [Command]
    let runDependenciesConcurrently: Bool
    let skipIf: @Sendable (Context) async throws -> Bool  // default: { _ in false }
    let run: @Sendable (Context) async throws -> Void     // default: { _ in }
}

Visibility Rules

Only public static var of type Command or Sake.Command are exposed to CLI. Non-public or non-static commands work as internal dependencies but aren't callable from terminal. Typealiases don't work.

swift
public static var build: Command { ... }  // visible in CLI
static var cleanIfNeeded: Command { ... } // internal, usable as dependency

CommandGroup & @CommandGroup Macro

swift
@CommandGroup
struct BuildCommands {
    public static var build: Command { ... }
}

Macro generates CommandGroup conformance with commands: [String: Command] dict. Register groups in main struct:

swift
@main @CommandGroup
struct Commands: SakeApp {
    static var configuration: SakeAppConfiguration {
        SakeAppConfiguration(commandGroups: [BuildCommands.self, TestCommands.self])
    }
    public static var lint: Command { ... } // root-level commands also work
}

Dependencies

swift
// Sequential (default)
Command(dependencies: [clean, fetch], run: { _ in ... })

// Concurrent
Command(dependencies: [a, b, c], runDependenciesConcurrently: true, run: { _ in ... })

// Direct run via CommandRunner
Command(run: { context in
    try await CommandRunner(command: otherCommand, context: context).run()
})

Conditional Execution (skipIf)

swift
Command(
    skipIf: { context in
        let args = try TestArguments.parse(context.arguments)
        return args.skipBuild
    },
    run: { _ in ... }
)

When skipIf returns true, the command AND its dependencies are skipped entirely.

Context

Properties: arguments: [String], environment: [String: String], appDirectory: String, runDirectory: String, storage: Storage, interruptionHandler: InterruptionHandler.

Context Extensions
swift
extension Command.Context {
    var projectRoot: String { "\(appDirectory)/.." }
}
Sharing Data via Storage

Thread-safe key-value store (NSRecursiveLock). Shared across command dependency chain:

swift
// In dependency
context.storage["build-output"] = outputPath
// In main command
let path = context.storage["build-output"] as? String
Context Mapping for Dependencies
swift
dependencies: [
    buildTests,
    unitTests.mapArguments { $0 + ["--skip-build"] },
    deploy.mapEnvironment { env in
        var e = env; e["TARGET"] = "prod"; return e
    },
]

Argument Parsing

Use ArgumentParser ParsableArguments inside commands:

swift
Command(run: { context in
    struct Args: ParsableArguments {
        @Flag(name: .long) var clean: Bool = false
        @Flag(name: .long) var skipBuild: Bool = false
    }
    let args = try Args.parse(context.arguments)
    ...
})

Subprocess Execution

Project uses helper functions wrapping swift-subprocess (see SakeApp/SubprocessPresets.swift):

swift
// Print output to stdout/stderr
try await runAndPrint("swift", "build", "--build-tests")

// Capture output
let result = try await run("mise", "which", "swiftformat")
if result.terminationStatus.isSuccess { ... }

Interruption Handling

swift
Command(run: { context in
    context.interruptionHandler.register {
        print("Cleanup on Ctrl+C...")
    }
    // long-running work
})

Common Pattern: Ensure Tool Installed

swift
static var ensureSwiftFormatInstalled: Command {
    Command(
        description: "Ensure swiftformat is installed",
        skipIf: { _ in
            try await run("mise", "which", "swiftformat").terminationStatus.isSuccess
        },
        run: { _ in
            try await runAndPrint("mise", "install", "swiftformat")
        },
    )
}

© kattouf, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/sake-command-patterns of kattouf/Sake.

Open the folder on GitHubat commit 80a3e98

Compare with similar skills

Sake Command Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sake Command Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sake Command Patterns this skillkattouf/Sake116—~1.1kAutomated safety check: PassMIT
Composewebview Documentationparkwoocheol/compose-webview103—~1.5kAutomated safety check: PassMIT
Android CLImajiayu000/claude-skill-registry6668 repos~2.7kAutomated safety check: PassMIT
Green GateVeryGoodOpenSource/vgv-ai-flutter-plugin169—~4.7kAutomated safety check: NotesMIT
Scripting Adb For CIskydoves/android-testing-skills333—~6.4kAutomated safety check: PassApache-2.0
UI Automation Workflowsconorluddy/xclaude-plugin183—~2.2kAutomated safety check: PassMIT

Similar skills

  • Composewebview Documentation

    parkwoocheol/compose-webview

    Manages MkDocs documentation site and API references for ComposeWebView.

    103 GitHub stars~1.5k tokensUpdated 1 mo ago
    MobileAuto-check passed
  • Android CLI

    majiayu000/claude-skill-registry

    Orchestrates Android development tasks including project creation, deployment, SDK management, and environment diagnostics using the android command-line tool.

    666 GitHub starsUsed in 8 repos~2.7k tokens
    MobileAuto-check passed
  • Green Gate

    VeryGoodOpenSource/vgv-ai-flutter-plugin

    Drives a Dart or Flutter package fully green through a verify-fix-rerun loop across four gates: analyze, format, test, coverage.

    169 GitHub stars~4.7k tokensUpdated 2 days ago
    MobileAuto-check: notes
  • Scripting Adb For CI

    skydoves/android-testing-skills

    A skill your agent uses to wire adb reliably into CI — bash idioms, exit codes, parallel device fan-out with xargs -P, port forwarding (adb forward LOCAL REMOTE vs adb reverse REMOTE LOCAL —…

    333 GitHub stars~6.4k tokensUpdated 4 mo ago
    MobileAuto-check passed
  • UI Automation Workflows

    conorluddy/xclaude-plugin

    Accessibility-first UI automation using IDB. An agent skill from conorluddy/xclaude-plugin.

    183 GitHub stars~2.2k tokensUpdated 26 days ago
    Frontend & DesignAuto-check passed
  • Scoutqa Test

    github/awesome-copilot

    Official

    This skill should be used when the user asks to "test this website", "run exploratory testing", "check for accessibility issues", "verify the login flow works", "find bugs on this page", or requests…

    40k GitHub starsUsed in 1 repo~3.5k tokens
    Testing & QAAuto-check passed

More from kattouf/Sake

All 8 skills in this repo
  • Sake CI Release

    kattouf/Sake

    A skill your agent uses when working on CI workflows, GitHub Actions, release process, changelog generation (git-cliff), or dependabot configuration.

    116 GitHub stars~731 tokensUpdated 6 mo ago
    Auto-check passed
  • A skill your agent uses when working on SakeCLI or SakeCLILibrary targets — CLI entry point, config resolution, SakeAppManager build/run lifecycle, error handling, shell execution.

    116 GitHub stars~1.1k tokensUpdated 6 mo ago
    Auto-check passed
  • Sake Config System

    kattouf/Sake

    A skill your agent uses when working on Sake configuration — .sake.yml, environment variables, CLI options, ConfigManager, ConfigResolver, or adding new config options.

    116 GitHub stars~687 tokensUpdated 6 mo ago
    Auto-check passed
  • Sake Docs

    kattouf/Sake

    A skill your agent uses when writing or updating Sake documentation — VitePress site structure, existing pages, how to add new docs, documentation conventions.

    116 GitHub stars~778 tokensUpdated 6 mo ago
    Auto-check passed
  • A skill your agent uses when modifying the @CommandGroup macro in SakeMacros target — SwiftSyntax ExtensionMacro, code generation patterns, testing with assertMacroExpansion.

    116 GitHub stars~844 tokensUpdated 6 mo ago
    Auto-check passed
  • Sake Testing

    kattouf/Sake

    A skill your agent uses when writing or running tests for the Sake project — unit tests, macro expansion tests, integration tests, test helpers, and CI test commands.

    116 GitHub stars~743 tokensUpdated 6 mo ago
    Auto-check passed

Works with

Categories

Questions about Sake Command Patterns

What does Sake Command Patterns do?

A skill your agent uses when writing or modifying Sake commands, CommandGroups, SakeApp files, or SakeApp/ directory code. Sake Command Patterns is an agent skill from kattouf/Sake. Use when writing or modifying Sake commands, CommandGroups, SakeApp files, or SakeApp/ directory code.

When should I use Sake Command Patterns?

Sake Command Patterns fits situations like: modifying Sake commands; sakeApp/ directory code.

How do I install Sake Command Patterns in Claude Code?

Run `npx skills add kattouf/Sake --skill sake-command-patterns -a claude-code`. Or copy the skill folder (.claude/skills/sake-command-patterns in kattouf/Sake) into .claude/skills/sake-command-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Sake Command Patterns in Codex?

Run `npx skills add kattouf/Sake --skill sake-command-patterns -a codex`. Or copy the skill folder (.claude/skills/sake-command-patterns in kattouf/Sake) into .agents/skills/sake-command-patterns in your project. Codex loads it when a task matches its description.

Can I use Sake Command Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kattouf/Sake --skill sake-command-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sake-command-patterns, .gemini/skills/sake-command-patterns, .github/skills/sake-command-patterns and .opencode/skills/sake-command-patterns in your project.

What does Sake Command Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Sake Command Patterns is instructions for the agent only.

Does Sake Command Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Sake Command Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sake Command Patterns use?

Sake Command Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sake Command Patterns use?

About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Sake Command Patterns?

Skills that share tags, products or a category with Sake Command Patterns: Composewebview Documentation (parkwoocheol/compose-webview, 103 stars), Android CLI (majiayu000/claude-skill-registry, 666 stars), Green Gate (VeryGoodOpenSource/vgv-ai-flutter-plugin, 169 stars) and Scripting Adb For CI (skydoves/android-testing-skills, 333 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sake Command Patterns?

kattouf (a GitHub user) maintains it in kattouf/Sake, which has 116 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on April 5, 2026.

Source: kattouf/Sake on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.