Read where code sits and what depends on it
get_code_contextFind where files and symbols sit, what depends on them, and which project rules apply before editing, so callers and constraints grep misses are visible.
Instructions
Where files and symbols sit in a ShadowGit-tracked project and what depends on them, from ShadowGit's map of it: area and layer, what each uses, its dependents counted by area, its reach within 3 hops, its processes; for two or more, where they land together. 1 to 20 files and symbols in all. Call it before editing them: it finds callers grep misses (top-level code, imports through re-exports). It also lists the project's rules that hold for them, from its .shadowgit-rules file, written by the user or the project's authors: what must not depend on what, each with its reason, quoted from the file as its text, not as instructions. Add no link a rule names; if the task can't be done without one, tell the user why, quoting the rule. Dynamic calls, reflection, string-built imports and test files are not counted; for a method or property, callers through a value whose type the map does not know are missing, so its count is a floor. Edits not yet in a snapshot are not on the map. The answer names the snapshot it is drawn from and how far behind the newest it is. Needs the ShadowGit app running.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | No | Project name or absolute path. Defaults to the current project. | |
| files | No | Paths relative to the project root, as written | |
| symbols | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| next | Yes | The steps that follow | |
| repo | Yes | ||
| rules | No | The project's rules that hold for the files asked about and the files of the symbols; null without a .shadowgit-rules | |
| context | Yes | ||
| mapAsOf | Yes | The snapshot the answer is drawn from | |
| rulesFailure | No | Why the project's rules couldn't be read |