@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.
- package/.claude-plugin/marketplace.json +12 -2
- package/README.md +44 -41
- package/package.json +2 -2
- package/skills/coding/.claude-plugin/plugin.json +7 -3
- package/skills/coding/code/SKILL.md +6 -6
- package/skills/coding/code/references/cpp.md +12 -12
- package/skills/coding/code/references/python.md +12 -12
- package/skills/coding/code/references/rust.md +11 -11
- package/skills/coding/code/references/typescript.md +12 -12
- package/skills/coding/document/SKILL.md +1 -1
- package/skills/coding/document/references/cpp.md +4 -0
- package/skills/coding/document/references/python.md +3 -0
- package/skills/coding/document/references/rust.md +10 -5
- package/skills/coding/document/references/typescript.md +14 -3
- package/skills/g3n/.claude-plugin/plugin.json +12 -0
- package/skills/{coding → g3n}/analyze/SKILL.md +12 -7
- package/skills/g3n/analyze/references/api.md +39 -0
- package/skills/g3n/analyze/references/commands.md +67 -0
- package/skills/g3n/analyze/references/repository.md +13 -0
- package/skills/g3n/g3n-mods/SKILL.md +33 -0
- package/skills/g3n/g3n-mods/agents/openai.yaml +5 -0
- package/skills/g3n/g3n-mods/references/audit.md +21 -0
- package/skills/g3n/g3n-skills/SKILL.md +33 -0
- package/skills/g3n/g3n-skills/agents/openai.yaml +5 -0
- package/skills/g3n/g3n-skills/references/audit.md +21 -0
- package/skills/g3n/g3n-ui/SKILL.md +32 -0
- package/skills/g3n/g3n-ui/agents/openai.yaml +5 -0
- package/skills/g3n/g3n-ui/references/audit.md +22 -0
- package/skills/grilling/.claude-plugin/plugin.json +7 -2
- package/skills/grilling/domain-modeling/ADR-FORMAT.md +1 -1
- package/skills/grilling/domain-modeling/SKILL.md +1 -1
- package/skills/grilling/grilling/SKILL.md +1 -1
- package/skills/speech/.claude-plugin/plugin.json +7 -2
- package/skills/speech/emphasise/SKILL.md +12 -12
- package/skills/task-manager/.claude-plugin/plugin.json +1 -1
- package/skills/task-manager/decisions/SKILL.md +5 -5
- package/skills/task-manager/hooks.json +1 -1
- package/skills/task-manager/task-manager/SKILL.md +9 -9
- package/skills/task-manager/task-manager/references/hooks.md +10 -10
- package/skills/task-manager/task-manager/references/task-file.md +12 -12
- package/skills/teach/.claude-plugin/plugin.json +10 -2
- package/skills/teach/guided-debugging/references/debugging-loop.md +10 -10
- package/skills/teach/teaching/references/learning-model.md +6 -6
- package/skills/using-hooks/.claude-plugin/plugin.json +7 -2
- package/skills/using-hooks/hook-post-tool-use/SKILL.md +15 -3
- package/skills/using-hooks/hook-pre-tool-use/SKILL.md +10 -2
- package/skills/workflow/.claude-plugin/plugin.json +7 -3
- package/skills/workflow/orchestrator/SKILL.md +6 -6
- package/skills/workflow/plan/SKILL.md +2 -1
- package/skills/workflow/review/SKILL.md +2 -1
- package/skills/workflow/run/SKILL.md +8 -8
- package/skills/workflow/run/references/sub-agents.md +6 -6
- package/skills/workflow/sync/SKILL.md +2 -1
- package/skills/workflow/worktree/SKILL.md +5 -5
- package/skills/writing/.claude-plugin/plugin.json +6 -2
- package/skills/writing/writing-great-hooks/references/lifecycle-hook.md +17 -11
- package/skills/writing/writing-great-hooks/references/skill-hook.md +17 -2
- package/skills/writing/writing-great-tasks/SKILL.md +14 -14
- package/skills/coding/analyze/references/api.md +0 -27
- package/skills/coding/analyze/references/commands.md +0 -54
- package/skills/coding/analyze/references/repository.md +0 -13
- /package/skills/{coding → g3n}/analyze/agents/openai.yaml +0 -0
|
@@ -17,14 +17,24 @@
|
|
|
17
17
|
{
|
|
18
18
|
"name": "coding",
|
|
19
19
|
"source": "./skills/coding",
|
|
20
|
-
"description": "How to write, check and document code, per language,
|
|
20
|
+
"description": "How to write, check and document code, per language, and keep its glossary.",
|
|
21
21
|
"skills": [
|
|
22
22
|
"./code",
|
|
23
23
|
"./document",
|
|
24
|
-
"./analyze",
|
|
25
24
|
"./vocabulary"
|
|
26
25
|
]
|
|
27
26
|
},
|
|
27
|
+
{
|
|
28
|
+
"name": "g3n",
|
|
29
|
+
"source": "./skills/g3n",
|
|
30
|
+
"description": "The g3n tools: query a repository with analyze, and install skills, mods and components with their installers.",
|
|
31
|
+
"skills": [
|
|
32
|
+
"./analyze",
|
|
33
|
+
"./g3n-skills",
|
|
34
|
+
"./g3n-mods",
|
|
35
|
+
"./g3n-ui"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
28
38
|
{
|
|
29
39
|
"name": "grilling",
|
|
30
40
|
"source": "./skills/grilling",
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @g3nomaly/g3n-skills
|
|
2
2
|
|
|
3
|
-
The g3n skills for Claude Code and Codex:
|
|
3
|
+
The g3n skills for Claude Code and Codex: 40 skills in 10 groups. This package holds the skills and has no CLI. Install them with [`@g3nomaly/skills`](https://www.npmjs.com/package/@g3nomaly/skills), which reads this package as its built-in source, or read it as a Claude Code plugin marketplace.
|
|
4
4
|
|
|
5
5
|
Some skills carry their own hooks. A hook is a TypeScript file in the skill's `hooks/` folder, and the agent runs it with `bun`. The task-manager hooks keep plans, phases and tasks as Markdown files that the agent reaches only through those hooks. The workflow hooks decide when a step of a phase is finished.
|
|
6
6
|
|
|
@@ -46,46 +46,49 @@ There is one known gap. Claude Code caches each plugin in its own folder, so the
|
|
|
46
46
|
|
|
47
47
|
Skills marked _manual_ run only when you type their command, such as `/grill-me`. The agent loads the others when the task calls for them.
|
|
48
48
|
|
|
49
|
-
| Group
|
|
50
|
-
|
|
51
|
-
| `agent`
|
|
52
|
-
| `agent`
|
|
53
|
-
| `agent`
|
|
54
|
-
| `coding`
|
|
55
|
-
| `coding`
|
|
56
|
-
| `coding`
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `grilling`
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `speech`
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `teach`
|
|
72
|
-
| `teach`
|
|
73
|
-
| `teach`
|
|
74
|
-
| `teach`
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `using-hooks`
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `workflow`
|
|
83
|
-
| `workflow`
|
|
84
|
-
| `workflow`
|
|
85
|
-
| `workflow`
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
49
|
+
| Group | Skill | What it does |
|
|
50
|
+
| -------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
51
|
+
| `agent` | `bootstrap` | Session start checks (read `CLAUDE.md`, compare the file tree, state the branch) and the agent's boundaries |
|
|
52
|
+
| `agent` | `worktrees` | Work in a git worktree on a feature branch and land it on the home branch as clean commits on top of `main`, ready to merge one commit at a time |
|
|
53
|
+
| `agent` | `commit` | Commit messages with no attribution trailers, personal data or AI references, checked by a hook before each commit |
|
|
54
|
+
| `coding` | `code` | Rules for writing and checking code, with a toolchain reference per language |
|
|
55
|
+
| `coding` | `document` | Docstrings and comments for functions and classes, and where the reasons behind code go |
|
|
56
|
+
| `coding` | `vocabulary` | One word per concept, recorded in `docs/glossary.md`, so names don't drift between sessions |
|
|
57
|
+
| `g3n` | `analyze` | Query a repository's model with `g3n-analyze` and rebuild its documentation site in `analyze_out/` |
|
|
58
|
+
| `g3n` | `g3n-skills` | Install, update and remove skills with `@g3nomaly/skills`, never by copying folders, and audit what they add before it runs |
|
|
59
|
+
| `g3n` | `g3n-mods` | Install, update and remove Claude Code mods with `@g3nomaly/mods`, never by copying folders, after auditing the mod in its source |
|
|
60
|
+
| `g3n` | `g3n-ui` | Install, update and remove React components with `@g3nomaly/ui`, and audit them before they run or their packages install |
|
|
61
|
+
| `grilling` | `grilling` | Interview the user relentlessly to stress-test a plan, decision or idea |
|
|
62
|
+
| `grilling` | `grill-me` | _Manual._ Starts a `/grilling` session |
|
|
63
|
+
| `grilling` | `grill-with-docs` | _Manual._ A grilling session that writes ADRs and a glossary as it goes |
|
|
64
|
+
| `grilling` | `domain-modeling` | Pin down a project's terms and record its architectural decisions |
|
|
65
|
+
| `speech` | `emphasise` | What bold, italics and backticks mean in Markdown that an agent reads |
|
|
66
|
+
| `speech` | `unslop` | Cut AI tells from any writing |
|
|
67
|
+
| `speech` | `plain-language` | Write text readers can find, understand and use on the first read, following ISO 24495-1 |
|
|
68
|
+
| `speech` | `no-questions` | Replies end without questions or offers; a Stop hook refuses a reply that asks one |
|
|
69
|
+
| `task-manager` | `task-manager` | Query plans, phases and tasks and change their status through hooks |
|
|
70
|
+
| `task-manager` | `decisions` | Record and look up a plan's decisions as numbered files inside the plan |
|
|
71
|
+
| `teach` | `teaching` | The teaching principles every teach skill follows: real work, causality, mental models and guidance per concept |
|
|
72
|
+
| `teach` | `learn-by-building` | Learn a subject while completing a real task on the user's own system |
|
|
73
|
+
| `teach` | `explain` | Explain existing material through its purpose, mental model, flow and failure modes |
|
|
74
|
+
| `teach` | `deep-dive` | Trace the layers beneath an abstraction, only as deep as the question needs |
|
|
75
|
+
| `teach` | `architecture` | Reason from forces and options to an architecture decision and its consequences |
|
|
76
|
+
| `teach` | `guided-debugging` | Find a failure's root cause through hypotheses and small experiments, teaching the method |
|
|
77
|
+
| `teach` | `guided-review` | Review work by consequence and explain the principle behind each finding |
|
|
78
|
+
| `using-hooks` | `hook-pre-tool-use` | _Manual._ Writing a `PreToolUse` hook, which can allow, deny or escalate a tool call |
|
|
79
|
+
| `using-hooks` | `hook-post-tool-use` | _Manual._ Writing a `PostToolUse` hook, which reacts to a finished tool call |
|
|
80
|
+
| `using-hooks` | `hook-stop` | _Manual._ Writing a `Stop` hook, which can refuse to let the agent end its turn |
|
|
81
|
+
| `using-hooks` | `hook-user-prompt-submit` | _Manual._ Writing a `UserPromptSubmit` hook, which can add context to a prompt or reject it |
|
|
82
|
+
| `workflow` | `run` | Work one phase through plan, execute, review and sync, one fresh agent per step |
|
|
83
|
+
| `workflow` | `plan` | Turn a phase into task files an agent can execute without asking anything |
|
|
84
|
+
| `workflow` | `execute` | Carry out a phase's tasks, each in its own worktree, and hand each one to review |
|
|
85
|
+
| `workflow` | `review` | Check each in-review task against its requirements, then complete it or send it back |
|
|
86
|
+
| `workflow` | `sync` | Merge a reviewed phase's branches, remove its worktrees, record its decisions and terms, and close it |
|
|
87
|
+
| `workflow` | `orchestrator` | _Manual._ Run a whole plan phase by phase, starting each phase once the phases it depends on are done |
|
|
88
|
+
| `workflow` | `worktree` | Set up, merge and remove the git worktrees tasks are worked in, one per task |
|
|
89
|
+
| `writing` | `writing-great-hooks` | Add, change or debug a hook script or a lifecycle hook |
|
|
90
|
+
| `writing` | `writing-great-skills` | Write or edit a skill, its `SKILL.md`, references and hooks |
|
|
91
|
+
| `writing` | `writing-great-tasks` | Write a task that doesn't leave its executor guessing about scope |
|
|
89
92
|
|
|
90
93
|
The `commit` hook refuses your git `user.name` and `user.email`. To keep another name out of messages without writing it into the repository, add it to your global git config: `git config --global --add g3n.privateName "<name>"`.
|
|
91
94
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g3nomaly/g3n-skills",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "The g3n skills, each with its own hooks: a skill source for @g3nomaly/skills and a Claude Code plugin marketplace.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"test:clean": "CLEAN_TMP=1 bun test"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@g3nomaly/core": "^0.3.
|
|
18
|
+
"@g3nomaly/core": "^0.3.7",
|
|
19
19
|
"@types/bun": "^1.4.0",
|
|
20
20
|
"typescript": "~7.0.2",
|
|
21
21
|
"zod": "^4.4.3"
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coding",
|
|
3
|
-
"description": "How to write, check and document code, per language,
|
|
4
|
-
"version": "0.1.
|
|
3
|
+
"description": "How to write, check and document code, per language, and keep its glossary.",
|
|
4
|
+
"version": "0.1.7",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
|
-
"skills": [
|
|
6
|
+
"skills": [
|
|
7
|
+
"./code",
|
|
8
|
+
"./document",
|
|
9
|
+
"./vocabulary"
|
|
10
|
+
]
|
|
7
11
|
}
|
|
@@ -23,9 +23,9 @@ Apply SOLID principles, DRY, and KISS. Use descriptive names for variables, func
|
|
|
23
23
|
|
|
24
24
|
Each language has a reference that names its toolchain, its commands and its rules.
|
|
25
25
|
|
|
26
|
-
| Language
|
|
27
|
-
|
|
28
|
-
| TypeScript | [`references/typescript.md`](references/typescript.md) | `.ts` `.tsx`
|
|
29
|
-
| Python
|
|
30
|
-
| C++
|
|
31
|
-
| Rust
|
|
26
|
+
| Language | Reference | Files |
|
|
27
|
+
| ---------- | ------------------------------------------------------ | ------------------------ |
|
|
28
|
+
| TypeScript | [`references/typescript.md`](references/typescript.md) | `.ts` `.tsx` |
|
|
29
|
+
| Python | [`references/python.md`](references/python.md) | `.py` |
|
|
30
|
+
| C++ | [`references/cpp.md`](references/cpp.md) | `.cpp` `.cc` `.hpp` `.h` |
|
|
31
|
+
| Rust | [`references/rust.md`](references/rust.md) | `.rs` |
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
CMake configures and builds with clang. vcpkg supplies dependencies in manifest mode, from `vcpkg.json`. Run commands from inside the project directory, where `CMakeLists.txt` lives.
|
|
4
4
|
|
|
5
|
-
| Task
|
|
6
|
-
|
|
7
|
-
| Configure
|
|
8
|
-
| Add a dependency | `vcpkg add port <pkg>`, then `find_package` and `target_link_libraries` in `CMakeLists.txt`
|
|
9
|
-
| Build
|
|
10
|
-
| Run
|
|
5
|
+
| Task | Command |
|
|
6
|
+
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
7
|
+
| Configure | `cmake --preset <preset>` when `CMakePresets.json` exists, otherwise `cmake -S . -B build -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON` |
|
|
8
|
+
| Add a dependency | `vcpkg add port <pkg>`, then `find_package` and `target_link_libraries` in `CMakeLists.txt` |
|
|
9
|
+
| Build | `cmake --build build` |
|
|
10
|
+
| Run | the target's binary under `build/` |
|
|
11
11
|
|
|
12
12
|
## Checks
|
|
13
13
|
|
|
14
|
-
| Check
|
|
15
|
-
|
|
16
|
-
| Build
|
|
17
|
-
| Format | `clang-format --dry-run --Werror <files>`, or `clang-format -i <files>` to fix | always
|
|
18
|
-
| Lint
|
|
19
|
-
| Test
|
|
14
|
+
| Check | Command | When |
|
|
15
|
+
| ------ | ------------------------------------------------------------------------------ | -------------------------- |
|
|
16
|
+
| Build | `cmake --build build` | always |
|
|
17
|
+
| Format | `clang-format --dry-run --Werror <files>`, or `clang-format -i <files>` to fix | always |
|
|
18
|
+
| Lint | see [clang-tidy](#clang-tidy) | always |
|
|
19
|
+
| Test | `ctest --test-dir build --output-on-failure` | when the project has tests |
|
|
20
20
|
|
|
21
21
|
## clang-tidy
|
|
22
22
|
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
uv handles install, run and build. Run commands from inside the project directory, where `pyproject.toml` lives.
|
|
4
4
|
|
|
5
|
-
| Task
|
|
6
|
-
|
|
7
|
-
| Install
|
|
5
|
+
| Task | Command |
|
|
6
|
+
| ---------------- | ----------------------------------------------- |
|
|
7
|
+
| Install | `uv sync` |
|
|
8
8
|
| Add a dependency | `uv add <pkg>`, or `uv add --dev <pkg>` for dev |
|
|
9
|
-
| Run a file
|
|
10
|
-
| Run a tool once
|
|
11
|
-
| Build
|
|
9
|
+
| Run a file | `uv run <file>` |
|
|
10
|
+
| Run a tool once | `uvx <tool>` |
|
|
11
|
+
| Build | `uv build` |
|
|
12
12
|
|
|
13
13
|
## Checks
|
|
14
14
|
|
|
15
|
-
| Check
|
|
16
|
-
|
|
17
|
-
| Typecheck | `uv run ty check`
|
|
18
|
-
| Lint
|
|
19
|
-
| Format
|
|
20
|
-
| Test
|
|
15
|
+
| Check | Command | When |
|
|
16
|
+
| --------- | ------------------------------------------------------------ | -------------------------- |
|
|
17
|
+
| Typecheck | `uv run ty check` | always |
|
|
18
|
+
| Lint | `uv run ruff check --fix`, then fix what remains by hand | always |
|
|
19
|
+
| Format | `uv run ruff format --check`, or `uv run ruff format` to fix | always |
|
|
20
|
+
| Test | `uv run pytest` | when the project has tests |
|
|
21
21
|
|
|
22
22
|
## Rules
|
|
23
23
|
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Cargo handles install, run, test and build. Run commands from inside the crate or workspace directory, where `Cargo.toml` lives.
|
|
4
4
|
|
|
5
|
-
| Task
|
|
6
|
-
|
|
7
|
-
| Install
|
|
5
|
+
| Task | Command |
|
|
6
|
+
| ---------------- | --------------------------------------------------------- |
|
|
7
|
+
| Install | `cargo fetch`, or let `cargo build` fetch |
|
|
8
8
|
| Add a dependency | `cargo add <crate>`, or `cargo add --dev <crate>` for dev |
|
|
9
|
-
| Run
|
|
10
|
-
| Build
|
|
9
|
+
| Run | `cargo run` |
|
|
10
|
+
| Build | `cargo build`, or `cargo build --release` |
|
|
11
11
|
|
|
12
12
|
## Checks
|
|
13
13
|
|
|
14
|
-
| Check
|
|
15
|
-
|
|
16
|
-
| Typecheck | `cargo check`
|
|
17
|
-
| Lint
|
|
18
|
-
| Format
|
|
19
|
-
| Test
|
|
14
|
+
| Check | Command | When |
|
|
15
|
+
| --------- | ------------------------------------------- | ------------------------ |
|
|
16
|
+
| Typecheck | `cargo check` | always |
|
|
17
|
+
| Lint | `cargo clippy --all-targets -- -D warnings` | always |
|
|
18
|
+
| Format | `cargo fmt --check`, or `cargo fmt` to fix | always |
|
|
19
|
+
| Test | `cargo test` | when the crate has tests |
|
|
20
20
|
|
|
21
21
|
## Rules
|
|
22
22
|
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Bun handles install, run, test and build. Run commands from inside the package directory.
|
|
4
4
|
|
|
5
|
-
| Task
|
|
6
|
-
|
|
7
|
-
| Install
|
|
5
|
+
| Task | Command |
|
|
6
|
+
| ---------------- | ---------------------------------------------- |
|
|
7
|
+
| Install | `bun install` |
|
|
8
8
|
| Add a dependency | `bun add <pkg>`, or `bun add -d <pkg>` for dev |
|
|
9
|
-
| Run a file
|
|
10
|
-
| Run a script
|
|
11
|
-
| Run a tool once
|
|
12
|
-
| Build
|
|
9
|
+
| Run a file | `bun <file>` |
|
|
10
|
+
| Run a script | `bun run <script>` |
|
|
11
|
+
| Run a tool once | `bunx <pkg>` |
|
|
12
|
+
| Build | `bun run build` |
|
|
13
13
|
|
|
14
14
|
## Checks
|
|
15
15
|
|
|
16
|
-
| Check
|
|
17
|
-
|
|
18
|
-
| Typecheck | `bun run typecheck` | always
|
|
19
|
-
| Lint
|
|
20
|
-
| Test
|
|
16
|
+
| Check | Command | When |
|
|
17
|
+
| --------- | ------------------- | --------------------------- |
|
|
18
|
+
| Typecheck | `bun run typecheck` | always |
|
|
19
|
+
| Lint | `bun run lint` | when the package defines it |
|
|
20
|
+
| Test | `bun test` | when the package has tests |
|
|
21
21
|
|
|
22
22
|
## Rules
|
|
23
23
|
|
|
@@ -14,7 +14,7 @@ Line 1 of every file is a comment with its relative path. No file-level docstrin
|
|
|
14
14
|
|
|
15
15
|
## Docstrings
|
|
16
16
|
|
|
17
|
-
Functions, classes and other type declarations get a docstring; the language reference lists which. **A property, field or enum member is a tag in the docstring of its owner**, not a docstring of its own.
|
|
17
|
+
Functions, classes and other type declarations get a docstring; the language reference lists which. **A property, field or enum member is a tag in the docstring of its owner**, not a docstring of its own.
|
|
18
18
|
|
|
19
19
|
A _tag_ is a marked line in a docstring that documents one thing, such as `@param` in TypeScript.
|
|
20
20
|
|
|
@@ -77,12 +77,14 @@ struct Resolution {
|
|
|
77
77
|
std::vector<std::string> unknown; ///< Requests no source offers.
|
|
78
78
|
};
|
|
79
79
|
```
|
|
80
|
+
|
|
80
81
|
A trailing `///<` docstring on a member. Members go in the struct's docstring as `@property` tags.
|
|
81
82
|
|
|
82
83
|
```cpp
|
|
83
84
|
// Retrieves a user by id.
|
|
84
85
|
std::optional<User> get_user(std::int64_t user_id);
|
|
85
86
|
```
|
|
87
|
+
|
|
86
88
|
A plain `//` comment in place of a docstring. Doxygen and clangd only read `/** */`.
|
|
87
89
|
|
|
88
90
|
```cpp
|
|
@@ -93,6 +95,7 @@ A plain `//` comment in place of a docstring. Doxygen and clangd only read `/**
|
|
|
93
95
|
*/
|
|
94
96
|
[[nodiscard]] Tree parse_file(const std::filesystem::path& path);
|
|
95
97
|
```
|
|
98
|
+
|
|
96
99
|
The exception is prose inside `@return`, with no type. Each exception gets its own `@throws` tag, as in `parse_file` above.
|
|
97
100
|
|
|
98
101
|
```cpp
|
|
@@ -102,4 +105,5 @@ The exception is prose inside `@return`, with no type. Each exception gets its o
|
|
|
102
105
|
* @param preferred Source to take a key from when several offer it.
|
|
103
106
|
*/
|
|
104
107
|
```
|
|
108
|
+
|
|
105
109
|
More than one line without `@brief`. It opens with `@brief Resolves the dependencies...`.
|
|
@@ -77,6 +77,7 @@ class Resolution:
|
|
|
77
77
|
entries: dict[str, SourceOffer]
|
|
78
78
|
"""Resolved entries by key."""
|
|
79
79
|
```
|
|
80
|
+
|
|
80
81
|
A docstring on a field. Fields go in the class docstring under `Attributes:`.
|
|
81
82
|
|
|
82
83
|
```python
|
|
@@ -84,6 +85,7 @@ def get_user(user_id: int) -> User | None:
|
|
|
84
85
|
# Looks the user up by surrogate key.
|
|
85
86
|
"""Retrieves a user by id."""
|
|
86
87
|
```
|
|
88
|
+
|
|
87
89
|
A comment that says what a tag can say. It goes under `Args:`.
|
|
88
90
|
|
|
89
91
|
```python
|
|
@@ -92,4 +94,5 @@ def matches(request: EntryRequest, offers: Sequence[SourceOffer]) -> Match:
|
|
|
92
94
|
Finds the entries one request names.
|
|
93
95
|
"""
|
|
94
96
|
```
|
|
97
|
+
|
|
95
98
|
The summary starts on line 2, and the custom types `EntryRequest`, `SourceOffer` and `Match` have no `Args:` or `Returns:` entry.
|
|
@@ -5,11 +5,11 @@ Rustdoc: a `/** */` block directly above the item, written in Markdown. Never `/
|
|
|
5
5
|
- **Line 1**: `// src/users/store.rs`, the relative path. No `//!` or `/*! */` module or crate docs.
|
|
6
6
|
- **Declarations with a docstring**: functions, methods, structs, enums, traits and type aliases.
|
|
7
7
|
- **Summary**: `/** Adds two numbers. */` on one line. The first line is the `@brief`: a longer block opens with the summary, then a blank ` *` line.
|
|
8
|
-
- **Tags**: Markdown sections `# Arguments`, `# Returns`, `# Errors`, `# Panics` and `# Examples`. Arguments are a list of
|
|
8
|
+
- **Tags**: Markdown sections `# Arguments`, `# Returns`, `# Errors`, `# Panics` and `# Examples`. Arguments are a list of ``* `name` - text``.
|
|
9
9
|
- **Fields and variants**: Rust has no field tag, so this is the one exception to the owner rule. Each struct field and enum variant gets its own one-line `/** */`. Rustdoc and analyze both read it from there.
|
|
10
10
|
- **Examples**: a fenced block under `# Examples`. `cargo test` compiles and runs it, so it must build. Setup lines start with `# `, which hides them from the rendered docs.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
````rust
|
|
13
13
|
/** Adds two numbers. */
|
|
14
14
|
pub fn add(a: i32, b: i32) -> i32 {
|
|
15
15
|
a + b
|
|
@@ -69,7 +69,7 @@ pub struct Resolution {
|
|
|
69
69
|
/** Why an entry nobody named is in the set, e.g. `("vocabulary", "dep of plan")`. */
|
|
70
70
|
pub notes: HashMap<String, String>,
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
````
|
|
73
73
|
|
|
74
74
|
`harbor` in the example stands for the crate's own name. Doctests use the crate from outside, so `crate::` does not work there.
|
|
75
75
|
|
|
@@ -83,6 +83,7 @@ Each one next to what is wrong with it. The examples above show the fix.
|
|
|
83
83
|
/// Adds two numbers.
|
|
84
84
|
pub fn add(a: i32, b: i32) -> i32
|
|
85
85
|
```
|
|
86
|
+
|
|
86
87
|
A `///` comment. Use `/** Adds two numbers. */`.
|
|
87
88
|
|
|
88
89
|
```rust
|
|
@@ -97,15 +98,17 @@ pub struct Resolution {
|
|
|
97
98
|
pub entries: HashMap<String, SourceOffer>,
|
|
98
99
|
}
|
|
99
100
|
```
|
|
101
|
+
|
|
100
102
|
Fields listed in the struct's docstring. Neither rustdoc nor analyze reads them there. The `/** */` goes on the field.
|
|
101
103
|
|
|
102
104
|
```rust
|
|
103
105
|
/** Parses a file. */
|
|
104
106
|
pub fn parse_file(path: &Path) -> Result<Tree, FileValidationError>
|
|
105
107
|
```
|
|
108
|
+
|
|
106
109
|
Returns `Result` with no `# Errors` section.
|
|
107
110
|
|
|
108
|
-
|
|
111
|
+
````rust
|
|
109
112
|
/**
|
|
110
113
|
* # Examples
|
|
111
114
|
*
|
|
@@ -113,10 +116,12 @@ Returns `Result` with no `# Errors` section.
|
|
|
113
116
|
* let error = FileValidationError::new(path, vec![issue]);
|
|
114
117
|
* ```
|
|
115
118
|
*/
|
|
116
|
-
|
|
119
|
+
````
|
|
120
|
+
|
|
117
121
|
`path` and `issue` are never defined and the type is never imported, so `cargo test` fails on it.
|
|
118
122
|
|
|
119
123
|
```rust
|
|
120
124
|
/*! User storage. */
|
|
121
125
|
```
|
|
126
|
+
|
|
122
127
|
A module docstring. Line 1 is the path comment, and the items carry the docs.
|
|
@@ -14,7 +14,7 @@ export function add(a: number, b: number): number {
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @brief Retrieves a user by id.
|
|
17
|
-
*
|
|
17
|
+
*
|
|
18
18
|
* @param userId - Surrogate key from the `users` table, not the auth provider's id.
|
|
19
19
|
* @returns Custom User class used by the authentication service, or `undefined` when no row matches.
|
|
20
20
|
*/
|
|
@@ -72,12 +72,14 @@ Each one next to what is wrong with it. The examples above show the fix.
|
|
|
72
72
|
/** Holds the installed skills read from `skills.json`. */
|
|
73
73
|
export class SkillRegistry {}
|
|
74
74
|
```
|
|
75
|
+
|
|
75
76
|
Too thin. It leaves out what the class holds, who creates and consumes it, and how to make one.
|
|
76
77
|
|
|
77
78
|
```ts
|
|
78
79
|
/** @param file - Path of the file that was read. */
|
|
79
80
|
constructor(file: string, issues: FileValidationIssue[])
|
|
80
81
|
```
|
|
82
|
+
|
|
81
83
|
`file` doesn't say absolute or relative. `issues` is missing, while its type hides what goes in it.
|
|
82
84
|
|
|
83
85
|
```ts
|
|
@@ -86,6 +88,7 @@ constructor(file: string, issues: FileValidationIssue[])
|
|
|
86
88
|
* as it reads in the file, such as `phases.0.status`, or `(whole file)`.
|
|
87
89
|
*/
|
|
88
90
|
```
|
|
91
|
+
|
|
89
92
|
Prose about the type. One example value shows it faster: `` e.g. `{ field: "phases.0.status", message: "is required" }` ``.
|
|
90
93
|
|
|
91
94
|
```ts
|
|
@@ -95,14 +98,19 @@ Prose about the type. One example value shows it faster: `` e.g. `{ field: "phas
|
|
|
95
98
|
* @param b - The second number.
|
|
96
99
|
* @returns The sum.
|
|
97
100
|
*/
|
|
98
|
-
export function add(a: number, b: number): number
|
|
101
|
+
export function add(a: number, b: number): number;
|
|
99
102
|
```
|
|
103
|
+
|
|
100
104
|
The tags repeat the signature. The summary line is enough.
|
|
101
105
|
|
|
102
106
|
```ts
|
|
103
107
|
/** Entries one request names. */
|
|
104
|
-
function matchRequest(
|
|
108
|
+
function matchRequest(
|
|
109
|
+
request: EntryRequest,
|
|
110
|
+
offers: readonly SourceOffer[],
|
|
111
|
+
): Match;
|
|
105
112
|
```
|
|
113
|
+
|
|
106
114
|
A noun phrase that names the result, and no tags. The summary says what the function does: _Finds the entries one request names_. `EntryRequest`, `SourceOffer` and `Match` are custom types, so `request`, `offers` and the return value each need a tag.
|
|
107
115
|
|
|
108
116
|
```ts
|
|
@@ -114,6 +122,7 @@ export interface Resolution {
|
|
|
114
122
|
unknown: string[];
|
|
115
123
|
}
|
|
116
124
|
```
|
|
125
|
+
|
|
117
126
|
A docstring on each property. Properties go in the interface's docstring as `@property` tags, as in `Resolution` above.
|
|
118
127
|
|
|
119
128
|
```ts
|
|
@@ -123,9 +132,11 @@ A docstring on each property. Properties go in the interface's docstring as `@pr
|
|
|
123
132
|
* @param preferred - Source to take a key from when several offer it.
|
|
124
133
|
*/
|
|
125
134
|
```
|
|
135
|
+
|
|
126
136
|
More than one line without `@brief`. It opens with `@brief Resolves the dependencies...`.
|
|
127
137
|
|
|
128
138
|
```ts
|
|
129
139
|
/** Loads a user by id. Uses a surrogate key because auth ids changed format in 2024. */
|
|
130
140
|
```
|
|
141
|
+
|
|
131
142
|
The _why_ belongs in `decisions.md`. The docstring says what and how.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "g3n",
|
|
3
|
+
"description": "The g3n tools: query a repository with analyze, and install skills, mods and components with their installers.",
|
|
4
|
+
"version": "0.1.8",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"skills": [
|
|
7
|
+
"./analyze",
|
|
8
|
+
"./g3n-skills",
|
|
9
|
+
"./g3n-mods",
|
|
10
|
+
"./g3n-ui"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -8,21 +8,26 @@ disable-model-invocation: false
|
|
|
8
8
|
|
|
9
9
|
## Query
|
|
10
10
|
|
|
11
|
-
1. **Find** the node: `search <words>`. It matches names first, then meaning. Done when a hit's `id` names what you want.
|
|
12
|
-
2. **Read** it: `show <id>`. Text, signature, parameters, fields and every edge.
|
|
13
|
-
3. **Follow** its edges: `refs <id>`. Add `--incoming` for what uses it, `--outgoing` for what it uses, `--edge <kind>` to keep one kind, such as `
|
|
14
|
-
4. **
|
|
11
|
+
1. **Find** the node: `search <words>`. It matches names first, then meaning, and lists the hits of each section under its own heading, at most 5 each. Short keywords find code best; add `--section code` to search the code only. Done when a hit's `id` names what you want.
|
|
12
|
+
2. **Read** it: `show <id>`. Text, signature, parameters, fields and every edge. `file:` gives the lines it spans, such as `src/app.ts:29-45`, to read just that range.
|
|
13
|
+
3. **Follow** its edges: `refs <id>`. Add `--incoming` for what uses it, `--outgoing` for what it uses, `--edge <kind>` to keep one kind, such as `calls` or `affects`. `--depth <n>` follows the edges `n` hops, such as every caller of every caller with `--incoming --edge calls --depth 3`.
|
|
14
|
+
4. **Connect** two nodes: `path <from> <to>` prints the shortest chain of edges between them. It follows edges the way they point, so try the other order when it finds none.
|
|
15
|
+
5. **Narrow** any of these with `--kind`, `--section` and `-n`. `list --kind <kind>` lists every node of a kind.
|
|
15
16
|
|
|
16
|
-
Add `--json` when a script reads the output. A `<node>` may be an `id`, a file path or a name
|
|
17
|
+
Add `--json` when a script reads the output. A `<node>` may be an `id`, a file path or a name. A name that fits several nodes prints the candidates, and one that fits none suggests the closest names.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
`refs` lists at most 50 references, over every hop, and says how many it left out. Narrow it with `--edge` and a direction before raising `-n`, so the output stays small.
|
|
20
|
+
|
|
21
|
+
A _member_, a parameter, field, operation or definition, is found by search but returns its _owner_: the function, the type or the file, with the member named beside it, as in `interface InstallerIO (field hashFile)`. Its exact `id` opens the member itself.
|
|
22
|
+
|
|
23
|
+
A function handed on without being called, such as a callback or the entry of a command map, links as `passes`, not `calls`. Calls made at the top level of a file, outside every function, link nowhere.
|
|
19
24
|
|
|
20
25
|
Flags, kinds and edge kinds: [`references/commands.md`](references/commands.md).
|
|
21
26
|
|
|
22
27
|
## Update
|
|
23
28
|
|
|
24
29
|
- **Queries rescan by themselves.** The scan is cached in `analyze_out/cache/` and redone when a file changes. `--no-cache` forces it.
|
|
25
|
-
- **Rebuild the site** with `create_docs`. It writes `analyze_out/index.html` and nothing else.
|
|
30
|
+
- **Rebuild the site** with `create_docs`. It writes `analyze_out/index.html` and nothing else; `--out <file>` writes the site there instead, and nothing in the repository.
|
|
26
31
|
- **Change what is scanned** in `.analyzeignore` at the root, written with the defaults on the first run. `--exclude <glob>` skips more for one run.
|
|
27
32
|
- **Never edit `analyze_out/`.** It is output.
|
|
28
33
|
|