# ClineFlow OKF Knowledge Rules

This is the shared OKF workflow used alongside ChatGPT Codex (`AGENTS.md`), Cursor, Copilot, Windsurf, and other compatible agents.

## Always read first

- `knowledge/index.md` — the OKF bundle entry point.
- `knowledge/journals/` — active and completed Engineering Journal concepts.
- `knowledge/journals/TASK_TEMPLATE.md` — the template for new task concepts.

## Task knowledge workflow

1. Search `knowledge/` for relevant context before work begins.
2. If `docs/journals/` exists, search it as read-only legacy context; never create or update new work there.
3. For substantial work, create or resume `knowledge/journals/<task-name>.md` from `knowledge/journals/TASK_TEMPLATE.md`.
4. Keep YAML frontmatter valid with a non-empty `type`, and record decisions, testing, and next steps in the concept body.
5. Update `knowledge/log.md` for material knowledge changes.

## Commit workflow

When asked to commit, update the active knowledge journal, run `./validate-okf` (or `./validate-okf --strict` when optional PyYAML is available), stage code and knowledge together, then create a descriptive commit.

## Code quality

- Prefer focused modules (roughly 300–500 lines; refactor files over 1,000 lines).
- Keep documentation factual, concise, and linked to related knowledge concepts or project files.
