late 14c., “Latin grammar, rules of Latin,” from Old French gramaire “grammar; learning,” especially Latin and philology, also “(magic) incantation, spells, mumbo-jumbo” (12c., Modern French grammaire), an “irregular semi-popular adoption” [OED] of Latin grammatica “grammar, philology,” perhaps via an unrecorded Medieval Latin form *grammaria. The classical Latin word is from Greek grammatike (tekhnÄ“) “(art) of letters,” referring both to philology and to literature in the broadest sense, fem. of grammatikos (adj.) “pertaining to or versed in letters or learning,” from gramma “letter” (see -gram). An Old English gloss of it was stæfcræft (see staff (n.)).