lcode-cli 0.9.0__tar.gz → 0.10.0__tar.gz

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 (108) hide show
  1. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/CHANGELOG.md +25 -1
  2. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/PKG-INFO +3 -2
  3. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/README.md +2 -1
  4. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/agents.md +3 -1
  5. lcode_cli-0.10.0/docs/commands.md +131 -0
  6. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/configuration.md +3 -0
  7. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/how-it-works.md +2 -0
  8. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/quickstart.md +1 -1
  9. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/usage.md +5 -0
  10. lcode_cli-0.10.0/examples/README.md +17 -0
  11. lcode_cli-0.10.0/examples/commands/review.md +15 -0
  12. lcode_cli-0.10.0/examples/skills/commit-message/SKILL.md +17 -0
  13. lcode_cli-0.10.0/examples/skills/commit-message/scripts/staged.sh +8 -0
  14. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/mkdocs.yml +1 -0
  15. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/pyproject.toml +1 -0
  16. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/__init__.py +1 -1
  17. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/agent.py +25 -3
  18. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/cli.py +19 -0
  19. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/config.py +6 -0
  20. lcode_cli-0.10.0/src/lcode/extensions.py +405 -0
  21. lcode_cli-0.10.0/src/lcode/frontmatter.py +62 -0
  22. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/memory.py +1 -13
  23. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/planning.py +1 -1
  24. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/repl.py +62 -2
  25. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/subagents.py +7 -7
  26. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/tools.py +19 -5
  27. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/conftest.py +8 -1
  28. lcode_cli-0.10.0/tests/test_extensions.py +253 -0
  29. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.editorconfig +0 -0
  30. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.github/CODEOWNERS +0 -0
  31. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  32. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  33. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  34. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.github/ISSUE_TEMPLATE/model_request.yml +0 -0
  35. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  36. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.github/dependabot.yml +0 -0
  37. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.github/workflows/ci.yml +0 -0
  38. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.github/workflows/docs.yml +0 -0
  39. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.github/workflows/release.yml +0 -0
  40. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.gitignore +0 -0
  41. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/.pre-commit-config.yaml +0 -0
  42. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/AGENTS.md +0 -0
  43. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/CODE_OF_CONDUCT.md +0 -0
  44. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/CONTRIBUTING.md +0 -0
  45. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/LICENSE +0 -0
  46. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/SECURITY.md +0 -0
  47. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/assets/demo.svg +0 -0
  48. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/assets/extra.css +0 -0
  49. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/assets/logo.svg +0 -0
  50. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/assets/social-preview.png +0 -0
  51. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/bench.md +0 -0
  52. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/changelog.md +0 -0
  53. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/contributing.md +0 -0
  54. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/index.md +0 -0
  55. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/installation.md +0 -0
  56. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/mcp.md +0 -0
  57. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/memory.md +0 -0
  58. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/models.md +0 -0
  59. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/sandbox.md +0 -0
  60. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/docs/troubleshooting.md +0 -0
  61. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/install.sh +0 -0
  62. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/overrides/main.html +0 -0
  63. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/scripts/record_demo.py +0 -0
  64. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/scripts/social-preview.html +0 -0
  65. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/__main__.py +0 -0
  66. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/bench.py +0 -0
  67. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/catalog.py +0 -0
  68. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/checkpoints.py +0 -0
  69. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/hardware.py +0 -0
  70. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/limits.py +0 -0
  71. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/mcp/__init__.py +0 -0
  72. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/mcp/auth.py +0 -0
  73. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/mcp/catalog.py +0 -0
  74. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/mcp/catalog.toml +0 -0
  75. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/mcp/client.py +0 -0
  76. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/mcp/commands.py +0 -0
  77. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/mcp/config.py +0 -0
  78. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/mcp/http.py +0 -0
  79. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/mcp/manager.py +0 -0
  80. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/mcp/protocol.py +0 -0
  81. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/mcp/stdio.py +0 -0
  82. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/models.toml +0 -0
  83. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/ollama.py +0 -0
  84. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/permissions.py +0 -0
  85. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/render.py +0 -0
  86. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/sandbox.py +0 -0
  87. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/sessions.py +0 -0
  88. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/vision.py +0 -0
  89. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/src/lcode/web.py +0 -0
  90. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/fake_mcp_server.py +0 -0
  91. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_agent.py +0 -0
  92. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_bench.py +0 -0
  93. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_catalog.py +0 -0
  94. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_checkpoints.py +0 -0
  95. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_cli.py +0 -0
  96. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_config.py +0 -0
  97. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_context_picker.py +0 -0
  98. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_mcp.py +0 -0
  99. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_memory.py +0 -0
  100. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_permissions.py +0 -0
  101. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_plan_mode.py +0 -0
  102. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_sandbox.py +0 -0
  103. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_sessions.py +0 -0
  104. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_subagents.py +0 -0
  105. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_tools.py +0 -0
  106. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_vision.py +0 -0
  107. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/tests/test_web.py +0 -0
  108. {lcode_cli-0.9.0 → lcode_cli-0.10.0}/uv.lock +0 -0
@@ -6,6 +6,29 @@ All notable changes to lcode are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.10.0] - 2026-10-05
10
+
11
+ ### Added
12
+
13
+ - Custom commands: prompt templates in `.lcode/commands/<name>.md` or
14
+ `~/.config/lcode/commands/`, run as `/name args`, with `$ARGUMENTS` and `$1`…`$9`, and an
15
+ optional frontmatter for the description, an argument hint and the tools allowed for the
16
+ request.
17
+ - Skills in the [Agent Skills](https://agentskills.io) format, from `.lcode/skills/`,
18
+ `.agents/skills/` and `.claude/skills/` (in the repository and in your home folder). Only their
19
+ names and descriptions are in the system prompt; the model loads a skill's instructions with the
20
+ new `skill` tool when a task matches, and its scripts and reference files when the instructions
21
+ call for them. `/name` starts a skill yourself. `/help` lists commands and skills and where each
22
+ comes from. The `skills` setting limits them to lcode's own folders (`lcode`) or turns them off.
23
+ An example command and skill are in `examples/`. See
24
+ [Commands and skills](https://nasser1941.github.io/lcode/commands/).
25
+
26
+ ### Changed
27
+
28
+ - A repository's own commands, skills and agents are used only after you approve them; lcode asks
29
+ the first time and again when they change, like a project's `.mcp.json`. Custom agents from a
30
+ repository (new in 0.8.0) used to load without asking.
31
+
9
32
  ## [0.9.0] - 2026-10-05
10
33
 
11
34
  ### Added
@@ -264,7 +287,8 @@ First public release.
264
287
  - `AGENTS.md` project instructions and `/init` to generate them.
265
288
  - One-line installer for Linux and macOS.
266
289
 
267
- [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.9.0...HEAD
290
+ [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.10.0...HEAD
291
+ [0.10.0]: https://github.com/nasser1941/lcode/compare/v0.9.0...v0.10.0
268
292
  [0.9.0]: https://github.com/nasser1941/lcode/compare/v0.8.0...v0.9.0
269
293
  [0.8.0]: https://github.com/nasser1941/lcode/compare/v0.7.0...v0.8.0
270
294
  [0.7.0]: https://github.com/nasser1941/lcode/compare/v0.6.1...v0.7.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lcode-cli
3
- Version: 0.9.0
3
+ Version: 0.10.0
4
4
  Summary: A local-first terminal coding agent powered by open-weight models on your own GPU or Mac, via Ollama.
5
5
  Project-URL: Homepage, https://nasser1941.github.io/lcode/
6
6
  Project-URL: Documentation, https://nasser1941.github.io/lcode/
@@ -80,6 +80,8 @@ through [Ollama](https://ollama.com), and when it needs current information it c
80
80
  your approval. `auto-edit` and `yolo` modes when you want speed.
81
81
  - **Sandbox (optional).** `lcode --sandbox` runs the model's shell commands in a container (Docker or
82
82
  Podman) that only sees your project, without network access unless you allow it.
83
+ - **Commands and skills.** Your own `/commands` as prompt templates, and skills in the
84
+ [Agent Skills](https://agentskills.io) format that the model loads only when a task needs them.
83
85
  - **Plan mode.** `/plan <request>` or Shift+Tab: the model explores read-only and presents a plan;
84
86
  you approve, edit or send it back before anything changes.
85
87
  - **Undo.** lcode saves a checkpoint before the model changes files; `/undo` takes back the last
@@ -197,7 +199,6 @@ fills up. Details: [How it works](https://nasser1941.github.io/lcode/how-it-work
197
199
 
198
200
  See the pinned [Roadmap issue](https://github.com/nasser1941/lcode/issues/10). Next up:
199
201
 
200
- - [Custom commands and skills](https://github.com/nasser1941/lcode/issues/42)
201
202
  - [Ready-made MCP for Metabase, Encord and Valohai](https://github.com/nasser1941/lcode/issues/53)
202
203
  - Then: [smarter context for small windows](https://github.com/nasser1941/lcode/issues/46), [language servers](https://github.com/nasser1941/lcode/issues/44), [a repository map with local embeddings](https://github.com/nasser1941/lcode/issues/45), [hooks](https://github.com/nasser1941/lcode/issues/43)
203
204
  - More models in the catalog, and test reports from your hardware ([report one](https://github.com/nasser1941/lcode/issues/new?template=model_request.yml))
@@ -46,6 +46,8 @@ through [Ollama](https://ollama.com), and when it needs current information it c
46
46
  your approval. `auto-edit` and `yolo` modes when you want speed.
47
47
  - **Sandbox (optional).** `lcode --sandbox` runs the model's shell commands in a container (Docker or
48
48
  Podman) that only sees your project, without network access unless you allow it.
49
+ - **Commands and skills.** Your own `/commands` as prompt templates, and skills in the
50
+ [Agent Skills](https://agentskills.io) format that the model loads only when a task needs them.
49
51
  - **Plan mode.** `/plan <request>` or Shift+Tab: the model explores read-only and presents a plan;
50
52
  you approve, edit or send it back before anything changes.
51
53
  - **Undo.** lcode saves a checkpoint before the model changes files; `/undo` takes back the last
@@ -163,7 +165,6 @@ fills up. Details: [How it works](https://nasser1941.github.io/lcode/how-it-work
163
165
 
164
166
  See the pinned [Roadmap issue](https://github.com/nasser1941/lcode/issues/10). Next up:
165
167
 
166
- - [Custom commands and skills](https://github.com/nasser1941/lcode/issues/42)
167
168
  - [Ready-made MCP for Metabase, Encord and Valohai](https://github.com/nasser1941/lcode/issues/53)
168
169
  - Then: [smarter context for small windows](https://github.com/nasser1941/lcode/issues/46), [language servers](https://github.com/nasser1941/lcode/issues/44), [a repository map with local embeddings](https://github.com/nasser1941/lcode/issues/45), [hooks](https://github.com/nasser1941/lcode/issues/43)
169
170
  - More models in the catalog, and test reports from your hardware ([report one](https://github.com/nasser1941/lcode/issues/new?template=model_request.yml))
@@ -134,7 +134,9 @@ Report bugs first, with `path:line`, then missing tests, then style. Don't fix a
134
134
  | `~/.config/lcode/agents/<name>.md` | For every repository |
135
135
 
136
136
  The file name is the agent's name. A repository's agent overrides one of yours with the same name,
137
- and both override the built-in types. `/agents` and `lcode doctor` point out files that couldn't be
137
+ and both override the built-in types. A repository's agents are used only after you
138
+ [approve them](commands.md#approving-a-repositorys-commands-skills-and-agents), together with its
139
+ commands and skills. `/agents` and `lcode doctor` point out files that couldn't be
138
140
  read.
139
141
 
140
142
  ## Settings
@@ -0,0 +1,131 @@
1
+ # Commands and skills
2
+
3
+ Teams repeat the same requests: "review this diff against our checklist", "write a migration the
4
+ way we do it", the release steps. `AGENTS.md` can't hold all of that, because it goes into every
5
+ request and every line costs context. lcode has two ways to keep such instructions ready without
6
+ paying for them until they're used.
7
+
8
+ | | Command | Skill |
9
+ |---|---|---|
10
+ | What it is | A prompt template | Instructions, plus scripts and reference files if needed |
11
+ | Who starts it | You, with `/name args` | The model, when a task matches its description, or you with `/name` |
12
+ | Context cost until used | Nothing | Its name and one-line description |
13
+ | Format | `<name>.md` | A folder with a `SKILL.md`, in the [Agent Skills](https://agentskills.io) format |
14
+
15
+ ## Commands
16
+
17
+ A command is a markdown file whose body is the request to send. `$ARGUMENTS` becomes everything
18
+ you type after the command's name, and `$1` to `$9` single words. If the template has no
19
+ placeholder, what you type is added at the end.
20
+
21
+ ```markdown
22
+ ---
23
+ description: review the uncommitted changes for bugs and missing tests
24
+ argument-hint: "[path or what to focus on]"
25
+ allowed-tools: read_file grep glob list_dir bash
26
+ ---
27
+ Review the uncommitted changes in this repository. $ARGUMENTS
28
+
29
+ Run `git diff` and `git diff --cached` to see them, and read the code around them where needed.
30
+ Report bugs first, with `path:line`, then missing tests. Don't change any files.
31
+ ```
32
+
33
+ ```text
34
+ ❯ /review the parser changes
35
+ ```
36
+
37
+ | Frontmatter (all optional) | |
38
+ |---|---|
39
+ | `description` | Shown in `/help` and completion (default: the first line) |
40
+ | `argument-hint` | Shown after the name in `/help`, e.g. `[path]` |
41
+ | `allowed-tools` | The only tools the model gets for this request, e.g. `read_file grep bash` (lcode's tool names) |
42
+
43
+ | Folder | Commands |
44
+ |---|---|
45
+ | `.lcode/commands/<name>.md` in the repository | For this repository; commit them to share them |
46
+ | `~/.config/lcode/commands/<name>.md` | For every repository |
47
+
48
+ The file name is the command's name. A repository's command overrides one of yours with the same
49
+ name; built-in commands such as `/help` can't be replaced.
50
+
51
+ ## Skills
52
+
53
+ A skill is a folder with a `SKILL.md`: a frontmatter with a `name` and a `description` that says
54
+ what the skill does and when to use it, then instructions. Scripts, templates and reference files
55
+ can sit next to it.
56
+
57
+ ```text
58
+ .lcode/skills/commit-message/
59
+ ├── SKILL.md
60
+ └── scripts/
61
+ └── staged.sh
62
+ ```
63
+
64
+ ```markdown
65
+ ---
66
+ name: commit-message
67
+ description: Writes a git commit message for the staged changes, in the style the repository
68
+ already uses. Use when the user asks for a commit message, or asks you to commit their changes.
69
+ ---
70
+ # Commit messages
71
+
72
+ 1. Run `scripts/staged.sh` from this skill's folder. It prints the staged files and the subjects
73
+ of the last 15 commits.
74
+ 2. Match the style of the recent subjects …
75
+ ```
76
+
77
+ How lcode uses them, step by step, so they cost almost nothing until needed:
78
+
79
+ 1. At the start of a session, the model gets only each skill's name and description.
80
+ 2. When a task matches a description, the model calls the `skill` tool. It gets the instructions,
81
+ the skill's folder and the list of files in it, but not their contents.
82
+ 3. The model reads or runs those files when the instructions call for them. Files in a skill's
83
+ folder can be read even when the [sandbox](sandbox.md) limits the model to the project.
84
+
85
+ You can also start a skill yourself: `/commit-message` or `/commit-message only the parser
86
+ changes`. After the conversation is compacted, the model is told which skills were in use, so it
87
+ can load them again.
88
+
89
+ lcode reads skills from these folders; a repository's skill overrides one of yours with the same
90
+ name:
91
+
92
+ | Folder | |
93
+ |---|---|
94
+ | `.lcode/skills/`, `.agents/skills/`, `.claude/skills/` in the repository | For this repository |
95
+ | `~/.config/lcode/skills/`, `~/.agents/skills/`, `~/.claude/skills/` | For every repository |
96
+
97
+ `.agents/skills/` is the folder agents share by convention, and `.claude/skills/` is read too, so
98
+ skills you already have for other agents work in lcode. If other agents installed many skills you
99
+ don't need here, `lcode config set skills lcode` limits lcode to its own folders (`skills off` turns
100
+ skills off). However many there are, the list in the model's instructions stays within about 5% of
101
+ the context window: with many skills, each description is shortened so that all of them stay
102
+ listed. The same skill installed in two folders is used once. The format is the
103
+ [Agent Skills specification](https://agentskills.io/specification); like other agents, lcode is
104
+ lenient with skills that bend its rules (a name with capital letters, an unquoted colon in a
105
+ description) and skips only those without a description. `/help` lists the skills it found and
106
+ any it skipped.
107
+
108
+ ## Approving a repository's commands, skills and agents
109
+
110
+ A repository's commands, skills and [agents](agents.md#custom-agents) steer the model, and skills
111
+ can bring scripts. A freshly cloned repository shouldn't be able to do that silently, so the first
112
+ time you start lcode in a repository that has any, it asks:
113
+
114
+ ```text
115
+ This repository brings its own commands, skills or agents:
116
+ commands: /review
117
+ skills: commit-message
118
+ They can steer the model and include scripts it may run (commands still ask first, unless you
119
+ allow them).
120
+ Use them? [y/N]
121
+ ```
122
+
123
+ lcode asks again whenever any of their files change. Until you say yes, only your own commands and
124
+ skills are used. `lcode -p` never asks and doesn't use them.
125
+
126
+ ## Examples
127
+
128
+ The lcode repository has a ready-made command and skill in
129
+ [`examples/`](https://github.com/nasser1941/lcode/tree/main/examples): `/review` and the
130
+ `commit-message` skill above. Copy them into `.lcode/` of a repository, or into
131
+ `~/.config/lcode/` to have them everywhere.
@@ -31,6 +31,7 @@ lcode config path # print the file location
31
31
  | `vision_model` | `auto` | The model that [looks at images](usage.md#images): `auto`, `off` or an Ollama model that can see |
32
32
  | `mcp_tools` | `auto` | How [MCP](mcp.md#context) tool definitions reach the model: `auto`, `direct` or `search` (on demand) |
33
33
  | `memory` | `ask` | [Notes that carry over](memory.md) to later sessions: `ask` (confirm each), `auto` or `off` |
34
+ | `skills` | `all` | Which [skills](commands.md#skills) the model is offered: `all` (lcode's folders and the ones other agents share), `lcode` (only `.lcode/skills/` and `~/.config/lcode/skills/`) or `off` |
34
35
  | `subagents` | `true` | Let the model hand tasks to [subagents](agents.md) with their own context |
35
36
  | `max_parallel_agents` | `1` | Subagents that run at the same time; more needs `OLLAMA_NUM_PARALLEL` on the Ollama server ([details](agents.md#several-at-once)) |
36
37
  | `checkpoints` | `true` | Save a checkpoint before the model changes files, so [`/undo`](usage.md#undo-and-checkpoints) can restore them |
@@ -74,6 +75,8 @@ Environment variables override the file, which is useful for one-off runs and CI
74
75
  | `~/.local/state/lcode/mcp-logs/` | Error output of local MCP servers |
75
76
  | `~/.local/state/lcode/checkpoints/` | Checkpoints for `/undo` (copies of your project's files; deleted after 14 days) |
76
77
  | `~/.local/state/lcode/memory/` | [Memory](memory.md) notes: `user/` for every repository, `projects/<repository>/` for each one |
78
+ | `~/.config/lcode/commands/`, `~/.config/lcode/skills/` | Your [commands and skills](commands.md) (a repository's go in `.lcode/`) |
79
+ | `~/.local/state/lcode/extensions-approved.json` | Repositories whose commands, skills and agents you approved |
77
80
  | `~/.config/lcode/agents/` | Your [custom agents](agents.md#custom-agents) (a repository's go in `.lcode/agents/`) |
78
81
  | `~/.local/state/lcode/limits.json` | Context sizes that ran out of GPU memory on this machine (safe to delete) |
79
82
 
@@ -89,6 +89,8 @@ the Ollama server you configure, it only contacts the web when the model searche
89
89
  | `bench.py` | `lcode bench`: the benchmark tasks, their checks and the reports |
90
90
  | `vision.py` | Looking at images with a model that can see |
91
91
  | `subagents.py` | Subagents: agent types, running them (also in parallel), worktrees for workers |
92
+ | `extensions.py` | Custom commands and skills, and approving a repository's own |
93
+ | `frontmatter.py` | The `---` headers of notes, agents, commands and skills |
92
94
  | `planning.py` | Plan mode: what it allows, presenting a plan and approving it |
93
95
  | `memory.py` | Notes that carry over between sessions, and the end-of-session check |
94
96
  | `sandbox.py` | The optional container for shell commands |
@@ -12,7 +12,7 @@ lcode
12
12
 
13
13
  ```text
14
14
  ╭──────────────────────────────────────────────╮
15
- │ lcode v0.9.0 — local coding agent │
15
+ │ lcode v0.10.0 — local coding agent │
16
16
  │ │
17
17
  │ model lcode-qwen3.6-35b │
18
18
  │ context 256K tokens │
@@ -59,6 +59,7 @@ reasoning is on.
59
59
  | `/undo` | Undo the file changes of the last request ([details](#undo-and-checkpoints)) |
60
60
  | `/rewind [N]` | Go back to before request N: its files, and optionally the conversation |
61
61
  | `/checkpoints` | List the requests that changed files, and which files |
62
+ | `/name [args]` | Run one of your [commands or skills](commands.md); `/help` lists them |
62
63
  | `/agents [N]` | [Subagent](agents.md) types, and what this session's subagents did |
63
64
  | `/remember [-g] TEXT` | Save a [note](memory.md) for later sessions (`-g`: for every repository) |
64
65
  | `/memory [show\|edit\|delete N]` | The [notes](memory.md) lcode remembers |
@@ -92,6 +93,7 @@ reasoning is on.
92
93
  | `view_image` | Look at an image: a model that can see describes it ([Images](#images)) |
93
94
  | `agent` | Hand a task to a [subagent](agents.md) with its own context; only its report comes back |
94
95
  | `memory` | Save, update or delete [notes](memory.md) that later sessions load |
96
+ | `skill` | Load a [skill](commands.md#skills)'s instructions when a task matches it |
95
97
  | `present_plan` | In [plan mode](#plan-mode): show the plan and ask for approval |
96
98
 
97
99
  lcode refuses to edit a file the model hasn't read in the session, or one that changed on disk since
@@ -276,6 +278,9 @@ At startup lcode reads `AGENTS.md` (or `LCODE.md`, or `CLAUDE.md`) from the work
276
278
  adds it to the model's instructions. Use it for build and test commands, architecture notes and
277
279
  conventions. `/init` writes a first version for you.
278
280
 
281
+ Instructions that are only needed for some tasks fit better in a [command or skill](commands.md),
282
+ which costs no context until it's used.
283
+
279
284
  What doesn't belong in `AGENTS.md` but should carry over, such as your corrections and preferences,
280
285
  goes into lcode's [memory](memory.md): short notes the model, you (`/remember`) or a short check at
281
286
  the end of a session save, and that every later session in the repository loads.
@@ -0,0 +1,17 @@
1
+ # Examples
2
+
3
+ Ready-made extensions for lcode. Copy them into a repository (or into `~/.config/lcode/` to use
4
+ them everywhere):
5
+
6
+ | Example | Copy to | Use it |
7
+ |---|---|---|
8
+ | [`commands/review.md`](commands/review.md) | `.lcode/commands/review.md` | `/review` or `/review the parser` |
9
+ | [`skills/commit-message/`](skills/commit-message/) | `.lcode/skills/commit-message/` | ask for a commit message, or `/commit-message` |
10
+
11
+ ```bash
12
+ mkdir -p .lcode/commands .lcode/skills
13
+ cp examples/commands/review.md .lcode/commands/
14
+ cp -r examples/skills/commit-message .lcode/skills/
15
+ ```
16
+
17
+ See [Commands and skills](https://nasser1941.github.io/lcode/commands/) for the format.
@@ -0,0 +1,15 @@
1
+ ---
2
+ description: review the uncommitted changes for bugs and missing tests
3
+ argument-hint: "[path or what to focus on]"
4
+ allowed-tools: read_file grep glob list_dir bash
5
+ ---
6
+ Review the uncommitted changes in this repository. $ARGUMENTS
7
+
8
+ Run `git diff` and `git diff --cached` to see them, and read the code around them where needed.
9
+
10
+ Report, most important first:
11
+ 1. Bugs: wrong behavior, unhandled errors and edge cases, with `path:line`.
12
+ 2. Missing or weak tests for the changed behavior.
13
+ 3. Anything that doesn't match the code around it.
14
+
15
+ Don't change any files.
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: commit-message
3
+ description: Writes a git commit message for the staged changes, in the style the repository already uses. Use when the user asks for a commit message, or asks you to commit their changes.
4
+ license: MIT
5
+ ---
6
+ # Commit messages
7
+
8
+ 1. Run `scripts/staged.sh` from this skill's folder (with its absolute path). It prints the staged
9
+ files and the subjects of the last 15 commits.
10
+ 2. If nothing is staged, tell the user and stop. Don't stage files yourself unless they asked.
11
+ 3. Read the staged diff (`git diff --cached`) of the files that matter.
12
+ 4. Match the style of the recent subjects: imperative mood or not, prefixes such as `feat:` or
13
+ `fix(scope):` only if the repository uses them, capitalization and length.
14
+ 5. Write a subject under 72 characters that says what the change does. For anything but a trivial
15
+ change, add a blank line and a short body that says why, wrapped at 72 characters.
16
+ 6. Show the message. Commit only if the user asked you to: `git commit -F -` with the message on
17
+ standard input.
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
2
+ # The staged changes and recent commit subjects, for a commit message in the repository's style.
3
+ set -e
4
+ echo "Staged files:"
5
+ git diff --cached --stat
6
+ echo
7
+ echo "Recent commit subjects:"
8
+ git log --format='%s' -15
@@ -94,6 +94,7 @@ nav:
94
94
  - Using lcode: usage.md
95
95
  - Memory: memory.md
96
96
  - Subagents: agents.md
97
+ - Commands and skills: commands.md
97
98
  - Models & context windows: models.md
98
99
  - Benchmarking models: bench.md
99
100
  - MCP servers: mcp.md
@@ -72,6 +72,7 @@ ignore = [
72
72
  "src/lcode/memory.py" = ["E501"]
73
73
  "src/lcode/subagents.py" = ["E501"]
74
74
  "src/lcode/planning.py" = ["E501"]
75
+ "src/lcode/extensions.py" = ["E501"]
75
76
 
76
77
  [tool.pytest.ini_options]
77
78
  testpaths = ["tests"]
@@ -1,3 +1,3 @@
1
1
  """lcode — a local-first terminal coding agent powered by open-weight models via Ollama."""
2
2
 
3
- __version__ = "0.9.0"
3
+ __version__ = "0.10.0"
@@ -21,7 +21,7 @@ from rich.markup import escape
21
21
  from rich.panel import Panel
22
22
  from rich.text import Text
23
23
 
24
- from lcode import catalog, limits, planning, sessions, subagents, vision, web
24
+ from lcode import catalog, extensions, limits, planning, sessions, subagents, vision, web
25
25
  from lcode import memory as memory_notes
26
26
  from lcode.checkpoints import Checkpoints
27
27
  from lcode.config import format_tokens
@@ -78,7 +78,7 @@ SYSTEM_PROMPT = """You are lcode, an autonomous software-engineering agent runni
78
78
 
79
79
  # Top-level layout of the working directory
80
80
  {tree}
81
- {web}{agents}{project}{notes}"""
81
+ {web}{agents}{skills}{project}{notes}"""
82
82
 
83
83
  WEB_PROMPT = """
84
84
  # Web access
@@ -171,6 +171,8 @@ class Settings:
171
171
  vision_model: str = "auto" # auto, off or an Ollama model that can see images
172
172
  memory: str = "off" # off, ask or auto: notes that carry over to later sessions (lcode.memory)
173
173
  subagents: bool = False # the agent tool (lcode.subagents)
174
+ trust_project: bool = False # use the repository's own commands, skills and agents (lcode.extensions)
175
+ skills: str = "off" # all, lcode (only lcode's own skill folders) or off
174
176
  max_parallel_agents: int = 1
175
177
 
176
178
 
@@ -200,6 +202,8 @@ class Agent:
200
202
  self._agent_types: tuple[Path, dict[str, subagents.AgentType], list[str]] | None = None
201
203
  self.agent_runs: list[subagents.Record] = [] # subagents run in this session, for /agents
202
204
  self.plan = "" # the plan the user approved; kept through compaction
205
+ self._extensions: tuple[Path, extensions.Extensions] | None = None
206
+ self.skills_loaded: set[str] = set() # skills whose instructions are in the conversation
203
207
  # Set on subagents (see lcode.subagents):
204
208
  self.allowed_tools: set[str] | None = None # None: every tool
205
209
  self.read_only = False # only read-only shell commands
@@ -236,8 +240,15 @@ class Agent:
236
240
  notes=self.memory().prompt(self.settings.context) if self.settings.memory != "off" else "",
237
241
  web=self.web_prompt(),
238
242
  agents=self.agents_prompt(),
243
+ skills=extensions.skills_prompt(self.extensions().skills, self.settings.context),
239
244
  )
240
245
 
246
+ def extensions(self) -> extensions.Extensions:
247
+ """Custom commands and skills for the current folder (a repository's only once approved)."""
248
+ if self._extensions is None or self._extensions[0] != self.cwd:
249
+ self._extensions = (self.cwd, extensions.load(self.cwd, self.settings.trust_project, self.settings.skills))
250
+ return self._extensions[1]
251
+
241
252
  def agents_prompt(self) -> str:
242
253
  if not self.settings.subagents:
243
254
  return ""
@@ -252,7 +263,7 @@ class Agent:
252
263
  def agent_types(self) -> dict[str, subagents.AgentType]:
253
264
  """Built-in and custom agent types for the current folder."""
254
265
  if self._agent_types is None or self._agent_types[0] != self.cwd:
255
- types, problems = subagents.load_types(self.cwd)
266
+ types, problems = subagents.load_types(self.cwd, self.settings.trust_project)
256
267
  self._agent_types = (self.cwd, types, problems)
257
268
  return self._agent_types[1]
258
269
 
@@ -290,6 +301,8 @@ class Agent:
290
301
  schemas.append(subagents.schema(self.agent_types(), self.settings.max_parallel_agents))
291
302
  if self.planning():
292
303
  schemas.append(PRESENT_PLAN_SCHEMA)
304
+ if self.extensions().skills:
305
+ schemas.append(extensions.schema(self.extensions().skills))
293
306
  if self.mcp:
294
307
  schemas += self.mcp.schemas(self.settings.context)
295
308
  if self.allowed_tools is not None:
@@ -409,6 +422,7 @@ class Agent:
409
422
 
410
423
  def new_session(self) -> None:
411
424
  self.reset()
425
+ self.skills_loaded.clear()
412
426
  self.session_id = self.new_session_id()
413
427
  self.session_name = ""
414
428
  self.session_title = ""
@@ -606,6 +620,8 @@ class Agent:
606
620
  return f"list_dir({args.get('path', '.')})"
607
621
  if name == "memory":
608
622
  return f"memory({' '.join(str(args.get(k) or '') for k in ('action', 'name')).strip()})"
623
+ if name == "skill":
624
+ return f"skill({args.get('name', '')})"
609
625
  if name == "agent":
610
626
  return f"agent({args.get('type', '')}: {args.get('description') or str(args.get('task', ''))[:50]})"
611
627
  if name == "bash":
@@ -787,6 +803,12 @@ class Agent:
787
803
  ]
788
804
  if self.plan: # the approved plan stays word for word
789
805
  self.messages[1]["content"] += f"\n\n[The plan the user approved; keep following it]\n\n{self.plan}"
806
+ if self.skills_loaded: # their instructions were in the old messages: load them again when needed
807
+ names = ", ".join(sorted(self.skills_loaded))
808
+ self.messages[1]["content"] += (
809
+ f"\n\n[Skills in use before the summary: {names}. Load them again with the skill tool if you still need them.]"
810
+ )
811
+ self.skills_loaded.clear()
790
812
  self.ctx_used = sum(len(m["content"]) for m in self.messages) // 3
791
813
  self.reflected = len(self.messages)
792
814
  self.console.print(Panel(Markdown(summary), title="Compacted summary", border_style="blue"))
@@ -367,6 +367,20 @@ def cmd_doctor(args) -> None:
367
367
  line("", f"{n} × {slots[1]} context may not fit in memory here; {slots[0]} would", None)
368
368
  for problem in problems:
369
369
  line("", problem, None)
370
+ from lcode import extensions
371
+
372
+ project_state = extensions.status(Path.cwd())
373
+ ext = extensions.load(Path.cwd(), include_project=project_state == "approved", skills_from=cfg["skills"])
374
+ found = f"{len(ext.commands)} command(s), {len(ext.skills)} skill(s)"
375
+ note = {
376
+ "none": "",
377
+ "approved": " · this repository's are approved",
378
+ "new": " · this repository brings its own: approve them when lcode asks",
379
+ "changed": " · this repository's changed since you approved them: lcode asks again",
380
+ }[project_state]
381
+ line("Extras", found + note, None if project_state in ("new", "changed") else True)
382
+ for problem in ext.problems:
383
+ line("", problem, None)
370
384
  if cfg["memory"] == "off":
371
385
  line("Memory", "off (lcode config set memory ask)", True)
372
386
  else:
@@ -528,6 +542,9 @@ def cmd_chat(args) -> None:
528
542
  num_batch = spec.num_batch
529
543
  else: # the tuned batch size assumes the text-only variant; the vision projector needs that VRAM
530
544
  console.print(f"[dim]Tip: run `lcode setup {spec.key}` once to create the faster text-only variant.[/]")
545
+ from lcode import extensions
546
+
547
+ trust_project = extensions.trust_project(cwd, console, interactive=not args.prompt)
531
548
  settings = Settings(
532
549
  model=model,
533
550
  context=context,
@@ -547,6 +564,8 @@ def cmd_chat(args) -> None:
547
564
  memory="off" if args.no_memory else cfg["memory"],
548
565
  subagents=cfg["subagents"],
549
566
  max_parallel_agents=cfg["max_parallel_agents"],
567
+ trust_project=trust_project,
568
+ skills=cfg["skills"],
550
569
  )
551
570
  agent = Agent(ollama, settings, cwd, console=console)
552
571
  agent.interactive = not args.prompt
@@ -27,6 +27,7 @@ SEARCH_BACKENDS = ("auto", "ollama", "brave", "tavily", "searxng")
27
27
  MCP_TOOL_MODES = ("auto", "direct", "search")
28
28
  SANDBOX_ENGINES = ("off", "docker", "podman")
29
29
  MEMORY_MODES = ("off", "ask", "auto")
30
+ SKILL_SOURCES = ("all", "lcode", "off")
30
31
 
31
32
  # key -> (default, type, help)
32
33
  SETTINGS: dict[str, tuple[object, type, str]] = {
@@ -47,6 +48,7 @@ SETTINGS: dict[str, tuple[object, type, str]] = {
47
48
  "vision_model": ("auto", str, "model that looks at images: auto | off | an Ollama model with vision"),
48
49
  "mcp_tools": ("auto", str, "how MCP tools reach the model: auto | direct | search (on demand, saves context)"),
49
50
  "memory": ("ask", str, "notes that carry over to later sessions: off | ask (confirm each) | auto"),
51
+ "skills": ("all", str, "skills to offer the model: all (also other agents' folders) | lcode | off"),
50
52
  "subagents": (True, bool, "let the model hand tasks to subagents that have their own context"),
51
53
  "max_parallel_agents": (1, int, "subagents that may run at the same time (more needs OLLAMA_NUM_PARALLEL)"),
52
54
  }
@@ -120,6 +122,10 @@ def coerce(key: str, value: object) -> object:
120
122
  if value not in MEMORY_MODES:
121
123
  raise ConfigError(f"memory must be one of {', '.join(MEMORY_MODES)}")
122
124
  return value
125
+ if key == "skills" and str(value).lower() not in SKILL_SOURCES:
126
+ raise ConfigError(f"skills must be one of {', '.join(SKILL_SOURCES)}")
127
+ if key == "skills":
128
+ return str(value).lower()
123
129
  if key == "mcp_tools" and value not in MCP_TOOL_MODES:
124
130
  raise ConfigError(f"mcp_tools must be one of {', '.join(MCP_TOOL_MODES)}")
125
131
  if key == "search_backend" and value not in SEARCH_BACKENDS: