WP1: Port Algorithm v3.7.0 and Fix USER Directory Structure#32
WP1: Port Algorithm v3.7.0 and Fix USER Directory Structure#32Steffen025 wants to merge 7 commits intodevfrom
Conversation
- Update SKILL.md with Algorithm v3.7.0 content - Fix USER directory structure (Issue #29): Remove root .opencode/USER/ - Update docs/MIGRATION.md with correct canonical USER paths - Align with upstream PAI v4.0.3 structure
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughDie Änderungen konsolidieren die Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.opencode/skills/PAI/SKILL.md (2)
1111-1120:⚠️ Potential issue | 🟡 MinorKleine Inkonsistenz: "4 red lines" aber 6 aufgelistet.
Die Überschrift in Zeile 1111 erwähnt "4 red lines", aber es werden tatsächlich 6 Regeln aufgelistet:
- No tool calls in OBSERVE (außer TaskCreate, voice curls, CONTEXT RECOVERY)
- No agents for instant operations
- No silent stalls
- Don't create too few ISC
- No build drift (v1.3.0)
- No rubber-stamp verification (v1.3.0)
Vorschlag: Überschrift auf "6 red lines" aktualisieren oder die Struktur verdeutlichen (z. B. "4 ursprüngliche + 2 v1.3.0-Ergänzungen").
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.opencode/skills/PAI/SKILL.md around lines 1111 - 1120, The header "4 red lines — immediate self-correction if violated:" is inconsistent with the six rules that follow; change the header text to "6 red lines — immediate self-correction if violated:" or reword it to "4 original + 2 v1.3.0 additions — immediate self-correction if violated:" so it matches the listed rules (refer to the header line containing "4 red lines — immediate self-correction if violated:" and the six bullets beginning with "No tool calls in OBSERVE" through "No rubber-stamp verification (v1.3.0)").
454-567:⚠️ Potential issue | 🟡 MinorPRD-Schema-Dokumentation erfordert Klarstellung.
Die Dokumentation präsentiert zwei unterschiedliche PRD-Frontmatter-Schemata ohne klare Trennung ihrer Zwecke:
- Schema A (Zeilen 454–459, 118–131): 8 Felder —
task,slug,effort,phase,progress,mode,started,updated(optional:iteration)- Schema B (Zeilen 462–567): 14 Felder —
prd,id,status,mode,effort_level,created,updated,iteration,maxIterations,loopStatus,last_phase,failing_criteria,verification_summary,parent,childrenInkonsistenzen:
- Feldnamen unterscheiden sich (
effortvs.effort_level,startedvs.created)- Felder fehlen im Template (z. B.
task,phase,progress)- Das Template ist als "v1.0.0" gekennzeichnet, wird aber nicht als aktuelles Format dokumentiert
- Die referenzierte Datei
~/.opencode/skills/PAI/SYSTEM/PRDFORMAT.mdexistiert nicht im RepositoryEmpfehlung: Explizit dokumentieren, welches Schema die AI tatsächlich schreibt (Schema A) und ob Schema B ein Entwurf, veraltete Dokumentation oder zukünftiges Format ist. Falls zwei Schemata beabsichtigt sind, den Verwendungskontext für jedes Format deutlich kennzeichnen.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.opencode/skills/PAI/SKILL.md around lines 454 - 567, The PRD docs present two conflicting frontmatter schemas (Schema A using fields like task, slug, effort, phase, progress, mode, started, updated and Schema B / PRD Template v1.0.0 using prd, id, status, mode, effort_level, created, updated, iteration, maxIterations, loopStatus, last_phase, failing_criteria, verification_summary, parent, children) without clarifying which the AI should emit or whether both are valid; update the document to explicitly state the canonical schema the system will write (or mark the other as "deprecated" or "draft"), reconcile field-name mismatches (map effort→effort_level, started→created, add missing fields like task/phase/progress to the canonical spec or remove them), correct the PRD Template header if it is not the current format, and either create or remove the reference to ~/.opencode/skills/PAI/SYSTEM/PRDFORMAT.md so readers can find the authoritative format; reference the frontmatter field names above and the "PRD Template (v1.0.0)" block when making changes.
🧹 Nitpick comments (1)
.opencode/skills/PAI/SKILL.md (1)
157-157: Optionale Verbesserung: Sprachspezifizierer für Fenced Code Blocks hinzufügen.Die Static-Analysis hat vier Fenced Code Blocks ohne Sprachspezifizierer identifiziert. Das Hinzufügen von Sprachspezifizierern (z. B.
```yaml,```bash) würde die Syntax-Hervorhebung verbessern, ist aber gemäß den Coding Guidelines nicht verpflichtend.✨ Optionale Verbesserungen
Coarse (8 ISC — WRONG for Extended+): -``` +```markdown - [ ] ISC-1: Blog publishing workflow handles draft to published transitionAtomic (showing 3 of those same areas decomposed to ~12 criteria each): -``` +```markdown Draft-to-Published:**Entry banner was already printed by CLAUDE.md** before this file was loaded. The user has already seen: -``` +```text ♻︎ Entering the PAI ALGORITHM… (v3.7.0) ═════════════These are direct, synchronous calls. Do not send to background. The voice notification is part of the phase transition ritual. -``` +```textAlso applies to: 164-164, 197-197, 431-431
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.opencode/skills/PAI/SKILL.md at line 157, Several fenced code blocks in SKILL.md lack language specifiers; add appropriate language tags to improve syntax highlighting by updating the triple-backtick blocks that contain the snippets like " - [ ] ISC-1: Blog publishing workflow handles draft to published transition" (use ```markdown), the block starting with "Draft-to-Published:" (use ```markdown or ```text as appropriate), the block containing "♻︎ Entering the PAI ALGORITHM… (v3.7.0)" (use ```text or ```bash if it's console output), and the empty/final fenced block (use ```text or remove if unnecessary); locate these by searching for the exact strings and add the chosen language immediately after the opening ``` for each fenced code block.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In @.opencode/skills/PAI/SKILL.md:
- Around line 1111-1120: The header "4 red lines — immediate self-correction if
violated:" is inconsistent with the six rules that follow; change the header
text to "6 red lines — immediate self-correction if violated:" or reword it to
"4 original + 2 v1.3.0 additions — immediate self-correction if violated:" so it
matches the listed rules (refer to the header line containing "4 red lines —
immediate self-correction if violated:" and the six bullets beginning with "No
tool calls in OBSERVE" through "No rubber-stamp verification (v1.3.0)").
- Around line 454-567: The PRD docs present two conflicting frontmatter schemas
(Schema A using fields like task, slug, effort, phase, progress, mode, started,
updated and Schema B / PRD Template v1.0.0 using prd, id, status, mode,
effort_level, created, updated, iteration, maxIterations, loopStatus,
last_phase, failing_criteria, verification_summary, parent, children) without
clarifying which the AI should emit or whether both are valid; update the
document to explicitly state the canonical schema the system will write (or mark
the other as "deprecated" or "draft"), reconcile field-name mismatches (map
effort→effort_level, started→created, add missing fields like
task/phase/progress to the canonical spec or remove them), correct the PRD
Template header if it is not the current format, and either create or remove the
reference to ~/.opencode/skills/PAI/SYSTEM/PRDFORMAT.md so readers can find the
authoritative format; reference the frontmatter field names above and the "PRD
Template (v1.0.0)" block when making changes.
---
Nitpick comments:
In @.opencode/skills/PAI/SKILL.md:
- Line 157: Several fenced code blocks in SKILL.md lack language specifiers; add
appropriate language tags to improve syntax highlighting by updating the
triple-backtick blocks that contain the snippets like " - [ ] ISC-1: Blog
publishing workflow handles draft to published transition" (use ```markdown),
the block starting with "Draft-to-Published:" (use ```markdown or ```text as
appropriate), the block containing "♻︎ Entering the PAI ALGORITHM… (v3.7.0)"
(use ```text or ```bash if it's console output), and the empty/final fenced
block (use ```text or remove if unnecessary); locate these by searching for the
exact strings and add the chosen language immediately after the opening ``` for
each fenced code block.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.opencode/USER/.gitkeep.opencode/USER/README.md.opencode/skills/PAI/SKILL.mddocs/MIGRATION.md
💤 Files with no reviewable changes (1)
- .opencode/USER/README.md
- Fix '4 red lines' header to '6 red lines' (4 original + 2 v1.3.0 additions) - Clarify PRD frontmatter schema: v1.0.0 canonical vs legacy, with field mappings - Remove non-existent PRDFORMAT.md references - Add language specifiers to code blocks (markdown, text, bash) - Fix CI secret scanning to exclude process.env references (false positive)
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.opencode/skills/PAI/SKILL.md (1)
43-134:⚠️ Potential issue | 🟠 MajorPAI-v3.0-Skill-Struktur ist nicht klar als USE WHEN / MANDATORY / OPTIONAL ausgewiesen
Für ein Skill-Dokument unter
.opencode/skills/**fehlt hier eine explizit erkennbare Struktur mit den geforderten Abschnittstypen. Das erschwert standardisierte Skill-Auswertung und Drift-Prüfung.As per coding guidelines, "SKILL.md follows PAI v3.0 format (USE WHEN triggers, MANDATORY/OPTIONAL sections)".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.opencode/skills/PAI/SKILL.md around lines 43 - 134, The SKILL.md lacks explicit PAI v3.0 sections; add clear top-level headings "USE WHEN", "MANDATORY", and "OPTIONAL" to .opencode/skills/PAI/SKILL.md (near the "Intro to PAI" / before "RESPONSE DEPTH SELECTION") and move or duplicate relevant text under those headings so automated checks can parse triggers and required/optional content; ensure each item is a single-line bullet (8–12 words max for ISC-like criteria) and keep existing headings like "The Algorithm" and "ISC Decomposition" intact and referenced from MANDATORY where applicable so the document conforms to the SKILL.md PAI v3.0 structure.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.opencode/skills/PAI/SKILL.md:
- Line 73: Several headings in the document (e.g., "The Algorithm (v3.7.0 |
github.com/danielmiessler/TheAlgorithm)" and the other listed headings at the
noted locations) use ATX-style "#" headings but the repo linter expects
Setext-style; update each ATX header to the corresponding Setext underline form
(use "===" for top-level/title and "---" for second-level/subtitle as
appropriate) so the headings: "The Algorithm (v3.7.0 |
github.com/danielmiessler/TheAlgorithm)" and the other mentioned headings are
converted from "# ..." to the matching Setext underline form to satisfy MD003
and keep the file consistent with the configured markdown style.
- Around line 207-223: Die aktuelle PRD-Stub-Anweisung, die in der Anleitung zur
Erstellung von ~/.opencode/MEMORY/WORK/{slug}/PRD.md steht, erzeugt ein
Legacy-Frontmatter (task, slug, effort, phase, progress, started, updated) und
bricht so das kanonische v1.0.0-Schema; passe die Stub-Erstellung so an, dass
die Datei direkt das vorgeschlagene kanonische Frontmatter enthält (ersetze die
Felder task/slug/effort/phase/progress/started durch
prd/id/status/mode/effort_level/created/updated/iteration/maxIterations/loopStatus/last_phase/failing_criteria/verification_summary/parent/children
u.ä. genau wie im Vorschlag), damit PRD.md sofort im v1.0.0-Format angelegt wird
und keine nachträgliche Migration nötig ist.
- Around line 207-209: The doc contains contradictory instructions about when to
create the PRD: one section titled "PRD stub (MANDATORY — immediately after
voice curl)" and an earlier/later section that requires PRD creation only after
ISC creation; pick a single canonical order (recommend: create the PRD after ISC
creation), update both occurrences so they match, change the header "PRD stub
(MANDATORY — immediately after voice curl)" and the line "Create the PRD
directory and write a stub PRD with frontmatter only." to explicitly state
"Create PRD directory and write stub PRD after ISC creation (then run PRDSync to
show the session)", and remove any wording that implies immediate creation at
voice curl so both places reference the same sequence and rationale (ensure the
mkdir command remains but is documented in the single agreed spot).
- Line 432: Remove or fix the isolated triple-backtick fence found in the
SKILL.md content (the solitary "```" at the reported location); either delete
the stray fence or convert it into a proper fenced code block by adding a
matching opening fence with an optional language identifier and the
corresponding closing fence, ensuring the Markdownlint MD040 rule is satisfied
and the document's code fences are balanced.
---
Outside diff comments:
In @.opencode/skills/PAI/SKILL.md:
- Around line 43-134: The SKILL.md lacks explicit PAI v3.0 sections; add clear
top-level headings "USE WHEN", "MANDATORY", and "OPTIONAL" to
.opencode/skills/PAI/SKILL.md (near the "Intro to PAI" / before "RESPONSE DEPTH
SELECTION") and move or duplicate relevant text under those headings so
automated checks can parse triggers and required/optional content; ensure each
item is a single-line bullet (8–12 words max for ISC-like criteria) and keep
existing headings like "The Algorithm" and "ISC Decomposition" intact and
referenced from MANDATORY where applicable so the document conforms to the
SKILL.md PAI v3.0 structure.
| **Default:** FULL. MINIMAL is rare — only pure social interaction with zero task content. Short prompts can demand FULL depth. The word "just" does not reduce depth. | ||
|
|
||
| # The Algorithm (v1.8.0 | github.com/danielmiessler/TheAlgorithm) | ||
| # The Algorithm (v3.7.0 | github.com/danielmiessler/TheAlgorithm) |
There was a problem hiding this comment.
Heading-Style inkonsistent zur Projektregel (MD003)
Die geänderten Überschriften nutzen ATX, während der Linter für diese Datei Setext erwartet. Bitte konsistent auf den konfigurierten Stil umstellen, damit Doku-Lint sauber bleibt.
Also applies to: 75-75, 81-81, 93-93, 97-97, 116-116, 134-134, 193-193, 777-777, 789-789, 798-798
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 73-73: Heading style
Expected: setext; Actual: atx
(MD003, heading-style)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.opencode/skills/PAI/SKILL.md at line 73, Several headings in the document
(e.g., "The Algorithm (v3.7.0 | github.com/danielmiessler/TheAlgorithm)" and the
other listed headings at the noted locations) use ATX-style "#" headings but the
repo linter expects Setext-style; update each ATX header to the corresponding
Setext underline form (use "===" for top-level/title and "---" for
second-level/subtitle as appropriate) so the headings: "The Algorithm (v3.7.0 |
github.com/danielmiessler/TheAlgorithm)" and the other mentioned headings are
converted from "# ..." to the matching Setext underline form to satisfy MD003
and keep the file consistent with the configured markdown style.
| **PRD stub (MANDATORY — immediately after voice curl):** | ||
| Create the PRD directory and write a stub PRD with frontmatter only. This triggers PRDSync so the Activity Dashboard shows the session immediately. | ||
| 1. `mkdir -p ~/.opencode/MEMORY/WORK/{slug}/` (slug format: `YYYYMMDD-HHMMSS_kebab-task-description`) |
There was a problem hiding this comment.
Widerspruch bei PRD-Erstellungszeitpunkt (sofort vs. nach ISC-Erstellung)
Line 207-209 verlangt PRD-Erstellung unmittelbar beim Einstieg, Line 577-579 verlangt sie erst nach ISC-Erstellung. Diese widersprüchliche Reihenfolge macht den Ablauf nicht eindeutig und führt leicht zu fehlerhafter Tool-Orchestrierung.
Also applies to: 577-579
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.opencode/skills/PAI/SKILL.md around lines 207 - 209, The doc contains
contradictory instructions about when to create the PRD: one section titled "PRD
stub (MANDATORY — immediately after voice curl)" and an earlier/later section
that requires PRD creation only after ISC creation; pick a single canonical
order (recommend: create the PRD after ISC creation), update both occurrences so
they match, change the header "PRD stub (MANDATORY — immediately after voice
curl)" and the line "Create the PRD directory and write a stub PRD with
frontmatter only." to explicitly state "Create PRD directory and write stub PRD
after ISC creation (then run PRDSync to show the session)", and remove any
wording that implies immediate creation at voice curl so both places reference
the same sequence and rationale (ensure the mkdir command remains but is
documented in the single agreed spot).
- Update PRD stub creation to use canonical v1.0.0 frontmatter schema - Remove isolated triple-backtick fence at line 439 - Update CI secret scan to exclude .env.example files - Fix process.env filter in secret scanning
- Add .opencode/node_modules/ to .gitignore - Update CI secret scan to exclude node_modules directories
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.gitignore (1)
2-2: Redundante Ignore-Regel kann entfernt werden.
node_modules/(Line 1) ignoriert bereits auch.opencode/node_modules/. Die zusätzliche Regel erhöht nur Pflegeaufwand ohne funktionalen Mehrwert.Vorgeschlagene Vereinfachung
node_modules/ -.opencode/node_modules/🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.gitignore at line 2, Entferne die redundante .opencode/node_modules/ Eintrag aus .gitignore, da bereits node_modules/ (die existierende node_modules/ Regel) alle Unterverzeichnisse wie .opencode/node_modules/ abdeckt; suche nach der Regel ".opencode/node_modules/" und lösche sie, sodass nur die allgemeine "node_modules/"-Regel verbleibt.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.gitignore:
- Line 2: Entferne die redundante .opencode/node_modules/ Eintrag aus
.gitignore, da bereits node_modules/ (die existierende node_modules/ Regel) alle
Unterverzeichnisse wie .opencode/node_modules/ abdeckt; suche nach der Regel
".opencode/node_modules/" und lösche sie, sodass nur die allgemeine
"node_modules/"-Regel verbleibt.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/ci.yml.gitignore
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/ci.yml
- Add debug logging to show which files are being scanned - Show actual matches before filtering - Better error messages indicating which directory has issues
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 78-80: The workflow currently prints the full matched line
($FILTERED), risking exposure of secrets; update the logging to only report the
file and line number instead. Replace the echo "$FILTERED" with an output that
uses the filename/dir and the grep-provided line number (e.g., $dir:$lineno or
the grep -n match) and keep setting FOUND=1; ensure variables referenced are the
same ones used in the surrounding loop (FOUND, FILTERED, dir/lineno) so no
secret contents are printed to CI logs.
- Line 71: The secret-scan command stored in RESULT currently only includes
*.ts, *.js, and *.json so it misses YAML configs; update the grep invocation
that sets RESULT to also include YAML by adding --include="*.yaml" and
--include="*.yml" to the include list (keeping the existing
--exclude-dir="node_modules" and other flags) so files like
profiles/anthropic.yaml and profiles/openai.yaml are scanned for secrets.
- Include YAML files in secret scan (*.yaml, *.yml) - Exclude BountyPrograms.json (contains public bug bounty URLs, not secrets) - Show only file:line in error output, not content (security best practice)
- Use grep -v to filter out BountyPrograms.json after the main search - This file contains public bug bounty URLs that are false positives
Summary
This PR implements Work Package 1 (WP1) of PAI-OpenCode v3.0:
Changes
.opencode/USERdirectory mismatch vs upstream PAI #29): Remove obsolete root .opencode/USER/ directory, canonical path is .opencode/skills/PAI/USER/Files Changed
Verification
Closes #29
Summary by CodeRabbit
Versionshinweise
Dokumentation
Chores