* Refers to the specific class of warriors in feudal Japan. For example, "The samurai were highly skilled warriors."
* Is part of a proper noun. For example, "The Samurai Code."
It should not be capitalized when:
* Used in a general sense. For example, "He was a brave warrior, almost like a samurai."
* Used as an adjective. For example, "The samurai sword was very sharp."
In essence, treat "samurai" like any other noun. Capitalize it when it represents a specific individual, group, or title, but not when it's simply a general descriptor.