You can programmatically generate most sections of the definition notebook, but the whole process won't be easy without a frontend, since you would need to write out cell expressions manually:
nb = DefinitionNotebookClient`GenerateDefinitionNotebook @ <|
"ResourceType" -> "Paclet",
"Name" -> Cell[ "MyPublisher/NameOfThePaclet", "Title" ],
"Description" -> Cell[ "This is the description", "Text" ],
"HeroImage" -> Cell[ BoxData @ ToBoxes @ FreeformEvaluate[ "picture of a cat" ], "Output" ],
"LongDescription" -> {
Cell[ "This is the \"Basic Description\" section", "Notes" ],
Cell[ "This is the stuff that appears next to the hero image on the web page", "Notes" ]
},
"Details" -> { Cell[ "This is the \"Details\" section", "Notes" ], Cell[ "Write details here", "Notes" ] },
"PrimaryContext" -> Cell[ "MyPublisher`NameOfThePaclet`", "Text" ],
"ExampleNotebook" -> {
Cell[ "The first example:", "Text" ],
Cell[ BoxData @ MakeBoxes[ 1 + 1 ], "Input", CellLabel -> "In[1]:=" ],
Cell[ BoxData[ "2" ], "Output", CellLabel -> "Out[1]=" ]
},
"Contributed By" -> Cell[ "Your name here", "Text" ]
|>
This will generate a Notebook[...] expression with the specified sections filled out.
You can use this to see the names of available template slots:
DeleteDuplicates @ Cases[
DefinitionNotebookClient`DefinitionTemplate[ "Paclet" ],
TemplateSlot[ name_String, ___ ] :> name,
Infinity
]
Note that you won't be able to fill out every section this way, since some of them contain more complex UI interfaces.
You'll also need documentation notebooks but I'm not sure if there's a way to generate those programmatically.