I wanna learn how to code great plugins...

The hard part of writing a plugin is identifying what to write, not how to
write it. Basically identify what is currently difficult in the Rails world,
and unsolved by the plugin community so far.

Writing the plugin is the easy part. However I have seen some ambivalence
to plugins. Some plugins broke with Rails versions, or the plugins
themselves weren't mature enough (features vs testing). Current wisdom seems
to be to use plugins sparingly, or thoroughly validate them yourself. Its
really no different to any other development - if a problem happens in your
application, it is best if it happens in your code and not a library or
plugin that you are using.

I am not trashing plugin authors here, I am advocating that you do not
overlook the necessary steps to mature it (testing, community feedback,
more testing, test with different rails versions and then do some testing)