/scout:scoutfrom scout
Plans and runs multi-metric repository measurements using the `scout` CLI across git history. Handles cross-cutting requests like dashboards, migration tracking, and CI setup. Delegates single-axis questions to sub-skills.
Ships in scout. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
scout measures a repository and replays that measurement over any commits in its history. Five metric subcommands, each with its own skill.
Before the first real command, run scout --help, then scout <subcommand> --help.
Flag names, defaults and the subcommand list live in the help and nowhere else. The help ships with the binary; this skill ships separately and lags behind it — where they disagree, the help is right. A newly discovered fact about the CLI belongs in the help too, not in this skill.
This skill carries only what the help does not: config file shapes, output JSON shapes, cross-commit behaviour and footguns.
Once any of these skills is in play, run every historical measurement through scout. Don't hand-roll for c in $(git log --format=%H); do git checkout "$c"; grep -rc …; done. Scout already does one checkout per unique commit, optional clean/LFS/submodule repair, and rewrites --output after every commit so an interrupted run still leaves usable data. A hand-rolled loop reintroduces all of that, badly.
If scout genuinely can't measure what's asked — say so and stop. The acceptable downstream tools are jq over the --output JSON and ordinary shell.
| User intent | Sub-skill |
|---|---|
Types by inheritance — UIView, UIViewController, SwiftUI View, XCTestCase, own base classes | scout-types |
Files by extension — storyboards, xibs, .swift, assets | scout-files |
Literal or regex occurrences in sources — imports, // TODO:, try!, API usage | scout-pattern |
| Lines of code by language and path | scout-loc |
Xcode build settings per target — SWIFT_VERSION, deployment target, strict concurrency | scout-build-settings |
| Migration progress ("UIKit → SwiftUI", "XCTest → Swift Testing") | scout-types + scout-pattern, one run each |
Combined questions ("how did the app grow while UIKit shrank?") pull recipes from each sub-skill and merge the JSON with jq.
--help--output is a JSON array with one entry per analyzed commit:
[
{ "commit": "abc1234def5678", "date": "2025-01-15T07:30:00Z", "results": [] }
]
date is the commit date in UTC ISO 8601. The shape of results items differs per subcommand — see the sub-skill. build-settings adds a projects field alongside results.
Paths inside results are not uniform: types and pattern give repository-relative paths, while files and build-settings give absolute ones. Normalize before joining data from two subcommands.
Without --output the numbers only reach the log. Always pass --output when you intend to read the data back.
The file is rewritten after every commit, not once at the end — a killed run keeps every commit it finished.
Each subcommand looks for its own dotfile in the current working directory when --config is absent: .scout-types.json, .scout-files.json, .scout-pattern.json, .scout-loc.json, .scout-build-settings.json. It resolves against the CWD, not --repo-path, so running from inside a repository that ships one silently changes what gets measured. If a result looks unlike what you asked for, check for that file first.
Positional arguments and flags override the config file. scout types UIView --config types.json analyzes UIView only, whatever metrics the config lists.
--commits applies the same commits to every metric. Different commits per metric need a config file:
{
"metrics": [
{ "type": "UIView", "commits": ["abc123", "def456"] },
{ "type": "XCTestCase" },
{ "type": "NSObject", "commits": [] }
]
}
Omitted commits means HEAD; an empty array skips the metric. A run where every metric is at HEAD reads the working tree as is — no checkout, no clean, uncommitted changes counted; one explicit commit anywhere makes the whole run check out every commit, HEAD included. --commits on the command line overrides all of them — except [], which still skips: the skip is checked before the override.
Every subcommand also accepts a git object in its config — repoPath, clean, fixLFS, initializeSubmodules — mirroring --repo-path, --git-clean, --fix-lfs, --initialize-submodules.
--commits, --include and --exclude keep consuming words until the next flag, so anything positional written after them is swallowed. scout build-settings --include "**/*.xcodeproj" SWIFT_VERSION treats SWIFT_VERSION as a glob and runs zero metrics — it logs Will analyze 0 commit(s) for 0 metric(s), exits 0 and writes no output file. Write the positionals first: scout build-settings SWIFT_VERSION --include "**/*.xcodeproj".
Scout doesn't sort them — it walks the metrics and keeps each commit at its first appearance. Pass them oldest-first when building a time series, and pass full hashes from git log.
--git-clean deletes your config and outputgit clean -ffdx removes untracked and ignored files under --repo-path. A config or output file sitting inside the repository disappears mid-run. Keep both outside: /tmp, or $RUNNER_TEMP on GitHub Actions.
With explicit commits, scout checks out commits in the working tree and never restores the original branch — after a historical run the repo sits in detached HEAD. --fix-lfs additionally creates local commits (never pushed).
So: run history analysis against a throwaway clone or a dedicated git worktree, not the checkout someone is working in. If you do use a live checkout, git -C <repo> checkout - afterwards and say so.
When GITHUB_STEP_SUMMARY is set, each run appends a markdown table of its results to the job summary. Nothing to enable.
If scout is not on $PATH, suggest:
mise use github:dodobrands/scout
Do not suggest swift run scout … — that's the contributor flow, not the user flow.
Extra requirements by subcommand: loc needs cloc on $PATH; build-settings needs xcodebuild and is macOS only; types resolves base classes from the Xcode SDK on macOS and degrades to source-only analysis on Linux.
scout types UIViewController View --repo-path ~/Developer/myapp --output /tmp/types.json
Without commits, scout reads the files as they are — uncommitted changes included — and changes nothing in git: no checkout, no clean, the branch stays put. git.clean and friends in a config are ignored with a warning. This holds only while every commit is the literal HEAD: one explicit commit anywhere, including a hash that equals HEAD, switches the whole run to checkouts and applies the git options. Prefer this to a historical run whenever the question is about the code as it is now, and run it in someone's live checkout without asking — except build-settings with setupCommands, which run in that tree and can change files.
REPO=~/Developer/myapp
OUT=/tmp/scout
mkdir -p "$OUT"
commits=$(git -C "$REPO" log --reverse --format='%H %cI' \
| awk '{ month = substr($2, 1, 7); if (month != seen) { print $1; seen = month } }')
scout types UIViewController View \
--repo-path "$REPO" \
--commits $commits \
--output "$OUT/types.json"
awk keeps the first commit of each calendar month. Feed the same $commits to every subcommand so the series line up on identical hashes.
jq -r '.[] | .date as $d | .results[] | [$d, .typeName, (.types | length)] | @csv' \
/tmp/scout/types.json
results items differ per subcommand — swap .typeName / .types | length for the fields the sub-skill documents.
Each subcommand is a separate process and a separate checkout loop, so a five-metric report costs five passes over history. Cut it down by putting every metric of one kind into one config file (one scout run analyzes all of them per checkout) rather than running the subcommand once per metric.
scout <subcommand> --help. Subcommands share most flags but not all (--extensions is pattern only, --include/--exclude match directory-name suffixes in loc and .xcodeproj globs in build-settings).--config or --output inside the analyzed repository when --git-clean is on.grep/find over git checkout when a subcommand covers it.loc without --include, a positional eaten by --include, a metric skipped by commits: [], a commit that errored and came back with empty results. Sanity-check the first number of any new metric before building a series on it.swift run scout … to users — that's for contributors to this repo.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub dodobrands/scout --plugin scout6 skills in this plugin
/scout-build-settingsExtract Xcode build settings per target with `scout build-settings`. Trigger when the question is about project configuration rather than source code, e.g. "which Swift version do our targets build with?", "what is our minimum iOS deployment target?", "which modules still have strict concurrency off?", "when did we move to Swift 6?", "show SWIFT_VERSION per target across the last year". Discovers `.xcodeproj` files by glob and can run setup commands first, so Tuist and XcodeGen projects work too. macOS only./scout-filesCount files by extension with `scout files` and replay that count over git history. Use it whenever the answer is a per-extension inventory or how one moved over time — "сколько сторибордов было год назад и сколько сейчас", "how many yml files were in .github a year ago versus now", "how did the markdown file count change per quarter", "file counts for swift, storyboard and xib at these three commits", "a burn-down of our graphql files across the last 12 months as data I can chart", "export swift/storyboard/xib counts as json every month for Grafana", "an inventory of every .sh file with its path", "track the disappearance of our .nib files, one point per quarter". Any extension counts, not only iOS ones. A bare count in the current checkout is a job for find; this skill earns its place when the question spans commits, needs the paths, or has to produce data that lines up with the other scout metrics. It counts files, never their size on disk./scout-locCount lines of code with `scout loc`, a `cloc` wrapper that can replay the count over git history. Trigger when the question is about size rather than count, e.g. "how many lines of Swift do we have?", "how did the codebase grow over two years?", "lines of code per module", "how much Objective-C is left in the legacy module?", "app code versus test code". Takes several languages per metric plus directory include/exclude filters./scout-patternCount lines matching a literal string or a regex in source files with `scout pattern`, in the current working tree or replayed over git history. Trigger when the question is about text in the code and how much of it there is, or how that amount moved over time, e.g. "how many files import UIKit?", "count our TODOs", "how many force unwraps are left?", "count @MainActor month by month since we adopted concurrency", "track the move from XCTest to Swift Testing", "where do we still use DispatchQueue.main?", "how many print statements ship in the app?", "how many hardcoded http links do we have?". Prefer it over a hand-rolled grep, especially once more than one commit is involved. One entry per matching line, with file and line number./scout-typesCount Swift types by inheritance with `scout types`. Trigger when the question is about how many types derive from a base, e.g. "how many UIViewControllers do we have?", "list every SwiftUI View in this repo", "how many XCTestCase subclasses are left?", "list every subclass of our BaseViewModel with its file path", "how many types inherit from UseCase<*>, where the generic parameter varies?", "count our BaseCoordinator subclasses", "track adoption of our new Repository<*> base class across commits since january", "did UIKit screens shrink over the last year?", "which files declare UIView subclasses?". Resolves inheritance through the source and through the Xcode SDK, so `UICollectionViewCell` subclasses count as `UIView`.Other plugins' skills for the same job