Commit graph

39 commits

Author SHA1 Message Date
Parfii-bot
cab78d68f7 Merge branch 'feat/v0.13-deep-sleep' — NREM deep-sleep pipeline + store trait (5 backends) 2026-04-22 08:50:09 +08:00
Parfii-bot
88a59f017f feat(integration): deep-sleep wired into MANIFEST + sleep-setup Phase 3b + README 2026-04-22 08:28:22 +08:00
Parfii-bot
293e96af5d feat(skills): /onboard auto-project-analyze with 3-mode apply (full-auto/step-by-step/full-manual) 2026-04-22 04:22:20 +08:00
Parfii-bot
3d928b41db feat(skills): /sleep-on-it 6-phase wizard + kei-sleep-queue CRUD + incubation prompt
Priority-scaled time budgets (quick/standard/deep/marathon/weekly),
marathon-mode for hard derivations (skips Phase B REM for one task),
checkpointing every N minutes via partial commits.
2026-04-22 02:30:04 +08:00
Parfii-bot
8e9c05272f feat(skills): /sleep-setup 5-phase wizard (click + 1 free-text URL) 2026-04-22 01:34:42 +08:00
Parfii-bot
139d2f0325 feat(skills): /self-audit 5-phase triage pipeline 2026-04-22 00:50:04 +08:00
Parfii-bot
7bffcdf037 docs(compose-solution): prior-art grep paths + phase-5 cross-refs for 10 pipelines + 21 primitives 2026-04-21 21:33:11 +08:00
Parfii-bot
c89352c87c Merge branch 'feat/frontend-v040' — 4 stacks + 3 Rust + 5 shell + 17 skills + /site-create (partial)
Cargo.lock regenerated after 8-crate workspace merge.
2026-04-21 21:17:19 +08:00
Parfii-bot
19850e1a45 Merge branch 'feat/v0.5-vm-security' — 7 blocks + 3 shell + 2 Rust + /vm-provision
Workspace Cargo.toml reconciled: all 8 crates (kei-ledger, kei-migrate, kei-changelog, ssh-check, firewall-diff, mock-render, visual-diff, tokens-sync) as members.
2026-04-21 21:15:49 +08:00
Parfii-bot
e5d565a11e Merge branch 'feat/v0.7-docs' — 5 blocks + kei-docs-scaffold + kei-changelog Rust + /docs-scaffold 2026-04-21 21:15:05 +08:00
Parfii-bot
f205a12348 Merge branch 'feat/v0.6-database' — 5 blocks + kei-migrate Rust + /schema-design 2026-04-21 21:14:50 +08:00
Parfii-bot
62e28450bc Merge branch 'feat/rule-0.12-agent-git-model' — kei-ledger Rust + hook + /new-project 2026-04-21 21:13:40 +08:00
Parfii-bot
0081bc8f46 Merge branch 'feat/v0.7-auth-iam' — 4 blocks + /auth-setup 2026-04-21 21:11:39 +08:00
Parfii-bot
6d382ee939 Merge branch 'feat/v0.7-api-design' — 4 blocks + /api-design 2026-04-21 21:11:17 +08:00
Parfii-bot
5d61866618 Merge branch 'feat/v0.6-cicd' — 4 blocks + kei-ci-lint + /ci-scaffold 2026-04-21 21:11:17 +08:00
Parfii-bot
40d11e7dac Merge branch 'feat/v0.7-testing-matrix' — 4 blocks + /test-matrix 2026-04-21 21:11:17 +08:00
Parfii-bot
5d5362db3e feat(skills): /site-create pipeline (phases 0-4 — phases 5-6 deferred) 2026-04-21 21:08:14 +08:00
Parfii-bot
fd81aae515 feat(skills): port 17 generic frontend skills from ~/.claude/skills/ (a11y-audit, design-system, figma-to-code, form-builder, frontend-design, landing-page, motion-design, perf-audit, responsive-audit, scroll-animation, seo-audit, site-builder, site-teardown, ui-component, web-assets, web-deploy, web-effects) 2026-04-21 21:08:14 +08:00
Parfii-bot
63b6b07c06 feat(skills): /docs-scaffold 5-phase pipeline 2026-04-21 21:01:28 +08:00
Parfii-bot
eee5eecc20 feat(skills): /vm-provision 6-phase pipeline
Hub-and-spoke skill:
- SKILL.md (index) + phase-1-select-provider, phase-2-plan,
  phase-3-provision, phase-4-harden, phase-5-verify, phase-6-handoff.

Pipeline: select provider → Plan Mode doc → provision (hetzner/vultr
primitives, SSH first-contact TOFU) → harden-base.sh over SSH →
ssh-check + firewall-diff HARD GATE → artefact ledger + optional
/web-deploy handoff.

Invariants:
- ≥ 6 AskUserQuestion calls (Phase 1×2, 2×1, 3×1, 4×1, 5×1).
- Hard gate: Phase 6 refuses to run unless ssh-check AND firewall-diff
  both exit 0. "Ignore and proceed" is BLOCKED by design.
- RULE 0.8 (secrets ENV-ref only), RULE 0.4 (cite provider specifics),
  RULE 0.5 (plan.md written to <run-dir>/plan.md before provisioning),
  RULE -1 (every failure branch returns 2-3 constructive paths).

Defensive-only — no scanning tools, no CVE probes, no third-party
attack-surface analysis. Every phase file ≤ 200 LOC per Constructor
Pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 21:00:14 +08:00
Parfii-bot
cd7a983f98 feat(skills): /ci-scaffold 5-phase pipeline 2026-04-21 20:56:24 +08:00
Parfii-bot
2262cc3f69 feat(skills): /api-design 6-phase pipeline 2026-04-21 20:54:54 +08:00
Parfii-bot
4178147b0f feat(skills): /new-project 4-phase pipeline
Hub-and-spoke orchestrator for RULE 0.12 at project scale. SKILL.md
indexes 4 phase files: intake, fork-skeleton, parallel-exec, merge-
ceremony.

Flow:
  Phase 1 — 1 free-text line (GOAL) + 1 batch of 5 AskUserQuestion
            (type, theory, fanout, main-agent, DB mode).
  Phase 2 — project/<slug> branch, kei-ledger fork root, theoretical
            sub-agent spawn confirmation click.
  Phase 3 — poll kei-ledger list --status running, aggregate
            progress.json, steering click (continue / add / kill /
            merge / pause).
  Phase 4 — kei-ledger validate per bundle, per-branch merge verdict
            click (merge --no-ff / squash / reject / defer), final
            integration + NO-DOWNGRADE close click if any rejected /
            deferred.

>=6 AskUserQuestion calls minimum (1 batch Phase 1 + 1 Phase 2 + 1
Phase 3 + >=2 per-branch Phase 4 + 1 close).

Constructor Pattern: SKILL.md 109 LOC, phase files 80-108 LOC each —
all under 150 LOC.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 20:52:49 +08:00
Parfii-bot
505e727dcf feat(skills): /auth-setup 5-phase pipeline
Hub-and-spoke skill that converts "I need auth for app X" into a
reviewable plan across 5 phases: intake (flows/stack/storage/MFA),
identity-provider pick + env scaffold, session strategy + cookies,
authorization model + permission matrix, and threats + mitigations.

- 8 AskUserQuestion calls total (≥6 hub-and-spoke contract; 4 in Phase 1
  + 1 each in Phases 2–5).
- Reads all four _blocks/auth-*.md; never writes production code or
  secret values.
- RULE 0.8 (Secrets SSoT): emits env VARIABLE NAMES only; storage path
  is secrets/auth.env per domain-has-secrets.md.
- Constructor Pattern: 6 files, largest 115 LOC (<200 limit).
- Fail-closed default + NO DOWNGRADE on unsafe combinations
  (passkey-only without recovery → return recovery-path options, not
  "not supported").

Evidence grade [E2] — pipeline mirrors OWASP ASVS v4.0.3 chapters 2–4.
2026-04-21 20:47:21 +08:00
Parfii-bot
c10e169806 feat(skills): /schema-design 5-phase pipeline
Hub-and-spoke skill that converts "I need a database for app X" into a
designed relational schema + first migration + optional seed.

Pipeline (5 phases, 9 AskUserQuestion calls total, pure-click after intake):
- Phase 1 — batched DB/ORM/scale/style/migration-control click
- Phase 2 — entity list + relations matrix (auto-junction tables)
- Phase 3 — generate DDL with indexes, FKs, constraints; review/revise loop
- Phase 4 — scaffold migrations/ + first timestamped migration + kei-migrate wiring
- Phase 5 — optional seed (smoke / rich / test fixtures / skip)

Cross-refs the five db-* blocks + the kei-migrate Rust primitive added in
commits f884891 and df85792 on this branch. Emits ENV-VAR NAMES only for
DATABASE_URL (RULE 0.8 secrets SSoT). Every file ≤ 121 LOC.
2026-04-21 20:46:32 +08:00
Parfii-bot
56ddccfddb feat(skills): /test-matrix 5-phase pipeline
Adds hub-and-spoke testing-matrix skill complementing /test-gen:
SKILL.md index + phase-1-intake (language/coverage/critical/CI),
phase-2-matrix (test-type × language multi-select), phase-3-scaffold
(config + corpus + fixtures per cell), phase-4-ci-wire (per-type
failure policy + artifacts), phase-5-triage (crash/regression runbook).
Cross-refs _blocks/test-fuzz.md, test-property.md, test-load.md,
test-e2e.md. Adds "complements" note to skills/test-gen/SKILL.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 20:46:02 +08:00
Parfii-bot
0d3b4efd30 feat(skills): /observability-setup 5-phase pipeline 2026-04-21 20:41:17 +08:00
Parfii-bot
ab70b8344d fix(audit-l): agent count drift in install.sh and compose-solution
- L1: install.sh post-install banners '~14 generated agents' → '12 generated agents'
  (both the activated-path and the manual-merge-path copies).
