npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

candy-debug

v1.1.1

Published

ロキシーがコードレビューをして、ノベルゲーム用の台本(JSON)を作る CLI

Readme

candy-debug

ロキシーがあなたのコードをレビューして、ノベルゲーム用の台本(JSON)を作る CLI です。

フォルダを渡すと、ローカルの Claude Code(claude コマンド)が コードを読み、指摘をロキシーの台詞にまとめます。出てきた JSON は candy-debug のクライアントアプリで、 音声つきのノベルとして再生できます。

必要なもの

  • Node.js 20 以上
  • ログイン済みの claude コマンド(npm install -g @anthropic-ai/claude-code)

インストール

npm install -g candy-debug
candy-debug --doctor   # claude が使えるかを確かめる

cdbg という短縮名でも同じコマンドを呼べます(cdbg ./my-project -o review.json)。

使い方

# 結果をファイルに書き出す
candy-debug ./my-project -o review.json

# 標準出力に JSON を出す(進捗は標準エラー)
candy-debug ./my-project > review.json

# AI を呼ばずに、対象になるファイルだけを確かめる
candy-debug ./my-project --scan-only

# Amazon Bedrock で動かす(モデルは環境変数 BEDROCK_MODEL_ID)
export AWS_REGION=ap-northeast-1 BEDROCK_MODEL_ID=zai.glm-5
cdbg ./my-project --provider bedrock -o review.json

# CI で使う: warning 以上の指摘があれば終了コード 3(JSON は書き終えてから返す)
cdbg . --provider bedrock --fail-on warning -o review.json

# 指摘のあるファイルを AI に直させる(このときだけ対象フォルダへ書き込む)
cdbg fix review.json --dir . --provider bedrock --summary pr.md

Bedrock の認証は AWS SDK の標準の順序(環境変数・~/.aws・SSO・CodeBuild/ECS の実行ロールなど)で探します。 CodePipeline に組み込んだ例は、リポジトリの examples/roxy-pipeline/(ロキシーパイプライン)にあります。

| オプション | 内容 | | ----------------------- | -------------------------------------------------------------------------------------------- | | -o, --output <file> | 結果の JSON を書き出すファイル(省略時は標準出力) | | --max-findings <n> | 指摘の最大件数(既定 6) | | --provider <name> | claude / bedrock(既定 claude・環境変数 CANDY_DEBUG_PROVIDER) | | --model <id> | レビューに使うモデル(claude の既定 claude-sonnet-5・bedrock の既定は BEDROCK_MODEL_ID) | | --region <region> | bedrock のリージョン(既定 AWS_REGION) | | --fail-on <severity> | この重要度以上の指摘があれば終了コード 3(critical / warning / info) | | --scenario-model <id> | 台本づくりに使うモデル(既定は --model と同じ) | | --claude <command> | claude コマンドの場所 | | --progress <mode> | 進捗の出し方: text / json / none(既定 text) | | --scan-only | 走査結果だけを JSON で出す | | --doctor [--json] | AI を呼べるかの確認 |

cdbg fix <review.json> のオプション: --dir <folder>(既定 カレント)/ --min-severity <sev>(既定 warning)/ --summary <file>(プルリクエスト用の Markdown)/ --dry-run。--provider / --model / --region もレビューと同じく使えます。

cdbg fix は、指摘のあるファイルごとにファイル全体と指摘を AI へ送り、直したファイル全体を返させます。 JavaScript / JSON は構文検査(node --check)を通ったものだけ書き込みます。AI が途中で切れた応答を返したとき・ 対象フォルダの外を指す指摘・AI が「直した」と申告しなかった指摘は書き込みません。動作は確かめないので、必ず差分を確認してください。

| 環境変数 | 内容 | | --------------------------- | --------------------------------------------- | | BEDROCK_MODEL_ID | Bedrock のモデル ID(推論プロファイル ID 可) | | BEDROCK_SCENARIO_MODEL_ID | 台本づくりだけ別のモデルにしたいとき | | BEDROCK_MAX_TOKENS | 1 回の応答の上限(既定 8192) | | CANDY_DEBUG_PROVIDER | --provider の既定 |

終了コード: 0 成功 / 1 失敗 / 2 引数の誤り / 3 --fail-on に該当する指摘あり / 130 中断

注意

  • 対象のコードは AI(claude なら Anthropic、bedrock なら Amazon Bedrock)へ送られます。 送ってよいコードかを確かめてから実行してください。
  • レビューは対象フォルダへ一切書き込みません(-o で明示した場所にだけ書きます)。書き込むのは cdbg fix を実行したときだけです。
  • 1 回の実行で claude を数回呼びます。目安は指摘 6 件で約 3 分・約 $0.3 です(2026-09-09 実測)。

出力の形

{
  "format": "candy-debug/review",
  "schemaVersion": 1,
  "generator": { "name": "candy-debug", "version": "1.1.1" },
  "project": { "name": "my-project", "dir": "/path/to/my-project" },
  "findings": [/* 指摘 */],
  "scenario": { "beats": [/* 台詞・表情・コード片・赤枠の位置 */] },
  "warnings": [],
  "costUsd": 0.29,
}

コード片は台本に埋め込まれているので、再生する側は対象プロジェクトを持っていなくても構いません。

ライセンス

MIT