一键导入
oat-project-import-plan
Use when you have an external markdown plan to execute with OAT. Preserves the source plan and normalizes it into canonical plan.md format.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when you have an external markdown plan to execute with OAT. Preserves the source plan and normalizes it into canonical plan.md format.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when prioritizing the file-backed repo backlog or evaluating roadmap alignment. Produces value-effort ratings, dependency mapping, and execution recommendations.
Use when repo reference artifacts need updating — roadmap, decision records, backlog status, or completed history. Frequently invoked at project completion, often chained from `oat-project-document`, to ensure active `.oat/repo/pjm/` state and durable `.oat/repo/reference/` records reflect what shipped.
Use when plan.md is ready for execution. Dispatches phase-level subagents with bounded fix loops; supports plan-declared parallel phase groups with worktree-isolated execution and ordered fan-in.
Use when design.md is complete and executable implementation tasks are needed. Breaks design into bite-sized TDD tasks in canonical plan.md format.
Use when authoring or mutating plan.md in any OAT workflow. Defines canonical format invariants — stable task IDs, required sections, review table rules, and resume guardrails.
Use when a task is small enough for quick mode or rapid iteration is preferred. Scaffolds a lightweight OAT project from discovery directly to a runnable plan, with optional brainstorming and lightweight design.
| name | oat-project-import-plan |
| version | 1.4.2 |
| description | Use when you have an external markdown plan to execute with OAT. Preserves the source plan and normalizes it into canonical plan.md format. |
| argument-hint | <path-to-plan.md> [--provider codex|cursor|claude] [--project <name>] |
| oat_gateable | true |
| disable-model-invocation | true |
| user-invocable | true |
| allowed-tools | Read, Write, Bash, Glob, Grep, AskUserQuestion |
Import a markdown plan from an external coding provider and normalize it into OAT project artifacts.
OAT MODE: Plan Import
Purpose: Preserve the original plan and generate a runnable canonical plan.md for OAT execution.
BLOCKED Activities:
ALLOWED Activities:
Self-Correction Protocol: If you catch yourself:
pNN-tNN tasks.Recovery:
references/imported-plan.md.plan.md in OAT structure.When executing this skill, provide lightweight progress feedback so the user can tell what’s happening after they confirm.
Print a phase banner once at start using horizontal separators, e.g.:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ OAT ▸ IMPORT PLAN ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Before multi-step work, print step indicators, e.g.:
[0/8] Checking inherited git state...[1/8] Resolving project + source plan…[2/8] Preserving imported source…[3/8] Normalizing plan to OAT task structure…[4/8] Updating plan metadata…[5/8] Running import-aware plan review…[6/8] Updating project state + dashboard…[7/8] Ensuring implementation tracker + committing…[8/8] Running configured gate…Before scaffolding, surface the working tree state so unrelated changes don't get carried into the project workflow's bookkeeping commits.
git status --porcelain. If empty, continue silently to the next step..oat/sync/manifest.json or paths under .claude/, .cursor/, .codex/ appear in the list, note: "These are generated by oat sync (often by pnpm run worktree:init or oat-worktree-bootstrap-auto) and are typically safe to commit as chore: run sync."AskUserQuestion:
chore: run sync; otherwise ask the user for the commit message.Tool availability is not the same as interactivity. If
AskUserQuestionis unavailable but chat is available, present the three choices as a plain chat message and wait for the user's reply. Only fall back to "Proceed anyway" whenOAT_NON_INTERACTIVE=1is set or there is no user-response channel at all.
Do not advance past this gate without an explicit choice.
PROJECT_PATH=$(oat config get activeProject 2>/dev/null || true)
PROJECTS_ROOT="${OAT_PROJECTS_ROOT:-$(oat config get projects.root 2>/dev/null || echo ".oat/projects/shared")}"
PROJECTS_ROOT="${PROJECTS_ROOT%/}"
If no valid active project exists:
--project if provided, else ask user.TARGET_PROJECT_PATH="${PROJECTS_ROOT}/{project-name}".TARGET_PROJECT_PATH/state.md exists, set:
oat config set activeProject "$TARGET_PROJECT_PATH"
PROJECT_PATH="$TARGET_PROJECT_PATH"
oat project new "{project-name}" --mode import
PROJECT_PATH="$TARGET_PROJECT_PATH"
Inputs:
$ARGUMENTS--providerIf source path is not provided, discover likely recent plans first. The discovery script checks both provider plan directories and this repository's external plan directory by default:
.oat/repo/reference/external-plans/ — the durable destination for imported provider/external plans, as documented in the repo reference guide (.oat/repo/reference/AGENTS.md). External plans are durable reference material and stay under reference/, never under the active pjm/ operational layer.bash .agents/skills/oat-project-import-plan/scripts/find-recent-provider-plans.sh --hours 24
Optional: extend discovery roots via OAT_PROVIDER_PLAN_DIRS (colon-separated):
export OAT_PROVIDER_PLAN_DIRS="$HOME/custom-plans:$HOME/tmp/provider-plans"
Then ask user to either:
Validation rules:
.md (or user explicitly confirms nonstandard markdown extension).Create references directory if missing:
mkdir -p "$PROJECT_PATH/references"
cp "{source-path}" "$PROJECT_PATH/references/imported-plan.md"
Never overwrite an existing source snapshot without user confirmation. If already present, write timestamped copy:
references/imported-plan-YYYY-MM-DD-HHMM.mdCreate/update "$PROJECT_PATH/plan.md" using .oat/templates/plan.md and map imported content into the canonical structure. Apply oat-project-plan-writing invariants after mapping:
## Phase N### Task pNN-tNN (stable task IDs)## Reviews, ## Implementation Complete, ## ReferencesNormalization rules:
oat-project-plan-writing format (pNN-tNN).Dispatch Profile import handling:
## Dispatch Profile rows as user-authored constraints or preferences.Set frontmatter in "$PROJECT_PATH/plan.md":
oat_status: completeoat_ready_for: null (Step 4.5 sets this after the import-aware plan review)oat_phase: planoat_phase_status: completeoat_plan_source: importedoat_import_reference: references/imported-plan.mdoat_import_source_path: {source-path}oat_import_provider: {codex|cursor|claude|null}Invoke the shared Auto Artifact-Review Loop from oat-project-plan-writing with target plan before advancing project state or handing off to implementation.
Required payload:
target: plantype: artifactscope: planartifact_path: "$PROJECT_PATH/plan.md"oat_output_mode: structuredimport_aware: truereview_note: "Review for canonical OAT plan conformance, executable completeness, stable task IDs, required sections, review-row preservation, and verification clarity. Preserve the imported source's intent and ordering; do not rewrite the author's plan goals or product decisions unless required for OAT conformance or completeness."Apply the shared loop exactly:
workflow.autoArtifactReview.plan; only an explicit false skips the loop.oat_orchestration_retry_limit from project state, defaulting to 2.oat-reviewer in structured mode using Tier 1 subagent when available and Tier 2 inline fallback otherwise.plan artifact row in the ## Reviews table to passed when clean. If residual findings remain, preserve the row and surface the residual findings before downstream handoff.After the loop completes or is explicitly skipped, set "$PROJECT_PATH/plan.md" frontmatter:
oat_ready_for: oat-project-implementSet "$PROJECT_PATH/state.md" frontmatter:
oat_workflow_mode: importoat_workflow_origin: importedoat_phase: planoat_phase_status: completeoat_current_task: nulloat_project_state_updated: "{ISO 8601 UTC timestamp, e.g. 2026-03-10T14:30:00Z}"Import mode must leave the imported project as active for immediate execution.
Validate target project before writing pointer:
if [[ ! -f "$PROJECT_PATH/state.md" ]]; then
echo "Error: Project missing state.md: $PROJECT_PATH/state.md" >&2
exit 1
fi
oat config set activeProject "$PROJECT_PATH"
oat state refresh
If activeProject in local config already exists with a different path, treat this as a project switch and note it in output.
If missing, scaffold from template:
.oat/templates/implementation.md → "$PROJECT_PATH/implementation.md"Initialize pointer to first plan task ID.
After the import-aware plan artifact review, project state sync, dashboard refresh, and implementation tracker setup, stage and commit the changed import artifacts before handing off to implementation or stopping.
git add "$PROJECT_PATH/references/"
for path in \
"$PROJECT_PATH/plan.md" \
"$PROJECT_PATH/implementation.md" \
"$PROJECT_PATH/state.md"; do
[ -e "$path" ] && git add "$path"
done
git diff --cached --quiet || git commit -m "chore(oat): update imported plan artifacts for {project-name}"
Before reporting this skill as complete, run the configured gate as the final step after artifact review, state sync, dashboard refresh, and the import artifact commit:
Resolve the gate for this skill:
oat gate resolve <this-skill> --json
If the command returns JSON null, no gate is configured; the skill is complete.
If a gate config is returned, run its command exactly as configured. Capture stdout, stderr, and the exit code. A zero exit code means the gate passed and the skill is complete.
Review-artifact handoff:
oat-project-review-receive to receive and disposition that artifact before treating the review as consumed.oat gate review ... outputs regardless of whether the gate ultimately exits zero or nonzero; the command output owns the exact artifact path, and receive-review owns disposition and archival.If the command exits nonzero, use description to orient the next steps and handle onFailure:
block: read gate feedback, remediate, and re-run the gate up to maxAttempts attempts (default 2). If attempts are exhausted, escalate to the human with accumulated feedback and append that feedback to implementation.md. Treat a launch failure, missing CLI, or no eligible runtime as escalation-biased and do not spend it as a remediation attempt.prompt: surface the gate failure and ask the human how to proceed.warn: record the gate failure and continue.Runtime selection note (V1): the step runs the gate command as-is and reads no OAT runtime env var. By default, oat gate review and oat gate cross-provider-exec resolve the current host from built-in hostDetectionCommands and avoid the same runtime when no exact target is supplied. Reusable lifecycle skill-gate commands should normally omit --target <id> so independent review stays provider-neutral. Use explicit targets only for manual/debug commands or deliberate local/user-specific overrides; do not hardcode provider/model targets in bundled skill guidance or shared lifecycle gate examples.
Report:
oat-project-implement (sequential by default; parallel when oat_plan_parallel_groups is declared)references/imported-plan.md.plan.md generated with OAT task structure.plan.md metadata marks oat_plan_source: imported.plan.md records the import-aware plan artifact review row unless workflow.autoArtifactReview.plan was explicitly disabled.state.md marks oat_workflow_mode: import.implementation.md is present and resumable.oat_plan_hill_phases left unset in frontmatter (deferred to oat-project-implement Step 2.5).## Planning Checklist items left unchecked (HiLL configuration deferred to implementation).activeProject in .oat/config.local.json points to the imported project..oat/state.md has been refreshed locally after pointer update; it is not staged or committed.oat-project-review-receive before it is treated as consumed.