Documentation
¶
Overview ¶
Package sofia holds assets embedded straight into the sf binary so a Homebrew (or `go install`) build — no repo checkout on disk — can still self-install them. Currently just the sf-context skill; see internal/common/initcmd (writes it to $CLAUDE_DIR) and doctor.checkSkill (falls back to comparing against it when repoRoot() can't be found).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SkillMD []byte
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
common/cc
command
Standalone cc binary.
|
Standalone cc binary. |
|
common/changed
command
Standalone changed binary.
|
Standalone changed binary. |
|
common/code
command
Standalone code binary.
|
Standalone code binary. |
|
common/composer
command
Standalone composer binary.
|
Standalone composer binary. |
|
common/doctor
command
Standalone doctor binary.
|
Standalone doctor binary. |
|
common/github
command
Standalone github binary.
|
Standalone github binary. |
|
common/grep
command
Standalone grep binary.
|
Standalone grep binary. |
|
common/gripe
command
Standalone gripe binary.
|
Standalone gripe binary. |
|
common/packagist
command
Standalone packagist binary.
|
Standalone packagist binary. |
|
common/vue
command
Standalone vue binary.
|
Standalone vue binary. |
|
common/worktrees
command
Standalone worktrees binary.
|
Standalone worktrees binary. |
|
sf
command
|
|
|
internal
|
|
|
adapter
Package adapter is sofia's Tier-1, host-interpreted plugin mechanism: a plugin.yaml `adapter:` block declares project conventions (a root key, root markers, file extensions, and named layers with path globs), and the host — not a subprocess — turns those into project-aware `layers`/`grep`/`refs` commands grouped by layer.
|
Package adapter is sofia's Tier-1, host-interpreted plugin mechanism: a plugin.yaml `adapter:` block declares project conventions (a root key, root markers, file extensions, and named layers with path globs), and the host — not a subprocess — turns those into project-aware `layers`/`grep`/`refs` commands grouped by layer. |
|
calllog
Package calllog records every invocation of a sofia-repo tool to a shared JSON-lines log so calls can be analysed and optimised later.
|
Package calllog records every invocation of a sofia-repo tool to a shared JSON-lines log so calls can be analysed and optimised later. |
|
cc
Package cc reads Claude Code session transcripts (the JSONL files under ~/.claude/projects/<encoded-path>/<session-id>.jsonl) and turns them into compact, TOON-friendly digests.
|
Package cc reads Claude Code session transcripts (the JSONL files under ~/.claude/projects/<encoded-path>/<session-id>.jsonl) and turns them into compact, TOON-friendly digests. |
|
cli
Package cli builds the master Cobra command tree for the `sf` binary.
|
Package cli builds the master Cobra command tree for the `sf` binary. |
|
common/changed
Package changed implements `sf changed` — a compact, classified summary of a git diff: per file its status, churn (+/-), category, language, and the enclosing functions/classes touched (read from git's own hunk-header function context, no file parsing).
|
Package changed implements `sf changed` — a compact, classified summary of a git diff: per file its status, churn (+/-), category, language, and the enclosing functions/classes touched (read from git's own hunk-header function context, no file parsing). |
|
common/code
Package code implements `sf code` — a compact structural summary of source files, without function bodies, so the agent needn't cat a whole file just to see its shape/API (where read tokens go in practice).
|
Package code implements `sf code` — a compact structural summary of source files, without function bodies, so the agent needn't cat a whole file just to see its shape/API (where read tokens go in practice). |
|
common/code/gocode
Package gocode is the Go backend for `sf code`: a structural summary of a Go source file (package, imports, types, func/method signatures, consts, vars) and single-symbol slicing — via the stdlib go/parser (syntax only, no type-checking), so it works on any file regardless of whether it compiles.
|
Package gocode is the Go backend for `sf code`: a structural summary of a Go source file (package, imports, types, func/method signatures, consts, vars) and single-symbol slicing — via the stdlib go/parser (syntax only, no type-checking), so it works on any file regardless of whether it compiles. |
|
common/code/phpcode
Package phpcode is the PHP backend for `sf code`: a structural summary of a PHP file (namespace, class/interface/trait/enum, extends/implements, attributes, enum cases, constructor deps, properties, method signatures) and single-method slicing.
|
Package phpcode is the PHP backend for `sf code`: a structural summary of a PHP file (namespace, class/interface/trait/enum, extends/implements, attributes, enum cases, constructor deps, properties, method signatures) and single-method slicing. |
|
common/code/tscode
Package tscode is the TypeScript/Vue backend for `sf code`.
|
Package tscode is the TypeScript/Vue backend for `sf code`. |
|
common/composer
Package composer implements `sf composer` — compact, TOON-first views over a tree of PHP packages described by composer.json files.
|
Package composer implements `sf composer` — compact, TOON-first views over a tree of PHP packages described by composer.json files. |
|
common/doctor
Package doctor implements `sf doctor` — a one-call health check of the local sf install.
|
Package doctor implements `sf doctor` — a one-call health check of the local sf install. |
|
common/github
Package github implements `sf github ci` — a compact view of a repo's GitHub Actions runs via the `gh` CLI, with an optional `--watch` that blocks until the latest run finishes and prints only its final status (instead of gh's verbose live stream).
|
Package github implements `sf github ci` — a compact view of a repo's GitHub Actions runs via the `gh` CLI, with an optional `--watch` that blocks until the latest run finishes and prints only its final status (instead of gh's verbose live stream). |
|
common/grep
Package grep implements a generic, language-agnostic TOON-emitting search across a project tree, built on the same walker + matcher + enclosing infrastructure as this toolkit's other structural tools.
|
Package grep implements a generic, language-agnostic TOON-emitting search across a project tree, built on the same walker + matcher + enclosing infrastructure as this toolkit's other structural tools. |
|
common/gripe
Package gripe records and lists agent complaints about sf — the one failure the call log can't capture on its own: sf exited 0 but gave the wrong thing, or the agent had to fall back to cat/rg/grep because sf couldn't do what was needed.
|
Package gripe records and lists agent complaints about sf — the one failure the call log can't capture on its own: sf exited 0 but gave the wrong thing, or the agent had to fall back to cat/rg/grep because sf couldn't do what was needed. |
|
common/hook
Package hook implements Claude Code hook endpoints (`sf hook pre`).
|
Package hook implements Claude Code hook endpoints (`sf hook pre`). |
|
common/initcmd
Package initcmd implements `sf init` — one-shot per-project onboarding that wires sf up for a project's coding agents: a managed block in AGENTS.md, the sf-context skill, the PreToolUse hook, and MCP server registration — for both Claude Code and Codex CLI, each gated on its own detection.
|
Package initcmd implements `sf init` — one-shot per-project onboarding that wires sf up for a project's coding agents: a managed block in AGENTS.md, the sf-context skill, the PreToolUse hook, and MCP server registration — for both Claude Code and Codex CLI, each gated on its own detection. |
|
common/packagist
Package packagist implements `sf packagist status` — per-package release health for a tree of PHP packages: the latest local git tag vs whether that tag is pushed to origin vs the latest version published on Packagist.
|
Package packagist implements `sf packagist status` — per-package release health for a tree of PHP packages: the latest local git tag vs whether that tag is pushed to origin vs the latest version published on Packagist. |
|
common/refs
Package refs answers "who defines/uses this symbol across the tree" in one call: a deterministic, word-boundary-matched scan (built on the same walker + matcher infrastructure as internal/common/grep) that labels every hit with its enclosing function/type — the def/use fan `sf grep <symbol>` plus opening each caller by hand would otherwise take.
|
Package refs answers "who defines/uses this symbol across the tree" in one call: a deterministic, word-boundary-matched scan (built on the same walker + matcher infrastructure as internal/common/grep) that labels every hit with its enclosing function/type — the def/use fan `sf grep <symbol>` plus opening each caller by hand would otherwise take. |
|
common/vue
Package vue implements `sf vue` — helpers over a Vue frontend.
|
Package vue implements `sf vue` — helpers over a Vue frontend. |
|
common/worktrees
Package worktrees implements `sf worktrees` — a read-only, cross-project view of git-worktree dev forks under a configured parent directory (see DefaultWww).
|
Package worktrees implements `sf worktrees` — a read-only, cross-project view of git-worktree dev forks under a configured parent directory (see DefaultWww). |
|
dedup
Package dedup implements a per-session dedup stub for token-heavy sofia tools: a repeated, byte-identical call within a short window of the same session returns a one-line stub ("already returned in call #N; --force to repeat") instead of paying for the full output again.
|
Package dedup implements a per-session dedup stub for token-heavy sofia tools: a repeated, byte-identical call within a short window of the same session returns a one-line stub ("already returned in call #N; --force to repeat") instead of paying for the full output again. |
|
envfile
Package envfile loads .env-style files, prompts interactively for missing required values, and writes them back.
|
Package envfile loads .env-style files, prompts interactively for missing required values, and writes them back. |
|
gitclone
Package gitclone is the first git-clone plumbing in this repo: a small shallow-clone helper for `sf plugin install <git-url>` (and, later, `sf pack install`).
|
Package gitclone is the first git-clone plumbing in this repo: a small shallow-clone helper for `sf plugin install <git-url>` (and, later, `sf pack install`). |
|
gitexec
Package gitexec is the one place in the repo that shells out to `git`.
|
Package gitexec is the one place in the repo that shells out to `git`. |
|
history
Package history reads the sofia call log and surfaces invocation history.
|
Package history reads the sofia call log and surfaces invocation history. |
|
launch
Package launch implements `sf claude` — a thin, generic launcher that starts the `claude` CLI for a project.
|
Package launch implements `sf claude` — a thin, generic launcher that starts the `claude` CLI for a project. |
|
mcpserver
Package mcpserver exposes sofia's public-safe Context Providers to LLM coding agents over the Model Context Protocol (MCP), on the stdio transport.
|
Package mcpserver exposes sofia's public-safe Context Providers to LLM coding agents over the Model Context Protocol (MCP), on the stdio transport. |
|
pack
Package pack implements sf's pack-authoring contract: a pack is a git repository or local directory holding a pack.yaml manifest plus the artifacts it bundles.
|
Package pack implements sf's pack-authoring contract: a pack is a git repository or local directory holding a pack.yaml manifest plus the artifacts it bundles. |
|
plugin
Package plugin implements sofia's subprocess-first plugin protocol: the host-side mechanics that let a third-party executable extend the `sf` command tree without being compiled into the binary.
|
Package plugin implements sofia's subprocess-first plugin protocol: the host-side mechanics that let a third-party executable extend the `sf` command tree without being compiled into the binary. |
|
version
Package version holds the sf release version so both the CLI (`sf --version`) and `sf doctor` report the same string without an import cycle between internal/cli and internal/common/doctor.
|
Package version holds the sf release version so both the CLI (`sf --version`) and `sf doctor` report the same string without an import cycle between internal/cli and internal/common/doctor. |
|
pkg
|
|
|
cliflags
Package cliflags holds tiny, dependency-free Cobra flag helpers shared by every tool in the repo (format aliases, etc.).
|
Package cliflags holds tiny, dependency-free Cobra flag helpers shared by every tool in the repo (format aliases, etc.). |
|
codectx
Package codectx extracts surrounding-scope context from source files without depending on a full AST.
|
Package codectx extracts surrounding-scope context from source files without depending on a full AST. |
|
emit
Package emit enforces the core invariant of every token-saving sofia tool: a tool that stands in for a standard command (cat, grep, …) must never cost MORE tokens than that command would.
|
Package emit enforces the core invariant of every token-saving sofia tool: a tool that stands in for a standard command (cat, grep, …) must never cost MORE tokens than that command would. |
|
matcher
Package matcher scans a file line-by-line for occurrences of one or more patterns, returning hits with line/column information.
|
Package matcher scans a file line-by-line for occurrences of one or more patterns, returning hits with line/column information. |
|
php
Package php reads a PHP source file and returns a structured summary of the first class/interface/trait/enum declaration it finds: namespace, FQCN, modifiers, parent/implements, public methods, constructor dependencies, and the docblock summary.
|
Package php reads a PHP source file and returns a structured summary of the first class/interface/trait/enum declaration it finds: namespace, FQCN, modifiers, parent/implements, public methods, constructor dependencies, and the docblock summary. |
|
strdist
Package strdist provides small string-distance helpers for typo-tolerant CLI suggestions ("did you mean X?").
|
Package strdist provides small string-distance helpers for typo-tolerant CLI suggestions ("did you mean X?"). |
|
tokens
Package tokens estimates how many LLM tokens a given string costs.
|
Package tokens estimates how many LLM tokens a given string costs. |
|
toon
Package toon implements low-level helpers for the TOON (Token-Oriented Object Notation) text format.
|
Package toon implements low-level helpers for the TOON (Token-Oriented Object Notation) text format. |
|
walker
Package walker enumerates files in a directory tree, applying include/exclude rules.
|
Package walker enumerates files in a directory tree, applying include/exclude rules. |
Click to show internal directories.
Click to hide internal directories.