An Intent is a self-contained document that explains the user request in a markdown file that has one H1 header as the title, followed by some required and optional H2 headers sections.
IMPORTANT: The intent document MUST strive to keep explanations brief, concise and straight to the point. Developers prefer communication that's as straightforward as possible. Start by the most important parts that need to be told, follow with some brief context, and only add details when it makes sense.
- The title MUST be the first line of the file and be short and concise and include the type of Intent and the Domain it refers to. The format for the title is
<typeofintent> (domain-resource): intent, e.g.54 - Feature (Catalogs-Products): Add CRUD actions.- the type of intent may be a
feature, anenhancement, abug, or something else. It needs to be defined as a single word without spaces, use only letters, numbers,:,-and_.
- the type of intent may be a
- WHY the user has asked to do something, the intention.
- WHAT the user wants to build, which can be provided by the user as event modelling images, using the Gherkin language or as plain text. The AI Coding assistant can also help the user and infer the WHAT from the WHY (the intention), by asking relevant questions, if needed.
- HOW the step-by-step that the AI Coding Agent plans to follow to build WHAT the user requested, the tasks and sub-tasks.
- TARGET AUDIENCE The target audience for the request when makes sense.
- CONSTRAINTS If any exist they must be listed and briefly explained in a concise way.
- DESIGN DECISIONS The key design decisions, their rationale and trade-offs.
- ALTERNATIVES CONSIDERED Other approaches that were considered and why they weren't chosen.
- ARCHITECTURE Architecture decisions, considerations and diagrams if applicable. By default the Domain Resource Action architecture pattern is used as per ARCHITECTURE.md.
- IMPLEMENTATION Notes on expected implementation details, key decisions, the expected challenges, and their possible resolutions.
- TECHNICAL DETAILS Specific technical details and considerations. For example what packages to use, and why they were chosen over other alternatives.
- CODE SNIPPETS AND EXAMPLES Provide them when the problem is complex to guide and help the AI Code Agent to better resolve them as you wish.
- CHALLENGES & SOLUTIONS Challenges encountered during implementation and how they were resolved. This only makes sense to add after the Intent is implemented, and didn't go as planned.
Intents must be persisted on the .intents/ directory at the root of the project.
CRITICAL: The guidelines defined in the DEVELOPMENT_WORKFLOW.md MUST be followed, especially the ones for 1.2 Task Implementation Protocol and 1.3 Task Completion Protocol.
The .intents/ directory will have the following folder structure to enable tracking the Intent progress status:
- todo - To persist all new Intents at the time of their creation.
- work-in-progress - To persist all Intents that are being worked on.
- completed - To persist all Intents with all tasks and sub-tasks completed.
These folders MUST be created if they don't exist yet.
The Intent MUST be kept in the correct status folder on the .intents/ directory as we progress from creating it, working on it, to complete it:
- todo - The Intent MUST be moved to the
work-in-progressstatus folder once work starts on it. - work-in-progress - The Intent MUST be moved to the
completedstatus folder once all tasks and sub-tasks on it are finished, and before git committing the changes. - completed - Changes can only be committed after a
work-in-progressIntent as been moved here.
CRITICAL: When an Intent is created/updated/moved in any of the status folders, with the user approval, it MUST be committed before proceeding with its implementation or anything else the user requests.
The .intents/ directory MUST have a file with a suffix of last_intent_created and as the name the number of the last Intent created, thus following this format number.last_intent_created. For example: 54.last_intent_created. When the next Intent is created the file MUST be git renamed with the number increased by one, therefore to 55.last_intent_created. The first Intent added to .intents/todo is REQUIRED to start at number 1, therefore the file will be 1.last_intent_created.
The file name for the Intent to be created MUST follow the format <number>_<typeofintent_<domain-resource><intent-dashed>, e.g. 54_feature_catalogs-products_add-crud-actions.md.
If they don't exist yet, create the .intents/* directory, its folders (todo, work-in-progress and completed) and the file 0_last_intent_created, where the number 0 means that no Intent was yet created. Commit this changes to git before proceeding with whatever it needs to be done next.
CRITICAL: To propose, create or update and save the Intent the guidelines defined in the DEVELOPMENT_WORKFLOW.md MUST be followed, especially the ones for 1.2 Task Implementation Protocol and 1.3 Task Completion Protocol.
- Before proposing an Intent you must check the
.intents/tododirectory to see if one already exists to implement the user request. - If no Intent is found then you MUST also check the
.intents/work-in-progressstatus folder to see if one exists with tasks to be completed for the user request. - If an Intent is found in either of the status folders, then you MUST read it and see if needs to be updated to better align with the user request and the current project documentation guidelines.
- If the Intent needs to be updated then you MUST propose such changes to the user for approval and save it to the
.intents/work-in-progressstatus folder. - If the Intent is to be created then you MUST propose it as a code change for user approval and then you MUST save it to the
.intents/todostatus folder. - After the Intent is created or updated and saved into the respective status folder it MUST be committed before proceeding with its implementation or anything else the user requests.
CRITICAL: The guidelines defined in the DEVELOPMENT_WORKFLOW.md MUST be followed, especially the ones for 1.2 Task Implementation Protocol and 1.3 Task Completion Protocol.
In addition to Task implementation and completion protocols you MUST perform this steps to implement an Intent:
- You MUST check if the Intent already has Tasks marked as completed
[x], and if so then you MUST: - Ensure it's in the correct status folder:
- All tasks and sub-tasks not marked as completed yet
[ ], the Intent MUST be in thetodofolder. - Some tasks or sub-tasks marked as completed[x], the Intent MUST be in thework-in-progressfolder. - All tasks marked as completed[x], the Intent MUST be in thecompletedfolder. - Ensure they are indeed done by checking the git history with
git log --stat. In case the git history isn't conclusive search the project files for the expected modules with the implementation code. If a task or sub-task isn't implemented yet, then confirm with the user and uncheck[ ]it if the user says isn't implemented yet. - Resume working on the Intent from the last confirmed completed task or sub-task, and ignore the next step.
- In the case you aren't resuming work on an Intent, then you MUST now move the Intent from the
todofolder to thework-in-progressfolder, but only commit this change when you complete the first task in the Intent. - When you complete all tasks and sub-tasks in an Intent
[x], then the Intent MUST be moved from the folderwork-in-progresstocompletedfolder, and changes committed as defined by the Task completion protocol.
CRITICAL: When working on an Intent task or sub-task and the instructions aren't correct, you MUST fix the Intent once you sort out the correct way of doing it.
See the INTENT_EXAMPLE.md file to use as a reference when implementing Intents for user requests. In a real project this Intent example would be located at the root of the project on the .intents/ folder, e.g., ./.intents/todo/54_feature_catalogs-products_add-crud-actions.md.