  Peterson and Proctor obtained a formula which expresses the multivariate
generating function for $P$-partitions on a $d$-complete poset $P$ as a product
in terms of hooks in $P$. In this paper, we give a skew generalization of
Peterson--Proctor's hook formula, i.e., a formula for the generating function
for $(P \setminus F)$-partitions for a $d$-complete poset $P$ and its order
filter $F$, by using the notion of excited diagrams. Our proof uses the
Billey-type formula and the Chevalley-type formula in the equivariant
$K$-theory of Kac--Moody partial flag varieties. This generalization provides
an alternate proof of Peterson--Proctor's hook formula.
