The point isn't what skills are available, it's what you want
What I'm asking is how would you know that you want "a miner that does farming on the side on Tuesdays and occasionally threshes on a full moon" blah blah? That seems really bizarre to decide you want ... well ever. But especially without even looking and seeing that a guy has natural mining and farming skills, or something.
I can imagine there being some really cool potential algorithms to optimize this sort of thing, but as a manually declared wish, I don't see it getting used very much, nor do I see how a simple algorithm could meaningfully assign primary/secondary/tertiary all on its own.
I think a lot more detail needs to be specified to make this really a powerful suggestion that it probably could be. I'll take a crack at it.
The first step is really more clearly specifying exactly what problem(s) we want to solve. What are they?
In my experience, labor issues include:
1) Skilled labor and grunt labor being the same permission, which is a problem when you have a bunch of masons for a megaproject, but then have difficulty cultivating any of them as a skilled mason for furniture. This can be solved by annoying workshop permissions, but it is clumsy.
2) Figuring out who is best for a job is extremely tedious with the current UI. And even with a better UI, it would probably still be tedious and not require much intelligence therefore not very fun.
3) Actually changing anything is mechanically tedious as well, with multiple submenus and no boolean options for "everything but this" etc.
4) Priorities are clunky -- It's inefficient to have one priority level for a job for everyone ever. It would be more efficient to have different guys have different priorities for the same job type.
5) Newer players often can't figure out how to even do certain things due to the job for it being not turned on for anybody, very frustrating. Even for experienced players, it is tedious and easy to overlook until 3 months pass by and the job is still unfinished.
What type of algorithm or changes would solve as many of these as possible?
1) Split apart everything that depends on skill level versus everything that doesn't (or only matters for speed). Those two types of tasks (or three types if you count speed-relevant as a third category) should never exist in the same permission in the first place.
2) Turn on completely self-sufficient basic labor managing logic by default (with an ini option for advanced players who don't even want to bother turning it off at the start of the game). It works like so:
2a) Pick two people in the fort at any given time and keep them on file as the best two dwarves for each given job type that depends on skills. This is a customizable parameter (player can set to = 3 or 1 or whatever), but 2 by default. Every time somebody dies or new migrants arrive or skills change, re-sort the list.
2b) Turn off permissions for everything by default while the labor AI is on.
2c) Whenever a job exists waiting for a worker that requires skill, the labor AI searches its list for one of the two people who are most skilled at that thing. If both are available, it randomly chooses. If one is available, it chooses them. If zero are available, it waits for a day or two, then chooses another available person on a one-time basis.
2d) Whenever a job exists waiting for a worker that does NOT require skill, the labor AI searches for an available worker OTHER THAN anybody who might currently be needed for skilled jobs, OR anybody who has very recently done a skilled job. It prefers these types of unskilled workers first, and searches in reverse order to (2c).
2e) Permissions are turned off right after any job is completed then re-considered again only as needed.
2f) The labor AI keeps track of how "stale" each job is, and also has a default level of basic importance (assigned in the RAWs). The priority of a specific job is based on both its baseline importance and its staleness (gradually gets more important over time as it is ignored).
2g) The labor AI can take into account human overriding details, like "turn off/on X job completely for now for anybody" or "force this one particular dwarf to have exactly the permissions I specify for now" etc. This could include the OP's primary/secondary levels as well.
2h) Whenever the labor AI is disabled, it returns the whole fort to whatever it's original permissions were. If it has been on the whole game so far, it just gives the skilled job permissions to the people on its skilled lists, and then makes sure all remaining permissions are available to other people, with slight variability in priority graded across people (so somebody might have cleaning a bit higher than corpse hauling, somebody else vice versa, to ensure a dwarf or two in the forst always has time for certain job types).
3) Add a therapist-like UI for advanced manual control. Again, including the OP's praimry/secondary distinctions for the truly micromanaging folks. And also convenient booleans in general like "turn on/off everything EXCEPT this" (both fort-wide and for a dwarf) or "copy this other guy's permissions for a start" or template shortcuts, etc.
4) Put all of this stuff for either (2g) or (3) in a single screen with fewer submenus and also mouse-compatibility.
5) Include a pivot chart of all the dwarves in your fort sortable by skill in different skill areas, as well as total for groups of related skills like fighting and armor and weapon, etc. Allow this to be viewed split-screen on one side while permissions assignment is on the other at the same time.
6) Also add (5) as a split-screen to any other page where you need to select dwarves for jobs, like choosing a baron or other nobles or choose military recruits, and so on.