Skip to content
Merged
30 changes: 27 additions & 3 deletions docker/custom_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,19 @@ function git_status_indicator() {
fi
}

# Speed up `git status` on macOS bind mounts (caches the untracked-files walk).
# Repo-local; do not enable core.fsmonitor — unreliable through this mount.
if git rev-parse --git-dir >/dev/null 2>&1; then
git config core.untrackedcache true
fi

# Cached git dirty state for the prompt. `git status` costs ~0.4s on the
# macOS bind mount even with core.untrackedCache, so refresh at most every
# 5 seconds instead of on every prompt redraw.
__GIT_DIRTY_CACHE=""
__GIT_DIRTY_REPO=""
__GIT_DIRTY_TS=-10

# Custom PS1 prompt with colors and git info
function set_bash_prompt() {
local exit_code=$?
Expand All @@ -270,16 +283,27 @@ function set_bash_prompt() {

# Get git branch and status
local git_info=""
if git rev-parse --git-dir > /dev/null 2>&1; then
local repo_root
repo_root=$(git rev-parse --show-toplevel 2>/dev/null)
if [[ -n "$repo_root" ]]; then
local branch
branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)

if [[ "$branch" == "HEAD" ]]; then
branch='detached*'
fi

# Check if there are uncommitted changes
if [[ -n $(git status --porcelain 2>/dev/null) ]]; then
if [[ "$repo_root" != "$__GIT_DIRTY_REPO" ]] || (( SECONDS - __GIT_DIRTY_TS >= 5 )); then
if [[ -n $(git status --porcelain 2>/dev/null) ]]; then
__GIT_DIRTY_CACHE=1
else
__GIT_DIRTY_CACHE=0
fi
__GIT_DIRTY_REPO="$repo_root"
__GIT_DIRTY_TS=$SECONDS
fi

if [[ "$__GIT_DIRTY_CACHE" == 1 ]]; then
git_info=" ${red}(${branch}*)${reset}"
else
git_info=" ${green}(${branch})${reset}"
Expand Down
4 changes: 4 additions & 0 deletions docs/aeo/MARKDOWN_FOR_AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Source: `src/content/pages/{en,es}/` content collection.

Language: en
Canonical: https://deepworkplan.com/about
Markdown: send header `Accept: text/markdown` on any URL to receive Markdown instead of HTML.

---

Expand All @@ -51,6 +52,7 @@ Canonical: https://deepworkplan.com/about
- Blockquote description — visually distinct
- Simple key-value metadata — easy to parse
- Canonical URL — always points to the HTML version
- **Markdown access line** — tells agents to send `Accept: text/markdown` on any URL for Markdown instead of HTML (content negotiation; do not rely on appending `.md`). Localized prose per language; the media type stays literal. Owned by `buildMarkdownAccessLine(lang)` in `src/lib/markdown-for-agents.ts`
- Separator before body — clear content boundary
- Site navigation footer — global nav links appended to every output (see below)

Expand All @@ -70,7 +72,9 @@ Canonical: https://deepworkplan.com/about

### Serialization Functions

- `buildMarkdownAccessLine(lang)` — localized `Markdown:` header hint (content negotiation)
- `serializePageToAgentMarkdown(page, { slug, lang })` — site pages
- `serializeReaderEntryToAgentMarkdown(entry, { basePath, slug, lang })` — methodology / spec / kit / examples readers

### Site Navigation Partial

Expand Down
61 changes: 61 additions & 0 deletions src/content/kit/de/ai-diff-reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: AI Diff Reviewer
description: "Optionales DWP-Addon: lokaler AI Diff Reviewer-Lauf für Security Review, optionales Flow-B-CI-Gate (v2), gemeinsame Extension und apply-review."
kind: addon
lang: de
order: 5
---

# AI Diff Reviewer Addon

Verbindet die Deep Work Plan-Ausführung mit dem **[AI Diff Reviewer](https://github.com/DailybotHQ/ai-diff-reviewer)** (Marketplace-Eintrag **"AI Diff Reviewer"**, aktuelle Version **v2.0.0**), sodass die obligatorische abschließende Aufgabe **Sicherheitsprüfung** eine strukturierte lokale Überprüfung erhält — Urteil, Ergebnistabelle und Schweregrad — und, bei Wahl von Flow B, jeder Pull-Request durch dieselbe Überprüfung in CI gesperrt werden kann. Ein **optionales** Addon; nie erforderlich für AI-first-Konformität.

Die Kernmethodologie von Deep Work Plan hat **null** Abhängigkeit vom AI Diff Reviewer. Ein Repository ohne Addons ist vollständig konform. Biete dieses Addon nur an, wenn der Entwickler oder das Team strukturierte Überprüfungsqualität wünscht; niemals automatisch für alle installieren. Immer Flow A vs. Flow B erfragen — niemals einen Standard annehmen.

## Wann es zu verwenden ist

| Signal | Aktion |
|--------|--------|
| Team möchte einen CI-PR-Merge-Gate mit strukturierten Ergebnissen | **Flow B empfehlen** beim Onboarding |
| Persönliches oder experimentelles Repository; lokale Pre-Push-Überprüfung reicht aus | **Flow A anbieten** |
| Kein Interesse an einer zusätzlichen Überprüfungsoberfläche | **Überspringen** — die Basis-Sicherheitsprüfung gilt weiterhin |

## Zwei Adoptionsflows

| Flow | Was du erhältst |
|------|----------------|
| **A — nur lokal** | Vendored Skill + erforderliche `.review/extension.md` (über `generate-extension`). Erweitert die Sicherheitsprüfung um einen lokalen Durchlauf. Kein GitHub Actions-Workflow. |
| **B — doppelte Oberfläche** | Flow A plus `setup` schreibt `.github/workflows/pr-review.yml` (Action `@v2`), dieselbe Erweiterungsdatei für lokal und CI. Optionaler `apply-review`-Begleiter nach CI-Ergebnissen. |

Die Erkennung für die Sicherheitsprüfungserweiterung erfordert **Skill + eine Erweiterungsdatei** an einem dieser Orte: `.review/extension.md`, `.github/ai-diff-reviewer/extension.md` oder `.github/ai-pr-reviewer/extension.md`. Der Skill allein reicht nicht aus.

## Was dieses Addon verbindet (bewusst begrenzt)

Das DWP-Addon **erfindet** den Reviewer nicht neu. Es delegiert Installation, Methodik, den CI-Assistenten, Erweiterungsautorenschaft, PR-Entwurf und Post-CI-Durchsicht an die fünf Sub-Skills des Upstream-Skills (übergeordneter Standardflow, `generate-extension`, `setup`, `open-pr`, `apply-review`).

### Erweiterung der Sicherheitsprüfung

Bei Erkennung fügen `create` / `execute` einen lokalen Überprüfungsschritt zur obligatorischen Sicherheitsprüfungsaufgabe hinzu. Die Ausgabe wird unter `## AI Diff Reviewer local review` in `analysis_results/SECURITY_REVIEW.md` angehängt.

- **Soft-Fail (nur Aufruf):** fehlender Skill, fehlende Erweiterung oder Aufruffehler → einmal warnen und fortfahren; Aufgabe nie für diesen Fehler scheitern lassen.
- **Gate nach einem abgeschlossenen Durchlauf:** `critical`-Ergebnisse blockieren weiterhin den Abschluss der Sicherheitsprüfung bis zur Korrektur oder expliziten Annahme (bestehender SR-Vertrag). `warning` / `info` werden dokumentiert, sind aber nicht blockierend.
- **Flow A benötigt kein CI-Secret.** Ein nicht gesetzter `CURSOR_API_KEY` darf den lokalen Durchlauf nicht unterdrücken.

### Flow-B-CI-Gate (optional)

Gepinnte Action `DailybotHQ/ai-diff-reviewer@v2`, typischerweise Label-gesperrt (`ready`), mit einem stabil benannten **AI review gate**-Job für Branch-Schutz und optionalem `skip-review-label: skip-ai-review`. Gemeinsames `prompt.md` + Erweiterung richten Methodik und Schweregrad aus; unter iterationsbewusster Überprüfung können CI-Runden 2+ kürzer sein, während der lokale Durchlauf vollständig bleibt.

### Optionaler `apply-review`-Begleiter

Nach CI-Veröffentlichung einer Überprüfung kann der Entwickler `apply-review` während `execute` aufrufen, um Ergebnisse einzeln zu durchlaufen (anwenden / zurückstellen / überspringen) mit Zustimmung. Standardmäßig nur lesend; nie eine Planaufgabendatei (würde die obligatorische Aufgabenreihenfolge brechen).

## Verhalten

- **Flow erfragen; niemals raten.** Ein unaufgefordert installierter Workflow hat einen größeren Fußabdruck als beim Flow A zu bleiben.
- **Abstimmen, nicht überschreiben.** Vorhandener Skill, Erweiterung oder `pr-review.yml` bleiben erhalten; nur Lücken füllen.
- **Auth verschoben.** Provider-Secrets für CI werden vom Maintainer konfiguriert; dieses Addon speichert keine Anmeldeinformationen.
- **Anbieterneutral.** Ablehnen hinterlässt ein vollständig AI-first-Repository.

## Hinweise

Optional und nie erforderlich. Upstream-Skill: [DailybotHQ/ai-diff-reviewer](https://github.com/DailybotHQ/ai-diff-reviewer). Spec-Seite: [Add-ons](/spec/addons).
2 changes: 1 addition & 1 deletion src/content/kit/de/dailybot.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Die Installation der Dailybot-Agent-Skill bringt weit mehr als das DWP-Addon ver

## Onboarding-Ablauf

Während DWP `onboard` **Phase 7b**, nach dem zentralen AI-first-Scaffolding, bietet der Ablauf vier optionale Addons. Akzeptiert der Entwickler Dailybot:
Während DWP `onboard` **Phase 7b**, nach dem zentralen AI-first-Scaffolding, bietet der Ablauf fünf optionale Addons. Akzeptiert der Entwickler Dailybot:

1. Bestehendes Setup erkennen (Skill, CLI, `.dailybot/profile.json`, Hooks, Report-Schritt).
2. Skill-/CLI-Installation über Dailybots Einwilligungsflows anbieten.
Expand Down
61 changes: 61 additions & 0 deletions src/content/kit/en/ai-diff-reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: AI Diff Reviewer
description: "Opt-in DWP addon: local AI Diff Reviewer Security Review pass, optional Flow B CI gate (v2), shared extension, and apply-review companion."
kind: addon
lang: en
order: 5
---

# AI Diff Reviewer addon

Connect Deep Work Plan execution to the **[AI Diff Reviewer](https://github.com/DailybotHQ/ai-diff-reviewer)** (marketplace listing **"AI Diff Reviewer"**, current **v2.0.0**) so the mandatory **Security Review** final task gains a structured local review — verdict, findings table, and severity — and, when you choose Flow B, every pull request can be gated by the same review in CI. An **opt-in** addon; never required for AI-first conformance.

The core Deep Work Plan methodology has **zero** AI Diff Reviewer dependency. A repository with zero addons is fully conformant. Offer this addon only when the developer or team wants structured review quality; never auto-install for everyone. Always ask Flow A vs Flow B — never default.

## When to use it

| Signal | Action |
|--------|--------|
| Team wants a CI PR merge gate with structured findings | **Recommend Flow B** during onboarding |
| Personal or experimental repo; local pre-push review is enough | **Offer Flow A** |
| No appetite for an extra review surface | **Skip** — baseline Security Review still applies |

## Two adoption flows

| Flow | What you get |
|------|----------------|
| **A — local-only** | Vendored skill + required `.review/extension.md` (via `generate-extension`). Augments Security Review with a local pass. No GitHub Actions workflow. |
| **B — dual-surface** | Flow A plus `setup` writes `.github/workflows/pr-review.yml` (Action `@v2`), same extension file for local and CI. Optional `apply-review` companion after CI posts findings. |

Detection for the Security Review augmentation requires **skill + an extension file** at one of: `.review/extension.md`, `.github/ai-diff-reviewer/extension.md`, or `.github/ai-pr-reviewer/extension.md`. Skill alone is not enough.

## What this addon wires (narrow by design)

The DWP addon does **not** reinvent the reviewer. It defers install, methodology, the CI wizard, extension authoring, PR drafting, and post-CI walkthrough to the upstream skill's five sub-skills (parent default flow, `generate-extension`, `setup`, `open-pr`, `apply-review`).

### Security Review augmentation

When detected, `create` / `execute` add a local review step to the mandatory Security Review task. Output appends under `## AI Diff Reviewer local review` in `analysis_results/SECURITY_REVIEW.md`.

- **Soft-fail (invocation only):** missing skill, missing extension, or invocation error → warn once and continue; never fail the task for that miss.
- **Gate after a completed pass:** `critical` findings still block Security Review completion until fixed or explicitly accepted (existing SR contract). `warning` / `info` are documented but non-blocking.
- **Flow A needs no CI secret.** An unset `CURSOR_API_KEY` must not suppress the local pass.

### Flow B CI gate (optional)

Pinned Action `DailybotHQ/ai-diff-reviewer@v2`, typically label-gated (`ready`), with a stable-named **AI review gate** job for branch protection and opt-in `skip-review-label: skip-ai-review`. Shared `prompt.md` + extension align methodology and severity; under Iteration-Aware Review, CI round 2+ may be shorter while the local pass stays full.

### Optional `apply-review` companion

After CI posts a review, the developer may invoke `apply-review` during `execute` to walk findings per-finding (apply / defer / skip) with consent. Read-only by default; never a plan task file (would break mandatory final-task order).

## Behavior

- **Ask the flow; never guess.** Installing a workflow unrequested is a larger footprint than staying on Flow A.
- **Reconcile, don't clobber.** Existing skill, extension, or `pr-review.yml` are preserved; fill gaps only.
- **Auth deferred.** Provider secrets for CI are maintainer-configured; this addon never stores credentials.
- **Vendor-neutral.** Declining leaves a fully AI-first repo.

## Notes

Opt-in and never required. Upstream skill: [DailybotHQ/ai-diff-reviewer](https://github.com/DailybotHQ/ai-diff-reviewer). Spec page: [Add-ons](/spec/addons).
2 changes: 1 addition & 1 deletion src/content/kit/en/dailybot.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Public reference: [dailybot.com/skill.md](https://www.dailybot.com/skill.md). So

## Onboarding flow

During DWP `onboard` **Phase 7b**, after core AI-first scaffolding, the flow offers four opt-in addons. If the developer accepts Dailybot:
During DWP `onboard` **Phase 7b**, after core AI-first scaffolding, the flow offers five opt-in addons. If the developer accepts Dailybot:

1. Detect existing setup (skill, CLI, `.dailybot/profile.json`, hooks, report step).
2. Offer skill/CLI install through Dailybot's consent flows.
Expand Down
61 changes: 61 additions & 0 deletions src/content/kit/es/ai-diff-reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: AI Diff Reviewer
description: "Addon DWP opcional: pase local de AI Diff Reviewer en la Revisión de Seguridad, puerta CI Flow B opcional (v2), extensión compartida y apply-review."
kind: addon
lang: es
order: 5
---

# Addon de AI Diff Reviewer

Conecta la ejecución de Deep Work Plan con el **[AI Diff Reviewer](https://github.com/DailybotHQ/ai-diff-reviewer)** (publicado en el marketplace como **"AI Diff Reviewer"**, versión actual **v2.0.0**) para que la tarea final obligatoria de **Revisión de Seguridad** adquiera una revisión local estructurada — veredicto, tabla de hallazgos y severidad — y, al elegir el Flujo B, cualquier pull request puede bloquearse con la misma revisión en CI. Un addon **opcional**; nunca requerido para la conformidad AI-first.

La metodología central de Deep Work Plan tiene **cero** dependencia de AI Diff Reviewer. Un repositorio sin addons es plenamente conforme. Ofrece este addon solo cuando el desarrollador o el equipo desea calidad de revisión estructurada; nunca lo instales automáticamente para todos. Siempre pregunta Flujo A vs Flujo B — nunca elijas por defecto.

## Cuándo usarlo

| Señal | Acción |
|--------|--------|
| El equipo quiere una compuerta de fusión en CI con hallazgos estructurados | **Recomendar Flujo B** durante la incorporación |
| Repositorio personal o experimental; la revisión local previa al push es suficiente | **Ofrecer Flujo A** |
| Sin apetito por una superficie de revisión adicional | **Omitir** — la Revisión de Seguridad de base sigue aplicándose |

## Dos flujos de adopción

| Flujo | Qué obtienes |
|------|----------------|
| **A — solo local** | Skill vendorizada + `.review/extension.md` requerido (vía `generate-extension`). Amplía la Revisión de Seguridad con un pase local. Sin flujo de GitHub Actions. |
| **B — doble superficie** | Flujo A más `setup` escribe `.github/workflows/pr-review.yml` (Action `@v2`), mismo archivo de extensión para local y CI. Compañero opcional `apply-review` tras los hallazgos de CI. |

La detección para la ampliación de la Revisión de Seguridad requiere **skill + un archivo de extensión** en alguna de: `.review/extension.md`, `.github/ai-diff-reviewer/extension.md` o `.github/ai-pr-reviewer/extension.md`. La skill sola no es suficiente.

## Qué conecta este addon (acotado por diseño)

El addon de DWP **no** reinventa el revisor. Delega la instalación, la metodología, el asistente de CI, la autoría de extensiones, la redacción de PRs y el recorrido post-CI a las cinco sub-skills de la skill upstream (flujo padre por defecto, `generate-extension`, `setup`, `open-pr`, `apply-review`).

### Ampliación de la Revisión de Seguridad

Cuando se detecta, `create` / `execute` añaden un paso de revisión local a la tarea obligatoria de Revisión de Seguridad. La salida se añade bajo `## AI Diff Reviewer local review` en `analysis_results/SECURITY_REVIEW.md`.

- **Fallo suave (solo invocación):** skill ausente, extensión ausente o error de invocación → advertir una vez y continuar; nunca fallar la tarea por eso.
- **Compuerta tras un pase completado:** los hallazgos `critical` siguen bloqueando la finalización de la Revisión de Seguridad hasta que se corrijan o se acepten explícitamente (contrato SR existente). Los hallazgos `warning` / `info` se documentan pero no bloquean.
- **El Flujo A no necesita secreto de CI.** Un `CURSOR_API_KEY` no configurado no debe suprimir el pase local.

### Compuerta de CI del Flujo B (opcional)

Action fijada `DailybotHQ/ai-diff-reviewer@v2`, típicamente bloqueada por etiqueta (`ready`), con un trabajo de nombre estable **AI review gate** para la protección de ramas y etiqueta de omisión opcional `skip-review-label: skip-ai-review`. El `prompt.md` compartido + extensión alinean metodología y severidad; bajo Revisión Consciente de Iteraciones, las rondas de CI 2+ pueden ser más breves mientras el pase local permanece completo.

### Compañero `apply-review` opcional

Tras publicar CI una revisión, el desarrollador puede invocar `apply-review` durante `execute` para recorrer los hallazgos uno a uno (aplicar / diferir / omitir) con consentimiento. Solo lectura por defecto; nunca un archivo de tarea del plan (rompería el orden obligatorio de tareas finales).

## Comportamiento

- **Pregunta el flujo; nunca asumas.** Instalar un flujo no solicitado es una huella mayor que permanecer en el Flujo A.
- **Reconcilia, no sobrescribas.** La skill, extensión o `pr-review.yml` existentes se preservan; solo rellena huecos.
- **Auth diferida.** Los secretos del proveedor para CI los configura el mantenedor; este addon nunca almacena credenciales.
- **Neutral respecto al proveedor.** Rechazarlo deja un repositorio plenamente AI-first.

## Notas

Opcional y nunca requerido. Skill upstream: [DailybotHQ/ai-diff-reviewer](https://github.com/DailybotHQ/ai-diff-reviewer). Página de spec: [Add-ons](/spec/addons).
2 changes: 1 addition & 1 deletion src/content/kit/es/dailybot.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Referencia pública: [dailybot.com/skill.md](https://www.dailybot.com/skill.md).

## Flujo de incorporación

Durante la **Fase 7b** de `onboard` de DWP, tras el andamiaje AI-first central, el flujo ofrece cuatro addons opcionales. Si el desarrollador acepta Dailybot:
Durante la **Fase 7b** de `onboard` de DWP, tras el andamiaje AI-first central, el flujo ofrece cinco addons opcionales. Si el desarrollador acepta Dailybot:

1. Detectar configuración existente (skill, CLI, `.dailybot/profile.json`, hooks, paso de reporte).
2. Ofrecer instalación de skill/CLI mediante los flujos de consentimiento de Dailybot.
Expand Down
Loading
Loading