Goal: To prepare your development environment, retrieve all necessary task details, and create a dedicated feature branch, ensuring you are ready to begin the Researching Phase.
Phase Starts: When a new Jira ticket is assigned, a new task is identified, or when a user suggests a large feature to build. Phase Ends: When you have a clean, up-to-date feature branch with all necessary ticket information loaded, and the ticket (if applicable) is moved to "In Progress" and assigned to you.
Expected Artifacts:
- Local repository on the correct feature branch.
- Feature branch correctly named and ideally pushed to the remote repository.
- Task or Jira ticket details (ID, summary, description, acceptance criteria) fetched and available (e.g., stored in
.agent/[JIRA-TICKET_OR_TASK-NAME]/task_details.md
if extensive). - Jira ticket status updated to "In Progress" and assigned to the current user (if a Jira ticket is involved).
Steps:
-
Check for Unstaged Changes:
- If unstaged changes exist, ask the user whether to stash, commit, or revert them before proceeding.
-
Switch to Primary Branch:
- Determine if the repository uses
main
,master
, or another primary branch. - Checkout the appropriate primary branch (e.g.,
git checkout main
).
- Determine if the repository uses
-
Update Codebase and Dependencies:
- Pull the latest changes from the remote primary branch (e.g.,
git pull origin main
). - Identify the package manager (
pnpm
,yarn
,npm
) based on lock files (prioritizepnpm
). - Install or update dependencies using the appropriate command (e.g.,
pnpm install
).
- Pull the latest changes from the remote primary branch (e.g.,
-
Get Jira Ticket Details (or Task Definition):
- If not already provided, obtain the Jira ticket ID or a clear definition/name for the task/feature.
- Use tools at your disposal to retrieve full information about the specified ticket (summary, description, acceptance criteria, current status, assignee) or to clearly document the user-suggested feature.
- If the details are extensive, consider saving them to a file like
.agent/[JIRA-TICKET_OR_TASK-NAME]/task_details.md
.
-
Update Jira Ticket Status and Assignment (if applicable):
- If a Jira ticket is involved, use tools at your disposal to:
- Assign the ticket to the current user (e.g.,
"current_user"
). - Update the ticket status to "In Progress".
- Assign the ticket to the current user (e.g.,
- If a Jira ticket is involved, use tools at your disposal to:
-
Create Feature Branch:
- The branch name MUST follow the format:
{type}/{JIRA-KEY}-{description}
.- Example:
feat/DX-123-add-user-login
- Example:
- Valid types:
build
,chore
,ci
,docs
,feat
,fix
,perf
,refactor
,revert
,style
,test
. - The
{JIRA-KEY}
should be the full ticket ID (e.g.,DX-123
) or a short, descriptive task name if no Jira ticket exists. - The
{description}
should be a short, kebab-case summary of the task. - Create and checkout the new branch (e.g.,
git checkout -b feat/DX-123-add-user-login
). - Optional but recommended: Push the new branch to the remote repository (e.g., using VCS commands like
git push -u origin feat/DX-123-add-user-login
).
- The branch name MUST follow the format:
This phase is now complete. You MUST finish this phase now and do not move on to the next phase.