Skip to content

refactor(intelligence): 旧スキル taxonomy を撤去し ADR-0016 基盤へ一本化#444

Merged
yusuke0610 merged 2 commits into
mainfrom
feat/skill-remove-legacy-taxonomy
Jun 30, 2026
Merged

refactor(intelligence): 旧スキル taxonomy を撤去し ADR-0016 基盤へ一本化#444
yusuke0610 merged 2 commits into
mainfrom
feat/skill-remove-legacy-taxonomy

Conversation

@yusuke0610

@yusuke0610 yusuke0610 commented Jun 30, 2026

Copy link
Copy Markdown
Owner

概要

ADR-0016「GitHub 連携によるスキル推論基盤」の残タスクのうち タスク2(旧パイプライン撤去) を対応。ADR ステータス冒頭の「既存決定論パイプラインを本基盤へ段階移行」を完了させる。

旧辞書ベースのスキル抽出経路(skill_extractor.py + skill_taxonomy/)が新基盤(skills/aggregate_skillsgithub_skills テーブル)と並走していた状態を解消し、live 経路を新基盤に一本化する。

変更内容

  • pipeline.py: aggregate_intelligence(username, repos, detected_skills) に刷新
    • unique_skills は検出 Layer1 のうち 言語スキル(kind=language)の件数のみで算出(package は含めない)
    • repos_analyzed = len(repos) / languages は従来通り Linguist バイト数を横断合算
    • デッドコード run_pipelineextract_skills 依存を除去
  • github_link_service.py: detected_skills を先に算出 → aggregate_intelligence へ渡す順序に変更
  • 削除: skill_extractor.py + skill_taxonomy/(5ファイル, 計 482行)
  • GitHubLinkDashboard.tsx: 統計カードのラベルを「スキル」→「言語」に変更(言語のみの件数と意味を一致)
  • テスト: test_github_link.py の旧 extract_skills/run_pipeline テストを aggregate_intelligence 新シグネチャのテストへ置換
  • ドキュメント: architecture.md の live 経路図、ADR-0016 改訂履歴を更新

判断事項

  • ⚠️ 破壊的変更(ファイル削除): skill_extractor.py + skill_taxonomy/ 5ファイル
  • ⚠️ 挙動変更: dashboard の件数表示が「辞書ヒットのユニークスキル数」→「言語スキル件数」に変わる。API 契約 GitHubLinkResponse は不変
  • API フィールド名は unique_skills のまま(中身は言語件数)。リネームは契約変更+codegen+フロント波及になるため見送り、表示ラベル「言語」で意味を担保

テスト

  • make ci green(backend lint+test / web 365 tests / build)
  • codegen drift なし
  • E2E 不要(UI フロー・ルート不変、ラベル文言と数値のみ変更)

関連

  • ADR-0016 残タスクのうち タスク1(verify ステージ / import 解析)は後続 PR で対応予定

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • GitHub insights now include a clearer language-focused summary in the dashboard.
    • The overview label has been updated to show Languages instead of Skills.
  • Bug Fixes

    • Improved how repository analysis is combined, making language totals and unique language counts more consistent.
    • Removed outdated skill-detection behavior so results better match the latest analysis flow.

ADR-0016 の「既存決定論パイプラインを本基盤へ段階移行」を完了。
旧辞書ベースのスキル抽出(skill_extractor / skill_taxonomy)を撤去し、
live 経路を skills.aggregate_skills(3層モデル)に一本化する。

- pipeline.aggregate_intelligence を detected_skills 受け取りに変更
  - unique_skills は言語スキル(kind=language)の件数のみで算出
  - デッドコード run_pipeline と extract_skills 依存を除去
- github_link_service: detected_skills を先に算出して渡す順序に変更
- skill_extractor.py / skill_taxonomy/(5ファイル)を削除
- dashboard: 統計カードのラベルを「スキル」→「言語」に変更
- test_github_link を新シグネチャのテストへ置換
- architecture.md / ADR-0016 改訂履歴を更新

API 契約(GitHubLinkResponse)は不変。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@yusuke0610, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ace7b00-e0e4-407b-a9a0-f34a57096c94

