Skill authoring

From cheatcode-ai/cheatcode · View interactive version

Skill authoring is an AI agent skill from the GitHub repository cheatcode-ai/cheatcode. Create or update project-local Cheatcode skills for direct backend routes, local workflows, or non-Composio external APIs. This is the default skill authoring path.

How to use this skill

Skill file

Cheatcode Skills

Use this skill when the user wants to create or update a generic custom skill for Cheatcode.

Do not use this skill for one-off task requests that can already be handled by an existing skill or by enabling a suitable tool.

Do not use this skill for deployable app-side Composio integrations.

If the request is for Airtable, Cal, Gmail, GitHub, Google Calendar, Google Docs, Linear, Notion, or another Composio-backed toolkit and the goal is to ship app code, switch to cheatcode-app-composio.

Default contract:

Use the lightest shape that fits the request:

/workspace/.cheatcode/skills/<skill-name>/
  SKILL.md
  references/       # optional

For tool-based skills that genuinely need executable logic:

/workspace/.cheatcode/skills/<skill-name>/
  SKILL.md
  <category>/
    <action>.ts
  scripts/          # optional Python, shell, or JavaScript helpers
  schemas/          # optional JSON, YAML, XML, or XSD contracts
  assets/           # optional templates and binary assets
  _shared.ts        # optional
  references/       # optional

Default implementation model:

  1. Determine whether the request is for a tool-based skill or a prompt-only skill.
  2. If the reusable behavior is mainly instructions, workflows, templates, decision rules, or usage of sandbox-built-in commands/CLI tools, keep the skill prompt-only.
  3. If the reusable behavior needs executable logic, durable automation, or third-party/API integration, make it tool-based.
  4. If the request is ambiguous, ask the user whether they want a reusable prompt/workflow skill or a tool-based automation skill.
  5. Understand the concrete behavior the user wants, including whether they also want the new capability used immediately after authoring.
  6. Run cheatcode-skills manage-skills/manage/list to check whether Cheatcode already provides a suitable built-in skill.
  7. If a suitable built-in skill already exists, prefer using it directly or enabling it instead of creating a new custom skill, unless the user explicitly asked to ignore the built-in option and create a custom one anyway.
  8. Pick a short kebab-case skill name only when custom skill authoring is still necessary.
  9. Create or update the skill under /workspace/.cheatcode/skills/.
  10. For tool-based skills, use createSkillTool(...) plus @cheatcode/sandbox-skills-runtime helpers.
  11. If the tool-based skill calls Cheatcode backend routes, use requestCheatcodeSkillJson(...).
  12. Treat @cheatcode/sandbox-skills-runtime as runtime-provided. Import it in source files, but do not add it to package.json and do not try to install it.
  13. If the skill only uses Node built-ins plus @cheatcode/sandbox-skills-runtime, skip package.json and skip dependency installation entirely.
  14. If the skill needs true third-party packages beyond that, you may author a root package.json, but do not assume persistence will install it during save or reload.
  15. Before validating or executing a custom skill that has a root package.json, install dependencies inside /workspace/.cheatcode/skills/<slug>/ when they are missing or stale. Treat missing local node_modules as the default signal to install. Do not install into shared /home/node/.cheatcode.
  16. For tool-based skills, validate the entrypoint shape with --help.
  17. For tool-based skills, run at least one representative non-destructive live invocation through the new skill when that is safely possible and the required auth/credentials are available. Prefer readonly actions such as get, list, search, preview, or other clearly non-mutating operations.
  18. If auth or credentials are missing, still validate CLI wiring and any auth guard path, but say explicitly that the live provider behavior remains unverified until a real authenticated invocation succeeds.
  19. If dependency installation for that specific skill fails, say so explicitly and stop rather than pretending the skill is ready.
  20. If a tool-based skill cannot be exercised safely end to end, say exactly what blocked validation and what remains unverified.
  21. Prompt-only skills do not need executable validation beyond making sure the prompt and file structure are correct.
  22. For a new Skill Creator package, call skill_create exactly once after validation and pass the exact folder slug under /workspace/.cheatcode/skills/ so Cheatcode can persist the complete package atomically. For edits to an already-saved skill, persist with cheatcode-skills skill-authoring/persist/save --skill <slug>.
  23. If the new skill likely requires credentials and they are not already available, explain the missing auth requirement clearly at the end, including where the user can obtain it and that the custom skill should keep those secrets in its root .env file so they persist with the skill.
  24. After creation or persistence, explain the new skill in user-facing terms: what the user can ask Cheatcode to do with it, and that Cheatcode can use it automatically when a future request clearly matches it. Do not default to CLI commands, code snippets, tool paths, or cheatcode-skills ... usage examples unless the user explicitly asks for technical usage or debugging details.
  25. If the user's original goal was to perform a task with the new capability, continue immediately after validation and persistence by using the new skill unless the user asked to stop at implementation only.

Read references/cheatcode-skills.md before introducing a new helper or transport pattern.

Read references/skill-registration.md before persisting a new or updated custom skill, and when the user explicitly asks about save/register behavior.

Minimal tool shape for tool-based skills:

import {
  createSkillTool,
  readProjectSkillRuntimeConfig,
  requestCheatcodeSkillJson,
  stringOption,
} from "@cheatcode/sandbox-skills-runtime";

async function main() {
  await createSkillTool({
    name: "lookup",
    description: "Run a project-local Cheatcode action.",
    options: {
      query: stringOption({
        description: "Lookup query.",
        short: "q",
        required: true,
      }),
    },
    action: async ({ options, logger }) => {
      const config = await readProjectSkillRuntimeConfig();
      const result = await requestCheatcodeSkillJson({
        config,
        path: "/your/backend/route",
        body: { query: options.query },
      });

      logger.log(JSON.stringify(result, null, 2));
    },
  }).run();
}

void main();

Keep runtime alignment in mind:

Avoid:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.