> For the complete documentation index, see [llms.txt](https://docs.newbot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.newbot.io/use-newbot-framework-js/create-a-skill-more-details/use-the-functions-of-a-child-competency.md). Agents can also search and read this documentation through its [MCP server](https://docs.newbot.io/~gitbook/mcp).

# Use the functions of a child competency

Let's use the skill of the previous chapter. We add a custom function.

`skills/my-skill/my-skill.js`

```javascript
import code from 'my-skill.converse'

export default {
    code,
    functions: {
        hello() {
            return 'Hey'
        }
    }
}
```

But we can use it in the parent scenario.

`main.js`

```javascript
import code from './main.converse'
import mySkill from 'skills/my-skill/my-skill'

export default {
    code,
    skills: {
        mySkill
    }
}
```

In `main.converse`, we will then have:

```typescript
@Event('start')
start() {
    > { mySkill.hello() }
}
```

As we can see, we use the `mySkill` object to access functions.

### Read directly a function of the conversational script

Without going through the `functions` property, we can directly read a function from the conversational script of the child skill. Using the code above, we add these instructions to the script:

`skills/my-skill/my-skill.converse`

```typescript
askName() {
    > What's your name ?
    Prompt()
    return :text
}
```

`main.converse`

```typescript
@Event('start')
start() {
    name = mySkill.askName()
    > Your name is { name }
}
```
