Capture solved problems as categorized documentation with YAML frontmatter for fast lookup
Automatically documents solved problems as structured YAML-markdown files in category-based directories for future search and reference. Triggers after phrases like "that worked" or via `/report-fix` command, capturing context, validating schema, and creating searchable knowledge base entries.
/plugin marketplace add majesticlabs-dev/majestic-marketplace/plugin install majestic-engineer@majestic-marketplaceThis skill is limited to using the following tools:
assets/critical-pattern-template.mdassets/resolution-template.mdreferences/yaml-schema.mdschema.yamlPurpose: Automatically document solved problems to build searchable institutional knowledge with category-based organization (enum-validated problem types).
This skill captures problem solutions immediately after confirmation, creating structured documentation that serves as a searchable knowledge base for future sessions.
Organization: Single-file architecture - each problem documented as one markdown file in its symptom category directory within lessons_path (default: .claude/lessons/, e.g., {lessons_path}/performance-issues/n-plus-one-queries.md). Files use YAML frontmatter for metadata and searchability. Lessons with workflow_phase fields are automatically discoverable by the lessons-discoverer agent.
<critical_sequence name="documentation-capture" enforce_order="strict">
Auto-invoke after phrases:
OR manual: /report-fix command
Non-trivial problems only:
Skip documentation for:
Extract from conversation history:
Required information:
Environment details:
BLOCKING REQUIREMENT: If critical context is missing (module name, exact error, or resolution steps), ask user and WAIT for response before proceeding to Step 3:
I need a few details to document this properly:
1. Which module had this issue? [ModuleName]
2. What was the exact error message or symptom?
[Continue after user provides details]
</step>
<step number="3" required="false" depends_on="2">
### Step 3: Check Existing Docs
Read lessons_path from config and search for similar issues:
# Get lessons path from config (default: .claude/lessons/)
LESSONS_PATH=$(claude -p "/majestic:config lessons_path .claude/lessons/")
# Search by error message keywords
grep -r "exact error phrase" "$LESSONS_PATH/"
# Search by symptom category
ls "$LESSONS_PATH/[category]/"
IF similar issue found:
THEN present decision options:
Found similar issue: docs/solutions/[path]
What's next?
1. Create new doc with cross-reference (recommended)
2. Update existing doc (only if same root cause)
3. Other
Choose (1-3): _
WAIT for user response, then execute chosen action.
ELSE (no similar issue found):
Proceed directly to Step 4 (no user interaction needed). </step>
<step number="4" required="true" depends_on="2"> ### Step 4: Generate FilenameFormat: [sanitized-symptom]-[module]-[YYYYMMDD].md
Sanitization rules:
Examples:
missing-import-auth-module-20251110.mdparameter-not-saving-state-api-20251110.mdwebview-crash-on-resize-frontend-20251110.md
</step>
Important: All docs require validated YAML frontmatter with enum validation.
<validation_gate name="yaml-schema" blocking="true">
Validate against schema:
Load schema.yaml and classify the problem against the enum values defined in references/yaml-schema.md. Ensure all required fields are present and match allowed values exactly.
BLOCK if validation fails:
YAML validation failed
Errors:
- problem_type: must be one of schema enums, got "compilation_error"
- severity: must be one of [critical, high, medium, low], got "severe"
- symptoms: must be array with 1-5 items, got string
Please provide corrected values.
GATE ENFORCEMENT: Do NOT proceed to Step 6 (Create Documentation) until YAML frontmatter passes all validation rules defined in schema.yaml.
</validation_gate> </step>
<step number="6" required="true" depends_on="5"> ### Step 6: Create DocumentationRead lessons_path from config:
LESSONS_PATH=$(claude -p "/majestic:config lessons_path .claude/lessons/")
Determine category from problem_type: Use the category mapping defined in references/yaml-schema.md.
Create documentation file:
PROBLEM_TYPE="[from validated YAML]"
CATEGORY="[mapped from problem_type]"
FILENAME="[generated-filename].md"
DOC_PATH="${LESSONS_PATH}/${CATEGORY}/${FILENAME}"
# Create directory if needed
mkdir -p "${LESSONS_PATH}/${CATEGORY}"
# Write documentation using template from assets/resolution-template.md
# (Content populated with Step 2 context and validated YAML frontmatter)
Result:
Create documentation: Populate the structure from assets/resolution-template.md with context gathered in Step 2 and validated YAML frontmatter from Step 5.
Discovery opt-in: If this lesson should surface automatically during workflows, add the optional discovery fields (lesson_type, workflow_phase, tech_stack, impact, keywords) to the frontmatter. </step>
<step number="7" required="false" depends_on="6"> ### Step 7: Cross-Reference & Critical Pattern DetectionIf similar issues found in Step 3:
Update existing doc:
# Add Related Issues link to similar doc
echo "- See also: [$FILENAME]($REAL_FILE)" >> [similar-doc.md]
Update new doc: Already includes cross-reference from Step 6.
Update patterns if applicable:
If this represents a common pattern (3+ similar issues):
# Add to docs/solutions/patterns/common-solutions.md
cat >> docs/solutions/patterns/common-solutions.md << 'EOF'
## [Pattern Name]
**Common symptom:** [Description]
**Root cause:** [Technical explanation]
**Solution pattern:** [General approach]
**Examples:**
- [Link to doc 1]
- [Link to doc 2]
- [Link to doc 3]
EOF
Critical Pattern Detection (Optional Proactive Suggestion):
If this issue has automatic indicators suggesting it might be critical:
critical in YAMLThen in the decision menu (Step 8), add a note:
This might be worth adding to Critical Patterns (Option 2)
But don't auto-promote. User decides via decision menu (Option 2).
Template for critical pattern addition:
When user selects Option 2 (Add to Critical Patterns), use the template from assets/critical-pattern-template.md to structure the pattern entry.
</step>
</critical_sequence>
<decision_gate name="post-documentation" wait_for_user="true">
After successful documentation, present options and WAIT for user response:
Solution documented
File created:
- {lessons_path}/[category]/[filename].md
What's next?
1. Continue workflow (recommended)
2. Add to Critical Patterns - Promote to critical-patterns.md
3. Link related issues - Connect to similar problems
4. Add to existing skill - Add to a learning skill
5. Create new skill - Extract into new learning skill
6. View documentation - See what was captured
7. Enable discovery - Add workflow_phase fields for auto-discovery
8. Other
Handle responses:
Option 1: Continue workflow
Option 2: Add to Critical Patterns
User selects this when:
Action:
docs/solutions/patterns/critical-patterns.mdOption 3: Link related issues
Option 4: Add to existing skill
User selects this when the documented solution relates to an existing learning skill:
Action:
Option 5: Create new skill
User selects this when the solution represents the start of a new learning domain:
Action:
Option 6: View documentation
Option 7: Enable discovery
User selects this to make the lesson discoverable by lessons-discoverer agent:
Action:
workflow_phase: Selected phasestech_stack: Selected stackslesson_type: Selected typeimpact: Derived from severity (critical→blocks_work, high→major_time_sink, medium/low→minor_inconvenience)keywords: Extract from tags + symptom keywordsOption 8: Other
</decision_gate>
<integration_protocol>
Invoked by:
Invokes:
Handoff expectations: All context needed for documentation should be present in conversation history before invocation.
</integration_protocol>
<success_criteria>
Documentation is successful when ALL of the following are true:
</success_criteria>
Missing context:
YAML validation failure:
Similar issue ambiguity:
MUST do:
mkdir -p)MUST NOT do:
Good documentation has:
Avoid:
User: "That worked! The N+1 query is fixed."
Skill activates:
includes(:profile) on User modeln-plus-one-user-queries-UserService-20251110.mdmodule: User Service
date: 2025-11-10
problem_type: performance_issue
component: model
symptoms:
- "N+1 query when loading user records"
- "API response taking >5 seconds"
root_cause: missing_eager_load
severity: high
tags: [n-plus-one, eager-loading, performance]
Valid{lessons_path}/performance-issues/n-plus-one-user-queries-UserService-20251110.mdOutput:
Solution documented
File created:
- {lessons_path}/performance-issues/n-plus-one-user-queries-UserService-20251110.md
What's next?
1. Continue workflow (recommended)
2. Add to Critical Patterns - Promote to critical-patterns.md
3. Link related issues - Connect to similar problems
4. Add to existing skill - Add to a learning skill
5. Create new skill - Extract into new learning skill
6. View documentation - See what was captured
7. Enable discovery - Add workflow_phase fields for auto-discovery
8. Other
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.