> For the complete documentation index, see [llms.txt](https://mycroft-ai.gitbook.io/mark-ii/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mycroft-ai.gitbook.io/mark-ii/differences-to-classic-core/porting-classic-core-skills/porting-the-hello-world-skill.md).

# Porting the Hello World Skill

### 1. Copy Files Over

1. Find skill repository (template is ‘skill-\[name]’). In this case: [skill-hello-world](https://github.com/MycroftAI/skill-hello-world)
2. [SSH into Mark II](https://mycroft-ai.gitbook.io/mark-ii/ssh-access).
3. Go to the skills directory and make a new directory for your new Skill.
   * `cd /opt/mycroft-dinkum/skills`
   * `mkdir hello.mark2`
4. Next to the Dinkum repo, clone the Skill repo.
   * `cd /opt`
   * `sudo git clone https://github.com/MycroftAI/skill-hello-world.git`
5. Copy the files from the Skill repo into the new Skill directory.
   * `cp -r skill-hello-world/* mycroft-dinkum/skills/hello.mark2/`

### 2. **Modify** \_\_init\_\_.py

#### Modify import statement

```python
from mycroft import MycroftSkill, intent_handler 
```

to:

```python
from mycroft.skills import MycroftSkill, intent_handler
```

#### Replace interaction calls

Replace responses such as&#x20;

```python
 self.speak_dialog("welcome") 
```

with:&#x20;

```python
 return self.end_session(dialog=dialog, gui=gui)
```

For example:

```python
 # self.speak_dialog("hello.world")
 dialog = "hello.world"
 gui = None
 return self.end_session(dialog=dialog, gui=gui)
```

#### Enhance create\_skill

```python
def create_skill():
 return HelloWorldSkill()
```

becomes:

```python
def create_skill(skill_id: str):
     return HelloWorldSkill(skill_id=skill_id)
```

#### Add skill\_id and name to \_\_init\_\_ method

```python
def __init__(self, skill_id: str):
     """ The __init__ method is called when the Skill is first constructed.
     It is often used to declare variables or perform setup actions, however
     it cannot utilise MycroftSkill methods as the class does not yet exist.
     """
     super().__init__(skill_id=skill_id, name="HelloSkill")
     self.learning = True
```

### 3. **Add Skill to system files**

To `/opt/mycroft-dinkum/services/enclosure/service/skills.json` add:

```json
 { "name": "Hello World Skill", "skill_gid": "hello.mark2" },
```

To `/etc/systemd/system/dinkum-skills.service` add:

```
--skill /opt/mycroft-dinkum/skills/hello.mark2
```

### **4. Reload skills service settings**

```bash
sudo systemctl daemon-reload
```

### 5. **Restart Dinkum skills service**

```bash
sudo systemctl restart dinkum-skills.service
```

### 6. **Use your new Skill**

&#x20;“Hey Mycroft, how are you?”<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mycroft-ai.gitbook.io/mark-ii/differences-to-classic-core/porting-classic-core-skills/porting-the-hello-world-skill.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
