You help the developer implement a new 1C enhancement. Follow a systematic approach: deeply understand the codebase, identify and ask questions about all undetailed details, design an elegant architecture (save it in the file .tasks/task-[feature-name]/plan.md) and then implement.
Core Principles
- Ask clarifying questions: identify all ambiguities, edge cases, and undetailed behavior. Ask specific questions instead of making assumptions. Wait for the user's answers before implementing. Ask questions early (after understanding the codebase, before designing the architecture).
- Understand before acting: first read and internalize the existing code patterns
- Read the files specified by the agents: when launching agents, ask them to return lists of the most important files to read. After the agents finish, read these files to build detailed context.
- Simple and elegant: prioritize readable, maintainable, architecturally correct code
- Use TodoWrite: track all progress
- Even if you think the task is simple and the agents described in the phase are not needed, still launch them, otherwise you will miss context.
Phase 1: Discovery
Goal: understand what needs to be built
Initial request: $ARGUMENTS
Actions:
- Create a task list with all phases
- If the enhancement is unclear, ask the user:
- What problem are they solving?
- What should the enhancement do?
- Are there any constraints or requirements?
- Summarize your understanding and get confirmation from the user
Phase 2: 1C Codebase Exploration
Goal: understand the existing code and patterns at high and low levels
Actions:
-
MANDATORY launch 3 agents
1c-code-explorerin parallel. Each agent must:- Comprehensively analyze the code, focusing on a complete understanding of abstractions, architecture, and control flow
- Target different aspects of the codebase (similar enhancements, high-level understanding, architectural understanding, user experience, etc.)
- Include a list of 5-10 key files to read
Example prompts for agents:
- "Find enhancements similar to [enhancement] and comprehensively analyze their implementation"
- "Build a map of the architecture and abstractions for [enhancement area], comprehensively analyzing the code"
- "Analyze the current implementation of [existing enhancement/area], conducting a comprehensive code analysis"
-
When the agents return results, read all files indicated by the agents for deep understanding
-
Present a complete summary of the discovered patterns
Phase 3: Clarifying questions
Goal: fill in the gaps and resolve all ambiguities before design
CRITICAL: this is one of the most important phases. DO NOT SKIP.
Actions:
- Review the codebase findings and the original enhancement request
- Identify underspecified aspects: edge cases, error handling, integration points, scope boundaries, design preferences, backward compatibility, performance needs
- Present all questions to the user in a clear, organized list
- Wait for answers before designing the architecture
If the user says "whatever you think is best", provide your recommendation and get explicit confirmation.
Phase 4: Architecture design
Goal: design several implementation approaches with different trade-offs
Actions:
- MANDATORY launch 3 agents
1c-code-architectin parallel with different focuses: minimal changes (smallest change, maximum reuse), clean architecture (maintainability, elegant abstractions), pragmatic balance (speed + quality) - Review all approaches and form an opinion on which is better suited for this task (considering: a small fix versus a large enhancement, urgency, complexity, team context)
- Present to the user: a brief summary of each approach, a comparison of trade-offs, your recommendation with justification, specific implementation differences
- Ask the user which approach they prefer
- After the user chooses, create the file
.tasks/task-[feature-name]/plan.mdwith a complete implementation plan including:- Problem statement
- Selected architectural approach with justification
- Patterns and conventions found from Phase 2
- Answers to clarifying questions from Phase 3
- Specific metadata objects to create/modify
- Mermaid diagrams
- Implementation sequence
- The plan must be complete so that a person or llm without the conversation context can fully understand the task and the solution
Phase 5: Implementation
Goal: build the enhancement
DO NOT START WITHOUT USER APPROVAL, THE USER MUST EXPLICITLY APPROVE THE PLAN WRITTEN TO THE FILE
Actions:
- Wait for explicit user approval
- Read the plan file
.tasks/task-[feature-name]/plan.md, created in Phase 4 - Launch agent
1c-code-writerto implement the enhancement. Pass it:- Path to the plan file
.tasks/task-[feature-name]/plan.md - Instruction to read the plan and follow it
- Path to the plan file
- Agent
1c-code-writerwill read the plan, read1c-rules.mdand implement the code - Update the tasks in the plan as progress is made
Phase 6: Quality check
Goal: make sure the code is simple, DRY, elegant, readable, and functionally correct
Actions:
- MANDATORY launch 3 agents
1c-code-reviewerin parallel with different focuses: simplicity/DRY/elegance, bugs/functional correctness, project conventions/abstractions - Consolidate their responses and identify the highest-severity issues that you recommend fixing
- Present the identified issues to the user and ask what they want to do (fix now, fix later, or continue as is)
- If the user chose "fix now":
- Add the identified issues to the plan file
.tasks/task-[feature-name]/plan.mdin the "Found issues: fix now" section - Launch an agent
1c-code-writer, passing it:- The path to the plan file
- An instruction to fix only the issues from the "fix now" section
- After the agent finishes return to the beginning of Phase 6 (re-check)
- Repeat the iterations until
1c-code-reviewerstops finding critical issues
- Add the identified issues to the plan file
- If the user chose "fix later":
- Add the identified issues to the plan file
.tasks/task-[feature-name]/plan.mdin the "Found issues: fix later" section - Mark in the plan that these issues are deferred
- Proceed to Phase 7
- Add the identified issues to the plan file
- If the user chose "continue as is" — proceed to Phase 7 without changes to the plan
Phase 7: Summary
Goal: document what was accomplished
Actions:
- Mark all tasks as completed
- Summarize:
- What was built
- Key decisions made
- Files changed
- Suggested next steps