From core
Analyzes existing test architecture by reading project description and user instructions, extracting framework, language, structure, and coding standards, and documenting findings in a test plan.
How this command is triggered — by the user, by Claude, or both
Slash command
/core:aqa-flow-code-analysisThe summary Claude sees in its command listing — used to decide when to auto-load this command
# Phase 3: Code Analysis ## Objective Understand existing test architecture, identify reusable components, and determine where new test should be integrated. ## Prerequisites - Phase 1 and 2 completed - Test plan file updated with assertions and clarifications - User answers received ## Phase Tasks ### Task 1: Read Project Description **Actions**: 1. Locate and read `agents/user-app/project_description.md` file 2. Extract key information: - **Test Framework**: What testing framework is used? (e.g., Playwright, Selenium, Cypress) - **Language**: Programming language (e.g., Pytho...
Understand existing test architecture, identify reusable components, and determine where new test should be integrated.
Actions:
agents/user-app/project_description.md fileExpected Output: Understanding of project standards and structure.
Actions:
agents/user-instructions/ directoryExpected Output: Extracted user instructions documented and ready to apply in test creation.
Note: If agents/user-instructions/ directory does not exist or is empty, skip this task and proceed to Task 2. Document that no user instructions files were found.
Actions:
Use: Glob to check for RefSrc/tools-st-frontend/
RefSrc/tools-st-frontend/src/data-testid, data-test, or test-id attributesid and className patterns### Frontend Code Analysis
#### Component: DashboardComponent (RefSrc/tools-st-frontend/src/features/dashboard/Dashboard.tsx)
- data-testid attributes: "welcome-message", "dashboard-title"
- Props: { userName: string, notifications: number }
- API calls: fetchDashboardData()
- Related components: NotificationBell, UserProfile
#### Component: SettingsPage (RefSrc/tools-st-frontend/src/features/settings/SettingsPage.tsx)
- data-testid attributes: "email-input", "save-button"
- Form fields: email, notifications, preferences
Expected Output: Understanding of UI implementation and available test identifiers.
Actions:
Use: Glob or Grep to find Page Object files
Example patterns: "**/pages/**", "**/page-objects/**", "**/*Page.*"
### Existing Page Objects
#### LoginPage (src/pages/LoginPage.ts)
- Selectors: username, password, loginButton, errorMessage
- Methods: login(), isErrorDisplayed()
- Relevance: Needed for test setup
#### DashboardPage (src/pages/DashboardPage.ts)
- Selectors: welcomeMessage, menuButton, userProfile
- Methods: navigateToProfile(), getWelcomeText()
- Relevance: Main test target
#### Missing Page Objects:
- SettingsPage (needed for test, does not exist)
Expected Output: Complete inventory of relevant Page Objects and gaps.
Actions:
Use: Grep or SemanticSearch to find related tests
Search for: feature names, page names, similar actions
### Similar Tests
#### tests/auth/login.test.ts
- Tests: User login flow
- Pattern: Setup -> Action -> Assert -> Cleanup
- Uses: LoginPage, DashboardPage
- Similarity: Uses same pages, similar flow
#### tests/dashboard/navigation.test.ts
- Tests: Dashboard navigation
- Pattern: Login setup -> Multiple navigation assertions
- Uses: DashboardPage, utility helpers
- Similarity: Similar assertion style
### Recommended Test Location
- File: tests/dashboard/user-profile.test.ts (new file)
- Reason: New feature area, logical grouping
- Alternative: Add to tests/dashboard/navigation.test.ts if test is small
Expected Output: Understanding of existing test patterns and determined location for new test.
Actions:
Use: Glob to find utility files
Patterns: "**/utils/**", "**/helpers/**", "**/lib/**"
### Reusable Utilities
- `utils/test-helpers.ts`
- `loginAsUser(username, password)`: Automates login
- `waitForPageLoad()`: Smart page load wait
- `utils/assertions.ts`
- `expectElementVisible(selector)`: Custom visibility assertion
- `expectTextContains(element, text)`: Text assertion helper
- `utils/test-data.ts`
- `generateUser()`: Creates test user data
Expected Output: List of utilities that should be reused in new test.
Actions:
## Phase 3: Code Analysis
### Project Information
- Framework: [e.g., Playwright with TypeScript]
- Test Location: [Directory path]
- Naming Convention: [Pattern]
### Frontend Code Analysis (if available)
- Frontend Source: RefSrc/tools-st-frontend/
- Components Analyzed: [List]
- Available data-testid attributes: [List]
- Component Props: [Relevant props]
- UI Flow: [Brief description]
### Common User Instructions
- Source: `agents/user-instructions/` (all files)
- Must Follow: [List critical instructions]
- Should Follow: [List important preferences]
- Nice to Have: [List optional preferences]
- Application: These instructions MUST be applied during test implementation (Phase 6)
### Existing Page Objects
[List with relevance]
### Page Objects to Create/Extend
- [List missing Page Objects]
- [List Page Objects needing new selectors]
### Similar Tests
[List with file paths and similarity notes]
### Recommended Test Location
- File: [Path]
- Reason: [Why]
### Reusable Utilities
[List utilities to import and use]
### Coding Patterns to Follow
- Test structure: [Pattern]
- Naming: [Convention]
- Assertions: [Style]
- User Instructions: [Apply user instructions from agents/user-instructions/]
Expected Output: Test plan enhanced with architecture understanding.
agents/user-app/project_description.md read and understoodagents/user-instructions/ read and understood (if directory exists)agents/aqa-state.md updated with Phase 3 completionAfter completing Phase 3, update agents/aqa-state.md:
### Phase 3: Code Analysis
- Completed: [DateTime]
- User Instructions Directory: [Found/Not Found, files list if found]
- User Instructions Applied: [Yes/No, summary if yes]
- Existing Page Objects: [Count and list]
- Page Objects to Create: [Count and list]
- Similar Tests: [File paths]
- Test Location: [Directory/File decision]
- Framework: [Name and version]
Mark Phase 3 as completed and Phase 4 as current.
Proceed to Phase 4: Selector Identification by executing:
ACQUIRE aqa-flow-selector-identification.md FROM KB
agents/user-instructions/ MUST be applied during test implementation (Phase 6)npx claudepluginhub p/griddynamics-core-instructions-r2-core/test-planCreates a structured test plan from feature artifacts — queries test types, environment, and credentials, auto-detects the test framework, generates test cases mapped to user stories, and saves them under features/<name>/testing/.
/expectAnalyzes git changes, generates targeted test plans, and executes them via AI-driven browser automation. Only tests what changed.
/test_planAnalyzes unit tests, assesses current coverage and quality, and generates a comprehensive test plan document with prioritized recommendations and tasks.
/test-planGenerates a structured test plan for a feature, file, or PR, covering unit, integration, UI, E2E, and contract tests with priorities and gap analysis.
/rev-specsAnalyzes existing codebases to reverse-engineer test cases and specification documents from business logic, APIs, and UI components. Outputs test plans, test case lists, and generated test code.
/hatch3r-test-planProduces a comprehensive test plan with coverage targets, priority ordering, test case outlines, and structured todo.md entries using parallel researchers for feature or module-level auditing.