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

@szk302/spectrack

v0.1.2

Published

仕様書依存関係追跡ツール

Downloads

33

Readme

spectrack 📄🔗

spectrack(スペクトラック)は、MarkdownやYAMLで書かれた仕様書・ドキュメント間の「依存関係」を、Gitの力を使って堅牢に追跡・管理するCLIツールです。

「要件定義書が更新されたのに、ユースケース図の修正が漏れていた…」 「ディレクトリ構造を整理したら、ドキュメントのリンクが全部切れてしまった…」

そんな仕様書管理の悲劇を、IDベースの追跡とSemVer(セマンティックバージョニング)で未然に防ぎます。

✨ 主な機能と特徴

  • 堅牢なIDベース追跡: ドキュメントの移動やリネームに影響されません。フロントマターに埋め込まれた一意のIDで関係性を維持し、人間用には「パスヒント」を自動で書き込みます。
  • Working Tree ファースト: 未コミットのローカルの変更を即座に評価。「仕様書Aを直して、それに合わせて仕様書Bも直してから、まとめて1つのコミットにする」という自然な開発体験(アトミック・コミット)を実現します。
  • Git履歴との高度な連携: 過去のバージョンとの差分表示(deps-diff)や、すでに削除されたファイルからの依存履歴の掘り起こし(dependents --all)など、強力な分析機能を備えています。
  • CI/CDフレンドリー: verify コマンドによる循環依存のチェックや、graph コマンドによる依存ツリーの可視化(Mermaid出力)をサポートしています。

📦 インストール

# npm を使用する場合
npm install -g @szk302/spectrack

🚀 クイックスタート

1. プロジェクトの初期化

プロジェクトのルートディレクトリで init コマンドを実行します。

# 設定ファイルを作成し、既存のドキュメントを一括で追跡対象にする
spectrack init --all

2. 依存関係を結ぶ(Link)

あるドキュメントが、別のドキュメントの仕様を前提としている場合、link コマンドで紐づけます。

spectrack link docs/use-case/UC001.md --deps=docs/prd/requirements.md

3. 日々のワークフロー

仕様書の更新から追従までのサイクルは非常にシンプルです。

① 依存先ドキュメントを更新する 要件定義書を修正し、バージョンを上げます。

spectrack bump docs/prd/requirements.md --minor

② 状態を確認する(Status) プロジェクト全体の依存状況をチェックします。status はローカルの未コミットの変更を即座に検知します。

$ spectrack status
...
🔄 [st-uc-001] docs/use-case/UC001.md の依存状況:
   └─ 🔄 [st-prd-001] docs/prd/requirements.md (参照: 1.0.0, 現在: 1.1.0) ⚠️ 更新あり

③ 変更内容をレビューする(Deps-diff) 依存先がどのように変更されたのか、差分を確認します。

spectrack deps-diff docs/use-case/UC001.md

④ 自分のドキュメントを修正し、同期する(Sync) 変更内容に合わせてユースケース記述を修正し、「最新の仕様に追従した」ことをマークします。

spectrack sync docs/use-case/UC001.md

これで、整合性の取れたドキュメント群をまとめて git commit する準備が整いました!

🛠 コマンドリファレンス

すべてのファイル変更を伴うコマンドには、安全確認用の --dry-run オプションが使用可能です。

| コマンド | 役割 | | --- | --- | | spectrack init [<file>] [--all] | プロジェクトの初期化、またはドキュメントへの追跡メタデータ追加 | | spectrack link <file> --deps=<path>... | ドキュメント間に依存関係を結ぶ | | spectrack unlink <file> --deps=<path>... | ドキュメント間の依存関係を解除する | | spectrack bump <file> [--major|minor|patch] | ドキュメントのバージョンを上げる | | spectrack sync <file> | 更新された依存先の最新バージョンに追従・同期する | | spectrack status [<file>] | 依存先ツリーを表示し、バージョンのズレ(更新)を警告する | | spectrack diff <file> | ドキュメント自身の過去バージョンからの変更差分を表示する | | spectrack deps-diff <file> | 対象が依存している全ドキュメントの変更差分を表示する | | spectrack list | 追跡中の全ドキュメントの目録(インベントリ)を表示する | | spectrack dependents <file> [--all] | 対象に依存しているドキュメント(影響範囲)を逆引き検索する | | spectrack log <file> | バージョンがいつ上がったかの歴史(タイムライン)を表示する | | spectrack verify | 構造、未解決リンク、循環依存などの全体的な健全性を検証する | | spectrack graph | 依存関係のネットワークグラフ(Mermaid形式等)を出力する |

⚙️ 設定(spectrack.yml)

プロジェクトルートに配置される spectrack.yml で、フロントマターのキーやID生成のルールを柔軟にカスタマイズできます。

frontMatterKeyPrefix: x-st-
frontMatterTemplate:
  md:
    version: 0.0.0
    x-st-version-path: version
    x-st-id: "{{context.file.dir}}-{{context.utils.nanoid}}"
    x-st-dependencies: []

除外設定(.spectrackignore)

.gitignore と同じ文法で、追跡対象から外したいディレクトリやファイルを指定します(init 時に強力なデフォルト設定が自動生成されます)。

📄 ライセンス (License)

This project is available as open source under the terms of the MIT License.