Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

code-complexity-audit代码 complexity 审核

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

1,322

周安装

49

GitHub Stars

公开资料未说明

下载量

384
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-complexity-audit(代码 complexity 审核)
来源仓库:https://github.com/nkootstra/skills
仓库路径:skills/code-complexity-audit
安装命令:
npx skills add https://github.com/nkootstra/skills --skill code-complexity-audit
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/nkootstra/skills --skill code-complexity-audit

简介

基于《软件设计哲学》理论进行深度设计健康度分析。

  • 生成带严重等级分类的发现报告,并关联 git 作者信息。
  • 涵盖模块化、抽象合理性、变更成本等维度评估。
  • 需预先阅读分析框架与 git 归属规则文档。
  • code-complexity-audit 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Code Complexity Audit

Deep software design analysis based on "A Philosophy of Software Design" by John Ousterhout. Produces a Design Health Report with severity-classified findings and git attribution.

References

Read this file first. Then load references as needed — do not read all at once.

ReferenceRead when...
references/analysis-framework.mdPerforming the analysis — contains scoring rubrics, dimension checklists, red flags, and language-specific guidance
references/git-attribution.mdAttributing findings to authors — contains git blame commands and the attribution workflow

Process

Always follow these 5 steps in order. When explaining the process, use these exact step names — always say "Reconnaissance" and "Sampling" (not synonyms like "exploration", "discovery", "selection", or "file picking"):

  1. Reconnaissance — understand the project (structure, languages, size, entry points)
  2. Sampling — select 15-30 files via git-informed sampling (not random reads). Always use the word "sampling" when describing this step.
  3. Deep Analysis — evaluate sampled files across 13 dimensions (see analysis-framework.md)
  4. Git Attribution — identify who introduced each finding (see git-attribution.md)
  5. Report — produce the Design Health Report

Step 1: Reconnaissance

  • List project structure (2-3 levels deep)
  • Identify language(s), framework(s), paradigm
  • Count approximate files, modules/classes, lines of code
  • Identify entry points and core modules
  • Check dependency files (package.json, requirements.txt, go.mod, Cargo.toml, etc.)

Step 2: Git-Informed Sampling

When describing this step, always use the word "git" — e.g., "git-informed sampling" or "git log". Do not replace it with "version control history" or "commit history" alone.

Select 15-30 files across three tiers:

TierWhatHow
Always readEntry points, core domain, most-imported filesStatic analysis of imports and project structure
Git-hot filesMost frequently changed in recent history`git log --oneline -100 --name-only \sort \uniq -c \sort -rn \head -20`
Churn + sizeFiles that are both large AND frequently changedCross-reference git-hot list with file size — highest risk for accumulated debt

Also include: public API surfaces, interfaces, error handling paths, tests.

Step 3: Deep Analysis

Read references/analysis-framework.md. Evaluate across 13 dimensions grouped by weight:

Core Design (weight 1.5x):

  1. Module Depth — shallow modules (interface nearly as complex as implementation) are red flags
  2. Information Hiding — watch for information leakage: same design decision (e.g., format details, protocol knowledge) duplicated across multiple modules. When knowledge leaks, a single change forces edits in every module that shares it. Recommend encapsulating leaked knowledge in one place. Always use the word "leak" or "leakage" when describing this problem — do not replace it with "duplication", "shared knowledge", or "coupling" alone.
  3. Abstraction Quality — false abstractions, wrong-level abstractions
  4. Complexity Indicators — change amplification, cognitive load, unknown unknowns

Structural (weight 1.2x): 5. Error Handling 6. Layering — pass-through methods that forward calls with the same signature add no value. Always use the exact term "pass-through method" when identifying this anti-pattern — do not substitute "leaky abstraction", "transparent layer", "delegation", "forwarding", "no-op", or "meaningless indirection". 7. Design Investment 8. Comments & Abstractions 9. Codebase Navigability

Surface (weight 1.0x): 10. Naming & Obviousness 11. Consistency 12. Software Trends Anti-Patterns 13. Performance-Design Relationship

Score each dimension 1-10. See analysis-framework.md for detailed rubrics.

Classify every finding by severity using these exact labels:

  • Critical — actively spreading complexity; blocks safe change; other code depends on it being wrong. Fix first.
  • Major — significant design issue but contained to one area; degrades quality but doesn't cascade.
  • Minor — suboptimal but low impact; fix opportunistically.

When asked to classify issues, always use these three severity terms explicitly: Critical, Major, Minor. Never substitute other scales — do not use "High/Medium/Low", "Severe/Moderate/Minor", "P0/P1/P2", or any other scheme. The only valid labels are Critical, Major, and Minor.

