(Reference @cards-ts/war for an implementation of a very simple card game)
The very first thing is to think about if any of the existing card games are like your desired game, then just directly copy the files from that card game package and tear out any logic that isn't needed. If none are a particularly close match, War has by far the least amount of logic / oddness and so is a good scaffold.
Start by clearing out any parameters in game-params and game-setup, since you can customize ways to play your game later and this only introduces noise in the meantime.
Then identify the user inputs your game has (e.g. will the user be prompted to discard a card? or to play a single card or a meld?), and implement an initial version of your game-handler-params, game-handler, and response messages.
Think about the states and flow your game goes through and then begin putting together your state-machine. While doing so, think about what state/controllers you will need, giving you a first start on your custom controllers and controllers/controllers file.
Once you've generally settled on your custom events and state, you can start to put together your event-handler to validate and respond to events, and your bot and intermediary handlers to respond to events (typically starting with a very basic valid response for bots).
At this point, you should be good to finalize on your state-machine. Also at this point, you should be able to compile and be able to incrementally run and test your game.
Once the basic game is in place, you can enhance the params, bot handler, or any other part of the game! Add it to games.txt and make sure it passes the basic package test which verifies the game finishes as well.
(Note that library major version changes are planned to be owned by the library maintainer)
The following are files you'll generally need to modify in the course of creating your game.
event-handler via calling buildEventHandler or implementing EventHandlerInterface
controllers / buildProviders
state-machine
game-handler-params
game-handler via implementing Handler
game-factory via calling buildGameFactory
game-params
game-setup via implementing GenericGameSetup
You will then also need to provide any additional custom message types, custom controllers, and at least one bot handler and intermediary handler.