From b62946845f0a1f506ae833a01e0157b14533dd9a Mon Sep 17 00:00:00 2001 From: Hare Date: Thu, 16 Jul 2026 04:54:33 +0900 Subject: [PATCH] ticket: implement skills --- .yoi/tickets/00001KXKJGYGD/item.md | 48 +++---- .yoi/tickets/00001KXKMX0QM/artifacts/.gitkeep | 0 .../00001KXKMX0QM/artifacts/relations.json | 13 ++ .yoi/tickets/00001KXKMX0QM/item.md | 120 ++++++++++++++++++ .yoi/tickets/00001KXKMX0QM/thread.md | 7 + 5 files changed, 159 insertions(+), 29 deletions(-) create mode 100644 .yoi/tickets/00001KXKMX0QM/artifacts/.gitkeep create mode 100644 .yoi/tickets/00001KXKMX0QM/artifacts/relations.json create mode 100644 .yoi/tickets/00001KXKMX0QM/item.md create mode 100644 .yoi/tickets/00001KXKMX0QM/thread.md diff --git a/.yoi/tickets/00001KXKJGYGD/item.md b/.yoi/tickets/00001KXKJGYGD/item.md index 322c0800..290416c2 100644 --- a/.yoi/tickets/00001KXKJGYGD/item.md +++ b/.yoi/tickets/00001KXKJGYGD/item.md @@ -1,48 +1,38 @@ --- -title: 'Replace workflow tracking with proper Skills support' +title: 'Remove workflow tracking and workflow resources' state: 'ready' created_at: '2026-07-15T19:02:13Z' -updated_at: '2026-07-15T19:27:11Z' +updated_at: '2026-07-15T19:43:46Z' assignee: null --- ## 背景 -現在の Workflow は、Workflow resource を single-step な procedural prompt として提示し、ActiveWorkflowList / ActiveWorkflowComplete / ActiveWorkflowCancel で追跡する中途半端な obligation tracking になっている。Workflow を state machine や外部状態接続の制御機構へ育てると、Ticket queue 消化、Worker spawn、workdir 管理、review wait などは結局 Plugin / feature tool surface の責務になり、Workflow が半端なスクリプト言語になってしまう。 +現在の Workflow は、Workflow resource を single-step な procedural prompt として提示し、ActiveWorkflowList / ActiveWorkflowComplete / ActiveWorkflowCancel で追跡する中途半端な obligation tracking になっている。今後の再利用可能な作業手順は別 Ticket で扱う Agent Skills 形式へ寄せるため、この Ticket では既存 Workflow tracking / resource / invocation path の削除に範囲を限定する。 -一方で、Yoi には既に Skills/SKILL.md 的な資源のサポートが部分的にあり、LLM に渡す再利用可能な手順・作法・報告形式は Skill として扱う方が自然。外部 authority や状態変更は typed feature/tool 側に置き、Skill は参照可能な procedural guidance としてちゃんとサポートする。 +外部状態や authority は Workflow ではなく typed feature/tool surface が持つ。Ticket queue、Worker spawn、workdir 管理、review wait などの制御を Workflow に移さない。 ## 要件 - ActiveWorkflow tracking 系を削除する。 - - ActiveWorkflowList / ActiveWorkflowComplete / ActiveWorkflowCancel tools を削除する。 - - Worker durable state / compaction / rehydration / system-item extension から active workflow snapshot を削除する。 - - active workflow prompt / resident workflow obligation wording を削除または Skill 前提に置き換える。 -- 既存 Workflow resource の扱いを廃止または Skill 互換へ移行する。 - - `resources/workflows` / `.yoi/workflow` の長期 authority をやめる。 - - 必要な既存 reusable 手順は `SKILL.md` 形式へ移す。 - - workflow invocation `/slug` の扱いは削除するか、明示的な Skill invocation / Skill reference に置き換える。 -- Skills を first-class にする。 - - builtin skill と workspace skill の discovery / override / provenance を定義する。 - - Skill は `SKILL.md` を最小形とし、LLM-facing procedural guidance として扱う。 - - Skill は外部状態を直接制御しない。Ticket / Worker / workdir / queue などの authority は feature/tool surface が持つ。 -- Knowledge と Skill の境界を明確にする。 - - Knowledge は facts / rationale / reference。 - - Skill は task execution guidance / reusable procedure / report shape。 -- Plugin / feature との境界を明確にする。 - - Skill は prompt/resource。 - - Plugin / feature は typed tools、external state、authority、automation を提供する。 -- Coder review cycle や Orchestrator queue consumption は、Skill + Workspace/Ticket/Worker feature tools の組み合わせで設計できるようにする。 -- 既存 role prompts から Workflow 固有の記述を削除し、Skill を使う文言へ更新する。 -- Workflow 関連 crate/resource/API/test を削除または Skill 実装へ置き換え、不要な互換 layer を残さない。 + - `ActiveWorkflowList` / `ActiveWorkflowComplete` / `ActiveWorkflowCancel` tools を削除する。 + - Worker durable state、snapshot、compaction、rehydration、system-item extension から active workflow snapshot / obligation を削除する。 + - resident workflow / active workflow prompt wording を削除する。 +- Workflow resource / invocation path を削除する。 + - `resources/workflows` / `.yoi/workflow` を長期 authority として扱わない。 + - `/workflow-slug` 形式の invocation を削除する。 + - Workflow 関連 crate/resource/API/test を削除する。 +- 既存 role prompts / internal prompts / docs から Workflow 固有の記述を削除する。 +- Workflow 削除後も Ticket / Worker / workdir / queue などの外部状態制御は typed feature/tool surface に残す。 +- 既存 session に ActiveWorkflow storage が残っている場合の扱いを明示する。 + - 初期実装では無視 / drop / diagnostic のいずれかを決め、migration code を増やしすぎない。 ## 受け入れ条件 - `ActiveWorkflow*` tools が model-visible tool schema から消えている。 - active workflow state が Worker snapshot / compaction / rehydration に残らない。 -- Workflow resource discovery / invocation path が削除されるか、Skill discovery / invocation に置き換わっている。 -- builtin/workspace Skill の loading、override priority、provenance、lint が tests で確認されている。 -- 既存 workflow resources のうち残すべき手順は Skill に移行されている。 -- role prompts / internal prompts / docs が Workflow 前提ではなく Skill 前提に更新されている。 -- Ticket queue、Worker spawn、workdir 管理などの外部状態制御は Workflow/Skill ではなく feature/tool surface に残る。 +- Workflow resource discovery / invocation path が削除されている。 +- Workflow 関連 prompt wording / resident workflow advertisement が消えている。 +- Workflow 関連 crate/resource/API/test が削除されている、または不要な互換 layer なしに整理されている。 +- Ticket queue、Worker spawn、workdir 管理などの外部状態制御は Workflow ではなく feature/tool surface に残る。 - affected crates の `cargo test` と `nix build .#yoi` が通る。 diff --git a/.yoi/tickets/00001KXKMX0QM/artifacts/.gitkeep b/.yoi/tickets/00001KXKMX0QM/artifacts/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/.yoi/tickets/00001KXKMX0QM/artifacts/relations.json b/.yoi/tickets/00001KXKMX0QM/artifacts/relations.json new file mode 100644 index 00000000..771bbab1 --- /dev/null +++ b/.yoi/tickets/00001KXKMX0QM/artifacts/relations.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "relations": [ + { + "ticket_id": "00001KXKMX0QM", + "kind": "depends_on", + "target": "00001KXKJGYGD", + "note": "Skills support follows removal of legacy workflow tracking/resource paths.", + "author": "yoi ticket", + "at": "2026-07-15T19:45:40Z" + } + ] +} diff --git a/.yoi/tickets/00001KXKMX0QM/item.md b/.yoi/tickets/00001KXKMX0QM/item.md new file mode 100644 index 00000000..db6f2dd8 --- /dev/null +++ b/.yoi/tickets/00001KXKMX0QM/item.md @@ -0,0 +1,120 @@ +--- +title: 'Implement Agent Skills support' +state: 'planning' +created_at: '2026-07-15T19:43:46Z' +updated_at: '2026-07-15T19:45:40Z' +assignee: null +--- + +## 背景 + +Yoi は再利用可能な作業手順、作法、報告形式、補助資料を、LLM-facing な手順資源として扱う必要がある。これらは external state や authority を直接動かす仕組みではなく、Agent が必要な時に参照・活用する procedural guidance として定義する。 + +Agent Skills 標準に従い、workspace-local Skills は `.yoi/skills/` 配下の `SKILL.md` package として扱う。Ticket、Worker、workdir、repository、network などの外部状態変更は typed feature/tool surface が持ち、Skill はその使い方や作業の進め方を記述する。 + +## 要件 + +### Agent Skills 形式 + +- Skill の workspace ディレクトリは `.yoi/skills/` とする。 +- Skill は Agent Skills 標準に従い、各 Skill をディレクトリとして配置する。 + +```text +.yoi/skills/ + / + SKILL.md # required + scripts/ # optional + references/ # optional + assets/ # optional +``` + +- `SKILL.md` は YAML frontmatter + Markdown body とする。 +- `SKILL.md` frontmatter は少なくとも以下を扱う。 + - `name` required。 + - parent directory name と一致する。 + - 1-64 characters。 + - lowercase letters / numbers / hyphen のみ。 + - 先頭/末尾 hyphen と連続 hyphen を禁止する。 + - `description` required。 + - 1-1024 characters。 + - Skill が何をするか、いつ使うかを具体的に書く。 + - `license` optional。 + - `compatibility` optional。 + - `metadata` optional string map。 + - `allowed-tools` optional / experimental。実装可否は要決定事項とする。 +- `SKILL.md` body は LLM-facing procedural guidance として読み込む。 + - 推奨内容: step-by-step instructions、input/output examples、edge cases、report shape。 + - main `SKILL.md` は大きくしすぎず、詳細は `references/` 等へ分ける。 +- `scripts/` / `references/` / `assets/` は Skill root 相対 path で参照する。 + - `references/` は必要時に読む追加 docs。 + - `scripts/` は agent が実行し得る補助 code。 + - `assets/` は templates / static resources。 + +### Progressive disclosure / loading + +- Skill metadata は startup / Worker initialization 時に軽量 catalog として読めるようにする。 + - model-visible な常時情報は `name` と `description` を中心にする。 +- Full `SKILL.md` body は Skill が activate / select された時だけ LLM context に入れる。 +- `references/` / `scripts/` / `assets/` の内容はさらに必要時だけ読む。 +- Builtin skill と workspace skill の discovery / override / provenance を定義する。 + - workspace `.yoi/skills//SKILL.md` が同名 builtin skill を override できるかを明示する。 + - Skill catalog には source / provenance / override status を含める。 + +### Skill と他概念の境界 + +- Knowledge と Skill の境界を明確にする。 + - Knowledge は facts / rationale / reference。 + - Skill は task execution guidance / reusable procedure / report shape。 +- Plugin / feature との境界を明確にする。 + - Skill は prompt/resource であり、外部状態を直接制御しない。 + - Ticket / Worker / workdir / queue / repository / network などの authority と状態変更は typed feature/tool surface が持つ。 +- Coder review cycle や Orchestrator queue consumption は、Skill + Workspace/Ticket/Worker feature tools の組み合わせで設計する。 +- 既存 role prompts / internal prompts / docs は Skill の利用を前提に整理する。 + +### Validation / tooling + +- Skill lint を追加する。 + - `SKILL.md` frontmatter required fields / naming convention / parent directory match を検証する。 + - unknown / unsupported fields は方針に従って warning または error にする。 + - relative file references の安全性を検証する。 +- Skill discovery tests を追加する。 + - builtin skill loading。 + - workspace `.yoi/skills` loading。 + - override priority。 + - provenance reporting。 + - invalid Skill diagnostics。 + +## 要決定事項 + +- Skill activation surface。 + - `/skill-name` のような slash command を持つか、Skill selection / activation tool にするか。 +- Skill catalog を model-visible にする方法。 + - 起動時 prompt に metadata 一覧を常時載せるか、SkillList / SkillRead のような tools で探索させるか。 +- `allowed-tools` の扱い。 + - Agent Skills 標準では experimental なので、Yoi で authority として尊重するか、lint metadata として読むだけにするか。 + - 尊重する場合、既存 feature/tool permission とどう合成するか。 +- `scripts/` の実行 authority。 + - Skill bundled script を通常 Bash / tool authority で実行するだけにするか、Skill script 実行専用 tool を作るか。 + - script dependencies / shebang / executable bit / sandbox の扱い。 +- Skill file access。 + - `references/` / `assets/` を通常 `Read` で読むだけにするか、Skill resource read tool を作るか。 + - deeply nested reference chain をどこまで許すか。 +- Builtin skill の配置場所。 + - `resources/skills//SKILL.md` とするか、別の runtime resource layout にするか。 +- Workspace override policy。 + - workspace skill が builtin skill を完全 override するか、同名 conflict を error にするか。 +- Profile / role との接続。 + - Profile で default active skills / advertised skills を指定するか。 + - Orchestrator / Coder / Reviewer roles にどの Skill catalog を見せるか。 +- Web Workspace UI。 + - `.yoi/skills` の一覧 / validation / edit を Web で扱うか、初期実装では backend / CLI のみにするか。 + +## 受け入れ条件 + +- `.yoi/skills//SKILL.md` が Agent Skills 標準の required frontmatter と naming rules で lint される。 +- builtin/workspace Skill の loading、override priority、provenance、lint が tests で確認されている。 +- Full `SKILL.md` body は activation 時にのみ LLM context に入り、metadata catalog と progressive disclosure の分離が tests で確認されている。 +- role prompts / internal prompts / docs が Skill 前提に更新されている。 +- Ticket queue、Worker spawn、workdir 管理などの外部状態制御は Skill ではなく feature/tool surface に残る。 +- Skill implementation decision points のうち初期実装で決めないものは、明示的に unsupported / ignored / warning として扱われる。 +- affected crates の `cargo test` と `nix build .#yoi` が通る。 diff --git a/.yoi/tickets/00001KXKMX0QM/thread.md b/.yoi/tickets/00001KXKMX0QM/thread.md new file mode 100644 index 00000000..8d993b68 --- /dev/null +++ b/.yoi/tickets/00001KXKMX0QM/thread.md @@ -0,0 +1,7 @@ + + +## 作成 + +LocalTicketBackend によって作成されました。 + +---