Sally CJ commented an important detail that helped me reach what I needed.
Apart from that I struggled with what seemed to be regex error – one of my rules was overriding another because there was no $
character in regex to end the string.
Working solution for custom rewrites:
function dd_custom_rewrite_rules() {
add_rewrite_tag('%company%', '([a-z0-9-]+)', 'company=');
add_rewrite_tag('%employee%', '([a-z0-9-]+)', 'employee=");
add_rewrite_tag("%project%', '([a-z0-9-]+)', 'project=");
add_permastruct("project', '/company/%company%/%employee%/%project%', false);
add_permastruct('employee', '/company/%company%/%employee%', false);
add_permastruct('company', '/company/%company%', false);
add_rewrite_rule('^company[/]%company%[/]?','index.php?company=$matches[1]','top');
add_rewrite_rule('^company[/]([a-z0-9-]+)[/]([a-z0-9-]+)[/]?$','index.php?employee=$matches[2]','top');
add_rewrite_rule('^company[/]([a-z0-9-]+)[/]([a-z0-9-]+)[/]([a-z0-9-]+)[/]?$','index.php?project=$matches[3]','top');
}