Rewritten for better understanding
Added spec for filter_resource_by_rules
Added rules.md