First off, I am not a professional DOTA 2 player so this guide is merely shows what I feel works best for Riki. I have tried many different builds for him, but I this build which I'm going to explain in detail, is the best way to play in most public games.
Riki is an amazing hero, which is very hard to counter for most pub players. Once you get to level 6 you will officially be the most annoying player on the field for the enemy team. The trademark of Riki is his Permanent Invisibility. This is a passive skill which will annoy the hell out of your enemies because you'll constantly be popping in and out of their view, ideally getting a kill or two every time you do.
For the early game I find it's best to lane with a ranged support hero who'll discourage enemy heroes from harassing you too much, and can deny the enemy farm. Once you get to level 6 you will become a ganking machine and can roam the map quite freely.
Never fight groups of enemy heroes alone. Even in the late game it's a very risky move. Try to pick them off when they're on their own. Or straggling behind the pack. By the time you get your Skull Basher, you should be able to take out even some of the tankier heroes on your own. But not if they have back up.
It's important to remember that Riki is a relatively squishy hero so you have to be careful while farming. Due to your Backstab you do much more damage from behind, as such it's better to farm by positioning yourself behind creeps. Since this is a relatively risky move you have to be ready flee at all times. This is why it's important to be in the same lane as a ranged support hero.
I generally find it's best to farm in the bottom lane if you're on Radiant and top if you're on Dire, as it's always good to be close to your tower. Don't push too far or you'll find it hard to escape.
The first thing you need to do is finish your Poor Man's Shield. It will give you much more lane survivability as it'll block a fair amount of the damage creeps and some of the damage ranged heroes will be doing to you.
To do this once you get 250 gold, head to the side shop and buy a Stout Shield. This will combine with 2 of the Slippers of Agility to form a Poor Man's Shield.
If you purchased 2 stacks of Tango, pick up another pair of Slippers of Agility as soon as you hit 150 gold.
Carry on farming until you get 500 gold, and buy some Boots of Speed from the side shop once again. Since you have 300 base speed, you'll get 355 which is more than enough for early game chase & escape.
At this point, depending on the enemy heroes in your lane and if your support hero has a stun/slow that deals a fair amount of damage you should be able to get a kill or two. Make sure not to get too close to towers since you're still extremely squishy at this point and they can kill you in 4-5 shots.
Continue farming until you have enough for a full Ring of Basilius, then once you have 330 more gold, buy a Circlet and a Recipe for the Wraith Band. Depending on your health get the Animal Courier to bring it to you, or head back to base to heal up. That will all combine in your inventory to form a Ring of Aquila. That gives you all the benefits of a Ring of Basilius and a Wraith Band with an added +9 damage.
By this point you should have reached Level 6.
Now it's time to roam the map and help in various lanes by picking up ganks, and collecting all the free farm. You should start earning gold at a very fast rate now. If your team has managed to get some kills by now the enemies should start grouping up in mid. You can either make your way up to a lane with free farm, or if there's a fight going on, get there and wait for people to get to low health or start running and get the gank.
If people start to run place your Smoke Screen in front of them. Since the smoke slows them down, the more of it they have to run through the more time you'll have to hit them. Try to hit them in back as much as possible as your Back Stab will do a lot more damage than hitting them in the face. Once again, avoid the tankier heroes for now and do not fight groups alone since you won't have the damage output to kill them just yet.
Once you get enough gold build your Power Treads as quickly as you can. Depending on if you're being hit, or you're the one hitting people buy either the Belt of Strength (for more HP) or Gloves of Haste (for more attack speed) first, make sure you set your Power Treads to Agility.
After this start working on your Diffusal Blade as the agility will increase the damage of your Backstab & the active ability Purge is great on enemies, and can also be used on yourself to remove silences and things like Slardar's Amplify Damage, and Bounty Hunter's Track.
Keep farming until you have 900 Gold and head to a side shop and pick up a Morbid Mask, This will give you 15% life steal which will mean you can regain health as long as you can farm inbetween fights. Keep farming / ganking till you can afford a Ring of Regen and a Recipe for Vladmir's Offering. Since you already have a Ring of Basilius don't waste gold on another one. Head back to the fountain making sure to pick up any farm you can on the way.
Once at the fountain disassemble your Ring of Aquila, pick the Ring of Basilius first, then grab the Ring of Regen and the recipe from your stash to form your Vladmir's Offering. Then pick up your Wraith Band again.
Buy a Town Portal Scroll (from now on, try to keep one on you at all times) and teleport over to your team, or if there's a lone hero by one of your towers over to them. By now, both teams should be consistently involved in team fights. Once again, try to pick off stragglers and people on low health only. Don't get too close to towers since they have True Sight.
Your next 850 gold should go on upgrading your Diffusal Blade to level 3.
Keep fighting and farming until you have 1500 gold. Buy a Javelin and get the Animal Courier to bring it over to you. When you have another 450 gold, head to the closest side shop, sell your Iron Branch and grab a Belt of Strength. Finally, when you get your next 1000 gold, buy the recipe for a Skull Basher and get the courier to bring it over to you.
At this point you're able to take out even the tankier enemies on your own because of your 1.4 second stun. All the same, play it safe and keep attacking low HP enemies and people trying to run away.
Keep farming and ganking till you have 3800 gold and can finish off you Abyssal Blade. Realistically the game should be over by the time you finish it, however if it's not then the extra damage and HP it gives you is a massive boost to your killing ability.
At this point, one of two things is happening. You're stomping so hard that you're just longing the game out for the sake of farm, or the game is extremely even and both teams are heavily armed.
If you're stomping, any of the luxury items I've listed are fun, if it's even I tend to go for the Assault Cuirass as long as the enemy team has more strength/agility heroes. If they have more intelligence heroes with crowd control spells I get a Black King Bar or Linken's Sphere.
These are the best heroes for you to lane with. Essentially, they're mainly ranged support heros with a stun/slow, or melee heros with a ranged stun. As a general rule, never lane with another carry, try to avoid laning with another melee hero if you can.
These are heroes which will lead you to have a bad time. They can either negate your Permanent Invisibility or are tanky enough that you won't make much of a dent to their health.
Thanks for reading my guide, I hope you've enjoyed it and it'll be helpful for when you play.
Keep in mind that this guide is exclusively for pub play, I have no idea how it would work competitively.
If you like the guide please rate it and leave a comment. If you have any criticisms or improvements, leave a comment and I'll try it out. If it's good I'll change the guide.
Best of luck!