joy-check · diff
git:20260919.28d30f9 to git:20260920.c4063a3
60 added, 87 removed. Audit A to A.
---
name: joy-check
description: "Validate content framing on joy-grievance spectrum."
user-invocable: false
argument-hint: "[--fix] [--strict] [--mode writing|instruction] <file>"
command: /joy-check
allowed-tools:
- Read
- Write
- Edit
- Bash
- Grep
- Glob
routing:
triggers:
- joy check
- check framing
- tone check
- negative framing
- joy validation
- too negative
- reframe positively
- positive framing check
- instruction framing
pairs_with:
- writing
- toolkit
complexity: Simple
category: content
---
# Joy Check
- Validate content framing using mode-specific rubrics. Two modes:
+ Two modes:
- - **writing** — Joy-grievance spectrum for human-facing content (blog posts, emails, articles). Evaluates whether content frames experiences through curiosity and generosity rather than grievance and accusation.
- - **instruction** — Positive framing validation for LLM-facing content (agents, skills, pipelines). Evaluates whether instructions tell the reader what to do rather than what to avoid (ADR-127).
+ - **writing** — Joy-grievance spectrum for human-facing content (blog posts, emails, articles). Evaluates curiosity/generosity vs. grievance/accusation framing.
+ - **instruction** — Positive framing for LLM-facing content (agents, skills, pipelines). Evaluates "what to do" vs. "what to avoid" (ADR-127).
- By default the skill evaluates each paragraph/instruction independently, produces a score (0-100), and suggests reframes without modifying content. Optional flags: `--fix` rewrites flagged items in place and re-verifies; `--strict` fails on any item below 60; `--mode writing|instruction` overrides auto-detection.
+ Evaluates each paragraph/instruction independently, produces a score (0-100), suggests reframes without modifying content. Flags: `--fix` rewrites flagged items in place and re-verifies; `--strict` fails on any item below 60; `--mode writing|instruction` overrides auto-detection.
- This skill checks *framing*, not *topic* and not *voice*. Voice fidelity belongs to voice-validator, AI pattern detection belongs to the private de-AI editor skill.
+ Checks *framing*, not *topic* or *voice*. The writing workflow owns voice fidelity and AI-pattern detection.
- ## Deep References
+ ## Reference Loading Table
- | When | Load | Content |
+ | Signal | Load These Files | Why |
|---|---|---|
- | Scoring instruction files (agents, skills, pipelines) | `references/instruction-rubric.md` | Positive-framing patterns, rewrite rules, scoring, examples |
- | Scoring human-facing prose (blog posts, emails, docs) | `references/writing-rubric.md` | Joy-grievance spectrum, subtle patterns, scoring, examples |
+ | Scoring agents, skills, pipelines, or toolkit documentation | `references/instruction-rubric.md` | Positive-framing patterns, scoring, and examples. |
+ | Scoring articles, emails, posts, or other human-facing prose | `references/writing-rubric.md` | Joy-grievance patterns, scoring, and examples. |
## Instructions
### Phase 0: DETECT MODE
- **Goal**: Determine which rubric to apply based on file location or explicit flag.
-
- **Auto-detection rules** (in priority order):
- 1. Explicit `--mode writing|instruction` flag → use that mode
- 2. File in `agents/*.md` → **instruction**
- 3. File in `skills/*/SKILL.md` → **instruction**
- 4. File in `skills/workflow/references/*.md` → **instruction**
- 5. File is `CLAUDE.md` or `README.md` → **instruction**
+ Auto-detection (priority order):
+ 1. Explicit `--mode` flag → use that
+ 2. `agents/*.md` → **instruction**
+ 3. `skills/*/SKILL.md` → **instruction**
+ 4. `skills/workflow/references/*.md` → **instruction**
+ 5. `CLAUDE.md` or `README.md` → **instruction**
6. Everything else → **writing**
- **Load the rubric**: Read `references/{mode}-rubric.md` for the scoring criteria, patterns, and examples relevant to this mode.
+ Load `references/{mode}-rubric.md` for scoring criteria and examples.
- **GATE**: Mode determined, rubric loaded. Proceed to Phase 1.
+ **GATE**: Mode determined, rubric loaded.
### Phase 1: PRE-FILTER
- **Goal**: Use regex scanning as a fast gate to catch obvious patterns before spending LLM tokens on semantic analysis.
+ Regex scanning as a fast gate before LLM semantic analysis.
- **For writing mode**: Run the regex-based scanner for grievance patterns:
+ **Writing mode**:
```bash
python3 ~/.claude/scripts/scan-negative-framing.py [file]
```
- **For instruction mode**: Run a grep scan for prohibition patterns:
+ **Instruction mode**:
```bash
grep -nE 'NEVER|do NOT|must NOT|FORBIDDEN' [file]
grep -nE "^-?\s*Don't|^-?\s*Avoid|^#+.*Anti-[Pp]attern|^#+.*Avoid" [file]
```
- **Handle hits**: Report findings with suggested reframes from the loaded rubric. If `--fix` mode is active, apply reframes and re-run to confirm clean.
+ Report findings with reframe suggestions from the rubric. If `--fix`, apply reframes and re-run.
- **GATE**: Regex/grep scan returns zero hits. Resolve obvious patterns before proceeding to Phase 2 — mechanical fixes come first.
+ **GATE**: Zero regex/grep hits. Resolve obvious patterns before Phase 2.
### Phase 2: ANALYZE
- **Goal**: Read the content and evaluate each item against the loaded rubric using LLM semantic understanding.
-
- **Step 1: Read the content**
-
- Read the full file. Skip frontmatter (YAML between `---` markers) and code blocks.
+ **Step 1: Read content**
- - **Writing mode**: Identify paragraph boundaries (blank-line separated blocks). Skip blockquotes.
- - **Instruction mode**: Identify each instructional statement — bullet points, table cells, imperative sentences, section headings. Skip examples, code blocks, quoted user dialogue, and file path references.
+ Read full file. Skip frontmatter and code blocks.
+ - **Writing**: Identify paragraphs (blank-line separated). Skip blockquotes.
+ - **Instruction**: Identify instructional statements — bullets, table cells, imperatives, headings. Skip examples, code blocks, quoted dialogue, file paths.
- **Step 2: Evaluate against the rubric**
+ **Step 2: Evaluate against rubric**
- Apply the scoring dimensions from the loaded rubric (`references/{mode}-rubric.md`). Each rubric defines its own PASS/FAIL dimensions, subtle patterns to detect, and contextual exceptions.
+ Apply scoring dimensions from `references/{mode}-rubric.md`.
- For **writing mode**: Evaluate through the joy-grievance lens. Watch for the subtle patterns described in `references/writing-rubric.md` (defensive disclaimers, accumulative grievance, passive-aggressive factuality, reluctant generosity).
+ For **writing**: Joy-grievance lens. Watch for subtle patterns in `references/writing-rubric.md` (defensive disclaimers, accumulative grievance, passive-aggressive factuality, reluctant generosity).
- For **instruction mode**: Evaluate through the positive-negative lens. Check each instruction against the patterns table in `references/instruction-rubric.md`. Apply contextual exceptions — subordinate negatives attached to positive instructions are PASS, as are negatives in code examples, writing samples, and technical terms.
+ For **instruction**: Positive-negative lens. Check against patterns table in `references/instruction-rubric.md`. Contextual exceptions: subordinate negatives attached to positive instructions are PASS, as are negatives in code examples, writing samples, and technical terms.
**Step 3: Score each item**
- Apply the scoring scale from the loaded rubric. For any item scoring in the lower tiers (CAUTION/GRIEVANCE for writing, NEGATIVE-LEANING/PROHIBITION-HEAVY for instruction), draft a specific reframe suggestion that preserves the substance while shifting the framing.
+ Apply the rubric's scoring scale. For items scoring CAUTION/GRIEVANCE (writing) or NEGATIVE-LEANING/PROHIBITION-HEAVY (instruction), draft specific reframe suggestions preserving substance.
- When an item seems subtle enough to question flagging — that is precisely when flagging matters most. Subtle patterns are what the regex/grep pre-filter misses, making them the primary purpose of this LLM analysis phase.
+ If an item seems "too subtle to flag" — that is precisely when flagging matters. Subtle patterns are the primary purpose of this LLM phase.
- **GATE**: All items analyzed and scored. Reframe suggestions drafted for all flagged items. Proceed to Phase 3.
+ **GATE**: All items scored. Reframe suggestions drafted for flagged items.
### Phase 3: REPORT
- **Goal**: Produce a structured report with scores, findings, and reframe suggestions.
-
**Step 1: Calculate overall score**
- Average all item scores. Pass criteria come from the loaded rubric:
- - **Writing mode**: Score >= 60 AND no GRIEVANCE paragraphs
- - **Instruction mode**: Score = 100 AND zero primary negative patterns in instructional context
+ Average all item scores. Pass criteria:
+ - **Writing**: Score >= 60 AND no GRIEVANCE paragraphs
+ - **Instruction**: Score >= 60 AND no primary negative patterns in instructional context
- **Step 2: Output the report**
+ **Step 2: Output**
```
JOY CHECK: [file]
Mode: [writing|instruction]
Score: [0-100]
Status: PASS / FAIL
Items:
[writing mode]
P1 (L10-12): JOY [85] -- explorer framing, curiosity
P3 (L18-22): CAUTION [40] -- "confused" leans defensive
-> Reframe: Focus on what you learned from the confusion
[instruction mode]
L33: NEGATIVE [20] -- "NEVER edit code directly"
-> Rewrite: "Route all code modifications to domain agents"
L45: PASS [90] -- "Create feature branches for all changes"
L78: PASS [85] -- "Credentials stay in .env files, never in code" (subordinate negative OK)
Overall: [summary of framing arc]
```
- **Step 3: Handle fix mode**
+ **Step 3: Fix mode**
- If `--fix` mode is active:
- 1. Rewrite flagged items using the drafted reframe suggestions
- 2. Preserve the substance — change only the framing
- 3. Re-run Phase 2 analysis on rewritten items to verify fixes landed
- 4. If fixes introduce new flagged items, iterate (maximum 3 attempts)
+ If `--fix`:
+ 1. Rewrite flagged items using drafted suggestions
+ 2. Preserve substance — change only framing
+ 3. Re-run Phase 2 on rewrites to verify
+ 4. Maximum 3 iterations if fixes introduce new flags
- **GATE**: Report produced. If `--fix`, all rewrites applied and re-verified. Joy check complete.
+ **GATE**: Report produced. If `--fix`, all rewrites applied and re-verified.
---
### Integration
- This skill integrates with content and toolkit pipelines:
-
- **Writing pipeline** (human-facing content):
+ **Writing pipeline**:
```
- CONTENT --> voice-validator --> scan-ai-patterns --> joy-check --mode writing --> de-AI edit (private skill)
+ CONTENT --> writing workflow --> scan-ai-patterns --> joy-check --mode writing
```
- **Instruction pipeline** (agent/skill/pipeline creation and modification):
+ **Instruction pipeline**:
```
SKILL.md --> joy-check --mode instruction --> fix flagged patterns --> re-verify
```
**Auto-invocation points**:
- - `skill-creator` pipeline: Call the Skill tool with `joy-check`. Use instruction mode after generating a new skill.
- - `agent-upgrade` pipeline: Call the Skill tool with `joy-check`. Use instruction mode after modifying an agent.
- - `voice-writer`: Call the Skill tool with `joy-check`. Use writing mode during validation.
- - `doc-pipeline`: Call the Skill tool with `joy-check`. Use instruction mode for toolkit documentation.
+ - `toolkit`: after generating a new skill
+ - `agent-upgrade`: after modifying an agent
+ - `writing`: during validation
+ - `doc-pipeline`: for toolkit documentation
- The joy-check can be invoked standalone via `/joy-check [file]` (auto-detects mode) or with explicit `--mode writing|instruction`.
+ Invoke standalone via `/joy-check [file]` (auto-detects mode) or with explicit `--mode`.
---
## Error Handling
### Error: "File Not Found"
- **Cause**: Path incorrect or file does not exist
- **Solution**:
- 1. Verify path with `ls -la [path]`
- 2. Use glob pattern to search: `Glob **/*.md`
- 3. Confirm correct working directory
+ Verify path with `ls -la`. Use glob to search: `Glob **/*.md`. Confirm working directory.
### Error: "Regex Scanner Fails or Not Found"
- **Cause**: `scan-negative-framing.py` script missing or Python error
- **Solution**:
- 1. Verify script exists: `ls scripts/scan-negative-framing.py`
- 2. Check Python version: `python3 --version` (requires 3.10+)
- 3. If script unavailable, skip Phase 1 and proceed directly to Phase 2 LLM analysis -- the regex pre-filter is an optimization, not a requirement
+ Verify `scripts/scan-negative-framing.py` exists. Requires Python 3.10+. If unavailable, skip to Phase 2 — the pre-filter is an optimization, not a requirement.
### Error: "All Paragraphs Score GRIEVANCE"
- **Cause**: Content is fundamentally framed through grievance -- not recoverable with paragraph-level reframes
- **Solution**:
- 1. Report the scores honestly
- 2. Suggest the content needs a full rewrite with a different framing premise, not paragraph-level fixes
- 3. Point the user to the Joy Principle section and Examples for guidance on the target framing
+ Content is fundamentally grievance-framed. Report scores honestly. Suggest full rewrite with different framing premise, not paragraph-level fixes.
### Error: "Fix Mode Fails After 3 Iterations"
- **Cause**: Rewritten paragraphs keep introducing new CAUTION/GRIEVANCE patterns, often because the underlying premise is grievance-based
- **Solution**:
- 1. Output the best version achieved with flagged remaining concerns
- 2. Explain which specific rubric dimensions resist correction
- 3. Suggest the framing premise itself may need rethinking, not just the language
+ Output best version with remaining concerns. Explain which rubric dimensions resist correction. The framing premise itself may need rethinking.
---
## References
### Rubric Files
- - `references/writing-rubric.md` — Joy-grievance spectrum, subtle patterns, scoring, examples (writing mode)
- - `references/instruction-rubric.md` — Positive framing rules, patterns to flag, rewrite strategies, examples (instruction mode)
+ - `references/writing-rubric.md` — Joy-grievance spectrum, subtle patterns, scoring, examples
+ - `references/instruction-rubric.md` — Positive framing rules, patterns, rewrite strategies, examples
### Scripts
- `scan-negative-framing.py` — Regex pre-filter for grievance patterns (writing mode, Phase 1)
### Complementary Skills
- - `voice-validator` — Voice fidelity validation (different concern)
- - private de-AI editor skill — AI pattern detection and removal (different concern; installed from `~/private-skills`)
- - `voice-writer` — Content pipeline that invokes joy-check as a validation phase
- - `skill-creator` — Skill creation pipeline that invokes joy-check in instruction mode
+ - `writing` — Voice, prose quality, and content validation
+ - `toolkit` — Skill creation and instruction validation