Kickstart with Alexa Skills!!
- Tanha Patel
- Apr 10, 2020
- 3 min read

Alexa is a voice assistant from amazon. It is named after the ancient library of Alexandria.
A user can give Alexa a number of voice commands such as creating a to-do-list, set the alarm, play a song, or provide the news and many more. An the tasks which Alexa performs upon user request are called "Alexa Skills".
For building a basic Alexa Skill you need is only Amazon Developers Account. And some idea of course ;)
First of all you can create Amazon Developer Account from here.

This is how amazon developer's dashboard looks like. Then click on Developer Console on top right corner.

As show select Alexa Skills Kit from the navigation bar.
Now we will be starting with actually work. So Let's get started...
Select Create Skill button

Give appropriate information as required. First you should have some unique skill name. This is the name which will be visible to the users. And remember that this is not which will invoke your skill.

Here language plays the most important role. Language will decide that in which region your skill will be visible and can be enabled. And as of now we will be selecting custom model and Alexa hosted Node.js as backend. So that Amazon itself will be managing the required backend services.


After doing all this you need to select the template which you want to use for making your skill. As we are making facts skill choose Fact Skill and you are ready to create outline of your skill so click on the create skill button in the top-right corner of the screen.

You will be taken to the console from where you can add intents, utterances, facts, etc. It looks like this.

As it is showing skill builder checklist, you have to complete all the tasks for successful submission of skill.
Invocation Name: It is the phrase by which alexa will be launching your skill.


Intents, Samples, Slots:
Intents: To perform specific activity
Samples: A list of phrases which may or may not be used by user
Slots: Parameter to the specific activity (Optional)
Now it's time to define intents by which we will make alexa perform our task. Intent name can be anything as we will specify it in code that which intent should be trigger on which set of utterances. Here utterances are defined in samples. You can define as many utterances as you want to.


Everytime you make any changes in build module make sure that you save and build the model successfully to avoid lose of changes made.
Now let's move to code tab. Here we will add one .json file containing facts. Select the code tab and create new file from selecting the highlighted symbol as in image.


You can give any name to your file, here I have given "fact_file.json". Inside the file you need to insert the facts like as shown. You can add as many as facts you want to.
Now let's head towards "index.js" file. In that we will change some texts. That texts are used when alexa and users are communicating. Alexa use to speak the texts which you have defined.

You will find this in the beginning of the "index.js" file. This should be replaced by your facts file name, here "fact_file.json".

This is the code snippet for alexa to say random facts mentioned in facts file. If we want some custom message to be spoken before fact then replace that with "Get_fact_message". And replace "Skill_name" with invocation of skill.
Now you can go to the certification tab followed by distribution tab. There you need to fill the basic details and submit it for deployment in Alexa Skills Store.
Congrats! You’ve successfully created the Fact skill.
Comments