A caponier is a type of fortification in a defensive structure. The word originates from the French word caponnière. "capon coop", i.e. "hen house".
In some types of bastioned fortifications, the caponier served as a "covered" means of access to the outworks, using "covered" in the old sense of "protected from direct fire"; such works were often roofless. Although usable for firing along the ditch, the flanks of the bastions were the main defence of the ditch by fire.
In later polygonal forts, caponiers were often roofed, and were not intended as a type of covered way, but as the main way of keeping the ditch clear of the enemy.
Originally the term referred to a covered passageway that traversed the ditch outside the curtain of a fortress. Fire from this point could cover the ditch between the ravelin and the curtain wall to deter any attempt to storm the wall. Thus the passageway was equipped with musket ports and cannon ports that fired along the ditch.
While fortifications were evolving to the simpler polygonal style, the term was sometimes used to describe the flanking positions set at the corners of the ditch that provide the same function in that style of fort, especially in France.
In bastioned forts, it usually takes the form of a low open passage, often partly sunken into the floor of the ditch and projecting outward into and across it, with access from the main fortress via a passage through the curtain wall. The roof, if any, was often made against weather, observation, and small arms fire, not artillery.
As polygonal fortresses evolved, caponiers became more substantial, higher, and protected above from plunging fire with masonry and earth cover. In late 19c. works which were largely underground, caponiers were reached via a tunnel from within the fort.
The caponier is usually equipped with a firing step and rifle ports to allow troops to fire along the ditch, and often has provision for small cannon to sweep the ditch as well. To clear the smoke and fumes from the firing the roof of the caponier is often provided with ventilation ports.