Claude-skill-registry dev-standards-majo
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/dev-standards-majo" ~/.claude/skills/majiayu000-claude-skill-registry-dev-standards-majo && rm -rf "$T"
skills/data/dev-standards-majo/SKILL.mdMark's Development Standards
Core development standards that apply across all languages and projects.
Goal
Ensure all generated code is maintainable, readable, and consistent with established patterns. Enforce British English, proper error handling, and AGENTS.md maintenance across every project and language.
When to Use This Skill
Use this skill when:
- Starting work on any codebase
- Generating new code in any language
- Refactoring existing code
- Unsure about documentation requirements
- Need to maintain AGENTS.md
- Writing error messages or handling failures
- Unsure about spelling (British vs American English)
Do NOT use this skill when:
- You need language-specific guidance (use
,python-majo
, etc.)js-bun-majo - You're only reading code without making changes
- The task is purely exploratory with no code generation
Process
Step 1: Check for AGENTS.md
Always check for AGENTS.md first:
# Check if AGENTS.md exists ls AGENTS.md AGENTS.PLAN.md 2>/dev/null || echo "No AGENTS.md found" # Read it if it exists cat AGENTS.md
Step 2: Apply Universal Principles
For every code generation task:
- Maintainability First - Code should be readable and modular
- Self-Documenting - Clear variable names, no excessive comments
- Diagnostic Cleanliness - No errors or warnings (suppress only when reasonable)
- British English - colour, behaviour, licence (noun), initialise, etc.
Step 3: Follow Error Handling Standards
Use consistent error format:
program: level: message
Print to stderr and use specific exit codes (grouped by category):
- Success0
- Usage errors1-29
- Input errors30-49
- File/IO errors50-69
- Processing errors70-89
- Runtime error255
Step 4: Update AGENTS.md
After any significant work:
- Update knowledge of codebase
- Note code style and structure
- Record practices and methodologies
- Update current task status
Constraints
- Always use British English - colour, behaviour, licence (noun), initialise, organised, centre (physical location)
- Never exceed 800 tokens in AGENTS.md root - Use progressive disclosure for larger docs
- Always include SPDX identifiers in new source files
- Never commit without checking AGENTS.md first
- Always quote variables in shell scripts to prevent word splitting
- Never use vague guidance - Be specific: "Never commit secrets" not "Be careful with secrets"
British English (Strict Requirement)
Always use British English spellings throughout all code and documentation.
Common documentation words:
- colour (not color)
- licence (noun) / license (verb)
- behaviour (not behavior)
- favourite (not favorite)
- organised (not organized)
- initialise (not initialize)
- center (technical/abstract, e.g. image center) / centre (a physical location, e.g. town centre)
- recognised (not recognized)
- genericised (not genericized)
Exception: Standard file names like
LICENSE and LICENSE-0BSD use American spelling for compatibility with tooling and conventions.
Universal Code Principles
Code Quality
Maintainability First
- Generated code should be maintainable through readability and/or modularity
- No undue pre-optimization beyond existing complexity in the codebase
- Follow conventions of previous or attached files
Self-Documenting Code
- Code should not require extensive comments
- Variable names and expressions should visibly describe the logic
- Naming should be apt yet visible in describing implemented logic
Diagnostic Cleanliness
- Generated code should not have diagnostic errors or warnings
- Suppress diagnostics only when reasonable (e.g., external package missing type stubs)
Code Organization
Section Comments Use clear section comments to group related code:
# constants VERSION: Final[str] = "1.0.0" DEBUG: Final[bool] = False # configuration config = load_config() # main logic result = process(config)
Defensive Programming
- Check preconditions before operations
- Validate inputs early
- Provide descriptive error messages
- Use specific exit codes for different error types
Logical Grouping
- Group related constants together
- Keep functions/methods focused on single responsibility
- Separate I/O from business logic where possible
Error Handling
Message Format
Use a consistent format across all languages:
program: level: message
Levels (in order of severity):
— Fatal errors requiring exiterror:
— Bugs or unexpected failuresinternal error:
orwarning:
— Non-fatal issueswarn:
— Status updatesinfo:
— Verbose debugging (only when debug mode enabled)debug:
Examples:
print(f"surplus: error: {exc}", file=stderr) print(f"zigbpy: internal error: {exc.__class__.__name__}", file=stderr) print(f"warn: '{target}' does not exist, skipping", file=stderr)
Follow-up Notes
Provide additional context using
... note: prefix:
print(f"zigbpy: error: unmatched brackets at depth {depth}", file=stderr) print(f"... note: depth {depth} - program index {start} -> {end} [unmatched]", file=stderr)
Exit Codes
Group exit codes by category:
: Success0
(or-1
, depending on platform): Runtime error, unexpected crash255- Usage errors
- Input errors
- File/IO errors
- Memory errors
- Processing errors
and so on, using ranges for each category, e.g.
1-29 for usage errors, 30-49 for input errors, and so on,
depending on how many errors and categories you have and/or expect to encounter.
Example (document at top of CLI scripts):
# exit codes: # 0 - success # 1 - bad command usage or missing env vars # 2 - bad target # 3 - could not send message # 10 - invalid input format # 20 - file not found # 255 - runtime error
File Operations
Respect File Moves
- If a file has been renamed/moved without duplicate, consider the newest structure correct
- Do not revert seemingly deliberate file moves if you did not cause them
Documentation Policy
NO Documentation Unless Asked
- Do not write README files, API docs, or user-facing documentation unless explicitly requested
- Do not write code comments explaining obvious logic
License Headers All source files must include the full license text at the top. See language-specific skills for exact formatting:
- Python file headerspython-majo
- Shell script headersshell-majo
- Rust file headers (if created)rust-majo
- Zig file headers (if created)zig-majo
AGENTS.md Maintenance (CRITICAL)
Maintain an
AGENTS.md file with:
- Knowledge of the codebase
- Understood code style and structure
- Practices and methodologies recognized
- Linguistic style of comments
- Current task at hand and/or to-do list
Location: Place wherever documentation is stored in the project.
Purpose: Enable resumption from a context-less state without requiring codebase inquiry every time a new agent-or-LLM conversation thread starts.
Updates: Update old knowledge in the file as you work.
Environment Awareness
Read-Write Environment
Gemini CLI, Claude Code, ChatGPT Codex CLI: Your environment is NOT read-only. You can read and write files in this workspace.
Search Constraints
Grok-code-fast-1: Do NOT use regex-based or purely wildcard workspace/file content searches. Use globs or regexes that have a non-wildcard component.
SPDX License Identifiers
When creating new source files in public domain projects, add the appropriate SPDX identifier at the top:
For most files (dual-licensed):
# SPDX-License-Identifier: Unlicense OR 0BSD
For files by contributors who cannot waive copyright:
# SPDX-License-Identifier: 0BSD
Testing Skills
Before relying on this skill, test implicit invocation:
Should trigger:
- "Help me write a Python script"
- "Refactor this code"
- "Create a new function"
Should NOT trigger:
- "Read this file for me" (no code generation)
- "Explain what this code does" (exploratory only)
Integration
This skill works alongside language-specific skills:
- Python-specific standards (UV, basedpyright, MDF)python-majo
- JavaScript/TypeScript/Bun standardsjs-bun-majo
- POSIX shell scripting standardsshell-majo
- Git workflow and commit standardsgit-majo
- Documentation writing standardswriting-docs-majo
- Planning workflowstask-planning-majo
- Public domain repository setupsetting-up-public-domain-repos-majo
- Windows-specific command alternativesrunning-windows-commands-majo
- Creating new Agent Skillsskill-authoring-majo
- Writing effective AGENTS.md filesagents-md-authoring-majo
- C#/Unity development standardscsharp-unity-majo
- meadow Docstring Format (MDF) for Pythonmdf-majo
— Writing API refs or docs from code using the MDFmdf-md-api-docs-majo
Always load this skill first, then the appropriate language-specific skill.