mirror of
https://github.com/Egonex-AI/Understand-Anything.git
synced 2026-06-22 10:58:03 +08:00
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
2.5 KiB
2.5 KiB
C++ Language Prompt Snippet
Key Concepts
- Templates: Function, class, and variadic templates for generic compile-time polymorphism
- RAII: Resource Acquisition Is Initialization — tie resource lifetime to object scope
- Smart Pointers:
unique_ptr(exclusive),shared_ptr(reference-counted),weak_ptr(non-owning) - Move Semantics: Rvalue references (
&&) andstd::movefor efficient resource transfer - Operator Overloading: Define custom behavior for operators on user-defined types
- Virtual Functions and Vtable: Runtime polymorphism through virtual method dispatch tables
- Namespaces: Organize symbols and prevent name collisions across translation units
- Constexpr: Compile-time evaluation of functions and variables for zero-runtime-cost computation
- Lambda Expressions: Anonymous functions with capture lists for closures
- STL Containers and Algorithms: Standard containers (vector, map, set) and generic algorithms
- Concepts (C++20): Named constraints on template parameters replacing SFINAE patterns
Import Patterns
#include <system_header>— include standard library or system headers#include "local_header.h"— include project-local header filesusing namespace std— bring all names from std into scope (avoid in headers)using std::vector— selectively bring specific names into scope
File Patterns
.h/.hpp— header files containing declarations, templates, and inline definitions.cpp/.cc— implementation files with function definitions and static dataCMakeLists.txt— CMake build system configurationMakefile— Make-based build rules and targetsmain.cpp— program entry point containingint main()
Common Frameworks
- Qt — Cross-platform application framework with signal/slot mechanism
- Boost — Extensive collection of peer-reviewed portable libraries
- Catch2 — Header-only testing framework with BDD-style syntax
- Google Test — Testing framework with fixtures, assertions, and mocking
- gRPC — High-performance RPC framework for service communication
Example Language Notes
Uses
std::unique_ptr<T>for RAII-based ownership, ensuring deterministic cleanup when scope exits. The unique pointer cannot be copied, only moved, making ownership transfer explicit and preventing accidental double-free errors.Header/implementation separation (
.h/.cpp) controls compilation boundaries — changes to a.cppfile only recompile that translation unit, not all includers.