I disagree that parties are in decline politically... especially the Republican party... don't be surprised to see it make huge gains in 2022 in Washington and around the state capitols...
But what is true is that both parties have moved so far away from what most Americans support that more Americans identify as independent even if they are only given a real choice between Republican or Democrat candidates in the annual election process.
As a result, the elected candidate rarely represent even the majority from their district... just the person that got the most votes... not the same thing...
Madison felt the best political system would be the one he designed and incorporated into the Constitution provided political parties did not corrupt it.
Underlying the concept of majority rules and minority rights is the idea that elected representatives vote according to the interests of their constituents. If they do so, then in order to get a majority to pass a legislation Congressional representatives would have to compromise. This process of achieving a majority through compromise would keep the country "centered".
But in a party system often "representatives" don't represent their constituencies but rather their party... in fact, the term "walking the plank" infers representatives knowingly vote against the interests of their constituents in the name of the party even at the risk of getting thrown out of office in the next election.
The bipartisan infrastructure bill is a great example. Replacing the Madison concept is the Senate filibuster. Because of the filibuster, Democrats and Republicans hammered out a "center" infrastructure proposal. This captures what Madison thought was needed for a functional democracy.
Biden suddenly declared he would not sign it absent getting things that clearly don't have bipartisan support. So in a sense, Biden is saying to hell with half the country, this is what my party wants... That is bad for the nation...
Yet the filibuster is under attack precisely because it forces compromise. So in a two party system, the only way democracy can work effectively is to require a super majority somewhere in the legislative process to force the kind of compromise that would happen naturally without parties...