| name | Function_and_Class_Knowledge_Graph_with_Hooks_v2.0 |
| version | 2 |
| description | Extends the App Development Blueprint Protocol v2.0 with a "Function & Class Knowledge Graph" mechanism.
Uses functions and classes as core graph nodes to build a complete code-structure knowledge graph
(including inheritance, methods, and dependencies), with hooks for automated triggering, expansion, and updates.
Applicable to OOP languages (Python, Java, TypeScript, Dart, etc.).
|
| tags | ["coding-agent","knowledge-graph","class-function-graph","hook","blueprint","oop","ast-parsing"] |
| author | Cosmic Master Brain |
| requires | ["App_Development_Blueprint_Protocol_v2.0","Function_Knowledge_Graph_with_Hooks_v1.0"] |
Function and Class Knowledge Graph with Hooks v2.0 Skill
Core Mission
During the blueprint planning phase, handle not only functions but also Classes simultaneously,
building a more complete code-structure knowledge graph that lets an AI Agent precisely manage
object-oriented design, method encapsulation, inheritance relationships, and dependencies.
Graph Structure Definition (Extended)
Hook Mechanism (Extended)
- pre_blueprint_hook: Scans existing code, automatically extracts classes, methods, and functions, and adds them to the graph.
- on_class_added_hook: When a new Class is added, auto-inserts it into the graph and checks inheritance / attributes.
- on_method_added_hook: When a new Method is added, creates a
DEFINES edge linking it to its owning Class.
- on_reference_detected_hook: When an existing Class / Method is detected, immediately expands its full code (Phase 2).
- pre_implementation_hook: Validates class-method consistency and dependency completeness.
- post_update_hook: After any Class or Method modification, updates the graph and computes impact scope (including the inheritance tree).
- visualization_hook: Outputs the complete Mermaid graph (distinguishing classes from functions).
Integration Flow with App Development Blueprint Protocol v2.0 (auto-executed)
- Phase 1: After producing the Function & Class Inventory, immediately build and output the knowledge graph (text + Mermaid).
- Phase 2: Trigger
on_reference_detected_hook — automatically expand full code of existing Classes / Methods (including constructors, attributes, methods, etc.).
- Phase 3: Produce a formal spec for each Class / Method; add a "relationships in the graph" field.
- Phase 4: Trigger relevant hooks, implement each Class / Method one at a time, and update the graph in real time.
- Final: Output the complete graph visualization + hook list + main entry point + recommended unit-test structure.
Usage Rules
- At the start of every task, output: "Function_and_Class_Knowledge_Graph_with_Hooks_v2.0 + App_Development_Blueprint_Protocol_v2.0 activated".
- For OOP languages, organize at the Class level first, then decompose into Methods.
- When existing code is provided, automatically trigger
pre_blueprint_hook for extraction.
- Hooks can be customized per project (e.g., add
on_inheritance_check_hook).
Trigger Phrases
"Use the Function & Class Knowledge Graph v2.0 to develop XXX App", "Activate v2.0 Skill", or describe your app requirements directly.