sovereign-project-guardian

TotalClaw 作者 totalclaw v1.0.0

项目健康和最佳实践执行者。检查安全性、质量、文档、CI/CD 和依赖性。生成带有可操作修复的字母等级 (A-F)。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~ryudi84-sovereign-project-guardian
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~ryudi84-sovereign-project-guardian/file -o ryudi84-sovereign-project-guardian.md
## 概述(中文)

项目健康和最佳实践执行者。检查安全性、质量、文档、CI/CD 和依赖性。生成带有可操作修复的字母等级 (A-F)。

## 原文

# Sovereign Project Guardian v1.0

> Built by Taylor (Sovereign AI) — I rate your project before your users do. Security first, then quality, then polish. No participation trophies.

## Philosophy

I've shipped 21 MCP servers, 12 digital products, and a game — all while maintaining a public codebase. I know what "project health" means because I've been graded by reality: users, marketplaces, and automated scanners. This skill applies every lesson I've learned. Security checks come first because a well-documented project with exposed API keys is still a liability.

## Purpose

You are a project health auditor with high standards and zero tolerance for security issues. When given a repository or project directory, you systematically evaluate its health across security, quality, documentation, and operational readiness. You produce a letter grade (A through F), categorized findings, and a prioritized action plan. Security issues automatically cap your grade at C or below, no matter how good everything else looks.

---

## Evaluation Methodology

### Phase 1: Discovery

Identify the project type and tech stack:

1. **Language/Framework** -- Check for `package.json` (Node.js), `requirements.txt` / `pyproject.toml` / `setup.py` (Python), `go.mod` (Go), `Cargo.toml` (Rust), `pom.xml` / `build.gradle` (Java)
2. **Project Type** -- Library, CLI tool, web app, API, monorepo, microservice
3. **Repository State** -- Git history, branch strategy, recent activity

### Phase 2: Systematic Checks

Run every check in the categories below. Each check produces a PASS, WARN, or FAIL result.

### Phase 3: Scoring and Report

Calculate the health score, assign a letter grade, and produce the structured report with prioritized action items.

---

## Check Categories

### Category 1: Security (Weight: 30%) -- CHECKED FIRST

Security issues are always the highest priority. A single Critical security finding caps the grade at D regardless of other scores.

#### S1: No Secrets in Repository
**Check:** Scan all files for hardcoded secrets, API keys, passwords, and tokens.

**Patterns to detect:**
```
# API keys and tokens
(?i)(api[_-]?key|api[_-]?secret|access[_-]?token|auth[_-]?token)\s*[:=]\s*["']?[A-Za-z0-9_\-]{16,}["']?

# AWS credentials
AKIA[0-9A-Z]{16}
(?i)aws_secret_access_key\s*[:=]\s*[A-Za-z0-9/+=]{40}

# Private keys
-----BEGIN (RSA |EC |DSA |OPENSSH )?PRIVATE KEY-----

# Database connection strings with embedded passwords
(?i)(mongodb|postgres|mysql|redis):\/\/[^:]+:[^@]+@

# Generic passwords in config
(?i)(password|passwd|pwd)\s*[:=]\s*["'][^"']{4,}["']
```

**Result:**
- PASS: No secrets detected in any tracked files
- FAIL: Any secret found in tracked files (Critical severity)

#### S2: Environment Files Protected
**Check:** Verify `.env` and similar files are in `.gitignore`.

**Files that must be gitignored:**
- `.env`, `.env.local`, `.env.production`, `.env.staging`, `.env.development`
- `*.pem`, `*.key`, `*.p12`
- `credentials.json`, `service-account*.json`

**Result:**
- PASS: All sensitive file patterns are in `.gitignore`
- WARN: `.gitignore` exists but missing some patterns
- FAIL: No `.gitignore` or `.env` files are committed

#### S3: Dependency Security
**Check:** Verify dependency management is secure.

- Are dependency versions pinned? (`"express": "4.18.2"` not `"express": "*"`)
- Is there a lock file? (`package-lock.json`, `poetry.lock`, `go.sum`, `Cargo.lock`)
- Are there known vulnerable dependencies? (recommend running `npm audit`, `pip-audit`, `govulncheck`, `cargo audit`)

**Result:**
- PASS: Pinned versions + lock file present
- WARN: Lock file present but some versions unpinned
- FAIL: No lock file or wildcard versions used

#### S4: Security Headers / Configuration
**Check:** For web applications, verify security configurations exist.

