feat(autoload): add trait detection (closes #4641)