# What is the Standard Procedure for Creating a Plugin

**URL:** <https://discourse.cakephp.org/t/what-is-the-standard-procedure-for-creating-a-plugin/3101>\
**Category:** Uncategorized\
**Created:** [August 27, 2017, 10:41pm UTC](https://discourse.cakephp.org/t/what-is-the-standard-procedure-for-creating-a-plugin/3101 "2017-08-27T22:41:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlroberts](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jlroberts/32/649_2.png) [@jlroberts](https://discourse.cakephp.org/u/jlroberts)\
**Post date:** [August 27, 2017, 10:41pm UTC](https://discourse.cakephp.org/t/what-is-the-standard-procedure-for-creating-a-plugin/3101/1 "2017-08-27T22:41:30Z")

</div>

I want to create a plugin for cakephp/app but I am not really sure how to go about it…

At some point I need to create a repo for the plugin, thats a given, lets call that

```
CakePHPKitchen/SharpAgent

```

Ok, now that I have that, if my hard drive busts or something I will need another repo that contains the app skeleton with a composer entry that requires SharpAgent, lets call that

```
CakePHPKitchen/SharpAgentDemo

```

Ok, that sounds great, however, now I want to create another plugin, but that leads to me creating yet another `Demo` repo, so now I create just one Demo repo, lets call it

```
CakePHPKitchen/PluginDemos

```

Now my instinct at this point is to create git submodules inside PluginDemos of each plugin, ex: SharpAgent, however, we have composer involved now, is there a way for me to use require by composer and be able to push to SharpAgent from the PluginDemos repo?

---

<div class="post-metadata">

**Author:** ![jlroberts](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jlroberts/32/649_2.png) [@jlroberts](https://discourse.cakephp.org/u/jlroberts)\
**Post date:** [August 27, 2017, 10:51pm UTC](https://discourse.cakephp.org/t/what-is-the-standard-procedure-for-creating-a-plugin/3101/2 "2017-08-27T22:51:42Z")

</div>

So this is what I ended up doing, please let me know how it compares to your method(s)

Created Repos

```
 1) SharpAgent
 2) PluginDemos

```

Bash Commands

```
git clone ... PluginDemos
cd PluginDemos
git remote add upstream cakephp/app
git pull upstream master
composer install
bin/cake bake plugin SharpAgent
cd ..
git clone ... SharpAgent
mv PluginDemos/plugins/SharpAgent/* SharpAgent/
mv PluginDemos/plugins/SharpAgent/.* SharpAgent/
cd SharpAgent
git add . && git commit -m 'Shotgun Commit' && git push origin master
cd PluginDemos/
rm -rf plugins/SharpAgent
git submodule add plugins/SharpAgent SharpAgent.git
```
