Full Product Factory OS lifecycle from idea or approved docs to implemented, tested, reviewed, and deployable project.
Installation
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Use this skill for full-cycle Product Factory OS project creation.
Mode Selection
Choose one mode:
fresh: no docs or code exist.
docs-ready: planning docs exist and need implementation.
resume: code exists and CODEX.md or git history shows progress.
adopted: existing project is being brought into the methodology.
Announce the selected mode and why.
Phases
Detect existing docs and code.
Load PFO runtime contracts:
routing/product-classifier.json
templates/product-templates.json
core/product-compiler.md
pipelines/execution-pipeline.json
execution/state-machine.json
deployment/deployment-targets.json
memory/session-state.schema.json
docs/rubrics/pfo.md
docs/rubrics/testing.md
docs/rubrics/strategy.md
If docs are missing, run discovery and blueprint work.
Ensure IDEA_SCORECARD.md and VALIDATION_PLAN.md exist before broad implementation scope.
Ensure Product Compiler outputs exist: PRODUCT_BLUEPRINT.md, BUILD_PLAN.md, and EXECUTION_GRAPH.md.
Use /mcp-docs when dependency, SDK, framework, or platform details may be stale.
Run /review before writing application code.
Run /handoff before switching sessions, roles, delegated agents, AFK execution, compaction, or recovery.
Before each major implementation iteration, write or update NEXT_STEP.md, show the visible roadmap, recommend one next step, list alternatives, and get user approval or changed direction.
Scaffold project structure, tooling, environment examples, and test framework.
Implement modules from BUILD_PLAN.md and EXECUTION_GRAPH.md step by step.
After each behavior change, run or create tests via /test.
For user-facing browser flows, run /browser-check before ship readiness.
Capture feedback and iteration outcomes in FEEDBACK_LOG.md and ITERATION_REVIEW.md when users or tests produce signals.
Promote reusable solutions into ASSET_REGISTER.md and CONTENT_BACKLOG.md when evidence exists.
Review significant changes with /review.
Before production work, run /security-audit, /deps-audit, and /harden.
Use /github-workflow and /tool-sync when PR, CI, release, or external roadmap sync is in scope.
Deploy only after explicit user confirmation.
Run /session-save.
Phase Details
1. Discovery And Planning
If DISCOVERY.md, IDEA_SCORECARD.md, VALIDATION_PLAN.md, PRD.md, PRODUCT_BLUEPRINT.md, PROJECT_ARCHITECTURE.md, BUILD_PLAN.md, EXECUTION_GRAPH.md, and IMPLEMENTATION_PLAN.md are absent, run the /blueprint behavior first.
If only some docs exist, supplement missing docs and preserve existing decisions.
If docs conflict, run /review and fix docs before code.
2. Implementation Gate
Implementation can start only when:
PRD.md exists.
IDEA_SCORECARD.md exists and does not say KILL for the current scope.
VALIDATION_PLAN.md exists or the project has a documented non-market/internal reason to build.
PRODUCT_BLUEPRINT.md exists.
PROJECT_ARCHITECTURE.md exists.
BUILD_PLAN.md exists.
EXECUTION_GRAPH.md exists.
IMPLEMENTATION_PLAN.md exists.
HANDOFF.md exists when implementation is transferred to another session, role, delegated agent, AFK run, or recovery pass.
NEXT_STEP.md exists and the user has approved or changed the next major implementation step.
Review status is not BLOCKED.
The user has approved the plan when the project is new.
3. Scaffold
Create the minimum viable structure implied by the architecture:
Package/project manifests
Source directories
Test directories
Lint/format/test scripts when idiomatic
.env.example
Docker or platform config only when deployment target is known
4. Step Loop
For each execution graph node or implementation step:
Close the previous iteration with: where we are, what changed, verification, blockers, and what remains.
Show the visible roadmap from EXECUTION_GRAPH.md in user-facing language.
Recommend exactly one next step, plus 2-3 alternatives.
Ask the user to confirm, change, or stop before major implementation starts.
Record the decision in NEXT_STEP.md and .codex-memory/STATE.json.
Restate the approved step and intended files.
Make the smallest coherent change.
Add or update tests.
Run the narrowest relevant verification.
Fix failures before continuing.
Update CODEX.md status.
Update .codex-memory/STATE.json when the milestone changes.
5. Ship Gate
Before deploy:
/review is not BLOCKED.
/security-audit has no Critical findings.
/deps-audit has no Critical findings or accepted risk.
/harden has no Critical production gaps.
/browser-check has no blocking user-facing failures when a browser UI exists.
EXECUTION_GRAPH.md has reached READY_FOR_DEPLOY.
User explicitly confirms target environment.
Self-validation
Before final output, verify:
Route, side-effect, and confirmation requirements match metadata.
Required artifacts or read-only result are explicit.
Verification, blockers, visible roadmap, recommended next step, alternatives, and required user decision are stated.
Rules
Prefer the repository's existing patterns if any code exists.
Commit or summarize work at meaningful step boundaries when git is available.
Do not skip tests for user-facing behavior.
Do not deploy or migrate production data without explicit confirmation.
Keep CODEX.md status updated as steps complete.
Keep .codex-memory/STATE.json aligned with the state machine.
Do not start a major implementation step without NEXT_STEP.md and recorded next-step approval.
Do not expose internal state-machine jargon as the primary user instruction; translate it into product-owner language.
Do not expand from a TEST idea into a full BUILD scope without validation evidence.
Do not treat meetings, commits, or generated docs as progress unless a gate, signal, decision, or reusable asset changes.
Never continue past a BLOCKED gate unless the user explicitly changes the requirement or accepts a documented non-production limitation.
Preserve unrelated user changes in the worktree.
If dependency installation or network access fails, report it and keep working with local verification where possible.
Failure Handling
Build fails: fix before the next implementation step.
Tests fail: diagnose whether test or code is wrong, then fix.
Review blocked: stop and address Critical findings.
Deployment fails: stop, report health check output, and provide rollback steps.
State transition invalid: stop, repair missing artifact or failed gate, then resume from the previous valid state.
Ambiguous product decision: ask once, then record a conservative assumption if the user delegates.
Done Criteria
Project runs locally.
Tests pass or known gaps are documented.
Review status is not BLOCKED.
README explains setup and deployment.
Product Factory OS state is saved in .codex-memory/STATE.json.
NEXT_STEP.md explains the visible roadmap, recommended next step, alternatives, and decision needed.
QUALITY_GATES.md or equivalent state gate results are updated.