agent-simple-english 0.6.0 → 0.7.0
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 +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +15 -1
- package/commands/ase.md +1 -0
- package/hooks/hooks.json +2 -0
- package/hooks/register.ts +51 -0
- package/package.json +2 -2
- package/src/extension/index.ts +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://anthropic.com/claude-code/plugin.schema.json",
|
|
3
3
|
"name": "simple-english",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"description": "Apply technical and house-style writing rules to writes, edits, and git commit messages.",
|
|
6
6
|
"repository": "https://github.com/jyooi/agent-simple-english",
|
|
7
7
|
"license": "MIT",
|
package/README.md
CHANGED
|
@@ -73,6 +73,11 @@ The `/ase` command controls the current Claude Code session.
|
|
|
73
73
|
New sessions start in enabled mode without a strict reply gate.
|
|
74
74
|
A change in one session does not change a parallel session.
|
|
75
75
|
|
|
76
|
+
The full command name is `/simple-english:ase`, and it always runs.
|
|
77
|
+
The short name `/ase` runs the same command.
|
|
78
|
+
If a user command or a project command has the name `ase`, that command takes the short name.
|
|
79
|
+
Then use the full name.
|
|
80
|
+
|
|
76
81
|
| Command | Result |
|
|
77
82
|
| --- | --- |
|
|
78
83
|
| `/ase on` | Enable write, edit, commit, and reply checks. |
|
|
@@ -82,6 +87,15 @@ A change in one session does not change a parallel session.
|
|
|
82
87
|
| `/ase strict off` | Disable the strict reply gate and use reply feedback. |
|
|
83
88
|
| `/ase explain` | Write the last reply again in Simplified Technical English. |
|
|
84
89
|
|
|
90
|
+
Claude Code 2.1.292 or later shows argument suggestions while you type.
|
|
91
|
+
Type `/ase`, press Tab to select the command, then type the first letters of an argument.
|
|
92
|
+
The list shows each argument that starts with those letters, and Tab completes the first one.
|
|
93
|
+
After `strict`, the list suggests `off`.
|
|
94
|
+
|
|
95
|
+
An earlier Claude Code version shows only the fixed argument hint.
|
|
96
|
+
Claude Code 2.1.287 to 2.1.291 also show one load error for the suggestion module at session start.
|
|
97
|
+
The writing-rule hooks continue to operate on those versions.
|
|
98
|
+
|
|
85
99
|
Strict mode blocks a `Stop` event when the reply has a hard violation.
|
|
86
100
|
Claude Code then uses the violation details to write the reply again.
|
|
87
101
|
The `stop_hook_active` check stops a second block in the same rewrite loop.
|
|
@@ -132,7 +146,7 @@ pi -e .
|
|
|
132
146
|
|
|
133
147
|
The mode applies to the current pi session.
|
|
134
148
|
The extension starts in enabled mode without strict reply gating.
|
|
135
|
-
Type `/ase ` to see autocomplete suggestions for `on`, `off`, `status`, and `strict`.
|
|
149
|
+
Type `/ase ` to see autocomplete suggestions for `on`, `off`, `status`, `strict`, and `strict off`.
|
|
136
150
|
The list changes to match the text that you type.
|
|
137
151
|
|
|
138
152
|
| Command | Result |
|
package/commands/ase.md
CHANGED
package/hooks/hooks.json
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
interface Suggestion {
|
|
2
|
+
readonly text: string
|
|
3
|
+
readonly description: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
interface AutocompleteInput {
|
|
7
|
+
readonly text: string
|
|
8
|
+
readonly token: string
|
|
9
|
+
readonly start: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface AutocompleteResult {
|
|
13
|
+
readonly suggestions: readonly Suggestion[]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type AutocompleteHook = (
|
|
17
|
+
engine: unknown,
|
|
18
|
+
input: AutocompleteInput,
|
|
19
|
+
next: (input: AutocompleteInput) => Promise<AutocompleteResult>,
|
|
20
|
+
) => Promise<AutocompleteResult>
|
|
21
|
+
|
|
22
|
+
const FIRST_WORDS: readonly Suggestion[] = [
|
|
23
|
+
{ text: "on", description: "Enable write, edit, commit, and reply checks" },
|
|
24
|
+
{ text: "off", description: "Disable all checks and leave strict mode" },
|
|
25
|
+
{ text: "status", description: "Show the mode, rule counts, and dictionary state" },
|
|
26
|
+
{ text: "strict", description: "Enable the strict reply gate and all other checks" },
|
|
27
|
+
{ text: "explain", description: "Write the last reply again in Simplified Technical English" },
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
const WORDS_AFTER_STRICT: readonly Suggestion[] = [
|
|
31
|
+
{ text: "off", description: "Disable the strict reply gate and use reply feedback" },
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
export function aseSuggestions(text: string, token: string, start: number): readonly Suggestion[] {
|
|
35
|
+
const head = /^\/(?:simple-english:)?ase\s+(.*)$/u.exec(text.slice(0, start))
|
|
36
|
+
if (head === null) return []
|
|
37
|
+
const earlierWords = (head[1] ?? "").trim().toLowerCase()
|
|
38
|
+
const words =
|
|
39
|
+
earlierWords === "" ? FIRST_WORDS : earlierWords === "strict" ? WORDS_AFTER_STRICT : []
|
|
40
|
+
const typed = token.toLowerCase()
|
|
41
|
+
return words.filter((word) => word.text.startsWith(typed) && word.text !== typed)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function register(on: (event: "prompt.autocomplete", hook: AutocompleteHook) => void): void {
|
|
45
|
+
on("prompt.autocomplete", async (_engine, input, next) => ({
|
|
46
|
+
suggestions: [
|
|
47
|
+
...aseSuggestions(input.text, input.token, input.start),
|
|
48
|
+
...(await next(input)).suggestions,
|
|
49
|
+
],
|
|
50
|
+
}))
|
|
51
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-simple-english",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Technical and house-style English lint engine, CLI, and host adapters",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@lezer/html": "^1.3.12",
|
|
48
48
|
"@lezer/markdown": "^1.7.2",
|
|
49
|
-
"effect": "4.0.
|
|
49
|
+
"effect": "4.0.1",
|
|
50
50
|
"micromark": "^4.0.2",
|
|
51
51
|
"micromark-extension-frontmatter": "^2.0.0",
|
|
52
52
|
"micromark-extension-gfm-table": "^2.1.1",
|
package/src/extension/index.ts
CHANGED
|
@@ -35,6 +35,7 @@ const COMMAND_COMPLETIONS: readonly AutocompleteItem[] = [
|
|
|
35
35
|
{ value: "off", label: "off", description: "Disable writing-rule enforcement" },
|
|
36
36
|
{ value: "status", label: "status", description: "Show writing-rule status" },
|
|
37
37
|
{ value: "strict", label: "strict", description: "Enable strict reply gating" },
|
|
38
|
+
{ value: "strict off", label: "strict off", description: "Disable strict reply gating" },
|
|
38
39
|
]
|
|
39
40
|
|
|
40
41
|
interface SessionState {
|