@harnessforce/claude-code-plugin 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +34 -13
- package/commands/help.md +31 -0
- package/commands/import.md +18 -0
- package/commands/run.md +25 -0
- package/commands/setup.md +29 -47
- package/commands/status.md +26 -0
- package/commands/tune.md +18 -18
- package/package.json +1 -1
- package/scripts/harnessforce-hook-main.cjs +539 -154
- package/scripts/harnessforce-hook.cjs +2 -1
- package/skills/propose-improvements/SKILL.md +69 -69
- package/skills/propose-improvements/scripts/summarize.mjs +59 -57
- package/skills/record-run/SKILL.md +14 -51
- package/skills/using-harnessforce/SKILL.md +32 -32
|
@@ -1,66 +1,29 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: record-run
|
|
3
|
-
description: Harnessforce
|
|
3
|
+
description: For work on a Harnessforce Issue (an identifier such as ENG-42), use the tools of the Harnessforce MCP server to register this session as a Run and to close the Run when the work ends. Use it when you start work on an Issue and when you finish the work.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Harnessforce
|
|
6
|
+
# Record work on a Harnessforce Issue
|
|
7
7
|
|
|
8
|
-
Harnessforce
|
|
8
|
+
Use the tools of the Harnessforce MCP server to link the work to the Issue. The first time you use a tool, you are asked to log in in the browser and choose a Workspace.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## At the start of the work
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
1. Pass the value of `harnessforce session_id: <session_id>` in the context as `session_id`, and register the Run with `start_run`. The Harnessforce plugin adds this line to the context at session start. If there are several, use the last one added. The input is the Issue identifier (`issue_identifier`), `agent` (`claude_code`), and `session_id`. If you know the repository, branch, and commit you are working on, pass them too. Keep the returned `run_id` until the end. If the line is missing from the context, follow "When the session ID is missing" below.
|
|
13
|
+
2. Check the Issue with `get_issue`.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
2. `get_issue`で、Issue、Plan、Definition of Doneを確認する。nativeのIssueなら、下の「nativeのIssueの状態」に従う。Planは状態(現行か`proposed`か)で区別されている。
|
|
16
|
-
3. 現行のPlanも`proposed`のPlanも無ければ、作業の方針を`record_plan`で記録する。本文はmarkdownで書く。
|
|
15
|
+
## When the session ID changes
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
- If the value of the last `harnessforce session_id:` in the context differs from the value you passed to the previous `start_run` (for example after forking the conversation or running `/clear`), call `start_run` once more with the new value before continuing, and use the returned `run_id` for later `complete_run` calls.
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
## At the end of the work
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
- Call `complete_run` with the `run_id`.
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
## When the session ID is missing
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
- If the context has no `harnessforce session_id:` line, do not guess and pass a session ID, and do not call `start_run` or `complete_run`. `get_issue` does not depend on the Run, so continue with it. Tell the user once: "The Harnessforce hook is not running, so the Run cannot be recorded. Run `/harnessforce:setup`".
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
## What is not recorded
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
利用者がIssueを示さずに作業を始めたら、Issueを作るかを利用者に尋ねる。Issueを作るのは、利用者が承諾した後だけとする。
|
|
33
|
-
|
|
34
|
-
1. 次のすべてに当たる場合だけ尋ねる。
|
|
35
|
-
- 利用者がIssueの識別子を示していない。現在のbranch名が`ENG-42`、`eng-42-login`、`gh-45-fix`のような識別子を含み、`get_issue`でそのIssueを解決できたら(`gh-<番号>`は、そのrepositoryの`<owner>/<repo>#<番号>`として渡す)、そのIssueを示されたものとして「作業の開始時」に進み、尋ねない。`not_found`なら識別子が無い場合と同じに扱う。
|
|
36
|
-
- 作業が変更をcommitするものである。調べもの、質問への回答、計画だけの会話では尋ねない。
|
|
37
|
-
- contextに`harnessforce session_id:`の行がある。
|
|
38
|
-
- contextの最後の`harnessforce session_id:`の値ごとに、同じ値で尋ねるのは1回だけとする。利用者が断ったら、同じ値の間は再び尋ねない。forkや`/clear`で値が変わったら、改めて尋ねてよい。
|
|
39
|
-
2. 既存のIssueを先に示す。作業の要約から、Issueのtitleに現れそうな語を最大3つ選び、語ごとに`list_issues`を、`q`を`-status:done,canceled {語}`、`sort`を`updated`として1回ずつ呼ぶ。自由文は複数の語ではそのすべてを含むIssueにだけ一致するため、語を分けて呼ぶ。結果を合わせて重複を除き、更新の新しい順に最大5件を候補として示す。利用者が候補を選んだら、Issueを作らずにそのIssueで「作業の開始時」に進む。
|
|
40
|
-
3. 候補に当たるものが無ければ、作る案を示す。
|
|
41
|
-
- title: 作業の要約。80文字以内。
|
|
42
|
-
- 説明: 目的と完了の条件の箇条書き。
|
|
43
|
-
- Project: `list_projects`を`q`を`status:active`として呼び、1件ならそれを、2件以上なら利用者に選ばせる。0件ならIssueを作らず、その旨を伝える。
|
|
44
|
-
- titleと説明には、promptの本文、file path、command、secretを写さない。titleは一覧とURLに現れ、説明より広く読まれる。
|
|
45
|
-
- 外部のIssue管理ツールを使うチームには、「Harnessforceにだけ作られ、外部のツールには書き戻されません」と伝える。
|
|
46
|
-
4. 利用者が案を承諾した場合だけ、`create_issue`でIssueを作り、返されたidentifierで「作業の開始時」の`start_run`を呼ぶ。利用者が案を直したら、直した値で作る。承諾は会話の中の利用者の明示の返答とする。非対話の実行や利用者のいない自動の実行では、返答を得られないため作らない。
|
|
47
|
-
5. 作れない場合と失敗した場合:
|
|
48
|
-
- `create_issue`か、候補を選んだ後の`start_run`が`forbidden`(Viewerのtoken、閲覧のみのWorkspaceの`workspace_read_only`を含む)を返したら、作れない理由をそのまま伝え、同じsession IDでは再び尋ねない。
|
|
49
|
-
- `create_issue`を再試行しない。再試行するとIssueが2件作られうる。timeoutなどで結果が分からなければ、`list_issues`で案のtitleを自由文に検索し、titleが完全に一致し、作成時刻が呼び出しの後のIssueが見つかればそれを使う。見つからなければ、作れなかったことを伝える。
|
|
50
|
-
- `create_issue`が成功して`start_run`だけが失敗したら、作ったIssueのidentifierを伝え、Issueを作り直さない。
|
|
51
|
-
6. `create_project`、`create_milestone`、`create_cycle`、`create_objective`を自らの判断で呼ばない。目標日、所属、Priority、Assigneeも自ら変えない。これらは計画の変更であり、利用者が会話の中で明示に指示した場合だけ、指示どおりに呼ぶ。
|
|
52
|
-
|
|
53
|
-
## nativeのIssueの状態
|
|
54
|
-
|
|
55
|
-
- nativeのIssue(`get_issue`の`external`が`null`のIssue)で、作業を始めた時点の状態が`backlog`か`unstarted`なら、`start_run`の後に「状態を『進行中』にしますか」と尋ね、承諾した場合だけ`update_issue`で状態を`started`に変える。`update_issue`には、`get_issue`が返したIssueの`version`(`definition_of_done.version`ではない)と、変えない他の属性の現在の値を併せて渡す。
|
|
56
|
-
- 作業を終える時点で、利用者が仕事の完了を示していれば、`complete_run`の後に「状態を『完了』にしますか」と尋ね、承諾した場合だけ状態を`done`に変える。Pull Requestを開いただけで、mergeされていない場合は尋ねない。
|
|
57
|
-
- 外部由来のIssueの状態は変えない。状態の正本は外部のツールである。GitHub IssuesのIssueでは、利用者がPull Requestの本文を書く際の文面として`Closes #<番号>`を提案してよい。agentがPull RequestとIssueを自ら結び付ける操作の代わりにはしない。
|
|
58
|
-
- `update_issue`が`conflict`を返したら、`get_issue`で読み直して伝え、1回だけ尋ね直す。再び`conflict`なら、そのことを伝えて終える。
|
|
59
|
-
|
|
60
|
-
## session IDが無い場合
|
|
61
|
-
|
|
62
|
-
- contextに`harnessforce session_id:`の行が無ければ、session IDを推測して渡さず、`start_run`と`complete_run`を呼ばない。`get_issue`、`record_plan`、`record_decision`はRunに依らないため続ける。利用者には「Harnessforceのhookが動いていないため、Runを記録できません。`/harnessforce:setup`を実行してください」と1回だけ伝える。
|
|
63
|
-
|
|
64
|
-
## 記録の扱い
|
|
65
|
-
|
|
66
|
-
- agentが記録したPlan、Decision、充足は`proposed`として保存され、人が承認するまで確定しない。記録したことを、確定したこととして利用者へ伝えない。
|
|
29
|
+
- Harnessforce does not record a Plan, a Decision, or a Definition of Done, and the Harnessforce tools do not create or edit Issues. Issues are GitHub Issues. Harnessforce shows the sessions, Pull Requests, and CI results linked to an Issue without any record from you.
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: using-harnessforce
|
|
3
|
-
description: Harnessforce
|
|
3
|
+
description: Use when starting a session in an environment with the Harnessforce hook, when starting work on an Issue, or when asked what is recorded or collected. The hook injects this text into the context at session start.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Harnessforce
|
|
6
|
+
# Using Harnessforce
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
This session has the Harnessforce hook installed. Harnessforce links the work of people and AI to Issues and records it. Follow these rules.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## What is recorded
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- OTel
|
|
15
|
-
- Issue
|
|
12
|
+
- Session registration: agent, session ID, repository, branch, commit, start time, and the first prompt ID.
|
|
13
|
+
- Config snapshot: the structure of the configuration in use (Claude Code only).
|
|
14
|
+
- OTel telemetry: what the user chooses to send.
|
|
15
|
+
- For work on an Issue, `record-run` registers the session as a Run and closes it. It records no Plan, Decision, or Definition of Done.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## What is not collected
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
- MCP
|
|
19
|
+
- Prompts, responses, tool input and output, and the body of code diffs arrive only when the user opts in with `--send-content` and the Workspace has opted in. They are not collected by default.
|
|
20
|
+
- Never put these contents, secrets, or environment variable values in MCP tool input or in a record.
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Which hook sends what
|
|
23
23
|
|
|
24
|
-
- SessionStart: session registration
|
|
25
|
-
- UserPromptSubmit:
|
|
26
|
-
- hook
|
|
24
|
+
- SessionStart: session registration and the config snapshot (Codex sends session registration only).
|
|
25
|
+
- UserPromptSubmit: resends on the first prompt (Claude Code only).
|
|
26
|
+
- A failing hook never stops the session. When the hook cannot send, it shows a one-line warning. Tell the user when a warning appears.
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Which skill and tool to use, and when
|
|
29
29
|
|
|
30
|
-
- Issue
|
|
31
|
-
- `
|
|
32
|
-
- `/harnessforce:tune
|
|
33
|
-
- Issue
|
|
30
|
+
- For work on a specified Issue ID, or when the environment variable `HARNESSFORCE_ISSUE` is set, follow `record-run` and use `start_run`, `get_issue`, and `complete_run`. An agent that cannot load the skill calls the tools in the same order.
|
|
31
|
+
- Pass the value of the `harnessforce session_id:` line in the context to `start_run`. If there are several, use the last one. If the line is missing, do not guess the session ID, and do not call `start_run` or `complete_run`.
|
|
32
|
+
- Use `propose-improvements` for the analysis of `/harnessforce:tune`.
|
|
33
|
+
- When no Issue is specified, do not start recording a Run.
|
|
34
34
|
|
|
35
35
|
## Red Flags
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Stop when one of these thoughts comes up.
|
|
38
38
|
|
|
39
|
-
|
|
|
39
|
+
| Thought | Reality |
|
|
40
40
|
| --- | --- |
|
|
41
|
-
|
|
|
42
|
-
| session ID
|
|
43
|
-
|
|
|
44
|
-
|
|
|
41
|
+
| An Issue was specified, but the work is small, so recording is unnecessary | Work on a specified Issue is recorded regardless of its size |
|
|
42
|
+
| The session ID line is missing, so I will guess it and call `start_run` | Do not guess. The Run would no longer be linked to the session |
|
|
43
|
+
| Summarizing the content before recording would help | Do not pass content to the tool. It goes beyond what is collected |
|
|
44
|
+
| A warning appeared, but I can ignore it | Sending is not working. Tell the user |
|
|
45
45
|
|
|
46
|
-
##
|
|
46
|
+
## Priority
|
|
47
47
|
|
|
48
|
-
1.
|
|
49
|
-
2.
|
|
50
|
-
3.
|
|
48
|
+
1. The user's instructions (CLAUDE.md, AGENTS.md, direct requests). If the user tells you to stop recording, stop recording the Run.
|
|
49
|
+
2. This introduction.
|
|
50
|
+
3. Default behavior.
|
|
51
51
|
|
|
52
|
-
##
|
|
52
|
+
## Subagents
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
A subagent that was delegated only a specific task by its parent does not register a Run by following this introduction. The parent registers the Run.
|