 
   require Logger
 
+  @type current_user :: User.t() | atom
+
+  @doc """
+  Adds a third argument to every action that contains the current user or the atom `:guest`.
+
+  Runs before all other actions in the controller.
+  """
+  @spec action(Plug.Conn.t(), Map.t()) :: Plug.Conn.t()
+  def action(conn, params)
+
   def action(conn, _) do
     args = [conn, conn.params, conn.assigns[:current_user] || :guest]
     apply(__MODULE__, action_name(conn), args)
   end
+
+  @doc """
+  Creates a new tweak with the given parameters.
+  """
+  @spec create(Plug.Conn.t(), Map.t(), current_user) :: Plug.Conn.t()
+  def create(conn, params, current_user)
 
   def create(conn, _, :guest), do: raise(NotLoggedInError, conn: conn)
 

    |> PageMetadata.add(Tweak.to_metadata(tweak))
    |> render("show.html", name: name, tweak: tweak)
  end

  def update(conn, %{"user_id" => name, "id" => id, "tweak" => tweak_params}, _current_user) do
    tweak = Repo.get(Tweak, id)

    )
  end

  @doc """
  Displays the new tweak form.
  """
  @spec new(Plug.Conn.t(), Map.t(), current_user) :: Plug.Conn.t()
  def new(conn, params, current_user)

  def new(conn, _, :guest), do: render_error(conn, :unauthorized)

  def new(conn, %{"user_id" => name}, %{name: other_name}) when name !== other_name do
