/tbsheff-skills:typed-call-stack-planningfrom tbsheff-skills
Creates executable implementation plans for multi-file code changes using typed pseudocode, boundary maps, current/target call stacks, explicit non-goals, tests, and live handoffs. Use before implementing features/refactors where design seams, interfaces, adapters, or call flow matter.
Ships in tbsheff-skills. 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.
Use this skill to turn an implementation request into durable, executable context before and during coding.
The plan should look more like typed pseudocode than prose. Prefer contracts, interfaces, function signatures, composition maps, and call stacks over vague paragraphs. The goal is for a fresh agent or engineer to know exactly what to edit, why each boundary exists, and which runtime path proves the work is complete.
Use this skill when any of these are true:
For a one-line or obviously local edit, keep the planning lightweight: write a tiny target stack and proceed.
Prefer durable repo-local context files when the task is not trivial:
llm/context/<YYYY-MM-DD>-<slug>-plan.md
llm/context/<YYYY-MM-DD>-<slug>-handoff.md
If the repository already uses a different convention, follow the existing convention.
Before writing the plan, inspect enough code to identify:
AGENTS.md, existing context files, README files, or nearby docs.When something is not yet known, write Unknown and list the exact file or command needed to resolve it. Do not invent facts.
Use the project language when possible. For TypeScript, use interfaces/types. For Rust, use traits/enums/structs. For Go, use interfaces/structs. For Python, use Protocols/dataclasses/TypedDicts when helpful.
Use this plan shape:
# Plan: <task>
## Goal
<One short paragraph describing the user-visible outcome.>
## Non-goals
- <Behavior/refactor explicitly out of scope.>
- <Files/layers not to touch unless the plan changes.>
- Do not add functionality not listed in this plan.
## Current state
- `<file>`: <what exists now>
- `<function/type>`: <current responsibility>
- Constraint: <known constraint from code/docs/user>
## Target contracts
```ts
// Pseudocode. Adapt this to the project language.
interface ExampleInput {
/* fields that matter at the boundary */
}
interface ExampleOutput {
/* result shape expected by callers */
}
type BoundaryResult =
| { ok: true; value: ExampleOutput }
| { ok: false; error: KnownError };
interface BoundaryPort {
execute(input: ExampleInput): Promise<BoundaryResult>;
}
```
## Boundary / composition map
```text
[entrypoint] <CLI / route / job / event handler>
-> [adapter] <config/env/request parsing>
-> [domain] <pure decision or orchestration>
-> [io] <filesystem/process/network/db>
-> [reporting] <response/result formatting>
```
## Current call stack
```text
[entrypoint] file:function()
-> [adapter] file:function()
-> [domain] file:function()
-> [io] file:function()
```
## Target call stack
```text
[entrypoint] file:function()
-> [adapter] file:function()
-> [domain] file:newOrChangedFunction()
-> [branch]
-> [io] file:happyPathFunction()
-> [fallback] file:fallbackFunction()
-> [reporting] file:function()
```
## Error / fallback stacks
```text
[failure condition]
[entrypoint] file:function()
-> [domain] file:function()
-> [error] file:normalizeKnownFailure()
-> [reporting] file:formatFailureForCaller()
```
## Implementation steps
1. `<file>`
- Change: <specific edit>
- Boundary touched: <entrypoint | adapter | domain | io | reporting | test>
- Acceptance check: <how to know this step works>
2. `<file>`
- Change: <specific edit>
- Boundary touched: <...>
- Acceptance check: <...>
## Tests / checks
```bash
<repo-specific command>
```
## Completion criteria
- [ ] Target contracts exist or their equivalent is implemented.
- [ ] Target happy-path call stack is implemented.
- [ ] Target error/fallback stacks are implemented or explicitly not applicable.
- [ ] Boundaries match the boundary map.
- [ ] Tests/checks pass, or failures are documented with exact output.
- [ ] No extra functionality was added.
For each important flow, include the current stack and the target stack when possible.
Call stack rules:
[entrypoint], [adapter], [domain], [io], [reporting], [test], [error], or [fallback].Example:
Happy path:
[entrypoint] packages/cli/src/run.ts:run()
-> [adapter] packages/cli/src/config.ts:readProjectConfig()
-> [domain] packages/core/src/plan.ts:createExecutionPlan()
-> [io] packages/core/src/process.ts:executeLocalProcess()
-> [reporting] packages/cli/src/output.ts:formatResult()
Fallback path:
[domain] packages/core/src/plan.ts:createExecutionPlan()
-> [fallback] packages/core/src/fallback.ts:executeFallbackStrategy()
-> [reporting] packages/cli/src/output.ts:formatResult()
Add a Boundaries section whenever the task crosses layers.
Example:
## Boundaries
- CLI owns argument parsing, process exit codes, and user-facing output.
- Domain code owns decisions, state transitions, and strategy selection.
- IO adapters own filesystem, process, network, and database effects.
- Tests should observe public behavior first and internals only when needed.
Do not collapse boundaries for convenience. If the code contradicts the plan, stop and update the plan with the discovered constraint before continuing.
Before editing code, restate the next slice in 3-7 bullets:
## Next implementation slice
- Edit `<file>` to introduce `<type/function>`.
- Wire `<caller>` to `<callee>` without changing behavior.
- Add/update `<test>` for `<observable behavior>`.
- Run `<command>`.
Then implement only that slice.
Hard guardrail:
Do not add extra functionality, broad refactors, packages, APIs, tests, or behavior outside the current plan unless the user asks or the plan is updated first.
After each meaningful phase, update the plan or handoff with:
If a mistake or recurring preference should become a durable rule, suggest an AGENTS.md entry, but do not edit global/project rules unless asked.
Use this when ending a session, handing off to another agent, or pausing mid-task.
# Handoff: <task>
## Done
- <completed work with files/functions>
## Current state
- <what compiles/runs>
- <what remains broken, unknown, or unverified>
## Important contracts
```ts
<final important interface/type snippets or language equivalent>
```
## Implemented call stacks
```text
<final happy-path stack>
<final error/fallback stack if relevant>
```
## Files changed
- `<file>`: <summary>
## Commands already run
```bash
<command>
# result: <pass/fail + short exact output>
```
## Next steps
1. <exact next action>
2. <exact next action>
3. <exact next action>
## Do not do
- <scope guardrails>
- Do not add functionality outside the approved plan.
Ask for a plan only:
Use the typed-call-stack-planning skill. Read the relevant code and create a plan in llm/context/. Make the plan mostly typed pseudocode: interfaces, boundaries, composition, current/target call stacks, files/functions, tests, and explicit non-goals. Do not implement yet.
Ask to implement from a plan:
Use the typed-call-stack-planning skill. Read llm/context/<plan>.md, summarize the target stack briefly, then implement only the listed steps in vertical slices. Do not add extra functionality. Update the plan or handoff as you complete work.
Ask to repair or re-ground a stale plan:
Use the typed-call-stack-planning skill. Compare the plan to the current code. Identify mismatches, update the current and target call stacks, and rewrite the next implementation slice before coding.
Ask for a handoff:
Use the typed-call-stack-planning skill. Write a handoff with what changed, tests run, files modified, open issues, final call stacks, and the next exact todos.
The plan is ready only when a fresh agent can answer these questions without reading the whole chat:
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
11 skills in this plugin
/abstraction-design-coachHelp design, review, simplify, and refactor software abstractions, especially in TypeScript and JavaScript./agent-artifactsCreate or update a substantial engineering deliverable as validated semantic JSON, then render it through the Agent Artifacts CLI or MCP into self-contained HTML plus optional durable Markdown. Covers eight kinds - implementation plan, progress report, ADR or design decision, architecture explainer, code or design review, research report, incident report or post-mortem, and engineering handoff. Use whenever the request is for a plan, RFC, design doc, status update, post-mortem, retro, architecture writeup, review verdict, or handoff that a colleague will read and act on - prefer this over hand-authored HTML or freeform Markdown for these eight, because the renderer enforces answer-first structure, provenance, print, and mobile layout that hand-written output silently drops. Do not use for short answers, ordinary notes, code-only replies, or one-off visual artifacts that fit none of the eight kinds./askUse when the user asks to be interviewed, wants guided choices, or needs to answer a question before work can continue. Ask through the agent's user-question tool./big-pictureUse when the user wants brief text, large visuals, and clear design without AI slop in an explanation, page, slide, or report./prove-itProve changed code with focused runtime checks and visual artifacts. Use after changing code, before shipping, or when asked to verify behavior. Work locally on uncommitted changes or publish to an existing GitHub pull request./restate-intentRestate the user's goal and problem before continuing. Use when asked to check understanding, summarize intent, or make sense of a long or dictated request.npx claudepluginhub tbsheff/skills --plugin tbsheff-skills