- L2: skills/compose-solution/SKILL.md handoff reference '14 kit agents' → '12 kit agents'.
- L3: README /new-agent section rephrases 'via option-pickers' to call out that
  the 6 questions are grouped into multiple option-picker batches (two
  AskUserQuestion calls) rather than six separate prompts.
2026-04-21 20:10:04 +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
a23cde32a8 fix(audit-h2,h3): remove bare-name bypass in compose-solution phase-2; backup settings.json in activate_hooks
- phase-2-decompose.md: delete 'or researcher if that agent is present in the user's
  global fleet' clause that silently bypassed the kei-namespace. Replace with an
  explicit prefer-kei note warning that bare 'researcher' matches only the user's
  personal fleet and may have divergent handoffs.
- install.sh activate_hooks(): call backup_file "$target" on the merge path
  (after the 'create new' early-return) so ERR-trap rollback can restore the
  pre-merge settings.json. Previously an ERR in the jq-merge or mv left no
  backup pair to restore.
2026-04-21 20:07:42 +08:00
Parfii-bot
a9abc6cace docs: primitives section + compose-solution phase-3/5 cross-refs
- README.md: new 'Primitives' section between Cross-tool bridges and
  Meta-composer. Explains _primitives/ vs _blocks/, lists tomd, names
  the PreToolUse(Read) hook, notes /compose-solution auto-discovery
- phase-3-prior-art.md: extend grep target list to include _primitives/
- phase-5-architecture.md: one-paragraph note on referencing tomd
  primitive instead of rolling custom binary-format parsing (reuse
  over rewrite)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 19:45:20 +08:00
Parfii-bot
a103614c46 refactor(compose-solution): remove patent examples from phase files
After merging feat/compose-solution, 3 phase files still referenced
patent-scale research / patent block suffix / sensitive IP question. Strip
those generic-kit-incompatible examples:
- phase-2-decompose.md: "patent-scale" → "deep-domain"
- phase-6-block-augment.md: "<slug>-patent" disambiguator → "<slug>-embedded"
- phase-7-assemble.md: drop sensitive IP from fields passed to new-agent wizard

Final grep for "patent" in main tree: zero hits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 19:13:02 +08:00
Parfii-bot
4e8542a0d5 Merge branch 'feat/compose-solution' into refactor/drop-restricted agents 2026-04-21 19:10:42 +08:00
Parfii-bot
4859e1cdf7 refactor: remove restricted-scope agents and blocks from public kit
Strip all patent-related tooling from the generic kit so it can ship
publicly under MIT without leaking sensitive IP. restricted-scope agents,
blocks, and skill conditionals live in the private PROJECT-E.

Deleted (5 files):
- _manifests/kei-patent-compliance.toml
- _manifests/kei-patent-researcher.toml
- _blocks/domain-sensitive IP-aware.md
- _assembler/tests/fixtures/_manifests/kei-patent-compliance.toml
- _assembler/tests/snapshots/kei-patent-compliance.snap

Cross-reference cleanup:
- 6 manifests: remove kei-patent-* handoffs and "sensitive IP" forbidden lines
- _blocks/deploy-local-only.md: drop sensitive IP rationale, keep ML weights /
  offensive / kernel / client-confidential banned-public triggers
- skills/research/SKILL.md: drop patent-angle-scanner + "Patent angles" section
- skills/new-agent/SKILL.md: drop Q5 (patent), renumber Q6→Q5 Q7→Q6
- README.md: drop 2 restricted agents rows, renumber wizard questions 5-7→5-6,
  update counts 34→33 blocks / 14→12 agents
- _assembler/tests/golden.rs: remove golden_patent_compliance test
- _assembler/tests/roundtrip.rs: swap kei-patent-compliance fixture to
  kei-cost-guardian for double-assembly determinism test
- _assembler/tests/fixtures/_manifests/kei-researcher.toml + snapshot:
  remove kei-patent-researcher handoff

Tests: 21 → 20 integration tests, all passing. Grep for "patent" in
main tree returns zero hits outside .claude/worktrees.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 19:07:02 +08:00
Parfii-bot
5c2dc98d54 feat(compose-solution): meta-orchestrator skill for 7-phase artefact creation
Adds a pure-click meta-composer that converts a free-text task description
into the right durable KeiSeiKit artefact — agent, skill, hook, rule, or
block — by composing existing primitives:

