cortex-next
Skill1 starsChanged 2 months agoMITView on GitHub
Where this repo is in the Cortex sequence, read off disk, and the one command to run next. Triggers — "what do I run next", "where am I", "I installed Cortex, now what".
In this repository50 other files it gives its agents.
- AGENTS.mdAGENTS.md
- core/AGENTS.mdAGENTS.md
- index/AGENTS.mdAGENTS.md
- mcp/AGENTS.mdAGENTS.md
- tools/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- analyze-specSkill
- auditSkill
- captureSkill
- catch-me-upSkill
- connect-brainSkill
- cortex-auditSkill
- cortex-briefSkill
- cortex-enrichSkill
- cortex-impactSkill
- cortex-installSkill
- cortex-profileSkill
- cortex-reviewSkill
- cortex-scaffoldSkill
- cortexSkill
- cortex-skillsSkill
- cortex-viewSkill
- dailySkill
- diagnosing-bugsSkill
- domain-modelingSkill
- dreamSkill
- grillingSkill
- handoffSkill
- improve-codebase-architectureSkill
- install-projectSkill
- level-upSkill
- migrate-engineSkill
- onboardSkill
- optimize-contextSkill
- optimize-promptSkill
- plugin-syncSkill
- reindexSkill
- resolving-merge-conflictsSkill
- resumeSkill
- scan-projectsSkill
- setup-pluginsSkill
- shipSkill
- site-syncSkill
- skill-auditSkill
- skill-creatorSkill
- team-addSkill
- team-initSkill
- weekly-reviewSkill
- wizardSkill
- writing-for-agentsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Read-only in the strongest sense: it writes nothing, not even under .cortex/.
- Very specific: line 25
Never mark a step done that no file on disk supports: Every ✓ traces to something that exists — .cortex/index/index.json, a report in …
- Distinctive: line 39
Show the runbook as it printed: Do not re-sort it, do not collapse the done steps into a sentence, and do not append the commands it …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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-next — where this repo is, and the one command to run now
Cortex had an ordering problem, not a capability one. Every ritual knew its own job and none of them knew what came after, so the honest answer to "I installed the plugin, now what" was a table of eleven commands sorted by nothing. A table is a menu. This is a position.
node "${CLAUDE_PLUGIN_ROOT}/index/cortex-next.mjs" . # the ordered runbook, ✓ / → / ·
node "${CLAUDE_PLUGIN_ROOT}/index/cortex-next.mjs" . --line # one line, for a footer
node "${CLAUDE_PLUGIN_ROOT}/index/cortex-next.mjs" . --json # for a ritual to walkRead-only in the strongest sense: it writes nothing, not even under .cortex/.
The one thing you must not do
Never mark a step done that no file on disk supports. Every ✓ traces to something that
exists — .cortex/index/index.json, a report in .cortex/findings/, CONTEXT.md, a
<dir>/AGENTS.md, a SKILL.md under .claude/skills/. A model that "remembers" running
/cortex-scaffold last session, and ticks the box on that memory, sends the user past the step
that actually writes their context layer. If the filesystem cannot say, the step is not done.
The same rule is why this is a script and not a judgment call. The sequence is a fact about the repository; asking a model to re-derive it every session is how a user gets a different answer each time they ask.
How to run it
- Run the CLI from the repo the user is asking about — not from the Cortex checkout, unless
that is the repo.
--jsonif you are going to act on the result rather than show it. - Show the runbook as it printed. Do not re-sort it, do not collapse the done steps into a sentence, and do not append the commands it deliberately left out. Its order is the answer.
- Say the next command last, on its own line, so it is the thing the user's eye lands on.
- If a step is blocking (a retired
.ai-os/engine), say why it jumps the queue: the old memory store gets harvested intoAGENTS.mdbefore anything is deleted, and running the sequence around it loses that knowledge permanently.
What the steps mean
| Step | Done when | Run |
| Index the codebase | .cortex/index/index.json exists | /cortex |
| Read the findings | a report in .cortex/findings/ | /cortex |
| See it as a graph | .cortex/view/repo.html exists | /cortex-view |
| Reconcile prior agent docs | not checkable — offered only while CONTEXT.md is missing | /optimize-context |
| Write the context layer | AGENTS.md and CONTEXT.md | /cortex-scaffold |
| Scoped briefs | any <dir>/AGENTS.md | /cortex-brief <dir> |
| Skills for this stack | any .claude/skills/*/SKILL.md | /cortex-skills |
| Refresh drifted skills | appears only while a skill names a path that is gone, says "no tests" beside a test suite, or runs a script nobody declares — needs an index | /cortex-skills |
| Close the artifact chain | every loop artifact that applies here exists — index/cortex-loop.mjs says which | /cortex |
| Semantic summaries | .cortex/index/enrichment.json | /cortex-enrich |
| Shared memory | anything in .cortex/memory/ | /dream |
Optional steps never become "next" and never hold the sequence up. The per-change rituals
(/cortex-impact, /cortex-review, /analyze-spec, /diagnosing-bugs, /catch-me-up) are a
lookup, not a sequence — they are triggered by what the user is doing, never by how far along the
install is, so they never appear as a step.
Why "reconcile" sits where it does
An AGENTS.md a human wrote before Cortex arrived must be slimmed before /cortex-scaffold
runs, not after. Scaffold is brownfield-safe and will not clobber it — which means the user ends up
with their curated file plus an AGENTS.generated.md, and a merge to do by hand. Doing
/optimize-context first leaves one file. The step disappears once CONTEXT.md exists, because at
that point the scaffold has run and an AGENTS.md older than the index is Cortex's own.
Related
/cortexis step one: a single run satisfies index through the loop, so on a fresh repo this sequence mostly matters for what was deferred./cortex-installis its read-only half and prints this same next line when it finishes./cortex-viewrenders the whole sequence as a Next steps tab in the graph viewer, for a user who would rather see it than read it.
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.

