Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small tasks #800

Draft
wants to merge 1 commit into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 14 additions & 8 deletions pilot/const/function_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,20 +319,26 @@ def command_definition(description_command='A single command that needs to be ex
'parameters': {
'type': 'object',
"properties": {
"thoughts": {
"type": "string",
"description": "Explanation of thoughts behind the plan.",
},
"plan": {
"type": "array",
"description": 'List of development tasks that need to be done to implement the entire plan.',
"description": "List of development tasks that need to be done to finish the entire project.",
"items": {
"type": "object",
'description': 'Development task that needs to be done to implement the entire plan. It contains all details that developer who is not familiar with project needs to know to implement the task.',
'properties': {
'description': {
'type': 'string',
'description': 'Very detailed description of the development task that needs to be done to implement the entire plan.',
"description": "Development task that needs to be done to finish the entire project.",
"properties": {
"description": {
"type": "string",
"description": "High level description of the development task that needs to be done to implement the entire plan."
}
},
'required': ['description'],
},
"required": [
"description"
]
}
},
},
"required": ['plan'],
Expand Down
57 changes: 13 additions & 44 deletions pilot/prompts/components/project_tasks.prompt
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
Before we go into the coding part, I want you to split the development process of creating this {{ task_type }} into smaller tasks so that it is easier to develop, debug and make the {{ task_type }} work.

Each task needs to be related only to the development of this {{ task_type }} and nothing else - once the {{ task_type }} is fully working, that is it. There shouldn't be a task for researching, deployment, writing documentation, testing or anything that is not writing the actual code.

**IMPORTANT**
As an experienced tech lead you always follow rules on how to create tasks. Dividing project into tasks is extremely important job and you have to do it very carefully.
Based on the project details provided{% if task_type == 'feature' %} and new feature description{% endif %}, think task by task and create the entire development plan{% if task_type == 'feature' %} for new feature{% elif task_type == 'app' %}. {% if files %}Continue from the existing code listed above{% else %}Start from the project setup{% endif %} and specify each task until the moment when the entire app should be fully working{% if files %}. You should not reimplement what's already done - just continue from the implementation already there{% endif %}{% endif %} while strictly following these rules:

Now, based on the project details provided{% if task_type == 'feature' %} and new feature description{% endif %}, think task by task and create the entire development plan{% if task_type == 'feature' %} for new feature{% elif task_type == 'app' %}. {% if files %}Continue from the existing code listed above{% else %}Start from the project setup{% endif %} and specify each task until the moment when the entire app should be fully working{% if files %}. You should not reimplement what's already done - just continue from the implementation already there{% endif %}{% endif %} while strictly following these rules:

---START_OF_RULES---
Rule #1
There should never be a task that is only testing or ensuring something works, every task must have coding involved. Have this in mind for every task, but it is extremely important for last task of project. Testing if {{ task_type }} works will be done as part of each task.

Expand All @@ -16,50 +12,23 @@ You have to make sure the project is not split into tasks that are too small or
Have in mind that project already has workspace folder created and only system dependencies installed. You don't have to create tasks for that.
Here are examples of poorly created tasks:

**too simple tasks**
- Set up a Node.js project and install all necessary dependencies.
- Establish a MongoDB database connection using Mongoose with the IP '127.0.0.1'.

**too complex tasks**
- Set up Node.js project with /home, /profile, /register and /login routes that will have user authentication, connection to MongoDB with user schemas, mailing of new users and frontend with nice design.

You must to avoid creating tasks that are too simple or too complex. You have to aim to create tasks that are medium complexity. Here are examples of tasks that are good:

**good tasks**
- Set up a Node.js project, install all necessary dependencies and set up an express server with a simple route to `/ping` that returns the status 200.
- Establish a MongoDB database connection and implement the message schema using Mongoose for persistent storage of messages.

Rule #3
This rule applies to the number of tasks you will create.
Every {{ task_type }} should have different number of tasks depending on complexity. Think task by task and create the minimum number of tasks that are relevant for this specific {{ task_type }}.{% if task_type == 'feature' %} If the feature is small, it is ok to have only 1 task.{% endif %} Here are some examples of apps with different complexity that can give you guidance on how many tasks you should create:

Example #1:
app description: "I want to create an app that will just say 'Hello World' when I open it on my localhost:3000."
number of tasks: 1-2

Example #2:
app description: "Create a node.js app that enables users to register and log into the app. On frontend it should have /home (shows user data), /register and /login. It should use sessions to keep user logged in."
number of tasks: 2-4

Example #3:
app description: "A cool online shoe store, with a sleek look. In terms of data models, there are shoes, categories and user profiles. For web pages: product listing, details, shopping cart. It must look cool and jazzy."
number of tasks: 5-15
Every {{ task_type }} should have different number of tasks depending on complexity. Think task by task and create the minimum number of tasks that are relevant for this specific {{ task_type }}. If the {{ task_type }} is small, it is ok to have only 1 task.

Rule #4
This rule applies to writing task 'description'.
Every task must have a clear and very detailed (must be minimum of 4 sentences but can be more) 'description'. It must be very clear so that even developers who just moved to this project can execute them without additional questions. It is not enough to just write something like "Create a route for /home". You have to describe what needs to be done in that route, what data needs to be returned, what should be the status code, etc. Give as many details as possible and make sure no information is missing that could be needed for this task.
Here is an example of good and bad task description:

**bad task**
{
"description": "Create a route for /dashboard"
}

**good task**
{
"description": "In 'route.js' add a route for /dashboard that returns the status 200. Route should be accessible only for logged in users. In 'middlewares.js' there should be a check if user is logged in using session. If user is not logged in, it should redirect to /login. If user is logged in, it should return the user data. User data should be fetched from database in 'users' collection using the user id from session."
}
Every task must have a clear 1 sentence description. It must be very clear so that even developers who just moved to this project can execute them without additional questions. Make sure no information is missing that could be needed for this task.

Rule #5
When creating and naming new files, ensure the file naming (camelCase, kebab-case, underscore_case, etc) is consistent with the best practices and coding style of the language.
Pay attention to file paths: if the command or argument is a file or folder from the project, use paths relative to the project root (for example, use `./somefile` instead of `/somefile`).

Rule #6
Keep in mind that project already has workspace folder created and only system dependencies installed. You don't have to create tasks for that.

Rule #7
Each task needs to be related only to the development of this app and nothing else - once the app is fully working, that is it. There shouldn't be a task for researching, deployment, writing documentation, testing or anything that is not writing the actual code.
---END_OF_RULES---

Let's think step by step and find minimum amount of tasks to successfully finish this {{ task_type }}.
2 changes: 1 addition & 1 deletion pilot/prompts/development/plan.prompt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
You are working in a software development agency and a project manager and software architect approach you telling you that you're assigned to work on a new project. You are working on a {{ app_type }} called "{{ name }}" and you need to create a detailed development plan so that developers can start developing the app.
You are working on a {{ app_type }} called "{{ name }}" and you need to create a development plan so that developers can start developing the app.

{{ project_details }}
{{ features_list }}
Expand Down
2 changes: 1 addition & 1 deletion pilot/prompts/system_messages/tech_lead.prompt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
You are an experienced tech lead in a software development agency and your main task is to break down the project into smaller tasks that developers will do. You must specify each task as clear as possible. Each task must have a description of what needs to be implemented.
You are an experienced tech lead in a software development agency and your main task is to break down the project into smaller tasks that developers will do.