A custom alexa skill capabale of playing a dice roll game and listing top 10 high scores.
You should be able to run the skill on any alexa enabled device. Use below commands to navigate through the skill. (ou may use one word or synonyms)
Lauch the skill - open pallav's dice roll game
Start a dice roll game - play game
End a game - game over
When asked for a name to save score - by name ${yourFirstName}
To list top 10 high scores - top 10 scores
- AWS Lambda.
- AWS DynamoDB
- Alexa-skill-tesing-framework
- Alexa Skills Kit
- Typescript
Took couple of initatives to develope a highly readbale and testable codebase.
- Unit testing
- Added unit tests for all custom intent handler. Tested happy flows and appropriate edge cases.
- Explored possible options for testing. Finalized the use of alexa-skill-test-framework (https://github.com/BrianMacIntosh/alexa-skill-test-framework).
- use the command
npm run test
to run unit tests.
- Design pattern
- Implemented Abstract Factory design pattern for developing easily modifiable and extensible intent handlers for YES/NO prompts.
- Reasoning - There could be mutiple YES/NO intents in resposne to different queries but they still fall under a single intent type Amazon.Yes /Amazon.No. The handler should be able map the response to a particular query(eg - save score?, did u like the game?, etc). Hence a YES/NO intent handler factory is needed to quickly extend handlers for future possible queries and map them correctly.
- Added a rolling dice audio(.mp3) to intent resposne to make the gaming experience more lively and real.
- Added repromts wherever needed to allow enough time for user to response to alexa query.
- Added possible one word alternatives to intent trigerrs inorder to make it easy and quick for user to respond and navigate thorugh the game.
- Adding audio to an intent handler response.
- Setting up tests using mocha with typescript. (In the end switched to ts-mocha library)
- Worked with alexa skills for first time and hence picked up available functionalities and development flow for creating a custom skill.
- Unit testing alexa skills using the alexa-skill-test framework.
- Deploying and testing alexa skills on actual device. In this case tested using the Alexa app on iphone and android.
- Writing AWS S3 bucket permissiona policies.