extract-patterns

Extract code patterns from a codebase using AST and regex analysis.

3|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/GDSDN/kord-aios --skill extract-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extract-patterns
Source: https://github.com/GDSDN/kord-aios/tree/main/src/features/builtin-skills/kord-aios/dev-workflow/extract-patterns
Command: npx skills add https://github.com/GDSDN/kord-aios --skill extract-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of identifying, extracting, and documenting recurring code patterns within a project, ensuring consistency and providing a valuable reference for developers.

Core Features & Use Cases

  • Code Pattern Detection: Analyzes codebase using AST and regex to find common patterns.
  • Markdown Generation: Creates a patterns.md file documenting these patterns.
  • Use Case: A new developer joins a project and needs to understand the established ways of handling state management. This Skill generates a document outlining existing patterns (e.g., Zustand stores, Redux reducers) that the new developer can reference.

Quick Start

Run extract-patterns to generate a markdown file of code patterns.

Frequently Asked Questions about extract-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically extract and document code patterns from my project?

You can automatically document code patterns by running the extract-patterns tool, which analyzes your codebase using AST and regex to generate a markdown reference file of common patterns like state management and API calls.

What is the best way to generate a markdown reference for codebase consistency?

Generating a markdown reference for codebase consistency is best handled by AST analysis, which parses your project to identify recurring code patterns and outputs a detailed patterns.md file for developer onboarding.

How does AST analysis identify state management and API call patterns in a codebase?

AST analysis identifies state management and API call patterns by parsing the abstract syntax tree of your source code alongside regex checks, extracting structural code conventions to document them for development consistency.

Can I output extracted code patterns to JSON and merge them with existing files?

Yes, you can output extracted code patterns to JSON format. The tool supports JSON output and allows you to merge newly detected patterns with existing pattern files to maintain a continuous reference.

Does the extract-patterns tool require any external dependencies to analyze code?

No, the extract-patterns tool requires no external dependencies to analyze code. It operates independently using internal scripts and references to perform AST and regex analysis on your project files.

When should I use regex versus AST for documenting recurring code conventions?

You should use AST for parsing structural code conventions and regex for matching specific text patterns, as this tool combines both methods to accurately detect and document diverse code patterns within your project.