The following are writers' guidelines:
Names of specific ships and other vessels are both capitalized and italicized (or capitalized entirely - "all caps" - in text documents denying italics such as email, use of a mechanical typewriter.) Note that when such abbreviations as USS (United States ship) or HMS (Her|His Majesty’s ship) precede a name, the word ship or other vessel type should not be used. The abbreviations themselves are not italicized.
HMS Frolic; the British ship Frolic
SS United States; the United States
the space shuttle Discovery
the Spirit of Saint Louis
More recently, naval ships have been assigned a pennant|hull number, consisting of a serial number sometimes preceded by a combination of letters (indicating the type of ship.) If used in place of a name, the number should be italicized. N.B. Smaller ships such as landing craft and submarine chasers may be individually numbered but not named.
USS SC-530; the U.S. ship SC-530
Where necessary to avoid confusion between vessels of the same name, the numbers should be included at first mention but should not be italicized.
HMCS Fredericton (F245) was already on her way to the Red Sea.
If disambiguation is not possible using pennant|hull numbers, the year of launch or renaming should be included in brackets after the name and not italicized
HMS Vanguard (1678), HMS Vanguard (1710), HMS Vanguard (1748), etc.
When a pronoun is used to refer to a vessel, the neuter it or its (rather than she or her) is gaining preference. But it is perfectly acceptable to follow tradition where a ship or other vessel is referred to as she or her.
Despite a growing tendency to generalise and debase, ship types should be used with precision; an aircraft carrier is not a battleship despite her ability to wage battle. Generic terms such as warship should be used carefully.
Type prefixes e.g. STS (sail training ship), MV (motor vessel) and country specific prefixes e.g. HMAS (His|Her Majesty's Australian Ship) should be all capitals without periods or slashes e.g. SS (steamship) but not S.S. nor S/S. An exception for the slash is permitted for variants e.g. HMCS/NCSM (His|Her Majesty's Canadian Ship/Navire Canadien de Sa Majesté)
The first mention of a ship should include type or prefix. For subsequent use the definite article before a ship's name despite declining usage is always acceptable, except before a pronoun
leaving Gibraltar, the Victory led the fleet
leaving Gibraltar, Victory led the fleet
leaving Gibraltar, the HMS Victory led the fleet
Also, some ship names particularly in languages other than English contain the definite article e.g. L'Orient, La Splendide; these should never be preceded by the English definite article.