·
Last changedVersion:
This version passed the hardening gate. Hardening applied 5 targeted changes and preserved all other text. Classified findings before hardening: 1. Classified findings closed: 0. Classified findings remaining: 1. Unclassified scanner findings remaining: 0. Review findings closed: 6. Review findings remaining: 2.
1
1
Expand | File | Group | Subtype | Severity | Status |
|---|---|---|---|---|---|
LICENSE | Excessive Agency & Rogue Autonomy | — | Low | Open |
1 finding
Use this skill when you need to add a new validation rule to the dart_skills_lint package, expose it as a toggleable CLI flag, and verify its behavior.
Create a new file in lib/src/rules/ extending SkillRule.
The class must also declare the static rule name and default severity constants that Step 2 refers to, so the registry code compiles.
Any path taken from skill content must be normalized and confirmed to stay inside the skill directory before it is read. Report absolute paths, parent directory references, and symbolic links that point outside the skill directory as validation errors, and add a test case for such a path.
If your rule needs configuration from the skill's YAML frontmatter, you can access it via context.parsedYaml.
Skills checked by this linter may be untrusted, so treat the parsed frontmatter and the raw content as untrusted input. Check the type of every field before using it, keep reads bounded in size, and return a validation error when input is malformed. Add a test case with malformed or unexpected-type frontmatter.
lib/src/rule_registry.dartAdd a new CheckType instance to RuleRegistry.allChecks list. This automatically exposes it as a CLI flag.
Then, add a case to RuleRegistry.createRule to instantiate your rule:
If the rule is disabled by default (defaultSeverity: AnalysisSeverity.disabled), passing the rule's flag (named exactly after the rule name, with no prefix) will automatically enable it with AnalysisSeverity.error severity (handled in entry_point.dart).
You must write automated tests verifying your rule triggers when it should and skips when it shouldn't.
Instead of writing files to disk, test the rule directly using a mock SkillContext. This is faster and avoids I/O dependencies.
If the rule interacts with the file system or wraps an external CLI tool (like popmark), you should use a temporary directory for testing instead of in-memory mocks. If a rule wraps an external tool, run it with fixed arguments passed as a list, put a double dash before any path taken from skill content, set a timeout, and document how the tool version is pinned. If the tool is missing, return a validation error instead of crashing.
If the rule interacts with CLI flags or configuration files, add a test in test/cli_integration_test.dart using TestProcess.
When a new rule is introduced, verify that you synchronize sibling markdown files!
README.md:
- \--[no-]<rule-name>`: <brief description>. (Disabled by default if applicable)`.ruleName EXACTLY. For example, if the ruleName is file-existence, the flag MUST be documented as --[no-]file-existence (do NOT hallucinate a check- prefix like --[no-]check-file-existence). Do NOT add empty bullet points.RULES.md:
rules_md_consistency_test.dart test.documentation/knowledge/SPECIFICATION.md:
lib/src/rules/.lib/src/rule_registry.dart.test/ using in-memory SkillContext.README.md under Flags (ensure flag string matches ruleName EXACTLY and format is correct).RULES.md.documentation/knowledge/SPECIFICATION.md (if applicable).dart_skills_lint package root.dart format . to format code.dart analyze --fatal-infos to ensure no issues.dart test to ensure tests passing.Get started with chainctlchainctl skill install public/flutter/add-dart-lint-validation-rule:latest
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.cgr.dev/public/github.com/flutter/tool/dart_skills_lint/.agents/skills/add-dart-lint-validation-rule:latest
BSD-3-Clause
HARDENING.md
LICENSE
SKILL.md
evals/evals.json