Skip to content

Rules

LingXiao supports project-level rule files that inject engineering constraints into Agent context. Rules are Markdown files automatically injected into the Agent context without manual referencing.

LevelDirectoryDescription
Project.lingxiao/rules/Project-specific rules
User~/.lingxiao/rules/Global user rules

Rule files are Markdown format, auto-injected into the Agent context:

# Code Standards
- Use TypeScript strict mode
- Functions must have explicit return type annotations
- No use of any type
- All public APIs must have JSDoc comments

project > global. Project-level rules override user-level rules.

Rule files are automatically read and injected into the system prompt at Agent startup. Unlike Skills, rules do not require explicit references (no $skill syntax); all rule file contents are injected.

ScopeBehavior
Project rulesVisible only to Agents in the current workspace
User rulesVisible to all Agents
# Code Standards
- TypeScript strict mode
- Use ESM imports (no require)
- Functions must have explicit return type annotations
- No @ts-ignore
- Public functions require JSDoc comments
# Git Standards
- Commit messages use conventional commits format
- feat: new feature / fix: bugfix / docs: docs / refactor: refactor
- Each commit contains only one logical change
- PR title matches commit title
# Testing Standards
- New features must include unit tests
- Test coverage must be at least 80%
- Use describe/it to organize test structure
- Mock external dependencies, not the module under test
# Security Standards
- No hardcoded API keys or passwords
- Environment variables must be read through config.ts
- SQL queries must use parameterized statements
- User input must be validated and escaped
FeatureRulesSkills
InjectionAutomaticOn-demand ($skill or role binding)
ContentConstraints and standardsProcedures and domain knowledge
FormatPlain MarkdownYAML frontmatter + Markdown
Location.lingxiao/rules/.lingxiao/skills/
Priorityproject > global4-tier (project > plugin > user > bundled)