{
  "project": {
    "name": "contrib",
    "repo": "https://github.com/contrib/contrib",
    "requirements": [
      {
        "name": "git",
        "home": "http://git-scm.com"
      },
      {
        "name": "node.js",
        "home": "http://nodejs.org"
      }
    ]
  },

  "install": {
    "desc": "Fork, download, and setup the project",
    "steps": [
      { "prompt": "confirm", "desc": "You will now be taken to Github where you will choose an account to fork the project under." },
      { "exec": "open {{project.repo}}/fork" },
      { "prompt": "text", "desc": "Which account did you choose? (no '@')", "id": "owner" },
      { "exec": "git clone https://github.com/{{owner}}/contrib.git" },
      { "exec": "cd contrib" },
      { "include": "setup" }
    ]
  },

  "setup": {
    "desc": "Set up version control and install dependencies",
    "steps": [
      [ "git fetch origin",                      "Get all git branches" ],
      [ "git remote add upstream {{project.repo}}.git",  "Add the upstream project as a remote for pulling changes" ],
      [ "git fetch upstream",                    "Get all upstream branches and changes" ],
      { "include": "update" }
    ]
  },

  "update": {
    "desc": "Get the latest copy of the code",
    "steps":[
      [ "git checkout master",      "Switch to the master branch" ],
      [ "git pull upstream master", "Get any changes to the main project" ],
      [ "git push origin master",   "Push any changes to your remote copy of the project" ],
      [ "npm install",              "Install any new dependencies" ],
      [ "grunt",                    "Build and run tests" ]
    ]
  },

  "test": "grunt test",
  "watch": "grunt watch",

  "feature": {
    "desc": "Create a new feature or general enhancement",
    "start": {
      "desc": "Start a new feature",
      "steps": [{ "include": "code_change start" }]
    },
    "submit": {
      "desc": "Submit a pull request for a feature when it's finished",
      "steps": [{ "include": "code_change submit" }]
    },
    "delete": {
      "desc": "Delete the current feature branch",
      "steps": [{ "include": "code_change delete" }]
    }
  },

  "patch": {
    "desc": "Create a new patch or general enhancement",
    "start": {
      "desc": "Start a new patch",
      "steps": [{ "include": "code_change start" }]
    },
    "submit": {
      "desc": "Submit a pull request for a patch when it's finished",
      "steps": [{ "include": "code_change submit" }]
    },
    "delete": {
      "desc": "Delete the current patch branch",
      "steps": [{ "include": "code_change delete" }]
    }
  },

  "code_change": {
    "private": true,
    "start": {
      "desc": "",
      "steps": [
        { "prompt": "text",                            "desc": "Name the branch", "id": "name" },
        { "include": "update" },
        { "exec": "git checkout -b {{name}} master",  "desc": "Create a branch for the changes" }
      ]
    },
    "submit": {
      "desc": "Submit a pull request for the changes after they are finished",
      "steps": [
        { "exec": "git diff --exit-code",             "desc": "Test for unadded changes {{ args.[0] }}", "fail": "Make sure all changes have been added and committed, or stashed, before switching branches" },
        { "exec": "git diff --cached --exit-code",    "desc": "Test for uncommitted changes", "fail": "Make sure all changes have been added and committed, or stashed, before switching branches" },
        { "include": "test" },
        { "exec": "git rev-parse --abbrev-ref HEAD",  "desc": "Get the current branch", "id": "branch" },
        { "prompt": "confirm",                        "desc": "Are you sure {{branch}} is the branch you want to submit?" },
        { "exec": "git push -u origin {{branch}}",    "desc": "Push the branch to your remote copy of the project" },
        { "prompt": "text",                           "desc": "Which github user or org are you submitting from?", "id": "user" },
        { "open": "{{project.repo}}/compare/contrib:{{baseBranch}}...{{user}}:{{branch}}", "desc": "Open the github pull request page" }
      ]
    },
    "delete": {
      "desc": "Delete the current set of changes",
      "steps": [
        { "exec": "git rev-parse --abbrev-ref HEAD", "desc": "Get the current branch name", "id": "name" },
        { "prompt": "confirm",                       "desc": "Are you sure '{{name}}' is the branch you want to delete?" },
        { "exec": "git branch -D {{name}}",          "desc": "Delete the local copy of the branch" },
        { "exec": "git push origin :{{name}}",       "desc": "Delete the remote copy of the branch" }
      ]
    }
  },

  "report": {
    "desc": "Submit a bug report",
    "steps": [
      { "prompt": "text", "desc": "Title your bug report",                                         "id": "title" },
      { "prompt": "text", "desc": "What did you do? (steps to reproduce)",                         "id": "reproduce" },
      { "prompt": "text", "desc": "What did you expect to happen?",                                "id": "expected" },
      { "prompt": "text", "desc": "What actually happened?",                                       "id": "actual" },
      { "prompt": "text", "desc": "What version of contrib are you using?",                        "id": "version" },
      { "prompt": "text", "desc": "What platforms did you experience this in (e.g. Mac OS 10.7)?", "id": "platforms" },
      { "prompt": "text", "desc": "Are there any other details you'd like to provide?",            "id": "details" },
      { "open": "{{project.repo}}/issues/new?title={{title}}&body=**Steps to reproduce:**\n> {{reproduce}}\n\n**What was expected:**\n> {{expected}}\n\n**What Happened:**\n> {{actual}}\n\n**Version:**\n> {{version}}\n\n**Platforms experienced on:**\n> {{platforms}}\n\n**Other details:**\n> {{details}}" }
    ]
  },

  "request": {
    "desc": "Submit a feature/enhancement request",
    "steps": [
      { "prompt": "text",    "desc": "Title your request", "id": "title" },
      { "prompt": "text",    "desc": "Describe the feature/enhancement (be as detailed as possible so it's clear who, why, and how it would be used)", "id": "describe" },
      { "prompt": "text",    "desc": "Is there any existing documentation or related specifications?", "id": "docs" },
      { "prompt": "text",    "desc": "Are there any existing examples?", "id": "examples" },
      { "prompt": "confirm", "desc": "You will be redirected to Github where you can submit this issue, OK?" },
      { "open": "{{project.urls.repo_ui}}/issues/new?title={{ title }}&body=**Describe the feature/enhancement:**\n> {{ describe }}\n\n**Existing docs/specs:**\n> {{ docs }}\n\n**Existing examples:**\n> {{ examples }}" }
    ]
  },

  "example": "echo hi"
}
