@semacode/cli 4.2.9 → 4.2.10

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.
@@ -1,98 +1,103 @@
1
- ---
2
- name: sema
3
- description: Use before creating or editing software in a workspace, including small fixes, plain HTML/CSS/JavaScript apps, and empty projects. Ask about first-time Sema adoption, confirm the effective context window, then follow local contracts before implementation. Also handles Sema installation, updates and repair. The user need not mention Sema.
4
- ---
5
-
6
- # Sema
7
-
8
- Load this skill before the first project write for creation or editing tasks.
9
- Sema applies to simple static apps as well as larger systems. A request to
10
- create an app, fix a bug or change a feature enters this workflow even when
11
- it does not name Sema. Loading the skill is not consent to adopt it.
12
-
13
- ## Create or edit a project
14
-
15
- 1. In the current workspace, run `sema --version`. If PATH fails, use the
16
- fallback below. Look for `AGENTS.md`, `SEMA_BOOT.md` and applicable contracts
17
- without reading the whole project.
18
- 2. **First use in a project without Sema:** before implementation, ask whether
19
- the user wants to adopt Sema in this project and wait for the answer. This
20
- applies both to an empty project and to editing existing ungoverned code.
21
- Do not infer consent from installation, automatic skill activation or a
22
- generic request to create/edit software. An explicit adoption request or
23
- previous acceptance for this same project already answers the question;
24
- do not ask again. If declined, do not initialize Sema or claim its validation;
25
- follow the remaining user and project instructions.
26
- 3. **After acceptance, or in an existing Sema project:** obtain the model's
27
- effective configured context window in tokens from the client or user.
28
- If unknown, ask and wait before loading project context or implementing.
29
- Parameter count (4B, 9B), advertised maximum and output-token limit are not
30
- the configured context window. Recheck when the model/configuration changes.
31
- 4. **Adopting this project:** preserve existing files and run:
32
-
33
- ```text
34
- sema descobrir explicar flow.project-adoption --json
35
- sema iniciar --template base --janela-contexto <confirmed-tokens>
36
- sema sync-codex --json
37
- ```
38
-
39
- Read the generated `AGENTS.md` and `SEMA_BOOT.md`. Initialization does not
40
- invent a business contract: examples stay under `exemplos/`. Model the actual
41
- requested behavior in `contratos/` before implementing; preserve existing contracts. Never add `--force`
42
- without an explicit overwrite decision.
43
- 5. **Existing Sema project:** read its `AGENTS.md` and `SEMA_BOOT.md`, then run
44
- `sema sessao "<task intention>" --janela-contexto <confirmed-tokens> --json`.
45
- Follow the local gates and selected contract through implementation/testing.
46
- Save a context profile only with `--salvar-perfil` as requested.
47
-
48
- Run `docs-impacto --intencao "<intent>" --arquivo <contract> --json` and retain
49
- `mudancaId`. After compaction, resume `sessao --mudanca-id <id> --json`.
50
- Use the recompiled `estadoAtual` and returned gates instead of conclusions from
51
- the conversation summary. A stale protocol blocks work: run `sync-codex`, reread
52
- `SEMA_BOOT.md` and resume the same id. `impl`/`vinculos` belong in `.sema` contracts.
53
- Use the returned argument arrays for closure; repeat `--doc-lida` only for docs
54
- actually read. Hashes reuse declarations until a file changes. Missing scope or
55
- nonexistent files block closure. This gate checks declarations, not comprehension
56
- or behavior: validation, fresh drift and application tests remain separate.
57
- Use `drift <contract> --cache fresh --pacote --json` and inspect evidence gaps;
58
- consume JSON without truncating lines or object depth. When creating a contract,
59
- plan each task's `impl { js: app.cadastrar }` and
60
- `vinculos { arquivo: "app.js" simbolo: app.cadastrar }` before implementation.
61
- Confirm the planned files and symbols with fresh drift once they exist.
62
- Link HTML/CSS as module files; they are not JavaScript implementations.
63
- `SEMA-GOVERNED` headers identify ownership but do not replace task mappings.
64
- Quote `arquivo` paths. Do not convert plain JavaScript to ES modules for Sema.
65
-
66
- `sema formatar` formats .sema contracts and `sema validar` validates those
67
- contracts. Neither adopts a project or proves that HTML, CSS, JavaScript or
68
- the application works. Report what was actually checked, including no contracts
69
- found. If the user corrects a missed Sema workflow, resume it before more writes.
70
-
71
- Read only the selected contract, declared dependencies and blocking docs.
72
- `SEMA_INDEX.json` and `AGENT_CONTEXT_PACK.json` are internal CLI databases,
73
- not files to preload. Resolve stale indexes or ambiguous targets before editing.
74
- The profile-selected summary is optional: skip it when the session already supplies the needed context.
75
- The budget counts local entry instructions plus the current delivery, not the whole chat.
76
- Do not load multiple summaries or choose context size from labels such as small/strong.
77
-
78
- ## CLI fallback and results
79
-
80
- On Windows PowerShell, use this directly if PATH fails:
81
-
82
- ```powershell
83
- & "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "$HOME\.sema\bin\sema-managed.ps1" --version
84
- ```
85
-
86
- On macOS/Linux: `"$HOME/.sema/bin/sema" --version`. Do not declare the CLI
87
- unavailable before trying the managed fallback. If both fail, stop governed
88
- edits. JSON results nest domain state in `payload`; `ok` alone is not proof
89
- of success. Drift JSON uses `payload.status.success`, `payload.status.score` and
90
- `payload.counts` both with and without `--pacote`; complete output also preserves
91
- legacy fields. Session context is under `payload.perfil` (`janelaTokens`,
92
- `orcamentoTokens`, `reservaSaidaTokens`). Respect domain verdicts, blockers and scope.
93
-
94
- ## Install, update or repair Sema
95
-
96
- Only for distribution work, read [references/distribution.md](references/distribution.md).
97
- Do not load it for ordinary project creation or editing. Informational requests
98
- do not mutate a workspace. Installation and repair remain separate from adoption.
1
+ ---
2
+ name: sema
3
+ description: Use before creating or editing software in a workspace, including small fixes, plain HTML/CSS/JavaScript apps, and empty projects. Ask about first-time Sema adoption, confirm the effective context window, then follow local contracts before implementation. Also handles Sema installation, updates and repair. The user need not mention Sema.
4
+ ---
5
+
6
+ # Sema
7
+
8
+ Load this skill before the first project write for creation or editing tasks.
9
+ Sema applies to simple static apps as well as larger systems. A request to
10
+ create an app, fix a bug or change a feature enters this workflow even when
11
+ it does not name Sema. Loading the skill is not consent to adopt it.
12
+
13
+ ## Create or edit a project
14
+
15
+ 1. In the current workspace, run `sema --version`. If PATH fails, use the
16
+ fallback below. Look for `AGENTS.md`, `SEMA_BOOT.md` and applicable contracts
17
+ without reading the whole project.
18
+ 2. **First use in a project without Sema:** before implementation, ask whether
19
+ the user wants to adopt Sema in this project and wait for the answer. This
20
+ applies both to an empty project and to editing existing ungoverned code.
21
+ Do not infer consent from installation, automatic skill activation or a
22
+ generic request to create/edit software. An explicit adoption request or
23
+ previous acceptance for this same project already answers the question;
24
+ do not ask again. If declined, do not initialize Sema or claim its validation;
25
+ follow the remaining user and project instructions.
26
+ 3. **After acceptance, or in an existing Sema project:** obtain the model's
27
+ effective configured context window in tokens from the client or user.
28
+ If unknown, ask and wait before loading project context or implementing.
29
+ Parameter count (4B, 9B), advertised maximum and output-token limit are not
30
+ the configured context window. Recheck when the model/configuration changes.
31
+ 4. **Adopting this project:** preserve existing files and run:
32
+
33
+ ```text
34
+ sema descobrir explicar flow.project-adoption --json
35
+ sema iniciar --template base --janela-contexto <confirmed-tokens>
36
+ sema sync-codex --json
37
+ ```
38
+
39
+ Read the generated `AGENTS.md` and `SEMA_BOOT.md`. Initialization does not
40
+ invent a business contract: examples stay under `exemplos/`. Model the actual
41
+ requested behavior in `contratos/` before implementing; preserve existing contracts. Never add `--force`
42
+ without an explicit overwrite decision.
43
+ 5. **Existing Sema project:** read its `AGENTS.md` and `SEMA_BOOT.md`, then run
44
+ `sema sessao "<task intention>" --janela-contexto <confirmed-tokens> --json`.
45
+ Follow the local gates and selected contract through implementation/testing.
46
+ Save a context profile only with `--salvar-perfil` as requested.
47
+
48
+ Run `docs-impacto --intencao "<intent>" --arquivo <contract> --json` and retain
49
+ `mudancaId`. After compaction, resume `sessao --mudanca-id <id> --json`.
50
+ Use the recompiled `estadoAtual` and returned gates instead of conclusions from
51
+ the conversation summary. A stale protocol blocks work: run `sync-codex`, reread
52
+ `SEMA_BOOT.md` and resume the same id. `impl`/`vinculos` belong in `.sema` contracts.
53
+ Use the returned argument arrays for closure; repeat `--doc-lida` only for docs
54
+ actually read. Hashes reuse declarations until a file changes. Missing scope or
55
+ nonexistent files block closure. This gate checks declarations, not comprehension
56
+ or behavior: validation, fresh drift and application tests remain separate.
57
+ Use `drift <contract> --cache fresh --pacote --json` and inspect evidence gaps;
58
+ consume JSON without truncating lines or object depth. When creating a contract,
59
+ plan each task's `impl { js: app.cadastrar }` and
60
+ `vinculos { arquivo: "app.js" simbolo: app.cadastrar }` before implementation.
61
+ Confirm the planned files and symbols with fresh drift once they exist.
62
+ Link HTML/CSS as module files; they are not JavaScript implementations.
63
+ `SEMA-GOVERNED` headers identify ownership but do not replace task mappings.
64
+ Quote `arquivo` paths. Do not convert plain JavaScript to ES modules for Sema.
65
+ Historical migrations, including Prisma `migrations/<timestamp>_<name>/migration.sql`,
66
+ keep their SQL bytes and contract bindings. Never add headers, reformat SQL or remove
67
+ bindings just to pass a gate. A filename does not prove application or checksum;
68
+ consult the project's runbook and database history. Use a new migration for behavior
69
+ changes and link current schema/code while preserving relevant historical references.
70
+
71
+ `sema formatar` formats .sema contracts and `sema validar` validates those
72
+ contracts. Neither adopts a project or proves that HTML, CSS, JavaScript or
73
+ the application works. Report what was actually checked, including no contracts
74
+ found. If the user corrects a missed Sema workflow, resume it before more writes.
75
+
76
+ Read only the selected contract, declared dependencies and blocking docs.
77
+ `SEMA_INDEX.json` and `AGENT_CONTEXT_PACK.json` are internal CLI databases,
78
+ not files to preload. Resolve stale indexes or ambiguous targets before editing.
79
+ The profile-selected summary is optional: skip it when the session already supplies the needed context.
80
+ The budget counts local entry instructions plus the current delivery, not the whole chat.
81
+ Do not load multiple summaries or choose context size from labels such as small/strong.
82
+
83
+ ## CLI fallback and results
84
+
85
+ On Windows PowerShell, use this directly if PATH fails:
86
+
87
+ ```powershell
88
+ & "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "$HOME\.sema\bin\sema-managed.ps1" --version
89
+ ```
90
+
91
+ On macOS/Linux: `"$HOME/.sema/bin/sema" --version`. Do not declare the CLI
92
+ unavailable before trying the managed fallback. If both fail, stop governed
93
+ edits. JSON results nest domain state in `payload`; `ok` alone is not proof
94
+ of success. Drift JSON uses `payload.status.success`, `payload.status.score` and
95
+ `payload.counts` both with and without `--pacote`; complete output also preserves
96
+ legacy fields. Session context is under `payload.perfil` (`janelaTokens`,
97
+ `orcamentoTokens`, `reservaSaidaTokens`). Respect domain verdicts, blockers and scope.
98
+
99
+ ## Install, update or repair Sema
100
+
101
+ Only for distribution work, read [references/distribution.md](references/distribution.md).
102
+ Do not load it for ordinary project creation or editing. Informational requests
103
+ do not mutate a workspace. Installation and repair remain separate from adoption.