Project Initialization
Use this Skill for project-level initialization. The system-level AGENTS.md is global policy; do not copy it into every project. A project AGENTS.md is optional and may contain only project-specific additions.
Required references
Read all five references before changing a workspace:
references/project-structure.mdreferences/source-layout.mdreferences/module-rule-contract.mdreferences/initialization-acceptance.mdreferences/document-controller-registry.md
When a code module is enabled, also copy and tailor assets/source-layout.manifest.json to .codex/harness/source-layout.json. This manifest is the project-specific machine contract used by the Stop integrity checker; the detailed directory responsibilities remain in this Skill, not in the system-level AGENTS.md.
Workflow
- Resolve the actual project root and inspect existing rules, records, repositories, local changes, and reusable assets.
- Determine whether initialization, repair, or no action is needed. Preserve newer user files and never replace an established layout without recording the migration decision.
- When
$CODEX_HOME/harness/current.jsonexists, runscripts/install-harness-assets.ps1 -Root <project-root>before document initialization. It installs only missing project-level Hooks, Harness assets, and approved on-demand diagnostics from the versioned project template. Existing conflicting files and version-declared retired assets are reported and preserved; use-Repaironly after user approval, and require the script to back up every conflicting or retired file before replacement/removal. Diagnostics undertools/diagnostics/are manual tools and must never be registered as production Hooks. - Load
.codex/harness/document-controllers.json; select only the artifacts required by the project goal, stage, and enabled modules. Invoke the registered atomicdoc-*controller for every selected Markdown artifact. Every document must preserve the human ledger fields defined inreferences/document-controller-registry.md. - Always create project-root
MEMORY.md,SHORT_MEMORY.md, andLONG_MEMORY.mdthrough their controllers, register all three inROUTER.md, and keep them in the project Git repository. Install the Memory policy, index, Hook scripts, transaction folders, and transient-lock ignores; never redirect these files to$CODEX_HOME. - Clarify the project goal, user-visible result, delivery stage, enabled modules, deferred modules, acceptance criteria, and repository boundaries.
- Select a source layout from
references/source-layout.md; create only enabled module directories. Record every enabled or existing governed directory in.codex/harness/source-layout.json, with a non-empty responsibility. - For every enabled module, create or repair its local rule using
references/module-rule-contract.md. - Check the storage boundary, Git,
.gitignore,.env.example, and sensitive-file exclusions. If a durable project is under the Windows system drive, record the risk and prepare a user-approved move or non-system-drive root before Git initialization; never move it silently. Do not create nested Git repositories without an approved decision. - Create and maintain
产品管理/clarification.mdthroughdoc-clarification;requirement-clarificationperforms semantic clarification and the ledger records time, user request, called Skills, current state, output routes, result, and next step. - Create
流程管理/历史记录库/INDEX.mdand the approved retention policy. Automatic migration is enabled only after the installed production Hooks pass fixture and project initialization acceptance; activity ledgers keep open records and history remains cold. - When knowledge management is enabled, create
知识管理/KnowledgeRouter.md,LLM-Wiki使用与运维.md, and研发中台使用与同步.md; keep<RND_HUB_ROOT>and LLM Wiki identity as explicit placeholders until configured. - Register paths in
ROUTER.mdthroughdoc-router. Router stores path, purpose, responsible Skill, status, and last check only; a missing hub mount may remain a labelled placeholder. - Set
sourceLayoutRequired: truein.codex/harness/index.jsonwhen a code module is enabled. Install the query-bound Plan disclosure runtime, empty disclosure state, schema, and E2E fixture from the approved production package; never seed a new project by scanning existingawaiting_reviewPlans. Run source-layout, document-controller, lifecycle, Memory, history, and Plan-disclosure integrity checkers plus every check inreferences/initialization-acceptance.md. - Report the initialized result, selected documents/controllers, enabled modules, deferred scope, validation evidence, and remaining decisions in product language.
Boundaries
- Do not create all possible engineering modules by default.
- Do not require project-level
AGENTS.mdorCLAUDE.mdmirrors unless that project explicitly adopts them. - Do not duplicate
ARCHITECTURE.md; rootARCHITECTURE.mdis the project architecture single source of truth and code-management records only link to it. - Do not treat directory creation as initialization completion.
- Do not put the lifecycle state machine, templates, or workflow instructions into
ROUTER.md; keep governance logic in Skills, schemas, and scripts while Markdown keeps human-readable evidence. - Do not change the system-level harness without user approval; use only the approved version recorded in
$CODEX_HOME/harness/current.json. - Do not ignore or relocate project-root Memory files; only lock files and unfinished temporary transactions are transient.


