#' @title Generate provenance for SUNSET's Skill module execution
#' @description Generate provenance information for the execution of SUNSET's Skill module.
#' @param recipe Configuration file specifying parameters.
#' @param data s2dv_cube object generated by SUNSET's Skill.R function.
#' @return List containing updated graph and parent node name.
#' @details This function generates provenance information for the execution of SUNSET's Skill module.
#' @references Add relevant references here.

SunsetProv.Skill <- function(recipe, graph, Indices = FALSE) {
    #fcst definition (Dataset+Datasubset)
    if (!is.null(data$fcst)) {
      graph_fcst <- Prov.Skill(recipe, data, graph, type = "fcst")
    }

    #hcst definition (Dataset+Datasubset)
    graph_hcst <- Prov.Skill(recipe, data, graph, type = "hcst")

    #hcst definition (Dataset+Datasubset)
    graph_obs <- Prov.Skill(recipe, data, graph, type = "obs")

    #Command Call and output definition
    if (!is.null(data$fcst)) {
      graph <- my_union_graph(graph_fcst$graph,graph_hcst$graph)

      graph <- SunsetProv.Command(graph, package = "Skill",
                                  version = "2.0.0",
                                  fun = "modules/Skill/Skill.R",
                                  arg.list =
                                    list(
                                        "recipe" = "Recipe",
                                        "Data" = "Data"),
                                  origin.node.name =
                                    list(graph_fcst$parentnodename,
                                        graph_hcst$parentnodename))

      graph <- list("graph" = graph,
                    "parentnodename" =
                      list(
                          "parentnodename_fcst" = graph_fcst$parentnodename,
                          "parentnodename_hcst" = graph_hcst$parentnodename,
                          "parentnodename_obs" = graph_obs$parentnodename))
    } else {
      graph <- graph_hcst$graph
      graph <- SunsetProv.Command(graph, package = "Skill",
                                  version = "2.0.0",
                                  fun = "modules/Skill/Skill.R",
                                  arg.list =
                                    list(
                                        "recipe" = "Recipe",
                                        "Data" = "Data"),
                                  origin.node.name =
                                    list(graph_hcst$parentnodename))

      graph <- list("graph" = graph,
                    "parentnodename" =
                      list(
                           "parentnodename_hcst" = graph_hcst$parentnodename,
                           "parentnodename_obs" = graph_obs$parentnodename))


    }
  return(graph)

}