rev-specs

A command that reconstructs test cases and test documentation from an existing codebase. It examines implemented logic, APIs, user-interface components, and existing tests.

In plain words
What is it for?
Use it to generate unit, integration, end-to-end, API, UI, performance, and security test cases, along with test specifications and test code.
Why use it?
It helps identify missing test coverage and document expected behavior when specifications are incomplete or outdated.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/classmethod/tsumiki/rev-specs
Clone the repo
git clone --depth 1 https://github.com/classmethod/tsumiki
Per session 70 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,178 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00070 $0.05178
Opus 5 $0.00035 $0.02589
Sonnet 5 $0.00014 $0.01036
Haiku 4.5 $0.00007 $0.00518

Measured yesterday against content hash f13ac7dcb32f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rev-specs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/rev-specs.md · 623 lines

How it starts

The opening of the file, as written. The whole thing — 623 lines — stays where its author put it; the contents beside it link to each section on GitHub.

rev-specs

目的

既存のコードベースから包括的なテストケースと仕様書を逆生成する。実装されたビジネスロジック、API動作、UI コンポーネントの動作を分析し、不足しているテストケースを特定・生成し、仕様書として文書化する。

前提条件

  • 分析対象のコードベースが存在する
  • docs/spec/{要件名}/ ディレクトリが存在する(なければ作成)
  • 可能であれば事前に /tsumiki:rev-requirements, /tsumiki:rev-design を実行済み

実行内容

  1. 既存テストの分析

    • 単体テスト(Unit Test)の実装状況確認
    • 統合テスト(Integration Test)の実装状況確認
    • E2Eテスト(End-to-End Test)の実装状況確認
    • テストカバレッジの測定
  2. 実装コードからテストケースの逆生成

    • 関数・メソッドの引数・戻り値からのテストケース生成
    • 条件分岐からの境界値テスト生成
    • エラーハンドリングからの異常系テスト生成
    • データベース操作からのデータテスト生成
  3. API仕様からテストケースの生成

    • 各エンドポイントの正常系テスト
    • 認証・認可テスト
    • バリデーションエラーテスト
    • HTTPステータスコードテスト
  4. UI コンポーネントからテストケースの生成

    • コンポーネントレンダリングテスト
    • ユーザーインタラクションテスト
    • 状態変更テスト
    • プロパティ変更テスト
  5. パフォーマンス・セキュリティテストケースの生成

    • 負荷テストシナリオ
    • セキュリティ脆弱性テスト
    • レスポンス時間テスト
  6. テスト仕様書の生成

    • テスト計画書
    • テストケース一覧
    • テスト環境仕様
    • テスト手順書
  7. ファイルの作成

    • docs/spec/{要件名}/test-specs.md - テスト仕様書
    • docs/spec/{要件名}/test-cases.md - テストケース一覧
    • docs/spec/{要件名}/tests/ - 生成されたテストコード

出力フォーマット例

test-specs.md

# {要件名} テスト仕様書(逆生成)

## 分析概要

**分析日時**: {実行日時}
**対象コードベース**: {パス}
**テストカバレッジ**: {現在のカバレッジ}%
**生成テストケース数**: {生成数}個
**実装推奨テスト数**: {推奨数}個

## 現在のテスト実装状況

### テストフレームワーク
- **単体テスト**: {Jest/Vitest/pytest等}
- **統合テスト**: {Supertest/TestContainers等}
- **E2Eテスト**: {Cypress/Playwright等}
- **コードカバレッジ**: {istanbul/c8等}

### テストカバレッジ詳細

| ファイル/ディレクトリ | 行カバレッジ | 分岐カバレッジ | 関数カバレッジ |
|---------------------|-------------|-------------|-------------|
| src/auth/ | 85% | 75% | 90% |
| src/users/ | 60% | 45% | 70% |
| src/components/ | 40% | 30% | 50% |
| **全体** | **65%** | **55%** | **75%** |

### テストカテゴリ別実装状況

#### 単体テスト
- [x] **認証サービス**: auth.service.spec.ts
- [x] **ユーザーサービス**: user.service.spec.ts
- [ ] **データ変換ユーティリティ**: 未実装
- [ ] **バリデーションヘルパー**: 未実装

#### 統合テスト
- [x] **認証API**: auth.controller.spec.ts
- [ ] **ユーザー管理API**: 未実装
- [ ] **データベース操作**: 未実装

#### E2Eテスト
- [ ] **ユーザーログインフロー**: 未実装
- [ ] **データ操作フロー**: 未実装
- [ ] **エラーハンドリング**: 未実装

## 生成されたテストケース

### API テストケース

#### POST /auth/login - ログイン認証

**正常系テスト**
```typescript
describe('POST /auth/login', () => {
  it('有効な認証情報でログイン成功', async () => {
    const response = await request(app)
      .post('/auth/login')
      .send({
        email: '[email protected]',
        password: 'password123'
      });

Read the full file on GitHub · 623 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 623 lines · 70 tokens per session scan A f13ac7dcb32f

Subscribe to this mod's changes

rev-specs is a command published in the GitHub repository classmethod/tsumiki (974 stars, last pushed 25d ago), licensed MIT. It adds 70 tokens to every session and 5,178 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.