> 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/relationship-between-skills.md).

# Relationship between skills

### Parent-Child

Let's say two skills have the same trigger

```typescript
@Intent(/hello/i)
hello() {
    > Hey
}
```

If the user says "hello", only the child skill will be triggered. The parent skill has been "overloaded" by the child's skill

#### Event "nothing"

Here are two codes

`parent.converse`

```typescript
@Intent(/hello/i)
hello() {
    > Hey
}

@Event('nothing')
nothing() {
    > What ?
}
```

`child.converse`

```typescript
@Intent(/bye/i)
bye() {
    > Bye
}
```

If the user says "bye", the chatbot responds "Bye" with the child skill.

Even if no function is triggered in the parent skill, the `nothing` event is not executed because a child skill has been triggered

If the user says "good", the chatbot responds "What?" Because no child and parent skills function has been triggered.

### Sisters

Two sister skills (ie having the same parent)

```typescript
import oneSkill from './skills/one-skill/one-skill'
import secondSkill from './skills/second-skill/second-skill'

export default {
    skills: {
        oneSkill,
        secondSkill
    }
}
```

If both skills have the same trigger:

```typescript
@Intent(/hello/i)
hello() {
    > Hey
}
```

Both will be triggered at the same time

### In the same skill

If the skill has this code:

```typescript
@Intent(/hello/i)
helloWorld() {
    > Hey Boy
}

@Intent(/hello (world)?/i)
hello() {
    > Hey World
}
```

If the user says "hello", both intentions are concerned but only the first one written (the function `helloWorld()`) will be triggered

If the user says "hello world", only the second intention (the function undefined) is concerned and will be triggered
