Cayenne pepper and red pepper flakes? Chili powder?
I've never come across anywhere where powder and flakes mean the same, but substituting one for the other should work in terms of flavour (the appearance and texture might be a bit different).

More specifically, in some places chilli powder means powdered chillies (like cayenne), in others it means chilli spice blend. Here in the UK it's even worse - both meanings can be found in the same shop.

Red pepper flakes aren't as common here as chilli flakes, but I wouldn't expect red pepper flakes to be hot, unlike chilli flakes. Sweet/mild paprika would be the substitute in that case.

So you have to be careful of where the recipe comes from as well as where you are. I suggest you have some form of mild pepper in powder or flake form, and some form of hot pepper, and adjust to taste when the dish is nearly cooked. This isn't perfect as (especially with flakes) the flavour needs to cook into the dish a bit.