Create plan

From shopsys/shopsys · View interactive version

Create plan is an AI agent skill from the GitHub repository shopsys/shopsys. Creates detailed implementation plans through an interactive research and specification workflow.

How to use this skill

Skill file

Monorepo note: if the repository has top-level packages/ and project-base/ directories (the shopsys/shopsys monorepo layout, not a standalone project), also read .agents/skills/monorepo-vs-project/SKILL.md and apply its delta (package-first + path/role remap) on top of this skill.

Implementation Plan

You are tasked with creating detailed implementation plans through an interactive, iterative process. You should be skeptical, thorough, and work collaboratively with the user to produce high-quality technical specifications.

Initial Response

When this command is invoked:

  1. Check if parameters were provided:
  1. If no parameters provided, respond with:
I'll help you create a detailed implementation plan. Let me start by understanding what we're building.

Please provide:
1. The task/feature description
2. Any relevant context, constraints, or specific requirements
3. Jira ticket key (e.g., PROJ-123) - I'll fetch details using MCP
4. Links to related implementations in the codebase

I'll analyze this information and work with you to create a comprehensive plan.

Tip: You can also invoke this command with a description directly: `/create-plan Add seller description management for multi-domain support`

Then wait for the user's input.

Process Steps

Step 1: Context Gathering & Initial Analysis

  1. Read all mentioned files immediately and FULLY:
  1. If a Jira ticket is mentioned, fetch its details first:
  1. Spawn initial research tasks to gather context:

Before asking the user any questions, use specialized agents to research in parallel:

These agents understand Shopsys architecture and will:

Follow the extension model — see .agents/skills/shopsys-architecture/SKILL.md

  1. Read all files identified by research tasks:
  1. Analyze and verify understanding:
  1. Present informed understanding and focused questions:

```

Based on the task description and my research of the codebase, I understand we need to [accurate summary].

I've found that:

Questions that my research couldn't answer:

```

Only ask questions that you genuinely cannot answer through code investigation.

Step 2: Research & Discovery

After getting initial clarifications:

  1. If the user corrects any misunderstanding:
  1. Create a research todo list using TodoWrite to track exploration tasks
  1. Spawn parallel sub-tasks for comprehensive research:

For deeper investigation:

For historical context and related work:

Each agent understands Shopsys project patterns and can:

  1. Wait for ALL sub-tasks to complete before proceeding
  1. Present findings and design options:

```

Based on my research, here's what I found:

Current State:

Design Options:

1. [Option A] - [pros/cons]

2. [Option B] - [pros/cons]

Open Questions:

Which approach aligns best with your vision?

```

Step 3: Plan Structure Development

Once aligned on approach:

  1. Create initial plan outline:

```

Here's my proposed plan structure:

## Overview

[1-2 sentence summary]

## Implementation Phases:

1. [Phase name] - [what it accomplishes]

2. [Phase name] - [what it accomplishes]

3. [Phase name] - [what it accomplishes]

Does this phasing make sense? Should I adjust the order or granularity?

```

  1. Get feedback on structure before writing details
  1. Agree on the costly decisions first. When the change touches the database schema, the public API (GraphQL schema, mutation inputs, public methods other code overrides) or the data model, present the viable options with a recommendation and get the user's choice before writing the detailed plan. These are the decisions that are expensive to change once code, generated files and the storefront depend on them.

Step 4: Pattern Verification

Before writing the detailed plan:

  1. Validate implementation patterns by spawning additional research tasks:
  1. Update plan approach based on validated patterns:
  1. Check the design against the conventions in .agents/skills/coding-conventions/SKILL.md → Design conventions (data model, API, simplicity). For every rule that applies to this change the plan must say how it is satisfied — which existing concept is reused instead of a new structure, who consumes each new API field or argument, why no extra guard or parallel flow is needed, which hot path gets a new loop and how its queries are bounded. Record this under Design decisions in the plan.

Step 5: Detailed Plan Writing

After structure approval and pattern verification:

  1. Write the plan to docs/plans/{descriptive_name}.md
  2. Use this template structure:
# [Feature/Task Name] Implementation Plan

## Overview

