context-surfing
Monitors context window health throughout a session and rides peak context quality for maximum output fidelity. Activates automatically after plan-interview and intent-framed-agent. Stays active through execution and hands off cleanly to simplify-and-harden and self-improvement when the wave completes naturally or exits via handoff. Use this skill whenever a multi-step agent task is underway and session continuity or context drift is a concern. Especially important for long-running tasks, complex refactors, or any work where degraded context would silently corrupt the output. Trigger even if the user doesn't say "context surfing" — if an agent task is running across multiple steps with intent and a plan already established, this skill is live.
What this skill does
# Context Surfing ## Install ```bash gh skill install pskoett/pskoett-skills context-surfing ``` Fallback using the Agent Skills CLI: ```bash npx skills add pskoett/pskoett-skills/skills/context-surfing ``` The agent rides the wave of peak context. When the wave crests, it commits. When it detects drift, it pulls out cleanly — saving state, handing off, and letting the next session catch the next wave. No wipeouts. No zombie sessions. Only intentional, high-fidelity execution. --- ## Mental Model Think of context like an ocean wave: - **Paddling in** = loading the intent frame, plan, and initial context. Energy is building. - **The peak** = full context coherence. The agent knows exactly what it's doing and why. This is when to execute. - **The shoulder** = context starting to flatten. Still rideable, but output density is dropping. - **The close-out** = drift. Contradiction, hedging, second-guessing, or hallucinated details. Wipe-out territory. The skill's job: ride as long as the wave is good, exit before it closes out. --- ## Lifecycle Position ``` [plan-interview] → [intent-framed-agent] → [context-surfing ACTIVE] → [simplify-and-harden] → [self-improvement] ``` Context Surfing is the execution layer. It wraps all work between intent capture and post-completion review. Simplify-and-harden and self-improvement are the next steps in the pipeline — they run after context-surfing completes, not as conditions that end it. ### Relationship with intent-framed-agent Both skills are live during execution. They monitor different failure modes: - **intent-framed-agent** monitors *scope* drift — am I doing the right thing? It fires structured Intent Checks when work moves outside the stated outcome. - **context-surfing** monitors *context quality* drift — am I still capable of doing it well? It fires when the agent's own coherence degrades (hallucination, contradiction, hedging). They are complementary, not redundant. An agent can be perfectly on-scope while its context quality degrades (e.g., it's doing the right thing but starting to hallucinate details). Conversely, scope drift can happen with perfect context quality (the agent deliberately chases a tangent). Intent-framed-agent's Intent Checks continue firing alongside context-surfing's wave monitoring. **Precedence rule:** If both skills fire simultaneously (an Intent Check and a drift exit at the same time), context-surfing's exit takes precedence. Degraded context makes scope checks unreliable — resolve the context issue first, then resume scope monitoring in the next session. **Cadence separation:** Intent checks fire at scope boundaries — *"before touching a new area/file, before starting a new logical work unit, when current action feels tangential"* (`intent-framed-agent/SKILL.md`). Context-surfing's pre-commit anchor check fires at side-effecting-action moments — specific tool calls, writes, commits, commit-level output. Don't run both in the same beat: if an Intent Check has just fired and resolved cleanly, the next side-effecting action inside that same work unit doesn't need a fresh anchor check — you already re-grounded. ### When to Use the Full Pipeline Not every task needs all five skills. Match pipeline depth to task complexity: | Task Type | Skills to Use | |-----------|---------------| | Trivial (rename, typo fix) | None — just do it | | Small (isolated bug fix, single-file change) | `simplify-and-harden` only | | Medium (feature in known area, multi-file) | `intent-framed-agent` + `simplify-and-harden` | | Large (complex refactor, new architecture, unfamiliar codebase) | Full pipeline | | Long-running (multi-session, high context pressure) | Full pipeline with `context-surfing` as the critical skill | When in doubt, start light. Add skills if you notice drift or quality issues mid-task. --- ## Activation This skill is live the moment the intent frame and plan are established. No explicit invocation needed. At activation, load whatever anchors are available: 1. The intent frame (from intent-framed-agent output) — if available 2. The plan (from plan-interview output) — if available 3. The current session state from the Entire CLI (if available) 4. All project context files (see below) If neither an intent frame nor a plan exists (standalone mode), use the user's original task description combined with project context files as the wave anchor. This is sufficient — the skill degrades gracefully, not catastrophically. ### Entire CLI Integration Entire CLI ([github.com/entireio/cli](https://github.com/entireio/cli)) provides persistent session state that serves as external ground truth for drift checks and handoff files. At activation, detect Entire: ```bash entire status 2>/dev/null ``` - If it succeeds, Entire captures the session passively via hooks — every prompt, tool call, file modification, and checkpoint is recorded to the shadow branch. You don't need to call Entire directly; the harness handles it. Use `entire status` and `entire explain --session <id>` to read back session state when needed. - If unavailable or failing, continue without it. Use the intent frame and plan file as the wave anchor instead. Track progress via structured comments in your output rather than Entire CLI commands. Do not block execution and do not nag about installation. The **wave anchor** is not held mentally. It is built from whatever external, persistent artifacts are available — every drift check reads from them directly, never from reconstructed memory. ### Handoffs become learning signals When context-surfing writes a handoff file on drift exit, that handoff is also captured in the Entire session transcript (via the `Stop` / `SessionEnd` hooks). At cadence, `learning-aggregator --deep` reads those transcripts and extracts: - Which drift signals most commonly trigger handoffs → potential session design issues - How many sessions hit drift exit vs completed cleanly → session health baseline - What context artifacts were missing when drift occurred → promotion candidates for project instruction files Structured handoff files (`.context-surfing/handoff-<slug>-<timestamp>.md`) with predictable section headers make this parseable. You don't need to do anything special — just keep the handoff format consistent. - **Full pipeline:** intent frame + plan file + Entire CLI session state - **Partial pipeline:** whichever of intent frame or plan exists, plus project context files - **Standalone:** the user's original task description + project context files (CLAUDE.md, AGENTS.md, README.md, etc.) The anchor is weaker in standalone mode — fewer artifacts to cross-check against — but it is always present. A weak anchor is better than no anchor. --- ## Project Context Files Before executing anything, scan the project for `.md` files that carry standing context. These are not documentation to skim — they are constraints, decisions, and architectural truth that must stay in the wave at all times. ### Always load at activation - `CLAUDE.md` — agent configuration, conventions, constraints - `AGENTS.md` — multi-agent setup, role definitions - `README.md` — project intent and structure - Any `.md` in the project root ### Load on demand (when relevant to the current task) - `.md` files in `skills/`, `docs/`, `.learnings/`, or similar directories - `SKILL.md` files for any skill being invoked alongside this one ### Rules for context files 1. **They are always part of the wave anchor.** If output contradicts a project `.md` file, that is a drift signal — treat it as a strong one. 2. **Re-read them if the task changes domain or scope.** Don't assume you remembered correctly 20 steps in. 3. **Include their key constraints in the handoff file.** The next session needs to reload them too — note which files were active and whether any were updated during the session. 4. **If a `.md` file is modified during the session**, flag it explicitly in the handoff under a "Modified Context
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.