WikiProjects associated with pages, along with the class and importance, should be available for querying from Lua. Perhaps as a pageassessments propery on mw.title objects.
From T391642:
Feature summary (what you would like to be able to do and where): I'd like a parser function that can retrieve assessment information of a given page, or at least the current page.
Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution): Per discussion at enwiki Idea Lab § Metadata gadget as the default experience, using a parser function would more elegantly allow manipulation of a page to make featured content status more prominent. Specific use case would be to include the parser function in MediaWiki:Tagline to update the tagline when an article is a piece of featured content.
Benefits (why should this be implemented?): There have been many discussions about making Good Article and Featured Article status more prominent on enwiki (see above linked discussion) and this would provide a solution to that.