← Back to list

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:
- It's in the
PROTECTED_FILESlist, OR - It contains any
PROTECTED_SIGNATURESstring
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
- Protected files have not been modified (git diff)
- CANONICAL_LAYOUT_V1 signature is intact
- No new edits pending for protected files
Recovery Procedures
If Protected File Was Modified
- Immediately revert:
git checkout -- <protected-file> - Review changes: Extract any valid logic
- Create new version:
LayoutName-v2.tsxif changes needed - Never merge: Block any PR modifying protected files
If Layout Needs Update
- Create
LandingLayout-v2.tsx(new version) - Add
CANONICAL_LAYOUT_V2signature - Add to protected files list
- 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