How to build Alexa skills
I’ve put this guide together for anyone getting started with Alexa Skill development, as well as anyone wanting to keep on top of the latest new features Amazon are providing to Alexa developers.
Amazon have plenty of content for developers, but sometimes it can be a little hard to find, so this guide should help anyone getting started, and I’ve linked to lots of their own great articles and tutorials.
Where to begin with Alexa
- Training for the Alexa Skills Kit - An overview of all Amazon’s own training content, along with some third party content
- Big Nerd Ranch Alexa Training - Big Nerd Ranch write some of the best training content out there for iOS and Android and their free Alexa course is no exception. It may be slightly out of date, but this a great place to get started
- Alexa templates and examples on Github - cookbooks and sample code giving you direction once you’ve covered the basics
Keep on top of Alexa news
- The Alexa Dev Chat Podcast - New episodes every 2 weeks, with “Alexa news, developer tips, and interviews with Alexa developers and Alexa employees”
- Alexa Blog - Amazon official announcements all appear here and you can keep on top of all the news by following this blog
Learning the basics
To get going, you really should take the time to learn the following concepts, which I hope to add content around in the coming weeks myself.
- Setting up Skills and Intents (features of Skills), within Amazon - Big Nerd Ranch Module 1, Skill Architecture and Interface Configuration
- Utterances and Slot Types, understanding what people are saying - Module 2, Slots, Slot Types and Utterances
- Ensuring your skill can remember what the user just said in a single session - Module 3, Sessions
- Remembering users between usage sessions - Module 4, Persistance
- Creating sign-in for users with accounts, so you can help Alexa to access your user’s existing data, allow sign-in via third party services, or track users across multiple Alexa devices - Module 5, Account Linking
- Learn how to certify your skills and submit them to Amazon, and write unit tests for skills - Module 6, Certification and testing
- Learn how to build a local environment, instead of repeatedly uploading to the server, build your own environment and run the skill locally Developing Alexa Skills Locally with Node.js
Alexa offers the following features outside of the standard interaction model:
- Access to the users postal address, permission is required - Learn more, and try the Device Address API template app
- You can include visual cards in the accompanying Alexa app, adding additional text and images to the app to support responses your skill might provide - Learn more
- Alexa provides skills with a session id, which lasts for a user’s individual session (from when they start using this skill to stopping, normally shortly after) - Learn more
- Alexa provides skills with a user id, which allows you to identify a user, until they disable the skill. This allows you to persist data across sessions. If a user re-enables the skill, they will have a new user id, so take care to add account linking if you really want to track a user over a long period of time.
- The SSML markup language allows you to add pauses and other customizations to the responses you provide via Alexa, to alter the way Alexa speaks - Learn more
- Speechcons allow you to have Alexa say custom phrases such as ‘booyah’ - Learn more
- Amazon provide standard built-in intents, a library of intents for use by any skill, such as ‘help’, ‘no’, ‘cancel’, ‘repeat’, ‘stop’, ‘start over’, ‘no’, ‘yes’ etc, these save you having to set up utterances for concepts such as going to the next song or stopping a skill. You still need to write the action code, but you don’t need to come up with utterances - Learn more
- Amazon provide a large range of additional built-in intents, a library of pre-populated intents, in preview, in categories such as books, weather, calendar, these save you having to set up utterances for concepts such as managing a reading list, or playing music or searching locally. You still need to write the action code, but you don’t need to come up with utterances - Learn more
- Amazon provide a library of built-in slot types, such as date, duration, four digit number, number, time and a range of useful lists such as states, music events, months and many more. These allow Alexa to weight certain words under certain circumstances, such as when you want book names, months, US States etc - Learn more
The following tools are provided by Amazon and the wider development community to help developers when building skills:
- Alexa Skills Kit SDK
- Beta testing tool for gathering feedback from beta users
- Build and host most skills for free
- Echosim, Echo simulator if you aren’t near your Echo device
- Alexa Analytics Dashboard
Check out the following design articles to ensure you build skills the right way:
- How customers invoke custom skills
- Best practices for choosing an invocation name (Amazon’s Guidelines)
- Alexa Skills Voice Design Handbook - an overview of invocation types, including full intent, partial intent and no intent. This in no way a handbook.
- Voice Design Best Practices - and overview of design best practices