skills/retrospect/SKILL.md
This skill reviews the current chat session and GitHub Copilot instructions to identify user-reported issues that should become new lessons, detect violations of existing instructions, and update instructions accordingly to prevent future mistakes.
npx skillsauth add cyberelf/agent_skills retrospectInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill performs meta-analysis on the current conversation and project instructions to continuously improve code and process quality and adherence to established patterns.
This skill helps maintain and improve the quality of AI-assisted development by:
Use this skill when:
Objective: Review the current chat session to identify learning opportunities.
Scan the conversation history for:
For each correction, determine:
Classify lessons by domain and type:
Objective: Verify compliance with existing standards and constitutions.
Read all relevant constitution and standards documents:
AGENTS.md - Agent architecture, behavior patterns, and operational guidelinesSDD files (Software Design Documents) - System design principles and requirements.github/constitution.md, docs/constitution.md).copilot-instructions.md or similar instruction filesDocument Discovery Strategy:
AGENTS.md in project root and docs folders*SDD.md, *design*.md, requirements.md).github/, docs/, or root directoryReview actions and outputs from the session against constitutions:
Compare user corrections with existing constitutions:
Objective: Formalize lessons learned into actionable constitutions.
Update Strategy:
For each identified gap or violation:
Structure:
## [Category]: [Specific Rule]
**Context**: [When does this apply?]
**Rule**: [What should be done?]
**Rationale**: [Why is this important?]
**Example** (if helpful):
```code
// Bad
[anti-pattern]
// Good
[correct pattern]
Related Instructions: [Link to related rules]
#### 3.2 Update Existing Constitutions
**In-Place Update Process**:
For violations of existing constitution rules:
- Clarify ambiguous language
- Add concrete examples relevant to the domain
- Strengthen weak guidelines (e.g., "should" → "must")
- Add cross-references to related rules
- Add "Common Mistakes" or "Anti-Patterns" sections
**Skill-Based Updates** (if available):
1. **Check for update skills**: Search for skills related to the constitution document
- `openspec-constitution-guard` for OpenSpec constitutions
- `agents-constitution-updater` for AGENTS.md
- Document-specific updater skills
2. **Invoke update skill**: If found, call the skill with:
- The lesson learned
- The violation context
- Proposed update text
- Rationale for the change
3. **Fallback to direct update**: If no skill exists, update the file directly
#### 3.3 Create New Constitution Entries
For lessons that don't fit existing documents, create or update appropriate constitution files:
**Location Options**:
- `.github/constitution.md` - General project principles
- `AGENTS.md` - Agent-specific behaviors and patterns
- `docs/constitution.md` - Domain-specific guidelines
- Skill-specific constitutions in `skills/[skill-name]/constitution.md`
**Format**:
```markdown
# Project Constitution
This document captures project-specific principles and lessons learned.
## [Principle Name]
**Date Added**: YYYY-MM-DD
**Origin**: [What situation led to this principle?]
**Principle**: [Clear statement of the rule]
**Application**: [How to apply this in practice]
**Examples**: [Concrete examples]
Objective: Ensure updates are effective and non-disruptive.
Provide a summary:
## Retrospect Summary
### Lessons Learned
1. [Lesson 1]: [What was learned and why]
2. [Lesson 2]: [What was learned and why]
### Instructions Updated
- **File**: [filename]
- **Section**: [section name]
- **Change**: [what was changed]
- **Reason**: [why it was changed]
### New Violations Detected
1. [Violation 1]: [Description and location]
2. [Violation 2]: [Description and location]
### Recommendations
- [Action item 1]
- [Action item 2]
The retrospect process should produce:
Retrospect Report (printed to console):
Updated Constitution Files:
AGENTS.md with updated agent behaviors and principlesconstitution.md files with clarifications and new rulesAction Items:
Constitutions
User Correction: "Don't skip the validation step - always validate inputs before processing"
Analysis:
Constitution Update (AGENTS.md):
### Input Validation Protocol
**Context**: All agent operations that accept external inputs
**Rule**: Input validation MUST occur before any processing or state changes.
**Rationale**: Prevents cascading errors and ensures data integrity throughout the system.
**Process**:
1. Receive input
2. Validate structure and constraints
3. Transform to internal representation
4. Process validated data
**Anti-Pattern**: Processing data before validation
**Related**: See "Error Handling Standards" and "State Management"
User Correction: "This agent shouldn't be making decisions about deployment - that's the DevOps agent's responsibility"
Analysis:
Constitution Update (AGENTS.md):
### Agent Responsibility Boundaries
**Context**: Multi-agent system with defined roles
**Rule**: Each agent MUST operate only within its defined domain. Cross-domain decisions require delegation to the appropriate agent.
**[AgentName] Responsibilities**:
- [Primary responsibility 1]
- [Primary responsibility 2]
**NOT Responsible For**:
- Deployment decisions → DevOps Agent
- Security policies → Security Agent
- Resource allocation → Resource Manager Agent
**Delegation Protocol**: When encountering a task outside your domain:
1. Identify the appropriate agent
2. Format the delegation request
3. Hand off with full context
4. Wait for response or acknowledgment
**Rationale**: Maintains clear separation of concerns and prevents conflicting decisions.
AGENTS.mdspec/ or docs/.github/constitution.md, docs/constitution.mdskills/openspec-constitution-guard/, skills/*/constitution.mdThis skill itself should evolve:
The meta-goal is to make AI-assisted development increasingly accurate and aligned with project standards over time.
tools
Agent-first graph-backed knowledge wiki builder with a self-contained CLI. Use for Graphwiki init/build/ingest/update, source indexing, semantic entity and relationship extraction, generated wiki pages, graph JSON/HTML explorer, evidence line ranges, query/explain question answering, synthesis pages, HTML reports, adding confirmed entity types, applying patches, cleanup, validation, tasks, and SQLite cache generation.
development
Use when the user asks to export a local HTML file, web page, or invitation page to a single-page PDF, a no-pagination PDF, a long PDF with auto-calculated height, or a PDF without headers and footers. Trigger on phrases like 单页 PDF, 不分页, 自动计算长度, 长图 PDF, 去掉页眉页脚, export HTML to single-page PDF, or print page to one PDF page.
development
Build and expand an insight-ready raw-material layer by discovering page-level sources, deduplicating them with an internal pre-crawl link index, capturing raw Markdown, verifying metadata in place, and keeping ingest/register state aligned. Use for additive source harvesting, raw webpage capture, source registry maintenance, source/ingest tracking, source/raw downloads, and in-place verification rather than final synthesis.
development
Generate a structured, illustrated Q&A HTML document from the current conversation. Scans the conversation for conceptual questions the user asked and Claude's answers, then produces a self-contained HTML file with styled cards and SVG diagrams for technical/architectural topics. If a Q&A HTML file already exists in the current project directory, appends the new Q&As to it instead of creating a new file. Trigger this skill whenever the user asks to "generate Q&A", "create Q&A from conversation", "save Q&A", "document our Q&A", "turn this chat into Q&A", or anything suggesting they want the conversation's questions and answers captured as a document — even if they don't use the exact phrase "Q&A skill".