Initialize PWDEV Flow
Read workflow, artifacts, migration, and safety before changing project state.
Procedure
- Inspect the repository without reading secrets:
- locate
AGENTS.md and read applicable instructions;
- treat
CLAUDE.md as optional compatibility context when present;
- inspect manifests, source layout, tests, and recent Git history;
- never open
.env, credentials, tokens, private keys, or certificates.
- Check for
.planning/flow/config.json, .planning/flow/state.md, and the legacy .planning/config.json.
- Route the request as
inspect, initialize, or migrate:
- if Flow state exists, do not overwrite it; summarize the active workflow, last gate, artifacts, and next valid action;
- if legacy config exists and Flow config does not, report a migration candidate instead of initializing over it;
- use
migrate only when the user asks to adopt the legacy workspace.
- For
migrate:
- resolve migrate_legacy.py from this installed plugin and run
plan with the active repository root;
- present mappings, excluded field names, and conflicts without exposing excluded values;
- stop for explicit approval before
apply;
- after approval, run
apply, create missing Flow state/directories without overwriting existing paths, and inventory legacy artifacts in .planning/flow/migration.md;
- do not copy or move legacy artifacts without a second approval for exact paths;
- record
migrated through the audit helper only when the migrated config enables audit.
- If state does not exist and the user requested fresh initialization:
- classify the repository as
greenfield or brownfield from existing source and history;
- create
.planning/flow/quick/ and .planning/flow/reports/;
- create configuration and state using the exact schemas in artifacts;
- set the artifact language from the user's current language unless explicitly configured otherwise;
- set
auto_commit to false.
- Report created, migrated, or discovered paths and recommend one next action.
Constraints
- Preserve existing configuration fields that this version does not recognize.
- Preserve
.planning/config.json byte-for-byte during migration.
- Do not add project dependencies, hooks, branches, commits, or remote configuration.
- Do not create or rewrite
AGENTS.md unless the user separately requests it.
- Keep all initialization writes under
.planning/flow/.
Output
Return MODE, STATUS, repository classification, state path, configuration path, MIGRATION when applicable, and NEXT. Link every real local artifact with an absolute path in the final response.
1---2name: flow-init3description: Initialize, inspect, resume, or migrate portable PWDEV Flow project state. Use when the user asks to set up PWDEV Flow, adopt an existing repository or legacy PWDEV Code workspace, resume its workflow, or diagnose its current state.4metadata:5 source: https://skillmd.com/skills/pwdev-solucoes/flow-init6---78# Initialize PWDEV Flow910Read [workflow](../../references/workflow.md), [artifacts](../../references/artifacts.md), [migration](../../references/migration.md), and [safety](../../references/safety.md) before changing project state.1112## Procedure13141. Inspect the repository without reading secrets:15 - locate `AGENTS.md` and read applicable instructions;16 - treat `CLAUDE.md` as optional compatibility context when present;17 - inspect manifests, source layout, tests, and recent Git history;18 - never open `.env`, credentials, tokens, private keys, or certificates.192. Check for `.planning/flow/config.json`, `.planning/flow/state.md`, and the legacy `.planning/config.json`.203. Route the request as `inspect`, `initialize`, or `migrate`:21 - if Flow state exists, do not overwrite it; summarize the active workflow, last gate, artifacts, and next valid action;22 - if legacy config exists and Flow config does not, report a migration candidate instead of initializing over it;23 - use `migrate` only when the user asks to adopt the legacy workspace.244. For `migrate`:25 - resolve [migrate_legacy.py](../../scripts/migrate_legacy.py) from this installed plugin and run `plan` with the active repository root;26 - present mappings, excluded field names, and conflicts without exposing excluded values;27 - stop for explicit approval before `apply`;28 - after approval, run `apply`, create missing Flow state/directories without overwriting existing paths, and inventory legacy artifacts in `.planning/flow/migration.md`;29 - do not copy or move legacy artifacts without a second approval for exact paths;30 - record `migrated` through the audit helper only when the migrated config enables audit.315. If state does not exist and the user requested fresh initialization:32 - classify the repository as `greenfield` or `brownfield` from existing source and history;33 - create `.planning/flow/quick/` and `.planning/flow/reports/`;34 - create configuration and state using the exact schemas in [artifacts](../../references/artifacts.md);35 - set the artifact language from the user's current language unless explicitly configured otherwise;36 - set `auto_commit` to `false`.376. Report created, migrated, or discovered paths and recommend one next action.3839## Constraints4041- Preserve existing configuration fields that this version does not recognize.42- Preserve `.planning/config.json` byte-for-byte during migration.43- Do not add project dependencies, hooks, branches, commits, or remote configuration.44- Do not create or rewrite `AGENTS.md` unless the user separately requests it.45- Keep all initialization writes under `.planning/flow/`.4647## Output4849Return `MODE`, `STATUS`, repository classification, state path, configuration path, `MIGRATION` when applicable, and `NEXT`. Link every real local artifact with an absolute path in the final response.