Hazel renaming and tagging

I am trying to replicate a workflow similar to that mentioned here

The author’s links to his hazel workflows are broken. There are some comments to the article requesting a fix, but they have not been responded to.

I am specifically looking for a way to accomplish the following in Hazel:

I can only rename the file names based on folder name but unable to add subfolders and tags as the author has written. Can someone help in configuring this?