Commit Graph
11 Commits
Author SHA1 Message Date
Lum1104andClaude Opus 4.6 398f5b15b0 feat: add PythonExtractor for tree-sitter Python structural analysis
Implements the LanguageExtractor interface for Python, extracting functions
(with type annotations, defaults, *args/**kwargs), classes (methods +
annotated properties), imports (plain, from, aliased, wildcard), exports
(top-level defs), and caller-callee call graphs. Includes 31 tests using
the real tree-sitter parser.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:28:38 +08:00
Lum1104andClaude Opus 4.6 9376375c8c feat: add extractCallGraph to PluginRegistry, derive DEFAULT_PLUGIN_CONFIG from configs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:20:31 +08:00
Lum1104andClaude Opus 4.6 ab011ff856 refactor: move TS/JS extraction logic to TypeScriptExtractor, dispatch via LanguageExtractor interface
Extract all TypeScript/JavaScript-specific AST extraction functions
(extractParams, extractReturnType, extractImportSpecifiers, processTopLevelNode,
extractFunction, extractClass, extractVariableDeclarations, extractImport,
processExportStatement, and call graph walking) from TreeSitterPlugin into the
new TypeScriptExtractor class. TreeSitterPlugin now dispatches to registered
LanguageExtractor instances, defaulting to TypeScriptExtractor for backward
compatibility. All 426 existing tests pass unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:17:09 +08:00
Lum1104andClaude Opus 4.6 4f954907ec feat: add LanguageExtractor interface and shared base utilities
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:12:07 +08:00
Lum1104andClaude Opus 4.6 4d2cb32232 fix: address comprehensive code review findings for PR #51
Fix all issues from the 5-agent parallel code review of universal file
type support:

- Parser error handling: add console.warn in JSON/YAML catch blocks,
  warn on unbalanced braces in Protobuf/Terraform parsers
- Parser correctness: filter .PHONY special targets in Makefile parser,
  handle opening brace on next line in Shell parser, fix per-stage
  EXPOSE port assignment in Dockerfile parser
- Graph builder: use nodeType-based ID prefix instead of hardcoded
  "file:", warn on unknown definition kinds, detect duplicate node IDs
- Type safety: export NodeType alias, add ServiceInfo.lineRange, type
  dashboard color maps as Record<NodeType,...>, refactor
  getDirectionalLabel to Record<EdgeType,...>, consolidate NodeCategory
- Schema: add StrictLanguageConfigSchema with extensions/filenames
  refinement, fix Infrastructure/Schema-Data category comments
- Agent prompts: fix Jenkinsfile language ID (groovy → jenkinsfile),
  fix css.md edge type (configures → related), remove shell.md
  Makefile cross-reference
- Tests: 20+ new edge case tests across parsers, graph builder,
  language registry, and plugin registry
- Documentation: add JSDoc to all 12 parser classes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 21:55:20 +08:00
Lum1104andClaude Opus 4.6 3fd688ac37 feat(core): add 12 custom parsers for non-code file types
Add regex/parser-based analyzers for: Markdown, YAML, JSON, TOML, Env,
Dockerfile, SQL, GraphQL, Protobuf, Terraform, Makefile, Shell.

Each implements AnalyzerPlugin with analyzeFile() and optional
extractReferences(). Uses `yaml` npm package for YAML parsing,
built-in JSON.parse for JSON, regex for all others.

Add registerAllParsers() helper to register all parsers at once.
Add comprehensive test suite with 35 tests covering all parsers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:38:25 +08:00
Lum1104andClaude Opus 4.6 9eb220c492 feat(core): make resolveImports optional on AnalyzerPlugin
Update PluginRegistry.resolveImports() to check for plugin.resolveImports
existence before calling it. Non-code plugins (e.g., markdown, dockerfile)
don't need import resolution, so this method is now optional.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:31:00 +08:00
Berkcan Gümüşışık 2f9b00c99c Expand core tests and add vitest coverage dep
Add several unit tests to improve robustness and coverage across the core package: plugin-discovery (handle missing/invalid plugins field and add serializePluginConfig tests), plugin-registry (unregister behavior, language detection, and import resolution delegation), persistence (invalid graph validation and option to skip validation), and tree-sitter-plugin (export aliases and arrow functions without params). Also add @vitest/coverage-v8 as a devDependency to enable V8-based coverage reporting.
2026-03-25 20:46:28 +03:00
Sreeram ae898a28b2 fix: address PR review feedback (C1-C4, I1-I5)
Critical fixes:
- C1: Remove unused treeSitter.nodeTypes from configs and schema — extraction
  logic is TS/JS-specific, nodeTypes gave false impression of generality
- C2+C3: Remove blocking temp dir prompt, default to .understand-anything/tmp/,
  update all 5 prompt templates to use project-local paths instead of /tmp/
- C4: Fix false-positive framework detection — use "next": (with quotes) for
  Next.js, remove cors/body-parser from Express keywords

Important fixes:
- I1: Change FrameworkConfig.language to languages[] array — React/Express/Vue
  now correctly listed under both typescript and javascript
- I2: Fix getByExtension case sensitivity — .TS now resolves same as .ts
- I3: languageKeyFromPath returns null instead of throwing for unknown extensions
- I4: Duplicate framework registration is now a no-op instead of corrupting array
- I5: SKILL.md now says "skip silently" when language/framework snippet not found

Also: getForLanguage returns a defensive copy, 3 new tests added (157 total).
2026-03-23 21:53:02 +05:30
Sreeram b5eb2e6041 feat: language-agnostic analysis with config-driven registry and framework detection
Replace the TypeScript/JavaScript-biased analysis pipeline with a truly
language-agnostic system. The core architecture was already language-neutral
(graph schema, dashboard, search) — the bias lived in agent prompts,
tree-sitter plugin, and language-lesson system.

Core changes:
- LanguageConfig + FrameworkConfig types with Zod validation
- LanguageRegistry (12 languages) and FrameworkRegistry (10 frameworks)
- Config-driven TreeSitterPlugin replacing hardcoded TS/JS grammars
- PluginRegistry now delegates to LanguageRegistry for extension mapping
- Language-lesson system uses config for display names and concepts

Prompt system:
- SKILL.md generalized: dynamic injection of language snippets and
  framework addendums instead of hardcoded if/else conditionals
- 12 language prompt snippets (languages/*.md) with concepts, patterns,
  frameworks per language
- 10 framework addendums (frameworks/*.md) with canonical file roles,
  edge patterns, architectural layers — Django/FastAPI/Flask preserved
  and split, plus React/Next.js/Express/Vue/Spring/Rails/Gin added
- Extended entry points, directory patterns, and test patterns across
  all 12 language ecosystems in base prompts
2026-03-23 12:35:09 +05:30
Lum1104andClaude Opus 4.6 b75235919e refactor: restructure monorepo into Claude Code plugin layout
Move packages/{core,dashboard,skill} into understand-anything-plugin/ to
conform to the Claude Code plugin format. Add .claude-plugin/marketplace.json
for plugin discovery. Update workspace config and docs accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 11:16:43 +08:00