UNPKG

@felixgeelhaar/cclint

Version:

Catch CLAUDE.md drift before Claude misbehaves. Lints CLAUDE.md, skills, subagents, and hooks for Claude Code projects.

70 lines 2.57 kB
import type { Rule } from '../domain/Rule.js'; import { ContextFile } from '../domain/ContextFile.js'; import { Violation } from '../domain/Violation.js'; /** * Rule that validates CLAUDE.md content organization and quality * * @remarks * Enforces Anthropic's best practices for content organization: * - Be specific: "Use 2-space indentation" vs "Format code properly" * - Use structure: Bullet points and markdown headings * - Clear instructions: Avoid vague language * - Emphasis for critical items: IMPORTANT, YOU MUST, etc. * * This rule focuses on content quality rather than technology-specific patterns. * * @see {@link https://docs.claude.com/en/docs/claude-code/memory#memory-best-practices | Memory best practices} * * @category Rules */ export declare class ContentOrganizationRule implements Rule { readonly id = "content-organization"; readonly description = "Validates content organization and specificity following Anthropic best practices"; private readonly vaguePhrases; private readonly emphasisMarkers; appliesTo(file: ContextFile): boolean; lint(file: ContextFile): Violation[]; /** * Check heading hierarchy (h1 → h2 → h3, no skipping levels) */ private checkHeadingHierarchy; /** * Check that sections use bullet points for organization */ private checkBulletPointUsage; /** * Detect vague language that should be more specific. * * Tracks fenced code-block state so vague terms inside a block * are ignored. Previously only the fence delimiter line itself * was skipped, letting vague terms in code examples generate * false positives. */ private checkVagueLanguage; /** * Check for proper use of emphasis markers */ private checkEmphasisUsage; /** * Check for overuse of emphasis markers (reduces effectiveness) */ private checkEmphasisOveruse; /** * Check for specific, measurable guidelines. * * The tool-name allowlist intentionally excludes "format" itself so * sentences like "Use the appropriate format for code" still fire — * previously the keyword "format" matched the allowlist regex and * silently suppressed every format-related warning. */ private checkSpecificity; /** * Check if a section is primarily code blocks */ private isCodeBlockSection; /** * Get suggestion for vague term based on context */ private getSuggestionForVagueTerm; } //# sourceMappingURL=ContentOrganizationRule.d.ts.map