The prompt
Project Step-by-step Plan:
```
{{ step_by_step_plan }}
```
Context From User:
```
{{ user_context }}
```
Context From Knowledge Base:
{% if not knowledge_base_context %}
No context found.
{% else %}
{% for query, result in search_results.items() %}
Query: {{ query }}
Result:
```
{{ result }}
```
---
{% endfor %}
{% endif %}
Read the step-by-step plan carefully. Think step-by-step. Learn relevant information from the knowledge base context. Then write the code to implement the step-by-step plan.
Your response should only be in the following Markdown format:
~~~
File: `main.py`:
```py
print("Example")
```
File: `src/main.rs`:
```rs
fn main() {
println!("Example");
}
```
File: `nested/directory/example/code.py`:
```py
print("Example")
```
File: `README.md`
```md
# Example
This is an example.
```
~~~
Rules:
- You should write clean and documented code.
- The code should work on the first try without any errors or bugs.
- Choose the library or dependency you know best.
- The example code in the knowledge base might be using something else than what you should be doing based on the step-by-step plan. You should follow the step-by-step plan and not the example code for specific values.
- The extension used for the Markdown code blocks should be accurate.
- Nested directories should be specified in the Markdown filename, the code structure should be accurate. If it requires to be nested to work, then it should be nested.
- You need to include required files for the code to run. Like: requirements.txt, Cargo.toml, etc.
- Files like Cargo.toml are mandatory to be included, the project won't work without it.
Any response other than this format will be rejected. You should not refuse to complete the task, you should try your absolute best and if there's any implementation detail that's impossible to complete, you should write a comment in the code explaining why it's impossible to complete. The refusal is only a last resort, it should never happen.
Your response should start with "~~~" and end with "~~~" just like the example format provided. Never provide any explanation or context inside the response, only the filenames and the code in the format provided. Do not leave any "Note". What it is
Devika's coder prompt: read the step-by-step plan, the user's context and the search results from the knowledge base, then write the full project as a list of File blocks between ~~~ lines, with accurate nested paths and code-block extensions and the dependency files needed to run it. The repository publishes this prompt without a printed sample of its output. The prompt text comes from the devika repository (MIT License, Copyright (c) 2024 stition). Licence: https://github.com/stitionai/devika/blob/main/LICENSE. Original author: stition (stitionai/devika). Changes by FoxaMind: none; the Jinja2 file is shown as in the source, with its {{ ... }} and {% ... %} tags.
Who it's for
- Developers building plan-then-code agents
- Anyone who wants an LLM reply that can be split into files
برومبت كتابة الكود في Devika: يقرأ الخطة وسياق المستخدم ونتائج البحث من قاعدة المعرفة، ثم يكتب المشروع كاملاً على شكل كتل File بين سطري ~~~، بمسارات متداخلة صحيحة وامتدادات دقيقة لكتل الكود، مع ملفات الاعتماديات اللازمة للتشغيل.
Tips
- The reply must start and end with "~~~", with no explanation or notes outside the file blocks.
- When example code in the knowledge base differs from the plan, the prompt says to follow the plan.
- Files such as requirements.txt or Cargo.toml must be included.
- If a detail is impossible to implement, the prompt asks for a code comment explaining why.