Commit graph

8 commits

Author SHA1 Message Date
Parfii-bot
1b382b7fca feat(hooks): site-wysiwyd-check PostToolUse(Edit|Write) drift advisory 2026-04-21 21:33:11 +08:00
Parfii-bot
cc8d1868be feat(hooks): agent-fork-logger PreToolUse:Agent
Advisory hook (RULE 0.12). Reads Agent tool_input JSON from stdin, hashes
the prompt (SHA-256 first 16), derives agent id and branch per isolation
mode, emits kei-ledger fork row.

NEVER blocks: every exit path is exit 0. Missing jq / kei-ledger / git
= silent no-op. Advisory because isolation=false trivial agents are
expected to slip through (RULE 0.12 Exceptions 1-2).

Constructor Pattern: 51 LOC, POSIX sh, chmod +x.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 20:52:29 +08:00
Parfii-bot
d155afc554 fix(audit-m): tomd cache path-salt; bridges respects rollback; rollback rm-rf guard; placeholder URLs; research skill role-tag note; stack frontend-gap doc
- M1 (RULE 0.4): replace fabricated URLs 'https://example.invalid/PROJECT-D'
  and 'https://…/PROJECT-D' with plain text ('user's personal CLI predecessor').
- M2: tomd-preread cache key = basename + mtime + 8-char shasum of full path,
  so two files with the same basename+mtime at different paths no longer
  collide. Portable shasum shim; falls back to 'nohash' if shasum absent.
- M3: install.sh --with-bridges gated on ROLLED_BACK=0 so bridges are NOT
  emitted into $PWD after an ERR-trap rollback.
- M4: rollback() guards rm -rf "$orig" behind an existence check.
- M5: skills/research/SKILL.md front-matter note — role tags like
  'web-researcher' / 'meta-critic' are ad-hoc prompt labels for the generic
  kei-researcher subagent, NOT separate manifests. Prevents fruitless
  grep in _manifests/.
- M6: README adds a 'Frontend-stack coverage gap' callout listing the
  planned-but-not-shipped frameworks (React-Vite, Vue-Nuxt, SvelteKit,
  Astro, Angular, plain-web).
- M7: no-hand-edit-agents.sh documents at case block that the GENERATED
  marker is the SOLE source of truth — legacy unmarked .md files pass
  silently by design; re-run the assembler to adopt them.
2026-04-21 20:09:24 +08:00
Parfii-bot
2e8c8acced feat(hooks): tomd-preread PreToolUse(Read) auto-convert hook
POSIX sh hook (50 LOC) that intercepts Read on .docx/.doc/.xlsx/.pptx/.csv
and auto-redirects Claude to a cached markdown conversion via the tomd
primitive.

- jq absence → exit 0 (graceful degrade, matches assemble-validate style)
- tomd primitive missing → exit 0 (don't block)
- cache dir via KEISEI_TOMD_CACHE env (default /tmp/keisei-tomd-cache)
- cache key = basename + mtime, portable stat for macOS/Linux
- exit 2 with [tomd-preread] stderr message on successful conversion
- conversion failure → exit 0 (let Claude try original, fail naturally)

Not wired into settings-snippet.json yet — follow-up commit adds the
PreToolUse(Read) entry alongside install.sh hooks-copy loop extension.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 19:43:21 +08:00
Parfii-bot
ef4d573e81 fix(hooks): surface FAIL lines unconditionally on agent rebuild
Previous block-rebuild path piped through head -40, so a FAIL on line 50
was invisible. Now FAIL/ERROR lines are always printed first; OK lines
are still truncated. Written in POSIX sh per Fix 4.
2026-04-21 04:11:30 +08:00
Parfii-bot
33192a06e0 refactor(hooks): port to POSIX sh
All three hooks changed shebang from bash to sh. No bashisms were in use
(no [[, no local, no arrays) so only the interpreter line moved. Verified
with sh -n, and dash smoke-run with a sample tool_input JSON.
2026-04-21 03:46:18 +08:00
Parfii-bot
16d4b48c77 fix(hooks): guard against missing jq; drop UUOC
All three hooks used `set -eu` + `cat | jq …`. Without jq installed, jq
would fail and `-e` would abort the hook → non-zero exit → Claude Code
refuses Edit/Write/Bash system-wide. Now each hook probes for jq BEFORE
`set -eu` and exits 0 silently if absent. Also dropped the useless `cat |`
pipe — `jq -r` reads stdin directly.

Companion: install.sh jq check upgraded from warn to hard `exit 1` because
without jq the hooks are dead weight; message states jq is required on
any machine that will activate the hooks.
2026-04-21 02:55:07 +08:00
denis
0b901cf2f9 feat: KeiSeiKit v0.1.0 — initial public release
Generic Constructor-Pattern agent kit for Claude Code. Zero personal data,
fully English, MIT-licensed.

Contents:
- 34 reusable blocks (baseline, rules, stack/deploy/domain/api/scraper)
- 14 cross-project agent manifests (code/ml/infra/researcher/critic/...)
- 6 portable skills (/new-agent, /research, /test-gen, /debug-deep, /pr-review, /refactor)
- Rust assembler (single binary, ~500 KB)
- 3 hooks (auto-reassemble, pre-commit validate, no-hand-edit)
- install.sh (idempotent, cargo-builds on first run)
- MIT LICENSE

All 6 sanity greps pass: 0 Russian text, 0 specific project names,
0 incident numbers, 0 user paths, 0 hardcoded IPs, 0 API keys.

cargo check + assemble --validate: both pass on 14 manifests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 23:58:34 +08:00