Skip to content

refactor: positive framing rewrite across toolkit (ADR-127, ADR-128)#199

Merged
notque merged 9 commits intomainfrom
feat/adr-127-128-positive-framing
Mar 28, 2026
Merged

refactor: positive framing rewrite across toolkit (ADR-127, ADR-128)#199
notque merged 9 commits intomainfrom
feat/adr-127-128-positive-framing

Conversation

@notque
Copy link
Copy Markdown
Owner

@notque notque commented Mar 28, 2026

Summary

  • ADR-127: Rewrite all negative instruction framing (NEVER, do NOT, FORBIDDEN, Anti-Pattern tables) to positive action-based framing across 113 agent/skill/pipeline files. Same safety boundaries, clearer instructions for LLMs.
  • ADR-128: Split joy-check into dual-mode skill with rubric reference files — writing mode (joy-grievance spectrum for human content) and instruction mode (positive framing validation for agent/skill markdown per ADR-127 rules).
  • Bug fix: Correct settings.json reference for posttool-lint-hint.py (file was renamed in ADR-118 but settings wasn't updated).

Changes

Category Files Description
Agents 56 Negative → positive instruction framing
Skills 38 Negative → positive instruction framing
Pipelines 19 Negative → positive instruction framing
Joy-check 3 Split into writing + instruction modes with reference rubrics
Settings 1 Fix posttool-lint-hint.py path

Key transformations:

  • "NEVER edit code directly" → "Route all code modifications to domain agents"
  • "Anti-Patterns" sections → "Preferred Patterns"
  • "FORBIDDEN Patterns (HARD GATE)" → "Hard Gate Patterns"
  • "do NOT proceed autonomously" → "get explicit confirmation"

5 legitimate negative residuals preserved (code examples, writing samples, technical terms).

Test plan

  • Grep verification: 283 → 5 remaining negative patterns (5 are legitimate)
  • Hook tests: 6/6 pass for posttool-lint-hint.py
  • PR review: 0 critical, 2 important (both fixed)
  • Spot-check: 5 high-change files verified for safety intent preservation

notque added 9 commits March 27, 2026 23:50
…ents, skills, and pipelines (ADR-127)

Systematic transformation of 113 files replacing prohibition-based instructions
with action-based positive framing. Negative patterns (NEVER, do NOT, FORBIDDEN,
Don't, Avoid, anti-pattern tables) rewritten to state the desired action while
preserving all safety intent.

Key transformations:
- "NEVER edit code directly" → "Route all code modifications to domain agents"
- "Anti-Patterns" sections → "Preferred Patterns"
- "FORBIDDEN Patterns (HARD GATE)" → "Hard Gate Patterns"
- "do NOT proceed autonomously" → "get explicit confirmation"
- Fear-based warnings → outcome-based instructions

5 legitimate residuals preserved (code examples, writing samples, technical terms).
…nce rubrics (ADR-128)

Refactor joy-check from a single writing-focused skill into a mode-dispatched
skill with rubrics in reference files:
- references/writing-rubric.md: joy-grievance spectrum (extracted from SKILL.md)
- references/instruction-rubric.md: positive framing validation per ADR-127
- SKILL.md: core engine with auto-detection (agents/skills/pipelines → instruction
  mode, everything else → writing mode)

Also create hooks/post-tool-lint-hint.py (was registered in settings.json but
the file was missing). Suggests linters after Write/Edit, once per extension
per session. All 6 tests pass.
ADR-118 renamed post-tool-lint-hint.py → posttool-lint-hint.py but
settings.json wasn't updated, causing every Write/Edit to error with
'No such file'. Fix the reference and remove the duplicate file
accidentally created during ADR-128 implementation.
…fix BRE regex in rubric

PR review found two issues:
1. Phase 1 grep missed "- Avoid ..." bullet-point instructions (only caught
   heading-level "## Avoid"). Added ^-?\s*Avoid to the pattern.
2. Instruction rubric used \| (BRE alternation) but SKILL.md uses grep -E
   (ERE). Fixed to | for consistency.
…118)

test_reddit_mod.py and test_video_transcript.py used direct imports
(import reddit_mod) but scripts were renamed to kebab-case (reddit-mod.py)
in ADR-118. Migrate to importlib.util with sys.modules registration.

Also fix test_post_tool_lint.py to reference posttool-lint-hint.py
(fused prefix name from ADR-118).
- score-component.py: accept 'Preferred Patterns' heading (ADR-127 rename)
  in addition to legacy 'Anti-Patterns'
- test_voice_validator.py: fix SCRIPT_PATH to voice-validator.py (kebab-case)
- test_voice_analyzer.py: fix SCRIPT_PATH to voice-analyzer.py (kebab-case)
- test_reddit_mod.py: ruff format fix

Reduces test failures from 86 to 3 (all 3 pre-existing on main).
…exists

The creation gate check in pretool-unified-gate.py used Path(file_path).exists()
which is unaffected by unittest.mock.patch("os.path.exists"). Changed to
os.path.exists(file_path) so the existing-file check works correctly both
in tests and in production. Fixes 2 pre-existing test failures.
…heck

domain-research/SKILL.md: rewrite 6 remaining negative patterns to positive
php-general-engineer.md: rewrite "forbidden" to positive instruction
@notque notque merged commit d66d3ed into main Mar 28, 2026
4 checks passed
@notque notque deleted the feat/adr-127-128-positive-framing branch March 28, 2026 14:49
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