[Brief description of what we're implementing and why]

## Current State Analysis

[What exists now, what's missing, key constraints discovered]

## Desired End State

[A Specification of the desired end state after this plan is complete, and how to verify it]

### Key Discoveries:
- [Important finding with file:line reference]
- [Pattern to follow]
- [Constraint to work within]

## What We're NOT Doing

[Explicitly list out-of-scope items to prevent scope creep]

## Implementation Approach

[High-level strategy and reasoning]

### Design decisions

[How the design conventions apply here: reused existing concepts, consumers of new API fields, sibling patterns followed, hot-path query cost. One line per decision, with the reason.]

## Phase 1: [Descriptive Name]

### Overview
[What this phase accomplishes]

### Changes Required:

#### 1. [Component/File Group]
**File**: `path/to/file.ext`
**Changes**: [Summary of changes]

<code>
// Specific code to add/modify
</code>

### Success Criteria:

#### Automated Verification:
- [ ] Entity changes generate migration correctly: `docker compose exec php-fpm php phing db-migrations-generate`
- [ ] Unit tests pass: `docker compose exec php-fpm php phing tests-unit`
- [ ] Code standards pass: `docker compose exec php-fpm php phing standards-fix`
- [ ] Storefront types check: `docker compose exec storefront pnpm run typecheck` (if applicable)
- [ ] GraphQL schema synced: `make generate-schema` (if applicable)

#### Manual Verification:
- [ ] Feature works as expected when tested via UI
- [ ] Performance is acceptable under load
- [ ] Edge case handling verified manually
- [ ] No regressions in related features

---

## Phase 2: [Descriptive Name]

[Similar structure with both automated and manual success criteria...]

---

## Testing Strategy

### Unit Tests:
- [What to test]
- [Key edge cases]

### Manual Tests:
- [Manual verification scenarios]

### Manual Testing Steps:
1. [Specific step to verify feature]
2. [Another verification step]
3. [Edge case to test manually]

## Performance Considerations

[Any performance implications or optimizations needed]

## Migration Notes

[If applicable, how to handle existing data/systems]

## References

- Jira ticket: [TICKET-KEY] - fetched via mcp__atlassian__getJiraIssue
- Similar implementation: `[file:line]`

Step 6: Sync and Review

  1. Present the completed plan:
  1. Present the draft plan location:
I've created the initial implementation plan at:
`docs/plans/[filename].md`

Please review it and let me know:
- Are the phases properly scoped?
- Are the success criteria specific enough?
- Any technical details that need adjustment?
- Missing edge cases or considerations?
   ```

3. **Iterate based on feedback** - be ready to:
   - Add missing phases
   - Adjust technical approach
   - Clarify success criteria (both automated and manual)
   - Add/remove scope items
   - Update the plan file directly when making changes

4. **Continue refining** until the user is satisfied

## Important Guidelines

1. **Be Skeptical**:
   - Question vague requirements
   - Identify potential issues early
   - Ask "why" and "what about"
   - Don't assume - verify with code

2. **Be Interactive**:
   - Don't write the full plan in one shot
   - Get buy-in at each major step
   - Allow course corrections
   - Work collaboratively

3. **Be Thorough**:
   - Read all context files COMPLETELY before planning
   - Research actual code patterns using parallel sub-tasks
   - Include specific file paths and line numbers
   - Write measurable success criteria with clear automated vs manual distinction
   - automated steps should use Docker-wrapped commands: `docker compose exec php-fpm php phing` for backend operations
   - storefront operations use: `docker compose exec storefront pnpm run [command]`

4. **Be Practical**:
   - Focus on incremental, testable changes
   - Consider migration and rollback
   - Think about edge cases
   - Include "what we're NOT doing"

5. **Track Progress**:
   - Use TodoWrite to track planning tasks
   - Update todos as you complete research
   - Mark planning tasks complete when done

6. **No Open Questions in Final Plan**:
   - If you encounter open questions during planning, STOP
   - Research or ask for clarification immediately
   - Do NOT write the plan with unresolved questions
   - The implementation plan must be complete and actionable
   - Every decision must be made before finalizing the plan

7. **Pattern Validation Before Writing**:
   - ALWAYS validate implementation patterns using pattern-finder research before detailed planning
   - Verify all component types you plan to implement have correct examples
   - This prevents implementation errors by catching pattern issues early

## Success Criteria Guidelines

**Always separate success criteria into two categories:**

1. **Automated Verification** (can be run by execution agents):
   - Commands that can be run: `make test`, `npm run lint`, etc.
   - Specific files that should exist
   - Code compilation/type checking
   - Automated test suites

2. **Manual Verification** (requires human testing):
   - UI/UX functionality
   - Performance under real conditions
   - Edge cases that are hard to automate
   - User acceptance criteria

**Format example:**

Success Criteria:

Automated Verification:
Manual Verification:

## Common Patterns

*Understand the extension model before planning where code goes — see `.agents/skills/shopsys-architecture/SKILL.md`.*

The golden rule: **never edit `vendor/shopsys/`**. It is read-only framework reference. Your project's own entities, services, and logic live in `app/src/…`. To change existing framework behavior, extend it — an `App\` entity extends the `Shopsys\` base entity (Entity Extension), and services/classes are swapped via service/class overrides.

### For Database Changes:
- Create your project's Doctrine entities in `app/src/Model/`
- To add fields/behavior to an existing framework entity, extend it: define an `App\` entity that extends the `Shopsys\` base (Entity Extension)
- Generate migrations with `docker compose exec php-fpm php phing db-migrations-generate`
- Add or override Repository methods in `app/src/Model/`
- Add business logic to project Facade classes in `app/src/Model/`
- Update forms and controllers in `app/src/` (extend framework form types / controllers where you only need to adjust behavior)

### For New Features:
- Research existing patterns in the framework reference (`vendor/shopsys/*/src/`) to see how the platform does it
- Implement the project's functionality in `app/src/Model/`:
  - Entity, EntityDomain, EntityTranslation (if multi-domain/translatable)
  - EntityData and EntityDataFactory for form handling
  - Repository and Facade classes
  - FormType in `app/src/Form/`
  - Controller actions in `app/src/Controller/`
- Where you're changing existing framework behavior rather than adding wholly new code, use Entity Extension and service/class overrides instead of duplicating framework code
- Consider GraphQL resolvers in `app/src/FrontendApi/` if API needed
- Consider storefront components in `storefront/` if UI needed

### For Refactoring:
- Document current behavior
- Plan incremental changes
- Maintain backwards compatibility
- Include migration strategy

## Sub-task Spawning Best Practices

When spawning research sub-tasks:

1. **Spawn multiple tasks in parallel** for efficiency
2. **Each task should be focused** on a specific area
3. **Provide detailed instructions** including:
    - Exactly what to search for
    - Which directories to focus on
    - What information to extract
    - Expected output format
4. **Be EXTREMELY specific about directories**:
    - Focus on the Shopsys project structure:
      - Framework base classes (READ-ONLY reference): `vendor/shopsys/*/src/` (e.g. `vendor/shopsys/framework/src/Model/`, `vendor/shopsys/framework/src/Controller/Admin/`)
      - Project code: `app/src/Model/`, `app/src/Controller/`, `app/src/Form/`
      - Frontend API: `app/src/FrontendApi/Resolver/`, `app/src/FrontendApi/Mutation/`
      - Storefront: `storefront/components/`, `storefront/pages/`
    - For admin features: `vendor/shopsys/framework/src/Controller/Admin/` (reference), project overrides in `app/src/Controller/Admin/`
    - For GraphQL: `app/src/FrontendApi/`, with framework reference in `vendor/shopsys/frontend-api/src/`
    - Include the full path context in your prompts
5. **Specify read-only tools** to use
6. **Request specific file:line references** in responses
7. **Wait for all tasks to complete** before synthesizing
8. **Verify sub-task results**:
    - If a sub-task returns unexpected results, spawn follow-up tasks
    - Cross-check findings against the actual codebase
    - Don't accept results that seem incorrect

Example of spawning multiple tasks:

Spawn these tasks concurrently:

tasks = [

Task("Research database schema", db_research_prompt),

Task("Find API patterns", api_research_prompt),

Task("Investigate UI components", ui_research_prompt),

Task("Check test patterns", test_research_prompt)

]


## Docker Command Context

**IMPORTANT**: All Shopsys development happens in Docker containers. When planning implementations:

### Container-Specific Commands:
- **Backend/PHP**: `docker compose exec php-fpm php phing [command]`
- **Storefront**: `docker compose exec storefront pnpm run [command]`
- **Database**: Direct PostgreSQL access via docker exec when needed

### Commands That Run on Host (NOT in containers):
- Git operations: `git status`, `git commit`, `git push`
- Make commands: `make check-fix`, `make generate-schema`
- System commands: `ls`, `grep`, file operations

## Example Interaction Flow

User: /create-plan

Assistant: I'll help you create a detailed implementation plan...

User: We need to implement PROD-456 - Add product variant description management

Assistant: Let me fetch the Jira ticket details first...

[Uses mcpatlassiangetJiraIssue to get PROD-456 details]

Based on the Jira ticket, I see we need to add product variant descriptions with multi-domain support. Let me research the current product and variant implementation in both the project code and the framework reference...

[Researches existing patterns in app/src/Model/Product/ and the framework reference in vendor/shopsys/framework/src/Model/Product/]

Based on my research, I found:

Before I start planning, I have some questions about the scope...

[Interactive process continues with project-aware context...]

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.