بنقرة واحدة
init-persistence
Initializes the project-wide persistence scaffolding. Invoke with: /init-persistence
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Initializes the project-wide persistence scaffolding. Invoke with: /init-persistence
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Umbrella catalog of the project's Mermaid class-diagram conventions (domain, commands, queries, ops kinds), organized by theme. Each theme lives in a sibling folder's index.md. Load when AUTHORING, editing, or REVIEWING a diagram in this project — the docs give the canonical authoring rule and the matching review lens (what is canonical and must not be flagged).
Umbrella catalog of all rest-api-spec pattern references. Each pattern lives in a sibling folder of this file — `<pattern-name>/` containing `index.md` (the pattern doc) plus an optional `examples.md` companion. Load to resolve pattern names to their reference docs by path instead of per-pattern skill invocations.
Initializes the project-wide application-layer scaffolding (project package discovery, src/<pkg>/application/, src/<pkg>/infrastructure/, src/<pkg>/infrastructure/services/, src/tests/fakes/, and a minimal src/tests/conftest.py). Invoke with: /application-spec:init-application
Initializes the project-wide domain scaffolding (project package discovery, src/<pkg>/domain/ with shared/, src/tests/ with conftest and unit/). Aggregate-agnostic — run once per project before any @domain-spec:code-generator invocation. Invoke with: /init-domain
Initializes the project-wide messaging scaffolding (project package discovery, src/<pkg>/messaging/ as an empty aggregator package, and a canonical Click __main__.py skeleton). Invoke with: /messaging-spec:init-messaging
Initializes the project-wide REST API scaffolding. Invoke with: /rest-api-spec:init-rest-api
| name | init-persistence |
| description | Initializes the project-wide persistence scaffolding. Invoke with: /init-persistence |
You are the project-wide persistence initializer. Ensure that the current repository has the minimum directory structure required for any subsequent @persistence-spec:code-generator (or /persistence-spec:generate-persistence) run:
infrastructure/, infrastructure/repositories/, and infrastructure/repositories/tables/ Python packages,infrastructure/unit_of_work/ and infrastructure/query_context/ packages copied from the spec-core:modules umbrella (with containers.py providers wired),extras/database_session/ package copied from the spec-core:modules umbrella and re-exported through extras/__init__.py,etc/migrator/migrations/ with an empty Liquibase master.yaml stub,tests/ and tests/integration/ test packages with empty conftest.py files (plus the query_context integration fixture).This skill performs no aggregate-specific work — per-aggregate sub-packages, tables, mappers, migrations, and repositories are still owned by the per-aggregate scaffolders.
None. The skill operates entirely on the current working directory.
This skill is silent on success. Print nothing — not even a closing confirmation — when every step succeeds, whether the work happened, was partial, or was already done. Print only on failure: a single ERROR: ... line naming the failure, then stop. Do not summarize, do not emit progress text, do not echo sub-agent confirmation lines.
Invoke @spec-core:project-package-finder with prompt /init-persistence. Wait for completion. If it returns a line beginning ERROR:, surface that line verbatim and stop.
Otherwise parse its report table and bind <repo> = the Repo value, <src> = the Src value, and <pkg> = the Package value.
Bind:
<pkg_dir> = <src>/<pkg><containers_file> = <pkg_dir>/containers.py<tests_dir> = <src>/tests<infra_dir> = <pkg_dir>/infrastructure<repos_dir> = <infra_dir>/repositories<tables_dir> = <repos_dir>/tables<migrations_dir> = <repo>/etc/migrator/migrations<master_yaml> = <migrations_dir>/master.yamlCheck whether <containers_file> exists:
[ -f "<containers_file>" ]
If it does not exist, emit:
ERROR: containers.py not found at <containers_file>. /init-persistence requires the project's containers.py to be in place before wiring unit_of_work and query_context providers.
and stop. Do not create the file. Do not proceed to any further step.
Invoke spec-core:target-locations-finder with the prompt persistence. Wait for completion and capture its Markdown table output as <locations_report>.
If the agent reports any error, surface it as a single ERROR: ... line and stop.
Run sequentially via Bash. For each of the three directories, create the directory and an empty __init__.py if they do not already exist:
mkdir -p <infra_dir> && [ -f <infra_dir>/__init__.py ] || touch <infra_dir>/__init__.py
mkdir -p <repos_dir> && [ -f <repos_dir>/__init__.py ] || touch <repos_dir>/__init__.py
mkdir -p <tables_dir> && [ -f <tables_dir>/__init__.py ] || touch <tables_dir>/__init__.py
Never overwrite an existing __init__.py.
Run:
mkdir -p <migrations_dir>
Then check whether <master_yaml> already exists:
[ -f "<master_yaml>" ]
If it does not exist, write the file with exactly this content (a minimal valid Liquibase changelog):
databaseChangeLog: []
If it already exists, do not modify it.
Invoke persistence-spec:database-session-scaffolder with prompt <locations_report>. Wait for completion.
If the agent reports any error, surface it as a single ERROR: ... line and stop. Do not print the agent's success confirmation lines.
Ensure <tests_dir> exists as a Python package containing a conftest.py, an integration sub-package, and an integration/conftest.py. Each created file is empty — fixture content is added by downstream agents. This is idempotent: create every missing level, never overwrite an existing file.
Run sequentially via Bash:
mkdir -p <tests_dir> && [ -f <tests_dir>/__init__.py ] || touch <tests_dir>/__init__.py
[ -f <tests_dir>/conftest.py ] || touch <tests_dir>/conftest.py
mkdir -p <tests_dir>/integration && [ -f <tests_dir>/integration/__init__.py ] || touch <tests_dir>/integration/__init__.py
[ -f <tests_dir>/integration/conftest.py ] || touch <tests_dir>/integration/conftest.py
Never overwrite an existing file. If any command fails, surface it as a single ERROR: ... line and stop.
Invoke persistence-spec:context-package-scaffolder with prompt unit_of_work <locations_report>. Wait for completion.
If the agent reports any error, surface it as a single ERROR: ... line and stop.
Invoke persistence-spec:context-package-scaffolder with prompt query_context <locations_report>. Wait for completion.
This MUST run after Step 8 and after Step 7: the query_context axis derives its install directory as the sibling of the unit_of_work/ package, asserts that leaf is exactly unit_of_work, and anchors its query_context conftest fixture immediately after the def unit_of_work( fixture in <tests_dir>/integration/conftest.py. Never invoke this before Step 8, and never combine the two invocations into one call.
If the agent reports any error, surface it as a single ERROR: ... line and stop.
Emit no output. Silent success.