/ knowledge

Capture decisions, notes, and feature documentation that persists across sessions.

The /knowledge command captures structured knowledge during or after a session. It creates documents in flydocs/knowledge/ that persist across sessions -- your AI assistant consults them when making future decisions.

Usage

agent chat
/knowledge We decided to use Zustand instead of Redux for state management
agent chat
/knowledge Document the authentication flow for the API

Templates

FlyDocs provides three knowledge templates. The AI selects the right one based on your input, or you can specify directly:

Template Purpose When to Use
Decision Architecture Decision Record (ADR) Recording a technical choice with context, alternatives, and rationale
Note General knowledge capture Documenting patterns, conventions, or context that future sessions need
Feature Feature documentation Describing how a feature works, its components, and integration points

What Happens

  1. Template Selection: FlyDocs determines the appropriate template from your description
  2. Content Generation: The AI structures your input into the selected template format
  3. File Creation: The document is saved to flydocs/knowledge/
  4. Index Update: flydocs/knowledge/INDEX.md is updated to reference the new document

How Knowledge Persists

Knowledge documents are checked into your repository alongside your code. When the AI starts a new session, the session-start.py hook injects relevant knowledge context. This means decisions you record today inform the AI's choices tomorrow -- even across different sessions and different team members.

Examples

Recording a Decision

agent chat
/knowledge Decision: Use server-side rendering for the dashboard pages.
Context: We need good SEO and fast initial loads.
Alternatives considered: SPA with client-side rendering, static generation.
Chose SSR because dashboard data changes frequently and static generation
would require rebuilds.

Capturing a Note

agent chat
/knowledge Note: The payment webhook endpoint expects idempotency keys
in the X-Idempotency-Key header. Stripe sends retries, so all handlers
must be idempotent.

Related Commands