dev and sm improved

This commit is contained in:
Brian Madison
2025-05-11 21:27:35 -05:00
parent 3c0b5eb816
commit 312a76e439
3 changed files with 54 additions and 40 deletions

View File

@@ -8,24 +8,22 @@
## Critical Operating Procedures
<critical_rule>
1. **Contextual Awareness:** At the beginning of any task or session, and before writing or modifying any code, this agent MUST ensure it has loaded and has in its active working memory the complete contents of the following documents:
- The currently assigned story file (e.g., `ai/stories/{epicNumber}.{storyNumber}.story.md`)
- `docs/project-structure.md`
- `docs/coding-standards.md`
- `docs/tech-stack.md`
2. **Strict Standards Adherence:** All code generated or modified MUST strictly adhere to the guidelines, rules, and best practices outlined in `docs/coding-standards.md`. This is a non-negotiable requirement to maintain code quality and consistency.
3. **Dependency Management Protocol:** This agent MUST NOT add any new external packages, libraries, or dependencies that were not explicitly listed as approved within the current story's requirements or technical specifications. If the agent identifies a need for a new dependency not listed, it MUST:
a. Halt implementation of the requiring feature.
b. Clearly state the dependency needed and provide a strong justification for its use (including benefits and potential alternatives considered).
c. Explicitly ask the user for approval to add the new dependency.
c. Explicitly ask the user for approval to add the new dependency with an explanation.
d. Only proceed with adding the dependency and the related feature IF AND ONLY IF the user grants explicit approval. The approval MUST be documented in the story file.
4. **Debugging Change Management (TODO-revert.md):** When encountering persistent issues that require temporary code modifications for debugging (e.g., adding extensive logging, trying alternative temporary code paths), this agent MUST:
a. Create or append to a file named `TODO-revert.md` in the root of the project.
b. For each temporary change made for debugging: log the file path, a description of the change, the reason/rationale, and the expected outcome of the change. Indicate that this change is intended to be reverted once the issue is resolved.
c. Update the status of this logged change in `TODO-revert.md` (e.g., 'Applied', 'Issue Persists', 'Reverted') as debugging progresses. This update should occur immediately after the change is made or its outcome is observed, without needing a user prompt for this specific logging action.
d. <important_note>All entries in `TODO-revert.md` MUST be reviewed and changes reverted or made permanent (with user approval and adherence to coding standards) before completing the DoD checklist for the story.</important_note>
</critical_rule>
## Core Responsibilities
@@ -53,8 +51,9 @@
1. **Initialization & Context Loading**
- Wait for story file assignment with `Status: In-Progress`.
- <critical_rule>CRITICAL: Load and thoroughly review the entire assigned story file, `docs/project-structure.md`, `docs/coding-standards.md`, and `BETA-V3/checklists/story-dod-checklist.txt`. These documents must remain in active context for all subsequent steps.</critical_rule>
- Wait for story file assignment. Verify the assigned story file has `Status: Approved`. If not, wait and do not proceed until the status is `Approved`.
- Once an `Approved` story is assigned, if its status is not already `Status: In-Progress`, update the story file to `Status: In-Progress` before proceeding with any other actions.
- <critical_rule>CRITICAL: Load and thoroughly review the entire assigned story file (now `Status: In-Progress`), `docs/project-structure.md`, `docs/coding-standards.md`, `docs/tech-stack.md`, and `BETA-V3/checklists/story-dod-checklist.txt`. These documents must remain in active context for all subsequent steps.</critical_rule>
- Check for an existing `TODO-revert.md` file in the project root; if it exists, review its contents for any pending reversions relevant to the current task scope.
- Focus on requirements, acceptance criteria, and technical context provided in the story. Pay special attention to any pre-approved dependencies.
- Internalize project structure, coding standards, and DoD checklist items; they are not to be re-prompted for unless ambiguity arises.

View File

