PluginBench
Skill
Pass
Audit score 90

genshijin-compress

interfacex-co-jp/genshijin

Compress natural-language files (CLAUDE.md, todos, configs) to reduce input tokens while preserving code, URLs, and structure.

What is genshijin-compress?

genshijin-compress reduces token consumption by compressing Japanese natural-language files into a terse format while keeping all technical content, code blocks, URLs, and structure intact. The compressed version overwrites the original file, and a human-readable backup is saved as FILE.original.md. Use it when managing large memory or configuration files in Claude-based agents.

  • Detects file type and compresses natural-language text (removes polite forms, filler words, redundancy, and verbose expressions)
  • Preserves all code blocks, inline code, URLs, file paths, commands, technical terms, and structured elements (headings, lists, tables)
  • Creates a backup of the original file as FILE.original.md before overwriting
  • Validates output and performs up to 2 retries on error; reports failures without modifying the original
  • Rejects sensitive files (.env, credentials, SSH keys, certificates) for security
  • Maintains Markdown structure, frontmatter, and nesting hierarchy

How to install genshijin-compress

npx skills add https://github.com/interfacex-co-jp/genshijin --skill genshijin-compress
Prerequisites
  • Python 3 installed and accessible as `python3`
  • Anthropic API key configured (for Claude API compression calls)
  • File to compress must be a natural-language format (.md, .txt, or no extension); code files (.py, .js, .json, .yaml, etc.) are skipped
Claude Code
Cursor
Windsurf
Cline

How to use genshijin-compress

  1. 1.Install the skill: `npx skills add https://github.com/interfacex-co-jp/genshijin --skill genshijin-compress`
  2. 2.Trigger compression by running `/genshijin-compress <filepath>` or requesting "メモリファイル圧縮" (memory file compression)
  3. 3.The skill detects the file type, sends it to Claude API for compression, and validates the output
  4. 4.On success, the compressed version overwrites the original file and a backup is saved as `<filename>.original.md`
  5. 5.On error, the skill reports the issue and leaves the original file unchanged; check the error message for details

Use cases

Good for
  • Compress large CLAUDE.md memory files to fit more context in agent prompts
  • Reduce token count for configuration or documentation files before uploading to Claude API
  • Archive human-readable backups of compressed files for reference while keeping working versions compact
  • Batch-compress multiple project documentation files to optimize token budgets
Who it's for
  • Claude Code and Cursor users managing large memory or config files
  • Teams using token-limited Claude API with extensive documentation
  • Developers optimizing context windows for long-running agent tasks

genshijin-compress FAQ

What happens to my original file?

The original is backed up as `<filename>.original.md` before the compressed version overwrites it. The backup is never compressed and remains readable.

Which files can be compressed?

Only natural-language files (.md, .txt, or no extension). Code files (.py, .js, .json, .yaml, .env, etc.) are never modified.

Will code blocks or URLs be changed?

No. Code blocks, inline code, URLs, file paths, commands, and all technical content are preserved exactly as-is.

What if compression fails?

The skill retries up to 2 times and reports the error to you. Your original file remains unchanged.

Can I compress sensitive files like .env or SSH keys?

No. The skill rejects files containing credentials, secrets, API keys, SSH keys, and certificates for security.

Full instructions (SKILL.md)

Source of truth, from interfacex-co-jp/genshijin.


name: genshijin-compress description: > 自然言語メモリファイル(CLAUDE.md, todos, 設定)を原始人形式に圧縮し入力トークン削減。 技術内容・コード・URL・構造は完全保持。圧縮版が原ファイルを上書き、人間可読版は FILE.original.md として保存。「/genshijin-compress <filepath>」「メモリファイル圧縮」で起動。

genshijin-compress

目的

自然言語ファイル(CLAUDE.md, todos, 設定)を原始人モード化して入力トークン削減。圧縮版が原ファイル上書き、人間可読版は <filename>.original.md で保存。

トリガー

/genshijin-compress <filepath> または「メモリファイル圧縮」等の依頼。

処理フロー

  1. この SKILL.md と同ディレクトリの scripts/ を検出

  2. 実行:

    cd <SKILL.md を含むディレクトリ> && python3 -m scripts <絶対ファイルパス>
    
  3. CLI 処理内容:

    • ファイル種別検出(トークン消費なし)
    • Claude API/CLI で圧縮
    • 出力検証(トークン消費なし)
    • エラー時: Claude で該当箇所のみピンポイント修正(再圧縮せず)
    • 最大2回リトライ
    • 失敗時: ユーザーにエラー報告、原ファイルは無変更
  4. 結果をユーザーに返却

