AgentSkillsCN

libanalysis

libanalysis——代码分析与格式化实用工具。formatForAnalysis 函数能够借助 Prettier 格式化工具,为 LLM 代码评审任务生成带有行号的 Markdown 文档。适用于文档准备、代码分析,以及为 AI 处理生成带有序号的参考文档。

SKILL.md
--- frontmatter
name: libanalysis
description: >
  libanalysis - Code analysis and formatting utilities. formatForAnalysis
  function prepares markdown documents with Prettier formatting and line numbers
  for LLM code review tasks. Use for document preparation, code analysis, and
  creating numbered reference documents for AI processing.

libanalysis Skill

When to Use

  • Preparing documents for LLM-based code review
  • Formatting markdown with line numbers for reference
  • Creating numbered documents for analysis tasks
  • Pre-processing content before sending to AI

Key Concepts

formatForAnalysis: Formats markdown content using Prettier and prepends line numbers, making it easy for LLMs to reference specific lines in their responses.

Usage Patterns

Pattern 1: Format document for analysis

javascript
import { formatForAnalysis } from "@copilot-ld/libanalysis";

const document = `# README
This is a code sample.`;

const formatted = await formatForAnalysis(document);
// Returns:
// 1: # README
// 2: This is a code sample.

Integration

Standalone utility used in analysis scripts and evaluation pipelines.