@g3nomaly/g3n-skills 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/.claude-plugin/marketplace.json +12 -2
  2. package/README.md +44 -41
  3. package/package.json +2 -2
  4. package/skills/coding/.claude-plugin/plugin.json +7 -3
  5. package/skills/coding/code/SKILL.md +6 -6
  6. package/skills/coding/code/references/cpp.md +12 -12
  7. package/skills/coding/code/references/python.md +12 -12
  8. package/skills/coding/code/references/rust.md +11 -11
  9. package/skills/coding/code/references/typescript.md +12 -12
  10. package/skills/coding/document/SKILL.md +1 -1
  11. package/skills/coding/document/references/cpp.md +4 -0
  12. package/skills/coding/document/references/python.md +3 -0
  13. package/skills/coding/document/references/rust.md +10 -5
  14. package/skills/coding/document/references/typescript.md +14 -3
  15. package/skills/g3n/.claude-plugin/plugin.json +12 -0
  16. package/skills/{coding → g3n}/analyze/SKILL.md +12 -7
  17. package/skills/g3n/analyze/references/api.md +39 -0
  18. package/skills/g3n/analyze/references/commands.md +67 -0
  19. package/skills/g3n/analyze/references/repository.md +13 -0
  20. package/skills/g3n/g3n-mods/SKILL.md +33 -0
  21. package/skills/g3n/g3n-mods/agents/openai.yaml +5 -0
  22. package/skills/g3n/g3n-mods/references/audit.md +21 -0
  23. package/skills/g3n/g3n-skills/SKILL.md +33 -0
  24. package/skills/g3n/g3n-skills/agents/openai.yaml +5 -0
  25. package/skills/g3n/g3n-skills/references/audit.md +21 -0
  26. package/skills/g3n/g3n-ui/SKILL.md +32 -0
  27. package/skills/g3n/g3n-ui/agents/openai.yaml +5 -0
  28. package/skills/g3n/g3n-ui/references/audit.md +22 -0
  29. package/skills/grilling/.claude-plugin/plugin.json +7 -2
  30. package/skills/grilling/domain-modeling/ADR-FORMAT.md +1 -1
  31. package/skills/grilling/domain-modeling/SKILL.md +1 -1
  32. package/skills/grilling/grilling/SKILL.md +1 -1
  33. package/skills/speech/.claude-plugin/plugin.json +7 -2
  34. package/skills/speech/emphasise/SKILL.md +12 -12
  35. package/skills/task-manager/.claude-plugin/plugin.json +1 -1
  36. package/skills/task-manager/decisions/SKILL.md +5 -5
  37. package/skills/task-manager/hooks.json +1 -1
  38. package/skills/task-manager/task-manager/SKILL.md +9 -9
  39. package/skills/task-manager/task-manager/references/hooks.md +10 -10
  40. package/skills/task-manager/task-manager/references/task-file.md +12 -12
  41. package/skills/teach/.claude-plugin/plugin.json +10 -2
  42. package/skills/teach/guided-debugging/references/debugging-loop.md +10 -10
  43. package/skills/teach/teaching/references/learning-model.md +6 -6
  44. package/skills/using-hooks/.claude-plugin/plugin.json +7 -2
  45. package/skills/using-hooks/hook-post-tool-use/SKILL.md +15 -3
  46. package/skills/using-hooks/hook-pre-tool-use/SKILL.md +10 -2
  47. package/skills/workflow/.claude-plugin/plugin.json +7 -3
  48. package/skills/workflow/orchestrator/SKILL.md +6 -6
  49. package/skills/workflow/plan/SKILL.md +2 -1
  50. package/skills/workflow/review/SKILL.md +2 -1
  51. package/skills/workflow/run/SKILL.md +8 -8
  52. package/skills/workflow/run/references/sub-agents.md +6 -6
  53. package/skills/workflow/sync/SKILL.md +2 -1
  54. package/skills/workflow/worktree/SKILL.md +5 -5
  55. package/skills/writing/.claude-plugin/plugin.json +6 -2
  56. package/skills/writing/writing-great-hooks/references/lifecycle-hook.md +17 -11
  57. package/skills/writing/writing-great-hooks/references/skill-hook.md +17 -2
  58. package/skills/writing/writing-great-tasks/SKILL.md +14 -14
  59. package/skills/coding/analyze/references/api.md +0 -27
  60. package/skills/coding/analyze/references/commands.md +0 -54
  61. package/skills/coding/analyze/references/repository.md +0 -13
  62. /package/skills/{coding → g3n}/analyze/agents/openai.yaml +0 -0
