boiler template for Alexa skill development by rewriting https://github.com/amzn/alexa-skills-kit-js/tree/master/samples/helloWorld
Alexa SDK and sample is written by ES5 and skill deployment isn't included see this.
This alexa-hello-world-skill intend to show
- write skill
- test skill
- deployment skill
with ES2015 and better developent pipeline.
npm install
You just extends AlexaSkill class and write intent handling and how Alexa respond content to user.
vi test/hello-world-skill.js
We can conduct unit test to mimic Alexa Intent. Similar test is available in AWS Console,
npm test
We write any test cased using mocha
using node-aws-lambda, zip skill code and deploy AWS lambda with following command
gulp build # build ES5 code with babel
gulp deploy
If you face with following error message, you need to go AWS console and put appropriate IAM Role information in lambda_config.js. All lambda deployment configuration is put there.
1 validation error detected: Value 'arn:aws:iam::xxxxxxxxxxxx:role/lambda_basic_execution' at 'role' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:aws:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+
Details:
After your skill zip file is uploaded, you need to associate with "Alexa Skills Kit" as Trigger.
Complete Skill setup on Amazon Developer Console
After Lambda setup, we need to input following information on development portal
- Name
- Invocation Name
- Intent Schema
- Sample Utterances
- Endpoint - ARN which appears at AWS Console
If you finish following step, you can test your skill on your associated devices or portal site
Alexa, ask {your invocation name}