Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Task State Management

БесплатноБез исполняемых скриптовНе проверен

Managing project and task state in .claude/projects/{id}/ with atomic writes and session continuity

TheLobbiот TheLobbi★ 22 звезды на GitHub

Об этом скилле

Task State Management Skill

State Directory Structure

All project state lives under .claude/projects/{project-id}/ relative to the repository root. This location is chosen deliberately: it is inside the .claude/ directory (which is already gitignored in most Claude Code configurations), it is scoped to the project by ID (supporting multiple concurrent projects), and it is readable by all hook scripts and skills without any path resolution logic.

The full directory layout is:

.claude/projects/{project-id}/
  project.json          — Top-level project record (validates against project.schema.json)
  tasks.json            — Master list of all task objects (validates against task.schema.json per item)
  progress/
    log.md              — Append-only human-readable execution log
    velocity.json       — Rolling velocity metrics updated after each task completes
  research/
    {task-id}.md        — Research brief per task (written by research-protocol skill)
  checkpoints/
    checkpoint-{n}.json — Numbered snapshots of tasks.json at key milestones
  temp/
    .write-{uuid}       — Temporary files used during atomic write operations

The temp/ directory is transient. Any file matching .write-* that is older than 5 minutes can be safely deleted — it is a failed atomic write that was abandoned mid-operation. The checkpoint and research directories grow over time; they are never pruned automatically. The progress log is append-only and must never be truncated or overwritten.

Atomic Write Protocol

All writes to project.json and tasks.json follow a strict atomic write protocol to prevent partial-write corruption that would leave the project in an unrecoverable state.

The protocol has three steps. First, compute the new JSON content in memory and validate it against the relevant schema. If validation fails, the write is aborted and an error is appended to progress/log.md — the existing file is never touched. Second, write the validated content to a temporary file at temp/.write-{uuid} where the UUID is generated fresh for each write operation. Third, rename the temporary file to the target path using an atomic filesystem rename. On POSIX systems this is a single mv operation. On Windows (where the project currently runs), the rename must replace an existing file, which requires deleting the target first and then renaming — this brief window is acceptable because the previous valid state is recoverable from the most recent checkpoint.

Under no circumstances should the target file be opened for direct write. Line-by-line or in-place edits to state files are forbidden. The entire file is always regenerated from the in-memory state object, serialized to JSON, and written atomically.

Tasks.json Master List Format

The tasks.json file is a JSON object with a single key tasks containing an array of task objects. The array is the canonical source of truth for all task state. The order of tasks in the array reflects the order they were created, not their execution order (which is determined dynamically by the scheduler based on dependencies and priority).

Each task object in the array conforms to task.schema.json. The id field is the primary key. Lookups by ID should iterate the array; no secondary index is maintained in this file. The tasks array includes tasks at all levels of the hierarchy — epics, stories, tasks, subtasks, and micro-tasks are all represented as peers in the flat list, with parent-child relationships expressed through the subtasks array on parent tasks.

When a task is decomposed into subtasks, the parent task's subtasks field is updated with the child IDs, and the new child tasks are appended to the tasks array. The parent task's status transitions to IN_PROGRESS at this point — a parent task is never directly executed; it is COMPLETE only when all its subtasks are COMPLETE.

Checkpoint Rolling Window

After every phase completion and after every 10 task completions (whichever comes first), the current state of tasks.json is written as a numbered checkpoint to checkpoints/checkpoint-{n}.json. The checkpoint number increments monotonically from 1. Only the last 10 checkpoints are retained; when checkpoint-11 is written, checkpoint-1 is deleted.

Checkpoints serve as recovery points. If tasks.json becomes corrupted or inconsistent (e.g., due to an interrupted atomic write), the most recent valid checkpoint is used to reconstruct the state. A checkpoint is considered valid if it can be parsed as JSON and at least one task object passes schema validation. The recovery logic does not require full schema compliance — partial recovery is preferable to no recovery.

Checkpoints are named with zero-padded numbers (checkpoint-001.json through checkpoint-010.json) so that lexicographic sort correctly identifies the newest checkpoint.

Progress Log Format

The progress/log.md file is append-only. Nothing is ever deleted or overwritten in

Полный SKILL.md на GitHub

Установить Task State Management в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Task State Management?

Managing project and task state in .claude/projects/{id}/ with atomic writes and session continuity

Как установить скилл Task State Management?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Task State Management запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Task State Management с