marinvch/cortex/setup-repo
Claude Code and agent skill by marinvch/cortex
- community
Checking that the SKILL.md file is still in the repository.
Set up a new or legacy repo — the whole Cortex loop in one pass (root brief, verification, PR review, hooks, evals, agent team) or a report only. Asks once, edits no source. Triggers — "install cortex", "set this repo up", "onboard this project", "just index this", "show me the findings", or a repo with no AGENTS.md.
Install
npx vskill@latest install marinvch/cortex/setup-repoSKILL.md
The same SKILL.md was published earlier as marinvch/cortex/setup-repo.
/setup-repo — one install, working project or new one
The front door. Runs in a target repo, never in the Cortex repo itself.
Everything Cortex used to ask a user to sequence by hand — index, findings, scaffold, briefs, skills — happens here, in one pass, behind one confirmation. The other rituals still exist and are still callable by name; what changed is that nobody has to know their order to get a served repo.
One pass writes everything that can be written today. Two rows cannot be: evals need real past tasks to seed cases from, and bands need a production metric with a stable history. Both also wait on files this same pass writes (CLAUDE.md, REVIEW.md), so they come back as missing afterwards. Say that in the playback. Do not promise them in the first pass. cortex-next.mjs then names /setup-repo evals and /setup-repo bands (RUNS.md).
The rule that governs this whole skill: steps 1–5 read, report and ask. They do not modifyone line of the repository. Writing happens in step 7, only for what the user confirmed. If youfind yourself editing a file before the user has chosen something, stop — you have left the skill.
What "served" means here
A repo is served when the artifact chain is closed: an idea becomes intent.md, which becomes spec.md, which becomes plan.md, which becomes a diff with tests, which becomes a PR judged against a written policy, which passes a gate — and production writes the next intent.md.
Each stage ends by committing a file the next stage reads, which is why "is this repo served" is a question about files on disk and not a judgment call. index/lib/loop.mjs answers it.
Report only, invoked with a row, or run unattended
Read RUNS.md before step 1 in any of these cases:
- Report only — "just index this", "report on this repo", "show me the findings". Index, report
and walk the offers, then stop; nothing is written beyond .cortex/. This is what the separate install command did before 3.0.0.
- Invoked with a row —
/setup-repo evals,/setup-repo bandsor/setup-repo team. Only that row is
taken, and evals and bands stop when there is no real history to build them from.
- Run unattended —
claude -p, where nobody answers the consent gate or step 6. Claude Code
refuses every write under .claude/ there unless the run is in auto mode, and the install still reads as finished.
1. Orient
Root, profile and index freshness, from the one place that owns them. Do not re-derive any of the three — every prose copy is a copy that drifts.
Refuse to continue if this is the Cortex repo itself (.claude-plugin/plugin.json names cortex). Cortex installs into other repos.
The consent gate
This skill is model-invocable — you may start it yourself when a repo plainly needs it. That makes the gate below the thing protecting the repository, not the invocation rules.
If `.cortex/` does not exist, ask before writing anything — including the index. Say what you propose to do, and what the read steps write: files under .cortex/, plus three ignore lines appended to .gitignore the first time. They never write to source. Then wait for a yes. Generated and gitignored is not the same as invisible: these are files appearing in someone's project on a run they did not ask for.
If `.cortex/` already exists, Cortex is established here and re-indexing needs no ceremony.
The gate is on the first write, not on reading. Orienting yourself — reading AGENTS.md, the tree, the manifest — needs no permission and never did.
2. Index
Deterministic and offline. Writes .cortex/index/index.json. The run that first creates .cortex/ also appends .cortex/index/, .cortex/findings/ and .cortex/view/ to the target's .gitignore, and creates that file if there is none. That is the one write outside .cortex/. The indexer prints the lines it added; tell the user.
Index before reading the loop. Two loop rows cite the index — the root brief names the detected stack, the hooks row names the generated paths — and without one they report "nothing detected", which a user cannot tell from "looked and found none". Running the loop first is not wrong, it is just half an answer, and it will say so in its own header.
The fork: working project or new one
The indexer prints the file count, and zero files is the greenfield flow — a different sequence, not a degenerate case of the other:
- New project — nothing to analyse, so skip the ceremony. Interview for the stack and the
commands instead of reading them, since there is nothing to read them from. Offer no scoped briefs and no enrichment: both describe code, and there is none. Offer no REVIEW.md yet either — a review policy about nothing is a file that will be wrong by the time it is read. Say the honest version: the loop now grows with the code instead of being reverse-engineered from it.
- Working project — continue below.
The fork is on the index, never on a guess. A repo with a README and no source is greenfield; a repo whose only code is a build script is not. And an index that has not been built is not evidence of either — loop.mjs refuses to call a repo greenfield on a missing index, because the first run of this module announced "no code yet" over several hundred files.
3. Report what is wrong
Writes exactly one file, .cortex/findings/<date>.md. Read it, then give a short summary in chat — the top three or four, most severe first, in your own words. Do not paste the report.
Lead with critical security findings if there are any, and say in the same breath that some will be fixtures. A false positive presented as a breach destroys trust in every other finding.
4. Read what is missing
Writes nothing. Returns three buckets, and the difference between them is the whole interview:
| Bucket | Meaning | What you do | |
|---|---|---|---|
present | already on disk | report it as served; never offer to rewrite it | |
missing | applies here and absent | this is the worklist | |
blocked | does not apply yet | name it, with its needs |
Walk missing in the order it comes — the rank is control flow, so the first row is the first question. Each entry carries why (what was detected) and brief (what the body must contain).
A blocked row is named, never dropped. bands.yaml waiting on REVIEW.md is a fact the user should hear once; an offer that silently vanishes is indistinguishable from a bug. One line each, with the needs attached, and move on.
Never offer to overwrite a `present` artifact. A hollow REVIEW.md still counts as present, because silently replacing a file someone wrote is the worse failure. If one looks thin, say so as an observation and let them ask.
5. Also walk the findings worklist
This prints the ranked worklist as JSON and writes nothing at all. It is the same analysis the report renders, in the shape you can act on: one entry per action, most severe first, each carrying targets (what it would touch) and findings (the titles that produced it). It covers what the loop does not:
| Action | Ask about | |
|---|---|---|
scaffold | the context layer: AGENTS.md and shims, CONTEXT.md, docs/adr/ | |
brief | scoped AGENTS.md leaves for the named areas | |
bundle | the plugin tiers the index gave a reason for, never the whole list | |
enrich | semantic summaries over the index | |
memory | a committed .cortex/memory/ | |
triage-secrets | nothing. See the rules below |
Merge it with the loop worklist into one list of questions; the user should not be able to tell which module produced which. Say first that nothing is written until the end, and record yes, no or later for each. Ask with the why from findings attached, and do not re-expand the collapsed worklist per target: one brief entry is one question naming its candidates. An empty worklist, or a user who declines everything, is a complete run.
On a team's repo, the person's job shapes the answers you propose, never the order or the list. Read RUNS.md before step 2 when .cortex/connector.json exists.
Agent docs that were already here go first. If CLAUDE.md, .cursorrules or another agent doc exists and CONTEXT.md does not, a human wrote it before Cortex arrived. Ask cortex-next.mjs rather than re-deriving it — a reconcile step in its --json output is the signal:
When it is there, the first question is whether to slim that doc with /trim-agent-docs before the scaffold runs. Scaffold never clobbers a curated file, so skipping this does not lose anything — it leaves the user with their file plus an AGENTS.generated.md to merge by hand, which is the double-file a single install exists to avoid. The first version of this skill left the step out and produced exactly that.
A reconcile step with optional: true is a different case: the layer is already written, and the files in its docs (today only .github/copilot-instructions.md) still hold rules of their own beside AGENTS.md. Add it to the worklist as one ordinary row that offers /trim-agent-docs for those files. It is not asked first, and a no is a full answer: a team may keep rules for one tool on purpose.
Skills an earlier pass wrote are checked on every re-run. A skill-drift step in the same --json output lists each skill the repo now contradicts, with its lines in drift[].findings — a path that is gone, "no tests" beside a test suite, a script no manifest declares. Every line is provable from disk. Add each drifted skill to the merged worklist as one row naming its lines, so the single confirmation in step 6 covers exactly what the user saw. When drift[].editedNote is set, a person worked on that skill after it was written: put the note on the row, word for word. The confirmation then covers the edit too, and nothing is asked about that skill afterwards. present in the loop means the file exists; it never meant the file is still true.
Loop files an earlier pass stamped are checked against this release's templates.
It writes nothing. When `olderPlugin` is not null, a newer Cortex stamped this repo: say its advice and offer no stamp row. This pass then updates no file and asks about none. Every state below is measured against this plugin's older templates, so none of them is what the updated plugin will find: a file that reads update here may read current there. So do not list the files or their states, not even as a preview of what the pass after the update will offer or ask. A preview is a promise about a comparison nobody has made yet, and that pass reads them again. A user who says to just update everything gets the same answer. Updating the plugin is how everything gets updated.
files is null when there is no .cortex/stamps.json yet. Otherwise each file has a state, and the state decides the row:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/setup-repo/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/marinvch/cortex/setup-repo)