Skip to content

feat: /knowledge to extract knowledge files#5253

Closed
paralin wants to merge 1 commit into
anomalyco:devfrom
paralin:knowledge-system-pr
Closed

feat: /knowledge to extract knowledge files#5253
paralin wants to merge 1 commit into
anomalyco:devfrom
paralin:knowledge-system-pr

Conversation

@paralin

@paralin paralin commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

Adds a command /knowledge which creates a sub-agent to take any new "knowledge" in the session and format it neatly into markdown docs in ./.opencode/knowledge/

This is particularly useful both for human-readable documentation for getting familiarized with a codebase, and for providing an extended version of AGENTS.md which does not pollute the context.

A follow-on commit adds a system to automatically load files from the knowledge directory according to topics mentioned in the conversation.

Try running /knowledge to create the sub-agent.

@paralin
paralin force-pushed the knowledge-system-pr branch 5 times, most recently from 0f62a3e to 5b07d28 Compare December 8, 2025 19:08
@paralin

This comment was marked as outdated.

@paralin
paralin force-pushed the knowledge-system-pr branch 2 times, most recently from bafd214 to c30c320 Compare December 8, 2025 19:14
@paralin

This comment was marked as outdated.

@paralin
paralin force-pushed the knowledge-system-pr branch from c30c320 to a135b5a Compare December 8, 2025 19:19
@edlsh

edlsh commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

Hey @paralin, the format CI is set up to auto-push formatting fixes, but this doesn't work for PRs from forks (the GitHub token can't push to external repos).

You'll need to run bun run prettier --ignore-unknown --write . locally and push the formatted changes yourself.

@paralin
paralin force-pushed the knowledge-system-pr branch 2 times, most recently from b37b416 to e0af373 Compare December 8, 2025 19:22
@paralin

This comment was marked as outdated.

@edlsh

edlsh commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

@paralin Don't worry too much about the format CI - it fails on fork PRs because it can't push back to external repos. Once a maintainer approves and merges to dev, the auto-formatting will run with proper permissions and fix it up.

@edlsh

edlsh commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

If you really wanted all green lights, then:

# 1. Generate SDK
bun ./packages/sdk/js/script/build.ts

# 2. Format everything (including generated SDK)
bun run prettier --ignore-unknown --write .

# 3. Commit and push
git add -A && git commit --amend && git push -f

The key is formatting after SDK generation so the generated files are also formatted.

@paralin
paralin force-pushed the knowledge-system-pr branch from e0af373 to 536ffe9 Compare December 8, 2025 19:33
@paralin

This comment was marked as outdated.

@paralin
paralin force-pushed the knowledge-system-pr branch 2 times, most recently from ccb3e43 to a228f1a Compare December 9, 2025 01:30
@Raviguntakala

Copy link
Copy Markdown
Contributor

commit adds a system to automatically load files from the knowledge directory according to topics mentioned in the conversation.

Try running /knowledge to create the sub-agent.

Sdk ci format and format ci always clash with each other, so you will never see both turn green. So chill, even if the ci fails they don’t bother much. It will still get merged

@paralin

This comment was marked as resolved.

@paralin
paralin force-pushed the knowledge-system-pr branch from a228f1a to b33b23c Compare December 9, 2025 02:43
@paralin
paralin marked this pull request as draft December 9, 2025 04:08
@paralin
paralin force-pushed the knowledge-system-pr branch from b33b23c to f3b3a27 Compare December 10, 2025 20:06
@paralin
paralin marked this pull request as ready for review December 10, 2025 20:06
@paralin

paralin commented Dec 10, 2025

Copy link
Copy Markdown
Contributor Author

Working now and this PR is as minimal as possible to add the feature. I'm using it a lot in my projects.

In opencode.jsonc:

  "agent": {
    "knowledge-extractor": {
      // "model": "github-copilot/claude-opus-4-5",
      "model": "github-copilot/oswe-vscode-prime",
    },
  },

@paralin
paralin force-pushed the knowledge-system-pr branch 2 times, most recently from 5f291b1 to 33e8840 Compare December 11, 2025 02:20
@paralin
paralin force-pushed the knowledge-system-pr branch 5 times, most recently from 7a3d09a to 880b71b Compare December 15, 2025 21:28
Adds a command /knowledge which creates a sub-agent to take any new "knowledge"
in the session and format it neatly into markdown docs in ./.opencode/knowledge/

This is particularly useful both for human-readable documentation for getting
familiarized with a codebase, and for providing an extended version of AGENTS.md
which does not pollute the context.

A follow-on commit adds a system to automatically load files from the knowledge
directory according to topics mentioned in the conversation.

Try running /knowledge to create the sub-agent.

Signed-off-by: Christian Stewart <christian@aperture.us>
@paralin
paralin force-pushed the knowledge-system-pr branch from 880b71b to 46671ec Compare December 15, 2025 23:12
@paralin paralin closed this Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants