Project knowledge extraction and graph structure rules. Defines how to analyze, document, and maintain project architecture knowledge using Serena MCP.
How this skill is triggered — by the user, by Claude, or both
Slash command
/chkim-su-serena-refactor:project-knowledge-graphThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Define rules and patterns for extracting, structuring, and maintaining comprehensive project knowledge using Serena MCP's symbol-level analysis capabilities.
Define rules and patterns for extracting, structuring, and maintaining comprehensive project knowledge using Serena MCP's symbol-level analysis capabilities.
| Entity Type | Description | Serena Tool |
|---|---|---|
Module | File or directory that groups related code | list_dir, get_symbols_overview |
Symbol | Class, function, method, variable | find_symbol |
Dependency | Import or reference relationship | find_referencing_symbols |
Pattern | Repeated design pattern or convention | Pattern analysis |
Convention | Naming, structure, or style rules | Convention extraction |
KnowledgeGraph:
project:
name: string
root_path: string
language: string[]
modules:
- path: string
type: "file" | "directory"
symbols: Symbol[]
dependencies: Dependency[]
symbols:
- name: string
type: "class" | "function" | "method" | "variable" | "interface"
file: string
line: number
visibility: "public" | "private" | "protected"
dependencies: string[]
dependents: string[]
patterns:
- name: string
type: "structural" | "behavioral" | "creational"
instances: SymbolRef[]
conventions:
- category: "naming" | "structure" | "import" | "export"
rule: string
examples: string[]
Directory Scan
Serena: list_dir with recursive=true
Output: File tree with types
Entry Points Identification
main, index, app, __init__*.config.*, *.json, *.yamlPer-File Symbol Overview
Serena: get_symbols_overview for each file
Extract: Classes, functions, methods, variables
Symbol Details
Serena: find_symbol with include_body=true
Extract: Full definition, parameters, return types
Outgoing Dependencies
Incoming Dependencies (Dependents)
Serena: find_referencing_symbols for key symbols
Map: Which symbols depend on this one
| Pattern | Detection Method |
|---|---|
| Factory | Classes ending with Factory, methods named create* |
| Repository | Classes ending with Repository, implementing CRUD |
| Service | Classes ending with Service, with business logic |
| Controller | Classes ending with Controller, handling requests |
| Strategy | Interface + multiple implementations |
| Observer | subscribe, notify, emit patterns |
Naming Conventions
Structure Conventions
Store extracted knowledge in Serena memories for future sessions:
Serena: write_memory
Key: "project-knowledge-graph.md"
Content: Serialized knowledge graph
# Project Knowledge Graph
Generated: [timestamp]
## Project Overview
- Name: [project_name]
- Languages: [languages]
- Entry Points: [entry_points]
## Module Map
[Hierarchical module structure]
## Key Symbols
[Top-level classes and functions with roles]
## Dependency Graph
[Mermaid diagram or text representation]
## Detected Patterns
[Pattern instances with locations]
## Conventions
[Extracted naming and structure rules]
| Query | Implementation |
|---|---|
| "Find all services" | search_for_pattern: "class.*Service" |
| "Show dependencies of X" | find_referencing_symbols + find_symbol |
| "List all entry points" | Search for main/index patterns |
| "Get module structure" | list_dir + get_symbols_overview |
QueryResult:
query: string
matches:
- symbol: string
file: string
line: number
relevance: number
context: string
When files change, update only affected portions:
The knowledge graph enables intelligent feature injection by providing:
npx claudepluginhub chkim-su/serena-refactorGuides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Provides Slack GIF creation utilities with dimension/FPS/color constraints and Python PIL-based frame generation. Use for animated Slack emoji or message GIFs.