I'm new to modding too! So sorry if this answer isn't super helpful because I'm a total newb, but I know there are script functions on the Creation Kit wiki that would be helpful to you. If you search that wiki for "Actor Script" and "ObjectReference Script" you'll find lists of functions that do lots of different things. For example one called "GetWornForm" would allow you to figure out what armor is being worn by the player, so you could then give it to your clone. You would have to make a PlayerRef in your code like this: Actor Property PlayerRef auto ...and then assign the player to that property in the CK. Then you could figure out what armor the player is wearing like this: PlayerRef.GetWornForm( some equip slot goes here ) ...but you'll have to read up on that function on the wiki to figure out how to use it. That's just to get the armor right. For weapons, spells, appearance, etc. there's other functions that might do the trick. GetSpellCount and GetNthSpell could help you figure out what spells the Player has. Getting the right weapons would be tricky, because the player will have the clone spell equipped. Copying ALL of the weapons in the player's ineventory to the clone would be really difficult, I think. You wouldn't want to use GetItemCount for every single possible weapon in the game (plus every kind of mod added weapon). If you figure out how the game stores the data for "Favorite Weapon... bla bla bla" in your stats (in the pause menu), that would be perfect for this. It also has a "Favorite Spell" listed, I think. You could always just give your Clone the Unrelenting Force shout, since you know the player is the dragonborn and has that shout, it wouldn't seem out of place. I have no idea how to copy the Player's appearance.
There might be some way out there to completely clone an actor, with appearance, inventory, spells, etc. intact... on command... right when the spell is cast. But I have no idea if that functionality even exists for NPC characters, and it SOUNDS like a magic bullet, which makes me think it probably doesn't exist (as magic bullets rarely do). I think you will probably have to do a lot of scripting and using functions like I described above. And if that's the case, you have to ask yourself what's really essential for the spell. How long is the clone going to even be there for? Does it REALLY need to know ALL the spells that the player knows? What if the player doesn't even ever use spells (like me!). Or, what if the player has mods installed which add non-combat spells to the game in different areas of the spell menu (as MANY mods do)? You wouldn't want your clone to try and cast a spell that changes an NPC's hairstyle, or one that lets the player sit down on the ground, etc. I would give it, say, 5 popular spells, and then try to see if the Player knows that spell (there must be a way to do this) before the clone uses it.
Also, if I couldn't find a way to copy the player's appearance, I would try to make the clone look really bright and glowing and etherial so you couldn't see the textures underneath. Then I would try to set the clone's race, gender, height and weight based on the player's height and weight (there are Functions for some of this in the Actor Script, I believe). Then, with the same armor equipped, the only real problem would be hair. And here... honestly I would just give the clone a helmet. But that's me! Maybe you'll find better solutions!
My biggest suggestion, though, would be to ask for help in a more specific way. What specific thing are you working on and having trouble with right now? Are you trying to find the right function to do ____? Is there an error in your script (so far) that you can't figure out? Are you struggling with scripts and you need a tutorial to help you get started? Are you just wondering if ____ is possible? When you ask "How would I do this?" about as broad a topic as this, you're probably not going to get many answers. Not because people don't want to help, but because the only real answer to your question is "Here, I wrote the mod for you." That said, I've given you all of my ideas; if you have more specific questions, I'll try to answer them with my limited knowledge, and others probably will too!
Best of luck and have fun.