Agent skill
repo-hardening
Best practices for setting up quality tooling across different language stacks.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/repo-hardening
SKILL.md
Repo Hardening Skill
Best practices for setting up quality tooling across different language stacks.
Language Detection
Detect stack from project files:
| File | Language | Package Manager |
|---|---|---|
package.json |
JavaScript/TypeScript | npm/yarn/pnpm/bun |
pyproject.toml |
Python | pip/poetry/uv |
requirements.txt |
Python | pip |
Cargo.toml |
Rust | cargo |
go.mod |
Go | go |
pom.xml |
Java | Maven |
build.gradle |
Java/Kotlin | Gradle |
build.gradle.kts |
Kotlin | Gradle |
Gemfile |
Ruby | Bundler |
composer.json |
PHP | Composer |
*.csproj / *.sln |
C#/.NET | dotnet |
Package.swift |
Swift | SwiftPM |
mix.exs |
Elixir | Mix |
CMakeLists.txt |
C/C++ | CMake |
Makefile |
C/C++ | Make |
build.sbt |
Scala | sbt |
Language References
Per-language tooling configs (linting, formatting, type checking, hooks, coverage):
| Language | Reference |
|---|---|
| JavaScript/TypeScript | skills/repo-hardening/references/javascript-typescript.md |
| Python | skills/repo-hardening/references/python.md |
| Rust | skills/repo-hardening/references/rust.md |
| Go | skills/repo-hardening/references/go.md |
| Java | skills/repo-hardening/references/java.md |
| Kotlin | skills/repo-hardening/references/kotlin.md |
| Ruby | skills/repo-hardening/references/ruby.md |
| PHP | skills/repo-hardening/references/php.md |
| C#/.NET | skills/repo-hardening/references/csharp-dotnet.md |
| Swift | skills/repo-hardening/references/swift.md |
| Elixir | skills/repo-hardening/references/elixir.md |
| C/C++ | skills/repo-hardening/references/c-cpp.md |
| Scala | skills/repo-hardening/references/scala.md |
.editorconfig
Universal editor settings:
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{py,rs}]
indent_size = 4
[*.go]
indent_style = tab
indent_size = 4
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab
.gitattributes
Normalize line endings:
* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
*.pdf binary
*.png binary
*.jpg binary
*.gif binary
Setup Priority
- .editorconfig - Universal, no dependencies
- Linter - Catches bugs early
- Formatter - Consistent style
- Git hooks - Enforce on commit
- Type checker - Optional but recommended
- Test coverage - Enforce minimum threshold (default: 80%)
Common Mistakes
- Conflicting rules - Ensure linter and formatter agree (use eslint-config-prettier)
- Missing hook permissions -
chmod +x .git/hooks/* - Hook not running - Ensure
.git/hooks/pre-commitexists (not.git/hooks/pre-commit.sample) - Too strict initially - Start with warnings, graduate to errors
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?