Template project using go-alexa-lambda library.
# this must be in your GOPATH, e.g. in the path to your git repo (see below)
git clone https://github.com/DrPsychick/go-alexa-lambda-template.git
mv go-alexa-lambda-template my-skill-name
cd my-skill-name
rm -rf .git
# Makefile requires mmake
go install github.com/tj/mmake/cmd/mmake@v1.4.0
alias make='mmake'
make test
make build
# generate skill and interactionModel(s)
./mydemoskill make --skill --models
ls -la ./alexa/skill.json ./alexa/*/*/en-US.json
# test how lambda responds to a launch request
./test/test-lambda.sh launch
# create your own git repo and push it
GITREPO=github.com/yourname/yourproject
git init .
git remote add origin https://$GITREPO.git
# replace module paths of the template with your own
find . -name \*.go -exec sed -i "" -e "s#github.com/drpsychick/go-alexa-lambda-template#$GITREPO#" {} ';'
git add .
git commit -m "initial commit"
git push
This templates is ready to use with an existing demo intent. Here are some example phrases:
- Alexa open my demo skill and make coffee.
- Alexa prepare lunch with my demo skill.
- Alexa start my demo skill. Yes? Sudo make me a sandwich.
To replace it with your own first intent, do the following:
- Replace Intent and Slot name in
loca/loca.go
- Replace
DoSomething
with your intent name - Replace
Task
with your slot type
- Replace
- Update your english locale accordingly
loca/en-US.go
- Like above replace
DoSomething
andTask
- Change texts and phrases to match your intent.
- Like above replace
- Make sure all references to the changed
loca.
constants are updated in all files.
- Adjust
skill.go
to define your skill manifest and interaction model. - Adjust
app.go
and add the behavioural or business logic for your intents. - Adjust
lambda/lambda.go
to add more intents or change how to process Alexa requests. - Of course, adjust
loca
files to your needs, adding keys and changing texts.
- run
make build; ./mydemoskill make --skill --models
- check
alexa/skill.json
andalexa/interactionModel/custom/en-US.json
Make a concept for your skill on how people will interact with it, e.g. use a mind map.
- How will users launch it?
- How will users interact with your skill?
- Write down example phrases and dialogs with your skill.
- Read them out loud and check if it "feels" like a smooth conversation.
- Make sure to repeat the above steps for every language (locale). Especially your invocation will likely be specific to the locale.
- Create sample lambda requests to ensure your lambda function answers correctly.
- Create a few common dialogs you want to have tested after deploy.
- Important:
ask cli dialog
does not work with prompts delegated to Alexa! It will just timeout.
- Important:
- Manually test dialogs with prompt delegation to Alexa with the Alexa SDK website.