← 返回 Skills 市场
ambitioncn

Small Context Coding

作者 ambitioncn · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
65
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install small-context-coding
功能描述
Efficient coding workflow for small-context models working on medium or large codebases. Use when the user wants to develop, debug, refactor, or analyze code...
使用说明 (SKILL.md)

Small Context Coding

Use this skill to keep coding work effective when the model context is limited.

Core operating mode

Treat the model as a short-working-memory engineer. Do not try to keep the whole project in chat context. Store project state in files and retrieve only what is needed for the current step.

Default workflow

  1. Classify the task size.
  2. Create or update a task plan file before broad changes.
  3. Read only the minimum files needed to decide the next step.
  4. Split the work into small closed loops: inspect -> change -> verify.
  5. Use sub-agents only to isolate distinct subproblems.
  6. Write checkpoints after each meaningful phase.

Task size heuristic

Small

  • One file or one obvious fix
  • No sub-agent
  • No extra planning file unless requested

Medium

  • A few files or one subsystem
  • Make a short plan
  • Consider one sub-agent for investigation only

Large

  • Multiple modules, unclear root cause, or feature work across boundaries
  • Create plan + todo + checkpoint files
  • Delegate investigation or isolated implementation to sub-agents
  • Keep main session focused on orchestration and decisions

Required file-based state

For medium or large tasks, create these under a working notes folder such as notes/\x3Ctask-slug>/:

  • plan.md — goal, constraints, phases
  • todo.md — actionable checklist
  • checkpoint.md — current state, decisions, next step

Keep each file short and current. Do not duplicate long chat history into these files.

Planning rules

A plan should contain:

  • task goal
  • current understanding
  • files/modules likely involved
  • ordered steps
  • verification method

If the task changes materially, update the plan before continuing broad edits.

Context discipline rules

  • Never read whole directories into context without a reason.
  • Prefer targeted reads and searches.
  • Summarize findings into notes instead of carrying raw outputs forward.
  • After a phase is complete, compress it into a checkpoint and move on.
  • Do not mix unrelated problem threads in one run when avoidable.

Sub-agent rules

Use a sub-agent when one of these is true:

  • investigation can be isolated from implementation
  • one subsystem can be analyzed independently
  • you need a clean context for an experiment
  • the main session is becoming an overloaded coordinator

Do not use sub-agents for trivial single-file edits. Do not spawn many sub-agents unless there are clearly separate workstreams.

Good sub-agent tasks

  • trace a call chain for one feature
  • inspect one module and summarize risks
  • draft a patch for one bounded component
  • write or repair one test area

Generate brief files with:

python3 /home/nick/.openclaw/workspace/skills/small-context-coding/scripts/generate_subagent_brief.py "\x3Ctask-name>" "\x3Cscope>" "\x3Cverification>" \x3Crepo-root>

Read references/subagent-patterns.md for prompt shapes and references/usage-guide.md for a concrete example.

Main session responsibilities

  • define task boundaries
  • decide delegation
  • merge findings
  • choose final implementation direction
  • verify final result

Verification rules

After each implementation step, run the smallest meaningful check:

  • targeted test
  • lint/typecheck for changed area
  • build of affected package
  • direct inspection if no automated check exists

Read references/verification-defaults.md for stack-specific defaults before choosing a verification command. Never claim completion without a verification step or explicit blocker.

A task is only done when these are true:

  • the requested change is implemented or explicitly blocked
  • the notes reflect the current state
  • one meaningful verification step has run, or the blocker is named clearly
  • the next follow-up is obvious from checkpoint.md if more work remains

Recommended note templates

If notes do not exist, create them from the bundled templates in references/templates.md. For a real task, prefer initializing them with scripts/init_task.py. Read references/usage-guide.md when you want a concrete flow for medium or large tasks. Read references/verification-defaults.md when selecting the smallest useful validation command for a stack.

Anti-patterns

Avoid:

  • giant upfront context dumps
  • broad refactors without a written plan
  • keeping important state only in chat
  • asking one session to investigate, design, implement, and validate many unrelated things at once
  • using sub-agents just because they exist

Initialization

To set up a task workspace for medium or large work, run:

python3 /home/nick/.openclaw/workspace/skills/small-context-coding/scripts/init_task.py "\x3Ctask-name>" \x3Crepo-root>

This creates notes/\x3Ctask-slug>/plan.md, todo.md, and checkpoint.md if they do not already exist.

To verify the helper workflow end to end, run:

python3 /home/nick/.openclaw/workspace/skills/small-context-coding/scripts/smoke_test.py

Iteration guidance

Keep the skill lean. Improve it after real use by refining:

  • task size thresholds
  • sub-agent delegation patterns
  • note templates
  • verification defaults per language or framework
安全使用建议
Before installing, expect this skill to create notes/<task>/ files in your repo and optionally generate sub-agent brief files. Verify that the python3 commands point to the installed, reviewed skill files, keep sensitive information out of task notes, and review any sub-agent output before accepting changes.
功能分析
Type: OpenClaw Skill Name: small-context-coding Version: 1.0.1 The skill provides a structured workflow for managing coding tasks in small-context environments by externalizing state to local files (plans, todos, and checkpoints). The included Python scripts (init_task.py, generate_subagent_brief.py) perform safe file operations to initialize these notes, and the documentation in SKILL.md and the references folder provides legitimate guidance for task orchestration. While smoke_test.py utilizes subprocess.run, it is strictly used to verify the functionality of the bundled scripts within a temporary directory, and no indicators of data exfiltration, malicious execution, or harmful prompt injection were found.
能力评估
Purpose & Capability
The described purpose of managing coding work in small context windows matches the artifacts: planning files, checkpoints, targeted reads, verification guidance, and bounded sub-agent briefs.
Instruction Scope
The instructions are generally bounded and repeatedly discourage broad reads or unrelated edits, but they do ask the agent to create persistent task notes, run focused verification commands, and optionally delegate bounded work to sub-agents.
Install Mechanism
There is no install spec and no declared binary requirement, yet the usage instructions invoke python3 scripts via a hard-coded absolute path. The included scripts are simple and purpose-aligned, but users should verify the path resolves to the reviewed package.
Credentials
The helper scripts write only task note and brief files under a user-supplied repo root, and no artifact shows network access, credential access, destructive commands, or broad local indexing.
Persistence & Privilege
The skill intentionally persists plan, todo, checkpoint, and sub-agent brief files under notes/<task-slug>/; no elevated privileges or account credentials are requested.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install small-context-coding
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /small-context-coding 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Add MIT LICENSE file to the published package and align license metadata.
v1.0.0
Initial release: bounded coding workflow for small-context models, with task notes, helper scripts, and smoke test.
元数据
Slug small-context-coding
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Small Context Coding 是什么?

Efficient coding workflow for small-context models working on medium or large codebases. Use when the user wants to develop, debug, refactor, or analyze code... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 65 次。

如何安装 Small Context Coding?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install small-context-coding」即可一键安装,无需额外配置。

Small Context Coding 是免费的吗?

是的,Small Context Coding 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Small Context Coding 支持哪些平台?

Small Context Coding 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Small Context Coding?

由 ambitioncn(@ambitioncn)开发并维护,当前版本 v1.0.1。

💬 留言讨论