Alexa Custom Skill Life Cycle

Sameer Mahajan
5 min readJul 15, 2019

--

Amazon Alexa

After working on alexa custom skills a couple of times over the past three years, I thought of writing this comprehensive compilation of all the steps involved in building alexa custom skills right from signing up for various required accounts to certification. This will act as a reference for newbies as well as anyone who needs to revisit developing a custom skill at any point in time. Most of the things have now matured over these steps barring some UI changes or a few minute details that might keep changing from time to time.

Signing up for amazon developer’s account

The first step in the process is to sign up for Amazon developer’s account.

Amazon Developer’s Account
Sign up

Developing Alexa Custom Skill using Alexa Skills Kit

Once you have a developer’s account, you can sign in and go to Alexa -> Alexa Skills Kit

Developer login

You can now start developing your custom skill.

Create new skill

Steps for creating a skill

You can follow the steps of creating a new skill like giving it a name, choosing a model.

Create skill step 1

Follow along the steps of creating invocation name, intents, sample utterances, slots, slot types etc. Make use of the right slot types depending on your input e.g. AMAZON.NUMBER for numeric type etc.

Create skill screen

You can refer to https://github.com/sameermahajan/Alexa-Custom-Skills/blob/master/lambda/twitter_bot/InteractionModel.json for a sample.

Writing backend business logic in lambda

Once you have completed the skill model, you need to write its backend business logic. It can be written in lambda and hosted on AWS or it can be written as any web service and hosted on platform of your choice including on prem server. Lambda is a preferred mechanism and we will take a look at it here.

Sign up for AWS account

Sign up for AWS account if you don’t already have one.

AWS sign up

Once you sign up log into the AWS management console.

AWS sign in
AWS sign in page

From the AWS Management Console, choose lambda.

AWS Management Console

Create new lambda function

Create lambda function

Specify function name, run time, permissions etc.

Create lambda function screen

You can edit code inline and take care of various settings.

Create lambda

You can refer https://github.com/sameermahajan/Alexa-Custom-Skills/blob/master/lambda/twitter_bot/lambda_function.py for example of an alexa skill lambda function.

Sanity testing your lambda function

Now you can perform some sanity testing of your lambda function.

Test lambda

Leverage various Amazon Alexa event templates like start session.

Test events

This testing is very useful in getting basic syntax and execution validation out of the way.

Test results

Once you are done editing the function, you need to publish its new version for further use.

Publish new version of lambda function

Once published, you will see the version number as the suffix of the function.

Published lambda function

Add ASK trigger to lambda function

ASK trigger

Copy skill id from Alexa Skill

At this time, switch back to you alexa skill (from your developer login) and copy the skill id.

Copy skill id

Paste skill id in lambda function trigger

Paste skill id

Copy ARN number for the published lambda function

Copy ARN

Paste ARN in skill’s endpoint

Paste ARN

Now your alexa custom skill is complete and is linked to your lambda function. Build it

Build skill

and it is ready for execution invocations!

Testing alexa skill

Once above steps are done, you can start testing the alexa skill.

test skill

Certification

Once you have completed testing of your skill, you can go for certification.

certification

Take care of everything that certification reports. Here are some tips:

  • Implement cancel, stop and help intents.
  • Close the session (in cancel or stop intents) or keep it open (during ongoig dialogue) as appropriate. It is governed by the last argument of the response.
  • Ensure appropriate content in cards.
  • In case you are keeping the session open, provide reprompt text.

Now you are ready to publish your skill!

Publishing

published skill

Congratulations your skill is now live! You can search for a published skill.

Published skills
Interacting with published skill

You can refer to it using the published URL. You can enable it on your alexa device etc.

Monitoring published skill

Once the skill is live, you can monitor it under ‘Analytics’.

Skill analytics

Exercising your skill without physical device

You can simulate a physical echo device using simulator.

Echo simulator

Good luck with your alexa custom skill!

--

--

Sameer Mahajan
Sameer Mahajan

Written by Sameer Mahajan

Generative AI, Machine Learning, Deep Learning, AI, Traveler

No responses yet