Prep the aromatics: Heat olive oil in a skillet over medium. Add onion and cook until soft and translucent, about 5 minutes.
Stir in scallions and garlic; cook 1–2 minutes until fragrant. Set aside to cool slightly.
Make the filling: In a bowl, combine the squeezed spinach, feta, ricotta (if using), egg, dill, parsley, nutmeg, salt, and pepper. Fold in the cooled onion mixture.
Taste and adjust seasoning. The filling should be well seasoned and not watery.
Prep the phyllo: Unroll phyllo and cover with a barely damp towel to prevent drying. Work with one sheet at a time.
Brush a sheet lightly with melted butter. Place a second sheet on top and brush again. Cut into 3 long strips (about 3–4 inches wide each).
Fill and fold: Place about 1 tablespoon of filling at the bottom of each strip.
Fold the bottom corner up over the filling to form a triangle. Continue folding the triangle up the length of the strip, like a flag, keeping edges tucked in. Brush the outside lightly with butter.
Repeat with remaining phyllo and filling.
Preheat the air fryer: Set to 350°F (175°C) for 3 minutes. Lightly mist or brush the basket with oil to prevent sticking.
Air fry in batches: Arrange triangles in a single layer with space between them. Air fry at 350°F (175°C) for 7–10 minutes, flipping halfway, until deeply golden and crisp.
Time may vary by model and triangle size.
Serve: Let rest 2 minutes. Serve warm with lemon wedges. For a platter, sprinkle with extra dill or parsley.