[Spec::Linter] Improve libraries validation logic