@turingcode/cli 0.3.19 → 0.3.21
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/dist/cli/create-cli.js +13 -12
- package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/SKILL.md +19 -3
- package/mods/claude/turingcode-skills/skills/{turingcode-cli → turingcode}/references/newproject.md +2 -0
- package/package.json +1 -1
- package/mods/claude/turingcode-skills/skills/turingcode-cli/SKILL.md +0 -48
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/M_StatusEnum.md +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/app-startup.md +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/code/BusMutexRegistry.hpp +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/code/COM_Driver.hpp +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/code/COM_I2C.hpp +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/code/COM_SPI.hpp +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/code/COM_USART.hpp +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/code/Util_MutexManager.hpp +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/driver/driver.md +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/driver/driver_ic.md +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/driver/driver_protocol.md +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/driver/driver_rtos.md +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/driver/driver_test.md +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/host-protocol.md +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/init-pins.md +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/registers-and-units.md +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/storage.md +0 -0
- /package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/references/tasks-and-interrupts.md +0 -0
package/dist/cli/create-cli.js
CHANGED
|
@@ -44,18 +44,19 @@ export function createCli(args) {
|
|
|
44
44
|
.scriptName('turingcode')
|
|
45
45
|
.usage("Usage: $0 <command> [options]; $0 <command> --help for each command's usage")
|
|
46
46
|
.epilogue([
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
'
|
|
54
|
-
'
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
'-
|
|
58
|
-
'
|
|
47
|
+
'`turingcode` handles project setup, building, configuration, flashing and debugging.',
|
|
48
|
+
'',
|
|
49
|
+
'Each command group has its own `--help` with flags and examples.',
|
|
50
|
+
' Read it before using commands in that area.',
|
|
51
|
+
'',
|
|
52
|
+
'- Run `turingcode status` first.',
|
|
53
|
+
'',
|
|
54
|
+
'Most useful commands:',
|
|
55
|
+
'- `project sync -b` to build on the server',
|
|
56
|
+
'- `probe program` to flash the board',
|
|
57
|
+
'- `probe --help` to learn more about debugging, breakpoints, stepping, ...',
|
|
58
|
+
'- Server mcp tools: `tool list` to find mcp tools on the turingcode server,',
|
|
59
|
+
' then `tool call <name> --args ...` to run it.',
|
|
59
60
|
].join('\n'))
|
|
60
61
|
.command(commands)
|
|
61
62
|
.demandCommand(1, `Name a command: ${names.slice(0, -1).join(', ')} or ${names.at(-1)}`)
|
package/mods/claude/turingcode-skills/skills/{turingcode-firmware-code → turingcode}/SKILL.md
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: turingcode
|
|
3
|
-
description: Coding rules for embedded C/C++ firmware on STM32. Use whenever writing, editing, reviewing or organizing .c, .cpp, .h or .hpp files for a microcontroller or sensor driver.
|
|
2
|
+
name: turingcode
|
|
3
|
+
description: Coding rules for embedded C/C++ firmware on STM32. Use whenever writing, editing, reviewing or organizing .c, .cpp, .h or .hpp files, or creating, building, flashing, testing a STM32 Project for a microcontroller or sensor driver.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Embedded C/C++ rules
|
|
@@ -16,6 +16,7 @@ description: Coding rules for embedded C/C++ firmware on STM32. Use whenever wri
|
|
|
16
16
|
| Read | When changing or making |
|
|
17
17
|
|---|---|
|
|
18
18
|
| `references/init-pins.md` | when a new project is created and we need to decide about pin connections and what pins to use, or when a user asks about where and how to connect the board pins |
|
|
19
|
+
| `references/newproject.md` | Only when the user asks for a new project |
|
|
19
20
|
| `references/driver/driver.md` | a driver for an external IC or bus protocol |
|
|
20
21
|
| `references/registers-and-units.md` | datasheet registers, bit fields, signedness, units, conversions |
|
|
21
22
|
| `references/tasks-and-interrupts.md` | ISRs, HAL callbacks, the main loop, RTOS tasks and their wakeups, DMA, shared data |
|
|
@@ -96,8 +97,23 @@ description: Coding rules for embedded C/C++ firmware on STM32. Use whenever wri
|
|
|
96
97
|
*/
|
|
97
98
|
```
|
|
98
99
|
|
|
99
|
-
##
|
|
100
|
+
## Typical loop
|
|
101
|
+
|
|
102
|
+
1. Edit the code, run `turingcode project sync -b` and fix the reported errors.
|
|
103
|
+
- Before finishing a change, run `turingcode project sync -b -a` for static analysis.
|
|
104
|
+
2. Flash with `turingcode probe program`.
|
|
105
|
+
3. Verify it runs without looking at the board: read a register the program changes a few times with `turingcode probe read` and check that it changes as expected.
|
|
106
|
+
4. On a crash, run `turingcode probe faults`, or `turingcode debug start` with breakpoints to find the cause.
|
|
107
|
+
|
|
108
|
+
## Code Safety rules
|
|
100
109
|
|
|
101
110
|
1. **Never drop a status.** Check or accumulate every status, `HAL_StatusTypeDef` and RTOS return. Never return `M_OK` after fallible steps; if ignoring one is safe, write in comments why.
|
|
102
111
|
2. **Every wait has a timeout and an error path.** No unbounded hardware loops, no retry count where 0 means "forever"; fail visibly instead of hanging boot.
|
|
103
112
|
3. **Budget memory.** No `new`/`delete` in periodic/per-transaction paths; preallocate as members or statics; keep KB-sized objects off task stacks and size each stack.
|
|
113
|
+
|
|
114
|
+
## Tool Safety rules
|
|
115
|
+
|
|
116
|
+
- Don't ever write debug registers by hand (DHCSR, DEMCR, DCRSR, DCRDR, FPB). doing so may brick the mcu.
|
|
117
|
+
- Halt, step and breakpoints go through `turingcode debug`, which releases the debug state on exit.
|
|
118
|
+
- NEVER touch RDP without asking first.
|
|
119
|
+
- Level 1 → 0 mass-erases the flash, and Level 2 is permanent.
|
package/package.json
CHANGED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: turingcode-cli
|
|
3
|
-
description: use for creating, build, debug, program, flash or analyze any STM32 project
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# turingcode CLI for STM32
|
|
7
|
-
|
|
8
|
-
`turingcode` handles the whole STM32 workflow: project setup, building, configuration, flashing and debugging. Use it instead of calling probe-rs or STM32_Programmer_CLI directly.
|
|
9
|
-
|
|
10
|
-
## Start here
|
|
11
|
-
|
|
12
|
-
- Run `turingcode status` first. It shows the project, token, last build, debug session and installed probe tools.
|
|
13
|
-
|
|
14
|
-
## Commands
|
|
15
|
-
|
|
16
|
-
Each command group has its own `--help` with flags and examples. Read it before using commands in that area.
|
|
17
|
-
|
|
18
|
-
- `turingcode project --help`: sync, build, pull, regen and static analysis.
|
|
19
|
-
- `turingcode syntax-check --help`: clang syntax check of the project, or of loose files, folders or globs.
|
|
20
|
-
- `turingcode probe --help`: flash, reset, read memory or registers, decode faults, recover a stuck probe.
|
|
21
|
-
- `turingcode debug --help`: breakpoints, stepping, stack, variables.
|
|
22
|
-
|
|
23
|
-
## Server tools
|
|
24
|
-
|
|
25
|
-
Pins, clocks, `.ioc` edits, register lookup and the datasheet knowledge base (MCUs and components) run as server tools:
|
|
26
|
-
|
|
27
|
-
- `turingcode tool list` shows the available tools.
|
|
28
|
-
- `turingcode tool call <name> --args '<json>' > result.md` runs one.
|
|
29
|
-
- On Windows PowerShell or cmd, inline JSON loses its quotes: write the JSON to a `.json` file and pass `--args args.json`.
|
|
30
|
-
|
|
31
|
-
## New project
|
|
32
|
-
|
|
33
|
-
Only when the user asks for a new project: follow [references/newproject.md](references/newproject.md).
|
|
34
|
-
|
|
35
|
-
## Typical loop
|
|
36
|
-
|
|
37
|
-
1. Edit the code, run `turingcode project sync -b` and fix the reported errors.
|
|
38
|
-
- Before finishing a change, run `turingcode project sync -b -a` for static analysis.
|
|
39
|
-
2. Flash with `turingcode probe program`.
|
|
40
|
-
3. Verify it runs without looking at the board: read a register the program changes a few times with `turingcode probe read` and check that it changes as expected.
|
|
41
|
-
4. On a crash, run `turingcode probe faults`, or `turingcode debug start` with breakpoints to find the cause.
|
|
42
|
-
|
|
43
|
-
## CRITICAL Safety rules
|
|
44
|
-
|
|
45
|
-
- Don't ever write debug registers by hand (DHCSR, DEMCR, DCRSR, DCRDR, FPB). doing so may brick the mcu.
|
|
46
|
-
- Halt, step and breakpoints go through `turingcode debug`, which releases the debug state on exit.
|
|
47
|
-
- NEVER touch RDP without asking first.
|
|
48
|
-
- Level 1 → 0 mass-erases the flash, and Level 2 is permanent.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|