In 2005, the U.S. Congress legislated that the H-1B visa program create 20,000 annual slots reserved for advanced-degree applicants. Since then, the U.S. Customs and Immigration Service (USCIS) has used visa allocation rules that comply with this legislation. Following a directive in the April 2017 Buy American and Hire American Executive Order by President Trump, USCIS tweaked its H-1B visa allocation rule in 2019. While remaining in compliance with the legislation set forth in 2005, the USCIS estimated that the 2019 rule change would increase the number of higher-skill awards by more than 5,000 annually at the expense of lower-skill awards. The rule change was explicitly engineered for this objective. In this paper we characterize all visa allocation rules that comply with the 2005 legislation and use this framework to analyze the rules that have been deployed in the interim. Despite specifying rigid caps, we show that the legislation permits a range of rules that can change the number of high-skill awards by as many as 14,000 in an average year. Of all rules that comply with the legislation, the 2019 rule adopted by the Trump administration maximizes the rate of high-skill awards and minimizes the rate of low-skill awards. However, two previous and relatively unknown changes to the H-1B visa allocation rule resulted in more substantial changes to this distribution. These earlier reforms, however, were motivated by logistical considerations, potentially without understanding of their distributional consequences.