@@ -2,16 +2,16 @@
2
2
 
3
3
  Keep this record when an investigation has several plausible hypotheses or spans several experiments.
4
4
 
5
- | Field | Record |
6
- | --- | --- |
7
- | Exact symptom | Error, wrong result, timing and reproduction boundary |
8
- | Producer and stage | Component that produced the evidence, and where it failed |
9
- | Relevant state | Configuration, inputs, dependencies and environment |
10
- | Hypothesis | A testable causal explanation |
11
- | Prediction | The result expected if the hypothesis is right |
12
- | Experiment | A small, safe action that tells the likely explanations apart |
13
- | Observation | The result of the experiment, uninterpreted |
14
- | Interpretation | Hypotheses strengthened, weakened or eliminated |
5
+ | Field | Record |
6
+ | ------------------ | ------------------------------------------------------------- |
7
+ | Exact symptom | Error, wrong result, timing and reproduction boundary |
8
+ | Producer and stage | Component that produced the evidence, and where it failed |
9
+ | Relevant state | Configuration, inputs, dependencies and environment |
10
+ | Hypothesis | A testable causal explanation |
11
+ | Prediction | The result expected if the hypothesis is right |
12
+ | Experiment | A small, safe action that tells the likely explanations apart |
13
+ | Observation | The result of the experiment, uninterpreted |
14
+ | Interpretation | Hypotheses strengthened, weakened or eliminated |
15
15
 
16
16
  Update the hypothesis set after each experiment instead of piling up unrelated fixes.
17
17
 
@@ -2,12 +2,12 @@
2
2
 
3
3
  Track understanding per concept, never as one level for the whole person. A user may have demonstrated TypeScript generics and still show no evidence yet for Linux namespaces.
4
4
 
5
- | State | Evidence | Guidance |
6
- | --- | --- | --- |
7
- | Unknown | None yet. Unobserved, not incapable | Explain directly, and demonstrate before expecting independent use |
8
- | Partial | Part of the model, with a gap or misconception | Keep what is right and repair only the missing connection |
9
- | Understood | Explains or reasons correctly with some support | Stop re-explaining; let the user reason through the next decision worth practicing |
10
- | Demonstrated | Applies it alone in real work and reads the result correctly | Step back; step in only for risk, new constraints or contradicting evidence |
5
+ | State | Evidence | Guidance |
6
+ | ------------ | ------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
7
+ | Unknown | None yet. Unobserved, not incapable | Explain directly, and demonstrate before expecting independent use |
8
+ | Partial | Part of the model, with a gap or misconception | Keep what is right and repair only the missing connection |
9
+ | Understood | Explains or reasons correctly with some support | Stop re-explaining; let the user reason through the next decision worth practicing |
10
+ | Demonstrated | Applies it alone in real work and reads the result correctly | Step back; step in only for risk, new constraints or contradicting evidence |
11
11
 
12
12
  ## Evidence
13
13
 
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "using-hooks",
3
3
  "description": "How to write each Claude Code lifecycle hook.",
4
- "version": "0.1.0",
4
+ "version": "0.1.7",
5
5
  "license": "UNLICENSED",
6
- "skills": ["./hook-pre-tool-use", "./hook-post-tool-use", "./hook-stop", "./hook-user-prompt-submit"]
6
+ "skills": [
7
+ "./hook-pre-tool-use",
8
+ "./hook-post-tool-use",
9
+ "./hook-stop",
10
+ "./hook-user-prompt-submit"
11
+ ]
7
12
  }
@@ -20,8 +20,15 @@ The four common fields, the call, and what came back:
20
20
  "cwd": "/home/you/project",
21
21
  "hook_event_name": "PostToolUse",
22
22
  "tool_name": "Edit",
23
- "tool_input": { "file_path": "/home/you/project/src/index.ts", "old_string": "…", "new_string": "…" },
24
- "tool_response": { "filePath": "/home/you/project/src/index.ts", "success": true }
23
+ "tool_input": {
24
+ "file_path": "/home/you/project/src/index.ts",
25
+ "old_string": "…",
26
+ "new_string": "…"
27
+ },
28
+ "tool_response": {
29
+ "filePath": "/home/you/project/src/index.ts",
30
+ "success": true
31
+ }
25
32
  }
