Create a Custom Skill from a Quick Start Template
The quick start templates let you quickly set up a new skill with an interaction model and default endpoint. You can use this new skill to learn how skills work and experiment with the voice user interface, then customize the skill to make it your own.
- Create a new skill with a quick start template
- Use the default endpoint to prototype and test the interaction model
- Add and test a dialog model with the default endpoint
- Replace the default endpoint with skill code
- Related Topics
Create a new skill with a quick start template
A skill created from a template is automatically configured with the following:
- An interaction model specific to the template. For example, the "Quiz Game" template creates an interaction model with intents such as
QuizIntent(to let the user ask to start a new quiz) and
AnswerIntent(to get the user's answer to a question).
- A default endpoint that provides the back-end code for the skill service. This endpoint lets you test the interaction model right away, but it does not reflect the template functionality. See Use the default endpoint to prototype and test the interaction model. Later, you can update the skill to use your own AWS Lambda function or web service endpoint.
The available templates are displayed in the developer console when you create a new custom skill.
- Go to developer.amazon.com/alexa.
- Click Your Alexa Consoles and then click Skills. This opens the developer console and displays any skills you have already created.
- Click Create Skill.
Enter the skill name and default language.
- Skill name: This is the name customers will see when you publish the skill. You can edit this name later on the Distribution page.
- Default language: You can add additional languages to the skill later.
- Click the Custom model.
- Click Create skill.
- Click the template you want to use and then click Choose.
After you create a skill from a template, the Build page displays the steps to customize the template. You can customize all aspects of the skill, just as you could in a skill created from scratch.
Use the default endpoint to prototype and test the interaction model
When you create a skill from a template, the skill is automatically configured with a default endpoint. Alexa sends requests to this endpoint when you invoke the skill. The default endpoint responds to each request with a response containing:
- The type of the request, such as "LaunchRequest" or "Intent".
- The name of the intent, if the request was an
- The locale for the
IntentRequest, such as "en-US".
- The names and values of all the slots defined for the intent.
- Slots that do not have values are reported as "undefined".
- If the slot value you provide in your utterance is defined as a synonym, the response includes both the defined value and the synonym you spoke.
Dialog.Delegatedirective if your utterance is part of an incomplete dialog. See Add and test dialogs with the default endpoint.
To test, invoke the skill and try out the sample utterances defined in the interaction model:
- Navigate the Custom > Interaction Model > Invocation page to see the skill's default invocation name.
- Navigate to the Custom > Interaction Model > Intents page and then go to a specific intent to see the utterances for the intent.
- Go to the Test page and click the option at the top to enable the skill.
- Invoke the skill with the invocation name and try the utterances for the intent.
User: Alexa, open quiz game
Alexa: Launch Request
User: Start a quiz
Alexa: Intent, QuizIntent. Locale, en-US.
User: tell me about California
Alexa: Intent, AnswerIntent. Locale, en-US. Slots. Abbreviation, undefined, StatehoodYear, undefined, StatehoodOrder, undefined, Capital, undefined, StateName, california.
You can test with a device or with the simulator on the Test page.
The default endpoint sets the
falseon every response (including responses for
AMAZON.StopIntent). This means the session remains open after Alexa speaks the response, so you can invoke another intent. To exit the session, say "Exit."
Experiment with changes to the interaction model
The default endpoint lets you experiment with the skill's interaction model without the need to edit any code. For example, you could do the following:
- Experiment with different invocation names. Note that you must change the invocation name from the default to publish the skill.
- Add or edit the utterances for an existing intent.
- Add or change slot values and synonyms for custom slot types.
- Add new intents and slots.
Note: if you delete a slot from an intent, be sure to also delete any sample utterances that reference the slot.
- Add a dialog model to the skill and test the dialog flow.
Be sure to save and build the interaction model after making any of these changes.
Add and test a dialog model with the default endpoint
For details about different ways to delegate the dialog, see Delegate the Dialog to Alexa. The default endpoint is designed to respond with
Dialog.Delegate for incomplete dialogs. Alternatively, you can configure the skill to delegate automatically.
Add a dialog model to a skill
To add a dialog model to a skill, do any of the following:
- Configure a slot to be required. In this case you provide:
- The prompts Alexa speaks to ask for the slot value
- The utterance users can speak in response to the prompts
- Configure a slot to require slot confirmation. In this case, you provide the prompts Alexa speaks to ask the user to confirm the value.
- Configure an intent to require intent confirmation. In this case, you provide the prompts Alexa speaks to ask the user to confirm the intent
- Add slot validation rules. In this case, you provide:
- The validation rules a slot value must meet to be considered valid.
- The prompts Alexa speaks to ask the user for a new value if the provided value fails.
The following image shows a new "
MyCustomIntent" intent with a slot called "color" that is configured as a required slot:
Test the dialog model with the default endpoint
To test a skill with a dialog model:
- Invoke an intent that has been configured with required slots, slot confirmation, intent confirmation, or slot validation rules. If the dialog is incomplete, Alexa prompts you for the missing information and listens for an utterance that fills the slot or confirms the data.
- The dialog continues until the dialog is complete.
When you invoke the intent, use an utterance that does not include slot values for required slots. This makes the dialog incomplete, so the default endpoint can respond with the
Dialog.Delegate directive to prompt the user for the missing slot values.
In this example, a custom intent with two required slots (
firstName) has been added to the skill:
User: Open space facts
Alexa: Launch Request
User: Invoke my custom intent
Alexa: What is your color? (This is a prompt defined in the dialog model for the
Alexa: What is your name? (This is a prompt defined in the dialog model for the
Alexa: Intent, MyCustomIntent. Locale, en-US. Slots. color, blue, firstName, sara,
For more details about managing dialogs in a skill, see:
- Define the Dialog to Collect and Confirm Required Information.
- Delegate the Dialog to Alexa
- Dialog Interface Reference
Replace the default endpoint with skill code
To add real functionality to the skill, create your own endpoint to handle the requests. You can use sample code that matches the templates as a starting point and then further customize the code.
A link to a GitHub repository with Node.js sample code is provided in the developer console. For some templates, you may be able to find samples in additional languages (such as Java) in the Alexa organization on GitHub
To get the sample code that matches a template:
- Navigate to the Build > Custom > Endpoint page.
In the box explaining that you must create your own endpoint, click the link to open the relevant GitHub repository.
If you don't see this endpoint warning box, this means your skill has already been updated to use a custom endpoint instead of the template default.
To connect the code to your skill, you need to create a new AWS Lambda function, upload the code, and then update the endpoint for the skill. Instructions for these steps are provided in the GitHub repository in the Lambda Function and Connect VUI to Code sections.
- For more about using Lambda with skills, see Host a Custom Skill as an AWS Lambda Function.
- For more about configuring the endpoint for a skill, see Build Your Skill: Custom Model.
At this point, you can test the skill with a device or the Test page and see the actual skill functionality instead of the default endpoint:
User: Open quiz game
Alexa: Welcome to the United States Quiz Game! You can ask me about any of the fifty states and their capitals, or you can ask me to start a quiz. What would you like to do?
See the other instructions in the repository for more about testing and customizing the skill.