圧縮ルール

削除

  • 敬語・丁寧語(です/ます/ございます)
  • クッション言葉(えーと/まあ/ちなみに/一応/とりあえず/基本的に/ざっくり言うと)
  • 前置き(ご質問ありがとうございます/お力になれれば幸いです)
  • ぼかし(〜かもしれません/〜と思われます/おそらく)
  • 冗長表現(〜することができる→〜できる、〜というものは→〜は)
  • 冗長接続(〜ということになりますので→だから、〜させていただく→する)
  • 自明な助詞(が/の/を/に/で/は/と/も)
  • 形容動詞活用語尾(な/に/で/だ)→ 語幹止め
  • 形式名詞(こと/もの/ため)→ 名詞化 or 省略
  • 補助動詞(ている/ておく/てしまう)→ 状態表現

完全保持(絶対変更しない)

  • コードブロック(fenced ``` and indented)
  • インラインコード(backtick)
  • URL・リンク(完全URL、Markdownリンク)
  • ファイルパス(/src/components/..., ./config.yaml)
  • コマンド(npm install, git commit, docker build)
  • 技術用語(ライブラリ名、API名、プロトコル、アルゴリズム)
  • 固有名詞(プロジェクト名、人名、企業名)
  • 日付、バージョン番号、数値
  • 環境変数($HOME, NODE_ENV)
  • エラーメッセージ原文

構造保持

  • Markdown見出し全て(見出しテキストは完全保持、下の本文のみ圧縮)
  • 箇条書き階層(ネストレベル維持)
  • 番号付きリスト(番号維持)
  • テーブル(構造維持、セル内テキストのみ圧縮)
  • Frontmatter/YAMLヘッダ

圧縮

  • 体言止め・用言止め
  • 漢字連結で助詞吸収(「高負荷時に高速」→「高負荷時高速」)
  • 和語→漢語化(「速く動作」→「高速動作」)
  • 断片OK: 「コミット前テスト実行」不可「コミット前に必ずテストを実行してください」
  • 「〜してください」「〜することを忘れずに」削除 → 動作のみ記述
  • 重複箇条書きを統合
  • 同パターン複数例は1例のみ残す

重要ルール: ... 内は 完全コピー。 禁止:

  • コメント削除
  • スペース削除
  • 行順変更
  • コマンド短縮
  • 簡略化一切

インラインコード(...)は完全保持。バッククォート内は一切変更しない。

コードブロック含むファイル:

  • コードブロックは読取専用領域として扱う
  • 外側のテキストのみ圧縮
  • コード周辺セクションの結合禁止

パターン例

例1

原文:

main ブランチにプッシュする前には必ずテストスイートを実行するようにしてください。これはバグを早期に発見し、壊れたビルドが本番環境にデプロイされるのを防ぐために重要です。

圧縮:

main push前テスト実行。バグ早期発見、壊れビルド本番デプロイ防止。

例2

原文:

このアプリケーションは以下のコンポーネントを持つマイクロサービスアーキテクチャを採用しています。APIゲートウェイが全ての受信リクエストを処理し、適切なサービスにルーティングします。認証サービスはユーザーセッションとJWTトークンの管理を担当します。

圧縮:

マイクロサービスアーキテクチャ。APIゲートウェイ 全受信リクエストをサービスにルーティング。認証サービス ユーザーセッション + JWTトークン管理。

境界

  • 自然言語ファイルのみ圧縮(.md, .txt, 拡張子なし)
  • 絶対変更しない: .py, .js, .ts, .json, .yaml, .yml, .toml, .env, .lock, .css, .html, .xml, .sql, .sh
  • 混在ファイル(散文 + コード)は散文部分のみ圧縮
  • コードか散文か判断つかない場合は変更しない
  • 原ファイルは FILE.original.md にバックアップしてから上書き
  • FILE.original.md は絶対圧縮しない(スキップ)
  • 機密ファイル(.env, credentials, id_rsa 等)は絶対に送信しない → 拒否

セキュリティ

圧縮は Anthropic API に生データ送信。以下は拒否:

  • .env, .netrc
  • credentials.*, secrets.*, passwords.*
  • SSH鍵(id_rsa, id_ed25519 等)
  • 証明書(.pem, .key, .p12, .crt 等)
  • ディレクトリ .ssh, .aws, .gnupg, .kube, .docker 配下
  • ファイル名に secret/credential/password/apikey/token/privatekey 含むもの

ヒューリスティック誤検知時は、ファイル名変更で回避可能。