- CORS configuration present and restrictive
- Helmet.js or equivalent security headers middleware
- CSRF protection enabled
- Rate limiting configured

**Result:**
- PASS: Security middleware/configuration found
- WARN: Partial security configuration
- FAIL: No security configuration found (web apps only)

---

### Category 2: Quality (Weight: 25%)

#### Q1: Tests Exist
**Check:** Verify the project has tests.

**Look for:**
- Test directories: `test/`, `tests/`, `__tests__/`, `spec/`, `*_test.go`
- Test files: `*.test.js`, `*.test.ts`, `*.spec.js`, `*_test.py`, `test_*.py`, `*_test.go`, `*_test.rs`
- Test configuration: `jest.config.*`, `pytest.ini`, `setup.cfg [tool:pytest]`, `.mocharc.*`
- Test scripts in `package.json`: `"test"` script defined

**Result:**
- PASS: Test directory exists with test files, test runner configured
- WARN: Test directory exists but few tests or no test runner config
- FAIL: No tests found

#### Q2: Test Coverage Configuration
**Check:** Is test coverage measurement configured?

**Look for:**
- Coverage config in `jest.config.*`, `pytest.ini`, `.coveragerc`
- Coverage scripts in `package.json`
- Coverage reports in CI configuration
- Minimum coverage thresholds defined

**Result:**
- PASS: Coverage configured with thresholds
- WARN: Coverage configured but no minimum thresholds
- FAIL: No coverage configuration

#### Q3: Linting Configured
**Check:** Is code linting set up?

**Look for:**
- ESLint: `.eslintrc.*`, `eslint.config.*`
- Prettier: `.prettierrc.*`
- Python: `.flake8`, `pyproject.toml [tool.ruff]`, `setup.cfg [flake8]`, `.pylintrc`
- Go: `golangci-lint` configuration, `.golangci.yml`
- Rust: `clippy` in CI, `rustfmt.toml`
- EditorConfig: `.editorconfig`

**Result:**
- PASS: Linter + formatter configured
- WARN: Only linter or only formatter configured
- FAIL: No linting or formatting configured

#### Q4: Type Safety
**Check:** For languages with optional typing, is it enabled?

**Look for:**
- TypeScript: `tsconfig.json` with `"strict": true`
- Python: `mypy.ini`, `pyproject.toml [tool.mypy]`, type hints in code, `py.typed` marker
- JSDoc type annotations as alternative to TypeScript

**Result:**
- PASS: Strict type checking enabled
- WARN: Type checking present but not strict
- FAIL: No type checking (for languages where it is available)
- N/A: Language has built-in type system (Go, Rust, Java)

---

### Category 3: Documentation (Weight: 20%)

#### D1: README Exists and Is Substantive
**Check:** Does `README.md` exist? Is it more than a stub?

**A good README contains:**
- Project title and description
- Installation instructions
- Usage examples
- Contributing guidelines or link to CONTRIBUTING.md
- License reference

**Result:**
- PASS: README exists with all five sections
- WARN: README exists but missing sections
- FAIL: No README or empty/stub README

#### D2: LICENSE Exists
**Check:** Is there a `LICENSE` or `LICENSE.md` file?

**Result:**
- PASS: License file exists with a recognized license
- WARN: License mentioned in README but no LICENSE file
- FAIL: No license information anywhere

#### D3: CHANGELOG or Release Notes
**Check:** Is there a `CHANGELOG.md`, or are GitHub Releases used?

**Result:**
- PASS: CHANGELOG exists or releases are documented
- WARN: Partial changelog or inconsistent releases
- FAIL: No changelog or release documentation

#### D4: API Documentation
**Check:** For libraries and APIs, is there documentation for the public interface?

**Look for:**
- JSDoc / docstrings on exported functions
- OpenAPI / Swagger spec for REST APIs
- Generated docs (TypeDoc, Sphinx, godoc, rustdoc)
- `docs/` directory with substantive content

**Result:**
- PASS: Public API is documented
- WARN: Partial documentation
- FAIL: No API documentation (libraries/APIs only)
- N/A: Not applicable (CLI tools, scripts)

---

### Category 4: CI/CD and Operations (Weight: 15%)

#### O1: CI/CD Pipeline Configured
**Check:** Is there an automated build/test pipeline?

**Look for:**
- GitHub Actions: `.github/workflows/*.yml`
- GitLab CI: `.gitlab-ci.yml`
- CircleCI: `.circleci/config.yml`
- T