-
Notifications
You must be signed in to change notification settings - Fork 11.6k
feat: add GitHub workflows to sync agents/ to Devin Knowledge #26994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add parse-to-devin-knowledge.ts to convert agents/ markdown to Devin Knowledge JSON - Add validate-format.ts to validate rules have frontmatter and knowledge-base sections start with 'When...' - Add sync-to-devin.ts to sync knowledge entries to Devin API - Add export-devin-knowledge.sh to backup existing Devin knowledge - Add validate-agents-format.yml workflow to validate format on PRs - Add sync-agents-to-devin.yml workflow to sync on merge to main - Add devin-knowledge.json to .gitignore (generated file) Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 8 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="scripts/devin/sync-knowledge-to-devin.ts">
<violation number="1" location="scripts/devin/sync-knowledge-to-devin.ts:1">
P2: The shebang uses `env` with a multi-word command (`npx ts-node`), which fails when executing the script directly. Use a single executable (e.g., `ts-node`) or `env -S` to pass multiple args.</violation>
</file>
<file name="scripts/devin/validate-local-knowledge.ts">
<violation number="1" location="scripts/devin/validate-local-knowledge.ts:1">
P3: This shebang won’t run as an executable because `/usr/bin/env` can only take one argument; it will try to execute a command literally named `npx ts-node`. Use `env -S` (or a single command) so the script can be executed directly.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| @@ -0,0 +1,248 @@ | |||
| #!/usr/bin/env npx ts-node | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The shebang uses env with a multi-word command (npx ts-node), which fails when executing the script directly. Use a single executable (e.g., ts-node) or env -S to pass multiple args.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/devin/sync-knowledge-to-devin.ts, line 1:
<comment>The shebang uses `env` with a multi-word command (`npx ts-node`), which fails when executing the script directly. Use a single executable (e.g., `ts-node`) or `env -S` to pass multiple args.</comment>
<file context>
@@ -0,0 +1,248 @@
+#!/usr/bin/env npx ts-node
+
+/**
</file context>
| @@ -0,0 +1,174 @@ | |||
| #!/usr/bin/env npx ts-node | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: This shebang won’t run as an executable because /usr/bin/env can only take one argument; it will try to execute a command literally named npx ts-node. Use env -S (or a single command) so the script can be executed directly.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/devin/validate-local-knowledge.ts, line 1:
<comment>This shebang won’t run as an executable because `/usr/bin/env` can only take one argument; it will try to execute a command literally named `npx ts-node`. Use `env -S` (or a single command) so the script can be executed directly.</comment>
<file context>
@@ -0,0 +1,174 @@
+#!/usr/bin/env npx ts-node
+
+/**
</file context>
Fix confidence (alpha): 8/10
| #!/usr/bin/env npx ts-node | |
| #!/usr/bin/env -S npx ts-node |
Devin AI is addressing Cubic AI's review feedbackNew feedback has been sent to the existing Devin session. ✅ No changes pushed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="scripts/devin/sync-knowledge-to-devin.ts">
<violation number="1" location="scripts/devin/sync-knowledge-to-devin.ts:10">
P3: Update the usage comment to reference the correct script path so the documented command is runnable.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Devin AI is addressing Cubic AI's review feedbackNew feedback has been sent to the existing Devin session. ✅ Pushed commit |
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 issues found across 8 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="scripts/devin/parse-local-knowledge.ts">
<violation number="1" location="scripts/devin/parse-local-knowledge.ts:1">
P2: The shebang won’t execute because `/usr/bin/env` can’t resolve `npx ts-node` as a single binary. Use `env -S` or call `ts-node` directly so the script runs when executed as a file.</violation>
</file>
<file name="scripts/devin/export-devin-knowledge.ts">
<violation number="1" location="scripts/devin/export-devin-knowledge.ts:1">
P2: The shebang uses multiple arguments without `-S`, so direct execution will fail because `/usr/bin/env` receives `"npx tsx"` as a single program name. Use `env -S` or a single executable in the shebang.</violation>
</file>
<file name="scripts/devin/validate-local-knowledge.ts">
<violation number="1" location="scripts/devin/validate-local-knowledge.ts:1">
P2: The shebang is invalid because `/usr/bin/env` cannot take multiple arguments without `-S`. Running the script directly will fail. Use `-S` or a single executable in the shebang.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| @@ -0,0 +1,236 @@ | |||
| #!/usr/bin/env npx ts-node | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The shebang won’t execute because /usr/bin/env can’t resolve npx ts-node as a single binary. Use env -S or call ts-node directly so the script runs when executed as a file.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/devin/parse-local-knowledge.ts, line 1:
<comment>The shebang won’t execute because `/usr/bin/env` can’t resolve `npx ts-node` as a single binary. Use `env -S` or call `ts-node` directly so the script runs when executed as a file.</comment>
<file context>
@@ -0,0 +1,236 @@
+#!/usr/bin/env npx ts-node
+
+import * as fs from "fs";
</file context>
| @@ -0,0 +1,174 @@ | |||
| #!/usr/bin/env npx ts-node | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The shebang is invalid because /usr/bin/env cannot take multiple arguments without -S. Running the script directly will fail. Use -S or a single executable in the shebang.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/devin/validate-local-knowledge.ts, line 1:
<comment>The shebang is invalid because `/usr/bin/env` cannot take multiple arguments without `-S`. Running the script directly will fail. Use `-S` or a single executable in the shebang.</comment>
<file context>
@@ -0,0 +1,174 @@
+#!/usr/bin/env npx ts-node
+
+/**
</file context>
Fix confidence (alpha): 8/10
| #!/usr/bin/env npx ts-node | |
| #!/usr/bin/env -S npx ts-node |
Devin AI is addressing Cubic AI's review feedbackNew feedback has been sent to the existing Devin session. ✅ Pushed commit |
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
What does this PR do?
Adds automation to sync the
agents/folder documentation to Devin's Knowledge API. This enables automatic updates to Devin's knowledge base whenever agent documentation is modified.Components added:
scripts/devin/parse-local-knowledge.ts- Converts agents/ markdown files to Devin Knowledge JSON formatscripts/devin/validate-local-knowledge.ts- Validates rules have proper frontmatter (title, tags) and knowledge-base sections start with "When..."scripts/devin/sync-knowledge-to-devin.ts- Syncs knowledge entries to Devin API (create/update)scripts/devin/export-devin-knowledge.ts- Backup script to export existing Devin knowledgevalidate-agents-format.yml- Runs on PRs modifyingagents/**sync-agents-to-devin.yml- Runs on merge to main foragents/**changesMandatory Tasks (DO NOT REMOVE)
How should this be tested?
npx tsx scripts/devin/validate-local-knowledge.ts- should pass with "All files are valid!"npx tsx scripts/devin/parse-local-knowledge.ts- generatesagents/devin-knowledge.jsonwith ~55 entriesDEVIN_API_TOKENenv var - not tested against live API yetBefore merging:
DEVIN_API_TOKENas a GitHub secret for the sync workflow to work/knowledge/folders) is correct - I assumed this path based on the docsChecklist
Updates since last revision
scripts/devin/subfolder with clearer names (per user request):parse-local-knowledge.ts- parses local agents/ filesvalidate-local-knowledge.ts- validates local agents/ formatsync-knowledge-to-devin.ts- syncs to Devin APIexport-devin-knowledge.ts- exports from Devin API (converted from shell to TypeScript)../..since scripts are now two levels deepknowledge-base.md(consolidated to avoid bloat):Build[ServiceName]) in app-store sectionLink to Devin run: https://app.devin.ai/sessions/b056870cc7fa42cbb2968159afa5929b
Requested by: @eunjae-lee