26
33
  ```
27
34
 
@@ -34,7 +41,12 @@ Same tool-name regex as [`hook-pre-tool-use`](../hook-pre-tool-use/SKILL.md), an
34
41
  ```json
35
42
  {
36
43
  "matcher": "Edit|MultiEdit|Write",
37
- "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/format-edited-file.ts" }]
44
+ "hooks": [
45
+ {
46
+ "type": "command",
47
+ "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/format-edited-file.ts"
48
+ }
49
+ ]
38
50
  }
39
51
  ```
40
52
 
@@ -20,7 +20,10 @@ The four common fields, plus the call about to be made:
20
20
  "cwd": "/home/you/project",
21
21
  "hook_event_name": "PreToolUse",
22
22
  "tool_name": "Write",
23
- "tool_input": { "file_path": "/home/you/project/src/index.ts", "content": "…" }
23
+ "tool_input": {
24
+ "file_path": "/home/you/project/src/index.ts",
25
+ "content": "…"
26
+ }
24
27
  }
25
28
  ```
26
29
 
@@ -33,7 +36,12 @@ This event selects by tool name, as a regex:
33
36
  ```json
34
37
  {
35
38
  "matcher": "Edit|MultiEdit|Write",
36
- "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/guard-protected-paths.ts" }]
39
+ "hooks": [
40
+ {
41
+ "type": "command",
42
+ "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/guard-protected-paths.ts"
43
+ }
44
+ ]
37
45
  }
38
46
  ```
39
47
 
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "workflow",
3
3
  "description": "Work a phase of a plan through plan, execute, review and sync, one agent per step, with hooks deciding when a step is finished.",
4
- "version": "0.1.0",
4
+ "version": "0.1.7",
5
5
  "license": "UNLICENSED",
