Who wrote the U.S. Constitution in 1787?
James Madison has been denominated the Father of the U.S. Constitution; however this is because Madison was appointed by the Constitutional Convention as its recording secretary. His Notes on the Constitutional Convention are the only authentic evidence available as to the debate within the convention as the first order of the convention, after the election of George Washington as President, was to keep its proceedings secret.
As to the actual writing of the Constitution, following the adoption of its major proposals, it was referred to a Committee on Style and Arrangement on September 8, 1787. The members of that Committee were James Madison of Virginia, William Johnson of Connecticut, Governeur Morris of Pennsylvania, Rufus King of Massachusetts, and Alexander Hamilton of New York. The committee delivered its final report and draft on September 12, 1787. The draft of the committee with very minor provisions is the Constitution as it was adopted and ratified.
You are right to say that (for the most part) Thomas Jefferson wrote the Declaration of Independence. However, in the case of the Constitution, there is no one author. The Constitution was written as a group effort by the men who were present at the Constitutional Convention. That being said, there is one man who is typically known as the "Father of the Constitution." That man is James Madison. Madison was the principal drafter of the Virginia Plan, which was the first major proposal at the convention and which had a great deal of influence on the finished document.
Madison, then, is seen as a major influence on the Constitution, but there was no one author of the document.
One historian, Richard Brookhiser, who wrote Gentleman Revolutionary: Gouverneur Morris, The Rake Who Wrote the Constitution thinks Gouverneur Morris wrote The Consitution.
I want to think that Thomas Jefferson wrote Declaration of Independence. But I'm a little dubious about who wrote the U.S. Constitution in 1787