Clean Code logo

Clean Code

Community
xenitV1
clean-code

The Foundation Skill. LLM Firewall + 2025 Security + Cross-Skill Coordination. Use for ALL code output - prevents hallucinations, enforces security, ensures quality.

Overview

PublisherxenitV1
Repositoryclaude-code-maestro
Skill nameclean-code
Stars
231
Forks
34
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by xenitV1 on GitHub. Read the source before you install it.

Installation

Install the Clean Code AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/xenitV1/claude-code-maestro.git /tmp/claude-code-maestro
mkdir -p .claude/skills
cp -r /tmp/claude-code-maestro/skills/clean-code .claude/skills/clean-code
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Clean Code in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Clean Code on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Clean Code is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

<domain_overview>

🛡️ CLEAN CODE: THE FOUNDATION

Philosophy: This skill is the FOUNDATION - it applies to ALL other skills. Every piece of code must pass these gates. ALGORITHMIC ELEGANCE MANDATE (CRITICAL): Never prioritize "clever" code over readable, intent-revealing engineering. AI-generated code often fails by introducing unnecessary abstractions or using vague naming conventions that obscure logic. You MUST use intent-revealing names for every variable and function. Any implementation that increases cognitive complexity without a proportional gain in performance or scalability must be rejected. Avoid "Hype-Driven Development"—proven patterns trump trending but unstable frameworks. </domain_overview> <iron_laws>

🚨 IRON LAWS

1. NO HALLUCINATED PACKAGES - Verify before import
2. NO LAZY PLACEHOLDERS - Code must be runnable
3. NO SECURITY SHORTCUTS - Production-ready defaults
4. NO OVER-ENGINEERING - Simplest solution first

</iron_laws> <security_protocols>

📦 PROTOCOL 1: SUPPLY CHAIN SECURITY

LLMs hallucinate packages that sound real but don't exist.

  1. Verify before import - npm search or pip show for unfamiliar packages
  2. Prefer battle-tested - lodash, date-fns, zod over obscure alternatives
  3. Check npm audit / pip-audit before adding new dependencies
  4. Pin versions in production - no ^ or ~ for critical deps 2025 AI Package Risks:
  • Never import AI "wrapper" libraries without verification
  • LLM SDKs: Use official only (openai, anthropic, google-generativeai)
  • Vector DBs: Stick to established (pinecone, weaviate, chromadb)

🔐 PROTOCOL 2: SECURITY-FIRST DEFAULTS

Frontend Security:

ForbiddenRequired
dangerouslySetInnerHTMLDOMPurify sanitization
Inline event handlersEvent delegation
eval(), new Function()Static code only
Storing tokens in localStoragehttpOnly cookies
Backend Security:
ForbiddenRequired
---------------------
CORS: *Explicit origin whitelist
Raw SQL stringsParameterized queries
chmod 777Principle of least privilege
Hardcoded secretsEnvironment variables + validation
API Security (2025):
  • Rate limiting on ALL public endpoints
  • Input validation at the gate (Zod/Pydantic)
  • Output sanitization for AI-generated content
  • PASETO > JWT for new projects </security_protocols> <modularity_and_placeholder_rules>

🏗️ PROTOCOL 3: NO LAZY PLACEHOLDERS

Forbidden Patterns:

javascript
// ❌ BANNED
// TODO: Implement this
// ... logic goes here
function placeholder() { }
throw new Error('Not implemented');

Required:

  • Every function must be runnable
  • If too complex, break into smaller complete functions
  • "Hurry" is not an excuse - write minimal viable implementation

📐 PROTOCOL 4: MODULARITY & STRUCTURE

The 50/300 Rule:

  • Functions > 50 lines → Break down
  • Files > 300 lines → Split into modules SOLID Principles: | Principle | Quick Check | |-----------|-------------| | Single Responsibility | Does this do ONE thing? | | Open/Closed | Can I extend without modifying? | | Liskov Substitution | Can subtypes replace parent? | | Interface Segregation | Are interfaces minimal? | | Dependency Inversion | Do I depend on abstractions? | </modularity_and_placeholder_rules> <complexity_and_dependencies>

🎯 PROTOCOL 5: COMPLEXITY CAP

Native First:

javascript
// ❌ Don't install is-odd
npm install is-odd
// ✅ Use native
const isOdd = n => n % 2 !== 0;

Anti-Patterns:

  • AbstractFactoryBuilderManager for simple functions
  • 10 layers of abstraction for CRUD
  • "Future-proofing" for requirements that don't exist YAGNI: You Aren't Gonna Need It. Build for today's requirements.

🔄 PROTOCOL 6: DEPENDENCY HYGIENE

Freshness Check:

bash
npm outdated      # Check for updates
npm audit         # Check for vulnerabilities

The CVE Brake:

  • "Latest" is not always "Safest"
  • If latest has Critical CVE → Rollback to last secure version
  • Security > New Features 2025 Recommended: | Category | Recommended | |----------|-------------| | Validation | zod, valibot | | HTTP | ky, ofetch | | State | zustand, jotai | | ORM | drizzle, prisma | | Auth | lucia, better-auth | </complexity_and_dependencies> <ai_era_protocols>

🤖 PROTOCOL 7: AI-ERA CONSIDERATIONS

When Building AI Features:

  1. Validate AI outputs - Never trust raw LLM responses
  2. Rate limit AI calls - Prevent cost explosions
  3. Sanitize before display - AI can generate malicious content
  4. Log AI interactions - For debugging and compliance When AI is Writing Code:
  5. Verify imports exist - AI hallucinates packages
  6. Check types are correct - AI guesses at APIs
  7. Test edge cases - AI misses boundary conditions
  8. Review security - AI takes shortcuts </ai_era_protocols> <audit_and_reference>

✅ QUICK AUDIT CHECKLIST

Before committing ANY code:

  • No hallucinated imports (verified packages exist)
  • No security shortcuts (CORS, eval, hardcoded secrets)
  • No lazy placeholders (// TODO, empty functions)
  • Functions < 50 lines, files < 300 lines
  • Dependencies audited (npm audit clean)
  • Types are strict (no any)

🔗 CROSS-SKILL INTEGRATION

When Using...Clean Code Adds...
@frontend-designSecurity defaults, no eval, CSP awareness
@backend-designInput validation, no raw SQL, Zero Trust
@tdd-masteryNo placeholders (tests enforce completeness)
@planning-masteryModularity guides task breakdown
@brainstormingSOLID/YAGNI guide architecture decisions
@debug-masteryLogging standards, no silent failures
</audit_and_reference>

Frequently asked questions

What does the Clean Code AI skill do?

The Foundation Skill. LLM Firewall + 2025 Security + Cross-Skill Coordination. Use for ALL code output - prevents hallucinations, enforces security, ensures quality.

Why use Clean Code on TypingMind?

Because you install it once and use it with any model. Clean Code is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Clean Code in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/xenitV1/claude-code-maestro/tree/main/skills/clean-code. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Clean Code?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Clean Code?

As many as you like. As long as a model supports skills, you can use Clean Code with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Clean Code AI skill free?

Yes. It is published on GitHub by xenitV1 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