Prompt file imported from karais89/copilot-ralph-wiggum-example (
.github/prompts/rw-onboard-project.prompt.md). Copyright stays with the author.
Language policy reference: .ai/CONTEXT.md
Quick summary:
- Use this prompt for an existing, already-implemented repository.
- Scope: scaffold/repair
.aibaseline and capture a current codebase snapshot. - Do not create bootstrap feature seeds or decompose tasks.
- Default handoff is
rw-feature.
Step 0 (Mandatory):
- Read
.ai/CONTEXT.mdfirst. - If missing, create it from
.ai/templates/CONTEXT-BOOTSTRAP.mdwhen available; otherwise create a minimal bootstrap context file. - If
.ai/CONTEXT.mdexists but is unreadable, stop immediately and output exactly:LANG_POLICY_MISSING - Validate language policy internally and proceed silently (no confirmation line).
- Do not modify any file before Step 0 completes, except creating
.ai/CONTEXT.mdwhen missing.
Input:
onboardSummary(optional)
Rules:
- Do not edit product code.
- This prompt must run in a top-level Copilot Chat turn.
- If not top-level, output
TOP_LEVEL_REQUIREDand stop.
- If not top-level, output
- Keep machine tokens unchanged (
Task Status,Log,pending,Status,READY_FOR_PLAN,PLANNED). - Write user-facing prose in language resolved from
.ai/CONTEXT.md(default Korean if ambiguous). - Do not create or modify
.ai/features/*.mdin this prompt. - Do not create commits in this prompt.
- Language-agnostic detection only:
- Do not rely on natural-language keywords from README or comments.
- Use file presence, file structure, extensions, and executable command signals.
Workflow:
-
Pre-scan task baseline before scaffold:
- Count existing
TASK-*.mdfiles in.ai/tasks/asTASK_COUNT_BEFORE. - Record whether
TASK-01-bootstrap-workspace.mdexisted before scaffold.
- Count existing
-
Scaffold baseline via shared script (required):
- Run
scripts/orchestration/rw-bootstrap-scaffold.sh "<workspace-root-absolute-path>". - If script is missing or fails, stop immediately and output:
- first line exactly:
RW_SCAFFOLD_FAILED - second line:
<short reason> - third line:
Fix scaffold script/runtime and rerun rw-onboard-project.
- first line exactly:
- Run
-
Detect existing-codebase signals (language-agnostic):
- Compute these signals from repository files (excluding
.git,.ai,node_modules,dist,build,vendor,.next,coverage):MANIFEST_SIGNAL: at least one build/package manifest exists.- Examples:
package.json,pnpm-workspace.yaml,pyproject.toml,requirements.txt,go.mod,Cargo.toml,pom.xml,build.gradle,build.gradle.kts,Gemfile,composer.json,deno.json.
- Examples:
SOURCE_SIGNAL: at least 3 product-source files exist under common source roots (src,app,lib,server,backend,frontend,cmd,internal,services,packages/*/src).- Use extension-based detection only (for example:
js,ts,jsx,tsx,py,go,rs,java,kt,rb,php,cs,swift,c,cc,cpp).
- Use extension-based detection only (for example:
BUILD_OR_TEST_SIGNAL: at least one executable build/test config exists.- Examples:
Makefile,Dockerfile,docker-compose.yml,pytest.ini,tox.ini,vite.config.*,webpack.config.*,tsconfig.json.
- Examples:
README_SIGNAL:README.mdexists and is non-trivial (>= 200 characters), regardless of language.
- Set
CODEBASE_SIGNAL_COUNTto the number of true signals. - Set
CONTEXT_MODE:EXISTING_READYifSOURCE_SIGNAL=trueORCODEBASE_SIGNAL_COUNT>=2EMPTY_OR_TEMPLATEotherwise
- Compute these signals from repository files (excluding
-
If
CONTEXT_MODE=EMPTY_OR_TEMPLATE:- Keep scaffolded baseline as-is.
- Do not write existing-project snapshot content.
- Output:
ONBOARD_RESULT=blockedCONTEXT_MODE=EMPTY_OR_TEMPLATETASK01_RESULT=keptSNAPSHOT_RESULT=skippedVERIFICATION_BASELINE=noneNEXT_COMMAND=rw-new-project
- Stop.
-
Build current codebase snapshot (existing project mode):
- Gather only observable facts:
- inferred project name (directory name or manifest name)
- detected stack/runtime signals from manifests/extensions
- key top-level source/config paths
- one canonical verification baseline command when discoverable from ecosystem signals
- Node: prefer
npm run buildwhen build script exists, elsenpm test, elsenpm run test - Python:
pytest -q - Go:
go test ./... - Rust:
cargo test - Java/Gradle:
./gradlew test - Java/Maven:
mvn test - Unknown:
none
- Node: prefer
- unresolved assumptions (if any)
- If
onboardSummaryis provided, use it only as supplemental context (never override file-based facts).
- Gather only observable facts:
-
Update
PLAN.mdwith strict boundaries:- If missing, create:
- title (
# <project-name>) ## Overviewwith 3~6 concise lines from detected facts## Current Codebase Snapshot## Feature Notes (append-only)
- title (
- If existing:
- keep all existing content unchanged
- ensure
## Current Codebase Snapshotsection exists - append one dated snapshot entry under that section (do not rewrite prior entries)
- ensure
## Feature Notes (append-only)exists
- Snapshot entry must include:
- Captured At: <YYYY-MM-DD>- Codebase Signals: <short list>- Core Stack: <short list>- Key Paths: <short list>- Verification Baseline: <command|none>
- If missing, create:
-
Remove scaffold-only bootstrap task when safe:
- Re-count tasks as
TASK_COUNT_AFTER. - If all are true:
TASK_COUNT_BEFORE=0TASK_COUNT_AFTER=1- the only task file is
.ai/tasks/TASK-01-bootstrap-workspace.mdthen:- delete
.ai/tasks/TASK-01-bootstrap-workspace.md - remove
TASK-01row from.ai/PROGRESS.mdTask Status when present - append one log line in
.ai/PROGRESS.md:- **YYYY-MM-DD** — Existing-project onboarding removed bootstrap TASK-01. - set
TASK01_RESULT=removed
- delete
- Otherwise set
TASK01_RESULT=kept. - Never delete any non-bootstrap task.
- Re-count tasks as
-
Decide next command:
- set
NEXT_COMMAND=rw-feature
- set
Output format (machine-friendly, fixed keys):
ONBOARD_RESULT=<created|updated|blocked>CONTEXT_MODE=<EXISTING_READY|EMPTY_OR_TEMPLATE>CODEBASE_SIGNAL_COUNT=<n>SNAPSHOT_RESULT=<created|updated|appended|skipped>TASK01_RESULT=<removed|kept>VERIFICATION_BASELINE=<command|none>NEXT_COMMAND=<rw-feature|rw-new-project>