Q. Rov we share a neighbor that has in his back yard during the summer chickens that the kids love to play with. They have inside the fenced enclosure were they stay, also a small cubicle where they nest, lay eggs and are protected from pray animals at night. Can one close during Shabbos the door to it or is it considered prohibited trapping?

A. Mishna Berura (316: 58) rules that household chickens that are
already used to being in captivity and are subdued one may touch them
and enclose them into their smaller cubicle, since as is, they are
already in a fenced enclosure that they enjoy for their feed and
protection. However, many Poskim maintain that there may still be a
Rabbinical prohibition (see opinions quoted in Hatzeida Beshabbos p.
28). See also Aruch Hashulchan ibid 37 who is more stringent.

Horav
Shlomo Miller’s Shlit’a opinion is similar when
not
in need.

Rabbi A. Bartfeld as revised by Horav Dovid Pam, Horav Aharon Miller and Horav Chanoch Ehrentreu Shlit’a