Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:32:18 +08:00
commit 52d23885b0
4 changed files with 107 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
{
"name": "coding-skills",
"description": "Collection of coding-related skills",
"version": "0.0.0-2025.11.28",
"author": {
"name": "Han",
"email": "ihanai1991@gmail.com"
},
"skills": [
"./skills/fundamental-coding-principles"
]
}

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# coding-skills
Collection of coding-related skills

44
plugin.lock.json Normal file
View File

@@ -0,0 +1,44 @@
{
"$schema": "internal://schemas/plugin.lock.v1.json",
"pluginId": "gh:hanai/cc-marketplace:coding-skills",
"normalized": {
"repo": null,
"ref": "refs/tags/v20251128.0",
"commit": "6899980d6014757702ef6fb51d56827898818790",
"treeHash": "b111d2f50fd3eabfc90b8a2daac480c1456e72d86729139afe3339ea927fd0ea",
"generatedAt": "2025-11-28T10:17:22.079315Z",
"toolVersion": "publish_plugins.py@0.2.0"
},
"origin": {
"remote": "git@github.com:zhongweili/42plugin-data.git",
"branch": "master",
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
},
"manifest": {
"name": "coding-skills",
"description": "Collection of coding-related skills"
},
"content": {
"files": [
{
"path": "README.md",
"sha256": "fe6afaeb015d54ee4f804c6602a9d77915c5c96e7c315a5ceb1434cd54a18205"
},
{
"path": ".claude-plugin/plugin.json",
"sha256": "5b400e60a0be9f3664fb56e6b5d3f135d8e70cbcc39caa35348b6897cedfeb2e"
},
{
"path": "skills/fundamental-coding-principles/SKILL.md",
"sha256": "982287446cd10ccd885f47c6597a9c5f84f6af34114b37fa027db38f2e17d5ae"
}
],
"dirSha256": "b111d2f50fd3eabfc90b8a2daac480c1456e72d86729139afe3339ea927fd0ea"
},
"security": {
"scannedAt": null,
"scannerVersion": null,
"flags": []
}
}

View File

@@ -0,0 +1,48 @@
---
name: fundamental-coding-principles
description: Apply SOLID, DRY, KISS, YAGNI, and SSOT principles when writing, reviewing, or refactoring code to ensure maintainability and quality.
---
# Fundamental Coding Principles
Apply this skill to keep code changes focused, testable, and maintainable.
## Quick Checklist
- Confirm each edit has a single purpose before coding.
- Ruthlessly remove duplication or dead paths you touch.
- Only add behavior backed by an explicit requirement.
- Prefer simple, composable solutions over clever ones.
- Keep truthy data and decisions in one authoritative place.
## Principle Guardrails
### SOLID
- `S`: Validate the change impacts one reason to vary; split helpers if mixed concerns appear.
- `O`: Extend behavior through new types or functions rather than rewriting stable code paths.
- `L`: Ensure new subtype logic preserves caller expectations (inputs, return contracts, exceptions).
- `I`: Create targeted interfaces; avoid forcing consumers to implement unused members.
- `D`: Depend on abstractions or injected collaborators; eliminate hardwired globals where possible.
### DRY
- Scan for repeated logic, constants, or schemas; consolidate into shared utilities before finishing.
- Prefer extracting reusable modules over copy-pasting even inside the same file.
### KISS
- Trim optional branches, flags, and polymorphism unless they solve todays requirement.
- Keep functions short and state minimal; decompose complex flows into readable steps.
### YAGNI
- Challenge every new feature, parameter, or hook: is there a verified need right now?
- Defer premature abstractions until duplication or clear requirements emerge.
### SSOT
- Update or create the canonical definition (config, schema, doc) when data models change.
- Remove divergent caches or mirrors unless you enforce sync in the same change.
## Reference Playbooks
- [Splunk: "SOLID Design Principles Hands-On Examples"](https://www.splunk.com/en_us/blog/learn/solid-design-principle.html) success/failure code walkthroughs for each letter.
- [PullRequest.com: "7 Clean Coding Principles"](https://www.pullrequest.com/blog/7-clean-coding-principles/) DRY-focused review prompts.
- [MIT 6.031: Code Review Guide](https://web.mit.edu/6.031/www/fa20/classes/03-code-review/) DRY and simplification questions to ask.
- [Baeldung: KISS Software Design Principle](https://www.baeldung.com/cs/kiss-software-design-principle) tactics for keeping solutions lightweight.
- [TechTarget: YAGNI Explainer](https://www.techtarget.com/whatis/definition/You-arent-gonna-need-it) decision tests and risk scenarios.
- [Atlassian Workstream: Building an SSOT](https://www.atlassian.com/work-management/knowledge-sharing/documentation/building-a-single-source-of-truth-ssot-for-your-team) practices for maintaining canonical sources.