Custom Plugin implementation I tried to write next class:

&lt;?php
namespace Craft;

class TaskShortcutPlugin extends BasePlugin
{
    // ...
    // Shortcut sample [task id="42"]Reference to task with id = 42[/task]
    public function task($attributes, $content, $tag)
    {
             $id = $attributes['id'];    // 42
             $content;                   // Reference to task with id = 42
             $tag;                       // 'task'

             return '&lt;a href="/task/'.$id.'" class="' .$tag. '"&gt;'.$content.'&lt;/a&gt;';
    }
}


So, what next, how to implement it into CMS? Or I should use it into Twig templates?
You've got a little ways to go before that will work as a plugin... I'd highly recommend getting a little more familiar with the basic anatomy of a plugin...

Craft Docs - Anatomy of a Plugin

Basically, you'll want to take the "task" method that you have and move it to a *Variable.php file. Then you will be able to call that variable via a Twig template...

{{ craft.taskShortcut.task(attributes, content, tag) }}


You can learn more about variables here: Template Variables

However, you'll still need your main *Plugin.php file, but the methods inside will be different (Your Primary Plugin Class).

This will most likely be the folder structure of your plugin:

/craft/plugins/taskshortcut
                           /TaskShortcutPlugin.php
                           /variables/TaskShortcutVariable.php