{
  "name": "scaffold",
  "title": "Load Project Environment",
  "category": "Core Functions",
  "slug": "scaffold",
  "description": "Loads your project environment by reading settings, installing/loading packages,\nsourcing custom functions, and setting up your workspace. This is the first\nfunction you run after library(framework).\n",
  "usage": "scaffold(quiet = FALSE)",
  "params": [
    {
      "name": "quiet",
      "type": "logical",
      "default": false,
      "description": "Suppress startup messages and package load notifications"
    }
  ],
  "returns": "Invisibly returns TRUE on success. Side effects include loading packages,\nsourcing functions from functions/ directory, and setting the random seed.\n",
  "details": "scaffold() performs the following actions in order:\n\n1. Reads settings from settings.yml (or split settings files)\n2. Sets random seed if configured (for reproducibility)\n3. Installs missing packages from settings$packages\n4. Loads/attaches packages based on auto_attach configuration\n5. Sources all .R files in the functions/ directory\n6. Executes scaffold.R if present (for project-specific setup)\n",
  "examples": [
    {
      "code": "library(framework)\nscaffold()\n",
      "description": "Standard usage - loads environment with status messages"
    },
    {
      "code": "library(framework)\nscaffold(quiet = TRUE)\n",
      "description": "Silent mode - suppresses all startup messages"
    },
    {
      "code": "# In your scaffold.R file (project-specific setup)\nmessage(\"Custom setup running...\")\noptions(scipen = 999)  # Disable scientific notation\n",
      "description": "Custom project setup via scaffold.R"
    }
  ],
  "related": ["init", "configure_packages", "packages_install"],
  "see_also": [
    {
      "name": "init",
      "description": "Initialize a new Framework project"
    },
    {
      "name": "configure_packages",
      "description": "Configure package installation and loading"
    }
  ],
  "tags": ["setup", "environment", "core", "workflow"],
  "notes": ["If you use renv, scaffold() will use renv for package installation", "The random seed is set from settings$seed or FW_SEED environment variable", "All .R files in functions/ are sourced in alphabetical order"]
}
