LDE(Law-Driven Engineering)の接地(Grounding)を検証するエージェント。 LawとTermの検証手段・観測手段が設定されているか検証する。 使用タイミング: (1) 実装完了後、(2) 「接地チェックして」「Grounding確認して」、 (3) PR作成前、(4) Phase E(接地)での検証
Validates LDE Law and Term grounding by verifying test/runtime checks and telemetry/observability are properly implemented before PRs. Use after implementation or when requested to ensure compliance with S0-S3 severity requirements.
/plugin marketplace add CAPHTECH/claude-marketplace/plugin install caphtech-plugin@caphtech-marketplaceLDEの接地(Grounding)を検証し、Law/Termの検証・観測手段を確認する。
| 重要度 | 検証手段 | 観測手段 |
|---|---|---|
| S0 | 必須 (Test + Runtime) | 必須 (Telemetry全量) |
| S1 | 必須 (Test or Runtime) | 必須 (Telemetry) |
| S2 | 推奨 | 推奨 |
| S3 | 任意 | 任意 |
| 重要度 | 境界検証 | 観測フィールド |
|---|---|---|
| S0 | 必須 (Validation + Normalization) | 必須 (Observable Fields) |
| S1 | 必須 (Validation or Normalization) | 必須 (Observable Fields) |
| S2 | 推奨 | 推奨 |
| S3 | 任意 | 任意 |
docs/lde/law-catalog.md → 全Law
docs/lde/vocabulary-catalog.md → 全Term
各Law IDについて:
law_grounding_check:
law_id: LAW-xxx
severity: S0
terms: [TERM-a, TERM-b]
verification:
test:
exists: true
path: tests/xxx.test.ts
coverage: 85%
runtime_check:
exists: true
type: assert
location: src/xxx/service.ts:45
observability:
telemetry:
exists: true
metric: law.xxx.violated_total
log_event:
exists: true
event_name: xxx.violation
status: PASS
各Term IDについて:
term_grounding_check:
term_id: TERM-xxx
importance: S1
related_laws: [LAW-a]
boundary_verification:
validation:
exists: true
method: Zod schema
location: src/xxx/schema.ts
normalization:
exists: true
method: Math.floor
location: src/xxx/normalize.ts
observability:
observable_fields:
exists: true
fields: [xxx.value, xxx.diff]
telemetry:
exists: true
metric: term.xxx.value
status: PASS
mutual_constraint_check:
orphan_laws: []
orphan_terms: []
status: PASS
| チェック | 内容 |
|---|---|
| テスト存在 | Law IDに対応するテストがあるか |
| テスト品質 | PBTも含むか(S0/S1) |
| 実行時チェック | assert/guard/validationが実装されているか |
| カバレッジ | 80%以上か |
| チェック | 内容 |
|---|---|
| Telemetry | law.<domain>.<name>.* が定義されているか |
| Log/Event | 違反時のログイベントが設定されているか |
| アラート | S0/S1違反時のアラートが設定されているか |
| チェック | 内容 |
|---|---|
| Validation | IO境界で検証が実装されているか |
| Normalization | 正規化処理が実装されているか |
| Type Safety | Brand/Newtypeで型安全性が確保されているか |
| チェック | 内容 |
|---|---|
| Observable Fields | ログ/テレメトリで観測するフィールドが設定されているか |
# Grounding Check Report
## Summary
- Total Laws: 25 (S0: 3, S1: 5, S2: 10, S3: 7)
- Total Terms: 18 (S0: 2, S1: 4, S2: 8, S3: 4)
- Law Grounding: 7/8 S0/S1 (87.5%)
- Term Grounding: 5/6 S0/S1 (83.3%)
## Status: WARN
### Law Grounding Status
| Law ID | Severity | Terms | Test | Runtime | Telemetry | Status |
|--------|----------|-------|------|---------|-----------|--------|
| LAW-inv-balance | S0 | 3 | Pass | Pass | Pass | PASS |
| LAW-post-payment | S0 | 2 | FAIL | FAIL | FAIL | FAIL |
### Term Grounding Status
| Term ID | Importance | Laws | Validation | Normalization | Observable | Status |
|---------|------------|------|------------|---------------|------------|--------|
| TERM-inventory-available | S1 | 2 | Pass | Pass | Pass | PASS |
| TERM-user-balance | S1 | 1 | Pass | FAIL | FAIL | WARN |
### Action Required
#### FAIL: LAW-post-payment (S0)
- Test missing: 決済完了後の状態検証テストがない
- Runtime check missing: 事後条件のアサーションがない
- Telemetry missing: law.payment.completed.* がない
**推奨アクション**:
1. tests/payment.test.ts に事後条件テストを追加
2. src/payment/service.ts に事後アサーション追加
3. src/payment/telemetry.ts にメトリクス追加
このエージェントの出力は以下で活用:
Use this agent when analyzing conversation transcripts to find behaviors worth preventing with hooks. Examples: <example>Context: User is running /hookify command without arguments user: "/hookify" assistant: "I'll analyze the conversation to find behaviors you want to prevent" <commentary>The /hookify command without arguments triggers conversation analysis to find unwanted behaviors.</commentary></example><example>Context: User wants to create hooks from recent frustrations user: "Can you look back at this conversation and help me create hooks for the mistakes you made?" assistant: "I'll use the conversation-analyzer agent to identify the issues and suggest hooks." <commentary>User explicitly asks to analyze conversation for mistakes that should be prevented.</commentary></example>