Skip to content

feat(skills): retrospect — evidence-grounded session retrospection - #73

Open
chitcommit wants to merge 1 commit into
mainfrom
feat/skill-retrospect
Open

chitcommit wants to merge 1 commit into
mainfrom
feat/skill-retrospect

Conversation

@chitcommit

@chitcommit chitcommit commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

New skill: retrospect

Three-phase process — Reflect → Validate → Distill — for turning session work into generalizable principles.

The validate phase treats the reflection itself as a hypothesis and checks it against the transcript. Prevents compounding unvalidated self-assessments across sessions.

Plugin: chittyos-core | Canon URI: chittycanon://core/services/chittymarket#skills/retrospect
Triggers: retrospect, reflect on this session, after-action review, distill learnings, what did we learn

Emerged from foundationagents session 2026-07-29 — 72 turns, 21-response debug loop, 3 architecture corrections.

Summary by CodeRabbit

  • New Features
    • Added an evidence-grounded retrospection skill.
    • Guides reflection, validation against transcripts or logs, and distillation of reusable principles.
    • Includes correction rules, anti-pattern guidance, validation examples, and a standardized output format.
    • Supports saving dated retrospection artifacts.
  • Configuration
    • Added dispatch state to synchronize the skill’s target revisions across supported environments.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an evidence-grounded retrospect skill with Reflect, Validate, and Distill phases, validation examples, anti-patterns, output requirements, artifact-saving conventions, and dispatch metadata for supported runtimes.

Changes

Retrospect skill

Layer / File(s) Summary
Canonical definition and dispatch metadata
canonical/skills/retrospect.md, canonical/.dispatch-state/skills/retrospect.json
Defines the skill workflow, validation rules, output format, artifact path, and runtime target SHAs.
Codex skill specification
plugins/chittyos-core/codex-skills/retrospect/SKILL.md
Adds the Codex skill metadata and complete three-phase retrospection instructions.
Core skill specification
plugins/chittyos-core/skills/retrospect/SKILL.md
Adds the core plugin skill metadata, retrospection phases, validation guidance, anti-patterns, and artifact format.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the new retrospection skill and its evidence-grounded workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/skill-retrospect

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@canonical/skills/retrospect.md`:
- Around line 87-91: Update the output-format example fence to use the markdown
language identifier in all three locations: canonical/skills/retrospect.md lines
87-91, plugins/chittyos-core/codex-skills/retrospect/SKILL.md lines 78-82, and
plugins/chittyos-core/skills/retrospect/SKILL.md lines 78-82. Change each
opening fence while preserving the example content.
- Around line 49-60: Update both transcript-processing commands in
canonical/skills/retrospect.md (lines 49-60),
plugins/chittyos-core/codex-skills/retrospect/SKILL.md (lines 40-51), and
plugins/chittyos-core/skills/retrospect/SKILL.md (lines 40-51) to pass
TRANSCRIPT_PATH as a command-line argument rather than embedding it in shell or
Python source. Ensure both grep and the Python invocation safely handle spaces
and metacharacters without interpolation.
- Around line 48-60: Replace the separate grep and ad hoc Python checks with one
schema-aware transcript parser that parses each record, counts records whose
type is USER_INPUT, detects premature completion claims from PLANNER_RESPONSE
content, and explicitly handles malformed records. Apply the same parser and
behavior in canonical/skills/retrospect.md lines 48-60,
plugins/chittyos-core/codex-skills/retrospect/SKILL.md lines 39-51, and
plugins/chittyos-core/skills/retrospect/SKILL.md lines 39-51.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c2dcd27-9a8f-4e66-8003-70ea05c47996

📥 Commits

Reviewing files that changed from the base of the PR and between 59c7571 and 86932dd.

📒 Files selected for processing (4)
  • canonical/.dispatch-state/skills/retrospect.json
  • canonical/skills/retrospect.md
  • plugins/chittyos-core/codex-skills/retrospect/SKILL.md
  • plugins/chittyos-core/skills/retrospect/SKILL.md

Comment on lines +48 to +60
# Count actual user turns
grep -c '"type":"USER_INPUT"' $TRANSCRIPT_PATH

# Find premature completion claims
python3 -c "
import json
with open('$TRANSCRIPT_PATH') as f:
for line in f:
d = json.loads(line)
if d.get('type') == 'PLANNER_RESPONSE':
c = str(d.get('content',''))
if any(w in c.lower() for w in ['complete', 'done', 'migrated', 'finished']):
print(d.get('step_index'), c[:100])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use one schema-aware transcript parser for validation.

  • canonical/skills/retrospect.md#L48-L60: count parsed type fields and define malformed-record handling.
  • plugins/chittyos-core/codex-skills/retrospect/SKILL.md#L39-L51: apply the same parser.
  • plugins/chittyos-core/skills/retrospect/SKILL.md#L39-L51: apply the same parser.
📍 Affects 3 files
  • canonical/skills/retrospect.md#L48-L60 (this comment)
  • plugins/chittyos-core/codex-skills/retrospect/SKILL.md#L39-L51
  • plugins/chittyos-core/skills/retrospect/SKILL.md#L39-L51
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@canonical/skills/retrospect.md` around lines 48 - 60, Replace the separate
grep and ad hoc Python checks with one schema-aware transcript parser that
parses each record, counts records whose type is USER_INPUT, detects premature
completion claims from PLANNER_RESPONSE content, and explicitly handles
malformed records. Apply the same parser and behavior in
canonical/skills/retrospect.md lines 48-60,
plugins/chittyos-core/codex-skills/retrospect/SKILL.md lines 39-51, and
plugins/chittyos-core/skills/retrospect/SKILL.md lines 39-51.

