## An Alexa Skill in Javascript – Part 6

We’ve done it! We’ve built an Alexa skill! Woohoo! Now we need to publish our skill to the Alexa Skills Catalog and make it official. Publishing your Alexa skill is the last step in the process of developing and deploying an Alexa Skill.

NOTE: Pay attention to Amazon’s developer promotions. You can get a free T-Shirt, Echo Dot, Echo Spot, and even the Echo Show if you publish your skill at the right time.

## Prepping the skill.json File

There are a few things we can do to enhance the **skill.json** file so our skill is ready for publishing.

First, find two images that you can use to represent your skill. These will appear in the catalog inside the speech bubble, like so:

The images should be png files in two sizes: small (108 x 108 px) and large (512 x 512 px). Create a new folder in your project called images and drop the two image files into it for safe-keeping. We’ll add them to the distribution page later.

Next, we can add some keywords to our skill.json file to help people find our skill more easily, right after the *description* tag add a “**keywords**” tag:

` "description": "Roll Some Dice will roll ..."`**,
"keywords": [
"die", "dice", "rpg", "dice roller"
]**
}
},

The last, and perhaps most difficult, task is to create the testing instructions.

Tip: Test your own testing instructions. Make sure Alexa actually does what you expect her to do.

Based on our intent’s sample phrases, the slots, the synonyms, and the edge conditions, we have quite a few testing instructions. Here are those sample phrases we put in the en-US skill model file:

```
"samples": [
"roll a die {plusMinus} {modifier}",
"roll {diceCount} dice {plusMinus} {modifier}",
"roll {diceCount} dice",
"roll a die"
]
```

To test our intent, we need to test the following:

Basic Phrases:

- Say “Alexa, start Roll Some Dice and roll a die.” Alexa will generate a random number between 1 and 6 and say, for example, “You said roll 1 dice. I rolled a three.”
- Say “Alexa, start Roll Some Dice and roll 10 dice.” Alexa will generate 10 random numbers between 1 and 6 and report the results, for example, “You said roll 10 dice. I rolled 3 ones, 4 threes, a four, a five and a six.”

With a modifier:

- Say “Alexa, start Roll Some Dice and roll a die plus one.” Alexa will generate a random number between 1 and 6 and add 1, and say, for example, “You said roll 1 dice plus 1. I rolled a two.”
- Say “Alexa, start Roll Some Dice and roll a die minus one.” Alexa will generate a random number between 1 and 6 and subtract 1, and say, for example, “You said roll 1 dice minus 1. I rolled a three.”

With a modifier using synonyms:

- Say “Alexa, start Roll Some Dice and roll a die add one.” Alexa will generate a random number between 1 and 6 and add 1, and say, for example, “You said roll 1 dice plus 1. I rolled a six.”
- Say “Alexa, start Roll Some Dice and roll a die subtract one.” Alexa will generate a random number between 1 and 6 and subtract 1, and say, for example, “You said roll 1 dice minus 1. I rolled a three.”

With a modifier, testing the edge/limits we put in:

- Say “Alexa, start Roll Some Dice and roll a die plus seven.” Alexa will generate a random number between 1 and 6 and add 7, maxing out at 6, and say, for example, “You said roll 1 dice plus 7. I rolled a six.”
- Say “Alexa, start Roll Some Dice and roll a die minus seven.” Alexa will generate a random number between 1 and 6 and subtract 7, with a minimum value of 0, and say, for example, “You said roll 1 dice minus 1. I rolled a zero.”

Testing missing slots and default values:

- Say “Alexa, start Roll Some Dice and roll dice.” Alexa will generate a random number between 1 and 6 and say, for example, “You said roll 1 dice. I rolled a three.”
- Say “Alexa, start Roll some Dice and roll a die plus.” Alexa will generate a random number between 1 and 6 and say, for example, “You said roll 1 dice. I rolled a three.”
- Say “Alexa, start Roll some Dice and roll 1 die frog 3.” Alexa will not understand and should respond, “Sorry, I can’t understand the command.”

Now we need to “stringify” those phrases and put them in our skill.json file here:

```
"isAvailableWorldwide": true,
"testingInstructions": "
```**Sample Testing Instructions.**",
"category": "GAME_INFO_AND_ACCESSORY",

The easiest way I’ve found to convert the text in the lists above into the correct format is in a text editor (like Notepad++) to replace the **“** marks with **\”** and then MS Word to replace all paragraph marks (under Special…) with **\n**, and tab characters (also under Special…) with spaces. When you’re done, the tests will look like this:

`Basic Phrases:\n1. Say \"Alexa, start Roll Some Dice and roll a die.\" Alexa will generate a random number between 1 and 6 and say, for example, \"You said roll 1 dice. I rolled a three.\"\n2. Say \"Alexa, start Roll Some Dice and roll 10 dice.\" Alexa will generate 10 random numbers between 1 and 6 and report the results, for example, \"You said roll 10 dice. I rolled 3 ones, 4 threes, a four, a five and a six.\"\nWith a modifier:\n1. Say \"Alexa, start Roll Some Dice and roll a die plus one.\" Alexa will generate a random number between 1 and 6 and add 1, and say, for example, \"You said roll 1 dice plus 1. I rolled a two.\"\n2. Say \"Alexa, start Roll Some Dice and roll a die minus one.\" Alexa will generate a random number between 1 and 6 and subtract 1, and say, for example, \"You said roll 1 dice minus 1. I rolled a three.\"\nWith a modifier using synonyms:\n1. Say \"Alexa, start Roll Some Dice and roll a die add one.\" Alexa will generate a random number between 1 and 6 and add 1, and say, for example, \"You said roll 1 dice plus 1. I rolled a six.\"\n2. Say \"Alexa, start Roll Some Dice and roll a die subtract one.\" Alexa will generate a random number between 1 and 6 and subtract 1, and say, for example, \"You said roll 1 dice minus 1. I rolled a three.\"\nWith a modifier, testing the edge/limits we put in:\n1. Say \"Alexa, start Roll Some Dice and roll a die plus seven.\" Alexa will generate a random number between 1 and 6 and add 7, maxing out at 6, and say, for example, \"You said roll 1 dice plus 7. I rolled a six.\"\n2. Say \"Alexa, start Roll Some Dice and roll a die minus seven.\" Alexa will generate a random number between 1 and 6 and subtract 7, with a minimum value of 0, and say, for example, \"You said roll 1 dice minus 1. I rolled a zero.\"\nTesting missing slots and default values:\n1. Say \"Alexa, start Roll Some Dice and roll dice.\" Alexa will generate a random number between 1 and 6 and say, for example, \"You said roll 1 dice. I rolled a three.\"\n2. Say \"Alexa, start Roll some Dice and roll a die plus.\" Alexa will generate a random number between 1 and 6 and say, for example, \"You said roll 1 dice. I rolled a three.\"\n3. Say \"Alexa, start Roll some Dice and roll 1 die frog 3.\" Alexa will not understand and should respond, \"Sorry, I can't understand the command.\"\n`

Now you can plug the new string in the place of **Sample Testing Instructions.** Like so:

```
"isAvailableWorldwide": true,
"testingInstructions": "
```**Basic Phrases:\n1. Say \"Alexa, start Roll Some Dice and roll a die.\" Alexa will generate a random number between 1 and 6 and say, for example, \"You said roll 1 dice. I rolled a three.\"\n2. Say \"Alexa, start Roll Some Dice and roll 10 dice.\" Alexa will generate 10 random numbers between 1 and 6 and report the results, for example, \"You said roll 10 dice. I rolled 3 ones, 4 threes, a four, a five and a six.\"\nWith a modifier:\n1. Say \"Alexa, start Roll Some Dice and roll a die plus one.\" Alexa will generate a random number between 1 and 6 and add 1, and say, for example, \"You said roll 1 dice plus 1. I rolled a two.\"\n2. Say \"Alexa, start Roll Some Dice and roll a die minus one.\" Alexa will generate a random number between 1 and 6 and subtract 1, and say, for example, \"You said roll 1 dice minus 1. I rolled a three.\"\nWith a modifier using synonyms:\n1. Say \"Alexa, start Roll Some Dice and roll a die add one.\" Alexa will generate a random number between 1 and 6 and add 1, and say, for example, \"You said roll 1 dice plus 1. I rolled a six.\"\n2. Say \"Alexa, start Roll Some Dice and roll a die subtract one.\" Alexa will generate a random number between 1 and 6 and subtract 1, and say, for example, \"You said roll 1 dice minus 1. I rolled a three.\"\nWith a modifier, testing the edge/limits we put in:\n1. Say \"Alexa, start Roll Some Dice and roll a die plus seven.\" Alexa will generate a random number between 1 and 6 and add 7, maxing out at 6, and say, for example, \"You said roll 1 dice plus 7. I rolled a six.\"\n2. Say \"Alexa, start Roll Some Dice and roll a die minus seven.\" Alexa will generate a random number between 1 and 6 and subtract 7, with a minimum value of 0, and say, for example, \"You said roll 1 dice minus 1. I rolled a zero.\"\nTesting missing slots and default values:\n1. Say \"Alexa, start Roll Some Dice and roll dice.\" Alexa will generate a random number between 1 and 6 and say, for example, \"You said roll 1 dice. I rolled a three.\"\n2. Say \"Alexa, start Roll some Dice and roll a die plus.\" Alexa will generate a random number between 1 and 6 and say, for example, \"You said roll 1 dice. I rolled a three.\"\n3. Say \"Alexa, start Roll some Dice and roll 1 die frog 3.\" Alexa will not understand and should respond, \"Sorry, I can't understand the command.\"\n**",
"category": "GAME_INFO_AND_ACCESSORY",

Now, with all that in place, you should be able to push the skill to Amazon again. At a PowerShell command prompt, from the root folder of your skill, enter the following command:

```
ask deploy --profile "default" --target "all"
```

Assuming your skill deployed properly and passes all your tests, we are ready to go through the Distribution and Certification steps in the Alexa Developer Console.

On the first page of Distribution, we can upload the icon files we found earlier. Simply add them here:

Now click Save and Continue.

Then, because we already filled all this in the skill.json, you can just click Save and Continue again.

And again.

Now, you’re at the validation stage. Your skill should pass validation.

Click on Functional Test, then click Run.

It passes!! Your skill is ready for Submission. Go ahead. Click that Submit button and relax for a bit. Depending on the promotions and backlog, your skill may or may not get reviewed within the next 1-3 business days.

That’s it for now.

A few days later… WOOHOO!