📥 Commits

Reviewing files that changed from the base of the PR and between 35ac96b and 9b9d399.

📒 Files selected for processing (2)
  • backend/app/services/intelligence/pipeline.py
  • backend/tests/test_worker/test_github_link.py
📝 Walkthrough

Walkthrough

Removes the deterministic skill_extractor.py and skill_taxonomy/ modules. aggregate_intelligence now accepts detected_skills: List[DetectedSkill] externally and counts only language-kind skills for unique_skills. github_link_service is updated to pass detected_skills into this call. Tests, ADR-0016, architecture docs, and the dashboard stat label are updated accordingly.

Changes

Skill Pipeline Refactor

Layer / File(s) Summary
aggregate_intelligence signature and logic update
backend/app/services/intelligence/pipeline.py
Drops run_pipeline and internal extract_skills call; adds detected_skills: List[DetectedSkill] parameter; computes unique_skills by counting skills with kind == SKILL_KIND_LANGUAGE; repos_analyzed set to len(repos).
github_link_service wiring
backend/app/services/intelligence/github_link_service.py
Step 3 now builds detected_skills first, then passes it to aggregate_intelligence(username, repos, detected_skills).
Deletion of skill_extractor and skill_taxonomy
backend/app/services/intelligence/skill_extractor.py, backend/app/services/intelligence/skill_taxonomy/*
All deterministic extraction modules (ExtractedSkill, ExtractionResult, extract_skills, LANGUAGE_TO_SKILL, TOPIC_TO_SKILLS, DESCRIPTION_KEYWORDS, SKILL_CATEGORIES, etc.) are removed. Tests are updated: TestSkillExtractor and async pipeline tests removed; new aggregate_intelligence tests added covering language byte totals, unique_skills counting, and empty inputs.
ADR, architecture docs, and UI label
docs/adr/0016-github-skill-inference.md, .claude/rules/backend/architecture.md, web/src/components/github-link/GitHubLinkDashboard.tsx
ADR-0016 records migration completion; architecture diagram updated to skills/ module structure; dashboard stat card label changed from スキル to 言語.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • yusuke0610/devforge#245: Previously introduced the skill_extractor/skill_taxonomy pipeline that this PR removes.
  • yusuke0610/devforge#311: Also modifies run_github_link in github_link_service.py, intersecting at the same function changed here.
  • yusuke0610/devforge#417: Directly extends the detected_skills construction path in github_link_service that this PR introduces.

Poem

🐇 The old taxonomy maps are gone,
No more keyword hunts from dusk to dawn.
detected_skills flows in from outside,
Language kinds alone count with pride.
The rabbit hops through cleaner code — hooray!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 旧スキルtaxonomyの撤去とADR-0016基盤への一本化という主要変更を簡潔に表しています。
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/skill-remove-legacy-taxonomy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added refactor リファクタリング documentation Improvements or additions to documentation backend バックエンド web フロントエンド (web) test テスト追加・修正 labels Jun 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
backend/app/services/intelligence/pipeline.py (1)

2-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

「決定論的 / 純粋関数」という表現は今の実装とズレています。

IntelligenceResult.analyzed_at を内部で datetime.now() から生成しているので、出力は時刻依存です。ここは「I/O なしの集計関数」に留めるか、純粋性を本当に担保したいなら時刻を呼び出し側から注入したほうがよいです。

Also applies to: 33-44

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@backend/app/services/intelligence/pipeline.py` around lines 2 - 9, The module
docstring and aggregate flow in pipeline.py claim the intelligence pipeline is
deterministic/pure, but IntelligenceResult.analyzed_at is currently derived from
datetime.now(), making the output time-dependent. Update the implementation
around the aggregation function and IntelligenceResult construction so
analyzed_at is injected from the caller (or otherwise removed from this pure
aggregation path), and revise the wording near the pipeline docstring/aggregate
entrypoint to describe it as an I/O-free aggregation step rather than a pure
function.
backend/tests/test_github_link.py (1)

88-123: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

新しい detected_skills 受け渡しの疎通テストを 1 本だけ残したいです。

今の追加分は aggregate_intelligence 単体の振る舞いは押さえていますが、この PR の主変更である backend/app/services/intelligence/github_link_service.py での aggregate_skills(...) -> aggregate_intelligence(...) の受け渡し自体は未カバーです。軽い mock ベースの run_github_link テストが 1 本あると、この配線変更の回帰を拾いやすいです。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@backend/tests/test_github_link.py` around lines 88 - 123, Add one lightweight
wiring test for the new detected_skills path: the current tests cover
aggregate_intelligence behavior, but not the handoff from aggregate_skills(...)
to aggregate_intelligence(...) inside run_github_link in github_link_service.
Add a mock-based test around run_github_link that verifies detected skills
returned by aggregate_skills are passed through to aggregate_intelligence, so
this PR’s plumbing change is covered. Use the existing run_github_link and
aggregate_intelligence symbols to keep the test focused on the integration
point.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@backend/app/services/intelligence/pipeline.py`:
- Around line 2-9: The module docstring and aggregate flow in pipeline.py claim
the intelligence pipeline is deterministic/pure, but
IntelligenceResult.analyzed_at is currently derived from datetime.now(), making
the output time-dependent. Update the implementation around the aggregation
function and IntelligenceResult construction so analyzed_at is injected from the
caller (or otherwise removed from this pure aggregation path), and revise the
wording near the pipeline docstring/aggregate entrypoint to describe it as an
I/O-free aggregation step rather than a pure function.

In `@backend/tests/test_github_link.py`:
- Around line 88-123: Add one lightweight wiring test for the new
detected_skills path: the current tests cover aggregate_intelligence behavior,
but not the handoff from aggregate_skills(...) to aggregate_intelligence(...)
inside run_github_link in github_link_service. Add a mock-based test around
run_github_link that verifies detected skills returned by aggregate_skills are
passed through to aggregate_intelligence, so this PR’s plumbing change is
covered. Use the existing run_github_link and aggregate_intelligence symbols to
keep the test focused on the integration point.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dd4415bc-2e62-4aa2-abc3-f0bd128cc5ad

📥 Commits

Reviewing files that changed from the base of the PR and between d389b8f and 35ac96b.

📒 Files selected for processing (12)
  • .claude/rules/backend/architecture.md
  • backend/app/services/intelligence/github_link_service.py
  • backend/app/services/intelligence/pipeline.py
  • backend/app/services/intelligence/skill_extractor.py
  • backend/app/services/intelligence/skill_taxonomy/__init__.py
  • backend/app/services/intelligence/skill_taxonomy/classifier.py
  • backend/app/services/intelligence/skill_taxonomy/keyword_map.py
  • backend/app/services/intelligence/skill_taxonomy/language_map.py
  • backend/app/services/intelligence/skill_taxonomy/topic_map.py
  • backend/tests/test_github_link.py
  • docs/adr/0016-github-skill-inference.md
  • web/src/components/github-link/GitHubLinkDashboard.tsx
💤 Files with no reviewable changes (6)
  • backend/app/services/intelligence/skill_taxonomy/keyword_map.py
  • backend/app/services/intelligence/skill_taxonomy/topic_map.py
  • backend/app/services/intelligence/skill_extractor.py
  • backend/app/services/intelligence/skill_taxonomy/init.py
  • backend/app/services/intelligence/skill_taxonomy/language_map.py
  • backend/app/services/intelligence/skill_taxonomy/classifier.py

- pipeline.aggregate_intelligence の docstring から「純粋関数」表現を外し、
  analyzed_at が実行時刻依存(厳密には非純粋)である旨を明記
- run_github_link で aggregate_skills → aggregate_intelligence へ
  detected_skills が渡る配線を検証する単体テストを追加

挙動・API 契約・シグネチャは不変。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@yusuke0610
yusuke0610 merged commit b152643 into main Jun 30, 2026
20 checks passed
@yusuke0610
yusuke0610 deleted the feat/skill-remove-legacy-taxonomy branch July 20, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend バックエンド documentation Improvements or additions to documentation refactor リファクタリング test テスト追加・修正 web フロントエンド (web)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant