I don't think you can do this, at least in the sense you suggest. Bryan's answer, and several answers in the question linked by gnat discuss several intangible (perhaps we should call them "immeasurable" in this context) productive activities.
I'm trying to think of a workflow where a group of developers can work seamlessly interchanging tasks
seems like it will set up a perverse incentive for the developers not to focus their efforts where they're most productive, but instead to pretend to be interchangeable resource units to fit your measurement scheme.
One approach would be to simply ask everyone to estimate everyone else's work, and average it into some kind of rough productivity consensus. This might just lead to (some) people talking up the complexity of their bugs or features around the water cooler though.
A more manageable way would be to just use peer reviews once or twice a year, where team members give ratings for each others' relative productivity.
- because this isn't done every week, or per fixed number of stories, it's harder to game
- because everyone on the team is already equipped with a large squishy computer which is carefully calibrated to assess group relationships, you can use these as a proxy
- everyone knows the value of favours done or received, even if they're hard to quantify
- if team members review each others' code, they'll have a feeling for who is storing up the most technical debt for the future
- this allows developers to play to their strengths (ignoring personal development and team-building in this context, this should be the most productive)