6
- "dependencies": ["task-manager@g3n"],
7
- "agents": ["./review/agents/reviewer.md"],
6
+ "dependencies": [
7
+ "task-manager@g3n"
8
+ ],
9
+ "agents": [
10
+ "./review/agents/reviewer.md"
11
+ ],
8
12
  "skills": [
9
13
  "./run",
10
14
  "./plan",
@@ -11,12 +11,12 @@ Hooks are scripts in a skill's `hooks/` folder, run with `bun`. `<task-manager-d
11
11
 
12
12
  `bun <orchestrator-dir>/hooks/ready-phases.ts --plan <plan>` sorts the plan's phases by gate:
13
13
 
14
- | Field | Holds |
15
- |---|---|
16
- | `ready` | phases whose gate is open, in queue order, each in full |
17
- | `waiting` | phases behind a closed gate, with the phases they are `waiting_on` |
18
- | `blocked` | phases set to `blocked` |
19
- | `completed` | finished phases |
14
+ | Field | Holds |
15
+ | ----------- | ------------------------------------------------------------------ |
16
+ | `ready` | phases whose gate is open, in queue order, each in full |
17
+ | `waiting` | phases behind a closed gate, with the phases they are `waiting_on` |
18
+ | `blocked` | phases set to `blocked` |
19
+ | `completed` | finished phases |
20
20
 
21
21
  1. **Claim the plan** with `bun <task-manager-dir>/hooks/set-state.ts --id <plan> --to in-progress`, unless it already is.
22
22
  2. **Read the gates** with `ready-phases`.
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: plan
3
3
  description: Use as the plan step of the workflow, when a phase has no tasks yet, or when the user wants a phase broken down.
4
- registryDependencies: [task-manager, writing-great-tasks, vocabulary, decisions, grilling, run]
4
+ registryDependencies:
5
+ [task-manager, writing-great-tasks, vocabulary, decisions, grilling, run]
5
6
  disable-model-invocation: false
6
7
  ---
7
8
 
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: review
3
3
  description: Use as the review step of the workflow, when every remaining task of a phase is in-review, or when the user wants a phase's work checked before it is merged.
4
- registryDependencies: [task-manager, writing-great-tasks, vocabulary, decisions, run]
4
+ registryDependencies:
5
+ [task-manager, writing-great-tasks, vocabulary, decisions, run]
5
6
  disable-model-invocation: false
6
7
  ---
7
8
 
@@ -13,14 +13,14 @@ Hooks are scripts in a skill's `hooks/` folder, run with `bun`. `<task-manager-d
13
13
 
14
14
  `bun <run-dir>/hooks/current-step.ts --phase <phase>` returns the phase's `step`:
15
15
 
16
- | `step` | Meaning | Hand it to |
17
- |---|---|---|
18
- | `plan` | the phase has no tasks, or is still `open` | an agent running the `/plan` skill |
19
- | `execute` | a task is `open` or `in-progress` | agents running the `/execute` skill |
20
- | `review` | every remaining task is `in-review` | the **reviewer** agent running the `/review` skill |
21
- | `sync` | every task is `completed` | an agent running the `/sync` skill |
22
- | `done` | the phase is `completed` | nobody. Report and stop |
23
- | `blocked` | the phase or a task in `holding` is `blocked` | nobody. Report and stop |
16
+ | `step` | Meaning | Hand it to |
17
+ | --------- | --------------------------------------------- | -------------------------------------------------- |
18
+ | `plan` | the phase has no tasks, or is still `open` | an agent running the `/plan` skill |
19
+ | `execute` | a task is `open` or `in-progress` | agents running the `/execute` skill |
20
+ | `review` | every remaining task is `in-review` | the **reviewer** agent running the `/review` skill |
21
+ | `sync` | every task is `completed` | an agent running the `/sync` skill |
22
+ | `done` | the phase is `completed` | nobody. Report and stop |
23
+ | `blocked` | the phase or a task in `holding` is `blocked` | nobody. Report and stop |
24
24
 
25
25
  The step is worked out from the statuses on disk each time, so a task the reviewer sends back puts the phase on `execute` again with nothing to reset. `holding` names the tasks keeping the phase on its step.
26
26
 
@@ -28,12 +28,12 @@ Give names, never contents. The agent reads the phase and its tasks through the
28
28
 
29
29
  ## Which agent per step
30
30
 
31
- | Step | Agent | Can edit |
32
- |---|---|---|
33
- | `plan` | general purpose | the tree only |
34
- | `execute` | general purpose, one or several | its task's worktree |
35
- | `review` | **reviewer**, defined in the plugin's `agents/reviewer.md` | nothing |
36
- | `sync` | general purpose | the phase branch, the tree |
31
+ | Step | Agent | Can edit |
32
+ | --------- | ---------------------------------------------------------- | -------------------------- |
33
+ | `plan` | general purpose | the tree only |
34
+ | `execute` | general purpose, one or several | its task's worktree |
35
+ | `review` | **reviewer**, defined in the plugin's `agents/reviewer.md` | nothing |
36
+ | `sync` | general purpose | the phase branch, the tree |
37
37
 
38
38
  Where no `reviewer` agent type is offered, which is the case after `g3n-skills add workflow`, spawn a general purpose agent for `review` and open its brief with _You change no file._
39
39
 
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: sync
3
3
  description: Use as the sync step of the workflow, or when every task of a phase is completed and the phase is still open.
4
- registryDependencies: [task-manager, worktree, vocabulary, decisions, run, orchestrator]
4
+ registryDependencies:
5
+ [task-manager, worktree, vocabulary, decisions, run, orchestrator]
5
6
  disable-model-invocation: false
6
7
  ---
7
8
 
@@ -8,11 +8,11 @@ Every task gets its own **worktree**, a second checkout on its own branch, so ag
8
8
 
9
9
  ## Names
10
10
 
11
- | Thing | Pattern | Example |
12
- |---|---|---|
13
- | Phase branch | `<type>/<plan>-<phase>` | `feature/auth-rework-01-schema` |
14
- | Task branch | `<worktree_type>/<task id>-<slug of the title>` | `feature/TASK-012-session-table-migration` |
15
- | Worktree folder | `../<repo folder>.worktrees/<task id>` | `../g3n.worktrees/TASK-012` |
11
+ | Thing | Pattern | Example |
12
+ | --------------- | ----------------------------------------------- | ------------------------------------------ |
13
+ | Phase branch | `<type>/<plan>-<phase>` | `feature/auth-rework-01-schema` |
14
+ | Task branch | `<worktree_type>/<task id>-<slug of the title>` | `feature/TASK-012-session-table-migration` |
15
+ | Worktree folder | `../<repo folder>.worktrees/<task id>` | `../g3n.worktrees/TASK-012` |
16
16
 
17
17
  `worktree_type` comes from the task's frontmatter. The phase branch takes the type most of its tasks carry. The worktree folder sits beside the repository, outside it, so no search or build inside the repo walks into it.
18
18
 
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "writing",
3
3
  "description": "How to write skills, hooks and tasks that an agent can follow.",
4
- "version": "0.1.0",
4
+ "version": "0.1.7",
5
5
  "license": "UNLICENSED",
6
- "skills": ["./writing-great-hooks", "./writing-great-skills", "./writing-great-tasks"]
6
+ "skills": [
7
+ "./writing-great-hooks",
8
+ "./writing-great-skills",
9
+ "./writing-great-tasks"
10
+ ]
7
11
  }
