DeepWorkPlan — Onboard
Turn the target repository into an AI-first autopilot repo: a codebase
whose AGENTS.md, docs/, per-module docs, .agents/, .claude → .agents and
.cursor → .agents symlinks, and gitignored .dwp/ give any AI agent (Claude Code, Cursor, OpenAI
Codex, Gemini, Copilot, Cline, Windsurf, OpenClaw) enough structured context to
work reliably without per-session human hand-holding.
The one rule that overrides everything: REASON, do not copy-paste
This flow is not a template copier and not a scaffolder. Its entire
value is that you inspect the actual target repo — its real languages,
frameworks, package manager, build/test/lint commands, folder layout, test
convention, deployment shape — and then generate artifacts adapted to that
repo. The shape of the output is fixed (the ~90%: AGENTS.md, the docs/
categories, per-module docs, .agents/, the symlinks, .dwp/); the content
is reasoned per repo (the ~10%: validation commands, paths, stack-specific
skills, example plans).
An empty doc, a generic stub, a placeholder command, or a doc copied
verbatim from this skill or another repo is a FAILURE. Never write
<your test command here>. Never write npm test unless you confirmed the
repo uses npm and has a test script. Find the real command and write it.
If you cannot determine a real value, ask the developer — do not guess and do
not leave a placeholder.
Shared resources — READ THESE FIRST
../shared/context.sh — resolve the target repo root,
branch, agent tool, and the .dwp/ output location (dwp_dir). Run it; do
not reinvent detection.
../shared/adaptation.md — the
reasoning-over-copy-paste principle and the two archetypes. This sub-skill is
its deep elaboration.
../shared/dwp-paths.md — the .dwp/ output
convention you scaffold in Phase 7.
presets/README.md — the per-stack reasoning guides
spanning backend/API (Django, FastAPI, Rails, Spring Boot, Laravel, NestJS),
frontend (Vue/Vite, Next.js, SvelteKit, Nuxt, Angular, Astro/Svelte), mobile
(React Native, Flutter, Swift/iOS), and systems/infra (Go, Rust, Terraform,
TypeScript Lambda, Node/TS service, Python package/CLI), plus a generic
fallback and the orchestrator-hub note. See presets/README.md for the full
index. Read the matching preset in Phase 1 and use it in Phases 3–6.
Presets are reasoning aids, not templates.
../guide/GUIDE.md — the DWP methodology you reference
when wiring the skill and (for hubs) the orchestrator/child-DWP capability.
templates/onboarding-plan.md — the
reasoning aid for the plan-driven path (Phase 2b): the shape of a "finish
onboarding myself" Deep Work Plan a large repo emits instead of generating
everything inline. A template to reason from, never to copy verbatim.
Ship purity: every path this flow references is relative inside
skills/deepworkplan/ (../shared/*, presets/*, ../guide/GUIDE.md,
../addons/*). Never reference any absolute host path or any
.agent_commands/... path. The output you write lives in the target repo,
at paths relative to its root.
The generated outcome (what success looks like in the target repo)
When this flow finishes, the target repo contains:
AGENTS.md — index + mandatory rules + a Quick Commands block with the
repo's real, runnable commands; plus CLAUDE.md → AGENTS.md.
docs/ — the standard categories, each filled with real
repo-specific content (real commands, real module names, real test pattern):
PRODUCT_SPEC.md (the non-technical product/why doc — required for every
repo, libraries included), ARCHITECTURE.md, STANDARDS.md,
TESTING_GUIDE.md, DEVELOPMENT_COMMANDS.md, SECURITY.md, PERFORMANCE.md,
AI_AGENT_ONBOARDING.md, AI_AGENT_COLLAB.md, optional
PR_REVIEW_WORKFLOW.md / ECOSYSTEM_CONTEXT.md, and a docs/README.md
index.
- Per-module nested docs — a
README.md (and a docs/ subfolder for
complex modules) inside each major source module discovered in recon.
.agents/ — reasoned agents/, commands/, skills/, docs/
(skills_agents_catalog.md + COMMANDS_REFERENCE.md), settings.json, and
the .claude → .agents and .cursor → .agents symlinks. Skills/agents/commands are
stack-appropriate, not generic boilerplate.
- DeepWorkPlan skill installed + a gitignored
.dwp/ scaffold
(.dwp/plans/, .dwp/drafts/, with READMEs and a .gitignore rule).
Plus, opt-in (Phase 7b): any accepted addons (the first is devcontainer).
The flow — Phases 0–8
Run the phases in order. Write your working notes to .dwp/onboard/RECON.md as
you go so generation is auditable and resumable. Treat every "detect" step as
reason about the real repo, never assume.
After recon and the archetype decision, Phase 2b picks the onboarding
strategy: generate everything inline in this session (small/medium repos —
the default), or, for a large repo, emit a Deep Work Plan that completes
the onboarding task-by-task with per-artifact gates and full resumability (the
recommended path at scale). The phase descriptions below are written for the
inline path; on the plan-driven path the same work runs as plan tasks.
Phase 0 — Preconditions & consent
- Resolve context. Run
bash ../shared/context.sh to get repo_root,
branch, agent_tool, and dwp_dir. All target-repo paths below are
relative to repo_root.
- Detect fresh-empty vs existing. Decide which case you are in:
- Fresh-empty — little/no source, no VCS history, no
AGENTS.md /
CLAUDE.md / docs/ / .agents/. You generate from a clean slate (still
reasoning from whatever signals exist — e.g. a single package.json).
- Existing — real source code and/or any of the above already present.
You must be idempotent and non-destructive (see below).
- Non-destructive rule (existing repos). You MUST NOT clobber a
hand-written
AGENTS.md, CLAUDE.md, docs/, .agents/, or .gitignore.
For each artifact that already exists: prefer to merge/augment; if a
destructive change is unavoidable, back it up (e.g. AGENTS.md.bak) and
ask the developer first. Re-running the flow on an
already-onboarded repo MUST be safe — detect what already conforms and only
fill gaps.
- Consent before writing. This flow mutates the developer's repo. Present
the planned change set at a high level (archetype guess, detected stack,
the list of files/folders you intend to create or modify) and get explicit
confirmation before writing anything.
- Honor dry-run / plan-only. If the developer passes
--dry-run, says
"just show me the plan", or declines to write, produce the full plan (recon +
intended change set) without writing any repo files. You MAY still write
.dwp/onboard/RECON.md as the plan artifact, after telling them.
Phase 1 — Repo reconnaissance (REASON, don't assume)
Inspect the real repo and record findings in .dwp/onboard/RECON.md. This is
the highest-value phase — everything downstream is reasoned from here.
Detect, by reading actual files (not by habit):
- Languages & frameworks. Manifests:
pyproject.toml / poetry.lock / requirements.txt / setup.cfg,
package.json / pnpm-lock.yaml / yarn.lock / package-lock.json,
go.mod, Cargo.toml, Gemfile, composer.json, pom.xml, *.csproj.
Framework signatures: manage.py+settings.py → Django; vite.config.* +
vue/react in deps → Vue/React + Vite; astro.config.* → Astro;
next.config.* → Next; Express/Fastify imports → Node service; Lambda
handlers / serverless.yml / template.yaml → serverless; a console_scripts
/ [project.scripts] entry + Click/Typer/argparse → Python CLI.
- Build / test / lint / typecheck commands — the crown jewels. Read the
manifest scripts (
package.json scripts, pyproject.toml tool config),
Makefile, Taskfile.yml, tox.ini, CI workflows (.github/workflows/*,
.gitlab-ci.yml), and any docker.sh / docker-compose.yml. Capture the
exact commands (e.g. pnpm run eslint:check, pnpm run type:check,
codecheck -f inside Docker, poetry run pytest, ruff check,
npm run biome:check, astro check). Note any command that runs only in
CI or only inside a container — flag it as such (this matters for the
Quick Commands block and the Phase 8 smoke test). If the repo has no test
and/or no lint/type-check command at all, do not just record the absence —
flag it as a gap to be closed in Phase 4 by proposing a stack-appropriate
toolchain (per ../spec/DOCUMENTATION_STANDARD.md §3.3). Validation gates are
the backbone of reliable Deep Work Plans; a repo with no way to validate its
behavior is not yet AI-first.
- Package manager. Infer from the lockfile that actually exists
(
pnpm-lock.yaml → pnpm, poetry.lock → poetry, etc.), never from habit.
- Folder layout & modules. Find the source roots (
src/, app/, lib/,
pkg/, cmd/, pages/, components/) and the major sub-modules within them.
These become the per-module docs in Phase 5.
- Test convention. File naming (
*_test.py, *.spec.ts, *.test.ts),
framework (pytest / jest / vitest / playwright / go test), and where tests
live (co-located vs tests/). If no tests exist, note that — Phase 4 will
propose a convention and framework reasoned from the stack rather than
leaving testing undefined.
- Deployment / runtime shape. Containerized? Serverless? Static site?
Long-running service? Library/package? This informs
ARCHITECTURE.md and
PERFORMANCE.md.
- Existing conventions to carry forward. Read any current
README,
CONTRIBUTING, .editorconfig, linter/formatter config, and the existing
commit-message style (git log). Carry these forward; do not override a
working convention with a generic one.
Then load the matching preset from presets/ (one per common stack across
backend, frontend, mobile, and systems/infra — see presets/README.md for the
full index — or generic if nothing matches). Use it as a reasoning
checklist, and explicitly verify each preset
assumption against what you actually found — detected reality wins over preset
assumptions.
Write .dwp/onboard/RECON.md with: detected stack, package manager, exact
validation commands (flagged CI/Docker-only where relevant), source roots +
major modules, test convention, deployment shape, carried-forward conventions,
and which preset you used.
Also record a scale count (the evidence the Phase 2b decision reads, so the
inline-vs-plan choice is mechanical, not guessed):
major_modules — the number of major source modules you'll write per-module
docs for (Phase 5).
planned_artifacts — a rough total of files to generate: AGENTS.md (1) +
the docs/ categories (~10) + one per-module README.md + the .agents/ kit.
Estimate it: ≈ 11 + major_modules for a typical repo.
Record both numbers explicitly in .dwp/onboard/RECON.md. Phase 2b thresholds
are stated against these counts.
Phase 2 — Archetype decision
Classify the repo using ../spec/ARCHETYPES.md signals (summarized in
presets/README.md):
| Signal |
Indicates orchestrator hub |
A repositories/ (or equivalent) folder of multiple independent repos |
strong |
| No single primary application stack at root; root is mostly markdown/coordination |
strong |
| Sub-repos git-ignored / tracked separately |
moderate |
| Cross-project standards, a repo navigation index, or orchestrator manifests |
moderate |
Root AGENTS.md indexes other repos' AGENTS.md |
moderate |
- Default to
individual repo (the 99% case) unless a clear majority of
signals say hub.
- A monorepo with one build/stack is an individual repo with modules
(handled by per-module docs), not a hub.
- If signals are ambiguous, present your assessment + evidence and ask the
developer before proceeding.
Record the decision and the evidence in .dwp/onboard/RECON.md. Every phase
below branches on this decision where noted.
Phase 2b — Onboarding strategy: inline vs plan-driven (scale decision)
Onboarding a repo means analyzing the whole codebase and documenting all
of it: every docs/ category, a per-module README.md for each major module,
and the full .agents/ kit (agents, skills, commands, catalogs). For a small or
medium repo, generating all of that inline in this session (Phases 3–8) is
the right, fast default.
For a large repo, doing it all inline is the wrong tool: it strains a single
context window, gives no per-artifact validation gate, can't be audited
task-by-task, and loses all progress if the session is interrupted. That is
exactly the problem Deep Work Plans solve. So for a large repo, onboarding
becomes its own Deep Work Plan — the repo's first plan is "finish onboarding
myself," executed task-by-task with gates and full resumability. This is the
methodology dogfooding itself: the onboarding uses the very loop it installs.
Decide the strategy from the recon counts (mechanical, not a guess). Read the
major_modules and planned_artifacts numbers you recorded in Phase 1. Choose
plan-driven when a clear majority of these hold (or the developer asks):
major_modules > 8 (each needs its own per-module doc, Phase 5).
planned_artifacts ≥ 15 (docs + per-module docs + .agents/).
- A monorepo / multi-package workspace, or an orchestrator hub.
- The work plainly won't fit one focused session, or must survive across
sessions/agents.
Otherwise stay inline (the typical case) — run Phases 3–8 directly. State the
counts and the resulting choice in .dwp/onboard/RECON.md so the decision is
auditable; if the counts sit right at the boundary, present them and let the
developer break the tie.
The plan-driven path:
Resume, don't regenerate (idempotency check). Before building a new plan,
look for an in-progress onboarding plan: ls .dwp/plans/PLAN_onboard_*. If one
exists, do not start over — read its PROGRESS.md, report status, and hand
off to /dwp-resume to continue from the first open task. Only generate a new
plan when none exists. (This honors the Phase 0 idempotency rule for the
plan-driven path and matches the verify sub-skill's in-progress note.)
Still complete Phase 1 recon and Phase 2 archetype here — the recon
(.dwp/onboard/RECON.md) is the analysis the plan is built from. Never skip
it.
Generate AGENTS.md + CLAUDE.md (Phase 3) up front (or as task 1) so
the plan's tasks have the index and mandatory rules to anchor to.
Instead of generating the rest inline, emit a Deep Work Plan draft under
.dwp/drafts/ whose atomic tasks are reasoned from recon — see
templates/onboarding-plan.md for the shape
(a reasoning aid, not a copy-paste). Typical decomposition:
- one task per
docs/ category (Phase 4), each gated on "no placeholders
- real commands + links resolve";
- one task per major module for its
README.md (Phase 5) — the part that
scales worst inline;
- one task for the
.agents/ kit (agents + skills + commands + catalogs,
Phase 6), gated on "catalog matches disk";
- one task to install the skill + scaffold
.dwp/ and tmp/ (Phase 7);
- the Phase 8 self-check as the mandatory final task, alongside the spec's
three mandatory final tasks (Security Review, Skills & Agents Discovery,
Executive Report).
Each task carries explicit Acceptance Criteria and a runnable
validation gate (the repo's real lint / md-check / test).
Hand off to the normal loop: refine the draft with /dwp-refine, finalize,
then /dwp-execute it task-by-task. It is resumable with /dwp-resume and
inspectable with /dwp-status.
The Phase 0 rules — non-destructive, idempotent, no placeholders, consent —
apply identically on the plan-driven path. They move into each task's
Acceptance Criteria and gate rather than disappearing. A plan-driven onboarding
that ships a placeholder doc is the same failure as an inline one.
Record the chosen strategy (inline vs plan-driven) and its evidence in
.dwp/onboard/RECON.md.
Phase 3 — Generate AGENTS.md + CLAUDE.md symlink
Reason the content from Phase 1; do not template it.
AGENTS.md (plain UTF-8 markdown, NO frontmatter, ~150–500 lines) MUST serve
three roles:
- Index — a documentation index table linking every
docs/ file you will
create (Phase 4), each with a one-line description; plus an annotated
repo-structure tree (≥2 levels) reflecting the real layout from recon.
Link only files that will exist.
- Mandatory rules — English-only; conventional commits
(
type(scope): description) with the repo's real scopes derived from its
domains; the repo's real test pattern + coverage expectation; its error/
logging conventions; repository-boundary rules (where the agent may/may not
commit); and a progress-reporting + "never block work on reporting" note.
- Quick Commands — a table of the detected install / test / lint /
type-check / build / validate commands, verbatim. Mark any command that
runs only in CI or only inside a container (e.g. "must run inside the
Docker container").
Orchestrator-hub additions (only if Phase 2 said hub): add the sub-project
navigation index link (e.g. repositories/README.md) and each sub-project's
AGENTS.md; the multi-project commit workflow (commit inside each sub-repo,
never from the hub root); and child-DWP language per ../guide/GUIDE.md
(orchestrator §).
CLAUDE.md. Create the symlink ln -s AGENTS.md CLAUDE.md. If the target
filesystem/host does not support symlinks, fall back to a one-line CLAUDE.md
containing exactly @AGENTS.md, and note the fallback in .dwp/onboard/REPORT.md.
Never duplicate AGENTS.md content into CLAUDE.md.
Existing-repo note: if AGENTS.md already exists and is hand-written,
merge your index/commands/rules into it rather than overwriting; back up +
ask before any destructive change (Phase 0).
Phase 4 — Generate docs/
Produce the standard categories, each adapted from recon — an empty or
generic doc is a failure. The conformance floor (all MUST):
PRODUCT_SPEC.md, ARCHITECTURE.md, STANDARDS.md, TESTING_GUIDE.md,
DEVELOPMENT_COMMANDS.md, SECURITY.md, AI_AGENT_ONBOARDING.md,
AI_AGENT_COLLAB.md. SHOULD: PERFORMANCE.md, plus optional
PR_REVIEW_WORKFLOW.md and ECOSYSTEM_CONTEXT.md. Always add a
docs/README.md master index.
Each doc must contain real content:
PRODUCT_SPEC.md — the non-technical product/why doc: the problem the repo
solves, who it is for, its key capabilities/features, success criteria, and
explicit non-goals. It MUST read plainly enough that anyone — a person or an
agent, technical or not — can understand what this repository is and why it
exists at a glance; that is the whole point of the document. Reason it from
the README, package description, public API, and any roadmap/issues — never a
generic stub. Required for every repo, including libraries, CLIs, and
internal tools: if there are no end users, frame the product as its
consumers (who calls this API, and why they choose it). This is the why; the
docs below are the how.
ARCHITECTURE.md — the real components, data flow, and deployment shape from
recon; an annotated diagram of the actual module layout.
STANDARDS.md — the repo's real coding conventions, naming, import order,
error/logging patterns, and forbidden anti-patterns (carry forward existing
linter config).
TESTING_GUIDE.md — the real test framework + file-naming pattern + how
to run/scope tests + coverage expectation. If the repo has no test/lint
setup, do NOT write "no tests" or leave it empty — propose a
stack-appropriate setup (recommended framework + runner, test file convention,
where tests live, a sensible initial coverage target, and the lint /
type-check / format tooling), document it as the target, and surface it to
the developer. When non-destructive and the developer consents, scaffold a
minimal runnable baseline (the test/lint scripts + at least one real smoke
test). See ../spec/DOCUMENTATION_STANDARD.md §3.3. This is essential, not
cosmetic: it is what gives every future Deep Work Plan a real validation gate.
DEVELOPMENT_COMMANDS.md — the authoritative, verbatim command reference
(install/test/lint/type-check/build/run), expanding the AGENTS.md Quick
Commands; flag CI/Docker-only commands.
SECURITY.md — the real secrets-handling location/convention, auth model,
sensitive-data boundaries, and what agents MUST NOT write into docs.
PERFORMANCE.md — performance-critical paths/budgets relevant to the runtime
shape (skip or keep brief for trivial repos).
AI_AGENT_ONBOARDING.md — a concrete first-session checklist for this repo
(clone → install with the real PM → run the real validation → where things
live).
AI_AGENT_COLLAB.md — handoff, ownership, and conflict-avoidance rules.
- (optional)
PR_REVIEW_WORKFLOW.md, ECOSYSTEM_CONTEXT.md — add when the repo
uses PRs / sits in a multi-repo ecosystem. ECOSYSTEM_CONTEXT.md is MUST
for an orchestrator hub.
docs/README.md — a one-paragraph scope statement + a table linking every
guide you created. MUST exist for a hub.
The preset for the detected stack lists the doc emphases that matter for
that stack — apply them.
Phase 5 — Generate per-module nested docs
For each major source module found in Phase 1 (a folder representing a
distinct feature/bounded concern), create a README.md inside that folder
describing: the module's responsibility, key files / public surface, and how
it's tested. For a complex or high-velocity module (3+ interconnected
concerns), add a docs/ subfolder with deeper guides, entered via a README.md.
A trivial/stable module needs only its README.md. Link each module's docs from
its own README.md; surface the most significant ones in the root AGENTS.md
index. (Reference ../spec/DOCUMENTATION_STANDARD.md §4 for the per-module rule; which
modules count as "major"/"complex" is reasoned per repo.)
Phase 6 — Generate .agents/ + agent directory symlinks
Create the canonical cross-agent config directory. All content must be
cross-agent (readable by Cursor/Codex/Gemini/Copilot as personas/procedures),
and stack-appropriate, not generic boilerplate.
.agents/agents/ — reasoned worker personas. Baseline roles: reviewer,
architect, executor, debugger, qa, perf-optimizer,
security-auditor, plus any stack-specific role the preset suggests
(e.g. a Django migration-author, a Vue component-author). Each persona
must be described well enough that a non-Claude agent can read it.
.agents/commands/ — the six short DWP commands (dwp-create,
dwp-execute, dwp-refine, dwp-resume, dwp-status, dwp-verify) plus stack-relevant
ones (code-review, pr, commit, branch). The dwp-* commands MUST be
thin delegators, NOT copies of the flow. Each is a short file (frontmatter
description: + a body) that routes the invocation to the matching sub-skill
of the installed deepworkplan skill — e.g. /dwp-create → the skill's
create sub-skill, /dwp-resume → resume, etc. Do NOT re-author the
command flow content (the skill owns it; duplicating it causes drift). This
gives users the familiar short /dwp-create / /dwp-resume aliases while the
single source of truth stays in the skill. (The skill's own sub-skills are
already user-invocable, so /deepworkplan-create etc. also work; the
dwp-* files are the shorter, conventional aliases.) Copy and adapt the
ready delegator templates at command-templates/ —
one per dwp-* command — fixing the <skill-path> to where the skill is
installed in the target repo. The same directory also ships skill-create.md
and agent-create.md — thin delegators that route /skill-create and
/agent-create to the author sub-skill so the onboarded repo can evolve
its own kit (create/update skills, agents, commands). Copy and adapt these two
alongside the dwp-* templates, fixing the same <skill-path>.
.agents/skills/ — stack-appropriate skills chosen by reasoning (use
the preset's "skills to generate" list as a starting point, then verify
against the repo's real needs), plus the DeepWorkPlan skill installed here
(Phase 7).
.agents/docs/ — skills_agents_catalog.md and COMMANDS_REFERENCE.md,
generated to match what you actually created (no phantom entries).
.agents/settings.json — a sane harness-config baseline (sensible
permissions; no secrets). .agents/README.md — a short entry point.
.claude → .agents and .cursor → .agents symlinks — ln -s .agents .claude and
ln -s .agents .cursor. Same symlink fallback as Phase 3 if unsupported (a tool-native pointer; document it).
Existing-repo note: if .agents/ (or per-tool .claude/ / .cursor/)
config already exists, reconcile into .agents/ and add the .claude and
.cursor symlinks only if absent; never delete existing personas/commands without asking.
Phase 7 — Install the DeepWorkPlan skill + scaffold .dwp/
- Make the DeepWorkPlan skill available to the target repo via one of (offer
the developer the choice; recommend the first):
npx skills add DailybotHQ/deepworkplan-skill
- OpenClaw:
openclaw skills install deepworkplan
git clone the skill repo + run its setup.sh
- or symlink the local skill pack into
.agents/skills/deepworkplan/.
- Scaffold the gitignored output area (per
../shared/dwp-paths.md):
create .dwp/plans/ and .dwp/drafts/, each with a README.md placeholder,
and add .dwp/ to the repo's .gitignore (append the rule
non-destructively — do not rewrite the file). .dwp/ is the only DWP output
location; it replaces any pre-v2 DWP output tree (see
../shared/dwp-paths.md for the contrast). If an older DWP output tree
exists, note it for migration (do not delete without asking).
- Scaffold the
tmp/ scratch area (per DOCUMENTATION_STANDARD.md §2.6):
create a root-level tmp/ with a .gitkeep, add tmp/ to the repo's
.gitignore (append non-destructively), and note the convention in
AGENTS.md — a gitignored freeform scratch space for ephemeral/throwaway
work (exploratory output, data exports, inter-agent prompt handoffs), kept
distinct from the structured .dwp/ plan output. If tmp/ already
exists, leave it as-is.
Phase 7b — Offer optional addons (opt-in)
After the core AI-first scaffolding, enumerate the available addons under
../addons/ and offer each as an explicit opt-in step. Addons are never
required — a repo is fully conformant with zero addons. In trust mode, you
MAY recommend the obviously-applicable ones, but still surface them.
Five addons ship today; enumerate all and offer each independently:
| Addon |
Folder |
Recommend in trust mode when… |
| Devcontainer support |
../addons/devcontainer/ |
the repo benefits from a reproducible isolated dev container (most repos with Docker/services). |
| Dailybot integration |
../addons/dailybot/ |
the developer/team already uses Dailybot or asks for team progress reporting — do NOT auto-install for everyone. |
| Dependency upgrade |
../addons/dependency-upgrade/ |
the repo has a lockfile + a dependency-heavy stack and wants safe, batched, validated upgrades — recommend only when a lockfile is present; never auto-install for everyone. |
| Design system |
../addons/design-system/ |
the repo has a user-facing interface surface, detected per profile: visual-ui (stylesheet with CSS custom properties, Tailwind config or @theme block, UI components, brand/style guide) is default-on when detected — in trust mode apply it (generate DESIGN.md), in guided mode strongly recommend and ask; cli-output (a CLI rendering library + a deliberate display layer) and conversational (a chat SDK or message-composition layer) are recommended when detected, always asked, never auto-applied. Never offer for a repo with no interface surface (pure library, headless service, infra-only). |
| AI Diff Reviewer |
../addons/ai-diff-reviewer/ |
the developer/team wants structured local code review on DWP Security Review and/or a CI PR merge gate — do NOT auto-install for everyone; always ask Flow A (local-only) vs Flow B (dual-surface), never default. |
The first addon is devcontainer support
(../addons/devcontainer/SKILL.md +
SPEC.md). If the developer accepts: read that
addon's SKILL.md and run its flow — match a preset in
../addons/devcontainer/templates/presets.md to the stack you detected in
Phase 1, then reason out a devcontainer adapted to that stack (base image,
user, workspaceFolder, supporting services from the app's real dependencies,
ports, public-vs-private secrets handling) while preserving the common skeleton
(AI-CLI persistence volumes for claude/codex/cursor/gh/dailybot + read-only
ssh/gitconfig mounts, dailybot-project-network, DOCKER_DEV_ENV=vscode →
sleep infinity, the codecheck/check/fix/test validation aliases, and
project-identity precedence per the addon SPEC §4). An existing devcontainer
MUST be reconciled, not clobbered — preserve working ports/network/identity and
only add missing skeleton pieces; back up and ask before any destructive change.
For a public repo, the addon also adds a secret-excluding .dockerignore and
keeps .env.example secret-free. After applying, run the addon's validation step
(SPEC §6). If declined, skip it and continue — the repo stays
baseline-conformant.
The second addon is Dailybot integration
(../addons/dailybot/SKILL.md +
SPEC.md). Offer it only when relevant — the
developer or team already uses Dailybot, or explicitly wants team progress
reporting; in trust mode, recommend it only on that signal and never
auto-install it for everyone. If accepted: read that addon's SKILL.md and run
its flow — detect whether the Dailybot skill/CLI is already present
(reconcile-don't-clobber), offer the opt-in install paths (Dailybot agent
skill via npx skills add DailybotHQ/agent-skill / npx skills update dailybot
/ OpenClaw / git clone + setup.sh, or the Dailybot CLI >= 3.7.0), defer
all authentication to the Dailybot skill's own consent flow (shared/auth.md
— dailybot login or DAILYBOT_API_KEY; never reinvent or store credentials),
wire the four lifecycle events (kickoff, significant task, blocked,
completion) as optional progress reports via the dailybot report sub-skill,
and MAY offer deterministic hook enforcement (dailybot hook, CLI >=
3.7.0). The paired Dailybot skill (3.10.3) exposes 14 capabilities (chat,
check-ins, forms authoring, ask AI, per-repo API keys, and more); this addon wires only report
into DWP execution. Every report is strictly best-effort and never blocks
the work if Dailybot is absent, unauthenticated, or unreachable. The core
DeepWorkPlan methodology has zero Dailybot dependency — this addon is purely
optional team visibility.
After applying, run the addon's validation step (SPEC §8). If declined, skip it
and continue — the repo stays baseline-conformant.
The third addon is dependency upgrade
(../addons/dependency-upgrade/SKILL.md +
SPEC.md). It is package-manager
agnostic — offer it when the repo has a lockfile and a dependency-heavy stack;
in trust mode recommend it only when a lockfile is present, and never
auto-install it for everyone. If accepted: read that addon's SKILL.md and run
its flow — detect the repo's real package manager (npm/pnpm/yarn + ncu,
pip/poetry/uv, cargo, go mod, bundler, composer…), classify upgrades by semver,
upgrade in safe batches, run the repo's real validation gate after each
batch, revert a failing batch, and summarize. Only when accepted, the addon
installs a /lib-upgrade delegator into the repo's .agents/commands/. After
applying, run the addon's validation step (SPEC §9). If declined, skip it — the
repo stays baseline-conformant and no command is installed.
The fourth addon is design system
(../addons/design-system/SKILL.md +
SPEC.md). It is interface-surface-scoped
with per-profile strength (addon SPEC §3, §3.5) — during Phase 1 detection, check
each profile independently from real files: visual-ui (a stylesheet with
CSS custom properties, a Tailwind config or a Tailwind v4 @theme {} block, UI
components (.tsx/.vue/.svelte/.astro), a design-token file, or a
brand/style guide); cli-output (a CLI/TUI rendering library — rich, chalk,
ink, lipgloss, ratatui — plus a deliberate rendering layer such as a
display.*/ui.* helper module with semantic print helpers; a bare argument
parser with raw prints does NOT qualify); and conversational (a chat-platform
SDK — Slack, Discord, Teams, … — a message-composition layer, or documented
outbound-message voice rules). When visual-ui is detected, do not merely list
the addon: in trust mode apply it automatically (generate DESIGN.md,
developer may still decline), and in guided mode present it as a strong
recommendation and ask. When cli-output or conversational is detected,
recommend it and ask in both modes — never auto-apply those profiles. When
no profile is detected, do not offer the addon (a repo with no interface
surface must never get a DESIGN.md). Declining always leaves a
baseline-conformant repo. If accepted (or auto-applied): read that addon's
SKILL.md and run its flow — locate the repo's real design source per
accepted profile, reason out that profile's canonical sections of DESIGN.md
(visual-ui: colors & roles incl. dark mode, typography, layout & spacing,
elevation, shapes, components, responsive behavior; cli-output: output voice,
semantic colors & styles, output components, layout conventions, degradation &
environment; conversational: voice & register, message anatomy, platform
rendering — each plus do's & don'ts, with one shared Overview and one agent
prompt guide), and write it at docs/DESIGN.md (alongside the other specs
you generated in Phase 4 — root only if the repo has no docs/ tree; multiple
accepted profiles stack as sections in the same single file, never sibling
files) — never copying a third-party brand file. Then add a DESIGN.md
reference to the AGENTS.md documentation index (and CLAUDE.md) so agents
discover it like the rest of docs/. An existing DESIGN.md/token source MUST
be reconciled, not clobbered — adding a new profile to an existing file is
additive. After applying, run the addon's validation step (SPEC §11: file at
docs/DESIGN.md or root with all sections per accepted profile, AGENTS.md
references it, values traceable to the real source, per-profile integrity —
WCAG AA contrast / degradation rules / plain-text fallbacks — token references
resolve, new profiles were asked about). If declined, skip it — the repo stays
baseline-conformant.
The fifth addon is AI Diff Reviewer
(../addons/ai-diff-reviewer/SKILL.md +
SPEC.md). Offer it only when relevant —
the developer or team wants structured code-review quality on DWP work, a local
pre-push review, and/or a CI PR merge gate; in trust mode recommend it only
on that signal and never auto-install it for everyone. If accepted: read
that addon's SKILL.md and run its flow — ask Flow A (local-only) vs Flow B
(dual-surface) explicitly and NEVER default (matches the upstream skill's
ambiguity tie-break); detect whether the vendored skill / extension file /
pr-review.yml already exist (reconcile-don't-clobber); offer the opt-in
vendored-skill install via
npx --yes skills add DailybotHQ/ai-diff-reviewer --skill ai-diff-reviewer -y
(both --yes and -y required); in Flow B hand off CI-workflow authoring to
the upstream setup sub-skill (never invent credentials — CURSOR_API_KEY /
provider secrets are the consumer's responsibility); wire the mandatory DWP
Security Review to run the upstream parent default flow as an additive
local-review pass; and (Flow B only) surface apply-review as an optional
developer-invoked companion during execute. Every local augmentation is
strictly best-effort and never blocks the work if the skill or extension is
absent or the local review invocation errors — an unset CI provider secret does
not skip the local Security Review pass (Flow B CI/gate only). The core
DeepWorkPlan methodology has zero AI Diff Reviewer dependency — this addon
is purely optional review quality. After applying,
run the addon's validation step (SPEC §9). If declined, skip it and continue —
the repo stays baseline-conformant.
Phase 8 — Self-check / validation (mandatory)
See the dedicated section below.
Phase 8 — Self-check / validation (run in the TARGET repo)
After generating, run this checklist in the target repo. On any failure,
fix-then-recheck before reporting done. On the plan-driven path
(Phase 2b), this checklist is the plan's mandatory final task — run it after
the plan's other tasks complete, gating the whole onboarding before reporting
done.
AGENTS.md exists and contains a Quick Commands block whose commands are
real and runnable (not placeholders). Spot-check that referenced commands
exist in the manifest/Makefile/scripts.
CLAUDE.md resolves to AGENTS.md — the symlink points at AGENTS.md,
or CLAUDE.md contains exactly @AGENTS.md.
docs/ has the standard categories, each non-empty and repo-specific
(the eight MUST files at minimum — PRODUCT_SPEC included — plus
docs/README.md). Grep for leftover
placeholder markers (<...>, "TODO", "your command here") and fix any.
TESTING_GUIDE.md MUST describe either a real test/lint setup or a concrete
proposed one (§3.3) — never empty, never "no tests".
- Every major source module has a
README.md (and complex modules have a
docs/).
.agents/ has agents/, commands/, skills/, docs/, settings.json
and .claude → .agents + .cursor → .agents symlinks (or documented fallback);
skills_agents_catalog.md and COMMANDS_REFERENCE.md match what was
actually created (no phantom entries). **The six `
…(truncated)
1---2name: deepworkplan-onboard3description: Make a repository AI-first by reasoning about its stack and archetype, then generating adapted AGENTS.md, docs/, per-module docs, .agents/, and the .claude/.cursor to .agents symlinks. Offers opt-in addons. Use when the developer wants to onboard or AI-enable a repo.4---56# DeepWorkPlan — Onboard78Turn the **target repository** into an **AI-first autopilot repo**: a codebase9whose `AGENTS.md`, `docs/`, per-module docs, `.agents/`, `.claude → .agents` and10`.cursor → .agents` symlinks, and gitignored `.dwp/` give *any* AI agent (Claude Code, Cursor, OpenAI11Codex, Gemini, Copilot, Cline, Windsurf, OpenClaw) enough structured context to12work reliably without per-session human hand-holding.1314> ## The one rule that overrides everything: REASON, do not copy-paste15>16> This flow is **not** a template copier and **not** a scaffolder. Its entire17> value is that you **inspect the actual target repo** — its real languages,18> frameworks, package manager, build/test/lint commands, folder layout, test19> convention, deployment shape — and then **generate artifacts adapted to that20> repo**. The *shape* of the output is fixed (the ~90%: `AGENTS.md`, the `docs/`21> categories, per-module docs, `.agents/`, the symlinks, `.dwp/`); the *content*22> is reasoned per repo (the ~10%: validation commands, paths, stack-specific23> skills, example plans).24>25> **An empty doc, a generic stub, a placeholder command, or a doc copied26> verbatim from this skill or another repo is a FAILURE.** Never write27> `<your test command here>`. Never write `npm test` unless you confirmed the28> repo uses npm and has a `test` script. Find the *real* command and write it.29> If you cannot determine a real value, ask the developer — do not guess and do30> not leave a placeholder.3132## Shared resources — READ THESE FIRST3334- [`../shared/context.sh`](../shared/context.sh) — resolve the target repo root,35 branch, agent tool, and the `.dwp/` output location (`dwp_dir`). Run it; do36 not reinvent detection.37- [`../shared/adaptation.md`](../shared/adaptation.md) — the38 reasoning-over-copy-paste principle and the two archetypes. This sub-skill is39 its deep elaboration.40- [`../shared/dwp-paths.md`](../shared/dwp-paths.md) — the `.dwp/` output41 convention you scaffold in Phase 7.42- [`presets/README.md`](presets/README.md) — the per-stack **reasoning guides**43 spanning backend/API (Django, FastAPI, Rails, Spring Boot, Laravel, NestJS),44 frontend (Vue/Vite, Next.js, SvelteKit, Nuxt, Angular, Astro/Svelte), mobile45 (React Native, Flutter, Swift/iOS), and systems/infra (Go, Rust, Terraform,46 TypeScript Lambda, Node/TS service, Python package/CLI), plus a `generic`47 fallback and the orchestrator-hub note. See `presets/README.md` for the full48 index. Read the matching preset in Phase 1 and use it in Phases 3–6.49 **Presets are reasoning aids, not templates.**50- [`../guide/GUIDE.md`](../guide/GUIDE.md) — the DWP methodology you reference51 when wiring the skill and (for hubs) the orchestrator/child-DWP capability.52- [`templates/onboarding-plan.md`](templates/onboarding-plan.md) — the53 **reasoning aid** for the plan-driven path (Phase 2b): the shape of a "finish54 onboarding myself" Deep Work Plan a **large** repo emits instead of generating55 everything inline. A template to reason from, **never** to copy verbatim.5657> **Ship purity:** every path this flow references is relative inside58> `skills/deepworkplan/` (`../shared/*`, `presets/*`, `../guide/GUIDE.md`,59> `../addons/*`). Never reference any absolute host path or any60> `.agent_commands/...` path. The output you write lives in the **target repo**,61> at paths relative to its root.6263---6465## The generated outcome (what success looks like in the target repo)6667When this flow finishes, the target repo contains:68691. **`AGENTS.md`** — index + mandatory rules + a Quick Commands block with the70 repo's **real, runnable** commands; plus `CLAUDE.md → AGENTS.md`.712. **`docs/`** — the standard categories, each filled with **real**72 repo-specific content (real commands, real module names, real test pattern):73 `PRODUCT_SPEC.md` (the non-technical product/why doc — **required for every74 repo, libraries included**), `ARCHITECTURE.md`, `STANDARDS.md`,75 `TESTING_GUIDE.md`, `DEVELOPMENT_COMMANDS.md`, `SECURITY.md`, `PERFORMANCE.md`,76 `AI_AGENT_ONBOARDING.md`, `AI_AGENT_COLLAB.md`, optional77 `PR_REVIEW_WORKFLOW.md` / `ECOSYSTEM_CONTEXT.md`, and a `docs/README.md`78 index.793. **Per-module nested docs** — a `README.md` (and a `docs/` subfolder for80 complex modules) inside each major source module discovered in recon.814. **`.agents/`** — reasoned `agents/`, `commands/`, `skills/`, `docs/`82 (`skills_agents_catalog.md` + `COMMANDS_REFERENCE.md`), `settings.json`, and83 the `.claude → .agents` and `.cursor → .agents` symlinks. Skills/agents/commands are84 **stack-appropriate**, not generic boilerplate.855. **DeepWorkPlan skill installed** + a gitignored **`.dwp/`** scaffold86 (`.dwp/plans/`, `.dwp/drafts/`, with READMEs and a `.gitignore` rule).8788Plus, opt-in (Phase 7b): any accepted **addons** (the first is devcontainer).8990---9192# The flow — Phases 0–89394Run the phases in order. Write your working notes to `.dwp/onboard/RECON.md` as95you go so generation is auditable and resumable. Treat every "detect" step as96**reason about the real repo**, never assume.9798After recon and the archetype decision, **Phase 2b** picks the onboarding99*strategy*: generate everything **inline** in this session (small/medium repos —100the default), or, for a **large** repo, **emit a Deep Work Plan that completes101the onboarding task-by-task** with per-artifact gates and full resumability (the102recommended path at scale). The phase descriptions below are written for the103inline path; on the plan-driven path the **same work** runs as plan tasks.104105## Phase 0 — Preconditions & consent1061071. **Resolve context.** Run `bash ../shared/context.sh` to get `repo_root`,108 `branch`, `agent_tool`, and `dwp_dir`. All target-repo paths below are109 relative to `repo_root`.1102. **Detect fresh-empty vs existing.** Decide which case you are in:111 - **Fresh-empty** — little/no source, no VCS history, no `AGENTS.md` /112 `CLAUDE.md` / `docs/` / `.agents/`. You generate from a clean slate (still113 reasoning from whatever signals exist — e.g. a single `package.json`).114 - **Existing** — real source code and/or any of the above already present.115 You must be **idempotent and non-destructive** (see below).1163. **Non-destructive rule (existing repos).** You **MUST NOT** clobber a117 hand-written `AGENTS.md`, `CLAUDE.md`, `docs/`, `.agents/`, or `.gitignore`.118 For each artifact that already exists: prefer to **merge/augment**; if a119 destructive change is unavoidable, **back it up** (e.g. `AGENTS.md.bak`) and120 **ask the developer first**. Re-running the flow on an121 already-onboarded repo MUST be safe — detect what already conforms and only122 fill gaps.1234. **Consent before writing.** This flow mutates the developer's repo. Present124 the **planned change set at a high level** (archetype guess, detected stack,125 the list of files/folders you intend to create or modify) and get explicit126 confirmation before writing anything.1275. **Honor dry-run / plan-only.** If the developer passes `--dry-run`, says128 "just show me the plan", or declines to write, produce the full plan (recon +129 intended change set) **without writing** any repo files. You MAY still write130 `.dwp/onboard/RECON.md` as the plan artifact, after telling them.131132## Phase 1 — Repo reconnaissance (REASON, don't assume)133134Inspect the real repo and record findings in `.dwp/onboard/RECON.md`. This is135the **highest-value** phase — everything downstream is reasoned from here.136137Detect, by reading actual files (not by habit):138139- **Languages & frameworks.** Manifests:140 `pyproject.toml` / `poetry.lock` / `requirements.txt` / `setup.cfg`,141 `package.json` / `pnpm-lock.yaml` / `yarn.lock` / `package-lock.json`,142 `go.mod`, `Cargo.toml`, `Gemfile`, `composer.json`, `pom.xml`, `*.csproj`.143 Framework signatures: `manage.py`+`settings.py` → Django; `vite.config.*` +144 `vue`/`react` in deps → Vue/React + Vite; `astro.config.*` → Astro;145 `next.config.*` → Next; Express/Fastify imports → Node service; Lambda146 handlers / `serverless.yml` / `template.yaml` → serverless; a `console_scripts`147 / `[project.scripts]` entry + Click/Typer/argparse → Python CLI.148- **Build / test / lint / typecheck commands — the crown jewels.** Read the149 manifest scripts (`package.json` `scripts`, `pyproject.toml` tool config),150 `Makefile`, `Taskfile.yml`, `tox.ini`, CI workflows (`.github/workflows/*`,151 `.gitlab-ci.yml`), and any `docker.sh` / `docker-compose.yml`. Capture the152 **exact** commands (e.g. `pnpm run eslint:check`, `pnpm run type:check`,153 `codecheck -f` *inside Docker*, `poetry run pytest`, `ruff check`,154 `npm run biome:check`, `astro check`). Note any command that runs **only in155 CI** or **only inside a container** — flag it as such (this matters for the156 Quick Commands block and the Phase 8 smoke test). **If the repo has no test157 and/or no lint/type-check command at all, do not just record the absence** —158 flag it as a gap to be closed in Phase 4 by *proposing* a stack-appropriate159 toolchain (per `../spec/DOCUMENTATION_STANDARD.md` §3.3). Validation gates are160 the backbone of reliable Deep Work Plans; a repo with no way to validate its161 behavior is not yet AI-first.162- **Package manager.** Infer from the **lockfile that actually exists**163 (`pnpm-lock.yaml` → pnpm, `poetry.lock` → poetry, etc.), never from habit.164- **Folder layout & modules.** Find the source roots (`src/`, `app/`, `lib/`,165 `pkg/`, `cmd/`, `pages/`, `components/`) and the major sub-modules within them.166 These become the per-module docs in Phase 5.167- **Test convention.** File naming (`*_test.py`, `*.spec.ts`, `*.test.ts`),168 framework (pytest / jest / vitest / playwright / go test), and where tests169 live (co-located vs `tests/`). If **no tests exist**, note that — Phase 4 will170 *propose* a convention and framework reasoned from the stack rather than171 leaving testing undefined.172- **Deployment / runtime shape.** Containerized? Serverless? Static site?173 Long-running service? Library/package? This informs `ARCHITECTURE.md` and174 `PERFORMANCE.md`.175- **Existing conventions to carry forward.** Read any current `README`,176 `CONTRIBUTING`, `.editorconfig`, linter/formatter config, and the existing177 commit-message style (`git log`). **Carry these forward**; do not override a178 working convention with a generic one.179180Then **load the matching preset** from `presets/` (one per common stack across181backend, frontend, mobile, and systems/infra — see `presets/README.md` for the182full index — or `generic` if nothing matches). Use it as a **reasoning183checklist**, and explicitly verify each preset184assumption against what you actually found — **detected reality wins over preset185assumptions**.186187Write `.dwp/onboard/RECON.md` with: detected stack, package manager, exact188validation commands (flagged CI/Docker-only where relevant), source roots +189major modules, test convention, deployment shape, carried-forward conventions,190and which preset you used.191192**Also record a scale count** (the evidence the Phase 2b decision reads, so the193inline-vs-plan choice is mechanical, not guessed):194195- `major_modules` — the number of major source modules you'll write per-module196 docs for (Phase 5).197- `planned_artifacts` — a rough total of files to generate: `AGENTS.md` (1) +198 the `docs/` categories (~10) + one per-module `README.md` + the `.agents/` kit.199 Estimate it: `≈ 11 + major_modules` for a typical repo.200201Record both numbers explicitly in `.dwp/onboard/RECON.md`. Phase 2b thresholds202are stated against these counts.203204## Phase 2 — Archetype decision205206Classify the repo using `../spec/ARCHETYPES.md` signals (summarized in207`presets/README.md`):208209| Signal | Indicates orchestrator hub |210|--------|---------------------------|211| A `repositories/` (or equivalent) folder of multiple independent repos | strong |212| No single primary application stack at root; root is mostly markdown/coordination | strong |213| Sub-repos git-ignored / tracked separately | moderate |214| Cross-project standards, a repo navigation index, or orchestrator manifests | moderate |215| Root `AGENTS.md` indexes *other repos'* `AGENTS.md` | moderate |216217- **Default to `individual repo`** (the 99% case) unless a clear majority of218 signals say hub.219- A monorepo with **one** build/stack is an **individual repo with modules**220 (handled by per-module docs), **not** a hub.221- If signals are **ambiguous**, present your assessment + evidence and **ask the222 developer** before proceeding.223224Record the decision and the evidence in `.dwp/onboard/RECON.md`. Every phase225below branches on this decision where noted.226227## Phase 2b — Onboarding strategy: inline vs plan-driven (scale decision)228229Onboarding a repo means analyzing the **whole** codebase and **documenting all230of it**: every `docs/` category, a per-module `README.md` for each major module,231and the full `.agents/` kit (agents, skills, commands, catalogs). For a small or232medium repo, generating all of that **inline** in this session (Phases 3–8) is233the right, fast default.234235For a **large** repo, doing it all inline is the wrong tool: it strains a single236context window, gives no per-artifact validation gate, can't be audited237task-by-task, and loses all progress if the session is interrupted. That is238**exactly** the problem Deep Work Plans solve. So for a large repo, **onboarding239becomes its own Deep Work Plan** — the repo's first plan is "finish onboarding240myself," executed task-by-task with gates and full resumability. This is the241methodology dogfooding itself: the onboarding uses the very loop it installs.242243**Decide the strategy from the recon counts (mechanical, not a guess).** Read the244`major_modules` and `planned_artifacts` numbers you recorded in Phase 1. Choose245**plan-driven** when a clear majority of these hold (or the developer asks):246247- `major_modules` **> 8** (each needs its own per-module doc, Phase 5).248- `planned_artifacts` **≥ 15** (docs + per-module docs + `.agents/`).249- A monorepo / multi-package workspace, or an orchestrator hub.250- The work plainly won't fit one focused session, or must survive across251 sessions/agents.252253Otherwise stay **inline** (the typical case) — run Phases 3–8 directly. State the254counts and the resulting choice in `.dwp/onboard/RECON.md` so the decision is255auditable; if the counts sit right at the boundary, present them and let the256developer break the tie.257258**The plan-driven path:**2592600. **Resume, don't regenerate (idempotency check).** Before building a new plan,261 look for an in-progress onboarding plan: `ls .dwp/plans/PLAN_onboard_*`. If one262 exists, **do not start over** — read its `PROGRESS.md`, report status, and hand263 off to `/dwp-resume` to continue from the first open task. Only generate a new264 plan when none exists. (This honors the Phase 0 idempotency rule for the265 plan-driven path and matches the `verify` sub-skill's in-progress note.)2661. Still complete **Phase 1 recon** and **Phase 2 archetype** here — the recon267 (`.dwp/onboard/RECON.md`) is the analysis the plan is built from. Never skip268 it.2692. Generate **`AGENTS.md` + `CLAUDE.md` (Phase 3) up front** (or as task 1) so270 the plan's tasks have the index and mandatory rules to anchor to.2713. Instead of generating the rest inline, **emit a Deep Work Plan draft** under272 `.dwp/drafts/` whose atomic tasks are reasoned from recon — see273 [`templates/onboarding-plan.md`](templates/onboarding-plan.md) for the shape274 (a **reasoning aid**, not a copy-paste). Typical decomposition:275 - one task **per `docs/` category** (Phase 4), each gated on "no placeholders276 + real commands + links resolve";277 - **one task per major module** for its `README.md` (Phase 5) — the part that278 scales worst inline;279 - one task for the **`.agents/` kit** (agents + skills + commands + catalogs,280 Phase 6), gated on "catalog matches disk";281 - one task to **install the skill + scaffold `.dwp/` and `tmp/`** (Phase 7);282 - the **Phase 8 self-check as the mandatory final task**, alongside the spec's283 three mandatory final tasks (Security Review, Skills & Agents Discovery,284 Executive Report).285286 Each task carries explicit **Acceptance Criteria** and a runnable287 **validation gate** (the repo's real lint / `md`-check / test).2884. Hand off to the normal loop: refine the draft with `/dwp-refine`, finalize,289 then `/dwp-execute` it task-by-task. It is resumable with `/dwp-resume` and290 inspectable with `/dwp-status`.291292> The Phase 0 rules — non-destructive, idempotent, **no placeholders**, consent —293> apply **identically** on the plan-driven path. They move into each task's294> Acceptance Criteria and gate rather than disappearing. A plan-driven onboarding295> that ships a placeholder doc is the same failure as an inline one.296297Record the chosen strategy (inline vs plan-driven) and its evidence in298`.dwp/onboard/RECON.md`.299300## Phase 3 — Generate `AGENTS.md` + `CLAUDE.md` symlink301302Reason the content from Phase 1; do not template it.303304**`AGENTS.md` (plain UTF-8 markdown, NO frontmatter, ~150–500 lines)** MUST serve305three roles:3063071. **Index** — a documentation index table linking every `docs/` file you will308 create (Phase 4), each with a one-line description; plus an annotated309 repo-structure tree (≥2 levels) reflecting the **real** layout from recon.310 Link only files that will exist.3112. **Mandatory rules** — English-only; conventional commits312 (`type(scope): description`) with the repo's **real** scopes derived from its313 domains; the repo's **real** test pattern + coverage expectation; its error/314 logging conventions; repository-boundary rules (where the agent may/may not315 commit); and a progress-reporting + "never block work on reporting" note.3163. **Quick Commands** — a table of the **detected** install / test / lint /317 type-check / build / validate commands, verbatim. **Mark** any command that318 runs only in CI or only inside a container (e.g. "must run **inside** the319 Docker container").320321**Orchestrator-hub additions** (only if Phase 2 said hub): add the sub-project322navigation index link (e.g. `repositories/README.md`) and each sub-project's323`AGENTS.md`; the **multi-project commit workflow** (commit inside each sub-repo,324never from the hub root); and **child-DWP** language per `../guide/GUIDE.md`325(orchestrator §).326327**`CLAUDE.md`.** Create the symlink `ln -s AGENTS.md CLAUDE.md`. If the target328filesystem/host does not support symlinks, fall back to a one-line `CLAUDE.md`329containing exactly `@AGENTS.md`, and note the fallback in `.dwp/onboard/REPORT.md`.330Never duplicate `AGENTS.md` content into `CLAUDE.md`.331332> **Existing-repo note:** if `AGENTS.md` already exists and is hand-written,333> merge your index/commands/rules into it rather than overwriting; back up +334> ask before any destructive change (Phase 0).335336## Phase 4 — Generate `docs/`337338Produce the standard categories, **each adapted** from recon — an empty or339generic doc is a failure. The conformance floor (all **MUST**):340`PRODUCT_SPEC.md`, `ARCHITECTURE.md`, `STANDARDS.md`, `TESTING_GUIDE.md`,341`DEVELOPMENT_COMMANDS.md`, `SECURITY.md`, `AI_AGENT_ONBOARDING.md`,342`AI_AGENT_COLLAB.md`. **SHOULD**: `PERFORMANCE.md`, plus optional343`PR_REVIEW_WORKFLOW.md` and `ECOSYSTEM_CONTEXT.md`. Always add a344`docs/README.md` master index.345346Each doc must contain **real** content:347348- `PRODUCT_SPEC.md` — the non-technical product/why doc: the problem the repo349 solves, who it is for, its key capabilities/features, success criteria, and350 explicit non-goals. It **MUST read plainly enough that anyone — a person or an351 agent, technical or not — can understand what this repository is and why it352 exists at a glance**; that is the whole point of the document. Reason it from353 the README, package description, public API, and any roadmap/issues — never a354 generic stub. **Required for every repo, including libraries, CLIs, and355 internal tools**: if there are no end users, frame the product as its356 consumers (who calls this API, and why they choose it). This is the *why*; the357 docs below are the *how*.358- `ARCHITECTURE.md` — the real components, data flow, and deployment shape from359 recon; an annotated diagram of the actual module layout.360- `STANDARDS.md` — the repo's real coding conventions, naming, import order,361 error/logging patterns, and forbidden anti-patterns (carry forward existing362 linter config).363- `TESTING_GUIDE.md` — the **real** test framework + file-naming pattern + how364 to run/scope tests + coverage expectation. **If the repo has no test/lint365 setup, do NOT write "no tests" or leave it empty** — *propose* a366 stack-appropriate setup (recommended framework + runner, test file convention,367 where tests live, a sensible initial coverage target, and the lint /368 type-check / format tooling), document it as the **target**, and surface it to369 the developer. When non-destructive and the developer consents, scaffold a370 minimal runnable baseline (the test/lint scripts + at least one real smoke371 test). See `../spec/DOCUMENTATION_STANDARD.md` §3.3. This is essential, not372 cosmetic: it is what gives every future Deep Work Plan a real validation gate.373- `DEVELOPMENT_COMMANDS.md` — the authoritative, **verbatim** command reference374 (install/test/lint/type-check/build/run), expanding the AGENTS.md Quick375 Commands; flag CI/Docker-only commands.376- `SECURITY.md` — the real secrets-handling location/convention, auth model,377 sensitive-data boundaries, and what agents MUST NOT write into docs.378- `PERFORMANCE.md` — performance-critical paths/budgets relevant to the runtime379 shape (skip or keep brief for trivial repos).380- `AI_AGENT_ONBOARDING.md` — a concrete first-session checklist for *this* repo381 (clone → install with the real PM → run the real validation → where things382 live).383- `AI_AGENT_COLLAB.md` — handoff, ownership, and conflict-avoidance rules.384- (optional) `PR_REVIEW_WORKFLOW.md`, `ECOSYSTEM_CONTEXT.md` — add when the repo385 uses PRs / sits in a multi-repo ecosystem. `ECOSYSTEM_CONTEXT.md` is **MUST**386 for an orchestrator hub.387- `docs/README.md` — a one-paragraph scope statement + a table linking every388 guide you created. **MUST** exist for a hub.389390The preset for the detected stack lists the **doc emphases** that matter for391that stack — apply them.392393## Phase 5 — Generate per-module nested docs394395For each **major** source module found in Phase 1 (a folder representing a396distinct feature/bounded concern), create a `README.md` inside that folder397describing: the module's responsibility, key files / public surface, and how398it's tested. For a **complex or high-velocity** module (3+ interconnected399concerns), add a `docs/` subfolder with deeper guides, entered via a `README.md`.400A trivial/stable module needs only its `README.md`. Link each module's docs from401its own `README.md`; surface the most significant ones in the root `AGENTS.md`402index. (Reference `../spec/DOCUMENTATION_STANDARD.md` §4 for the per-module rule; which403modules count as "major"/"complex" is reasoned per repo.)404405## Phase 6 — Generate `.agents/` + agent directory symlinks406407Create the canonical cross-agent config directory. **All content must be408cross-agent** (readable by Cursor/Codex/Gemini/Copilot as personas/procedures),409and **stack-appropriate**, not generic boilerplate.410411- **`.agents/agents/`** — reasoned worker personas. Baseline roles: `reviewer`,412 `architect`, `executor`, `debugger`, `qa`, `perf-optimizer`,413 `security-auditor`, plus any **stack-specific** role the preset suggests414 (e.g. a Django `migration-author`, a Vue `component-author`). Each persona415 must be described well enough that a non-Claude agent can read it.416- **`.agents/commands/`** — the six short DWP commands (`dwp-create`,417 `dwp-execute`, `dwp-refine`, `dwp-resume`, `dwp-status`, `dwp-verify`) plus stack-relevant418 ones (`code-review`, `pr`, `commit`, `branch`). **The `dwp-*` commands MUST be419 thin delegators, NOT copies of the flow.** Each is a short file (frontmatter420 `description:` + a body) that routes the invocation to the matching sub-skill421 of the installed `deepworkplan` skill — e.g. `/dwp-create` → the skill's422 `create` sub-skill, `/dwp-resume` → `resume`, etc. Do NOT re-author the423 command flow content (the skill owns it; duplicating it causes drift). This424 gives users the familiar short `/dwp-create` / `/dwp-resume` aliases while the425 single source of truth stays in the skill. (The skill's own sub-skills are426 already `user-invocable`, so `/deepworkplan-create` etc. also work; the427 `dwp-*` files are the shorter, conventional aliases.) Copy and adapt the428 ready delegator templates at [`command-templates/`](command-templates/) —429 one per `dwp-*` command — fixing the `<skill-path>` to where the skill is430 installed in the target repo. The same directory also ships `skill-create.md`431 and `agent-create.md` — thin delegators that route `/skill-create` and432 `/agent-create` to the **author** sub-skill so the onboarded repo can evolve433 its own kit (create/update skills, agents, commands). Copy and adapt these two434 alongside the `dwp-*` templates, fixing the same `<skill-path>`.435- **`.agents/skills/`** — **stack-appropriate** skills chosen by reasoning (use436 the preset's "skills to generate" list as a starting point, then verify437 against the repo's real needs), plus the DeepWorkPlan skill installed here438 (Phase 7).439- **`.agents/docs/`** — `skills_agents_catalog.md` and `COMMANDS_REFERENCE.md`,440 generated to **match what you actually created** (no phantom entries).441- **`.agents/settings.json`** — a sane harness-config baseline (sensible442 permissions; no secrets). `.agents/README.md` — a short entry point.443- **`.claude → .agents` and `.cursor → .agents` symlinks** — `ln -s .agents .claude` and444 `ln -s .agents .cursor`. Same symlink fallback as Phase 3 if unsupported (a tool-native pointer; document it).445446> **Existing-repo note:** if `.agents/` (or per-tool `.claude/` / `.cursor/`)447> config already exists, reconcile into `.agents/` and add the `.claude` and448> `.cursor` symlinks only if absent; never delete existing personas/commands without asking.449450## Phase 7 — Install the DeepWorkPlan skill + scaffold `.dwp/`4514521. **Make the DeepWorkPlan skill available** to the target repo via one of (offer453 the developer the choice; recommend the first):454 - `npx skills add DailybotHQ/deepworkplan-skill`455 - OpenClaw: `openclaw skills install deepworkplan`456 - `git clone` the skill repo + run its `setup.sh`457 - or symlink the local skill pack into `.agents/skills/deepworkplan/`.4582. **Scaffold the gitignored output area** (per `../shared/dwp-paths.md`):459 create `.dwp/plans/` and `.dwp/drafts/`, each with a `README.md` placeholder,460 and add `.dwp/` to the repo's `.gitignore` (append the rule461 non-destructively — do not rewrite the file). `.dwp/` is the only DWP output462 location; it **replaces** any pre-v2 DWP output tree (see463 `../shared/dwp-paths.md` for the contrast). If an older DWP output tree464 exists, note it for migration (do not delete without asking).4653. **Scaffold the `tmp/` scratch area** (per `DOCUMENTATION_STANDARD.md` §2.6):466 create a root-level `tmp/` with a `.gitkeep`, add `tmp/` to the repo's467 `.gitignore` (append non-destructively), and note the convention in468 `AGENTS.md` — a gitignored freeform scratch space for ephemeral/throwaway469 work (exploratory output, data exports, inter-agent prompt handoffs), kept470 distinct from the **structured** `.dwp/` plan output. If `tmp/` already471 exists, leave it as-is.472473## Phase 7b — Offer optional addons (opt-in)474475After the core AI-first scaffolding, **enumerate** the available addons under476`../addons/` and offer each as an **explicit opt-in** step. Addons are **never477required** — a repo is fully conformant with zero addons. In **trust mode**, you478MAY recommend the obviously-applicable ones, but still surface them.479480Five addons ship today; enumerate **all** and offer each independently:481482| Addon | Folder | Recommend in trust mode when… |483|-------|--------|-------------------------------|484| **Devcontainer support** | [`../addons/devcontainer/`](../addons/devcontainer/SKILL.md) | the repo benefits from a reproducible isolated dev container (most repos with Docker/services). |485| **Dailybot integration** | [`../addons/dailybot/`](../addons/dailybot/SKILL.md) | the developer/team **already uses Dailybot** or asks for team progress reporting — **do NOT auto-install for everyone**. |486| **Dependency upgrade** | [`../addons/dependency-upgrade/`](../addons/dependency-upgrade/SKILL.md) | the repo has a lockfile + a dependency-heavy stack and wants safe, batched, validated upgrades — recommend only when a lockfile is present; **never auto-install for everyone**. |487| **Design system** | [`../addons/design-system/`](../addons/design-system/SKILL.md) | the repo has a **user-facing interface surface**, detected per profile: **visual-ui** (stylesheet with CSS custom properties, Tailwind config or `@theme` block, UI components, brand/style guide) is **default-on when detected** — in trust mode **apply** it (generate `DESIGN.md`), in guided mode **strongly recommend** and ask; **cli-output** (a CLI rendering library + a deliberate display layer) and **conversational** (a chat SDK or message-composition layer) are **recommended when detected, always asked, never auto-applied**. **Never offer for a repo with no interface surface** (pure library, headless service, infra-only). |488| **AI Diff Reviewer** | [`../addons/ai-diff-reviewer/`](../addons/ai-diff-reviewer/SKILL.md) | the developer/team wants structured local code review on DWP Security Review and/or a CI PR merge gate — **do NOT auto-install for everyone**; always ask Flow A (local-only) vs Flow B (dual-surface), never default. |489490The first addon is **devcontainer support**491([`../addons/devcontainer/SKILL.md`](../addons/devcontainer/SKILL.md) +492[`SPEC.md`](../addons/devcontainer/SPEC.md)). If the developer accepts: read that493addon's `SKILL.md` and run its flow — match a preset in494`../addons/devcontainer/templates/presets.md` to the stack you detected in495Phase 1, then **reason out** a devcontainer adapted to that stack (base image,496user, `workspaceFolder`, supporting services from the app's real dependencies,497ports, public-vs-private secrets handling) while preserving the common skeleton498(AI-CLI persistence volumes for claude/codex/cursor/gh/dailybot + read-only499ssh/gitconfig mounts, `dailybot-project-network`, `DOCKER_DEV_ENV=vscode` →500`sleep infinity`, the `codecheck`/`check`/`fix`/`test` validation aliases, and501project-identity precedence per the addon SPEC §4). An **existing devcontainer502MUST be reconciled, not clobbered** — preserve working ports/network/identity and503only add missing skeleton pieces; back up and ask before any destructive change.504For a **public** repo, the addon also adds a secret-excluding `.dockerignore` and505keeps `.env.example` secret-free. After applying, run the addon's validation step506(SPEC §6). If declined, skip it and continue — the repo stays507baseline-conformant.508509The second addon is **Dailybot integration**510([`../addons/dailybot/SKILL.md`](../addons/dailybot/SKILL.md) +511[`SPEC.md`](../addons/dailybot/SPEC.md)). Offer it **only when relevant** — the512developer or team already uses Dailybot, or explicitly wants team progress513reporting; in trust mode, recommend it **only** on that signal and **never514auto-install it for everyone**. If accepted: read that addon's `SKILL.md` and run515its flow — detect whether the Dailybot skill/CLI is already present516(reconcile-don't-clobber), offer the **opt-in** install paths (Dailybot agent517skill via `npx skills add DailybotHQ/agent-skill` / `npx skills update dailybot`518/ OpenClaw / git clone + `setup.sh`, or the Dailybot CLI **>= 3.7.0**), **defer519all authentication** to the Dailybot skill's own consent flow (`shared/auth.md`520— `dailybot login` or `DAILYBOT_API_KEY`; never reinvent or store credentials),521wire the **four lifecycle events** (kickoff, significant task, blocked,522completion) as optional progress reports via the dailybot `report` sub-skill,523and **MAY** offer deterministic hook enforcement (`dailybot hook`, CLI >=5243.7.0). The paired Dailybot skill (**3.10.3**) exposes 14 capabilities (chat,525check-ins, forms authoring, ask AI, per-repo API keys, and more); this addon wires only **report**526into DWP execution. Every report is strictly **best-effort and never blocks**527the work if Dailybot is absent, unauthenticated, or unreachable. The core528DeepWorkPlan methodology has **zero Dailybot dependency** — this addon is purely529optional team visibility.530After applying, run the addon's validation step (SPEC §8). If declined, skip it531and continue — the repo stays baseline-conformant.532533The third addon is **dependency upgrade**534([`../addons/dependency-upgrade/SKILL.md`](../addons/dependency-upgrade/SKILL.md) +535[`SPEC.md`](../addons/dependency-upgrade/SPEC.md)). It is **package-manager536agnostic** — offer it when the repo has a lockfile and a dependency-heavy stack;537in trust mode recommend it **only** when a lockfile is present, and **never**538auto-install it for everyone. If accepted: read that addon's `SKILL.md` and run539its flow — detect the repo's real package manager (npm/pnpm/yarn + ncu,540pip/poetry/uv, cargo, go mod, bundler, composer…), classify upgrades by semver,541upgrade in safe batches, run the repo's **real** validation gate after each542batch, revert a failing batch, and summarize. **Only when accepted**, the addon543installs a `/lib-upgrade` delegator into the repo's `.agents/commands/`. After544applying, run the addon's validation step (SPEC §9). If declined, skip it — the545repo stays baseline-conformant and no command is installed.546547The fourth addon is **design system**548([`../addons/design-system/SKILL.md`](../addons/design-system/SKILL.md) +549[`SPEC.md`](../addons/design-system/SPEC.md)). It is **interface-surface-scoped**550with per-profile strength (addon SPEC §3, §3.5) — during Phase 1 detection, check551each profile independently from **real files**: **visual-ui** (a stylesheet with552CSS custom properties, a Tailwind config or a Tailwind v4 `@theme {}` block, UI553components (`.tsx`/`.vue`/`.svelte`/`.astro`), a design-token file, or a554brand/style guide); **cli-output** (a CLI/TUI rendering library — rich, chalk,555ink, lipgloss, ratatui — **plus** a deliberate rendering layer such as a556`display.*`/`ui.*` helper module with semantic print helpers; a bare argument557parser with raw prints does NOT qualify); and **conversational** (a chat-platform558SDK — Slack, Discord, Teams, … — a message-composition layer, or documented559outbound-message voice rules). When **visual-ui** is detected, do not merely list560the addon: in **trust mode apply it automatically** (generate `DESIGN.md`,561developer may still decline), and in **guided mode present it as a strong562recommendation** and ask. When **cli-output** or **conversational** is detected,563**recommend it and ask in both modes — never auto-apply** those profiles. When564**no** profile is detected, **do not offer the addon** (a repo with no interface565surface must never get a `DESIGN.md`). Declining always leaves a566baseline-conformant repo. If accepted (or auto-applied): read that addon's567`SKILL.md` and run its flow — locate the repo's **real** design source per568accepted profile, **reason out** that profile's canonical sections of `DESIGN.md`569(visual-ui: colors & roles incl. dark mode, typography, layout & spacing,570elevation, shapes, components, responsive behavior; cli-output: output voice,571semantic colors & styles, output components, layout conventions, degradation &572environment; conversational: voice & register, message anatomy, platform573rendering — each plus do's & don'ts, with one shared Overview and one agent574prompt guide), and write it at **`docs/DESIGN.md`** (alongside the other specs575you generated in Phase 4 — root only if the repo has no `docs/` tree; multiple576accepted profiles stack as sections in the **same single file**, never sibling577files) — **never** copying a third-party brand file. Then **add a `DESIGN.md`578reference to the `AGENTS.md` documentation index** (and `CLAUDE.md`) so agents579discover it like the rest of `docs/`. An **existing `DESIGN.md`/token source MUST580be reconciled, not clobbered** — adding a new profile to an existing file is581additive. After applying, run the addon's validation step (SPEC §11: file at582`docs/DESIGN.md` or root with all sections per accepted profile, AGENTS.md583references it, values traceable to the real source, per-profile integrity —584WCAG AA contrast / degradation rules / plain-text fallbacks — token references585resolve, new profiles were asked about). If declined, skip it — the repo stays586baseline-conformant.587588The fifth addon is **AI Diff Reviewer**589([`../addons/ai-diff-reviewer/SKILL.md`](../addons/ai-diff-reviewer/SKILL.md) +590[`SPEC.md`](../addons/ai-diff-reviewer/SPEC.md)). Offer it **only when relevant** —591the developer or team wants structured code-review quality on DWP work, a local592pre-push review, and/or a CI PR merge gate; in trust mode recommend it **only**593on that signal and **never auto-install it for everyone**. If accepted: read594that addon's `SKILL.md` and run its flow — **ask Flow A (local-only) vs Flow B595(dual-surface) explicitly and NEVER default** (matches the upstream skill's596ambiguity tie-break); detect whether the vendored skill / extension file /597`pr-review.yml` already exist (reconcile-don't-clobber); offer the **opt-in**598vendored-skill install via599`npx --yes skills add DailybotHQ/ai-diff-reviewer --skill ai-diff-reviewer -y`600(both `--yes` and `-y` required); in Flow B hand off CI-workflow authoring to601the upstream `setup` sub-skill (never invent credentials — `CURSOR_API_KEY` /602provider secrets are the consumer's responsibility); wire the mandatory DWP603**Security Review** to run the upstream parent default flow as an additive604local-review pass; and (Flow B only) surface `apply-review` as an optional605developer-invoked companion during `execute`. Every **local** augmentation is606strictly **best-effort and never blocks** the work if the skill or extension is607absent or the local review invocation errors — an unset CI provider secret does608**not** skip the local Security Review pass (Flow B CI/gate only). The core609DeepWorkPlan methodology has **zero AI Diff Reviewer dependency** — this addon610is purely optional review quality. After applying,611run the addon's validation step (SPEC §9). If declined, skip it and continue —612the repo stays baseline-conformant.613614## Phase 8 — Self-check / validation (mandatory)615616See the dedicated section below.617618---619620# Phase 8 — Self-check / validation (run in the TARGET repo)621622After generating, run this checklist in the target repo. On any failure,623**fix-then-recheck** before reporting done. On the **plan-driven path**624(Phase 2b), this checklist **is the plan's mandatory final task** — run it after625the plan's other tasks complete, gating the whole onboarding before reporting626done.6276281. **`AGENTS.md` exists** and contains a Quick Commands block whose commands are629 **real and runnable** (not placeholders). Spot-check that referenced commands630 exist in the manifest/Makefile/scripts.6312. **`CLAUDE.md` resolves to `AGENTS.md`** — the symlink points at `AGENTS.md`,632 or `CLAUDE.md` contains exactly `@AGENTS.md`.6333. **`docs/` has the standard categories**, each non-empty and repo-specific634 (the eight MUST files at minimum — `PRODUCT_SPEC` included — plus635 `docs/README.md`). Grep for leftover636 placeholder markers (`<...>`, "TODO", "your command here") and fix any.637 **`TESTING_GUIDE.md` MUST describe either a real test/lint setup or a concrete638 *proposed* one (§3.3)** — never empty, never "no tests".6394. **Every major source module has a `README.md`** (and complex modules have a640 `docs/`).6415. **`.agents/`** has `agents/`, `commands/`, `skills/`, `docs/`, `settings.json`642 and `.claude → .agents` + `.cursor → .agents` symlinks (or documented fallback);643 `skills_agents_catalog.md` and `COMMANDS_REFERENCE.md` **match** what was644 actually created (no phantom entries). **The six `645646…(truncated)