class_docstr: Handles CRUD operations at the database level for Skills
docstr: Adds a skill to the database.
  
  Parameters:
      name (str): The name of the new skill
      project_name (str): The containing project
      type (str): The type of the skill (e.g. Knowledge Base)
      params: (Dict[str, str]): Parameters associated with the skill
  
  Returns:
      bot (db.Skills): The created skill
  
  Raises:
      ValueError: If `project_name` does not exist or skill already exists
docstr_tok: ["Adds","a","skill","to","the","database",".","Parameters",":","name","(","str",")",":","The","name","of","the","new","skill","project_name","(","str",")",":","The","containing","project","type","(","str",")",":","The","type","of","the","skill","(","e.g",".","Knowledge","Base",")","params",":","(","Dict","[","str",",","str","]",")",":","Parameters","associated","with","the","skill","Returns",":","bot","(","db.Skills",")",":","The","created","skill","Raises",":","ValueError",":","If","`","project_name","`","does","not","exist","or","skill","already","exists"]
code: def add_skill(
      self,
      name: str,
      project_name: str,
      type: str,
      params: Dict[str, str] = {},
  ) -> db.Skills:
      """
      Adds a skill to the database.
  
      Parameters:
          name (str): The name of the new skill
          project_name (str): The containing project
          type (str): The type of the skill (e.g. Knowledge Base)
          params: (Dict[str, str]): Parameters associated with the skill
  
      Returns:
          bot (db.Skills): The created skill
  
      Raises:
          ValueError: If `project_name` does not exist or skill already exists
      """
      if project_name is None:
          project_name = "mindsdb"
      project = self.project_controller.get(name=project_name)
  
      skill = self.get_skill(name, project_name)
  
      if skill is not None:
          raise ValueError(f"Skill with name already exists: {name}")
  
      new_skill = db.Skills(
          name=name,
          project_id=project.id,
          type=type,
          params=params,
      )
      db.session.add(new_skill)
      db.session.commit()
  
      return new_skill
  
file_path: mindsdb/mindsdb/interfaces/skills/skills_controller.py
imports: from typing import Dict, List
  from mindsdb.interfaces.storage import db
  from mindsdb.interfaces.database.projects import ProjectController
  from sqlalchemy.orm.attributes import flag_modified
label_desc: Use image node_id 4 for calling the SkillsController obj's underlying member method code with example usage: obj.add_skill(name, project_name, type, params) and returns: new_skill