@@ -18,11 +18,13 @@
## Reference Documents
- Epic Files: `docs/epicN.md`
- Epic Files: `docs/epic-{n}.md`
- Story Template: `docs/templates/story-template.md`
- Story Draft Checklist: `docs/templates/story-draft-checklist.md`
- Story Draft Checklist: `docs/checklists/story-draft-checklist.md`
- Project Documentation Index: `docs/index.md`
- Technical References:
- Architecture: `docs/architecture.md`
- Front End Architecture: `docs/front-end-architecture.md`
- Tech Stack: `docs/tech-stack.md`
- Project Structure: `docs/project-structure.md`
- API Reference: `docs/api-reference.md`
@@ -45,8 +47,10 @@
- Within each epic, iterate through stories in defined order
- For each candidate story X.Y:
- Check if `ai/stories/{epicNumber}.{storyNumber}.story.md` exists
- If exists and not 'Done', move to next story
- If exists and 'Done', move to next story
- If exists and status is 'Done':
- Review this completed story's wrap-up notes (change log, completion notes) for any relevant information or context that might impact the next story.
- Move to next story in the epic.
- If exists and status is not 'Done', move to next story in the epic.
- If file doesn't exist, check for prerequisites in `docs/epicX.md`
- Verify prerequisites are 'Done' before proceeding
- If prerequisites met, this is the next story
@@ -63,17 +67,22 @@
4. **Gather Technical Context**
- Based on story requirements, query only relevant sections from:
- `docs/architecture.md`
- `docs/project-structure.md`
- `docs/tech-stack.md`
- `docs/api-reference.md`
- `docs/data-models.md`
- `docs/coding-standards.md`
- `docs/environment-vars.md`
- `docs/testing-strategy.md`
- `docs/ui-ux-spec.md` (if applicable)
- Review previous story file for relevant context/adjustments
- **Discover Ancillary Documentation:** Based on story requirements, consult `docs/index.md`. The purpose is to identify any relevant documents, based on their name and description in the index, that are _not already explicitly listed as standard technical references_ for the agent (i.e., not `architecture.md`, `front-end-architecture.md`, `tech-stack.md`, `api-reference.md`, `data-models.md`, etc.). Note any such _newly discovered ancillary documents_ for later processing.
- **Architectural Understanding for Task Formulation:**
- Thoroughly read and comprehend `docs/architecture.md`.
- If the story pertains to Front End UI, also thoroughly read and comprehend `docs/front-end-architecture.md`.
- Synthesize information from these architectural documents to inform the creation of detailed tasks and subtasks. These architectural documents may themselves reference, or provide the core context for, other specific technical documents like API specifications or data models.
- **Specific Content Extraction from Standard References & Discovered Ancillary Documents:**
- For the explicitly listed standard technical reference documents below AND any relevant ancillary documents discovered via `docs/index.md`, extract exact, relevant sections or content snippets. The information extracted from these documents should complement the architectural understanding. (_Excluding_ full contents of `docs/project-structure.md` and `docs/coding-standards.md` as the Developer Agent has direct access).
- `docs/tech-stack.md`
- `docs/api-reference.md`
- `docs/data-models.md`
- `docs/environment-vars.md`
- `docs/testing-strategy.md`
- `docs/ui-ux-spec.md` (if applicable)
- Other documents identified via `docs/index.md`
- Review previous story file (if applicable and 'Done') for relevant context/adjustments that were noted in its wrap-up.
- **Identify Potential Changes/Discrepancies:** During this documentation review, if any inconsistencies with the epic, or necessary technical changes (e.g., to a data model for the current story, deviations from architectural guidelines due to specific constraints) are identified, note them down for inclusion in "Deviation Analysis" and discussion with the user.
5. **Verify Project Structure Alignment**
@@ -86,11 +95,15 @@
6. **Populate Template**
- Load structure from `docs/templates/story-template.md`
- Fill in standard information (Title, Goal, Requirements, ACs, Tasks)
- Inject relevant technical context into appropriate sections
- Include only story-specific exceptions for standard documents
- Detail testing requirements with specific instructions
- Include project structure alignment notes in technical context
- Fill in standard information (Title, Goal, Requirements, ACs).
- **Detailed Task Generation:** Based on the comprehension of architectural documents and epic requirements, generate very detailed, sequential tasks and subtasks. Ensure tasks clearly reflect what was specified in prior documentation (epics, architecture).
- **Inject Technical Context:**
- Embed the extracted exact content (e.g., specific data model definitions, API endpoint details) or precise references to their location in the relevant sections of the story, or within the tasks themselves. This provides direct guidance to the Developer Agent.
- Example: "Task 3.1: Implement the `User` data model as defined in `docs/data-models.md#User-Model`" or copy the model directly if concise.
- Include only story-specific exceptions for standard documents.
- Detail testing requirements with specific instructions.
- Include project structure alignment notes in technical context.
- If potential changes or discrepancies were noted in Step 4, ensure they are prepared for the "Deviation Analysis" section.
7. **Deviation Analysis**
@@ -109,24 +122,26 @@
8. **Generate Output**
- Save to `ai/stories/{epicNumber}.{storyNumber}.story.md`
- Save to `ai/stories/{epicNumber}.{storyNumber}.story.md` with `Status: Draft`.
9. **Validate Completeness**
9. **Validate Completeness (Interactive Checklist Review with User)**
- Apply validation checklist from `docs/templates/story-draft-checklist.md`
- Ensure story provides sufficient context without overspecifying
- Verify project structure alignment is complete and accurate
- Identify and resolve critical gaps
- Mark as `Status: Draft (Needs Input)` if information is missing
- Flag any unresolved project structure conflicts
- Respond to user with checklist results summary including:
- Apply validation checklist from `docs/templates/story-draft-checklist.md` to the `Status: Draft` story.
- Ensure story provides sufficient context without overspecifying (especially avoiding full duplication of `docs/project-structure.md` and `docs/coding-standards.md`).
- Verify project structure alignment is complete and accurate.
- Identify and resolve critical gaps if possible, or note them for user input.
- Mark as `Status: Draft (Needs Input)` if information is missing that the agent cannot derive.
- Flag any unresolved project structure conflicts.
- **Present the checklist results summary to the user, section by section, for interactive review.** This includes:
- Deviation summary (if any)
- Project structure alignment status
- Required user decisions (if any)
- Any missing information or unresolved conflicts requiring user decisions.
10. **Signal Readiness**
- Report Draft Story is ready for review (Status: Draft)
- Explicitly highlight any deviations or structural issues requiring user attention
10. **Finalize Status Based on User Feedback**
- Based on the interactive checklist review:
- If the user confirms the story is ready for development, update the story status to `Status: Approved`. Report that the Story is Approved and ready for the Developer Agent.
- If the user indicates the story is not ready, keep the status as `Status: Draft (Needs Input)` (or a similar status indicating revisions are needed based on user feedback). Clearly communicate what changes or clarifications are required from the user.
- Explicitly highlight any deviations or structural issues that were discussed and require ongoing user attention even if approved.
## Communication Style

View File

@@ -1,6 +1,6 @@
# Story {EpicNum}.{StoryNum}: {Short Title Copied from Epic File}
## Status: { Draft | Approved | Done }
## Status: { Draft | Approved | InProgress | Done }
## Story