Current-rule's name in Snakemake

(Edit: Proposed a workaround)

{rule}can be used for rulename during shell:/run: directives. As op stated, this does not work in input/output:. However the current template is a work-araound

myrule = "foo"
rule foo:
    output: touch(myrule + ".ok")
    shell:
        'echo "I am {rule}, making {output}"'

In the example above, introducing the variable myrule is unnecessary since it is used only once. But it makes more sense when you want to use the rule-name several times in the various snakemake directives. And it also facilitates rule-templating.