@hagicode/cli 0.1.0-dev.38.1.49d2c87 → 0.1.0-dev.41.1.8543fd3
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/README.md +103 -9
- package/dist/chunks/main-C3T3Iu-a.js +176 -0
- package/dist/cli.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +3 -2
- package/skills/README.md +51 -0
- package/skills/hagi/SKILL.md +106 -0
- package/skills/hagi/agents/openai.yaml +7 -0
- package/skills/hagi/references/cli-usage.md +282 -0
- package/skills/hagi/references/local-development.md +79 -0
- package/skills/hagi/references/openspec-workflow.md +130 -0
- package/skills/hagi/references/proposal-flow.md +183 -0
- package/skills/hagi/references/session-data.md +156 -0
- package/skills/hagi/references/super-commit.md +106 -0
- package/skills/hagi/references/validation.md +145 -0
- package/dist/chunks/main-BU7mtIsu.js +0 -165
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Validation
|
|
2
|
+
|
|
3
|
+
Run the smallest relevant set after changes.
|
|
4
|
+
Documentation-only updates do not require the full code validation stack, but cross-links and package metadata assumptions still need confirmation.
|
|
5
|
+
|
|
6
|
+
## Documentation and skill checks
|
|
7
|
+
|
|
8
|
+
Confirm these paths resolve and link correctly:
|
|
9
|
+
|
|
10
|
+
- `repos/cli/README.md`
|
|
11
|
+
- `repos/cli/skills/README.md`
|
|
12
|
+
- `repos/cli/skills/hagi/SKILL.md`
|
|
13
|
+
- `repos/cli/skills/hagi/agents/openai.yaml`
|
|
14
|
+
- `repos/cli/skills/hagi/references/*.md`
|
|
15
|
+
|
|
16
|
+
Check that every command named in the references is registered: the `hagi` help output after a build lists the same families and subcommands.
|
|
17
|
+
|
|
18
|
+
## Repository scope rule check
|
|
19
|
+
|
|
20
|
+
The repository scope rule for `proposal create` must appear in three files. Each one is checked on its own, and one file that still has the rule does not stand in for another:
|
|
21
|
+
|
|
22
|
+
- `SKILL.md` carries the core rule: the writable and read-only lists, and the `project repositories` query.
|
|
23
|
+
- `references/proposal-flow.md` carries the `Repository scope` section: the query step, the `Writable repositories:` and `Read-only repositories:` lists, and the example that begins its chief complaint with that section.
|
|
24
|
+
- `references/session-data.md` carries the state-changing rule: the scope is taken from the user or the session, and the agent asks when neither gives it instead of guessing.
|
|
25
|
+
|
|
26
|
+
Run this from `repos/cli` after editing any of the three:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
grep -n "Repository scope" skills/hagi/SKILL.md skills/hagi/references/proposal-flow.md
|
|
30
|
+
grep -n "Read-only repositories" skills/hagi/SKILL.md skills/hagi/references/proposal-flow.md
|
|
31
|
+
grep -n "project repositories" skills/hagi/SKILL.md skills/hagi/references/proposal-flow.md skills/hagi/references/session-data.md
|
|
32
|
+
grep -n "ask the user" skills/hagi/SKILL.md skills/hagi/references/proposal-flow.md skills/hagi/references/session-data.md
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Each of the three files must match the lines listed for it above. A file that is missing a match fails the check, and it is fixed in the skill folder, not by copying the rule from another file.
|
|
36
|
+
|
|
37
|
+
Confirm also that no skill file names `--writable-repo` or `--readonly-repo`, and that every `proposal create` example passes a chief complaint that begins with the `Repository scope` section.
|
|
38
|
+
|
|
39
|
+
## HagiTask command check
|
|
40
|
+
|
|
41
|
+
The `hagitask` command group must appear in the README and in each skill file that lists command families, and no file may document the retired `autotask` command. Run this from `repos/cli`:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
for f in README.md skills/hagi/SKILL.md skills/hagi/references/cli-usage.md skills/hagi/references/session-data.md skills/hagi/references/super-commit.md skills/hagi/references/openspec-workflow.md; do
|
|
45
|
+
grep -q "hagitask" "$f" && echo "ok hagitask in $f" || echo "FAIL hagitask missing from $f"
|
|
46
|
+
done
|
|
47
|
+
grep -rniE "autotask|auto-task" README.md skills --exclude=validation.md | grep -vi "migrat" || echo "ok no autotask command documented"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Each file must print `ok`. The last grep lists only the migration notes (lines that say "migrat"), so any other match is a stale `autotask` reference and fails the check. This file is excluded from that grep because it names the pattern itself.
|
|
51
|
+
|
|
52
|
+
## Workflow and Super Commit check
|
|
53
|
+
|
|
54
|
+
Run this from `repos/cli` after editing `references/openspec-workflow.md`, `references/super-commit.md`, or any file that links them. Each line must print `ok`.
|
|
55
|
+
|
|
56
|
+
1. Both references exist and are linked from `SKILL.md` and `skills/README.md`:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
for f in skills/hagi/references/openspec-workflow.md skills/hagi/references/super-commit.md; do
|
|
60
|
+
[ -f "$f" ] && echo "ok exists $f" || echo "FAIL missing $f"
|
|
61
|
+
done
|
|
62
|
+
for f in skills/hagi/SKILL.md skills/README.md; do
|
|
63
|
+
for t in openspec-workflow.md super-commit.md; do
|
|
64
|
+
grep -q "$t" "$f" && echo "ok $f links $t" || echo "FAIL $f does not link $t"
|
|
65
|
+
done
|
|
66
|
+
done
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
2. No README or skill file shows the retired `--task-id compose-commit` form. This check does not scan this file, which names the pattern itself. The id may remain as test data in `tests/commands/hagitask.test.ts`, the one allowed place, and that file is outside this scan:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
grep -rn --exclude=validation.md -e "--task-id compose-commit" README.md skills
|
|
73
|
+
status=$?
|
|
74
|
+
if [ "$status" -eq 0 ]; then
|
|
75
|
+
echo "FAIL retired compose-commit example found above"
|
|
76
|
+
elif [ "$status" -eq 1 ]; then
|
|
77
|
+
echo "ok no --task-id compose-commit in README.md or skills"
|
|
78
|
+
else
|
|
79
|
+
echo "FAIL grep could not run"
|
|
80
|
+
fi
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
3. Every option the two references name is registered in the built CLI. Build first (`pnpm run build`), then run:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
check() {
|
|
87
|
+
local command="$1"; shift
|
|
88
|
+
for option in "$@"; do
|
|
89
|
+
node ./dist/cli.js $command --help | grep -q -- "$option" && echo "ok $command $option" || echo "FAIL $command $option is missing"
|
|
90
|
+
done
|
|
91
|
+
}
|
|
92
|
+
check "proposal get" --session-id --wait --timeout --interval --grace --json
|
|
93
|
+
check "proposal messages" --session-id --last --json
|
|
94
|
+
check "hagitask get" --session-id --wait --timeout --interval --grace --json
|
|
95
|
+
check "hagitask messages" --session-id --last --json
|
|
96
|
+
check "hagitask create" --prompt-id --repository-path --need-push --pull-rebase --target-branch-mode --target-branch-name
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
4. Both references have a "Who drives each step" section and both name `--wait`. Each count must be at least `1`:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
grep -c "Who drives each step" skills/hagi/references/openspec-workflow.md skills/hagi/references/super-commit.md
|
|
103
|
+
grep -l -- "--wait" skills/hagi/references/openspec-workflow.md skills/hagi/references/super-commit.md
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Built-in copy consistency check
|
|
107
|
+
|
|
108
|
+
The embedded skill exists twice: `repos/cli/skills/hagi` is the only place it is edited, and `repos/built-in-skills/content/hagi` is the copy the server ships as the built-in `hagi` skill. Run this from the monorepo root to confirm the two match:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
diff -r repos/cli/skills/hagi repos/built-in-skills/content/hagi
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The expected result is no output, which means the folders are identical. Any output names a file that differs, is missing from one side, or is extra on one side.
|
|
115
|
+
|
|
116
|
+
- If the check reports a difference, fix it by editing only `repos/cli/skills/hagi`. Never edit the bundle copy by hand.
|
|
117
|
+
- Refreshing the bundle copy and its content hash is a separate follow-up in the bundle repository. It is not part of a CLI change, and a skill change leaves the check reporting differences until that follow-up runs.
|
|
118
|
+
- After the repository scope edit, the bundle copy must be recopied from `repos/cli/skills/hagi` and its hash refreshed. Doing that needs write access to `repos/built-in-skills`. Until then, sessions that load the built-in `hagi` skill run the older text, with no `project repositories` guidance.
|
|
119
|
+
- In a standalone CLI checkout the bundle is not beside the CLI. Replace `repos/built-in-skills/content/hagi` with the path to the `content/hagi` folder of a checked-out built-in skills bundle, for example `<path-to-built-in-skills>/content/hagi`.
|
|
120
|
+
|
|
121
|
+
## Maintainer validation commands
|
|
122
|
+
|
|
123
|
+
When command behavior, metadata, or packaging changes are involved, run the smallest relevant subset:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
cd repos/cli
|
|
127
|
+
pnpm run build
|
|
128
|
+
pnpm run typecheck
|
|
129
|
+
pnpm test
|
|
130
|
+
node ./dist/cli.js --help
|
|
131
|
+
node ./dist/cli.js proposal --help
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
If only a specific command changed, also verify that command's help directly.
|
|
135
|
+
|
|
136
|
+
## Package publish-surface check
|
|
137
|
+
|
|
138
|
+
Run this only when `package.json`, publish contents, or release metadata changed:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
cd repos/cli
|
|
142
|
+
pnpm run pack:check
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The npm tarball ships `dist` and `README.md` only (`package.json` `files`), so `skills/**` is not in the package. The skill reaches users through the repository and the server's built-in skill copy, not through npm. Change `files` only if that decision changes.
|