- Phase 1 intake (one free-text DESC + target-type click)
- Phase 2 wave-based decomposition (delegates to /research for heavy tasks)
- Phase 3 prior-art grep sweep across _blocks/, _manifests/, skills/,
  _bridges/, hooks/ + optional PROJECT-E + external docs
- Phase 4 gap analysis (AskUserQuestion multi-select)
- Phase 5 math-first architecture proposal (derive-first, "what is
  unnecessary" pass, Constructor-Pattern check)
- Phase 6 block augmentation — drafts + persists new _blocks/<slug>.md
  on user click; kit gets smarter each session
- Phase 7 recipe assembly — branches by type, hands off to /new-agent
  (agent) or /escalate-recurrence (hook / rule)

Split into SKILL.md (121-LOC index) + seven phase-*.md files (each <160
LOC) to stay under the 500-LOC/file Constructor-Pattern limit. Minimum 6
AskUserQuestion calls per session enforced by the pipeline; every
referenced block / skill / manifest / bridge path verified to exist on
disk before commit (RULE 0.4 — no fabricated references).

Writes only to _blocks/<slug>.md and skills/<slug>/SKILL.md;
handoffs to /new-agent and /escalate-recurrence own their own files.
2026-04-21 18:22:00 +08:00
Parfii-bot
6feefc6bfb feat(new-agent): Phase 8 optional cross-tool bridges
- Insert Phase 8 between Phase 6 (Report) and Phase 7 (setup)
- Single AskUserQuestion with 3 options: all 11 / AGENTS.md only / skip
- On accept: invoke ~/.claude/agents/_bridges/emit.sh with the
  project path from Phase 2 (optionally --only AGENTS.md)
- On skip: print the exact command the user can run later
- All paths idempotent (emit.sh skips existing files)
2026-04-21 14:46:55 +08:00
Parfii-bot
2b478ce2b6 feat(new-agent): final-name confirmation with kei- default + override
Wizard's Phase 3 previously computed a deterministic `<slug>-specialist`
name and wrote it directly. Now:

- Phase 3 composition step states the PROPOSED default: `kei-<slug>-specialist`
  (matches the KeiSeiKit kit-prefix convention introduced in commit 3039ada).
- NEW Phase 3.5: one AskUserQuestion call with three options:
  1. `kei-<slug>-specialist` (default, kit convention)
  2. `<slug>-specialist`     (user namespace, no kei- prefix)
  3. Specify custom name    (free-text with strict validation:
     regex ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$, length 3-40, no --, no
     leading/trailing dash; no auto -specialist suffix)
- Resolved value stored as FINAL_NAME and threaded through Phase 4
  (manifest Write path), Phase 5 (--validate + --in-place assemble args),
  and Phase 6 (report block + git-commit example).
- Phase 2 prompt updated to reflect the confirmation step.
- Invalid custom-name input re-asks instead of falling through (constructive-
  only rule).

Touches only skills/new-agent/SKILL.md. The installed ~/.claude/skills/new-agent/
copy will be refreshed on the next `./install.sh` run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 14:07:28 +08:00
Parfii-bot
1a4a25a540 refactor(skills): update agent references in 2 skills to kei- prefix
Mechanical rename of all 14 kit-agent references in skills/*/SKILL.md.
Pattern: word-boundary match that excludes "-" on both sides, applied
longest-first so "ml-researcher" rewrites before "researcher" (avoids
the "kei-ml-kei-researcher" double-prefix trap).

skills/new-agent/SKILL.md (14 refs):
  - Phase 3.3 handoff list (code-implementer/critic/validator mandatory,
    cost-guardian/ml-implementer/ml-researcher/infra-implementer/
    security-auditor conditional)
  - Phase 3.5 role-template example (Hand off ... to code-implementer ...)
  - Phase 4 manifest-template example (target = "code-implementer" etc.)
  - Phase 6 report-block example ("Handoffs: code-implementer, critic, ...")
  - Description-string ref on Phase 1b (cost-guardian mandatory)

skills/research/SKILL.md (5 refs):
  - `critic` renamed to `kei-critic` inside backticks and bold
  - Teammate-role mentions that happen to share the name
  - NOTE: hyphenated compound labels like `web-researcher`, `code-explorer`,
    `{component}-critic`, `meta-critic` are left untouched — they are
    ad-hoc teammate-role labels, not kit-agent handoffs. The boundary rule
    (no "-" immediately before the name) preserves them correctly.

Other 4 skills (debug-deep, pr-review, refactor, test-gen) have zero
kit-agent references — untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 13:38:03 +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