GO

golden-principles

Scans and enforces organizational golden principles within a repository.

Install

mkdir -p .claude/skills/golden-principles && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14603" && unzip -o skill.zip -d .claude/skills/golden-principles && rm skill.zip

Installs to .claude/skills/golden-principles

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Scan repository for golden principle violations with agent-readable remediation. Enforces GP-001 through GP-008 from .agents/governance/golden-principles.md. Use when auditing compliance, preparing PRs, or running garbage collection scans.
239 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Scan the repository for violations of golden principles GP-001 through GP-008.
  • Produce remediation instructions for identified violations.
  • Scope scans to the entire repository, specific directories, or PR diffs.
  • Run specific rules only, such as `script-language` or `skill-frontmatter`.
  • Output results in JSON format for tooling integration.

How it works

The skill executes a Python script to scan specified targets for violations of predefined golden principles and generates remediation advice.

Inputs & outputs

You give it
A target for scanning (repository, directory, or diff scope) and optional rules/format.
You get back
A report of golden principle violations with agent-readable remediation instructions, optionally in JSON format.

When to use golden-principles

  • Auditing principle compliance
  • Preparing code for PR submission
  • Garbage collection scans

About this skill

Golden Principles

Scan the repository for violations of mechanically enforced golden principles. Produces remediation instructions that agents can act on directly.

<!-- vendor-portability: declared. This skill enforces GP-001 through GP-008 defined in .agents/governance/golden-principles.md and cites that document plus .claude/skills/ siblings. The governance file is the upstream rule source; a vendored install without it loses the canonical principle text, while the bundled scanner still applies its built-in GP-001 and GP-003 through GP-006 checks against the consumer's files (GP-002 is enforced elsewhere, not by this scanner). Issue #2050. -->

Inspired by OpenAI Harness Engineering:

"We started encoding what we call 'golden principles' directly into the repository and built a recurring cleanup process."

Triggers

Trigger PhraseOperation
scan golden principlesFull principle compliance scan
check principle complianceScan with summary report
golden principle violationsScan and list violations
run garbage collectionDeep scan with fix-up recommendations
audit principlesScan specific rules only

When to Use

Use this skill when:

  • Preparing a PR for submission (catch violations early)
  • Running periodic garbage collection scans
  • Auditing a domain or directory for compliance
  • Adding new files to the repository

Use taste-lints instead when:

  • Checking code-level invariants only (file size, naming, complexity)
  • Running pre-commit checks on staged files

Use quality-grades instead when:

  • Grading domains across architectural layers
  • Producing quality trend reports

Process

  1. Run python3 .claude/skills/golden-principles/scripts/scan_principles.py with target
  2. Review AGENT_REMEDIATION blocks in output
  3. Apply suggested fixes
  4. Re-run to confirm compliance

Usage

# Scan entire repository
python3 .claude/skills/golden-principles/scripts/scan_principles.py

# Scan specific directory
python3 .claude/skills/golden-principles/scripts/scan_principles.py --directory .claude/skills/

# Scope to a pull request diff (only files changed vs the base branch)
python3 .claude/skills/golden-principles/scripts/scan_principles.py --diff-scope "origin/$BASE_BRANCH"

# Run specific rules only
python3 .claude/skills/golden-principles/scripts/scan_principles.py --rules script-language,skill-frontmatter

# JSON output for tooling
python3 .claude/skills/golden-principles/scripts/scan_principles.py --format json

# Write results to file
python3 .claude/skills/golden-principles/scripts/scan_principles.py --output scan-results.json --format json

Rules

RulePrincipleWhat it checks
script-languageGP-001No new .sh/.bash files
skill-frontmatterGP-003SKILL.md has required frontmatter fields
agent-definitionGP-004Agent .md files have required sections
yaml-logicGP-005No inline logic in workflow YAML
actions-pinnedGP-006GitHub Actions pinned to SHA

GP-002, GP-007, GP-008 are enforced by existing tools (git hooks, taste-lints).

Exit Codes

CodeMeaning
0No violations found
1Script error (bad arguments, file not found)
10Violations detected

Scripts

ScriptPurposeExit codes
scripts/scan_principles.pyScan a path (repo, directory, or diff scope) for GP-001..GP-006 violations and emit AGENT_REMEDIATION blocks. Supports --directory, --diff-scope, --rules, --format, --output.0 no violations; 10 violations detected; 1 tool error (bad arguments, file not found).

Suppression

Add a comment in the file header to suppress a specific rule:

# golden-principle: ignore script-language

Valid rules: script-language, skill-frontmatter, agent-definition, yaml-logic, actions-pinned

Verification

After execution, run the bundled validator and require exit 0:

python3 .claude/skills/golden-principles/scripts/scan_principles.py <path>
echo "exit=$?"   # 0 = clean, 10 = violations found, 1 = tool error
  • Exit 0 to pass; exit 10 means violations exist and must be reported with principle ID and remediation
  • Exit 1 (tool error) is a BLOCKED result, not a pass
  • Report lists scanned file count
  • Output format matches --format flag

References

  • Code Qualities - Five foundational qualities: cohesion, coupling, non-redundancy, encapsulation, testability
  • SOLID Principles - SRP, OCP, LSP, ISP, DIP with violation signs and code examples
  • Programming by Intention - Sergeant pattern for expressing intent over implementation
  • Separation of Concerns - Decomposition at method, class, layer, and service levels
  • DRY Principle - Single authoritative representation with scope, violations, and when NOT to DRY

Cross-References

When not to use it

  • When checking code-level invariants only like file size or naming.
  • When grading domains across architectural layers.
  • When producing quality trend reports.

Limitations

  • The skill enforces GP-001 through GP-008 as defined in `.agents/governance/golden-principles.md`.
  • The skill requires a Python script to run the scan.
  • The skill can be suppressed for specific rules via file header comments.

How it compares

This workflow mechanically enforces specific golden principles and provides agent-readable remediation, unlike general linting or quality grading tools.

Compared to similar skills

golden-principles side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
golden-principles (this skill)01moReviewIntermediate
pair-capability-verify-adoption05moNo flagsIntermediate
harness-boundary03moNo flagsAdvanced
adversarial-review02moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry