Skip to content

feat: installable agent skill for coding agents#25

Merged
joce merged 6 commits into
mainfrom
agent-skills
Jul 7, 2026
Merged

feat: installable agent skill for coding agents#25
joce merged 6 commits into
mainfrom
agent-skills

Conversation

@joce

@joce joce commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Ships an Agent Skills–standard skill teaching coding agents fredq's library and CLI, plus a fredq skills {install,uninstall,list} CLI group to install it.

  • Content (src/fredq/skills/content/): a SKILL.md router plus four task-oriented domains — observations (fetching series data: windows, units transforms, frequency aggregation, missing values), revisions (ALFRED: realtime windows, vintage dates, revision analysis), catalog (search, category tree, releases, sources, tags), dataframes (Frame vocabulary, the pandas extra, parquet, joining mixed frequencies). Each domain carries a SHARP-EDGES.md of corpus- and dogfood-dated pitfalls (12 total), e.g.: revision cadence varies wildly by series (RSAFS/INDPRO heavy churn, PAYEMS prior-2-months, GDP estimate-rounds only, UNRATE/CPIAUCSL annual-only — live-measured 2026-07-07); inner joins across vintages silently drop new-in-newer-vintage rows; UNRATE for month M publishes early in M+1 (look-ahead risk); FRED's "." missing-value sentinel decodes to None, never NaN; empty results are a valid response shape, not an error; an unknown tag name is a 400, not an empty result; every 400 surfaces as one FredApiError shape by design (no NotFoundError); geofred was removed in 0.4.0 and agents with stale training data may still reach for it.
  • Installer (src/fredq/skills/_install.py): copy-only install/uninstall/status against a documented table of six agents' skill-discovery roots — claude, codex, copilot, cursor, gemini, pi — at both user and project scope. Installs stamp the installing fredq version into SKILL.md's frontmatter; list/status reports each location as current/stale/absent by reading that stamp back. Ownership is checked by frontmatter name: before any overwrite or removal, so a directory fredq didn't create is never touched.
  • CLI (fredq skills install|uninstall|list): --agent NAME[,NAME...] for named targets, --project for repo-relative roots instead of user-level ones, --to PATH as an escape hatch. Dispatches before any FRED client construction — fredq skills list works with no API key. README "Agent skill" section and CHANGELOG entries added.

This ports yoghurt PR #25's reviewed installer/CLI design (squash 5187bcb) near-verbatim; the skill content and sharp edges are authored fresh from fredq's own corpus and dogfooding.

Gates

  • Content gates (tests/test_skill_content.py): frontmatter name == fredq + description ≤1024 chars, exact tree shape, every domain linked from SKILL.md, relative links resolve, SHARP-EDGES.md fixed shape (Severity + Evidence lines per entry), and — the important one — every fenced Python snippet across the skill is extracted verbatim and executed offline against corpus fixtures via fredq's existing _core._get_client monkeypatch seam, so a snippet that doesn't actually run can't ship.
  • Installer gates (tests/test_skills_install.py): the six agent paths are pinned against the documented table (not name-derived), version stamping, ownership refusal, and that a refused target never blocks the rest of a batch install.
  • CLI gates (tests/test_cli_skills.py): exit codes, --agent CSV usage-error semantics (empty item = usage error, matching fredq's existing CSV convention), output line formats, and that no FredClient is ever constructed for any skills subcommand.
  • Packaging (tests/test_packaging.py, extended in this PR): the built wheel is asserted to contain fredq/skills/content/SKILL.md, fredq/skills/content/observations/README.md, and fredq/skills/_install.py.
  • Test totals: 34 content + 25 installer + 23 CLI = 82 new tests, plus 1 new packaging assertion. Suite: 481 → 564 passed (3 skipped, pre-existing/platform-conditional), all green.
  • Full local gate run: ruff check, ruff format --check, black --check, pyright (0 errors), pytest -q, npx cspell . --no-gitignore (0 issues) all clean. Live round-trip smoke: fredq skills install --to <tmp> writes a version-stamped SKILL.md + 4 domains to disk, fredq skills list reports every named target, fredq skills uninstall --to <tmp> removes the installed directory — verified on disk at each step.

🤖 Generated with Claude Code

joce added 6 commits July 7, 2026 16:55
SKILL.md router plus four markdown domains (observations, revisions,
catalog, dataframes), each README patterns + SHARP-EDGES with dated,
evidence-tagged pitfalls from the corpus and live dogfooding, gated by
tests/test_skill_content.py (structure, links, and behavioral pinning of
every python snippet against corpus fixtures).
Copy-only installer for the agent skill: resolve_roots/install/uninstall/
status over documented per-agent skill-discovery roots (claude, codex,
copilot, cursor, gemini, pi; user and project scopes), ownership-checked
via the SKILL.md frontmatter name so a directory fredq does not own is
never replaced or removed, and version-stamped at install time (surfaced
as current/stale by status()). Ported from yoghurt's reviewed
implementation.
fredq skills install/uninstall/list with --agent (comma-separable named
targets), --project scope, and --to PATH; dispatches before client
construction so it works with no API key; human-readable output carved
out of the raw-JSON contract in AGENTS.md as packaging/installer surface.
Extend the existing wheel-membership gate so a wheel that silently drops
the agent skill (SKILL.md, a domain doc, or the installer module) fails
this test instead of shipping broken.
Add a README "Agent skill" section (right after Install) covering
`fredq skills install/list/uninstall`, named agent targets, --project/--to,
and the copy-only/ownership-safe install model; add the matching CHANGELOG
Added entries under Unreleased.
@joce
joce merged commit 91a96e3 into main Jul 7, 2026
16 checks passed
@joce
joce deleted the agent-skills branch July 7, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant