Learn how to use the Mycroft Skills Kit - MSK - to make the creation, testing and submission of Skills a lot easier.
The Mycroft Skills Kit - msk - is a Python-based utility that has been created to make it easier for Skill Authors to create, test and submit Skills to the Skills Marketplace. We hope this utility helps to shorten the development cycle, and remove some of the tedious parts of Skill creation.
msk currently supports the following features:
Create a new Skill
Create an Intent test for a Skill
Upload a Skill
Upgrade an existing Skill
Installing msk
NOTE: msk has only been tested on Linux systems
msk comes pre installed on the Mark 1, Picroft and the git installation of Mycroft-core. The utility is self-contained and can be installed separately using pip by typing the following line into the terminal on your Linux system:
Next, we use the msk create function. You will be prompted to enter the required information to help set up your Skill.
$mskcreateEnterashortuniqueskillname (ie. "siren alarm"or"pizza orderer"):FeedtheCorgiClassname:FeedTheCorgiSkillReponame:feed-the-corgi-skillLooksgood? (Y/n) YEnteraonelinedescriptionforyourskill (ie. Ordersfreshpizzasfromthestore):-RemindsyoutofeedyourpoorstarvingCorgiEnteralongdescription:> Every 24 hours, Mycroft will send you a reminder to feed your Corgi, and tell you what your Corgi was fed the previous day, so you can provide a different delicious meal for your precious Corgi.>Entersomeexamplephrasestotriggeryourskill:-HaveIfedtheCorgitoday-WhatdidIfeedtheCorgiyesterday-RemindmetofeedtheCorgiat5pm-Enterauthor:YourGitHubUserNameCategoriesdefinewheretheskillwilldisplayintheMarketplace.Itmustbeoneofthefollowing:Daily,Configuration,Entertainment,Information,IoT,Music&Audio,Media,Productivity,Transport.Entertheprimarycategoryforyourskill:-DailyEnteradditionalcategories (optional):-Productivity-Entertagstomakeiteasiertosearchforyourskill (optional):-Dogs-WouldyouliketocreateaGitHubrepoforit? (Y/n) Y===GitHubCredentials===Username:YourGitHubUserNamePassword:Countingobjects:12,done.Deltacompressionusingupto8threads.Compressingobjects:100% (5/5), done.Writingobjects:100% (12/12), 1.44 KiB |0bytes/s,done.Total12 (delta 0), reused 0 (delta0)Tohttps://github.com/YourGitHubUserName/feed-the-corgi-skill* [new branch]master ->masterBranchmastersetuptotrackremotebranchmasterfromorigin.CreatedGitHubrepo:https://github.com/YourGitHubUserName/feed-the-corgi-skillCreatedskillat:/opt/mycroft/skills/feed-the-corgi-skill
Now, if you look in /opt/mycroft/skills/ you will see that all the files required for the Skill have now been created, including the .voc files.
Please see this ASCII Cinema video to see the process for using msk create-test:
As before if the mycroft-core github installation is used make sure to use mycroft-msk or activate the mycroft-core Python virtual environment. From the mycroft-core folder
$ source .venv/bin/activate
Next, we use the msk create-test function. You must pass the Skill directory location to the command, or it will fail.
Please see this ASCII Cinema video to see the process for using msk upload:
If using the msk delivered with the mycroft-core github installation be sure to use mycroft-msk or activate the mycroft-core Python virtual environment. From the mycroft-core folder
$ source .venv/bin/activate
You will now see that your bash prompt is prefixed with (venv).
Next, we use the msk upload command with the path to the Skill:
That your Skill has already been merged with the mycroft-skills repo.
That you have made changes to your Skill and that these changes have been committed to the Skill'sgit repository.
Once your changes are committed, you can then use msk upgrade by passing the location of the Skill folder. Generally we find it's easiest to be inside the Skill's folder in /opt/mycroft/skills/SKILL-NAME and then use the current directory symbol, period .
(.venv) kathyreid@kathyreid-Oryx-Pro:/opt/mycroft/skills/kathy-msk-test-skill$ msk upgrade .
=== GitHub Credentials ===
Username: KathyReid
Password:
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 877 bytes | 877.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
remote:
remote: Create a pull request for 'upgrade-kathy-msk-test-skill' on GitHub by visiting:
remote: https://github.com/KathyReid/mycroft-skills/pull/new/upgrade-kathy-msk-test-skill
remote:
To https://github.com/KathyReid/mycroft-skills
* [new branch] upgrade-kathy-msk-test-skill -> upgrade-kathy-msk-test-skill
Branch 'upgrade-kathy-msk-test-skill' set up to track remote branch 'upgrade-kathy-msk-test-skill' from 'fork'.
=== Upgrade kathy-msk-test-skill ===
'This upgrades kathy-msk-test-skill to include the following new commits:
- [test for msk](https://github.com/KathyReid/kathy-msk-test-skill/commit/6d0e3552314673402e6f44ee90ee29feff6075ca)
<sub>Created with [mycroft-skills-kit](https://github.com/mycroftai/mycroft-skills-kit) v0.3.10</sub>
Created PR at: https://github.com/MycroftAI/mycroft-skills/pull/661
If you try to run msk upgrade and your Skill has not yet been merged, you will receive the error:
(.venv) kathyreid@kathyreid-Oryx-Pro:/opt/mycroft/skills/kathy-msk-test-skill$ msk upgrade .
NotUploaded: The skill kathy-msk-test-skill has not yet been uploaded to the skill store
If have uncommitted items, you will receive the error:
(.venv) kathyreid@kathyreid-Oryx-Pro:/opt/mycroft/skills/kathy-msk-test-skill$ msk upgrade .
AlreadyUpdated: The latest version of kathy-msk-test-skill is already uploaded to the skill repo
(.venv) kathyreid@kathyreid-Oryx-Pro:/opt/mycroft/skills/kathy-msk-test-skill$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
You need to ensure that your changes are committed:
(.venv) kathyreid@kathyreid-Oryx-Pro:/opt/mycroft/skills/kathy-msk-test-skill$ git commit -a
[master 6d0e355] test for msk
1 file changed, 3 insertions(+)
(.venv) kathyreid@kathyreid-Oryx-Pro:/opt/mycroft/skills/kathy-msk-test-skill$ git push -u origin master
Username for 'https://github.com': KathyReid
Password for 'https://KathyReid@github.com':
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 326 bytes | 326.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/KathyReid/kathy-msk-test-skill
5c9a7f2..6d0e355 master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.