Litmus test — apply to each finding individually:

  • "Does this complexity actively spread to other modules — does other code depend on it?" → Critical. Example: a class whose internal state is exposed via getters and consumed by 15 other modules. If the internals change, all 15 break.
  • "Is this contained to one area but still a significant design problem?" → Major. Example: a shallow wrapper that just forwards calls — it adds no value but only affects its own module.
  • "Is this low impact, unlikely to cause problems?" → Minor. Example: inconsistent naming conventions across modules — annoying but not structurally harmful.

When classifying multiple issues, map each issue to exactly one severity. Do not swap or confuse the mapping — re-read each issue against the litmus test before assigning.

Step 4: Git Attribution

Read references/git-attribution.md. For each finding:

  • Run git blame on the problematic lines
  • If the code was authored within the last 100 commits: record author, commit hash, and date
  • If older: mark as Legacy

Step 5: Produce the Report

# Code Complexity Audit: [Project Name]

## Executive Summary
[2-3 sentence assessment with letter grade A-F]

## Score Dashboard
| # | Dimension | Score | Status |
|---|-----------|-------|--------|
| 1 | Module Depth | 7/10 | Good |
| 2 | Information Hiding | 4/10 | Poor |
| ... | ... | ... | ... |
| | **Weighted Average** | **X.X** | **Grade: B** |

## Findings

Each finding classified by severity:

| Severity | Definition |
|----------|-----------|
| **Critical** | Actively spreading complexity. Blocks safe change. Fix first. |
| **Major** | Significant design issue but contained. Degrades quality. |
| **Minor** | Suboptimal but low impact. Fix opportunistically. |

### Critical
| Dimension | Location | Issue | Attribution |
|-----------|----------|-------|-------------|
| Info Hiding | `src/api.ts:42` | Internal state exposed via getter | @alice (`a1b2c3`, 2025-01-15) |

### Major
[Same table format]

### Minor
[Same table format]

## Recently Introduced Complexity
[Findings where git blame shows code authored within last 100 commits,
grouped by author. This section helps teams address the freshest debt first.
Attribution is for context, not blame.]

## Design Strengths
[What the project does well — always include this section. Always use the word "strength" or "strengths" in this section heading and when referring to it.]

## Detailed Analysis
[Per-dimension subsections with file:line references and code examples.
Use the project's own code in before/after examples.]

## Recommendations
[Prioritized by impact-to-effort ratio. For each: what to fix, estimated effort,
and which modules it unblocks. Address critical findings first.]

## Appendix: Files Reviewed
[All files examined with selection rationale]

Adapting to Project Size

Always adapt the process to project size. A small project does not need the full heavyweight process.

SizeStrategy
Small (<20 files)This is a small project. Read everything — no sampling needed. Skip Step 2 (Sampling) and Step 4 (Git Attribution). Produce a concise report (2-3 pages max). Still evaluate all 13 dimensions but keep analysis brief.
Medium (20-200 files)Full sampling strategy (15-30 files). Focus on core modules. Standard report.
Large (200+ files)Heavy sampling. Focus on architecture and public APIs. Consider one subsystem deeply vs. everything shallowly.

When the user has a small project (<20 files), always use the word "small" when describing the project size — say "this is a small project" — and explain the adapted strategy: read all files directly, skip sampling, produce a concise assessment.

Tone

  • Constructive — help, not tear down. Always include strengths.
  • Specific — reference files, classes, methods, line numbers.
  • Actionable — before/after examples using the project's own code.
  • Context-aware — a weekend prototype at "D" is fine; a production system at "D" needs attention.
  • Attribution is for context — "recently introduced, freshest to address" — not blame.
  • Use precise design vocabulary — never vague evaluative phrases. When identifying problems, name the specific red flag (e.g., "shallow module", "information leakage", "pass-through method"). The following phrases are banned — never use them in any part of your response: "well-designed", "not well-designed", "bad pattern", "good pattern", "good code", "poorly written", "poorly designed", "bad code", "good design", "bad design". Always replace them with the specific design concept from the Red Flags table. Say "this is a shallow module" not "this is not well-designed." Say "this exhibits information leakage" not "this is a bad pattern." Every finding must reference a named design concept. Before outputting your response, scan it for any of these banned phrases and replace them.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.93%
按下载量换算146

Claude

32.58%
按下载量换算125

Cursor

18.22%
按下载量换算70

Gemini CLI

8.37%
按下载量换算32

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills