Create and Manage Skills in Visual Studio Code

The Alexa Skills Toolkit (ASK Toolkit) for Visual Studio Code (VS Code) is an extension that makes it easier for you to create, test, and deploy Alexa skills. For prerequisites and installation instructions, see Get Started with the ASK Toolkit for VS Code.

Start working with an Alexa skill

You can start working with an Alexa skill by creating a new skill, downloading an existing skill, or opening an existing skill that you've already worked with previously. You can create Alexa-hosted or self-hosted skills with the Alexa Skills Toolkit. For more details about Alexa-hosted skills, see Build a Skill End-to-end Using an Alexa-hosted Skill.

Create a new skill

To create a new skill

  1. In the activity bar, click the Alexa icon. The Alexa Skills Toolkit side bar appears.
  2. Expand Skills Management and then choose Create skill. The Create new skill form appears.

    1. For Skill name, enter the name for your skill.
    2. For Default language, choose the default language for your skill.
    3. For Skill Model, choose Custom to define a custom voice-interaction model for your skill. If you want to use a pre-built voice-interaction model for your skill, create your skill by using the Alexa developer console and then download your skill into VS Code.
    4. For Choose a method to host your skill's backend resources, choose Alexa-hosted or Provision your own. For details, see Alexa-hosted Skills.
    5. For self-hosted skills, for Programming language, choose the programming language for your skill code.
    6. For Alexa-hosted skills, for Hosting runtime, choose the programming language for your skill code.
    7. For Alexa-hosted skills, for Hosting region, choose the region to host your backend resources. The hosting region determines the location of your Amazon S3 bucket and Amazon DynamoDB table. For details, see Hosting your skill resources in different AWS Regions.
    8. For Local directory, choose the location for your project files.
  3. Click Create. After about one or two minutes, your skill appears in the side bar.

Download an existing skill

To download an existing skill

  1. In the activity bar, click the Alexa icon. The Alexa Skills Toolkit side bar appears.
  2. Expand Skills Management and then choose Download and edit skill. A list of your existing skills appears.
  3. Click the skill you want to download, and then choose the location to save the project. A child folder is created for the project in the location that you specify. After about one or two minutes, your skill appears in the side bar.

Open a local skill project

To open a local skill project

  1. In the activity bar, click the Alexa icon. The Alexa Skills Toolkit side bar appears.
  2. Expand Skills Management and then choose Open local skill.
  3. Choose the folder of project that you want to open and then choose Select Folder. Your skill project appears in the side bar.

Build your Alexa skill

You build your Alexa skill in VS Code by editing the project files.

APL

If you want to use Alexa Presentation Language (APL) in your skill, you can use the Alexa Skills Toolkit for Visual Studio Code to create, edit, and preview APL documents. For details, see Manage and Preview APL Documents.

Interaction Model

The voice-interaction model is how the user interacts with Alexa while using your skill. For details, see Create the Interaction Model for Your Skill and Interaction Model Schemas.

For skills that have a custom voice-interaction model, you can edit the interaction model in the following ways:

  • In VS Code, edit the JSON files for the interaction model directly. The files are in the skill folder.
  • In the Alexa developer console, edit the interaction model on the Build page for your skill. Save the changes and build your interaction model. Afterwards, synchronize your interaction model to your local project.
  • In VS Code, use the Edit in console link to open the interaction model for your skill in the Alexa developer console. Expand Skills, expand your skill, expand Interaction Model, and then choose Edit in console. The Build page for your skill appears. Edit the interaction model, save the changes, and build your interaction model. Afterwards, synchronize your interaction model to your local project.

Synchronize changes from the console

Synchronize your interaction model

For skills that have a custom voice-interaction model, you can create and update the interaction model in the Alexa developer console. If you create or update the interaction model for your skill in the console, download the latest interaction model to your local VS Code project.

To download your interaction model

  1. In the activity bar, click the Alexa icon. The Alexa Skills Toolkit side bar appears.
  2. Expand Skills, expand your skill, expand Interaction Model, and then choose Download. The Download latest interaction model page appears.
  3. Choose the correct locale and then click Download.

Synchronize your skill manifest

You can make changes to the configuration of your skill, such as updating publishing details, permissions, supported interfaces, and endpoints, in the Alexa developer console. The configuration for your skill is stored in the skill manifest. If you make changes to the configuration of your skill in the console, download the latest skill manifest to your local VS Code project.

To download your skill manifest

  1. In the activity bar, click the Alexa icon. The Alexa Skills Toolkit side bar appears.
  2. Expand Skills, expand your skill, expand Skill Manifest, and then choose Download. The Download latest skill manifest page appears.
  3. Click Download. The latest version of the manifest appears and replaces the existing skill-package/skill.json file in your skill project.
  4. Open the File menu and choose Save to save the updated manifest.

Test your local Alexa skill

If you want to use test your skill in VS Code, see Test Skills in Visual Studio Code.

Deploy your Alexa skill

When you deploy your skill from VS Code, you overwrite changes that you made to your skill in the Alexa developer console. Therefore, before you deploy your skill, verify the following:

After you have synchronized any changes from the console, you can deploy local changes your skill.

To deploy local changes to your skill

  1. Save local changes to your skill.

    For an Alexa-hosted skill, commit your skill changes to the branch named master. Use the git support in VS Code, or any git client.

    For a self-hosted skill, save changes to your skill project. You must deploy changes to your Lambda code by using the ASK CLI or another method.

  2. In the activity bar, click the Alexa icon. The Alexa Skills Toolkit side bar appears.
  3. Expand Skills, expand your skill, and then choose Deploy skill. The Skill deploy and build page appears. If your local skill is synchronized with any changes made in the console as described earlier in this section, the Deploy & build button becomes active.

    For an Alexa-hosted skill, the status of both your skill package and your skill code appears.

    For a self-hosted skill, the status of only your skill package appears. You must deploy changes to your Lambda code by using the ASK CLI or another method.

  4. Click Deploy & build. Your changes are deployed. To track the status of your deployment, visit the Code page for your skill in the Alexa developer console.