Skip to content
AFK / Docs

Search page titles and summaries. Shortcut: Ctrl / ⌘ K.

38 pages found

Rules and LSP configuration

Project rules and language server configuration let teams make AFK sessions behave consistently across a repository without repeating setup instructions in every prompt.

Path-scoped rules

Rules are Markdown files under <projectDir>/.afk/rules/with frontmatter that declares where they apply. AFK scans matching rules at session start and whenever it rebuilds the prompt, then injects the relevant instructions for the current project paths.

---
glob: "web/src/**/*.{ts,tsx}"
---
Use apiFetch for user-scoped server resources.
Use CSS design tokens from web/src/index.css; do not hardcode colours.

Use rules for durable repository conventions: API wrappers, testing expectations, deployment constraints, path-specific style, generated-file warnings, and architectural boundaries.

Managing rules

Run /rules in the browser chat to open the rule manager for the active project. Rules can also be edited directly on disk when you want them reviewed in source control.

LSP configuration

AFK's daemon owns language server processes through its LSP manager. LSP tools provide semantic navigation, hover information, diagnostics, references, rename, code actions, and call hierarchy to agents. See the Tools Reference for the full lsp_*tool list.

Override a language-server command from Preferences → LSP. That editor writes lsp.json on the selected daemon. Project files and bundled defaults still apply when no override is set.

The daemon starts LSP servers with the same resolved environment used for other subprocesses. This matters on macOS and service-managed installs where PATH can differ from an interactive shell.

When to use rules vs skills

UseFor
RulesAlways-on project or path conventions that should apply automatically.
SkillsReusable workflows that should be invoked explicitly or selected by the model for a task.
Custom agentsReusable personas with role instructions, model preferences, or tool restrictions.