code: def create_skill(project_name, skill):
      skills_controller = SkillsController()
      for required_field in ["name", "type", "params"]:
          if required_field not in skill:
              return http_error(
                  HTTPStatus.BAD_REQUEST,
                  "Missing field",
                  'Missing "{}" field for skill'.format(required_field),
              )
      name = skill["name"]
      type = skill["type"]
      params = skill["params"]
  
      try:
          existing_skill = skills_controller.get_skill(
              name, project_name
          )
      except ValueError:
          # Project needs to exist
          return http_error(
              HTTPStatus.NOT_FOUND,
              "Project not found",
              f"Project with name {project_name} does not exist",
          )
  
      if existing_skill is not None:
          return http_error(
              HTTPStatus.CONFLICT,
              "Skill already exists",
              f"Skill with name {name} already exists. Please use a different name",
          )
  
      new_skill = skills_controller.add_skill(
          name, project_name, type, params
      )
      return new_skill.as_dict(), HTTPStatus.CREATED
  
file_path: mindsdb/mindsdb/api/http/namespaces/skills.py
imports: from http import HTTPStatus
  from flask import request
  from flask_restx import Resource
  from mindsdb.api.http.namespaces.configs.projects import ns_conf
  from mindsdb.api.http.utils import http_error
  from mindsdb.interfaces.skills.skills_controller import SkillsController
label_desc: Use image node_id 1 for calling a global function with example usage: create_skill(project_name, skill) and returns: new_skill,  HTTPStatus, http_error, http_error, http_error