├── .gitignore
├── README.md
├── __init__.py
├── docs
    ├── jemma-builds.png
    ├── jemma-logo.png
    ├── jemma-sketch.png
    ├── jemma.cast
    ├── jemma.gif
    └── minesweeper.png
├── huddle.py
├── jemma
    ├── __init__.py
    ├── epic
    │   ├── chord-progression.txt
    │   ├── talk-to-me-wiki.md
    │   └── valgo.txt
    ├── huddle.py
    ├── prompt
    │   ├── __init__.py
    │   ├── business
    │   │   ├── __init__.py
    │   │   └── owner.py
    │   ├── engineer
    │   │   ├── __init__.py
    │   │   ├── clarify.py
    │   │   ├── code.py
    │   │   └── game.py
    │   ├── tester
    │   │   ├── __init__.py
    │   │   └── test.py
    │   └── ui
    │   │   └── designer.py
    ├── requirements
    │   ├── __init__.py
    │   └── feature.py
    ├── team
    │   ├── __init__.py
    │   ├── business_owner.py
    │   ├── engineer.py
    │   ├── project_manager.py
    │   ├── tester.py
    │   └── ui_ux_designer.py
    ├── thinker.py
    ├── tools.py
    └── work
    │   ├── __init__.py
    │   └── flow.py
└── pyproject.toml
/.gitignore:
--------------------------------------------------------------------------------
  1 | # Byte-compiled / optimized / DLL files
  2 | __pycache__/
  3 | *.py[cod]
  4 | *$py.class
  5 | 
  6 | # C extensions
  7 | *.so
  8 | 
  9 | # Distribution / packaging
 10 | .Python
 11 | build/
 12 | develop-eggs/
 13 | dist/
 14 | downloads/
 15 | eggs/
 16 | .eggs/
 17 | lib/
 18 | lib64/
 19 | parts/
 20 | sdist/
 21 | var/
 22 | wheels/
 23 | share/python-wheels/
 24 | *.egg-info/
 25 | .installed.cfg
 26 | *.egg
 27 | MANIFEST
 28 | 
 29 | # PyInstaller
 30 | #  Usually these files are written by a python script from a template
 31 | #  before PyInstaller builds the exe, so as to inject date/other infos into it.
 32 | *.manifest
 33 | *.spec
 34 | 
 35 | # Installer logs
 36 | pip-log.txt
 37 | pip-delete-this-directory.txt
 38 | 
 39 | # Unit test / coverage reports
 40 | htmlcov/
 41 | .tox/
 42 | .nox/
 43 | .coverage
 44 | .coverage.*
 45 | .cache
 46 | nosetests.xml
 47 | coverage.xml
 48 | *.cover
 49 | *.py,cover
 50 | .hypothesis/
 51 | .pytest_cache/
 52 | cover/
 53 | 
 54 | # Translations
 55 | *.mo
 56 | *.pot
 57 | 
 58 | # Django stuff:
 59 | *.log
 60 | local_settings.py
 61 | db.sqlite3
 62 | db.sqlite3-journal
 63 | 
 64 | # Flask stuff:
 65 | instance/
 66 | .webassets-cache
 67 | 
 68 | # Scrapy stuff:
 69 | .scrapy
 70 | 
 71 | # Sphinx documentation
 72 | docs/_build/
 73 | 
 74 | # PyBuilder
 75 | .pybuilder/
 76 | target/
 77 | 
 78 | # Jupyter Notebook
 79 | .ipynb_checkpoints
 80 | 
 81 | # IPython
 82 | profile_default/
 83 | ipython_config.py
 84 | 
 85 | # pyenv
 86 | #   For a library or package, you might want to ignore these files since the code is
 87 | #   intended to run in multiple environments; otherwise, check them in:
 88 | # .python-version
 89 | 
 90 | # pipenv
 91 | #   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
 92 | #   However, in case of collaboration, if having platform-specific dependencies or dependencies
 93 | #   having no cross-platform support, pipenv may install dependencies that don't work, or not
 94 | #   install all needed dependencies.
 95 | #Pipfile.lock
 96 | 
 97 | # poetry
 98 | #   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
 99 | #   This is especially recommended for binary packages to ensure reproducibility, and is more
