docs: function createAgent (appname, masterSpec, moduleSpec, cb) {
    fs.mkdir(path.join(path.resolve(appname), 'generated', 'agents', moduleSpec.name), function (response) {
      createTemplate(appname, path.join('generated', 'agents', 'agentModule.js'), {
        moduleName: moduleSpec.name,
        states: moduleSpec.states
      })
  
      var oldPath = path.join(appname, 'generated', 'agents', 'agentModule.js'),
        newPath = path.join(appname, 'generated', 'agents', moduleSpec.name, moduleSpec.name + '.js')
      fs.renameSync(oldPath, newPath)
  
      // CREATE THE AGENT MAIN CONTROLLER
      fs.mkdir(path.join(path.resolve(appname), 'generated', 'agents', moduleSpec.name, 'controllers'), function (response) {
        createTemplate(appname, path.join('generated', 'agents', 'agentMasterController.js'), {
          moduleName: moduleSpec.name,
          actions: moduleSpec.actions,
          states: moduleSpec.states
        })
        var oldControllerPath = path.join(appname, 'generated', 'agents', 'agentMasterController.js'),
          newControllerPath = path.join(appname, 'generated', 'agents', moduleSpec.name, 'controllers', moduleSpec.name + '.js')
        fs.renameSync(oldControllerPath, newControllerPath)
  
        // CREATE THE MODULE INIT STATE CONTROLLER AND PARTIAL
        fs.mkdir(path.join(path.resolve(appname), 'generated', 'partials', 'agents', moduleSpec.name), function (response) {
          createTemplate(appname, path.join('generated', 'index.html'), {})
  
          var oldHtmlPath = path.join(appname, 'generated', 'index.html'),
            newHtmlPath = path.join(appname, 'generated', 'partials', 'agents', moduleSpec.name, 'index.html')
          fs.renameSync(oldHtmlPath, newHtmlPath)
  
          if (moduleSpec.actions.elements) {
            for (childState in moduleSpec.actions.elements) {
              var state = {
                title: moduleSpec.actions.elements[childState].ui.title,
                components: moduleSpec.actions.elements.init.components,
                initConversation: true
              }
              createAgentChildState(appname, moduleSpec.name, moduleSpec.actions.elements[childState], '', moduleSpec.actions.url)
            }
          }
          // CREATE THE MODULE CHILD STATES
          if (moduleSpec.states) {
            for (var i = moduleSpec.states.length - 1; i >= 0; i--) {
              moduleSpec.states[i] = translateUiTitles(moduleSpec.states[i])
              createAgentState(appname, moduleSpec.name, moduleSpec.states[i], moduleSpec.actions.url)
            }
          }
          moduleSpec.actions.elements = translateUiTitles(moduleSpec.actions.elements)
          fs.mkdir(path.join(path.resolve(appname), 'generated', 'agents', moduleSpec.name, 'services'), function (response) {
            createTemplate(appname, path.join('generated', 'agents', 'agentServices.js'), {
              moduleName: moduleSpec.name,
              actions: moduleSpec.actions,
              states: moduleSpec.states,
              agentSpec: masterSpec.agents
            })
            var oldServicePath = path.join(appname, 'generated', 'agents', 'agentServices.js'),
              newServicePath = path.join(appname, 'generated', 'agents', moduleSpec.name, 'services', moduleSpec.name + 'Services.js')
            fs.renameSync(oldServicePath, newServicePath)
            cb()
          })
        })
      })
    })
  }