skill.translate¶
Format translators: SKILL.md <-> agent-specific formats.
Module Attributes
Registry of format translators (Skill -> target format string). |
Functions
|
Import a Cursor |
|
Translate a Skill to GitHub Copilot instructions format. |
|
Translate a Skill to Cursor |
|
Translate a Skill to the specified target format. |
- skill.translate.from_mdc(content)[source]¶
Import a Cursor
.mdcfile as a Skill.- Return type:
>>> content = "---\ndescription: Do things\nglobs: '*.py'\nalwaysApply: false\n---\n# Rules" >>> s = from_mdc(content) >>> s.meta.description 'Do things' >>> s.meta.metadata.get('cursor.globs') '*.py'
- skill.translate.to_copilot_instructions(skill)[source]¶
Translate a Skill to GitHub Copilot instructions format.
Produces a Markdown section suitable for appending to
.github/copilot-instructions.md. Lossy: no frontmatter support beyondapplyTo, no progressive disclosure, no resources.- Return type:
>>> from skill.base import SkillMeta >>> s = Skill(meta=SkillMeta(name='lint', description='Lint rules'), body='Use ruff.') >>> md = to_copilot_instructions(s) >>> '## lint' in md True >>> 'Use ruff.' in md True
- skill.translate.to_mdc(skill)[source]¶
Translate a Skill to Cursor
.mdcformat.Lossy:
allowed-tools,license, bundled resources, and progressive disclosure semantics are lost.- Return type:
>>> from skill.base import SkillMeta >>> s = Skill(meta=SkillMeta(name='test', description='Test skill'), body='Do stuff.') >>> mdc = to_mdc(s) >>> 'description: Test skill' in mdc True >>> 'Do stuff.' in mdc True