linguistic-semantic-algorithms

使用 NLP 与图算法对陌生代码库进行映射的工具集,涵盖主题建模、语义嵌入、代码图、仓库挖掘、克隆检测、基于信息检索的缺陷定位、标识符语言学与复杂度度量等约 40 种算法。适用于跨文件排查缺陷、规划新功能、识别领域实体、分析提交历史或寻找代码位置与风险评估的场景。

仓库最近推送
GitHub Stars
228
Forks
20
Issues / PRs
3

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "linguistic-semantic-algorithms":https://skillpi.com/zh/skills/deepskill-01a8b7f79985c82118022796db1c4e39ac8858f69f2dc8b94265dd7f4ff8a5fd。安装前核对上游来源和版本:https://github.com/pproenca/dot-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

使用 NLP 与图算法对陌生代码库进行映射的工具集,涵盖主题建模、语义嵌入、代码图、仓库挖掘、克隆检测、基于信息检索的缺陷定位、标识符语言学与复杂度度量等约 40 种算法。适用于跨文件排查缺陷、规划新功能、识别领域实体、分析提交历史或寻找代码位置与风险评估的场景。

0 下载

介绍来源: third_party · pproenca · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: linguistic-semantic-algorithms
description: Mapping out an unfamiliar codebase via NLP and graph algorithms — 40 algorithms across topic modelling, semantic embeddings, code graphs, repository mining, clone detection, IR-based bug localization, identifier linguistics, and complexity metrics. Trigger when hunting bugs across many files, scoping a new feature, identifying domain entities, or analyzing commit history — even if the user doesn't explicitly mention algorithms — apply when they ask "where does X live in this codebase?", "what is this codebase about?", "find duplicated logic", "what changed recently?", "who owns this code?", or "is this function risky?".

pproenca Linguistic and Semantic Algorithms Best Practices

Reference of 40 algorithms an agent should reach for when extracting structure, meaning, history, or risk signals from source code and commit data. Categories are ordered by insight-per-effort — how much non-obvious truth the technique exposes relative to how easy it is to apply. The first two categories target the highest-leverage questions: what business entities live in this code? and where else does this concept already exist? — questions that grep and intuition cannot answer.

When to Apply

Reach for these algorithms when:

  • Orienting in an unfamiliar codebase: PageRank the import graph to find the core, run LDA over identifier tokens to discover business themes, mine change coupling to surface hidden architectural couplings.
  • Hunting a bug from a description: BM25 + history prior + embedding re-rank produces a ranked file shortlist far better than grep.
  • Scoping a feature: find prior PRs that did similar work via embedding similarity; map the feature's vocabulary against the codebase's domain via TF-IDF and noun-phrase mining.
  • Reviewing a refactor: AST-level GumTree diff reveals semantic impact text diff hides; PDG isomorphism finds the "same logic, different code" twin you should also update.
  • Auditing risk: hotspots (churn × complexity), bus factor, defect-magnet density, dead-code candidates — together they direct attention to the parts of the codebase that pay back attention.
  • Identifying domain entities and bounded contexts: noun-phrase mining + TF-IDF rare-term extraction + Louvain communities + Jensen-Shannon divergence on per-cluster vocabulary.

Rule Categories by Priority

Priority Category Impact Prefix Question answered
1 Concept & Domain Extraction CRITICAL concept- What business entities live in this code?
2 Semantic Similarity & Feature Mapping CRITICAL sim- Where else does this concept already exist?
3 Architectural Topology HIGH graph- What is the shape of this codebase?
4 Co-Change & Temporal Mining HIGH mine- What hidden couplings does history reveal?
5 Clone & Duplication Detection MEDIUM-HIGH clone- Where are we repeating ourselves?
6 Bug & Feature Localization MEDIUM-HIGH local- Given a description, where in code?
7 Identifier Linguistics MEDIUM ling- How to prepare tokens so the other algorithms work?
8 Complexity & Risk Metrics MEDIUM risk- Where is the danger concentrated?

Quick Reference

1. Concept & Domain Extraction (CRITICAL)

2. Semantic Similarity & Feature Mapping (CRITICAL)

3. Architectural Topology (HIGH)

4. Co-Change & Temporal Mining (HIGH)

5. Clone & Duplication Detection (MEDIUM-HIGH)

6. Bug & Feature Localization (MEDIUM-HIGH)

7. Identifier Linguistics (MEDIUM)

8. Complexity & Risk Metrics (MEDIUM)

How to Use

Pick the category that matches the user's question, then read one or two specific rules from that category. Most rules cite combinable partners ("Combine with mine-change-coupling...") that compound the signal — read the partner rule when you need higher precision.

For unfamiliar repos, the highest-ROI starting sequence is:

  1. graph-pagerank-core → read the top-20 most central files
  2. concept-lda-topic-modeling + concept-tfidf-rare-terms → identify the business themes
  3. mine-hotspots-churn-complexity → find where the bugs concentrate
  4. mine-change-coupling → uncover hidden architectural couplings

For a single-task bug or feature, the pipeline is:

  1. local-bm25-saturation (broad candidates) → local-embedding-bug-text (semantic re-rank) → local-history-prior-localization (fix-history boost)
  2. sim-cross-pr-feature-mapping for prior precedent on new features
  3. mine-change-coupling to surface partner files that historically move together

Always preprocess identifier tokens via ling-camel-snake-split → ling-abbreviation-expansion → ling-porter-stemming before any vocabulary-based algorithm. Skipping this step silently degrades every downstream signal.

Cross-language parsing. Most rule code examples use Python's built-in ast module for brevity. For real cross-language work (Go, Rust, Java, TS, C++ in the same repo), use tree-sitter — it provides robust parsers for 40+ languages with a uniform API. Every AST-based rule in this skill (PDG clones, GumTree, Zhang-Shasha, POS-tag heads, identifier co-occurrence) maps cleanly onto tree-sitter ASTs.

Reference Files

File Description
references/_sections.md Category definitions and impact ordering
assets/templates/_template.md Template for adding new algorithm rules
metadata.json Version and reference information

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值95/100

亮点

  • 覆盖代码库语义分析、缺陷定位、架构拓扑、克隆检测等开发者高频刚需场景
  • 提供40种算法并按洞察效率排序,显著提升跨文件排查与功能规划效率
触发精准95/100

亮点

  • 触发词覆盖多种自然语言查询变体(如'where does X live'、'find duplicated logic')
  • 边界清晰,无歧义或与其他Skill重叠风险
结构规范90/100

亮点

  • 结构清晰:含应用场景、算法分类、快速参考、使用指南等完整章节
  • 提供端到端示例(如四步启动序列)和预处理最佳实践
执行可靠85/100

待提升项

  • 引用文件完整性未验证 原报告严重程度:轻微

    Skill 引用了 references/ 目录下多个 .md 文件(如 concept-lda-topic-modeling.md),但未确认这些文件是否真实存在于 ZIP 包中

    改进建议:请确保所有被引用的参考文件(references/*.md、assets/templates/_template.md、metadata.json)均完整打包,避免用户执行时出现缺失依赖

亮点

  • 算法工具来源明确(CodeBERT、tree-sitter、GumTree等)
  • 强调标识符预处理流程(ling-*系列)以提升下游信号质量
  • 提供跨语言解析方案(tree-sitter)支持多语言代码库
证据可验 (前四项均值)91/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • tree-sitter.github.io

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。