@guardsmith/cli 0.2.1 → 0.2.2
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/README.md +126 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# @guardsmith/cli
|
|
2
|
+
|
|
3
|
+
**AI開発標準の配布と統制を1つにしたガバナンスツールキット GuardSmith の CLI(`guard` コマンド)。**
|
|
4
|
+
標準(CLAUDE.md / agents / skills のテンプレート)を配り、守られているかを機械検証します —
|
|
5
|
+
「ESLint + 公式config」の関係を AI コーディング標準に対して提供します。
|
|
6
|
+
|
|
7
|
+
_English follows Japanese._
|
|
8
|
+
|
|
9
|
+
## インストール
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx @guardsmith/cli <command> # 都度実行
|
|
13
|
+
# または
|
|
14
|
+
pnpm add -D @guardsmith/cli # プロジェクトに導入して pnpm guard <command>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Node.js 20 以上が必要です。
|
|
18
|
+
|
|
19
|
+
## クイックスタート
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# 新規プロジェクト: 標準雛形(CLAUDE.md / agents / skills / docs)から展開
|
|
23
|
+
npx @guardsmith/cli new my-project
|
|
24
|
+
|
|
25
|
+
# 既存プロジェクト: 検証ポリシーだけ生成
|
|
26
|
+
npx @guardsmith/cli init
|
|
27
|
+
|
|
28
|
+
# 検証(プレースホルダ残置・契約見出し欠落・資格情報混入などを検出。exit 1 = error)
|
|
29
|
+
npx @guardsmith/cli lint
|
|
30
|
+
|
|
31
|
+
# 配布ファイルのマスター乖離(drift)を確認 → 復元
|
|
32
|
+
npx @guardsmith/cli sync # dry-run
|
|
33
|
+
npx @guardsmith/cli sync --write # 適用
|
|
34
|
+
|
|
35
|
+
# ルールの意図を表示
|
|
36
|
+
npx @guardsmith/cli explain claude-md/thin-diff
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## ポリシー(guard.policy.yaml)
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
version: 1
|
|
43
|
+
target: claude-code
|
|
44
|
+
extends:
|
|
45
|
+
- github:novexar/guardsmith//presets/baseline.yaml@v0.2.1 # タグ固定必須
|
|
46
|
+
rules: [] # 追加・上書き(同idで再定義=上書き)
|
|
47
|
+
exemptions: [] # 期限付き例外(expires + approved_by 必須。期限切れは error)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`extends: github:owner/repo[//path]@tag` により OSS baseline → 組織 private overlay → 各プロジェクト
|
|
51
|
+
の3層合成ができます。private リポジトリは `GITHUB_TOKEN` 環境変数で取得します。
|
|
52
|
+
|
|
53
|
+
## CI(GitHub Action)
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
# .github/workflows/guard.yml
|
|
57
|
+
name: GuardSmith
|
|
58
|
+
on: [pull_request]
|
|
59
|
+
permissions:
|
|
60
|
+
contents: read
|
|
61
|
+
pull-requests: write
|
|
62
|
+
jobs:
|
|
63
|
+
guard:
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@v4
|
|
67
|
+
- uses: novexar/Guardsmith@v0.4.0
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
違反があるとジョブが失敗し、レポートが Job Summary と PR コメントに載ります(SARIF 出力対応)。
|
|
71
|
+
|
|
72
|
+
## ドキュメント
|
|
73
|
+
|
|
74
|
+
- リポジトリ / 導入ガイド: https://github.com/novexar/Guardsmith
|
|
75
|
+
- 3層 overlay 設計: https://github.com/novexar/Guardsmith/blob/main/docs/LAYERING.md
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
# English
|
|
80
|
+
|
|
81
|
+
**CLI (`guard`) for GuardSmith — a governance toolkit that unifies distribution and
|
|
82
|
+
enforcement of AI development standards.** It distributes standards (templates for
|
|
83
|
+
`CLAUDE.md` / agents / skills) and machine-verifies that projects follow them — the
|
|
84
|
+
"ESLint + official config" relationship, applied to AI coding standards.
|
|
85
|
+
|
|
86
|
+
## Install
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npx @guardsmith/cli <command> # one-off
|
|
90
|
+
# or
|
|
91
|
+
pnpm add -D @guardsmith/cli # per project, then: pnpm guard <command>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Requires Node.js 20+.
|
|
95
|
+
|
|
96
|
+
## Quick start
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
npx @guardsmith/cli new my-project # scaffold a new project from the standards master
|
|
100
|
+
npx @guardsmith/cli init # existing project: generate guard.policy.yaml only
|
|
101
|
+
npx @guardsmith/cli lint # verify (exit 1 = errors found)
|
|
102
|
+
npx @guardsmith/cli sync # show drift against the master (dry-run)
|
|
103
|
+
npx @guardsmith/cli sync --write # repair drift
|
|
104
|
+
npx @guardsmith/cli explain <rule> # explain a rule
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Policy (guard.policy.yaml)
|
|
108
|
+
|
|
109
|
+
`extends: github:owner/repo[//path]@tag` chains OSS baseline → private org overlay →
|
|
110
|
+
per-project policy (remote refs must pin a tag; private repos are fetched with the
|
|
111
|
+
`GITHUB_TOKEN` environment variable). Exemptions require `expires` + `approved_by`,
|
|
112
|
+
and expired exemptions surface as errors.
|
|
113
|
+
|
|
114
|
+
## CI enforcement
|
|
115
|
+
|
|
116
|
+
Use the GitHub Action `novexar/Guardsmith@v0.4.0` — on violations the job fails, the
|
|
117
|
+
report lands in the Job Summary and a PR comment, and a SARIF report is produced.
|
|
118
|
+
|
|
119
|
+
## Documentation
|
|
120
|
+
|
|
121
|
+
- Repository / getting started: https://github.com/novexar/Guardsmith
|
|
122
|
+
- 3-layer overlay design: https://github.com/novexar/Guardsmith/blob/main/docs/LAYERING.md
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardsmith/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "GuardSmith CLI — the guard binary (init / lint / sync / new / explain)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
"bin"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@guardsmith/core": "^0.2.
|
|
22
|
+
"@guardsmith/core": "^0.2.2"
|
|
23
23
|
}
|
|
24
24
|
}
|