100 | #   commonly ignored for libraries.
101 | #   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102 | #poetry.lock
103 | 
104 | # pdm
105 | #   Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106 | #pdm.lock
107 | #   pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108 | #   in version control.
109 | #   https://pdm.fming.dev/#use-with-ide
110 | .pdm.toml
111 | 
112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113 | __pypackages__/
114 | 
115 | # Celery stuff
116 | celerybeat-schedule
117 | celerybeat.pid
118 | 
119 | # SageMath parsed files
120 | *.sage.py
121 | 
122 | # Environments
123 | .env
124 | .venv
125 | env/
126 | venv/
127 | ENV/
128 | env.bak/
129 | venv.bak/
130 | 
131 | # Spyder project settings
132 | .spyderproject
133 | .spyproject
134 | 
135 | # Rope project settings
136 | .ropeproject
137 | 
138 | # mkdocs documentation
139 | /site
140 | 
141 | # mypy
142 | .mypy_cache/
143 | .dmypy.json
144 | dmypy.json
145 | 
146 | # Pyre type checker
147 | .pyre/
148 | 
149 | # pytype static type analyzer
150 | .pytype/
151 | 
152 | # Cython debug symbols
153 | cython_debug/
154 | 
155 | # PyCharm
156 | #  JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157 | #  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158 | #  and can be added to the global gitignore or merged into this file.  For a more nuclear
159 | #  option (not recommended) you can uncomment the following to ignore the entire idea folder.
160 | #.idea/
161 | 
162 | prototype/
163 | requirements/
164 | .copilot-token
165 | .DS_Store
166 | 
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
  1 | # 
 jemma
  2 | > hey, I am Jemma. I convert your thoughts to code
  3 | 
  4 | 
  5 | - [🧬 what I do](#-what-i-do)
  6 |   - [am skechin'](#-am-sketchin)
  7 | - [🕹️ can I play?](#%EF%B8%8F-can-i-play)
  8 |   - [install me](#install-me)
  9 |   - [convert ideas to code](#convert-ideas-to-code)
 10 | - [🛠️ how I do it](#%EF%B8%8F-how-i-do-it)
 11 |   - [models](#models)
 12 |   - [problems](#problems)
 13 |   - [development](#development)
 14 | - [license](#license)
 15 | 
 16 | # 🧬 what I do
 17 | 
 18 | I take an idea in a form of:
 19 | * a few words, such as "`Bill Pay Service`", "`2048`" or "`Kanban Board`"
 20 | * OR a text file with requirements
 21 | 
 22 | and I create a web based prototype 🚀
 23 | 
 24 | > _in fact I just created all three 👆 (so you can quickly see what I mean):_
 25 | 
 26 | 
 27 | 
 28 | 
 29 | after the prototype is built, I take feedback and refactor it.
 30 | 
 31 | ## 🎨 am sketchin'
 32 | 
 33 | I also dabble in converting sketches to web app mockups:
 34 | 
 35 | ```bash
 36 | $ jemma --prompt "Learning Portal" --sketch ~/tmp/sketch.png --build-prototype --claude
 37 | ```
 38 | 
 39 | 
 40 | _this does require one or two hints of feedback, but I'm getting better_
 41 | 
 42 | # 🕹️ can I play?
 43 | 
 44 | of course!
 45 | 
 46 | ## install me
 47 | 
 48 | ```
 49 | $ pip install jemma
 50 | ```
 51 | 
 52 | add a "`.env`" file from where I am going to be called from with API keys of your choice:
 53 | 
 54 | ```bash
 55 | export ANTHROPIC_API_KEY=sk-ant-api03...
 56 | export OPENAI_API_KEY=sk-puk...
 57 | export REPLICATE_API_TOKEN=r8_ai...
 58 | ```
 59 | 
 60 | ready to rock! :metal:
 61 | 
 62 | ## convert ideas to code
 63 | 
 64 | ```
 65 | $ jemma --prompt "Bill Pay Service" --build-prototype --claude
 66 | ```
 67 | 
 68 | I will assemble a team who will build a prototype, open a browser with it, and wait for your feedback:
 69 | ```bash
 70 | Claude 🧠 claude-3-haiku-20240307 ✅
 71 | 
 72 | > Project Manager:
 73 | Dear Business Owner, in this meeting we'll work on creating requirements based on the 💡 idea
 74 | 
 75 | > Business Owner: 📚 creating detailed requirements ...🖋️
 76 | 
 77 | > Project Manager:
 78 | Dear Engineer, in this meeting let's put our heads together to build a prototype based on the requirements.
 79 | 
 80 | > Engineer: 💫 creating a prototype based on the requirements...
 81 | > Engineer: crafting css 🎨 (a.k.a. "visual beauty")
 82 | > Engineer: cooking javascript 🎮 (a.k.a. "master of interactions")
 83 | > Engineer: creating html 🕸️ (a.k.a. "the skeleton of the web")
 84 | 
 85 | prototype files created successfully:
 86 | - prototype/index.html
 87 | - prototype/app.js
 88 | - prototype/app.css
 89 | opened prototype in the web browser
 90 | 
 91 | tell me how to make it better >
 92 | ```
 93 | 
 94 | # 🛠️ how I do it
 95 | 
 96 | I rely on my team of project managers, business owners and engineers
 97 | yes... "AI Agents"
 98 | 
 99 | When I get an idea a Project Manager meets with a Business Owner to take it in and create a comprehensive set of requirements
100 | then the Project Manager meets with an Engineer to build the idea based on these new requirements.
101 | 
102 | ## models
103 | 
104 | I best work with Claude models, that is why my examples all end in "`--claude`":
105 | ```bash
106 | $ jemma --prompt "Trivia Game" --build-prototype --claude
107 | ```
108 | by default though I will call Ollama (llama3 model):
109 | 
110 | ```bash
111 | $ jemma --prompt "Trivia Game" --build-prototype
112 | Ollama 🧠 llama3:8b-instruct-fp16 ✅
113 | ```
114 | 
115 | here are the default models I would use:
116 | 
117 | | model param    | default model|
118 | |    ----        |    ----      |
119 | | `--claude`       | `claude-3-haiku-20240307` |
120 | | `--openai`       | `gpt-3.5-turbo`|
121 | | `--ollama`       | `llama3:8b-instruct-fp16`|
122 | | `--replicate`    | `meta/meta-llama-3-70b-instruct`|
123 | | `--copilot`    | `gpt-3.5-turbo`|
124 | 
125 | but you can override all of these with your (local, or not) models:
126 | 
127 | ```bash
128 | $ jemma --prompt "Trivia Game" --build-prototype --claude claude-3-opus-20240229
129 | $ jemma --prompt "Trivia Game" --build-prototype --ollama dolphin-mistral:7b-v2.6-dpo-laser-fp16
130 | $ jemma --prompt "Trivia Game" --build-prototype --openai gpt-4-turbo-preview
131 | $ jemma --prompt "Trivia Game" --build-prototype --replicate meta/llama-2-70b-chat
132 | $ jemma --prompt "Trivia Game" --build-prototype --copilot gpt-4
133 | $ ...
134 | ```
135 | 
136 | > _but, at least for now, the best results are produced with **Claude** based models_
137 | 
138 | ## problems
139 | 
140 | I am still learning, so some prototypes that I build might result in errors
141 | this would especially be likely with non Claude based models
142 | 
143 | but, we are all learning, _and_ I love feedback:
144 | 
145 | ```bash
146 | tell me how to make it better > I see an error "app.js:138: uncaught TypeError: chordProgressionData.find(...) is undefined"
147 | 
148 | > Project Manager:
149 | Dear Engineer, we have met with the user and received a valuable feedback. sudo make it better! 🛠️
150 | 
151 | > Engineer: 💫 refactoring prototype based on the feedback...
152 | 
153 | > Engineer: ♻️  crafting css 🎨 (a.k.a. "visual beauty")
154 | 
155 | > Engineer: ♻️  cooking javascript 🎮 (a.k.a. "master of interactions")
156 | 
157 | > Engineer: ♻️  creating html 🕸️ (a.k.a. "the skeleton of the web")
158 | prototype files created successfully:
159 | - prototype/index.html
160 | - prototype/app.js
161 | - prototype/app.css
162 | opened prototype in the web browser
163 | 
164 | tell me how to make it better >
165 | ```
166 | 
167 | _you can check for / find errors in your browser console_
168 | 
169 | >_iff you know "how to HTML", you can help fix the code as well
_
170 | >_it is often something simple: adding a CSS class, updating the "width", etc._
171 | 
172 | ## development
173 | 
174 | in order to run from source
175 | clone jemma:
176 | 
177 | ```bash
178 | $ git clone git@github.com:tolitius/jemma.git
179 | ```
180 | and
181 | ```bash
182 | $ cd jemma
183 | $ python huddle.py --prompt "Code Editor" --build-prototype --claude
184 | Claude 🧠 claude-3-haiku-20240307 ✅
185 | ...
186 | ```
187 | 
188 | # license
189 | 
190 | Copyright © 2024 tolitius
191 | 
192 | Distributed under the Eclipse Public License either version 1.0 or (at
193 | your option) any later version.
194 | 
--------------------------------------------------------------------------------
/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tolitius/jemma/6b2ec2979a733f7a99c9ff698dc253239ea0d9de/__init__.py
--------------------------------------------------------------------------------
/docs/jemma-builds.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tolitius/jemma/6b2ec2979a733f7a99c9ff698dc253239ea0d9de/docs/jemma-builds.png
--------------------------------------------------------------------------------
/docs/jemma-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tolitius/jemma/6b2ec2979a733f7a99c9ff698dc253239ea0d9de/docs/jemma-logo.png
--------------------------------------------------------------------------------
/docs/jemma-sketch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tolitius/jemma/6b2ec2979a733f7a99c9ff698dc253239ea0d9de/docs/jemma-sketch.png
--------------------------------------------------------------------------------
/docs/jemma.cast:
--------------------------------------------------------------------------------
  1 | {"version": 2, "width": 110, "height": 24, "timestamp": 1712671227, "env": {"SHELL": "/bin/zsh", "TERM": "xterm-256color"}}
  2 | [23.183867, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
  3 | [23.184034, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
  4 | [26.427115, "o", "#"]
  5 | [26.854374, "o", " "]
  6 | [27.285076, "o", "l"]
  7 | [27.426631, "o", "e"]
  8 | [27.490238, "o", "t"]
  9 | [27.648269, "o", "'"]
 10 | [27.724372, "o", "s"]
 11 | [28.052343, "o", " "]
 12 | [28.252589, "o", "i"]
 13 | [28.307936, "o", "n"]
 14 | [28.406209, "o", "s"]
 15 | [28.515345, "o", "t"]
 16 | [28.586581, "o", "a"]
 17 | [28.677015, "o", "l"]
 18 | [28.81579, "o", "l"]
 19 | [29.223139, "o", " "]
 20 | [29.537522, "o", "j"]
 21 | [29.650377, "o", "e"]
 22 | [29.737625, "o", "m"]
 23 | [29.889897, "o", "m"]
 24 | [30.540265, "o", "a"]
 25 | [31.322033, "o", "\r\n"]
 26 | [31.322854, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
 27 | [31.322987, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
 28 | [31.809095, "o", "\r\n"]
 29 | [31.809283, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
 30 | [31.809365, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
 31 | [32.387362, "o", "p"]
 32 | [32.468176, "o", "i"]
 33 | [32.553229, "o", "p"]
 34 | [32.957947, "o", " "]
 35 | [33.52269, "o", "i"]
 36 | [33.578804, "o", "n"]
 37 | [33.685539, "o", "s"]
 38 | [33.776625, "o", "t"]
 39 | [33.85148, "o", "a"]
 40 | [33.90132, "o", "l"]
 41 | [34.047729, "o", "l"]
 42 | [34.136452, "o", " "]
 43 | [35.22181, "o", "j"]
 44 | [35.348903, "o", "e"]
 45 | [35.501331, "o", "m"]
 46 | [35.623357, "o", "m"]
 47 | [35.715591, "o", "a"]
 48 | [36.9748, "o", "\r\n"]
 49 | [37.605139, "o", "Collecting jemma\r\n"]
 50 | [41.855677, "o", "Downloading jemma-0.1.42-py3-none-any.whl (30.8 kB)\r\n"]
 51 | [43.433938, "o", "\u001b[?25l"]
 52 | [43.436122, "o", "   \u001b[38;5;237m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/30.8 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m"]
 53 | [43.462826, "o", "\r\u001b[2K   \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m30.8/30.8 kB\u001b[0m \u001b[31m4.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\r\n\u001b[?25h"]
 54 | [46.811493, "o", "Successfully installed jemma-0.1.42\r\n"]
 55 | [47.187392, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
 56 | [47.187462, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
 57 | [50.102587, "o", "\r\n"]
 58 | [50.102804, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
 59 | [50.103034, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
 60 | [52.102811, "o", "#"]
 61 | [52.222686, "o", " "]
 62 | [52.621102, "o", "j"]
 63 | [52.725522, "o", "e"]
 64 | [52.832191, "o", "m"]
 65 | [52.968215, "o", "m"]
 66 | [53.043827, "o", "a"]
 67 | [53.308322, "o", " "]
 68 | [53.925784, "o", "i"]
 69 | [54.028707, "o", "s"]
 70 | [54.141023, "o", " "]
 71 | [54.323593, "o", "i"]
 72 | [54.374484, "o", "n"]
 73 | [54.464592, "o", "s"]
 74 | [54.601129, "o", "t"]
 75 | [54.681652, "o", "a"]
 76 | [54.753266, "o", "l"]
 77 | [54.858666, "o", "l"]
 78 | [54.97183, "o", "e"]
 79 | [55.018816, "o", "d"]
 80 | [55.404868, "o", "!"]
 81 | [55.73258, "o", "\r\n"]
 82 | [55.733235, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
 83 | [55.733324, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
 84 | [56.358198, "o", "\r\n"]
 85 | [56.358363, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
 86 | [56.358457, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
 87 | [56.78382, "o", "#"]
 88 | [56.922403, "o", "#"]
 89 | [57.335237, "o", " "]
 90 | [57.50485, "o", "c"]
 91 | [57.754626, "o", "r"]
 92 | [57.839279, "o", "e"]
 93 | [57.918637, "o", "a"]
 94 | [58.108663, "o", "t"]
 95 | [58.136224, "o", "e"]
 96 | [58.701196, "o", " "]
 97 | [59.091609, "o", "a"]
 98 | [59.286239, "o", " "]
 99 | [59.452303, "o", "\""]
100 | [59.558795, "o", "\""]
101 | [59.742611, "o", "\b"]
102 | [60.297858, "o", ".\"\b"]
103 | [60.65312, "o", "e\"\b"]
104 | [60.78167, "o", "n\"\b"]
105 | [60.898833, "o", "v\"\b"]
106 | [61.232338, "o", "\u001b[C"]
107 | [61.605882, "o", " "]
108 | [61.788714, "o", "f"]
109 | [61.856224, "o", "i"]
110 | [61.90117, "o", "l"]
111 | [61.988846, "o", "e"]
112 | [62.33452, "o", " "]
113 | [62.438841, "o", "w"]
114 | [62.536185, "o", "i"]
115 | [62.654946, "o", "t"]
116 | [62.734316, "o", "h"]
117 | [63.1561, "o", " "]
118 | [63.479123, "o", "A"]
119 | [63.587403, "o", "P"]
120 | [63.649455, "o", "I"]
121 | [64.587512, "o", " "]
122 | [64.733834, "o", "k"]
123 | [64.832183, "o", "e"]
124 | [64.980079, "o", "y"]
125 | [65.063448, "o", "s"]
126 | [65.152313, "o", " "]
127 | [65.546689, "o", "o"]
128 | [65.64047, "o", "f"]
129 | [65.716444, "o", " "]
130 | [66.103964, "o", "y"]
131 | [66.169787, "o", "o"]
132 | [66.211616, "o", "u"]
133 | [66.302025, "o", "r"]
134 | [66.422154, "o", " "]
135 | [66.94006, "o", "c"]
136 | [67.064801, "o", "h"]
137 | [67.137327, "o", "o"]
138 | [67.187885, "o", "i"]
139 | [67.334851, "o", "c"]
140 | [67.434883, "o", "e"]
141 | [68.333271, "o", "\r\n"]
142 | [68.334155, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
143 | [68.334328, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
144 | [69.023081, "o", "c"]
145 | [69.080178, "o", "a"]
146 | [69.171631, "o", "t"]
147 | [69.222838, "o", " "]
148 | [69.759086, "o", "."]
149 | [69.885643, "o", "e"]
150 | [69.991501, "o", "nv "]
151 | [70.590873, "o", "\r\n"]
152 | [70.604078, "o", "export ANTHROPIC_API_KEY=sk-ant-api...\r\nexport OPENAI_API_KEY=sk-puk...\r\nexport REPLICATE_API_TOKEN=r8_ai...\r\n"]
153 | [70.604514, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
154 | [70.604643, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
155 | [71.33887, "o", "\r\n"]
156 | [71.339039, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
157 | [71.339194, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
158 | [76.117585, "o", "#"]
159 | [77.848998, "o", "\b\u001b[K"]
160 | [78.767181, "o", "#"]
161 | [78.885124, "o", " "]
162 | [79.500423, "o", "w"]
163 | [79.531504, "o", "e"]
164 | [79.670532, "o", " "]
165 | [79.780999, "o", "a"]
166 | [79.954666, "o", "r"]
167 | [80.027463, "o", "e"]
168 | [80.112079, "o", " "]
169 | [80.314912, "o", "n"]
170 | [80.362062, "o", "o"]
171 | [80.351413, "o", "w"]
172 | [80.49187, "o", " "]
173 | [80.852561, "o", "r"]
174 | [80.907151, "o", "e"]
175 | [81.13743, "o", "a"]
176 | [81.152483, "o", "d"]
177 | [81.794738, "o", "y"]
178 | [81.856976, "o", " "]
179 | [82.030695, "o", "t"]
180 | [82.093292, "o", "o"]
181 | [82.153796, "o", " "]
182 | [82.412856, "o", "c"]
183 | [82.654921, "o", "r"]
184 | [82.754491, "o", "e"]
185 | [82.831862, "o", "a"]
186 | [83.015021, "o", "t"]
187 | [83.083481, "o", "e"]
188 | [83.396401, "o", " "]
189 | [83.610557, "o", "w"]
190 | [83.701977, "o", "h"]
191 | [83.782256, "o", "a"]
192 | [83.939274, "o", "t"]
193 | [84.383062, "o", "e"]
194 | [84.430107, "o", "v"]
195 | [84.519922, "o", "e"]
196 | [84.589967, "o", "r"]
197 | [84.755435, "o", " "]
198 | [85.137483, "o", "o"]
199 | [85.199325, "o", "u"]
200 | [85.384681, "o", "r"]
201 | [85.464833, "o", " "]
202 | [85.703198, "o", "m"]
203 | [85.825467, "o", "i"]
204 | [85.923186, "o", "n"]
205 | [86.089466, "o", "d"]
206 | [86.186953, "o", " "]
207 | [86.557464, "o", "d"]
208 | [86.630235, "o", "e"]
209 | [86.830593, "o", "s"]
210 | [86.970969, "o", "i"]
211 | [87.915445, "o", "r"]
212 | [87.983687, "o", "e"]
213 | [88.235896, "o", "s"]
214 | [89.12749, "o", "!"]
215 | [89.699432, "o", "\r\n"]
216 | [89.700102, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
217 | [89.700311, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
218 | [91.603908, "o", "\r\n"]
219 | [91.604093, "o", "\u001b]0;jemma@simmons: /tmp\u0007(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
220 | [91.990094, "o", "j"]
221 | [92.344294, "o", "e"]
222 | [92.497118, "o", "m"]
223 | [92.624674, "o", "m"]
224 | [92.773592, "o", "a"]
225 | [93.533758, "o", " "]
226 | [93.961426, "o", "-"]
227 | [94.073652, "o", "-"]
228 | [94.41557, "o", "p"]
229 | [94.582055, "o", "r"]
230 | [94.675312, "o", "o"]
231 | [94.892753, "o", "m"]
232 | [94.965641, "o", "p"]
233 | [95.499592, "o", "t"]
234 | [96.222088, "o", " "]
235 | [96.774856, "o", "\""]
236 | [96.774856, "o", "R"]
237 | [96.774856, "o", "e"]
238 | [96.774856, "o", "t"]
239 | [96.774856, "o", "r"]
240 | [96.774856, "o", "o"]
241 | [96.774856, "o", " "]
242 | [96.774856, "o", "M"]
243 | [96.774856, "o", "i"]
244 | [96.774856, "o", "n"]
245 | [96.774856, "o", "e"]
246 | [96.774856, "o", "s"]
247 | [96.774856, "o", "w"]
248 | [96.774856, "o", "e"]
249 | [96.774856, "o", "e"]
250 | [96.774856, "o", "p"]
251 | [96.774856, "o", "e"]
252 | [96.774856, "o", "r"]
253 | [96.774856, "o", "\""]
254 | [106.017869, "o", " "]
255 | [106.221827, "o", "-"]
256 | [106.338306, "o", "-"]
257 | [106.849482, "o", "b"]
258 | [106.926901, "o", "u"]
259 | [106.950488, "o", "i"]
260 | [107.14714, "o", "l"]
261 | [107.249215, "o", "d"]
262 | [108.02931, "o", "-"]
263 | [108.672744, "o", "p"]
264 | [108.851926, "o", "r"]
265 | [108.943869, "o", "o"]
266 | [109.449629, "o", "t"]
267 | [109.570386, "o", "o"]
268 | [110.032397, "o", "t"]
269 | [110.170903, "o", "y"]
270 | [110.280879, "o", "p"]
271 | [110.420384, "o", "e"]
272 | [110.700011, "o", " "]
273 | [111.25571, "o", "-"]
274 | [111.349431, "o", "-"]
275 | [111.488602, "o", "c"]
276 | [111.603774, "o", "l"]
277 | [112.342723, "o", "a"]
278 | [112.503399, "o", "u"]
279 | [112.677954, "o", "d"]
280 | [112.769259, "o", "e"]
281 | [113.364133, "o", "\r\n"]
282 | [104.471046, "o", "\u001b[38;5;244mClaude 🧠 claude-3-haiku-20240307 ✅\u001b[0m\r\n\r\n\u001b[94m> \u001b[1m\u001b[96m\u001b[4mProject Manager\u001b[0m: \u001b[93m\r\nDear Business Owner, in this meeting we'll work on creating requirements based on the 💡 idea\r\n\r\n\u001b[94m> \u001b[1m\u001b[95m\u001b[4mBusiness Owner\u001b[0m: \u001b[36m📚 creating detailed requirements ...🖋️\r\n"]
283 | [122.008796, "o", "\r\n\u001b[94m> \u001b[1m\u001b[96m\u001b[4mProject Manager\u001b[0m: \u001b[93m\r\nDear Engineer, in this meeting let's put our heads together to build a prototype based on the requirements.\r\n\r\n\u001b[94m> \u001b[1m\u001b[95m\u001b[4mEngineer\u001b[0m: \u001b[36m💫 creating a prototype based on the requirements...\r\n\r\n\u001b[94m> \u001b[1m\u001b[95m\u001b[4mEngineer\u001b[0m: \u001b[96mcrafting css 🎨 (a.k.a. \"visual beauty\")\r\n"]
284 | [134.758708, "o", "\r\n\u001b[94m> \u001b[1m\u001b[95m\u001b[4mEngineer\u001b[0m: \u001b[96mcooking javascript 🎮 (a.k.a. \"master of interactions\")\r\n"]
285 | [157.272637, "o", "\r\n\u001b[94m> \u001b[1m\u001b[95m\u001b[4mEngineer\u001b[0m: \u001b[96mcreating html 🕸️ (a.k.a. \"the skeleton of the web\")\r\n"]
286 | [166.188864, "o", "prototype files created successfully:\r\n- prototype/index.html\r\n- prototype/app.js\r\n- prototype/app.css\r\n"]
287 | [166.421101, "o", "opened prototype in the web browser\r\n"]
288 | [166.421453, "o", "\r\n\u001b[92mtell me how to make it better > \u001b[0m"]
289 | [167.368968, "o", "a"]
290 | [167.623074, "o", "d"]
291 | [167.764074, "o", "d"]
292 | [168.12246, "o", " "]
293 | [168.27193, "o", "c"]
294 | [168.342906, "o", "o"]
295 | [168.474862, "o", "l"]
296 | [168.623646, "o", "o"]
297 | [169.222911, "o", "r"]
298 | [169.30331, "o", "s"]
299 | [169.467906, "o", ","]
300 | [169.541442, "o", " "]
301 | [169.72338, "o", "m"]
302 | [169.767506, "o", "a"]
303 | [169.899985, "o", "k"]
304 | [169.997455, "o", "e"]
305 | [170.633092, "o", " "]
306 | [170.767175, "o", "i"]
307 | [170.872972, "o", "t"]
308 | [170.922585, "o", " "]
309 | [171.104084, "o", "m"]
310 | [171.152494, "o", "o"]
311 | [171.934826, "o", "r"]
312 | [172.003481, "o", "e"]
313 | [172.124126, "o", " "]
314 | [172.176365, "o", "f"]
315 | [172.357832, "o", "u"]
316 | [172.973384, "o", "n"]
317 | [174.893149, "o", "!"]
318 | [177.14567, "o", "\r\n"]
319 | [177.145885, "o", "\r\n\u001b[94m> \u001b[1m\u001b[96m\u001b[4mProject Manager\u001b[0m: \u001b[93m\r\nDear Engineer, we have met with the user and received a valuable feedback. sudo make it better! 🛠️\r\n"]
320 | [177.145966, "o", "\r\n\u001b[94m> \u001b[1m\u001b[95m\u001b[4mEngineer\u001b[0m: \u001b[36m💫 refactoring prototype based on the feedback...\r\n"]
321 | [208.358243, "o", "prototype files created successfully:\r\n- prototype/index.html\r\n- prototype/app.js\r\n- prototype/app.css\r\n"]
322 | [208.591947, "o", "opened prototype in the web browser\r\n"]
323 | [208.592253, "o", "\r\n\u001b[92mtell me how to make it better > \u001b[0m"]
324 | [278.751848, "o", "\r\n"]
325 | [278.86765, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
326 | [278.867897, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
327 | [280.605838, "o", "\r\n"]
328 | [280.606012, "o", "\u001b]0;jemma@simmons: /tmp\u0007"]
329 | [280.606124, "o", "(simmons) [\u001b[01;36mai\u001b[01;37m]\u001b[01;34m\u001b[00m$ "]
330 | [283.671642, "o", "#"]
331 | [286.006794, "o", " "]
332 | [287.790002, "o", "y"]
333 | [287.9022, "o", "a"]
334 | [288.447781, "o", "y"]
335 | [288.790676, "o", "!"]
336 | 
--------------------------------------------------------------------------------
/docs/jemma.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tolitius/jemma/6b2ec2979a733f7a99c9ff698dc253239ea0d9de/docs/jemma.gif
--------------------------------------------------------------------------------
/docs/minesweeper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tolitius/jemma/6b2ec2979a733f7a99c9ff698dc253239ea0d9de/docs/minesweeper.png
--------------------------------------------------------------------------------
/huddle.py:
--------------------------------------------------------------------------------
 1 | import argparse, os
 2 | from dotenv import load_dotenv
 3 | 
 4 | from jemma.tools import parse_cli_arguments
 5 | from jemma.requirements.feature import Feature
 6 | from jemma.team.ui_ux_designer import UiUxDesigner
 7 | from jemma.team.business_owner import BusinessOwner
 8 | from jemma.team.engineer import Engineer
 9 | from jemma.team.tester import Tester
10 | from jemma.team.project_manager import ProjectManager
11 | import jemma.work.flow as flow
12 | 
13 | import jemma.thinker as thinker
14 | 
15 | def main():
16 | 
17 |     ## ----------------------------- setup
18 |     env_path = os.path.join(os.getcwd(), '.env')
19 |     load_dotenv(dotenv_path=env_path)
20 | 
21 |     args = parse_cli_arguments()
22 |     brain = thinker.make_brain(args)
23 | 
24 |     ## ----------------------------- create a feature
25 |     # read requirements from the file
26 |     requirements = ""
27 |     if args.requirements:
28 |         with open(args.requirements, 'r') as file:
29 |             requirements = file.read()
30 | 
31 |     feature = Feature(requirements)
32 | 
33 |     ## ----------------------------- create a team
34 |     designer = UiUxDesigner("an experienced UI/UX designer with attention to detail, "
35 |                              "focused on building beautiful and intuitive user interfaces")
36 | 
37 |     business_owner = BusinessOwner("an experienced business owner with attention to detail, "
38 |                                    "focused on building requirements for engineers to build software products")
39 | 
40 |     engineer = Engineer("an experienced software engineer "
41 |                         "with a focus on full stack development")
42 | 
43 |     tester = Tester("a professional software tester with a deep expertise is "
44 |                     "understanding business requirements and how they translate into software features")
45 | 
46 |     project_manager = ProjectManager(feature)
47 | 
48 |     ## ----------------------------- rock & roll
49 | 
50 |     if args.tasks:
51 |         flow.compose(brain,
52 |                      project_manager,
53 |                      designer,
54 |                      business_owner,
55 |                      engineer,
56 |                      tester,
57 |                      args)
58 | 
59 |     if args.user_stories:
60 |         flow.create_user_stories (brain,
61 |                                   project_manager,
62 |                                   business_owner,
63 |                                   engineer)
64 |     if args.build_prototype:
65 |         flow.build_prototype(brain,
66 |                              project_manager,
67 |                              designer,
68 |                              business_owner,
69 |                              engineer,
70 |                              args.prompt,
71 |                              args.sketch)
72 | 
73 |     if args.build_user_stories:
74 |         flow.build_user_stories(brain,
75 |                                 project_manager,
76 |                                 business_owner,
77 |                                 engineer)
78 |     if args.test_prototype:
79 |         flow.test_prototype(brain,
80 |                             project_manager,
81 |                             tester)
82 | 
83 | if __name__ == '__main__':
84 |     main()
85 | 
--------------------------------------------------------------------------------
/jemma/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tolitius/jemma/6b2ec2979a733f7a99c9ff698dc253239ea0d9de/jemma/__init__.py
--------------------------------------------------------------------------------
/jemma/epic/chord-progression.txt:
--------------------------------------------------------------------------------
 1 | Here's a detailed prompt with requirements for the "Musical Chord Progression Generator" web app:
 2 | 
 3 | Title: Musical Chord Progression Generator
 4 | 
 5 | Description:
 6 | Create a web app that generates chord progressions based on user-selected musical keys and moods. The app should display the generated chords, their positions on a virtual fretboard, and allow the user to play the progression and adjust the tempo. The app should also display the chord names and their corresponding musical notation.
 7 | 
 8 | Requirements:
 9 | 1. Key and Mood Selection:
10 |    - Provide a dropdown menu for the user to select a musical key (e.g., C, D, E, F, G, A, B).
11 |    - Include another dropdown menu for the user to choose a mood (e.g., happy, sad, mysterious, uplifting, melancholic).
12 | 
13 | 2. Chord Progression Generation:
14 |    - Upon user selection of key and mood, generate a chord progression that fits the selected criteria.
15 |    - Use music theory rules and algorithms to create harmonically pleasing progressions.
16 |    - Generate progressions with a minimum of 4 chords and a maximum of 8 chords.
17 | 
18 | 3. Chord Display Table:
19 |    - Display the generated chords in a table format.
20 |    - Each row should represent a chord in the progression.
21 |    - Columns should include the chord name, its position in the progression, and its musical notation.
22 |    - The chord name should be displayed in both letter notation (e.g., Cmaj7) and Roman numeral notation (e.g., I7).
23 | 
24 | 4. Virtual Fretboard:
25 |    - Display a virtual fretboard that shows the positions of the chords in the generated progression.
26 |    - Highlight the chords on the fretboard as the progression plays.
27 |    - Allow the user to interact with the fretboard by hovering over or clicking on the chords to display their names.
28 | 
29 | 5. Audio Playback:
30 |    - Include a "Play" button that allows the user to listen to the generated chord progression.
31 |    - Use a default tempo for playback, but allow the user to adjust the tempo using a slider or input field.
32 |    - Highlight the currently playing chord in the table and on the virtual fretboard.
33 | 
34 | 6. Musical Notation:
35 |    - Display the musical notation for each chord in the progression.
36 |    - Use standard notation symbols for chords (e.g., triads, sevenths, extensions).
37 |    - Optionally, include the ability to export the chord progression as a MIDI file or sheet music image.
38 | 
39 | 7. User Interface:
40 |    - Design a clean, intuitive, and visually appealing user interface.
41 |    - Use appropriate colors, fonts, and layout to create a professional and engaging experience.
42 |    - Ensure the app is responsive and works well on various screen sizes.
43 | 
44 | 8. Code Generation:
45 |    - The AI agent should generate the necessary HTML, CSS, and JavaScript code to create a functional prototype of the Musical Chord Progression Generator.
46 |    - The generated code should be well-structured, efficiently written, and include relevant comments.
47 | 
48 | Additional Considerations:
49 | - Consider adding a feature to save and share generated chord progressions.
50 | - Provide a help section or tutorial to explain the app's features and how to use them.
51 | - Incorporate accessibility best practices to ensure the app is usable by a wide range of users.
52 | 
53 | By following this prompt and its requirements, the AI agent should be able to create a comprehensive and engaging prototype of the Musical Chord Progression Generator web app.
54 | 
--------------------------------------------------------------------------------
/jemma/epic/talk-to-me-wiki.md:
--------------------------------------------------------------------------------
 1 | # CONTEXT
 2 | - Company documentation is stored on an internally hosted Confluence wiki
 3 | - Each team has their own space for documentation
 4 | - Documents contain text, links, images, tables, presentations, etc.
 5 | - The wiki contains hundreds of thousands of documents
 6 | 
 7 | # PROBLEM
 8 | - Searching for information on the wiki is difficult due to:
 9 |   - Information being scattered across different spaces and pages
10 |   - Many documents being abandoned and not updated
11 | - Onboarding new employees is challenging as they need to read through extensive documentation
12 | - Understanding integration points between systems is difficult due to scattered information
13 | - Comprehending how things work is not easy, despite most information being available
14 | 
15 | # SOLUTION
16 | - Build a RAG (Retrieval Augmented Generation) system that allows users to interact with and retrieve information from the wiki through natural language queries
17 | - Ensure data privacy by:
18 |   - Running the RAG system on internal company servers
19 |   - Using local embeddings and language models (e.g., Ollama or llama.cpp)
20 | - Host the RAG system using an open-source UI (e.g., open-webui, oobabooga) for user interaction
21 | - Implement document indexing to keep the RAG system up-to-date:
22 |   - Index new documents as they are created
23 |   - Periodically re-index old documents
24 | - Utilize ColBERT (v2) for document retrieval and RAGatouille for reranking to provide relevant search results
25 | - Implement a fallback search mechanism using LLM function calling/tooling to directly search the wiki when the RAG system fails to find relevant information
26 | - Develop user authentication, authorization, and access control to ensure data security
27 | - Implement monitoring, logging, and reporting features to track system performance and usage
28 | 
--------------------------------------------------------------------------------
/jemma/epic/valgo.txt:
--------------------------------------------------------------------------------
 1 | # Algorithmic Visualizer
 2 | 
 3 | ## Requirements:
 4 | - User selects a common algorithm (e.g., sorting, pathfinding, graph traversal)
 5 | - App displays a visually appealing, animated representation of the algorithm in action
 6 | - A table below the visualization shows the algorithm's step-by-step progress
 7 | - User can adjust parameters (e.g., array size, animation speed) via sliders or input fields
 8 | - App highlights the relevant code snippets as the algorithm progresses
 9 | - User can pause, step forward/backward, or restart the visualization
10 | 
11 | The Algorithmic Visualizer would be an engaging and interactive way for developers to understand and teach common algorithms. The visual animations and step-by-step table would make the algorithm's inner workings clear and easy to follow.
12 | 
13 | ## Instructions:
14 | 
15 | Here's how the AI agent could approach generating the prototype:
16 | 
17 | HTML:
18 | - Create a container for the visualization canvas
19 | - Add a table to display the algorithm's progress
20 | - Include sliders and input fields for adjusting parameters
21 | - Place buttons for controlling the visualization (play, pause, step, restart)
22 | - Display the relevant code snippets in a syntax-highlighted code block
23 | 
24 | CSS:
25 | - Style the visualization canvas to be visually appealing and responsive
26 | - Use animations and transitions to smoothly update the visualization
27 | - Style the table to be readable and visually consistent with the overall design
28 | - Ensure the sliders, input fields, and buttons have a modern, intuitive appearance
29 | - Apply syntax highlighting styles to the code block
30 | 
31 | JavaScript:
32 | - Implement a few algorithms in a modular, readable way
33 | - Create functions to update the visualization canvas based on the algorithm's progress
34 | - Populate and update the table with the algorithm's step-by-step progress
35 | - Add event listeners to the sliders, input fields, and buttons to control the visualization
36 | - Highlight the relevant lines of code as the algorithm progresses
37 | 
38 | The AI agent would need to intelligently generate the HTML structure, CSS styles, and JavaScript code based on the selected algorithm and user-specified parameters. The resulting prototype would be a fully functional, visually engaging app that showcases the power of AI-driven development.
39 | 
40 | This Algorithmic Visualizer combines the fun of interactive visualizations, the developer-oriented focus on common algorithms, and the flashy use of tables and animations to create an appealing and educational web app.
41 | 
42 | (!) make sure that when launched the first algorithm is defined, selected, visible and playable
43 | 
--------------------------------------------------------------------------------
/jemma/huddle.py:
--------------------------------------------------------------------------------
1 | ../huddle.py
--------------------------------------------------------------------------------
/jemma/prompt/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tolitius/jemma/6b2ec2979a733f7a99c9ff698dc253239ea0d9de/jemma/prompt/__init__.py
--------------------------------------------------------------------------------
/jemma/prompt/business/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tolitius/jemma/6b2ec2979a733f7a99c9ff698dc253239ea0d9de/jemma/prompt/business/__init__.py
--------------------------------------------------------------------------------
/jemma/prompt/business/owner.py:
--------------------------------------------------------------------------------
  1 | def clarify_user_story(role,
  2 |                        requirements,
  3 |                        user_story,
  4 |                        engineer_response):
  5 |     return f"""
  6 | # INSTRUCTIONS
  7 | As the {role}, your task is to review the engineer's feedback on the user story and provide clarifications while ensuring the user story remains concise and focused on a single unit of work.
  8 | 
  9 | Consider the following guidelines:
 10 | 1. Address the specific questions or points raised by the engineer.
 11 | 2. Provide clear and concise clarifications without adding unnecessary details.
 12 | 3. Ensure that the clarified user story still aligns with the overall feature requirements.
 13 | 4. Keep the user story focused on a single, well-defined unit of work.
 14 | 5. Use simple language and avoid ambiguity or vague statements.
 15 | 6. If the engineer has confirmed that no clarification is needed, simply return the original user story.
 16 | 
 17 | you task is to return the clarified acceptance criteria of the original user story. ALL in the Gherkin format (Given/When/Then). and NOTHING ELSE: no headers, no footers, no explanations, just the user story.
 18 | 
 19 | Return the acceptance criteria of the original user story clarified in the following JSON format:
 20 | 
 21 | "Given ,",
 22 | "When ,",
 23 | "And ,",
 24 | "Then .",
 25 | "",
 26 | "Given ,",
 27 | "When ,",
 28 | "And ,",
 29 | "And ,",
 30 | "Then .",
 31 | "",
 32 | "",
 33 | ...
 34 | 
 35 | make sure the final acceptance criteria covers ALL the points raised by the engineer
 36 | AS WELL AS the previous acceptance criteria, so no context is lost
 37 | 
 38 | * Use clear and concise language
 39 | return this acceptance criteria without any additional text, headings or footers: just a list of acceptance criteria in Gherkin format.
 40 | 
 41 | # FEATURE REQUIREMENTS
 42 | {requirements}
 43 | 
 44 | # ORIGINAL USER STORY
 45 | {user_story}
 46 | 
 47 | # ENGINEER'S RESPONSE
 48 | {engineer_response}
 49 | 
 50 | # CLARIFIED USER STORY
 51 | """
 52 | 
 53 | def split_requirements_to_features(role,
 54 |                                    requirements,
 55 |                                    evaluation,
 56 |                                    features):
 57 |     return f"""
 58 | # INSTRUCTIONS
 59 | As a {role}, your task is to take in:
 60 | 
 61 | * requirements: high level requirements for the project
 62 | * evaluation: previous feedback on the current features split
 63 | * features: the current features split
 64 | 
 65 | and, given all three, split the requirements into feature names by looking at the current features split and the previous evaluation.
 66 | 
 67 | # REQUIREMENTS
 68 | {requirements}
 69 | 
 70 | # FEATURES
 71 | {features}
 72 | 
 73 | # EVALUATION
 74 | {evaluation}
 75 | 
 76 | # GUIDELINES
 77 | 1. Review the current features split and the previous evaluation.
 78 | 2. Split the requirements into features based on evaluation and these guidelines.
 79 | 3. Name them by their business goal and purpose: DON'T start their name with "Implement"
 80 | 4. To determine the appropriate granularity of the features make sure each feature is
 81 |    - focused on a single business aspect of the requirements
 82 |    - cohesive busineswise
 83 |    - prefer delivering incremental value to the user
 84 |      - for example if something can be delivered read only with a follow up feature to edit or change, prefer that
 85 | 5. Ensure that an individual feature is NOT too small to implement.
 86 |    - example of TOO SMALL:
 87 |      - "edit one field"
 88 |      - "when naviated to a link user can see a view"
 89 |      - "display a button, component on the screen"
 90 |      - "validate email field", etc.
 91 | 6. Return each feaure on a separate line. Do not add empty lines.
 92 | 7. Return no other information, only a list of features.
 93 |    - NO additional text, headers, or footers
 94 | 
 95 | Remember feature is not a small task, it is a business functionality
 96 | Make sure that the list of feature names FULLY addresses every aspect of the requirements.
 97 | think step by step before providing a response
 98 | 
 99 | # RESPONSE FORMAT EXAMPLE
100 | : 
101 | : 
102 | : 
103 | : 
104 | : 
105 | ...
106 | 
107 | (!) return a list of features ONLY: no other headers, footers, or additional text
108 | """
109 | 
110 | def evaluate_features(role, features, requirements):
111 |     return f"""
112 | # INSTRUCTIONS
113 | As a {role}, your task is to evaluate the following feature names against the original requirements and decide whether the feedback is needed.
114 | 
115 | Your goal is to make sure requirements are split into features that are:
116 |  - focused on a single business aspect of the requirements
117 |  - cohesive busineswise
118 |  - clear, concise
119 |  - simple to implemented by the engineering team
120 | 
121 | Remember feature is not a small task but a business functionality
122 | 
123 | # FEATURES
124 | {features}
125 | 
126 | # REQUIREMENTS
127 | {requirements}
128 | 
129 | # RESPONSE FORMAT
130 | 
131 | **chain of thought**
132 | 
133 | 
134 | **feedback about each feature**
135 | 
136 | 
137 | 
138 | # GUIDELINES
139 | 1. Review features and assess whether it aligns with the original requirements
140 |    - ask to remove any features that are not aligned with the requirements
141 | 2. Determine whether this split needs to change, provide feedback accordingly
142 | 3. (!) Prefer delivering incremental value to the user
143 |        - for example if something can be delivered read only with a follow up feature to edit or change, prefer that
144 | 4. Ensure that an individual feature is NOT too small to implement.
145 |    - example of TOO SMALL:
146 |      - "edit one field"
147 |      - "when naviated to a link user can see a view"
148 |      - "display a button, component on the screen"
149 |      - "validate email field", etc.
150 | 5. Don't include features that are satisfactory in the reponse
151 | 6. Stricly follow the "RESPONSE FORMAT" provided above
152 | 7. If the features are not split well and require to be split differently, provide feedback indicating so.
153 | 
154 | Make sure that the list of feature names FULLY addresses every aspect of the requirements.
155 | (!) Only in case there no suggestions or improvements to ANY of the features in the list, reply with "APPROVED AND READY FOR REFINEMENT" in uppercase
156 | Remember, these are not full descriptions of the features, but a high-level feature names.
157 | """
158 | 
159 | def refine_feature(role, project_requiements, feature):
160 |     return f"""
161 | # INSTRUCTIONS
162 | As a {role}, your task is to given the project requirements refine the business feature
163 | This feature was carefully carfted to be a single, isolated, cohesive piece of business functionality
164 | Please keep it that way while refining
165 | 
166 | 
167 | {project_requiements}
168 | 
169 | 
170 | {feature}
171 | 
172 | # GUIDELINES
173 | 1. Analyze the feature and identify any areas that need improvement in terms of:
174 |    - Cohesiveness: Ensure that the feature focuses on a single, specific functionality or business goal.
175 |    - Size: Ensure that the feature is small enough to be easily understood and implemented.
176 |    - Clarity: Ensure that the feature is clear, concise, and free of ambiguity.
177 |    - Simplicity: Ensure that the feature is simple enough for an engineer to implement without requiring further clarification.
178 | 2. If any improvements are needed, refine the feature by making the necessary changes.
179 | 3. Return the refined feature.
180 |    - don't share any additional information
181 |    - only the refined feature name, description and the final list of detailed requirements
182 | 
183 | Remember, the goal is to create a feature that is cohesive, small, clear, concise, and simple for the engineer to implement.
184 | 
185 | # EXAMPLE RESPONSE
186 | 
187 | ## "Edit Account Details Inside the Table Row"
188 | 
189 | ### Description
190 | 
191 | 
192 | ### Requirements
193 | 
194 | """
195 | 
196 | def combine_user_stories(role,
197 |                          requirements,
198 |                          user_stories):
199 |     return f"""
200 | # INSTRUCTIONS
201 | As the {role}, your task is to combine the provided user stories, and the original requirements, combine these user stories into a single, cohesive set of requirements that has all the necessary details and instructions for implementation.
202 | 
203 | # REQUIREMENTS
204 | {requirements}
205 | 
206 | # USER STORIES
207 | {user_stories}
208 | 
209 | # GUIDELINES
210 | 1. Review the original requirements and the provided user stories.
211 | 2. Combine the user stories into a single, cohesive set of requirements that cover all the necessary details.
212 | 3. Ensure that the combined requirements are clear, concise, and free of ambiguity.
213 | 4. Make sure the combined requirements are detailed enough for an engineer to implement without requiring further clarification.
214 | 5. Return the combined requirements.
215 |    - don't share any additional information
216 | """
217 | 
218 | def idea_to_prompt(idea):
219 |     return f"""
220 | Title: Web App Prototype Prompt Generator
221 | 
222 | Description:
223 | Create a prompt generator that takes a short-form web app idea and generates a detailed prompt for building a self-sufficient prototype using only HTML, CSS, and JavaScript. The generated prompt should guide an AI model to create a functional web app prototype based on the provided idea.
224 | 
225 | Web App Idea:
226 | {idea}
227 | 
228 | Prompt:
229 | [Web App Idea]
230 | Description: [A brief description of the web app idea]
231 | 
232 | Desired Prompt Output:
233 | 
234 | Title: [Web App Name]
235 | 
236 | Description:
237 | [A detailed description of the web app, including its purpose, main features, and target audience]
238 | 
239 | Requirements:
240 | 1. [Requirement 1]
241 | 2. [Requirement 2]
242 | 3. [Requirement 3]
243 | ...
244 | 
245 | User Interface:
246 | [A description of the desired user interface, including layout, design elements, and user interactions]
247 | 
248 | Functionality:
249 | [Detailed explanations of the app's functionality, including any necessary algorithms, data processing, or dynamic behavior]
250 | 
251 | HTML Structure:
252 | [Guidelines for structuring the HTML code, including specific elements, classes, and IDs to be used]
253 | 
254 | CSS Styling:
255 | [Instructions for styling the app using CSS, including color scheme, typography, layout, and responsive design considerations]
256 | 
257 | JavaScript Interactivity:
258 | [Directions for implementing interactivity and dynamic functionality using JavaScript, including event handling, data manipulation, and API integration if applicable]
259 | 
260 | Additional Considerations:
261 | [Any additional features, optimizations, or best practices to keep in mind while building the prototype]
262 | 
263 | Note: The generated prompt should be clear, concise, and provide sufficient detail for an AI model to generate a functional web app prototype using only HTML, CSS, and JavaScript. The prompt should focus on guiding the model to create a self-sufficient prototype without relying on external libraries or frameworks.
264 | 
265 | Example Usage:
266 | Input:
267 | [Web App Idea]: Color Palette Generator
268 | Description: A web app that generates color palettes based on user input, allowing users to discover and save color combinations for their projects.
269 | 
270 | Output:
271 | Title: Color Palette Generator
272 | 
273 | Description:
274 | The Color Palette Generator is a web app that helps users create, discover, and save beautiful color palettes for their design projects. Users can input a base color or select a random color, and the app will generate a visually appealing color palette based on color theory principles. The app will display the color palette along with the hex codes and RGB values for each color. Users can adjust the brightness and saturation of the colors, save their favorite palettes, and export them for use in their projects.
275 | 
276 | Requirements:
277 | 1. Color input: Allow users to input a base color using a color picker or by entering a hex code.
278 | 2. Random color generation: Provide an option to generate a random base color for the palette.
279 | 3. Color palette generation: Generate a visually appealing color palette based on the base color using color theory principles (e.g., complementary, analogous, triadic).
280 | 4. Color palette display: Show the generated color palette with the hex codes and RGB values for each color.
281 | 5. Color adjustment: Allow users to adjust the brightness and saturation of the colors in the palette.
282 | 6. Palette saving: Enable users to save their favorite color palettes for future reference.
283 | 7. Palette export: Provide options to export the color palette as an image or CSS code snippet.
284 | 
285 | User Interface:
286 | The Color Palette Generator should have a clean, intuitive, and visually appealing user interface. The main section of the app should display the generated color palette, with each color shown as a large swatch along with its hex code and RGB values. The color input and random color generation options should be prominently placed above the palette. The color adjustment controls should be located below the palette, allowing users to easily tweak the brightness and saturation. The save and export options should be easily accessible, with clear labels and icons.
287 | 
288 | Functionality:
289 | The app should use JavaScript to handle color input, generation, and manipulation. When a user inputs a base color or selects the random color option, the app should generate a color palette using predefined color theory algorithms. The generated colors should be displayed dynamically on the page, with their hex codes and RGB values updated in real-time. The color adjustment controls should use range sliders to allow users to modify the brightness and saturation of the colors. The adjusted colors should be updated instantly in the palette display. The save functionality should store the user's favorite palettes in the browser's local storage, while the export options should generate downloadable files or copy CSS code snippets to the clipboard.
290 | 
291 | HTML Structure:
292 | The HTML structure should be semantically marked up and include the following main elements:
293 | - Header with the app title and navigation menu
294 | - Main section with the color input, random color button, and color palette display
295 | - Color adjustment controls below the palette
296 | - Save and export buttons
297 | - Footer with any necessary information or links
298 | 
299 | Use appropriate classes and IDs for styling and JavaScript manipulation.
300 | 
301 | CSS Styling:
302 | The CSS should provide an attractive and responsive design for the Color Palette Generator. Use a clean, modern color scheme that complements the generated color palettes. Ensure proper spacing, alignment, and sizing of elements. Use CSS Grid or Flexbox for the layout, and apply hover and focus states for interactive elements. Make the app responsive and mobile-friendly using media queries and relative units.
303 | 
304 | JavaScript Interactivity:
305 | Use JavaScript to add interactivity and functionality to the app. Implement the following features:
306 | - Color input and validation
307 | - Random color generation
308 | - Color palette generation based on color theory algorithms
309 | - Real-time updates of color swatches, hex codes, and RGB values
310 | - Color adjustment using range sliders
311 | - Saving and loading of favorite palettes using local storage
312 | - Exporting palettes as images or CSS code snippets
313 | 
314 | Organize the JavaScript code into modular functions and use descriptive variable and function names for clarity.
315 | 
316 | Additional Considerations:
317 | - Implement accessibility best practices, such as proper color contrast and keyboard navigation support.
318 | - Optimize the app's performance by minimizing DOM manipulation and using efficient algorithms for color generation and manipulation.
319 | - Add error handling and validation for user inputs to ensure a smooth user experience.
320 | - Consider adding a feature to share color palettes on social media or via unique URLs.
321 | - Provide a help section or tutorial to guide users on how to use the app effectively.
322 | 
323 | By following this prompt, an AI model should be able to generate a self-sufficient and functional prototype of the Color Palette Generator web app using HTML, CSS, and JavaScript. The prototype should fulfill the specified requirements, provide an engaging user interface, and demonstrate the core functionality of the app idea.
324 | """
325 | 
326 | def design_to_requirements(idea, design):
327 |     return f"""
328 | Title: Web App Prototype Prompt Generator
329 | 
330 | Description:
331 | Create a prompt generator that takes a short-form web app idea and a description of a mockup and generates a detailed prompt for building a self-sufficient prototype using only HTML, CSS, and JavaScript. The generated prompt should guide an AI model to create a functional web app prototype based on the provided idea and the mockup description. The generated prompt should make sure that the prototype 100% aligns with the visual structure and interactivity described in the mockup.
332 | 
333 | Web App Idea:
334 | {idea}
335 | 
336 | Mockup Description:
337 | {design}
338 | 
339 | Prompt:
340 | [Web App Idea]
341 | Description: [A brief description of the web app idea]
342 | 
343 | Desired Prompt Output:
344 | 
345 | Title: [Web App Name]
346 | 
347 | Description:
348 | [A detailed description of the web app, including its purpose, main features, and target audience]
349 | 
350 | Requirements:
351 | 1. [Requirement 1]
352 | 2. [Requirement 2]
353 | 3. [Requirement 3]
354 | ...
355 | 
356 | User Interface:
357 | [A description of the desired user interface, including layout, design elements, and user interactions based on the idea and mockup description]
358 | 
359 | Functionality:
360 | [Detailed explanations of the app's functionality, including any necessary algorithms, data processing, or dynamic behavior based on the idea and mockup description]
361 | 
362 | HTML Structure:
363 | [Guidelines for structuring the HTML code, including specific elements, classes, and IDs to be used based on the idea and mockup description]
364 | 
365 | CSS Styling:
366 | [Instructions for styling the app using CSS, including color scheme, typography, layout, and responsive design considerations based on the idea and mockup description]
367 | 
368 | JavaScript Interactivity:
369 | [Directions for implementing interactivity and dynamic functionality using JavaScript, including event handling, data manipulation, and API integration if applicable based on the idea and mockup description]
370 | 
371 | Additional Considerations:
372 | [Any additional features, optimizations, or best practices to keep in mind while building the prototype based on the idea and mockup description]
373 | 
374 | Note: The generated prompt should be clear, concise, and provide sufficient detail for an AI model to generate a functional web app prototype using only HTML, CSS, and JavaScript. The prompt should focus on guiding the model to create a self-sufficient prototype relying on jQuery, Twitter Bootstrap and DataTable libraries.
375 | """
376 | 
--------------------------------------------------------------------------------
/jemma/prompt/engineer/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tolitius/jemma/6b2ec2979a733f7a99c9ff698dc253239ea0d9de/jemma/prompt/engineer/__init__.py
--------------------------------------------------------------------------------
/jemma/prompt/engineer/clarify.py:
--------------------------------------------------------------------------------
 1 | def check_whether_clarification_needed(requirements, user_story):
 2 |     return f"""
 3 | # INSTRUCTIONS
 4 | As an experienced software engineer, your task is to carefully review the provided user story and determine if you have enough information to implement it precisely based on the project requirements.
 5 | 
 6 | Thoroughly analyze the user story and identify any missing, ambiguous, or unclear details that could impact the implementation. Consider the following aspects:
 7 | 
 8 | - all the necessary functionalities and behaviors clearly defined
 9 | - specific requirements about system integration
10 | - any edge cases or exceptional scenarios to consider
11 | - any specific performance criteria or constraints to consider
12 | - how should the feature integrate with existing systems or components
13 | - any security considerations or requirements
14 | 
15 | you job is to see which of the above options apply to the user story
16 | NONE or some could apply, depending on the user story context
17 | 
18 | If any information is missing or unclear, provide a list of specific questions or points that require further clarification from the business owner. Each clarification request should be clear, concise, and directly related to the implementation of the user story.
19 | 
20 | Make sure the clarifications and questions are ONLY about the content the user story itself vs. other non relevant requiements of the project.
21 | 
22 | Only share the final set of questions wit no headers, no footers, no explanations, just the questions.
23 | (!) Only if the user story is already complete and no further clarification is needed respond with "No clarification needed."
24 | 
25 | # PROJECT REQUIREMENTS
26 | {requirements}
27 | 
28 | # USER STORY
29 | {user_story}
30 | 
31 | # ENGINEER'S RESPONSE
32 | """
33 | 
--------------------------------------------------------------------------------
/jemma/prompt/engineer/code.py:
--------------------------------------------------------------------------------
  1 | def create_css_file(requirements):
  2 |     return f"""
  3 | You are a CSS expert with deep knowledge of Twitter Bootstrap CSS framework.
  4 | 
  5 | Your task is to generate a complete and working CSS file for a web prototype based on a twitter's "bootstrap.css" framework and the following requirements:
  6 | 
  7 | # REQUIREMENTS
  8 | {requirements}
  9 | 
 10 | follow these guidelines to create the CSS file:
 11 | 
 12 | # GUIDELINES
 13 | - Implement a color scheme with pastel colors that creates a pleasing atmosphere.
 14 |   - USE colors on a brighter side effectively to create visual hierarchy, highlight important elements, and convey the desired mood.
 15 | - Use appropriate margins, paddings, and spacing to create a balanced and visually pleasing arrangement.
 16 |   - (!) make sure DataTables are styled and flexible width so they don't overflow
 17 | - Choose a clean and readable font family for headings and body text
 18 |   - make font small enough to fit the content
 19 | - Make sure top and side margins and paddings make user focus on the main content
 20 | - Use Bootstrap's grid system to create a responsive layout
 21 |   - align menu items in a single row whether it is vertical or horizontal
 22 | 
 23 | Please generate a complete CSS file that fulfills these requirements and provides a beautiful, user-friendly, and responsive design for the web prototype. The generated CSS file should be ready to be integrated with the corresponding HTML and JavaScript files.
 24 | 
 25 | do NOT surround the file with markdown backticks: ```css ... ```
 26 | start the response with /* Global Styles */ and follow with CSS source according the guidelines.
 27 | 
 28 | # IMPORTANT
 29 | Provide the CSS file content ONLY, without any additional text or explanations. The CSS file should be well-structured, organized, and easy to understand for developers working on the web prototype.
 30 | 
 31 | (!) make sure ALL the requirements and actions are addressed in the CSS file.
 32 | """
 33 | 
 34 | 
 35 | def create_javascript_file(requirements, css):
 36 |     return f"""
 37 | You are a JavaScript expert who specializes in jQuery with a focus on Twitter Bootstrap and DataTables libraries.
 38 | 
 39 | Given requirements and a CSS file (based on "bootstrap.css") your task is to generate a JavaScript file that utilizes the jQuery library to create an interactive and dynamic web prototype based on these requirements that relies on that CSS file.
 40 | 
 41 | for tables, use a DataTables jQuery plugin to enhance the functionality and appearance of the tables.
 42 | 
 43 | This JavaScript file should be self-contained as this would be the only file that would be used to run the web prototype.
 44 | 
 45 | # REQUIREMENTS
 46 | {requirements}
 47 | 
 48 | # CSS FILE
 49 | {css}
 50 | 
 51 | follow these guidelines to create the JavaScript file:
 52 | 
 53 | # GUIDELINES
 54 | - Make sure layout pieces do not overlap or are not hidden by other elements.
 55 | - Make sure tables are used to store grid and tabular data
 56 | - Ensure that the generated JavaScript file seamlessly integrates with the provided CSS file.
 57 | - Instead of calling backend APIs populate test data or MINIMUM 7 entries in the JavaScript file to simulate the dynamic behavior of the web prototype.
 58 |   - doublechek that the data is visible to the user
 59 |   - doublecheck that the data is POPULATED
 60 | - Make sure edits happen in either inline within the table rows or in a modal window.
 61 | - do not forget to close all the code forms in parentheses, brackets, etc. $(function() {{ foo = [..] }});
 62 | - don't use todo action comments such as "// Add more test data here" or "// add code for to do X": instead IMPLEMENT the data / action
 63 | 
 64 | do NOT surround the file with markdown backticks: ```javascript ... ```
 65 | - start your response with a comment "// jQuery implementation"
 66 | - followed by the source code according to guidelines.
 67 | - ending with a comment "// prototype implementation"
 68 | 
 69 | IMPORTANT: Provide the JavaScript file content ONLY, without any additional text or explanations. The JavaScript file should be well-structured, organized, and easy to understand for developers working on the web prototype.
 70 | 
 71 | # IMPORTANT
 72 | (!) make sure ALL the requirements and actions are addressed in the JavaScript file.
 73 | """
 74 | 
 75 | def create_html_file(requirements, css, js):
 76 |     return f"""
 77 | Code Generator Agent,
 78 | 
 79 | Given requirements, a CSS file (based on "bootstrap.css"), and a JavaScript file, your task is to generate a complete and semantic HTML file that serves as the foundation for the web prototype based on these requirements.
 80 | The HTML file should import these in the following order:
 81 | 
 82 | - remote "bootrap.css"
 83 | - remote dataTables css (for bootstrap 4, "dataTables.bootstrap4.css")
 84 | - local, previously generated, CSS: app.css
 85 | - remote jQuery library
 86 | - remote "popper.js"
 87 | - remote "bootrap.js"
 88 | - remote dataTables js
 89 | - remote dataTables js (for bootstrap 4, "dataTables.bootstrap4.js")
 90 | - local, previously generated, JavaScript: app.js
 91 | 
 92 | example:
 93 | 
 94 |   
 95 |   
 96 |   
 97 |   
 98 |   
 99 |   
100 |   
101 |   
102 |   
103 | 
104 | and adhere to the following requirements to create the best layout and user experience possible.
105 | 
106 | # REQUIREMENTS
107 | {requirements}
108 | 
109 | # CSS FILE
110 | {css}
111 | 
112 | # JAVASCRIPT FILE
113 | {js}
114 | 
115 | follow these guidelines to create the HTML file:
116 | 
117 | # GUIDELINES
118 | 
119 | - Link the previously generated CSS file in the head section using the appropriate `` tag.
120 | - Place the previously generated JavaScript file before the closing `