Find all triples $(k, m, n)$ of positive integers such that $m$ is a prime and:

(1) $kn$ is a perfect square;

(2) $\frac{k(k-1)}{2}+n$ is a fourth power of a prime;

(3) $k-m^2=p$ where $p$ is a prime;

(4) $\frac{n+2}{m^2}=p^4$. 
1. **From Condition (3):**

   \[
   k = m^2 + p
   \]

2. **From Condition (4):**

   \[
   \frac{n+2}{m^2} = p^4 \implies n + 2 = p^4 m^2 \implies n = p^4 m^2 - 2
   \]

3. **Substitute \(k\) and \(n\) into Condition (2):**

   \[
   \frac{(m^2 + p)(m^2 + p - 1)}{2} + (p^4 m^2 - 2) = r^4
   \]

   Simplify the left-hand side:

   \[
   \frac{(m^2 + p)(m^2 + p - 1)}{2} = \frac{m^4 + m^2 p - m^2 + pm^2 + p^2 - p}{2} = \frac{m^4 + 2m^2 p + p^2 - m^2 - p}{2}
   \]

   So,

   \[
   \frac{m^4 + 2m^2 p + p^2 - m^2 - p}{2} + p^4 m^2 - 2 = r^4
   \]

4. **From Condition (1):**

   \[
   kn = (m^2 + p)(p^4 m^2 - 2) = x^2
   \]

   Since \(kn\) is a perfect square, both \(k\) and \(n\) must share the same prime factors in such a way that their product is a perfect square.

### Analysis of Possible Solutions:

1. **Case \(p = 2\):**

   \[
   k = m^2 + 2
   \]

   \[
   n = 16m^2 - 2
   \]

   Check if \(kn\) is a perfect square:

   \[
   kn = (m^2 + 2)(16m^2 - 2)
   \]

   For \(m = 1\):

   \[
   k = 1^2 + 2 = 3, \quad n = 16 \cdot 1^2 - 2 = 14
   \]

   \[
   kn = 3 \cdot 14 = 42 \quad \text{(not a perfect square)}
   \]

   For \(m > 1\), \((2m+1)^2 < kn < (2m+2)^2\), so no solution exists for \(m > 1\).

2. **Case \(d = \gcd(n, k) = 1\):**

   \[
   n = a^2, \quad k = b^2
   \]

   \[
   a^2 + 2 = b^2 p^4
   \]

   This leads to a contradiction since \(a^2 + 2 = b^2\) has no integer solutions.

3. **Case \(d = r\):**

   \[
   n = a^2 r, \quad k = b^2 r
   \]

   Rewrite the conditions:

   \[
   a^2 r + 2 = p^4 (b^2 r - p)
   \]

   \[
   b^4 r + 2a^2 - b^2 = 2r^3
   \]

   If \(3 \mid a\), we get a contradiction. For \(b\), we get \(r = 1 \mod 3\).

   \[
   3 \mid LHS \implies 3 \mid p^4 (b^2 r - p)
   \]

   If \(p = 3\), we get the solution \((k, m, n) = (28, 5, 2023)\).

### Conclusion:

The only solution that satisfies all conditions is:

\[
(k, m, n) = (28, 5, 2023)
\]

The final answer is \( \boxed{ (k, m, n) = (28, 5, 2023) } \)