@vpxa/aikit 0.1.141 → 0.1.142

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.
@@ -104,7 +104,7 @@ knowledge({ action: "list", category: "conventions" }) // see project convention
104
104
  scope_map("what you need") // generates a reading plan
105
105
 
106
106
  // If running as sub-agent with flow context:
107
- knowledge({ action: "withdraw", profile: "<your-role>", budget: 6000 }) // get pre-analyzed context from prior agents
107
+ knowledge({ action: "withdraw", scope: "flow", profile: "<your-role>", budget: 6000 }) // get pre-analyzed context from prior agents
108
108
  \`\`\`
109
109
 
110
110
  **Rules:**
@@ -113,13 +113,9 @@ knowledge({ action: "withdraw", profile: "<your-role>", budget: 6000 }) // get
113
113
  - If no results → proceed, but **persist your decisions with \`knowledge({ action: "remember", ... })\`** afterward for future recall.
114
114
  - Never assume "there's nothing stored" — always search first.
115
115
 
116
- ### Step 3: Real-time Exploration (only
117
- if steps 1-2
118
- don;
119
- 't cover it)
116
+ ### Step 3: Real-time Exploration (only if steps 1-2 don't cover it)
120
117
 
121
- | Tool | Use
122
- for |
118
+ | Tool | Use for |
123
119
  |---|---|
124
120
  | \`graph({ action: 'neighbors', node_id })\` | Traverse module import graph — cross-package dependencies, who-imports-whom |
125
121
  | \`find({ pattern })\` | Locate files by name/glob |
@@ -140,7 +136,7 @@ If unsure which AI Kit tool to use → run \`guide({ topic: "what you need" })\`
140
136
  1. If the Orchestrator provided FORGE tier in your prompt, use it. Otherwise, run \`forge_classify\` to determine tier.
141
137
  2. **Floor tier** → implement directly, no evidence map needed.
142
138
  3. **Standard/Critical tier** → Use \`evidence_map\` to track each critical-path claim as V/A/U during your work.
143
- 4. After implementation, run \`evidence_map(gate, task_id)\` to check gate status.
139
+ 4. After implementation, add final evidence entries. The Orchestrator will run the gate.
144
140
  5. Use \`stratum_card\` for quick file context instead of reading full files. Use \`digest\` to compress accumulated context.
145
141
 
146
142
  ---
@@ -445,41 +441,17 @@ Always return this structure when invoked as a sub-agent:
445
441
  \`\`\`
446
442
  `,"researcher-base":`# Researcher — Shared Base Instructions
447
443
 
448
- > Shared methodology
449
- for all Researcher variants. Each variant
450
- 's definition contains only its unique identity and model assignment. **Do not duplicate.**
444
+ > Shared methodology for all Researcher variants. Each variant's definition contains only its unique identity and model assignment. **Do not duplicate.**
451
445
 
452
446
 
453
447
  ## MANDATORY FIRST ACTION
454
448
 
455
449
  Follow the **MANDATORY FIRST ACTION** and **Information Lookup Order** from code-agent-base:
456
- 1. Run \`status(
457
- {
458
- }
459
- )\` — check Onboard Status and note the **Onboard Directory** path
460
- 2. If onboard shows Run \`onboard(
461
- {
462
- path: '.';
463
- }
464
- )\` and wait
465
- for completion
466
- 3. If onboard
467
- shows;
468
- ✅ → Read relevant onboard artifacts
469
- using;
470
- \`compact(
471
- {
472
- path: '<Onboard Directory>/<file>';
473
- }
474
- )\` before exploring
475
-
476
- **Start
477
- with pre-analyzed artifacts.** They
478
- cover;
479
- 80 % +of;
480
- common;
481
- research;
482
- needs.
450
+ 1. Run \`status({})\` — check Onboard Status and note the **Onboard Directory** path
451
+ 2. If onboard shows ❌ → Run \`onboard({ path: '.' })\` and wait for completion
452
+ 3. If onboard shows ✅ → Read relevant onboard artifacts using \`compact({ path: '<Onboard Directory>/<file>' })\` before exploring
453
+
454
+ **Start with pre-analyzed artifacts.** They cover 80%+ of common research needs.
483
455
 
484
456
  ## Flow Context Bootstrap
485
457
 
@@ -487,7 +459,7 @@ When dispatched as a subagent within an active flow:
487
459
 
488
460
  1. **Withdraw context first** — before any search or file reads:
489
461
  \`\`\`
490
- knowledge({ action: 'withdraw', profile: 'researcher', budget: 6000 })
462
+ knowledge({ action: 'withdraw', scope: 'flow', profile: 'researcher', budget: 6000 })
491
463
  \`\`\`
492
464
  This returns pre-analyzed context from prior agents.
493
465
 
@@ -502,17 +474,9 @@ When dispatched as a subagent within an active flow:
502
474
 
503
475
  ---
504
476
 
505
- #
506
- #
507
- Research;
508
- Methodology;
509
-
510
- #
511
- #
512
- #
513
- Phase;
514
- 1;
515
- : AI Kit Recall (BLOCKING)
477
+ ## Research Methodology
478
+
479
+ ### Phase 1: AI Kit Recall (BLOCKING)
516
480
  \`\`\`
517
481
  search("task keywords")
518
482
  scope_map("what you need to investigate")
@@ -611,34 +575,15 @@ For questions that require trying approach A vs approach B in isolation:
611
575
  6. Include the diff summary in your output; do NOT merge lanes back (read-only role)
612
576
  `,"code-reviewer-base":`# Code-Reviewer — Shared Base Instructions
613
577
 
614
- > Shared methodology
615
- for all Code-Reviewer variants. Each variant
616
- 's definition contains only identity and model. **Do not duplicate.**
578
+ > Shared methodology for all Code-Reviewer variants. Each variant's definition contains only identity and model. **Do not duplicate.**
617
579
 
618
580
 
619
581
  ## MANDATORY FIRST ACTION
620
582
 
621
583
  Follow the **MANDATORY FIRST ACTION** and **Information Lookup Order** from code-agent-base:
622
- 1. Run \`status(
623
- {
624
- }
625
- )\` — check Onboard Status and note the **Onboard Directory** path
626
- 2. If onboard shows ❌ → Run \`onboard(
627
- {
628
- path: '.';
629
- }
630
- )\` and wait
631
- for completion
632
- 3. If onboard
633
- shows;
634
- ✅ → Read relevant onboard artifacts
635
- using;
636
- \`compact(
637
- {
638
- path: '<Onboard Directory>/<file>';
639
- }
640
- )\` — especially \`patterns.md\` and \`api-surface.md\`
641
- for review context
584
+ 1. Run \`status({})\` — check Onboard Status and note the **Onboard Directory** path
585
+ 2. If onboard shows ❌ → Run \`onboard({ path: '.' })\` and wait for completion
586
+ 3. If onboard shows ✅ → Read relevant onboard artifacts using \`compact({ path: '<Onboard Directory>/<file>' })\` — especially \`patterns.md\` and \`api-surface.md\` for review context
642
587
 
643
588
  ## Flow Context Bootstrap
644
589
 
@@ -646,7 +591,7 @@ When dispatched as a subagent within an active flow:
646
591
 
647
592
  1. **Withdraw context first** — before any search or file reads:
648
593
  \`\`\`
649
- knowledge({ action: 'withdraw', profile: 'reviewer', budget: 6000 })
594
+ knowledge({ action: 'withdraw', scope: 'flow', profile: 'reviewer', budget: 6000 })
650
595
  \`\`\`
651
596
  This returns pre-analyzed context from prior agents.
652
597
 
@@ -661,97 +606,40 @@ When dispatched as a subagent within an active flow:
661
606
 
662
607
  ---
663
608
 
664
- #
665
- #
666
- Review;
667
- Workflow;
668
-
669
- 1 ** AI;
670
- Kit;
671
- Recall** —
672
- \`search("conventions relevant-area")\` + \`knowledge({ action: "list" })\`
673
- for past review findings, patterns
674
- 2. **Blast
675
- Radius** —
676
- \`blast_radius\` on changed files to understand impact
609
+ ## Review Workflow
610
+
611
+ 1. **AI Kit Recall** — \`search("conventions relevant-area")\` + \`knowledge({ action: "list" })\` for past review findings and patterns
612
+ 2. **Blast Radius** — \`blast_radius\` on changed files to understand impact
677
613
  3. **FORGE Classify** — \`forge_classify\` to determine review depth
678
614
  4. **Review** — Evaluate against all dimensions below
679
615
  5. **Validate** — Run \`check\` (typecheck + lint) and \`test_run\`
680
- 6. **Report** — Structured findings
681
- with verdict
682
- 7. **Persist** —
683
- \`knowledge(
684
- {
685
- action: "remember",
686
- title: 'Review: <finding>', content;
687
- : "<details>", category: "patterns"
688
- }
689
- )\`
690
- for any new patterns, anti-patterns, or recurring issues
691
- found;
692
-
693
- #
694
- #
695
- Review;
696
- Dimensions | Dimension | What;
697
- to;
698
- Check |
616
+ 6. **Report** — Structured findings with verdict
617
+ 7. **Persist** — \`knowledge({ action: "remember", title: 'Review: <finding>', content: "<details>", category: "patterns" })\` for any new patterns, anti-patterns, or recurring issues found
618
+
619
+ ## Review Dimensions
620
+
621
+ | Dimension | What to Check |
699
622
  |-----------|---------------|
700
- | **Correctness** | Logic
701
- errors, off - by - one, null;
702
- handling, async/await |
703
- | **Security** | OWASP
704
- Top;
705
- 10, input;
706
- validation, secrets;
707
- exposure |
708
- | **Performance** | N+1
709
- queries, unnecessary;
710
- allocations, missing;
711
- caching |
712
- | **Maintainability** | Naming, complexity, DRY, single
713
- responsibility |
714
- | **Testing** | Coverage
715
- for new/changed logic, edge cases |
716
- | **Patterns** | Consistency with existing codebase
717
- conventions |
718
- | **Types** | Proper
719
- typing, no;
720
- \`any\`, generics where useful |
623
+ | **Correctness** | Logic errors, off-by-one, null handling, async/await |
624
+ | **Security** | OWASP Top 10, input validation, secrets exposure |
625
+ | **Performance** | N+1 queries, unnecessary allocations, missing caching |
626
+ | **Maintainability** | Naming, complexity, DRY, single responsibility |
627
+ | **Testing** | Coverage for new/changed logic, edge cases |
628
+ | **Patterns** | Consistency with existing codebase conventions |
629
+ | **Types** | Proper typing, no \`any\`, generics where useful |
721
630
 
722
631
  ## Output Format
723
632
 
724
633
  \`\`\`markdown
725
- ## Code Review:
726
- {
727
- scope;
728
- }
634
+ ## Code Review: {scope}
729
635
  **Verdict: APPROVED | NEEDS_REVISION | FAILED**
730
- **Severity:
731
- {
732
- count;
733
- by;
734
- level;
735
- }
736
- **
636
+ **Severity: {count by level}**
737
637
 
738
638
  ### Findings
739
- 1. **[SEVERITY]**
740
- {
741
- file;
742
- }
743
- :
744
- {
745
- line;
746
- }
747
- — Description and fix
639
+ 1. **[SEVERITY]** {file}:{line} — Description and fix
748
640
 
749
641
  ### Summary
750
- {
751
- Overall;
752
- assessment, key;
753
- concerns;
754
- }
642
+ {Overall assessment, key concerns}
755
643
  \`\`\`
756
644
 
757
645
  ## Severity Levels
@@ -764,33 +652,19 @@ typing, no;
764
652
  ## Rules
765
653
 
766
654
  - **APPROVED** requires zero CRITICAL/HIGH findings
767
- - **NEEDS_REVISION**
768
- for any HIGH finding
655
+ - **NEEDS_REVISION** for any HIGH finding
769
656
  - **FAILED** for any CRITICAL finding
770
- - Always check
771
- for **test coverage** on new/changed code
772
-
773
- #
774
- #
775
- Evidence;
776
- Citation;
777
- Protocol(tier - aware);
778
-
779
- The;
780
- Orchestrator;
781
- runs;
782
- \`forge_classify\` before dispatching you, and runs the final
783
- \`evidence_map(
784
- {
785
- action: 'gate', task_id;
786
- }
787
- )\` after you respond. **Do not create your own
788
- task_id or run the gate** — feed into the Orchestrator's existing evidence map.
657
+ - Always check for **test coverage** on new/changed code
658
+
659
+ ## Evidence Citation Protocol (tier-aware)
660
+
661
+ **Standalone mode:** If no FORGE task_id was provided in your dispatch prompt, skip \`evidence_map\` calls entirely — provide free-form findings with \`file:line\` citations only.
662
+
663
+ The Orchestrator runs \`forge_classify\` before dispatching you, and runs the final \`evidence_map({ action: 'gate', task_id })\` after you respond. **Do not create your own task_id or run the gate** — feed into the Orchestrator's existing evidence map.
789
664
 
790
665
  | Tier | Your responsibility |
791
666
  |------|---------------------|
792
- | Floor | Free-form findings
793
- with \`file.ts#Lxx\` citations. No \`evidence_map\` calls required. |
667
+ | Floor | Free-form findings with \`file.ts#Lxx\` citations. No \`evidence_map\` calls required. |
794
668
  | Standard | For every CRITICAL or HIGH finding: \`evidence_map({action:'add', task_id, claim, status:'V', receipt:'file.ts#Lxx'})\`. Max 2-4 adds to keep signal high. |
795
669
  | Critical | Structured claims for all CRITICAL/HIGH findings (2-4 Verified + receipts) AND tag contract/security claims with \`safety_gate:'commitment'\` or \`safety_gate:'provenance'\`. |
796
670
 
@@ -806,34 +680,15 @@ Do NOT:
806
680
  - Duplicate findings into the map that weren't CRITICAL/HIGH
807
681
  `,"architect-reviewer-base":`# Architect-Reviewer — Shared Base Instructions
808
682
 
809
- > Shared methodology
810
- for all Architect-Reviewer variants. Each variant
811
- 's definition contains only identity and model. **Do not duplicate.**
683
+ > Shared methodology for all Architect-Reviewer variants. Each variant's definition contains only identity and model. **Do not duplicate.**
812
684
 
813
685
 
814
686
  ## MANDATORY FIRST ACTION
815
687
 
816
688
  Follow the **MANDATORY FIRST ACTION** and **Information Lookup Order** from code-agent-base:
817
- 1. Run \`status(
818
- {
819
- }
820
- )\` — check Onboard Status and note the **Onboard Directory** path
821
- 2. If onboard shows ❌ → Run \`onboard(
822
- {
823
- path: '.';
824
- }
825
- )\` and wait
826
- for completion
827
- 3. If onboard
828
- shows;
829
- ✅ → Read relevant onboard artifacts
830
- using;
831
- \`compact(
832
- {
833
- path: '<Onboard Directory>/<file>';
834
- }
835
- )\` — especially \`structure.md\`, \`dependencies.md\`, and \`diagram.md\`
836
- for architecture context
689
+ 1. Run \`status({})\` — check Onboard Status and note the **Onboard Directory** path
690
+ 2. If onboard shows ❌ → Run \`onboard({ path: '.' })\` and wait for completion
691
+ 3. If onboard shows ✅ → Read relevant onboard artifacts using \`compact({ path: '<Onboard Directory>/<file>' })\` — especially \`structure.md\`, \`dependencies.md\`, and \`diagram.md\` for architecture context
837
692
 
838
693
  ## Flow Context Bootstrap
839
694
 
@@ -841,7 +696,7 @@ When dispatched as a subagent within an active flow:
841
696
 
842
697
  1. **Withdraw context first** — before any search or file reads:
843
698
  \`\`\`
844
- knowledge({ action: 'withdraw', profile: 'reviewer', budget: 6000 })
699
+ knowledge({ action: 'withdraw', scope: 'flow', profile: 'reviewer', budget: 6000 })
845
700
  \`\`\`
846
701
  This returns pre-analyzed context from prior agents.
847
702
 
@@ -856,104 +711,43 @@ When dispatched as a subagent within an active flow:
856
711
 
857
712
  ---
858
713
 
859
- #
860
- #
861
- Review;
862
- Workflow;
863
-
864
- 1 ** AI;
865
- Kit;
866
- Recall** —
867
- \`search("architecture decisions boundaries")\` + \`knowledge({ action: "list" })\`
868
- for past ADRs, patterns
869
- 2. **Analyze** —
870
- \`analyze({ aspect: "structure", ... })\`, \`analyze({ aspect: "dependencies", ... })\`, \`blast_radius\`
714
+ ## Review Workflow
715
+
716
+ 1. **AI Kit Recall** — \`search("architecture decisions boundaries")\` + \`knowledge({ action: "list" })\` for past ADRs and patterns
717
+ 2. **Analyze** — \`analyze({ aspect: "structure", ... })\`, \`analyze({ aspect: "dependencies", ... })\`, \`blast_radius\`
871
718
  3. **Evaluate** — Check all dimensions below
872
- 4. **Report** — Structured findings
873
- with verdict
874
- 5. **Persist** —
875
- \`knowledge(
876
- {
877
- action: "remember",
878
- title: 'Architecture: <finding>', content;
879
- : "<details>", category: "decisions"
880
- }
881
- )\`
882
- for any structural findings, boundary violations, or
883
- design;
884
- insights;
885
-
886
- #
887
- #
888
- Review;
889
- Dimensions | Dimension | What;
890
- to;
891
- Check |
719
+ 4. **Report** — Structured findings with verdict
720
+ 5. **Persist** — \`knowledge({ action: "remember", title: 'Architecture: <finding>', content: "<details>", category: "decisions" })\` for any structural findings, boundary violations, or design insights
721
+
722
+ ## Review Dimensions
723
+
724
+ | Dimension | What to Check |
892
725
  |-----------|---------------|
893
- | **Dependency
894
- Direction** | Dependencies
895
- flow;
896
- inward (domain services infra) |
897
- | **Boundary
898
- Respect** | No
899
- cross - cutting;
900
- between;
901
- unrelated;
902
- packages |
903
- | **SOLID
904
- Compliance** | Single
905
- responsibility, dependency;
906
- inversion |
907
- | **Pattern
908
- Adherence** | Consistent
909
- with established patterns in codebase |
910
- | **Interface
911
- Stability** | Public
912
- APIs;
913
- don;
914
- 't break existing consumers |
726
+ | **Dependency Direction** | Dependencies flow inward (domain ← services ← infra) |
727
+ | **Boundary Respect** | No cross-cutting between unrelated packages |
728
+ | **SOLID Compliance** | Single responsibility, dependency inversion |
729
+ | **Pattern Adherence** | Consistent with established patterns in codebase |
730
+ | **Interface Stability** | Public APIs don't break existing consumers |
915
731
  | **Scalability** | Design handles growth (more data, more users, more features) |
916
732
  | **Testability** | Dependencies injectable, side effects isolated |
917
733
 
918
734
  ## Output Format
919
735
 
920
736
  \`\`\`markdown
921
- ## Architecture Review:
922
- {
923
- scope;
924
- }
737
+ ## Architecture Review: {scope}
925
738
  **Verdict: APPROVED | NEEDS_CHANGES | BLOCKED**
926
739
 
927
740
  ### Boundary Analysis
928
- {
929
- dependency;
930
- direction, package;
931
- boundaries;
932
- }
933
-
934
- #
935
- #
936
- #
937
- Pattern;
938
- Compliance;
939
- {
940
- consistency;
941
- with existing patterns
942
- }
943
-
944
- #
945
- #
946
- #
947
- Findings;
948
- 1 ** ([SEVERITY] ** { description });
949
- — Impact and recommendation
741
+ {dependency direction, package boundaries}
742
+
743
+ ### Pattern Compliance
744
+ {consistency with existing patterns}
745
+
746
+ ### Findings
747
+ 1. **[SEVERITY]** {description} — Impact and recommendation
950
748
 
951
749
  ### Summary
952
- {
953
- Overall;
954
- structural;
955
- assessment;
956
- }
750
+ {Overall structural assessment}
957
751
  \`\`\`
958
752
 
959
753
  ## Rules
@@ -965,18 +759,13 @@ Findings;
965
759
 
966
760
  ## Evidence Citation Protocol (tier-aware)
967
761
 
968
- The Orchestrator runs \`forge_classify\` before dispatching you, and runs the final
969
- \`evidence_map(
970
- {
971
- action: 'gate', task_id;
972
- }
973
- )\` after you respond. **Do not create your own
974
- task_id or run the gate** — feed into the Orchestrator's existing evidence map.
762
+ **Standalone mode:** If no FORGE task_id was provided in your dispatch prompt, skip \`evidence_map\` calls entirely provide free-form findings with \`file:line\` citations only.
763
+
764
+ The Orchestrator runs \`forge_classify\` before dispatching you, and runs the final \`evidence_map({ action: 'gate', task_id })\` after you respond. **Do not create your own task_id or run the gate** — feed into the Orchestrator's existing evidence map.
975
765
 
976
766
  | Tier | Your responsibility |
977
767
  |------|---------------------|
978
- | Floor | Free-form findings
979
- with \`file.ts#Lxx\` citations. No \`evidence_map\` calls required. |
768
+ | Floor | Free-form findings with \`file.ts#Lxx\` citations. No \`evidence_map\` calls required. |
980
769
  | Standard | For every CRITICAL or HIGH finding: \`evidence_map({action:'add', task_id, claim, status:'V', receipt:'file.ts#Lxx'})\`. Max 2-4 adds to keep signal high. |
981
770
  | Critical | Structured claims for all CRITICAL/HIGH findings (2-4 Verified + receipts) AND tag contract/security claims with \`safety_gate:'commitment'\` or \`safety_gate:'provenance'\`. |
982
771