Is it possible? Working like with plugins...
Yes, it's possible. Such scripts are called folder-level scripts.
Here's a good place to start learning about them:
Retrieving data ...