Mycroft Skills Kit
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
Intenttest for a SkillUpload 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:
pip3 install mskYou should then see output like the below:
Collecting msk
Downloading https://files.pythonhosted.org/packages/69/d9/1d41acac01b1e6f9004963606f0b9f939a917e240a955a657f6dc1844836/msk-0.3.8.tar.gz
Collecting GitPython (from msk)
Using cached https://files.pythonhosted.org/packages/ac/c9/96d7c86c623cb065976e58c0f4898170507724d6b4be872891d763d686f4/GitPython-2.1.10-py2.py3-none-any.whl
Collecting typing (from msk)
Using cached https://files.pythonhosted.org/packages/05/2b/2b05bf1d5a9dd450447c9a5df3e118a465e5d3cb12b73b7220a5064a403f/typing-3.6.4-py3-none-any.whl
Collecting msm>=0.5.13 (from msk)
Collecting pygithub (from msk)
Collecting gitdb2>=2.0.0 (from GitPython->msk)
Using cached https://files.pythonhosted.org/packages/e0/95/c772c13b7c5740ec1a0924250e6defbf5dfdaee76a50d1c47f9c51f1cabb/gitdb2-2.0.3-py2.py3-none-any.whl
Collecting pyjwt (from pygithub->msk)
Using cached https://files.pythonhosted.org/packages/93/d1/3378cc8184a6524dc92993090ee8b4c03847c567e298305d6cf86987e005/PyJWT-1.6.4-py2.py3-none-any.whl
Collecting smmap2>=2.0.0 (from gitdb2>=2.0.0->GitPython->msk)
Using cached https://files.pythonhosted.org/packages/e3/59/4e22f692e65f5f9271252a8e63f04ce4ad561d4e06192478ee48dfac9611/smmap2-2.0.3-py2.py3-none-any.whl
Building wheels for collected packages: msk
Running setup.py bdist_wheel for msk ... done
Stored in directory: /home/kathyreid/.cache/pip/wheels/b8/d7/7d/c650d047645e875a4c301821844ded868db716b877fdae8b9b
Successfully built msk
Installing collected packages: smmap2, gitdb2, GitPython, typing, msm, pyjwt, pygithub, msk
Successfully installed GitPython-2.1.10 gitdb2-2.0.3 msk-0.3.8 msm-0.5.14 pygithub-1.39 pyjwt-1.6.4 smmap2-2.0.3 typing-3.6.4To check that the installation was successful msk --help can be run and should list the arguments and options for the utility.
Usage
The normal commands for msk are:
If using the built-in installation of msk with a Mycroft device or Mycroft git installation, use mycroft-msk in place of msk:
Create
Next, we use the msk create function. You will be prompted to enter the required information to help set up your 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.
Create test
msk also provides a function for creating Intent tests, as part of our Automated Testing for Skills.
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.
If we have a look inside the corgi.the.feed.intent.0.intent.json file we can see that the test has been created for us.
Upload Skill
msk also provides a function for uploading a Skill to the Mycroft Skills Repo, as part of our [Skill Submission Process] (https://mycroft.ai/documentation/skills/skill-submission/).
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:
Upgrade Skill
msk also provides a function for upgrading a Skill once it has been merged into the Mycroft Skills Repo, as part of our [Skill Submission Process] (https://mycroft.ai/documentation/skills/skill-submission/).
Before you upgrade
Before you can use msk upgrade, you must ensure:
That your Skill has already been merged with the
mycroft-skillsrepo.That you have made changes to your Skill and that these changes have been committed to the Skill's
gitrepository.
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 .
msk upgrade will create a new PR on the Mycroft Skills Repo, and this will be reviewed using the Skills Acceptance process.
If you try to run
msk upgradeand your Skill has not yet been merged, you will receive the error:
If have uncommitted items, you will receive the error:
You need to ensure that your changes are committed:
Join our Skills Authoring Community
Last updated
Was this helpful?

