working-records
npx machina-cli add skill Jiusi-pys/agent-plugins/working-records --openclawWorking Records Skill
概述
提供移植工作状态的持久化记录能力,解决以下问题:
- 长时间任务的上下文保持
- 多 agent 间的状态同步
- 工作中断后的恢复
记录格式
任务记录 (YAML)
task_id: PORTING-20260118-001
library: libcurl
version: 8.5.0
source_url: https://github.com/curl/curl
target_platform: OpenHarmony 4.0
target_device: RK3588S
status: in_progress # pending | in_progress | blocked | completed | abandoned
phases:
- name: exploration
status: completed
started_at: 2026-01-18T10:00:00
completed_at: 2026-01-18T10:30:00
notes: "发现依赖 openssl, zlib, 均已移植"
- name: diagnostics
status: completed
started_at: 2026-01-18T10:30:00
completed_at: 2026-01-18T11:00:00
grade: B
notes: "15 处 epoll 使用,需要适配"
- name: architecture
status: in_progress
started_at: 2026-01-18T11:00:00
notes: "选择最小改动方案"
blockers: []
artifacts:
- path: /home/ohos/libcurl/ohos_port.patch
type: patch
description: "OHOS 适配补丁"
next_steps:
- "完成 epoll 到 poll 的替换"
- "修改 CMakeLists.txt"
context:
key_files:
- lib/multi.c # 事件循环核心
- lib/select.c # select/poll 封装
key_decisions:
- "使用 poll 替代 epoll"
- "保持与上游同步能力"
文件位置
~/.claude/working-records/
├── PORTING-20260118-001.yaml
├── PORTING-20260118-002.yaml
└── index.yaml # 任务索引
操作命令
创建任务
./scripts/create_task.sh libcurl 8.5.0
更新状态
./scripts/update_task.sh PORTING-20260118-001 phase=diagnostics status=completed
查看任务
./scripts/show_task.sh PORTING-20260118-001
列出所有任务
./scripts/list_tasks.sh
恢复任务
./scripts/resume_task.sh PORTING-20260118-001
使用场景
场景 1: 任务中断恢复
用户: 继续之前 libcurl 的移植工作
Agent: [读取 working-records]
上次进度: diagnostics 阶段已完成,正在进行 architecture 阶段
上次决策: 使用 poll 替代 epoll
继续执行...
场景 2: 多 agent 协作
Main Agent: 启动 source-explorer 分析
[写入 working-records: exploration started]
source-explorer: [完成分析]
[写入 working-records: exploration completed, key_files=[...]]
Main Agent: [读取 working-records]
探索阶段完成,关键文件: lib/multi.c, lib/select.c
开始诊断阶段...
场景 3: 阻塞记录
blockers:
- id: BLOCK-001
type: dependency
description: "需要先移植 nghttp2"
created_at: 2026-01-18T12:00:00
resolution: null
- id: BLOCK-002
type: technical
description: "epoll_pwait 无法直接替换"
created_at: 2026-01-18T13:00:00
resolution: "使用 ppoll + sigmask 模拟"
最佳实践
- 频繁保存: 每个阶段完成后立即更新
- 详细记录: 关键决策必须记录理由
- 阻塞即记: 遇到阻塞立即记录
- 关联上下文: 保存关键文件和代码位置
集成方式
在 agent 系统提示中添加:
每个阶段开始前:
- 读取 working-records 获取上下文
每个阶段结束后:
- 更新 working-records 保存进度
遇到阻塞时:
- 记录 blocker 并通知用户
Source
git clone https://github.com/Jiusi-pys/agent-plugins/blob/main/plugins/ohos-porting/skills/working-records/SKILL.mdView on GitHub Overview
Working Records provides a persistent record of porting work state, including progress, blockers, and artifacts, to prevent context loss. It supports multi-agent collaboration and automatic loading of the latest record when a task is paused or switched.
How This Skill Works
Records are stored as YAML in ~/.claude/working-records with fields such as task_id, library, version, source_url, target_platform, target_device, status, phases, blockers, artifacts, next_steps, and context (key_files, key_decisions). A set of scripts (create_task.sh, update_task.sh, show_task.sh, resume_task.sh) enables creating, updating, viewing, and resuming tasks; the system loads the latest record automatically when a phase starts/ends or a task is resumed.
When to Use It
- Task interruption and resume
- Multi-agent collaboration
- Recording blockers and diagnostics
- Cross-version/platform migration progress transfer
- Quick lookup and restore of past tasks to guide next steps
Quick Start
- Step 1: ./scripts/create_task.sh libcurl 8.5.0
- Step 2: ./scripts/update_task.sh PORTING-20260118-001 phase=diagnostics status=completed
- Step 3: ./scripts/resume_task.sh PORTING-20260118-001
Best Practices
- Save frequently after each phase completes
- Record rationale for key decisions in the log
- Log blockers as soon as they occur
- Capture context with critical files and code locations
- Use consistent field naming and update cadence for easy cross-agent sharing
Example Use Cases
- PORTING-20260118-001: libcurl 8.5.0 to OpenHarmony 4.0 with phases exploration, diagnostics, and architecture
- Two-agent workflow: source-explorer writes exploration started; main agent reads and completes exploration, then starts diagnostics
- Blockers example: BLOCK-001 dependency on nghttp2; BLOCK-002 technical: epoll_pwait workaround
- Artifact recorded: /home/ohos/libcurl/ohos_port.patch as a patch artifact
- Resume example: running ./scripts/resume_task.sh PORTING-20260118-001