The question cannot be answered in a theoretical vacuum, especially when it comes to stress. However, in standard SPE style rule theory, this would be "V → [+stress] / #Co _". "V" is a common abbreviation for "[+syllabic]" and "C" for [-syllabic]. "Co" (where "o" is subscript-zero) means "any number of; "#" is the standard symbol for word boundary. The SPE account did not have syllables, instead stress was assigned to vowels. The expression "any number of consonants" was required since a rule applying to a vowel in the context "#__" would only apply to a word-initial vowel.
Post-SPE (starting around 1977), this segmental theory of stress was abandoned for a metrical theory of stress, where syllables were labeled as "prominent" or "strong", versus "weak". In that approach, you would make the first syllable of the word be "strong". The exact mechanism for doing this changed over time: it sometimes involved building tree structures, sometimes piling up marks like "x" or "*", sometimes putting in brackets (paired or not). As for the formalism of rules, there usually weren't any, instead a language would be said to have certain "parameters", such as "build a left-headed foot", "start at the left", "ignore the first syllable", all of which were said to be part of an inventory of parameters in Universal Grammar. Consequently, the actual rule part in a grammar was negligible, and usually neglected. Hayes, in his dissertation, offered a few rules, such as "destressing", which (in Aklan) is "delete a non-branching foot before a strong syllable:
F → Ø / ___ s