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. Currently, you can only create Alexa-hosted skills with the Alexa Skills Toolkit. For more information 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 Alexa-hosted skill. The Create new skill form appears.
  3. Fill out the form and click Create. After about one or two minutes, your skill appears in the side bar.

Download an existing skill

This procedure performs a git clone of your Alexa-hosted skill project into your selected directory.

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 Alexa-hosted 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.

Interaction Model

The interaction model is how the user interacts with Alexa while using your skill. For more information, see Create the Interaction Model for Your Skill. For more information about the interaction model schemas, see Interaction Model Schemas.

You can edit the interaction model for your skill 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.

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 more information, see Manage and Preview APL Documents.

Synchronize changes from the console

Synchronize your interaction model

You can create and update the interaction model for your skill in the Alexa developer console. If you create or update the interaction 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

You can test and debug your local skill by using one of the following methods:

To invoke your local skill, add ask-sdk-local-debug to your skill project. Follow the instructions for your SDK language to add ask-sdk-local-debug to your skill:

To test your local skill

  1. Create a launch.json file for your skill, if you don't already have one, by doing the following:

    1. Open the Run menu and then choose Add Configuration…. The Select Environment dialog appears.
    2. Choose your programming language, Node.js or Python. The launch.json file is added to your project and opens in the editor.
  2. Edit the launch.json file to add the Alexa debugger, if you haven't already, by doing the following:

    1. Open the Run menu and then choose Add Configuration… A list of options appears.
    2. Choose ASK: Alexa Skills Debugger (Node.js) or ASK: Alexa Skills Debugger (Python). The configuration code is added to the launch.json file.
    3. Save the changes to the launch.json file.
  3. Open the Run menu and then choose Start Debugging. Your skill code starts and a websocket connects from your local machine to the Alexa proxy service. Requests to your skill are now routed directly to your local skill code as long as the connection with the Alexa proxy service is open. The connection remains open for one hour. You can't create more than one connection to a skill.

  4. Test your skill by using one of the methods named earlier. To test your skill by using the Alexa simulator, do the following:

    1. Expand Skills, expand your skill, and then choose Test skill. The Alexa Simulator page launches in your browser.
    2. Use the Alexa simulator to test your skill.

To stop testing locally, open the Run menu and then choose Stop Debugging. This closes the connection to the Alexa proxy service and Alexa reverts to invoking the endpoint that is configured for your skill instead of your local skill.

Deploy your Alexa skill

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

After you have downloaded any changes from the console, you can deploy your skill. You deploy your Alexa-hosted skill from VS Code by using git commands.

To deploy changes to your skill

  1. Commit your skill changes to the master branch for your skill. Use the git support in VS Code, or any git client.
  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.
  4. Click Deploy & build. Your changes are pushed to the remote git repository for your Alexa-hosted skill.

To track the status of your deployment, visit the Code page for your skill in the Alexa developer console.