cortex-evolve
Skill24 starsChanged 2 months agoApache-2.0View on GitHub
Save knowledge to the cortex vault. Use when the user says "存到 cortex", "記一下", "save to cortex", "記到筆記", "cortex evolve", or when the session-suggest hook recommends saving content. Handles Notes and Projects.
- Commits and pushes
In this repository5 other files it gives its agents.
- cortex-broadcastSkill
- cortex-distillSkill
- cortex-querySkill
- cortex-takeoffSkill
- using-cortexSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 4 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Read ~/.cortex/config.json to get vault_path.
- Very specific: line 16
If the file doesn't exist, tell the user to run /cortexes:genesis first.
- Distinctive: line 17
All file paths below are relative to the vault root.
- Distinctive: line 21
Ask the user if unclear. Use these heuristics:
- Very specific: line 31
Create file at Notes/<category>/<title>.md
- Very specific: line 50
Use Obsidian wikilinks [[note-name]] for vault-internal references
- Very specific: line 51
Use standard markdown links text for external URLs only
- Very specific: line 56
If Projects/<repo-name>/_index.md doesn't exist, create it:
- Very specific: line 71
Create topic file at Projects/<repo-name>/<topic>.md
- Distinctive: line 75
After writing the file:
- Very specific: line 119
If git.commit_trailer in config is a non-empty string, pass it as a second -m so it becomes the last line of the message body: git commit …
- Very specific: line 123
If auto_push is true in config: git push
- Distinctive: line 129
After committing the new file to the vault:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cortex Evolve — Save to Vault
Save content to the cortex Obsidian vault.
Resolve Vault Path
Read ~/.cortex/config.json to get vault_path.
If the file doesn't exist, tell the user to run /cortexes:genesis first.
All file paths below are relative to the vault root.
Determine Content Type
Ask the user if unclear. Use these heuristics:
| Signal | Type | Target |
| Technical knowledge, how-to, concept explanation | Notes | Notes/<category>/<title>.md |
| Related to a specific repo's design, decision, or progress | Projects | Projects/<repo-name>/<title>.md |
Writing to Notes
- Determine category from content (C++, Linux, Nginx, Web, or create new)
- Create file at
Notes/<category>/<title>.md - Use this template:
---
title: <title>
tags:
- <relevant-tags>
created: <YYYY-MM-DD>
source: cortex
---
# <title>
<content>
<optional: related wikilinks like [[nginx-cert-renew]] or [[other-note]]>- Use Obsidian wikilinks
[[note-name]]for vault-internal references - Use standard markdown links
[text](url)for external URLs only
Writing to Projects
- Determine repo name (from current session context or ask user)
- If
Projects/<repo-name>/_index.mddoesn't exist, create it:
---
title: <repo-name>
repo: <git-remote-url>
tags:
- project
---
# <repo-name>
<brief description>- Create topic file at
Projects/<repo-name>/<topic>.md
Update _index.md
After writing the file:
- Read
<vault_path>/_index.md Append a row under the matching
###sub-section, creating the sub-section (with its table header) if it does not exist yet:- Notes →
### <topic>under## Notes:| [[title]] | tags | one-line summary | - Projects →
### <repo-name>under## Projects:| [[topic-title]] | tags | summary |
Rows are per-page, not per-repo: a new repo means a new
###sub-section, not a single row standing for the whole repo.- Notes →
- Bump the
updateddate in frontmatter. There is noentries:count to maintain — the field was removed by design (see/cortexes:genesis).
Append Log Entry
Compose this entry with all placeholders substituted (today's date/time in YYYY-MM-DD HH:MM format, the vault-relative path of the saved file, the repo name or (none)):
## [YYYY-MM-DD HH:MM] evolve | user-initiated
- outcome: new
- target: <vault-relative path of saved file>
- repo: <repo name or "(none)">Append to <vault>/log.md using either the Edit tool (preferred — preserves file integrity) or bash:
printf '\n%s\n' "$ENTRY" >> "<vault>/log.md"Where $ENTRY is the fully-substituted markdown entry.
Preserve exactly one blank line between entries (achieved by the leading \n in the printf above, or by ensuring the Edit tool's appended content starts with a blank line).
The dedup_top1 field is omitted for evolve entries (evolve does not perform a dedup check in Phase 1; the user explicitly chose to save).
Commit
In the vault repo:
git add <file> _index.md log.md
git commit -m "cortex: <type> <brief>"If git.commit_trailer in config is a non-empty string, pass it as a second
-m so it becomes the last line of the message body:
git commit -m "cortex: <type> <brief>" -m "<commit_trailer>".
If auto_push is true in config: git push
Confirm to the user what was saved and where.
Update Vector Store
After committing the new file to the vault:
- Run:
cortex-vec upsert <relative-path-from-vault>
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

