This document provides essential information for AI coding agents working in the SSW.Rules.Content repository.
This is a content-only repository containing SSW's technical rules and best practices. It has no traditional build process - content is written in MDX (Markdown with JSX) and consumed by the SSW.Rules engine which builds it into a static site.
Structure:
public/uploads/rules/[rule-name]/rule.mdx- Individual rules with frontmatter- Top category -
categories/[top-category-folder]/index.mdx categories/[top-category-folder]/[category-name].mdx- Category organizationscripts/- Validation and utility scripts (Node.js, Python, C#).github/workflows/- CI/CD automation
cd scripts/frontmatter-validator
npm install
node frontmatter-validator.js '<comma-separated-files>'Example:
node frontmatter-validator.js 'public/uploads/rules/my-rule/rule.mdx'npm install -g markdownlint-cli
markdownlint <file-paths> --config .markdownlint/config.jsonAuto-fix markdown:
markdownlint --fix <file-paths> --config .markdownlint/config.jsoncd scripts/find-unreferenced-images
npm install
node find-unreferenced-images.jscd scripts/rename-duplicate-images
npm install
node rename-duplicate-images.jsRequired fields:
type: rule(always "rule")title:Question format (e.g., "Do you use TypeScript?")uri:Short kebab-case identifier for URL (e.g., "use-typescript")guid:UUID identifier (generate withuuidgenor online tool)seoDescription:Brief SEO-friendly descriptionauthors:Array withtitleandurl(SSW people URLs)
Optional fields:
archivedreason:Reason for archiving (null if not archived)related:Array of related rule objects withrule:key pointing to full pathredirects:Array of old URIs for redirect handlingcategories:Array of category objects with full file paths
Example:
---
type: rule
archivedreason: #empty if not archived (null or empty string)
title: # e.g. "Do you ....?" (always in question format)
seoDescription: # A brief description of the rule for search engines
guid: # Unique identifier for the rule (UUID format)
uri: # e.g. "cocona-for-command-line-tools", keep short, ensure no conflicts
created: # e.g. 2025-01-03T00:00:00.000Z (ISO 8601 format)
authors:
- title: # e.g. "Brady Stroud"
url: # e.g. "https://www.ssw.com.au/people/brady-stroud"
related:
- # e.g. "provide-list-of-arguments" (rule URIs only)
- # e.g. "dependency-injection"
categories:
- category: # e.g. "categories/communication/rules-to-better-technical-documentation.mdx" (full path)
- category: # Multiple categories allowed
sidebarVideo: # Optional: e.g. "https://youtube.com/shorts/ak37CjgT_uM?si=Od8VIFMIHjycrygv"
createdBy: # System-managed: Original creator name (e.g. "Brady Stroud [SSW]")
createdByEmail: # System-managed: Creator email
isArchived: # Boolean: true or false
lastUpdated: # System-managed: Last update timestamp (e.g. 2025-12-04 00:53:15+00:00)
lastUpdatedBy: # System-managed: Last editor name
lastUpdatedByEmail: # System-managed: Last editor email
---
{{Rule Markdown content here}}
<endIntro />
{{Rest of the rule content}}For Rules (public/uploads/rules/[rule-name]/rule.mdx):
- Intro section - Explain the problem/context
<endIntro />- Marks end of introduction (REQUIRED for rules)- Main content - Use good/bad examples with MDX components
- Links to related rules - Cross-reference other rules
For Categories (categories/[folder]/[category-name].mdx):
- Categories do NOT use
<endIntro />tags - Only descriptive content in the body (after frontmatter)
- No special intro/content separation needed
Box components:
<boxEmbed
style="greybox"
body={<>
Code or text content here
</>}
figurePrefix="good"
figure="Good example - Description"
/>Styles: greybox, info, highlight, china, codeauditor, todo
Prefixes: bad, ok, good, none
Image components:
<imageEmbed
alt="Descriptive alt text"
size="large"
showBorder={true}
figurePrefix="good"
figure="Good example - Clear descriptive caption"
src="/uploads/rules/rule-name/image-file.jpg"
/>Email templates:
<emailEmbed
from=""
to="recipient@example.com"
subject="Subject line"
shouldDisplayBody={true}
body={<>
Email content here
</>}
figurePrefix="good"
figure="Good example - Clear email"
/>YouTube videos:
<youtubeEmbed
url="https://www.youtube.com/embed/VIDEO_ID"
description={"Video: Title (duration)"}
/>- Rule files:
public/uploads/rules/[uri-name]/rule.mdx - Images: Store next to rule file in the same folder
- Use kebab-case for folder and file names
- Folder name MUST match the
urifield in frontmatter
- Headings: Never use
#(H1) - page title uses it. Start with##(H2) - Heading emphasis: Use bold for key concepts (e.g.,
## This is a **key concept**) - Code blocks: Always specify language (e.g.,
```typescript) - Figure captions: Every image/box needs a descriptive
figureparameter - Links: Use relative links for internal rules:
[Rule title](/rule-uri) - Line length: No limit (MD013 disabled)
- Inline HTML: Allowed (MD033 disabled) for MDX components
- Present tense, active voice
- Neutral/impersonal (third-person perspective)
- Company-agnostic and objective
- Concise but comprehensive
- Show the pain - Explain WHY before HOW
- Good/bad examples - Use
figurePrefix="bad"andfigurePrefix="good" - Focus on "why" not "how" - Link to external docs for implementation details
- Rule titles are ALWAYS questions (e.g., "Do you...?")
- Create folder:
public/uploads/rules/[uri-name]/ - Create file:
rule.mdxwith proper frontmatter - Add images to the same folder
- Validate frontmatter: Run validator script
- Add rule to appropriate category file(s) in
categories/
- Find category file in
categories/[folder]/[category-name].mdx - Open category frontmatter
- Add rule path to
index:array - Validate with frontmatter validator
Category folders:
communication/- Documentation, presentations, meetingssoftware-engineering/- Development practices, code qualityproject-delivery/- Project management, Scrumdesign/- UX, UI guidelinesmarketing-and-video/- Marketing contentartificial-intelligence/- AI/ML practicesinfrastructure-and-networking/- DevOps, infrastructureclient-engagement/- Client relationshipscompany-operations/- Internal operationsothers/- Miscellaneous
Choose the most relevant category file: Browse the category files in the appropriate folder. For example:
- Documentation rules →
/categories/communication/rules-to-better-technical-documentation.md - Testing rules →
/categories/software-engineering/rules-to-better-unit-tests.md - Meeting rules →
/categories/communication/rules-to-better-meetings.md
- Images go in the rule folder next to
rule.mdx - Use descriptive filenames (kebab-case)
- Extensions must be lowercase (
.jpg,.png,.gif,.svg) - Always use
<imageEmbed>component, never plain markdown images - Include descriptive
alttext for accessibility
Rules must have:
- Valid
type: rule - Non-empty
title,uri,guid,seoDescription - At least one author with valid
titleandurl - Valid UUID format for
guid - Valid URI reference format for
uri - Valid datetime for
createdfield
Disabled rules:
- MD046 - Code block style (fenced blocks allowed)
- MD013 - Line length (no limit)
- MD033 - Inline HTML (needed for MDX)
- MD036 - Emphasis instead of heading
- MD055 - Table pipe style
- MD024 - Duplicate headings (allowed)
Enabled rules:
- MD003 - Heading style must be ATX (
##) - MD004 - List style must use asterisks (
*)
On every PR:
- Frontmatter validation (changed files only)
- Markdown linting with auto-fix
- Image validation
- Folder name consistency check
On push to main:
- Full frontmatter validation (all files)
- Deployment trigger to SSW.Rules engine
Scheduled (weekly):
- Duplicate image detection and renaming
- NO package.json in root - this is a content repo
- NO traditional build/test commands - validation only
- Content is consumed by separate build system (SSW.Rules)
- Always run validation scripts before committing
- Folder names auto-sync with
urifield via GitHub Actions - Use TinaCMS for visual editing (optional)
- Read
.github/copilot-instructions.mdfor detailed MDX component usage
- SSW.Rules Engine - The build system
- Copilot Instructions - Detailed component usage