Comment on lines +49 to +60
grep -c '"type":"USER_INPUT"' $TRANSCRIPT_PATH

# Find premature completion claims
python3 -c "
import json
with open('$TRANSCRIPT_PATH') as f:
for line in f:
d = json.loads(line)
if d.get('type') == 'PLANNER_RESPONSE':
c = str(d.get('content',''))
if any(w in c.lower() for w in ['complete', 'done', 'migrated', 'finished']):
print(d.get('step_index'), c[:100])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Pass TRANSCRIPT_PATH as an argument, not embedded source. The current shell/Python interpolation is unsafe for paths containing spaces or metacharacters and can become code injection if the runtime-controlled path is not trusted.

  • canonical/skills/retrospect.md#L49-L60: replace both commands with argument-based invocation.
  • plugins/chittyos-core/codex-skills/retrospect/SKILL.md#L40-L51: apply the same safe invocation.
  • plugins/chittyos-core/skills/retrospect/SKILL.md#L40-L51: apply the same safe invocation.
📍 Affects 3 files
  • canonical/skills/retrospect.md#L49-L60 (this comment)
  • plugins/chittyos-core/codex-skills/retrospect/SKILL.md#L40-L51
  • plugins/chittyos-core/skills/retrospect/SKILL.md#L40-L51
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@canonical/skills/retrospect.md` around lines 49 - 60, Update both
transcript-processing commands in canonical/skills/retrospect.md (lines 49-60),
plugins/chittyos-core/codex-skills/retrospect/SKILL.md (lines 40-51), and
plugins/chittyos-core/skills/retrospect/SKILL.md (lines 40-51) to pass
TRANSCRIPT_PATH as a command-line argument rather than embedding it in shell or
Python source. Ensure both grep and the Python invocation safely handle spaces
and metacharacters without interpolation.

Comment on lines +87 to +91
```
**[Principle name]**
One sentence of the generalizable claim.
One sentence of what it looks like when violated.
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add markdown to the output-format fences.

  • canonical/skills/retrospect.md#L87-L91: change the opening fence to ```markdown.
  • plugins/chittyos-core/codex-skills/retrospect/SKILL.md#L78-L82: change the opening fence to ```markdown.
  • plugins/chittyos-core/skills/retrospect/SKILL.md#L78-L82: change the opening fence to ```markdown.
🧰 Tools
🪛 markdownlint-cli2 (0.23.1)

[warning] 87-87: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

📍 Affects 3 files
  • canonical/skills/retrospect.md#L87-L91 (this comment)
  • plugins/chittyos-core/codex-skills/retrospect/SKILL.md#L78-L82
  • plugins/chittyos-core/skills/retrospect/SKILL.md#L78-L82
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@canonical/skills/retrospect.md` around lines 87 - 91, Update the
output-format example fence to use the markdown language identifier in all three
locations: canonical/skills/retrospect.md lines 87-91,
plugins/chittyos-core/codex-skills/retrospect/SKILL.md lines 78-82, and
plugins/chittyos-core/skills/retrospect/SKILL.md lines 78-82. Change each
opening fence while preserving the example content.

Source: Linters/SAST tools

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 86932dd328

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


```bash
# Count actual user turns
grep -c '"type":"USER_INPUT"' $TRANSCRIPT_PATH

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve runtime paths before running validation

When this projection runs in the inspected Codex runtime, neither TRANSCRIPT_PATH nor the later ARTIFACTS_DIR is supplied, and a repo-wide search finds no initializer or fallback for either variable. Consequently grep reads from stdin, the Python command attempts open(''), and the report destination is unresolved, so a normal invocation cannot validate or persist the retrospect; derive documented runtime-specific paths or explicitly require and validate these variables.

Useful? React with 👍 / 👎.

with open('$TRANSCRIPT_PATH') as f:
for line in f:
d = json.loads(line)
if d.get('type') == 'PLANNER_RESPONSE':

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Parse Codex's native rollout record shape

When TRANSCRIPT_PATH is manually pointed at a native Codex rollout, its top-level record types are values such as response_item and event_msg, with user/assistant messages nested under payload; neither USER_INPUT nor PLANNER_RESPONSE occurs. These predicates therefore report zero user turns and no completion claims even for a populated session, making the evidence-validation phase silently produce false results; use a runtime-specific parser or normalize transcripts before applying these checks.

Useful? React with 👍 / 👎.

**[Name]** — [claim]. Violated when [symptom].
```

Save to: `$ARTIFACTS_DIR/retrospect-[YYYY-MM-DD].md`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Give each retrospect artifact a unique filename

When more than one session is retrospectively reviewed on the same date, every invocation targets the identical filename, so the later report can overwrite the earlier session's evidence and principles. Include a timestamp, session/thread identifier, or explicit collision handling in the prescribed output path.

Useful? React with 👍 / 👎.

@@ -0,0 +1,112 @@
---
name: retrospect

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bump the plugin version so installed caches receive the skill

For existing Claude Code marketplace installations, this new packaged skill will not propagate because the commit leaves both plugins/chittyos-core/.claude-plugin/plugin.json and the generated marketplace entry at version 1.1.0. Installed plugin caches are version-pinned—the repository previously had to repair stranded chittyos-core agents for this exact missing-version-bump failure—so plugin update can retain the old package without retrospect; increment the plugin version and regenerate the marketplace metadata.

Useful? React with 👍 / 👎.

d = json.loads(line)
if d.get('type') == 'PLANNER_RESPONSE':
c = str(d.get('content',''))
if any(w in c.lower() for w in ['complete', 'done', 'migrated', 'finished']):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Distinguish denials from completion claims

When a planner response says something such as “the migration is not complete,” “this remains unfinished,” or “the prior change was undone,” the substring test still classifies it as a candidate premature completion claim. This can make the validation report attribute exactly the opposite assertion to the transcript; detect affirmative completion assertions with their surrounding context instead of treating any occurrence of these substrings as evidence.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant