+1 to @silverpill's contribution. As the linked doc says;

"ActivityPub specification hasn't been updated since 2018. Many developers consider it incomplete and/or outdated."

https://codeberg.org/ap-next/ap-next/src/branch/main/guide.md

Following the current spec to the letter is a good exercise in understanding it, but by itself it will not get you smooth interop with existing AP implementations.

I'd also recommend familiarising yourself with the Fediverse Enhancement Protocol process;

https://codeberg.org/fediverse/fep/src/branch/main/fep/a4ed/fep-a4ed.md

#FEP

@douginamug