AGENT SKILL

context-pack

Build a task-aware context bundle (relevant code + applicable standards + related past decisions) via the local RAG index, capped at a token budget. Use at the start of any implementation/refactor/debug task instead of reading files blindly. Replaces "read whole file" with "retrieve the function + callers + rules + prior ADR."

适用职业开发工程师
License 许可
MIT
最近更新
2026-11-14
Stars
★ 1
Forks
1

01 前言 Front Matter

name
context-pack
type
skill
description
Build a task-aware context bundle (relevant code + applicable standards + related past decisions) via the local RAG index, capped at a token budget. Use at the start of any implementation/refactor/debug task instead of reading files blindly. Replaces "read whole file" with "retrieve the function + callers + rules + prior ADR."

03 SKILL.md 正文

context-pack

Compresses a whole-codebase-style context into the chunks that actually matter for this task.

When to use

  • Start of plan, pr-flow, code-review, ship, bug fix, refactor.
  • Before touching an unfamiliar file: ask pack for "relevant code" around the target symbol.
  • When user asks "how does X work" across a large repo.

When NOT to use

  • You already have the exact file path and know what you need → Read directly.
  • Exact string search → Grep.
  • Symbol-level navigation in the current repo → Serena.

Usage

~/.claude/rag-index/venv/bin/python ~/.claude/rag-index/pack.py "<task description>" [options]

Options:

  • --files path1 path2 … — explicit paths the task will touch.
  • --diff — auto-populate --files from git diff --name-only.
  • --budget N — token budget (default 4 000; chars/4 heuristic).
  • --cwd <path> — override working dir for repo auto-scoping.

Always pipe the output back into context:

pack.py "fix send_discord retry logic" --diff --budget 3500

What the bundle contains

Four sections in priority order, each capped per-chunk so the budget stays honest:

  1. Relevant code — top-6 symbol-level code chunks (cwd auto-scopes to the current repo).
  2. Applicable standards — top-3 sliced rules from ~/.claude/standards/*.md matching the task.
  3. Past decisions / memory — top-4 chunks from memory, plans, and handoffs (cross-repo).
  4. Explicit files — if --files given, best chunks for each; falls back to first 40 lines when no match exists in the index.

Output format

# Context pack for: <task>

_Budget: 4000 tokens · remaining ≈ N_

## Relevant code

### code/Lucky::setupInternalNotifyRoutes `packages/backend/src/routes/internalNotify.ts:23-28` (cos=0.57 bm=12.9)

```...chunk...
### ...

## Applicable standards
### standards  `~/.claude/standards/security.md:1-5`  ...

## Past decisions / memory
### plans  `~/.claude/plans/my-project-planning.md:40-60`  ...
```

Integration points

  • plan skill runs pack first; plan-drafting sees only the pack output + user prompt, not the whole repo.
  • pr-flow / ship runs with --diff to pull in context for the changed files.
  • code-review pipes the PR's file list and diff summary in.

Eval baseline

Retrieval layer is measured via ~/.claude/rag-index/eval/run.py (MRR + Hit@K). The canonical 20-query rerank-on baseline is MRR 0.72 · Hit@3 0.80 · Hit@5 0.80; the expanded 30-query baseline is MRR 0.62 · Hit@3 0.63 · Hit@5 0.67. Compare against the matching dataset version.

Rebuild triggers

  • PostToolUse hook reindexes single files on Write/Edit.
  • Full rebuild: ~/.claude/rag-index/venv/bin/python ~/.claude/rag-index/build.py (~50 s).

04 同仓库更多 Skills

LucasSantana-Dev
LucasSantana-Dev/forgekit

token-audit

Audit historical Claude Code token usage from JSONL session files — shows total spend, cache hit rates, top costly sessions, weekly trends, and where tokens are going. Run after heavy sessions or weekly to measure optimization impact. Answers how many tokens a session used, how expensive was that session, session cost, and token usage report.

开发工程师
★ 1
LucasSantana-Dev
LucasSantana-Dev/forgekit

smart-model-route

Auto-classify prompt complexity via Haiku (with heuristic fallback) and inject model routing hints for Agent tool calls. Wired as a UserPromptSubmit hook — fires on every prompt, routes low tasks to Haiku, standard to Sonnet, complex to Sonnet with thorough reasoning, and critical (security/arch/migrations) to Opus. Handles model selection, for example choose model by task complexity.

Skill与智能体开发
★ 1
LucasSantana-Dev
LucasSantana-Dev/forgekit

smart-commands

Decision guide for when to proactively use Claude Code slash commands — /think, /model, /compact, /clear. Use when choosing whether to invoke a command before or during a task, or when a complexity-classifier hook has flagged a task as high or critical. Pairs with the complexity-classifier UserPromptSubmit hook. Answers when to compact, should I switch models, and whether to use extended thinking. Use to pick the right /model command and switch model.

开发工程师
★ 1
LucasSantana-Dev
LucasSantana-Dev/forgekit

spec-ship

暂无简介

★ 1
LucasSantana-Dev
LucasSantana-Dev/forgekit

spec-new

Create a committed per-feature spec under `docs/specs/YYYY-MM-DD-<slug>/{spec,tasks}.md` with frontmatter (status, created, owner, pr, tags). Promotes an ephemeral `.claude/plans/<name>.md` into a persistent, searchable artifact. Use when starting a feature that's larger than a one-shot PR.

★ 1
LucasSantana-Dev
LucasSantana-Dev/forgekit

roadmap-refresh

Regenerate `docs/roadmap.md` for a repo from all specs under `docs/specs/` + their frontmatter (status, tags, pr). Produces Now/Next/Recently-shipped sections. Run after creating / shipping a spec, or at the start of a new session for orientation.

产品经理
★ 1