Skip to content

refactor: Constitution alignment — reasoning-based rewrites + new skills#20

Merged
iamladi merged 5 commits intomainfrom
refactor/constitution-alignment
Feb 8, 2026
Merged

refactor: Constitution alignment — reasoning-based rewrites + new skills#20
iamladi merged 5 commits intomainfrom
refactor/constitution-alignment

Conversation

@iamladi
Copy link
Owner

@iamladi iamladi commented Feb 7, 2026

Summary

Rewrites 2 existing prompt files from rule-based to reasoning-based instructions following Anthropic's Constitutional AI principles, and adds 2 new skills. Part of a cross-plugin constitution alignment effort.

  • Rewrote commit.md from step-by-step bash procedures to outcome-driven workflow with judgment criteria (score: 2.4 → 7.4/10)
  • Rewrote agent-ready-repo-setup/SKILL.md from constraint list to 8 reasoning-based principles with examples and adaptation guidance (score: 2.8 → 8.2/10)
  • Added prompt-as-onboarding skill — system prompt generator using 8-section annotated template
  • Added principal-hierarchy-audit skill — hierarchy compliance audit with RED/YELLOW/GREEN classification
  • Restored auth header redaction in Pino logging example (req.headers.authorization)
  • All 7 rewritten files within <20% token inflation NFR vs originals

NFR Compliance

File Original Final % Change
commit.md 565 675 +19.5%
agent-ready-repo-setup 1,196 1,407 +17.6%

Review Findings Addressed

  • P0: N/A for this repo
  • P1: Auth header redaction restored, token inflation within NFR

Test plan

  • bun run validate passes (v1.9.0)
  • Manual: invoke /commit and verify reasoning-based behavior
  • Manual: invoke agent-ready-repo-setup skill and verify principle-based output
  • Manual: invoke prompt-as-onboarding and principal-hierarchy-audit skills

…ased

Transform rule-based instructions into reasoning-based per Anthropic
Constitution principles. Each constraint now explains WHY it matters,
workflows are outcome-driven, and judgment criteria replace rigid
templates.

commit.md: 2.4/10 → 7+/10
agent-ready-repo-setup: 2.8/10 → 7+/10
System prompt generator that produces reasoning-based prompts from
product context. Follows onboarding document structure with identity,
goals, constraints with reasoning, and edge case principles. Includes
annotated template reference.
Audits system prompts against the Anthropic Constitution's principal
hierarchy. Detects operator boundary violations, user protection
gaps, and hard constraint conflicts with RED/YELLOW/GREEN severity
classification. Includes codified hierarchy rules with Constitution
page references.
Restore auth header redaction in agent-ready-repo-setup Pino example.
Trim all rewritten files to stay within 20% of original word counts.
Add changelog entries for constitution alignment refactor:
- 2 new skills (prompt-as-onboarding, principal-hierarchy-audit)
- 2 reasoning-based rewrites (commit.md, agent-ready-repo-setup)
@iamladi iamladi merged commit bad2c1f into main Feb 8, 2026
1 check passed
@iamladi iamladi deleted the refactor/constitution-alignment branch February 8, 2026 09:19
@@ -0,0 +1,333 @@
# Principal Hierarchy Codified Rules

This document codifies the principal hierarchy boundaries from Anthropic's Constitution. Use this as a reference when auditing system prompts and plugin configurations for compliance.

Choose a reason for hiding this comment

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

💡 Great to see that somebody is thinking about this! 👍

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.

2 participants