@shuji-bonji/houki-abbreviations 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 shuji-bonji
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,158 @@
1
+ # @shuji-bonji/houki-abbreviations
2
+
3
+ > 日本の法令略称・通称の共有辞書。houki-hub MCP family が共通で利用する基盤パッケージ。
4
+
5
+ [![CI](https://github.com/shuji-bonji/houki-abbreviations/actions/workflows/ci.yml/badge.svg)](https://github.com/shuji-bonji/houki-abbreviations/actions/workflows/ci.yml)
6
+ [![npm version](https://img.shields.io/npm/v/@shuji-bonji/houki-abbreviations.svg)](https://www.npmjs.com/package/@shuji-bonji/houki-abbreviations)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
8
+
9
+ ## 何のパッケージか
10
+
11
+ 日本の法令には「消法」「労基法」「電帳法」のような**略称**と、「電子帳簿保存法」のような**通称**があります。条文を参照したい LLM や MCP は、ユーザーがどの呼称で入力しても正式名称・e-Gov law_id に解決できる必要があります。
12
+
13
+ このパッケージは、houki-hub MCP family(`houki-egov-mcp`、`houki-nta-mcp`、`houki-mhlw-mcp` 等)が**共通で参照する辞書層**です。各 MCP が独自に同じデータを持たないように、ここに一元化しています。
14
+
15
+ ```mermaid
16
+ graph TB
17
+ subgraph "houki-hub MCP family"
18
+ Egov[houki-egov-mcp]
19
+ NTA[houki-nta-mcp]
20
+ MHLW[houki-mhlw-mcp]
21
+ end
22
+
23
+ Abbr["@shuji-bonji/houki-abbreviations<br/>略称辞書"]
24
+
25
+ Egov --> Abbr
26
+ NTA --> Abbr
27
+ MHLW --> Abbr
28
+
29
+ style Abbr fill:#fff4d6
30
+ ```
31
+
32
+ ## v0.1.0 の収録範囲
33
+
34
+ - **165 エントリ**(6 分野)
35
+ - **法律・政令・省令・規則・憲法**(e-Gov 法令API 配下)
36
+ - 全エントリ `source_mcp_hint='houki-egov'`
37
+
38
+ | 分野 | 件数 | 例 |
39
+ |---|---|---|
40
+ | tax | 26 | 所法、消法、電帳法 |
41
+ | labor | 28 | 労基法、安衛法、フリーランス新法 |
42
+ | accounting | 9 | 公認会計士法、会計士法 |
43
+ | commercial | 31 | 会社、商法、電子署名法、資金決済法 |
44
+ | civil | 23 | 民、民訴法、不動産登記法 |
45
+ | administrative | 48 | 憲法、行手法、個情法、プロ責法 |
46
+
47
+ ## インストール
48
+
49
+ ```sh
50
+ npm install @shuji-bonji/houki-abbreviations
51
+ ```
52
+
53
+ ## 使い方
54
+
55
+ ```ts
56
+ import {
57
+ resolveAbbreviation,
58
+ listByDomain,
59
+ listByCategory,
60
+ listBySourceMcpHint,
61
+ getAbbreviationStats,
62
+ } from '@shuji-bonji/houki-abbreviations';
63
+
64
+ // 略称・通称・正式名称のいずれからもエントリを引ける
65
+ const r = resolveAbbreviation('消法');
66
+ // {
67
+ // abbr: '消法',
68
+ // formal: '消費税法',
69
+ // law_id: '363AC0000000108',
70
+ // law_num: '昭和六十三年法律第百八号',
71
+ // law_type: 'Act',
72
+ // domain: 'tax',
73
+ // category: 'law',
74
+ // source_mcp_hint: 'houki-egov',
75
+ // aliases: ['消費税']
76
+ // }
77
+
78
+ // 通称・aliases でも引ける
79
+ resolveAbbreviation('電子帳簿保存法')?.abbr; // '電帳法'
80
+ resolveAbbreviation('PL法')?.formal; // '製造物責任法'
81
+
82
+ // 分野別・カテゴリ別・MCP 別の一覧
83
+ listByDomain('tax'); // 26 件
84
+ listByCategory('cabinet-order'); // 政令系
85
+ listBySourceMcpHint('houki-egov'); // e-Gov 管轄全件
86
+
87
+ // 統計
88
+ getAbbreviationStats();
89
+ // { total: 165, byDomain: {...}, byCategory: {...}, bySourceMcpHint: {...} }
90
+ ```
91
+
92
+ ## API
93
+
94
+ ### `resolveAbbreviation(name: string): AbbreviationEntry | null`
95
+
96
+ 略称・通称・正式名称のいずれかからエントリを引きます。前後の空白はトリムされます。完全一致のみ(部分一致なし)。見つからない場合は `null`。
97
+
98
+ ### `listByDomain(domain: Domain): AbbreviationEntry[]`
99
+
100
+ `'tax' | 'labor' | 'accounting' | 'commercial' | 'civil' | 'administrative'` のいずれかで絞り込み。
101
+
102
+ ### `listByCategory(category: Category): AbbreviationEntry[]`
103
+
104
+ 法令種別で絞り込み。`'constitution' | 'law' | 'cabinet-order' | 'imperial-ordinance' | 'ministerial-ordinance' | 'rule' | 'kihon-tsutatsu' | 'kobetsu-tsutatsu' | 'qa-jirei' | 'tax-answer' | 'hanrei' | 'saiketsu'` のいずれか。
105
+
106
+ ### `listBySourceMcpHint(hint: SourceMcpHint): AbbreviationEntry[]`
107
+
108
+ このエントリを処理すべき MCP で絞り込み。各 MCP が起動時に「自分の管轄エントリだけ」を抽出する用途を想定。
109
+
110
+ ### `getAbbreviationStats(): AbbreviationStats`
111
+
112
+ 辞書全体の統計(総数、ドメイン別、カテゴリ別、MCP 別)。
113
+
114
+ ## エントリ型
115
+
116
+ ```ts
117
+ interface AbbreviationEntry {
118
+ abbr: string; // 略称(例: '消法')
119
+ formal: string; // 正式名称(例: '消費税法')
120
+ law_id: string | null; // e-Gov law_id(verified 済みのみ)
121
+ law_num?: string; // 法令番号(例: '昭和六十三年法律第百八号')
122
+ law_type?: LawTypeCode; // 'Act' | 'CabinetOrder' | ...(後方互換)
123
+ domain: Domain; // 分野タグ
124
+ category: Category; // 法令カテゴリ
125
+ source_mcp_hint: SourceMcpHint; // 参照すべき MCP
126
+ aliases?: string[]; // 同義の別表記
127
+ note?: string; // 備考
128
+ }
129
+ ```
130
+
131
+ ## category と source_mcp_hint の対応
132
+
133
+ | category | 例 | source_mcp_hint |
134
+ |---|---|---|
135
+ | `constitution` | 日本国憲法 | houki-egov |
136
+ | `law` | 消費税法、労働基準法 | houki-egov |
137
+ | `cabinet-order` | 消費税法施行令 | houki-egov |
138
+ | `ministerial-ordinance` | 消費税法施行規則 | houki-egov |
139
+ | `rule` | 各庁規則 | houki-egov |
140
+ | `kihon-tsutatsu` *(将来)* | 消費税法基本通達 | houki-nta |
141
+ | `kobetsu-tsutatsu` *(将来)* | 個別通達 | houki-nta / houki-mhlw |
142
+ | `qa-jirei` *(将来)* | 質疑応答事例 | houki-nta |
143
+ | `hanrei` *(将来)* | 判例 | houki-court |
144
+ | `saiketsu` *(将来)* | 国税不服審判所裁決 | houki-saiketsu |
145
+
146
+ v0.1.0 では `houki-egov` 管轄のみ。`houki-nta-mcp` 等の開発と並行してエントリを追加していきます。
147
+
148
+ ## 貢献方法
149
+
150
+ 辞書の追加・修正は PR でお願いします。詳しくは [CONTRIBUTING.md](CONTRIBUTING.md) を参照。
151
+
152
+ ## リリース
153
+
154
+ リリース手順・Trusted Publisher 設定・トラブルシュートは [docs/RELEASE.md](docs/RELEASE.md) を参照。
155
+
156
+ ## ライセンス
157
+
158
+ MIT
@@ -0,0 +1,87 @@
1
+ [
2
+ {
3
+ "abbr": "会社計算規則",
4
+ "formal": "会社計算規則",
5
+ "law_id": null,
6
+ "law_type": "MinisterialOrdinance",
7
+ "domain": "accounting",
8
+ "category": "ministerial-ordinance",
9
+ "source_mcp_hint": "houki-egov"
10
+ },
11
+ {
12
+ "abbr": "財規",
13
+ "formal": "財務諸表等の用語、様式及び作成方法に関する規則",
14
+ "law_id": null,
15
+ "law_type": "MinisterialOrdinance",
16
+ "domain": "accounting",
17
+ "category": "ministerial-ordinance",
18
+ "source_mcp_hint": "houki-egov",
19
+ "aliases": [
20
+ "財務諸表等規則"
21
+ ]
22
+ },
23
+ {
24
+ "abbr": "連結財規",
25
+ "formal": "連結財務諸表の用語、様式及び作成方法に関する規則",
26
+ "law_id": null,
27
+ "law_type": "MinisterialOrdinance",
28
+ "domain": "accounting",
29
+ "category": "ministerial-ordinance",
30
+ "source_mcp_hint": "houki-egov"
31
+ },
32
+ {
33
+ "abbr": "四半期財規",
34
+ "formal": "四半期財務諸表等の用語、様式及び作成方法に関する規則",
35
+ "law_id": null,
36
+ "law_type": "MinisterialOrdinance",
37
+ "domain": "accounting",
38
+ "category": "ministerial-ordinance",
39
+ "source_mcp_hint": "houki-egov"
40
+ },
41
+ {
42
+ "abbr": "中間財規",
43
+ "formal": "中間財務諸表等の用語、様式及び作成方法に関する規則",
44
+ "law_id": null,
45
+ "law_type": "MinisterialOrdinance",
46
+ "domain": "accounting",
47
+ "category": "ministerial-ordinance",
48
+ "source_mcp_hint": "houki-egov"
49
+ },
50
+ {
51
+ "abbr": "公認会計士法",
52
+ "formal": "公認会計士法",
53
+ "law_id": null,
54
+ "law_type": "Act",
55
+ "domain": "accounting",
56
+ "category": "law",
57
+ "source_mcp_hint": "houki-egov"
58
+ },
59
+ {
60
+ "abbr": "税理士法",
61
+ "formal": "税理士法",
62
+ "law_id": null,
63
+ "law_type": "Act",
64
+ "domain": "accounting",
65
+ "category": "law",
66
+ "source_mcp_hint": "houki-egov"
67
+ },
68
+ {
69
+ "abbr": "会計検査院法",
70
+ "formal": "会計検査院法",
71
+ "law_id": null,
72
+ "law_type": "Act",
73
+ "domain": "accounting",
74
+ "category": "law",
75
+ "source_mcp_hint": "houki-egov"
76
+ },
77
+ {
78
+ "abbr": "法会規",
79
+ "formal": "法人の会計の公正な処理の基準に関する規則",
80
+ "law_id": null,
81
+ "law_type": "MinisterialOrdinance",
82
+ "domain": "accounting",
83
+ "category": "ministerial-ordinance",
84
+ "source_mcp_hint": "houki-egov",
85
+ "note": "(通称なし・参考参照用)"
86
+ }
87
+ ]