Video Transcript

Hey, this is Steve with Dabble Lab.  In this video, I’m going to talk about using the Alexa Skills Kit Command Line Interface, the ASK-CLI to create new skills using a template.  This is kind of a trick that I figured out or an approach that I figured out to creating new skills with existing code that isn’t documented exactly.  So I thought I’ll create a video and show you how to do it.

So when you read the documentation on the skills kit, creating a new skill project, it talks about using the ASK new command and it creates a boilerplate skill.  So if you go ask new like this, name, create a skill called, like, hello world, and that’s going to create skill project for you that is going to look like this.  And it has a boilerplate skill function, Lambda Function for the skill that’s a hello world.  Then you can go ahead and start editing from here, which is great.

As you have more skills or you’re using code that you find online on GitHub or something like that, you’ll be copying and pasting to add the stuff in here.  So I was looking for the way to create skill templates, I guess, not to be confused with the ones, the blueprints that you can find when you go create a new Lambda Function.  But this approach that I use lets me start with code that I’ve previously created.

So I’ve got some skills that I use as templates that I’ve created myself and let me show you how that work.  So there is another command that you can use to that’s part of the skill kit called the clone command, so it’s ask clone, like that.  And that will give you a list of the skills that you’ve got in your Developer Console.  And so you can pick one of the skills that you want to clone and it shows both the live version and the development version and for cloning, you want to clone the development version.  I don’t think it will let you clone the live version, actually.

So when you do that, it’s going to make a copy of the skill with all of the setting.  So the spear suggestion is the one that I selected and so if I go in here, I can see all of the configuration information for that skill.  So this is, like, the interaction model and all of my intents and utterances and all of my lambda code everything is in here.

The purpose of this is sort of the obvious use case, I suppose, is to make updates to your existing skill which is how you would normally use it.  But you can hack it a little bit to use it a starting point for a new skill and how you would do that is you go into the configuration.  And the first thing that you want to do is you want to get rid of the skill ID, so you don’t override the existing skill and then you want to change the was clone from true to false.  And the last thing that you want to do in here is, you want to change the URI for the endpoint and this is the ARN for the Lambda Function to something new, so I’ll call this hello world example, like that.

So this is going to create a new function for me called hello world example and it’s going to create that in my AWS account.  So once I’ve made those changes, I can close it.  I usually will also change the folder name.  I’m going to change this to hello world, like that.  I will — let’s see, I want to get rid of the hello world, so this is not confusing.

All right.  So now I’ve got my new skill here and then I can just go through and make the changes that I need to make and I’m going to start with I’ll change the name of the skill to hello world.  And I won’t change all of this just because I think you get the point.  I’ve got my icons and everything in here.

I can change all of this stuff for whatever is appropriate for my new skill.  The other important change is going to be my invocation change, so I’ll change this to hello world also for this example.  Now with my changes done, I can go back over here and deploy this with ask deploy, like that.  And when I do that, this takes a minute to deploy and create the model, so I’m going to pause for a second and then I’ll come back.

So the deployment process is finished.  It created my skill and built the model and then also deployed my Lambda Function, so I can go check that out.  So if I go over here to my AWS console, I can see here’s my hello world example, which is the name of the function that I changed in the config.  And then if I go to my Developer Console here and refresh, I’ve got my new hello world skill.

So you can see how I carried over all of the configuration information because this is the one that I cloned.  But it’s not a development version of this one.  This is actually a new skill with new skill ID and everything, so this is my brand new starting point.  And I can go in here and make whatever changes I need to make and finish deploying the skill and then submit it for certification.

So that is how I go about creating new skills from a template, so hopefully, that was helpful.  If you have any questions or comments, you can leave those in the comments and I’ll reply just as soon as I can.  If you did find this video helpful, please like it and subscribe to the Dabble Lab channel.  Thanks so much.