idev-init
Skill0 starsChanged 5 months agoMITView on GitHub
Scaffolds the per-project .claude/idev/ state directory (caches, journal, lessons, config templates) for the idev plugin. Use when starting idev in a new project, when the SessionStart hook reports the state directory is missing, or when the user runs /idev:idev-init or asks to 'set up idev'.
In this repository38 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-contract-validationSkill
- architecture-scannerSkill
- auto-approve-policySkill
- auto-learningSkill
- backend-patternsSkill
- branch-syncSkill
- browser-testSkill
- browseSkill
- build-checkSkill
- cache-refreshSkill
- codebase-explainerSkill
- coding-standardsSkill
- commit-styleSkill
- context-switchingSkill
- continuous-learningSkill
- db-preflightSkill
- env-preflightSkill
- eval-harnessSkill
- feature-completenessSkill
- file-indexSkill
- frontend-patternsSkill
- function-extractSkill
- import-graphSkill
- lessons-learnedSkill
- post-creation-verifySkill
- pre-ship-verifySkill
- project-mapSkill
- self-reviewSkill
- session-resumeSkill
- skill-benchmarkSkill
- skilloptSkill
- smart-contextSkill
- strategic-compactSkill
- task-journalSkill
- tdd-workflowSkill
- test-coverageSkill
- test-mapSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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 14
Check for existing state: If .claude/idev/ already exists with content, report what's there and ask before overwriting anything.
- Very specific: line 30
Initialize session state: Write .claude/idev/session-resume/last-session.json with:
- Very specific: line 36
Initialize db-preflight state: Write .claude/idev/db-preflight/applied.json with:
- Very specific: line 42
Fill project config (refuse to leave templated): Read .claude/idev/project-config.json — if git.baseBranch is still "{{e.g.
- Very specific: line 47
Write the filled values back to project-config.json.
- Distinctive: line 52
Write the filled values back.
- Very specific: line 54
Offer auto-learning setup (one-time): Ask the user: "Enable the auto-learning observer?
- Very specific: line 55
Create ~/.claude/homunculus/ directory structure if missing
- Distinctive: line 58
If no, skip — the hooks are pre-registered but flag-guarded, so they cost nothing until enabled.
- Very specific: line 78
Optionally trigger first scans: Ask whether to run the initial project scans now (smart-context index, file-index, pattern caches).
- Very specific: line 82
If python3 is unavailable, build the index manually per the idev:smart-context skill (detect the stack, feature names, and naming patterns, …
≈ “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
idev Init — Scaffold Per-Project State
Initialize the .claude/idev/ state directory in the current project. All idev skills read and write their per-project state (caches, indexes, journal, lessons, session state) here — never inside the plugin install directory.
Steps
- Check for existing state: If
.claude/idev/already exists with content, report what's there and ask before overwriting anything. Never overwrite an existingjournal.md,lessons.md, or any cache file. - Create the directory layout:
mkdir -p .claude/idev/{smart-context,backend-patterns,frontend-patterns,architecture-scanner,build-check,api-contract-validation,post-creation-verify,file-index,import-graph,test-map,lessons-learned,task-journal,session-resume,project-map,api-contracts/contracts,browser-tests/{scripts,artifacts,reports},db-preflight} - Copy templates (only where the destination does not exist):
${CLAUDE_PLUGIN_ROOT}/templates/journal.md→.claude/idev/task-journal/journal.md${CLAUDE_PLUGIN_ROOT}/templates/lessons.md→.claude/idev/lessons-learned/lessons.md${CLAUDE_PLUGIN_ROOT}/templates/project-config.json→.claude/idev/project-config.json${CLAUDE_PLUGIN_ROOT}/templates/commands.json→.claude/idev/commands.json${CLAUDE_PLUGIN_ROOT}/templates/watcher_config.json→.claude/idev/project-map/watcher_config.json${CLAUDE_PLUGIN_ROOT}/templates/rules.md→.claude/idev/rules.md${CLAUDE_PLUGIN_ROOT}/templates/commit-style.md→.claude/idev/commit-style.md
- Initialize session state: Write
.claude/idev/session-resume/last-session.jsonwith:
Also stamp the plugin version into{ "lastTask": null, "modifiedFiles": [], "openIssues": [], "savedAt": null }.claude/idev/.idev-version(read it from${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json) —/idev:upgradeuses this to detect drift after plugin updates. - Initialize db-preflight state: Write
.claude/idev/db-preflight/applied.jsonwith:
This tracks which DBScripts have been applied to prevent "Invalid object name" 500s.{ "applied": [], "lastChecked": null } - Fill project config (refuse to leave templated): Read
.claude/idev/project-config.json— ifgit.baseBranchis still"{{e.g. developer | develop | main}}"or any other template placeholder, PROMPT the user to fill it in:git.baseBranch: "What is your team's base branch? (default: developer)" — set todeveloperif they accept the defaultproject.name: "What is this project's name?" — auto-detect from directory name or package.json if possibleproject.type: "What is the project type? (e.g., aspnet-react, django, express-vue)" — auto-detect from tech stack markers if possibleproject.framework: "What framework version? (e.g., net8.0, python3.12, node20)" — auto-detect from config files if possible Write the filled values back toproject-config.json. Never leave template placeholders — the skills depend on these values. 6b. Validate watcher_config.json (fail loudly if blank): Read.claude/idev/project-map/watcher_config.json— ifproject_type,frontend_path, orbackend_pathare empty strings, PROMPT the user to fill them:project_type: "Is this a split (separate FE/BE dirs) or unified (single dir) project?" — auto-detect by checking for separate frontend/backend directoriesfrontend_path: "Where is the frontend source? (e.g., ./frontend, ./src)" — auto-detect from package.json locationbackend_path: "Where is the backend source? (e.g., ./backend, ./src)" — auto-detect from *.csproj/go.mod/pyproject.toml location Write the filled values back. Never leave watcher_config blank — the project-map skill depends on it and will fail silently with empty paths.
- Offer auto-learning setup (one-time): Ask the user: "Enable the auto-learning observer? It captures session observations (secret-redacted) to learn reusable habits. You can toggle it later with
/idev:hooks enable observer." If yes:- Create
~/.claude/homunculus/directory structure if missing - Touch
~/.claude/homunculus/enabledflag file - Report that observations will start being captured If no, skip — the hooks are pre-registered but flag-guarded, so they cost nothing until enabled.
- Create
- Offer the CLAUDE.md snippet (or do it directly if the user passed
--with-claude-md-snippet): append the contents of${CLAUDE_PLUGIN_ROOT}/templates/claude-md-snippet.mdto the project'sCLAUDE.md(create the file if missing). It contains the idev operating guide (cache-first context rules, skill workflow chain, agent delegation map) plus per-project policies (protected branches, migration policy, API config) — tell the user to review the FILL IN / KEEP ONLY IF sections. If an older idev snippet already exists in CLAUDE.md (look for the===== idev pluginmarker), replace it instead of appending a duplicate. - Offer the low-prompt permissions preset: Ask whether to allowlist the plugin's read-only scripts and read-only git commands in the project's
.claude/settings.json, so they run without permission prompts. If yes: resolve${CLAUDE_PLUGIN_ROOT}to its absolute path, then MERGE (never replace existing entries) this into.claude/settings.json'spermissions.allowarray, creating the file if missing:
These are exact path prefixes — only the plugin's own read-only scripts are covered, nothing broader (never add[ "Bash(python3 <abs-plugin-root>/skills/smart-context/scanner.py:*)", "Bash(python3 <abs-plugin-root>/skills/auto-learning/scripts/instinct-cli.py:*)", "Bash(python3 <abs-plugin-root>/skills/project-map/ai_map_updater.py:*)", "Bash(git status:*)", "Bash(git diff:*)", "Bash(git log:*)", "Bash(git branch:*)" ]Bash(python3:*)). Note for the user: the bundled agents' Read/Grep/Glob tools never prompt; prompts come from Bash invocations, which is what this preset removes. - Offer team git hooks: Ask whether to install the commit-message hooks (
prepare-commit-msgauto-prefixes the ticket from the branch name;commit-msgvalidates the subject format). If yes, follow theinstall-git-hooksprocedure in the/idev:hookscommand (never overwrite non-idev hooks without asking). Point the user at.claude/idev/commit-style.mdto tune the team format. - Optionally trigger first scans: Ask whether to run the initial project scans now (smart-context index, file-index, pattern caches). If yes, generate
.claude/idev/smart-context/index.jsonfirst by running the scanner from the project root:
python3 "${CLAUDE_PLUGIN_ROOT}/skills/smart-context/scanner.py"If python3 is unavailable, build the index manually per the idev:smart-context skill (detect the stack, feature names, and naming patterns, and write the same JSON shape by hand).
- Report: List what was created, what was skipped (already existed), and remind the user that caches regenerate automatically as the skills run. Mention
/idev:hooksfor enabling the optional observer/compact hooks later.
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.

