Gates soon had enough of Wilkinson, and the young officer was compelled to resign in March 1778. On July 29, 1779, Congress appointed him clothier-general of the Army, but he resigned on March 27, 1781, due to his "lack of aptitude for the job". After his resignation from the Continental Army, Wilkinson reluctantly became a brigadier general in the Pennsylvania militia in 1782 and also a state assemblyman in 1783, due to the wishes of George Washington. He moved to Kentucky (at that time, just three counties still belonging to Virginia) in 1784, and he was active there in efforts to achieve independence from Virginia. In April 1787, Wilkinson made a highly controversial trip to New Orleans, which was the capital of Spanish colonial Louisiana. At that time, Americans were allowed to trade on the Mississippi River, but they had to pay a hefty tariff. Wilkinson met with Spanish Governor Esteban Rodríguez Miró and managed to convince him to allow Kentucky to have a trading monopoly on the River; in return he promised to promote Spanish interests in the west. On August 22, 1787, Wilkinson signed an expatriation declaration and swore allegiance to the King of Spain to satisfy his own commercial needs. The "Spanish Conspiracy", as it is known, was initiated by Wilkinson's "First Memorial", a 7,500-word report written before he left New Orleans for Charleston, to the Spanish concerning the "political future of western settlers" and to convince Spain to "admit us [Kentuckians] under protection as vassals". This was encoded with myriad symbols, numbers, and letters that was decoded via a complex English-Spanish cipher code-named "Number 13", which became the basis for his pseudonym, "Agent 13". Upon returning to Kentucky in February 1788, Wilkinson vigorously opposed the new U.S. Constitution. Kentucky had very nearly achieved statehood under the old Articles of Confederation, and there was widespread disappointment when this was delayed because of the new constitution. Leading up to Kentucky's seventh convention regarding separation from Virginia in November 1788, Wilkinson attempted to gauge the support for Kentucky to seek union with Spain. Wilkinson's ability to win people over with his charm and sincerity got him elected committee chairman at the convention. He advocated for Kentucky to seek independence from Virginia first, and then to consider joining the Union of states as a second step. For many, joining the Union was conditional upon the Union negotiating with Spain to arrange free navigation on the Mississippi River, a contentious point which many doubted the eastern states would act upon.