Files
kebab/integrations/claude-code
altair823 00ffe9c792 feat(rag): fb-41 PR-9c-2 — pipeline integration + mock test + SKILL.md (★ NLI 실 활성화)
PR-9c-1 의 wire surface 위에 behavior 활성화 — `ask_multi_hop` 의 step 8.5 hook 가 `[rag] nli_threshold > 0` 일 때 NLI 검증 실 수행. **첫 user-visible behavior change** in PR-9.

- crates/kebab-rag/src/pipeline.rs:
  - ask_multi_hop step 8.5 NLI hook (empty answer 가드 + truncate_for_nli + verifier.score + verification field + refusal 분기).
  - refuse_nli_verification helper (verification: Some(...) + RefusalReason::NliVerificationFailed).
  - refuse_nli_model_unavailable helper (verification: None + RefusalReason::NliModelUnavailable).
  - truncate_for_nli helper (module-level pub fn, MAX_NLI_PREMISE_CHARS = 4 * 400 = 1600 chars 의 chars-based budget, _hypothesis 미사용 placeholder — v0.18.1 token-budget 갱신 candidate).
  - PR-9c-1 의 #[allow(dead_code)] 두 곳 제거 (verifier field + with_verifier builder; doc 의 transitional sentence 도 정리). round-1 PR-9c-1 review N1 carry-forward closure.
- crates/kebab-app/src/app.rs:
  - App::open_with_config 의 NliVerifier construction — config.rag.nli_threshold > 0 → OnnxNliVerifier::new + Arc::new wrap + 후속 RagPipeline 초기화 시 with_verifier 호출. 실패 시 ? 전파 (시그니처 Result<Self> 그대로 — caller cascading 0).
  - kebab-app/Cargo.toml 에 kebab-nli path 의존 추가.
- crates/kebab-rag/tests/multi_hop.rs + tests/common/mod.rs:
  - MockNliVerifier (pass / fail / err 생성자 + score call_count instrumented).
  - multi_hop_nli_pass_keeps_grounded — entailment 0.9 → grounded=true, verification.nli_passed=true.
  - multi_hop_nli_fail_refuses — entailment 0.1 → refusal=NliVerificationFailed.
  - multi_hop_nli_disabled_skip_verify — threshold 0.0 → verify skip, verification=None.
  - multi_hop_nli_model_unavailable_refuses — verifier Err → refusal=NliModelUnavailable.
  - multi_hop_truncate_for_nli_preserves_hypothesis — long premise truncation + hypothesis 보전.
- integrations/claude-code/kebab/SKILL.md: mcp__kebab__ask 절에 NLI 안내 한 단락 (verification.nli_passed 의미 + threshold tuning + nli_verification_failed/nli_model_unavailable refusal handling).

검증: cargo test --workspace -j 1 — 5 신규 multi-hop pass + 회귀 0 (pre-existing kebab-mcp::tools_call_ask_multi_hop 동일 flaky). cargo clippy --workspace --all-targets -j 1 -- -D warnings clean.
Wire 영향: PR-9c-1 의 schema 변경에 *behavior wiring* — answer.v1.verification field 가 multi-hop happy path + refuse path 양쪽에서 채움.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 00:55:02 +00:00
..

Claude Code integration

Skill packages that let Claude Code call kebab automatically when a question would benefit from the user's local KB.

Available skills

Skill Trigger What it does
kebab Internal / org-specific questions, runbooks, indexed-doc lookups Calls kebab search --json / kebab ask --json and folds the results into the answer with citations

Install

User-level (every Claude Code session on this machine):

# from a kebab repo checkout
cp -r integrations/claude-code/kebab ~/.claude/skills/

# verify
ls ~/.claude/skills/kebab/SKILL.md

Or symlink so git pull in the repo updates the skill in place:

mkdir -p ~/.claude/skills
ln -s "$(pwd)/integrations/claude-code/kebab" ~/.claude/skills/kebab

Project-level (only loads when Claude Code runs in a specific project):

mkdir -p <project>/.claude/skills
cp -r integrations/claude-code/kebab <project>/.claude/skills/

After install, start a fresh Claude Code session — the skill self-registers from its frontmatter description and is invoked automatically when a matching question shows up. No config edit needed.

Customization

The shipped SKILL.md is generic on purpose — it triggers on any "internal / org-specific" cue. To make Claude Code more eager (or less) for your corpus, edit the frontmatter description of your local copy and add the team / system / acronym keywords that should trigger the skill (e.g. MLOps, DMQ, AiSuite). Don't PR those keywords back into this repo — they're per-user.

A symlink install + a ~/.claude/skills/kebab/SKILL.md.local patch script is one pattern; another is to keep a fork branch with personalized frontmatter and rebase on main.

Update policy

The skill consumes kebab's wire schema v1 (schema_version fields like search_hit.v1, answer.v1). When the wire schema major-bumps to v2, this skill is updated in the same PR — see the project root CLAUDE.md §Wire schema v1.

Other hosts

kebab exposes the same --json contract to any agent host. To add a new integration:

  1. Drop a directory under integrations/<host>/ mirroring the structure here.
  2. Reference docs/wire-schema/v1/ for the JSON shapes.
  3. Link from this README.md table.

A native MCP server (kebab serve --mcp) and an HTTP wrapper are listed in the root README §외부 AI 통합 as future options.