@@ -10,7 +10,13 @@ In a plugin's `hooks.json`, or in `settings.json`:
10
10
  "PreToolUse": [
11
11
  {
12
12
  "matcher": "Read|Grep|Glob",
13
- "hooks": [{ "type": "command", "command": "bun \"${CLAUDE_PLUGIN_ROOT}/task-manager/hooks/guard-tree.ts\"", "timeout": 10 }]
13
+ "hooks": [
14
+ {
15
+ "type": "command",
16
+ "command": "bun \"${CLAUDE_PLUGIN_ROOT}/task-manager/hooks/guard-tree.ts\"",
17
+ "timeout": 10
18
+ }
19
+ ]
14
20
  }
15
21
  ]
16
22
  }
@@ -28,19 +34,19 @@ A JSON payload on stdin with `session_id`, `transcript_path`, `cwd`, `hook_event
28
34
 
29
35
  ## Output
30
36
 
31
- | Exit | Effect |
32
- |---|---|
33
- | `0` | ran; stdout is read per event |
34
- | `2` | blocks; stderr goes to the agent as the reason |
35
- | other | error shown to the user; the run continues |
37
+ | Exit | Effect |
38
+ | ----- | ---------------------------------------------- |
39
+ | `0` | ran; stdout is read per event |
40
+ | `2` | blocks; stderr goes to the agent as the reason |
41
+ | other | error shown to the user; the run continues |
36
42
 
37
43
  For more than a block, print JSON on stdout and exit `0`: `continue`, `stopReason`, `suppressOutput`, `systemMessage`, and the event's `hookSpecificOutput`.
38
44
 
39
45
  ## Events
40
46
 
41
- | Event | Fires | Skill |
42
- |---|---|---|
47
+ | Event | Fires | Skill |
48
+ | ------------------ | ------------------------------- | ------------------------- |
43
49
  | `UserPromptSubmit` | before the agent reads a prompt | `hook-user-prompt-submit` |
44
- | `PreToolUse` | before a tool runs | `hook-pre-tool-use` |
45
- | `PostToolUse` | after a tool ran | `hook-post-tool-use` |
46
- | `Stop` | when the agent is about to stop | `hook-stop` |
50
+ | `PreToolUse` | before a tool runs | `hook-pre-tool-use` |
51
+ | `PostToolUse` | after a tool ran | `hook-post-tool-use` |
52
+ | `Stop` | when the agent is about to stop | `hook-stop` |
@@ -16,7 +16,12 @@
16
16
 
17
17
  ```ts
18
18
  // packages/g3n-skills/skills/<group>/<skill>/hooks/get-term.ts
19
- import { printJson, requireFlag, resolveRoot, runHook } from "@task-manager/hooks";
19
+ import {
20
+ printJson,
21
+ requireFlag,
22
+ resolveRoot,
23
+ runHook,
24
+ } from "@task-manager/hooks";
20
25
 
21
26
  /** Prints the term `--term` names. */
