| name | init-workspace-flow |
| description | Workflow for initializing or upgrading a workspace: context, discovery, documentation, etc. |
| tags | ["workflow"] |
| baseSchema | docs/schemas/workflow.md |
<init_workspace_flow>
<description_and_purpose>
Problem: Workspace initialization is multi-phase, order-dependent, and must handle install/upgrade/plugin modes without overwriting human content.
Validation: State file tracks every phase with file inventory; verification confirms all files exist.
</description_and_purpose>
<workflow_phases>
<prerequisites phase="0", applies="ALL">
- All Rosetta prep steps MUST be FULLY completed
- MUST ALWAYS use todo tasks ledger, ASAP. Phases are sequential. Independent tasks can run in parallel.
- MUST FOLLOW THIS WORKFLOW EXACTLY AND FULLY.
- MUST extensively use subagents as this is a large workflow.
- Each phase updates
agents/init-workspace-flow-state.md. Optional phases marked as skipped. Keep state file very brief.
- No rush, Take your time, Be thorough, ACCURACY > SPEED
- Dual-mode: every phase reads
state.mode → check-exists → identify-gaps → create/update → preserve-human-content → report-changes.
- Composite workspace: documentation phases to create top-level index referencing sub-repository docs.
- IF state.file_count >= 100 (set by Phase 3): pass "USE SKILL
large-workspace-handling" to Phase 5, 7, 8 subagents.
- Create
agents/init-workspace-flow-state.md.
- Conditional phases:
- If you have already in context "RUNNING AS A PLUGIN": MUST NOT EXECUTE "shells" phase 2
- Else MUST EXECUTE "shells" phase 2
- Note:
rosetta@rosetta is an MCP connector, not a plugin — it follows the normal path (shells phase 2 executes)
- If user says to initialize rules, subagents, agents, workflows, commands it ONLY means to execute "shells" phase 2.
- Upgrade from R2 to R3 is exactly the same process as define here, but you already have some files available, which you can reuse.
- Additionally tell subagents: "If you want to use shell commands, prefer to combine individual shell commands into single simple shell script and execute it, but already available tools ALWAYS take precedence."
- When subagents already available, you are orchestrator and senior team lead and effective manager. Orchestrator makes process poka-yoke and reliable itself, provides clear context and instructions, uses subagents as his team, tells WHAT to do and HOW to think, does not work on tasks for subagents itself nor provides mechanical tasks nor paraphrases instructions, but appends context, ensures subagents provide grounded information, provides already known references to files, instructions, phases, steps, skills, keep agents focused. Prompt subagents to report honestly, concise, terse, and we exact links to files it created/modified.
- Remember: subagents always start with fresh context on every run. User can not see orchestrator and subagent communication.
- Subagent prompt must be concise, terse, factual, specific, DRY, grounded, etc.
- ENFORCE provided required subagent models and effort levels.
- Detect mode: install, upgrade, or plugin. Set state.mode, state.plugin_active, state.composite, state.existing_files. Creates/reads gain.json. GAIN.json questions keep for questions phase.
- APPLY SKILL FILE
phases/init-workspace-flow-context.md
- Update state
- Generate shell files for skills, agents, workflows. Skip if state.plugin_active.
- Input: IDEs, Output: shell configs, bootstrap rule, load-project-context skill shell.
- APPLY SKILL FILE
phases/init-workspace-flow-shells.md
- Update state
- Analyze workspace tech stack, structure, source code file count.
- Output: TECHSTACK.md, CODEMAP.md, DEPENDENCIES.md, state.file_count.
- APPLY SKILL FILE
phases/init-workspace-flow-discovery.md
- Update state
DISABLED
- Extract coding and architectural patterns into reusable templates.
- Output: PATTERNS folder (one .md per pattern, INDEX.md, CHANGES.md).
- APPLY SKILL FILE
phases/init-workspace-flow-patterns.md
- Update state. Log gaps for Phase 8.
- Suggest user to install LSPs xor code graphs if relevant
- Output: user selection, updates to CONTEXT.md
- APPLY SKILL FILE
phases/init-workspace-flow-codegraph.md
- Update state. Log gaps for Phase 6.
- Create project documentation from workspace analysis.
- Output: CONTEXT.md, ARCHITECTURE.md, IMPLEMENTATION.md, ASSUMPTIONS.md, AGENT MEMORY.md.
- APPLY SKILL FILE
phases/init-workspace-flow-documentation.md
- Update state. Log gaps for Phase 8.
- Review all docs, identify gaps, ask user reflective questions, update affected files via subagents.
- APPLY SKILL FILE
phases/init-workspace-flow-questions.md
- Update state
- Required: USE SKILL
questioning
- Verify all files exist, run validation checklist, suggest next steps.
- APPLY SKILL FILE
phases/init-workspace-flow-verification.md
- Mark state as COMPLETE.
</workflow_phases>
<next_steps>
-
DEMAND user as MUST to start new chat session (highly visible message, red icon, bold, ASCII art, it must standout).
-
DEMAND user to study (USAGE GUIDE)[https://griddynamics.github.io/rosetta/docs/usage-guide/]
-
DEMAND user to review examples for the next steps for user and EMPHASIS on "/slash-commands":
# Coding Workflow
**WHAT**: Majority of tasks are actually coding tasks, including unit tests. Just ask exactly what is required.
"/coding-flow Implement left navigation sidebar on the home page, ..."
"/coding-flow Identify and implement fix, ..."
"/coding-flow Improve unit tests coverage to 85% for ..."
# Business and Technical Requirements
**WHY**: Requirements - is the source of truth for code and tests. Going requirements first is the most effective. In brownfield start with extracting.
"/requirements-authoring-flow extract detailed business and technical requirements from community of ... using subagents. Additionally, ... . Once done spawn subagent to validate and repeat an entire loop until there are no issues detected."
"/requirements-authoring-flow extract high-level business and technical requirements at end-point level for controllers according to glob ... using subagents. Additionally, ... . Once done spawn subagent to validate and repeat an entire loop until there are no issues detected."
# Modernization
**FIRST**: Document modernization goals in CONTEXT.md, document target services technical aspects in ARCHITECTURE.md, document where source code should be created, keep refsrc populated with reference code source (old code, new code, reusable libraries, configuration and documentation files, and similar).
**NOTE**: All phases are must. All phases to be implemented one-by-one with proper review. Phase 3: Pre-Modernization Test Coverage is a must (and must include both unit and integration/e2e tests).
"/modernization-flow Perform modernization phase 1 to reuse library refsrc/... using subagents."
"/modernization-flow Perform modernization phase 2 to analyze service module ... using subagents. Target microservice name is ... ."
"/modernization-flow Perform modernization phase 8 for target service to analyze service module ... using subagents. Must USE FLOW `coding-flow.md` to actually implement and as the main flow. Once done spawn subagent to validate and repeat an entire loop until there are no issues detected."
</next_steps>
- Phase 8 must update files, not just collect answers.
- Shells and rules take effect only after new chat session.
</init_workspace_flow>