LifeOSHooks/RichFormat types: setup names only claude-code.d.ts (claude-code-tools.d.ts also needed), mod-types skips when declarations are absent, RichFormat test fails tsc on 2.1.322

オープン
#2,778 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 5 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

Start with LIFEOS/TOOLS/IntegrityCheck.ts and checkModTypes, then review the named setup docs and type declarations in skills/LifeOSHooks and skills/RichFormat. Reproduce the reported tsc failures on Claude Code 2.1.322 with the stated declaration files. Done when setup names both required files, mod-types detects installed mods missing declarations, and the RichFormat test typechecks.

索引モデルが issue の本文から書いたものです。

説明

LifeOS 8.761.0, Claude Code 2.1.322, Linux. Both mods (LifeOSHooks, RichFormat) loaded from the skills folder.

1. Setup names one declaration file; the hooks module needs two

skills/LifeOSHooks/SKILL.md (§ After a Claude Code update), skills/LifeOSHooks/Setup.md and the mod-types fix text in LIFEOS/TOOLS/IntegrityCheck.ts name only claude-code.d.ts. With only that file in .claude/types/, tsc -p skills/LifeOSHooks reports 32 errors, all in hooks/LifeOSHooks.ts, for example:

  • TS2367: This comparison appears to be unintentional because the types '"Agent" | "AskUserQuestion" | "Glob" | ...' and '"Bash"' have no overlap (line 1270)
  • TS2339: Property 'command' does not exist on type 'never' (line 1373)

BuiltinToolInputs is empty until the engine's second file, claude-code-tools/index.d.ts, merges into it. Copying .claude-plugin/types/claude-code-tools/index.d.ts (which the engine lays beside the mod) to .claude/types/claude-code-tools.d.ts makes tsc exit 0 on 2.1.322.

Suggested fix: name both files wherever the declarations step is described. The engine's copies in .claude-plugin/types/ are also an easier source than the plugin-authoring skill folder; skills/RichFormat/Setup.md already points there.

2. mod-types reports "no function-hooks mods installed" when both are installed

checkModTypes recognises a mod by the presence of types/claude-code.d.ts or .claude/types/claude-code.d.ts. The release ships neither, so a fresh install shows ✓ mod-types skipped — no function-hooks mods installed while both mods are loaded, and the check that should flag declarations missing or stale for the running build never runs.

Suggested fix: find mods by hooks/hooks.json carrying modules (or by the plugin manifest), and report missing declarations as a non-blocking finding.

3. RichFormat tests/engine.test.tsx does not typecheck on 2.1.322

With both declaration files in skills/RichFormat/types/, tsc -p skills/RichFormat reports 4 × TS2345 at lines 38, 49, 63 and 89: Argument of type 'Engine' is not assignable to parameter of type '{ prompt: { compose: (e: unknown) => Promise<unknown>; }; }'. The helper interactive($: { prompt: { compose: (e: unknown) => Promise<unknown> } }, on) declares a parameter wider than PromptComposeInput, which strict function types reject. Typing $ as Engine (or compose: (e: never) => Promise<unknown>) clears it. hooks/ itself is clean.

主要言語
TypeScript
スター
19.9k
フォーク
2.5k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

danielmiessler/LifeOS のほかの issue

danielmiessler/LifeOS の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。