22
27
  async function run(argv: readonly string[]): Promise<void> {
@@ -39,8 +44,18 @@ From task-manager's `src/hooks/`: `readFlag`, `requireFlag`, `hasFlag`, `oneOf`,
39
44
  - **Code shared between skills** lives in the `src/` of the skill that owns it. Import it as `@<owner>/<module>`, mapped in the importing skill's `tsconfig.json`, and list the owner in `registryDependencies`:
40
45
 
41
46
  ```json
42
- { "compilerOptions": { "paths": { "@task-manager/*": ["../task-manager/src/*", "../../task-manager/task-manager/src/*"] } } }
47
+ {
48
+ "compilerOptions": {
49
+ "paths": {
50
+ "@task-manager/*": [
51
+ "../task-manager/src/*",
52
+ "../../task-manager/task-manager/src/*"
53
+ ]
54
+ }
55
+ }
56
+ }
43
57
  ```
44
58
 
45
59
  The first path is the owner installed beside the skill; the second is its folder in another group in the repo.
60
+
46
61
  - **Packages** go in the owning skill's `package.json` with a pinned version and a `bun.lock`. Installers run `bun install` in that skill folder.
@@ -15,17 +15,17 @@ A task is a _brief_: one agent reads it, works alone, and is done when every box
15
15
 
16
16
  ## Sections
17
17
 
18
- | Section | Holds |
19
- |---|---|
20
- | Description | Prose: the problem, the outcome, the context needed to start |
21
- | Goals | `- [ ]` outcomes the task is judged on |
22
- | Non-Goals | `- [ ]` outcomes a reasonable agent would pursue from the Description, which stay out |
23
- | Deliverables | `- [ ]` one per file: **new** or **edit**, the path, a one-line contract. Files added later go in Findings |
24
- | Package Dependencies | `- [ ]` packages the task may use, each with why |
25
- | Contracts | Optional: a settled schema, type or signature small enough to write out |
26
- | Requirements | `- [ ]` constraints on how, each checkable in the diff; a goal is never restated here |
27
- | Findings | Empty; the executor appends what it discovers |
28
- | Blockers | Empty; filled when the task is blocked, cleared when it is released |
29
- | Decisions | ADR paths only, in the `/domain-modeling` format |
30
- | References | Files, skills and task ids to read first, each with why |
31
- | Amendments | Empty; whoever edits the task after creation logs what changed and which later tasks are now suspect |
18
+ | Section | Holds |
19
+ | -------------------- | ---------------------------------------------------------------------------------------------------------- |
20
+ | Description | Prose: the problem, the outcome, the context needed to start |
21
+ | Goals | `- [ ]` outcomes the task is judged on |
22
+ | Non-Goals | `- [ ]` outcomes a reasonable agent would pursue from the Description, which stay out |
23
+ | Deliverables | `- [ ]` one per file: **new** or **edit**, the path, a one-line contract. Files added later go in Findings |
24
+ | Package Dependencies | `- [ ]` packages the task may use, each with why |
25
+ | Contracts | Optional: a settled schema, type or signature small enough to write out |
26
+ | Requirements | `- [ ]` constraints on how, each checkable in the diff; a goal is never restated here |
27
+ | Findings | Empty; the executor appends what it discovers |
28
+ | Blockers | Empty; filled when the task is blocked, cleared when it is released |
29
+ | Decisions | ADR paths only, in the `/domain-modeling` format |
30
+ | References | Files, skills and task ids to read first, each with why |
31
+ | Amendments | Empty; whoever edits the task after creation logs what changed and which later tasks are now suspect |
@@ -1,27 +0,0 @@
1
- # Library
2
-
3
- `@g3nomaly/analyze` exports the queries as functions. They take the CLI options as fields, never print, and throw `OptionsError`, `QueryError` or `SourceError`.
4
-
5
- ```ts
6
- import { createDocs, list, refs, search, show } from '@g3nomaly/analyze';
7
-
8
- const repo = '/home/me/app';
9
- const { hits } = await search({ repo, query: 'route price', limit: 5 });
10
- const node = await show({ repo, target: hits[0].id });
11
- const users = await refs({ repo, target: 'choose_route', incoming: true, edges: ['type'] });
12
- const tasks = await list({ repo, kinds: ['task'] });
13
- await createDocs({ repo });
14
- ```
15
-
16
- | Field | Functions | CLI flag |
17
- |---|---|---|
18
- | `repo`, `skillDirs`, `docDirs`, `excludes`, `embeddings` | all | `--repo`, `--skills`, `--docs`, `--exclude`, `--no-embeddings` |
19
- | `from`, `cache` | queries | `--from`, `--no-cache` |
20
- | `kinds`, `section` | queries | `--kind`, `--section` |
21
- | `query`, `by`, `limit` | `search` | `<query>`, `--by`, `-n` |
22
- | `target` | `show`, `refs` | `<node>` |
23
- | `incoming`, `outgoing`, `edges` | `refs` | `--incoming`, `--outgoing`, `--edge` |
24
- | `title` | `createDocs` | `--title` |
25
- | `onWarning` | all | — |
26
-
27
- Warnings go to `onWarning` and are dropped without it.
@@ -1,54 +0,0 @@
1
- # Commands
2
-
3
- | Command | Does |
4
- |---|---|
5
- | `create_docs` | Writes `analyze_out/index.html`, one offline HTML file |
6
- | `search <query>` | Finds nodes by words and by meaning |
7
- | `show <node>` | Prints one node in full |
8
- | `refs <node>` | Lists its edges, both ways |
9
- | `list` | Lists nodes in display order |
10
-
11
- ## Flags
12
-
13
- | Flag | Commands | Does |
14
- |---|---|---|
15
- | `--repo <dir>` | all | Repository to read. Default: the working directory |
16
- | `--skills <dir>`, `--docs <dir>` | all | Read skills or docs from this directory only. Repeatable |
17
- | `--exclude <glob>` | all | Skip matching paths. Repeatable |
18
- | `--no-embeddings` | all | No search by meaning |
19
- | `--title <text>` | `create_docs` | Site title |
20
- | `--from <file>` | queries | Query a built `index.html` instead of scanning |
21
- | `--no-cache` | queries | Scan again even when nothing changed |
22
- | `--json` | queries | JSON instead of text |
23
- | `--kind <kind>` | queries | Only this kind. Repeatable |
24
- | `--section <name>` | queries | `skills`, `docs`, `code`, `database` or `tasks` |
25
- | `-n, --limit <n>` | `search`, `list` | Most results |
26
- | `--by <way>` | `search` | `name`, `meaning` or `both` |
27
- | `--incoming`, `--outgoing` | `refs` | One direction only |
28
- | `--edge <kind>` | `refs` | Only this edge kind. Repeatable |
29
-
30
- Each flag has an `ANALYZE_*` variable, such as `ANALYZE_REPO`. A flag wins over its variable.
31
-
32
- ## Kinds
33
-
34
- - **Structure**: `folder`, `package`, `file`
35
- - **Code**: `namespace`, `class`, `interface`, `struct`, `enum`, `trait`, `type`, `function` (methods included)
36
- - **Docs and data**: `term`, `decision`, `table`, `query`
37
- - **Tasks**: `plan`, `phase`, `task`
38
- - **Members**, returned as their owner: `operation`, `definition`, `parameter`, `field`
39
-
40
- The JSON of a node has its `kind` and its `type`, the finer sort, such as `method` or `api`.
41
-
42
- ## Edge kinds
43
-
44
- | Edge | From → to |
45
- |---|---|
46
- | `type` | parameter or field → its type |
47
- | `returns`, `throws` | function → type it returns or throws |
48
- | `extends` | type → type it extends or implements |
49
- | `mentions` | page or description → node it links to |
50
- | `uses` | text → glossary term |
51
- | `affects` | decision → node it is about |
52
- | `references` | table → table of its foreign key |
53
- | `reads`, `writes` | query → table |
54
- | `names`, `depends` | plan, phase or task → node it names, task it waits for |
@@ -1,13 +0,0 @@
1
- # What analyze reads
2
-
3
- | Shows as | Write |
4
- |---|---|
5
- | **Skill** | A `SKILL.md` inside an AI directory: `.claude`, `.codex`, `.cursor`, `.gemini`, `.agents`, `.windsurf`, `.opencode`. Elsewhere it is a doc |
6
- | **Package** | A directory with a manifest: `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `pom.xml`, `build.gradle`, `composer.json`, `.csproj`, `.gemspec`, `Gemfile`. A declared executable makes it an app |
7
- | **Glossary** | A `glossary.md`. Each term is a node, and its first use in any text links to it |
8
- | **Decisions** | A `decisions.md`. Each decision is a node; a link or inline code in it that names a node becomes an `affects` edge |
9
- | **Code docs** | Doc comments. `@param`, `@returns`, `@throws` and `@property` attach to the parameter, return value, error and field |
10
- | **Database** | `.sql` files. One with `CREATE TABLE` is a schema, any other a query |
11
- | **Tasks** | The task-manager tree in `docs/task-manager`, or the directory `.g3n.config.json` names |
12
-
13
- Inline code that names a type or function, such as `` `choose_route` ``, links to it from any text.