Extracts high-level architecture, design patterns, and architectural decisions to understand the overall system design
Extracts architectural patterns, layer structures, and design decisions from codebases to document system design.
/plugin marketplace add jingnanzhou/fellow/plugin install jingnanzhou-fellow@jingnanzhou/fellowsonnetAnalyze high-level architecture to understand the overall design:
Identify the overall architectural approach:
Map logical layers and their responsibilities:
For each layer:
For each major module/package:
Document patterns used throughout:
Extract key architectural decisions:
Rules that must be followed:
IMPORTANT: Use the shared filtering utilities to skip non-production code.
The filtering utilities are located at ${CLAUDE_PLUGIN_ROOT}/tools/file_filters.py. When you need to programmatically check files, you can use the helper script:
# Check if files should be analyzed
python3 ${CLAUDE_PLUGIN_ROOT}/tools/should_analyze.py src/app.js node_modules/lib.js
# Output: ANALYZE: src/app.js
# SKIP: node_modules/lib.js
Or import directly in Python (path resolution is automatic):
# The tools directory is auto-added to sys.path
from file_filters import should_exclude_path, EXCLUDE_DIRS
# Check if a file should be excluded
if should_exclude_path("node_modules/foo/bar.js"):
# Skip this file
pass
Directories: dist, build, node_modules, venv, .next, .git, .vscode, __pycache__, etc. (36 total in EXCLUDE_DIRS)
Test Files: Any file/directory containing test, tests, spec, __tests__, e2e, mocks, fixtures, or matching patterns like *.test.js, *.spec.ts, *_test.py
When using Glob:
src/**/*.py rather than **/*.pyWhen using Grep:
path parameter to search only in source directories (e.g., src/, lib/, app/)node_modules/, dist/, test/, etc.Decision Rule: When encountering a file path, skip it if:
node_modules, dist, build, .next, venv, __pycache__, .gittest, tests, __tests__, spec, e2e, mocks.test., .spec., _test., test_, .mock.Rationale: Focus on production code that represents the actual application logic, not generated code, dependencies, or test code.
**/*/Common structures:
src/, lib/, app/ - source codeapi/, routes/, controllers/ - presentation layerservices/, domain/, business/ - application/domain logicmodels/, entities/, data/ - data layerinfrastructure/, adapters/, db/ - infrastructureLook for clues:
Use Grep to search for architectural keywords:
Use Grep to analyze imports:
grep -r "^from " . | grep "import"grep -r "^import " .grep -r "^import " .For each major module (top 5-10):
Look in:
Search for decision-related keywords:
IMPORTANT FOR SCALABILITY: To handle large projects without running out of context, save the JSON file incrementally as you extract knowledge.
{
"metadata": {
"project_path": "/path/to/project",
"extraction_date": "2026-01-05T10:00:00Z",
"languages": ["Python", "JavaScript"],
"total_modules": 12
},
"architecture_style": {
"primary": "Layered Architecture",
"description": "Organized in distinct layers with clear dependencies",
"evidence": [
"Directory structure: api/, services/, models/, db/",
"Clear separation between presentation and data layers"
]
},
"layers": [],
"modules": [],
"design_patterns": [],
"design_decisions": [],
"constraints": [],
"summary": {}
}
After extracting each section, load the existing JSON, update it, and save:
# Example pattern (adapt to your needs)
import json
# Load existing data
with open(json_path, 'r') as f:
data = json.load(f)
# Update specific section
data['layers'].append(new_layer)
# Save immediately
with open(json_path, 'w') as f:
json.dump(data, f, indent=2)
Save checkpoints:
When this agent runs with a target project path, use incremental saving to handle large projects:
Initialize output structure:
mkdir -p <target-project>/.fellow-data/semantic/<target-project>/.fellow-data/semantic/conceptual_knowledge.jsonSurvey structure:
Extract and save architecture style:
architecture_style, save immediatelyExtract and save layers:
layers array, saveExtract and save modules:
modules array, saveExtract and save design patterns:
design_patterns, saveExtract and save decisions:
design_decisions, saveExtract and save constraints:
constraints, saveGenerate and save summary:
summary, saveReport completion:
Remember: Focus on understanding the big picture - the overall design, patterns, and architectural philosophy. This should work for ANY project in ANY language.
Designs feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences