Back to list
atiati82

layout-guard-v1

by atiati82

0🍴 0📅 Jan 25, 2026

SKILL.md


name: layout-guard-v1 description: Protect canonical templates from modification - enforce immutability

Layout Guard Skill v1.0

Purpose: Prevent any modification to canonical layout templates.

1) Non-Negotiables (Policy)

Protected Files List

These files must NEVER be edited by any agent:

const PROTECTED_FILES = [
  'client/src/templates/gpt/LandingLayout.tsx',
  'client/src/templates/gpt/ProductLayout.tsx',
  'client/src/templates/gpt/ArticleLayout.tsx',
  'client/src/templates/gpt/UtilityLayout.tsx',
  'client/src/templates/gpt/IONLayout.tsx',
  'client/src/templates/gpt/index.ts',
];

const PROTECTED_SIGNATURES = [
  'CANONICAL_LAYOUT_V1',
];

Detection Rules

A file is protected if:

  1. It's in the PROTECTED_FILES list, OR
  2. It contains any PROTECTED_SIGNATURES string

2) Inputs & Outputs

Inputs (When to Run)

Run this skill:

  • Before ANY file edit operation
  • Before committing changes
  • As part of CI/CD pipeline (npm run guard:layouts)

Output Contract

{
  "status": "PASS" | "FAIL",
  "protectedFilesChecked": number,
  "violations": [
    {
      "file": "string",
      "reason": "string"
    }
  ]
}

3) Quality Gates

Pre-Edit Check

Before editing ANY file:

# Check if file is protected
grep -l "CANONICAL_LAYOUT_V1" <target-file>

If match found → ABORT EDIT

Post-Change Validation

After any changes:

npm run guard:layouts

Must return exit code 0.

CI/CD Integration

This guard runs automatically via:

"prebuild": "npm run guard:all"

Enforcement Scripts

Primary Guard Script

Location: scripts/guard-layouts.ts

Run manually:

npm run guard:layouts

What It Checks

  1. Protected files have not been modified (git diff)
  2. CANONICAL_LAYOUT_V1 signature is intact
  3. No new edits pending for protected files

Recovery Procedures

If Protected File Was Modified

  1. Immediately revert: git checkout -- <protected-file>
  2. Review changes: Extract any valid logic
  3. Create new version: LayoutName-v2.tsx if changes needed
  4. Never merge: Block any PR modifying protected files

If Layout Needs Update

  1. Create LandingLayout-v2.tsx (new version)
  2. Add CANONICAL_LAYOUT_V2 signature
  3. Add to protected files list
  4. Migrate pages gradually

Score

Total Score

40/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon