role-check-and-lint-error-remediation
Skill139 starsChanged 3 months agoApache-2.0View on GitHub
Remediate role-check, role-enforcement, and lint failures by improving the design instead of suppressing the rule. Use when a role annotation, target, dependency, justification, max-lines, complexity, or other lint failure needs a structural fix, especially when failures cluster in one file or one concept.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- project-memory/AGENTS.mdAGENTS.md
- analyze-sessionSkill
- dddSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Never silence an error or look for hacky workarounds.
- Very specific: line 11
Read the failing role's definition in .riviere/role-definitions/<role>.md and .riviere/role-selection-guide.md before editing.
- Distinctive: line 14
Never invent a new role, all role changes require user approval.
- Very specific: line 16
Always look in project-memory/ for related refactoring examples that show how similar errors were previously resolved.
- Distinctive: line 31
If the thing you are dealing with involves data, chances are very high that it's a value object.
- Very specific: line 35
Read .riviere/role-definitions/value-object.md.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Remediating role-check and lint failures
Role-check and lint errors are design feedback. Do not see them as constraints to workaround. Step back and review the design.
- Never silence an error or look for hacky workarounds.
- Read the failing role's definition in
.riviere/role-definitions/<role>.mdand.riviere/role-selection-guide.mdbefore editing. Read every candidate role before choosing one. - Never invent a new role, all role changes require user approval.
Always look in project-memory/ for related refactoring examples that show how similar errors were previously resolved.
Find the seam
Errors often indicate responsibilities are not in the right place. A file-length limit is there to avoid responsibilities being mixed together and it's a sign that there is a missing concept, for example.
So the first step is to look for a seam - a boundary to split and carve out responsibilities.
Technique 1: extract a value object
A value object is the most common seam. Look for one or more pieces of data and the logic for constructing, querying, and modifying. Look for it in the following use-cases (but not only):
- an aggregate, entity, domain service, repository (or other object) has validation and construction logic for one or a group of related fields
- an aggregate, entity, domain service, repository (or other object) needs an input or output data structure for one of it's methods
If the thing you are dealing with involves data, chances are very high that it's a value object. So start there and try to solve the problem with VOs. Look for relevant project memories showing value object refactorings.
The contract in this repository
Read .riviere/role-definitions/value-object.md. The enforced shape is:
Simple example
A common anti-pattern is when construction + validation are decoupled from the data they operate on.
In this example, the BookingScheduler has a method called parseDateRange. It validates the inputs then constructs a startDate and endDate variable. The method name alone gives a clue that there is a missing DateRange concept.
class BookingScheduler {
schedule(text: string): void {
const window = this.parseDateRange(text)
// ... uses window
}
private parseDateRange(text: string) {
// validation and construction that belong to DateRange
return {
startDate,
endDate
}
}
}This is an easy and obvious way to split the large file and improve the design by making an implicit concept explicit with a dedicated DateRange value object. The parseDateRange helper function in the BookingScheduler is it's constructor. It becomes a static parse method on the new value object.
class BookingScheduler {
schedule(text: string): void {
const window = DateRange.parse(text)
// ... uses window
}
}Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

