@devrik-tools/claude-gates 0.4.0 → 0.6.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 +2 -2
- package/README.es.md +25 -4
- package/README.md +21 -5
- package/cli/config.mjs +126 -124
- package/cli/init.mjs +303 -276
- package/cli/install.mjs +281 -175
- package/cli/materialize.mjs +103 -102
- package/cli/registry.mjs +139 -136
- package/cli/smoke-fixtures.json +51 -0
- package/cli/task.mjs +140 -140
- package/package.json +1 -1
- package/plugins/gates/.claude-plugin/plugin.json +1 -1
- package/plugins/gates/hooks/ask-adoption.mjs +147 -147
- package/plugins/gates/hooks/doctor.mjs +207 -207
- package/plugins/gates/hooks/gates/atomic-commit/index.mjs +229 -0
- package/plugins/gates/hooks/gates/audit-before-build/index.mjs +110 -88
- package/plugins/gates/hooks/gates/autonomous-mode/index.mjs +50 -50
- package/plugins/gates/hooks/gates/bash-commands/index.mjs +215 -215
- package/plugins/gates/hooks/gates/brief-before-delegate/index.mjs +269 -265
- package/plugins/gates/hooks/gates/capability-map/index.mjs +377 -0
- package/plugins/gates/hooks/gates/circuit-breaker/index.mjs +527 -501
- package/plugins/gates/hooks/gates/diagnosis-before-patch/index.mjs +48 -43
- package/plugins/gates/hooks/gates/feature-catalog/index.mjs +83 -83
- package/plugins/gates/hooks/gates/force-parallel/index.mjs +134 -119
- package/plugins/gates/hooks/gates/forge-flow/index.mjs +134 -134
- package/plugins/gates/hooks/gates/implementation-pipeline/index.mjs +187 -187
- package/plugins/gates/hooks/gates/intent-flow/index.mjs +260 -260
- package/plugins/gates/hooks/gates/lint-commit/index.mjs +152 -149
- package/plugins/gates/hooks/gates/mandatory-flow/index.mjs +180 -180
- package/plugins/gates/hooks/gates/never-assume/index.mjs +59 -58
- package/plugins/gates/hooks/gates/no-blocking/index.mjs +163 -148
- package/plugins/gates/hooks/gates/no-coauthor/index.mjs +127 -0
- package/plugins/gates/hooks/gates/no-lint-suppression/index.mjs +183 -0
- package/plugins/gates/hooks/gates/protected-paths/index.mjs +149 -144
- package/plugins/gates/hooks/gates/recurrence-lock/index.mjs +91 -89
- package/plugins/gates/hooks/gates/reuse-before-build/index.mjs +263 -159
- package/plugins/gates/hooks/gates/risk-level/index.mjs +265 -263
- package/plugins/gates/hooks/gates/root-cause-first/index.mjs +57 -56
- package/plugins/gates/hooks/gates/root-whitelist/index.mjs +211 -131
- package/plugins/gates/hooks/gates/rule-skill-autodiscovery/index.mjs +181 -184
- package/plugins/gates/hooks/gates/sdd-specs/index.mjs +256 -256
- package/plugins/gates/hooks/gates/staged-lint/index.mjs +187 -0
- package/plugins/gates/hooks/gates/stop-pending/index.mjs +169 -164
- package/plugins/gates/hooks/gates/test-matrix/index.mjs +187 -187
- package/plugins/gates/hooks/gates/tool-map/index.mjs +168 -143
- package/plugins/gates/hooks/hooks.json +51 -0
- package/plugins/gates/hooks/lib/config.mjs +179 -172
- package/plugins/gates/hooks/lib/hook-io.mjs +367 -357
- package/plugins/gates/hooks/lib/signals.mjs +172 -127
- package/plugins/gates/hooks/wiring-check.mjs +227 -227
- package/plugins/tasks/.claude-plugin/plugin.json +1 -1
- package/plugins/tasks/hooks/hooks.json +26 -26
- package/plugins/tasks/hooks/lib/task-store.mjs +217 -197
- package/plugins/tasks/hooks/register-requests.mjs +145 -145
- package/plugins/tasks/hooks/session-tasks.mjs +108 -108
- package/registry.json +171 -1
package/registry.json
CHANGED
|
@@ -563,6 +563,115 @@
|
|
|
563
563
|
"description": "Milliseconds allowed for the lint run before it counts as a failure."
|
|
564
564
|
}
|
|
565
565
|
]
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"id": "staged-lint",
|
|
569
|
+
"configKey": "blockCommitWithStagedLintErrors",
|
|
570
|
+
"default": false,
|
|
571
|
+
"event": "PreToolUse",
|
|
572
|
+
"tools": ["shell"],
|
|
573
|
+
"description": "Denies a git commit when the STAGED files fail lint — lints only what you staged, not the whole repo, so your change can't add new lint debt while pre-existing debt in untouched files never blocks you. Autodetects eslint; escape hatch [skip-lint].",
|
|
574
|
+
"script": "gates/staged-lint/index.mjs",
|
|
575
|
+
"params": [
|
|
576
|
+
{
|
|
577
|
+
"name": "lintCommand",
|
|
578
|
+
"type": "string",
|
|
579
|
+
"description": "Command to run; staged paths are appended. Default: autodetect npx eslint when an eslint config exists."
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"name": "lintExtensions",
|
|
583
|
+
"type": "string[]",
|
|
584
|
+
"description": "Staged file extensions that get linted. Replaces the built-in list."
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
"name": "lintTimeoutMs",
|
|
588
|
+
"type": "number",
|
|
589
|
+
"description": "Milliseconds allowed for the lint run before it counts as a failure."
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"name": "escapeHatch",
|
|
593
|
+
"type": "string",
|
|
594
|
+
"description": "Substring in the commit command that skips the check once. Default [skip-lint]."
|
|
595
|
+
}
|
|
596
|
+
]
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"id": "atomic-commit",
|
|
600
|
+
"configKey": "blockNonAtomicCommits",
|
|
601
|
+
"default": false,
|
|
602
|
+
"event": "PreToolUse",
|
|
603
|
+
"tools": ["shell"],
|
|
604
|
+
"description": "Denies a git commit that is not atomic: one mixing more than N distinct natures of change (code/tests/deps/config...) or staging more reviewable files than a commit should carry. Docs/assets/generated files are not counted. Escape hatch [wip] for one deliberately broad commit.",
|
|
605
|
+
"script": "gates/atomic-commit/index.mjs",
|
|
606
|
+
"params": [
|
|
607
|
+
{
|
|
608
|
+
"name": "maxFiles",
|
|
609
|
+
"type": "number",
|
|
610
|
+
"description": "Max counted (reviewable) files in one commit. Default 12."
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
"name": "maxNatures",
|
|
614
|
+
"type": "number",
|
|
615
|
+
"description": "Max distinct counted natures of change in one commit. Default 2."
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"name": "escapeHatch",
|
|
619
|
+
"type": "string",
|
|
620
|
+
"description": "Substring in the commit command that allows one deliberately broad commit. Default [wip]."
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"name": "natures",
|
|
624
|
+
"type": "string[]",
|
|
625
|
+
"description": "Classification table ({name, source, counts}) mapping a path to a nature. Replaces the built-in list."
|
|
626
|
+
}
|
|
627
|
+
]
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"id": "no-coauthor",
|
|
631
|
+
"configKey": "blockCoauthorTrailers",
|
|
632
|
+
"default": true,
|
|
633
|
+
"event": "PreToolUse",
|
|
634
|
+
"tools": ["shell", "delegation"],
|
|
635
|
+
"description": "Denies a git commit whose message carries an AI/agent attribution trailer (Co-Authored-By, Generated with, session trailer). Escape hatch marker allows one legitimate co-author.",
|
|
636
|
+
"script": "gates/no-coauthor/index.mjs",
|
|
637
|
+
"params": [
|
|
638
|
+
{
|
|
639
|
+
"name": "attributionPatterns",
|
|
640
|
+
"type": "string[]",
|
|
641
|
+
"description": "Regex sources of attribution trailers/phrases to deny. Replaces the built-in list."
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"name": "escapeHatch",
|
|
645
|
+
"type": "string",
|
|
646
|
+
"description": "Substring in the command that allows one commit to keep a co-author. Default [allow-coauthor]."
|
|
647
|
+
}
|
|
648
|
+
]
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"id": "no-lint-suppression",
|
|
652
|
+
"configKey": "blockLintSuppression",
|
|
653
|
+
"default": true,
|
|
654
|
+
"event": "PreToolUse",
|
|
655
|
+
"tools": ["write"],
|
|
656
|
+
"description": "Denies a write that silences the linter/type-checker (inline disable directive, or a config rule set off) instead of fixing the code. Escape hatch marker on the same line allows a documented false positive.",
|
|
657
|
+
"script": "gates/no-lint-suppression/index.mjs",
|
|
658
|
+
"params": [
|
|
659
|
+
{
|
|
660
|
+
"name": "suppressionPatterns",
|
|
661
|
+
"type": "string[]",
|
|
662
|
+
"description": "Regex sources marking an inline suppression directive. Replaces the built-in list."
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
"name": "watchedConfigFiles",
|
|
666
|
+
"type": "string[]",
|
|
667
|
+
"description": "Config file basenames whose edits are scanned for rule-weakening. Replaces the built-in list."
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"name": "escapeHatch",
|
|
671
|
+
"type": "string",
|
|
672
|
+
"description": "Substring on the same line as a suppression that allows it (a documented false positive). Default lint-ok:."
|
|
673
|
+
}
|
|
674
|
+
]
|
|
566
675
|
}
|
|
567
676
|
]
|
|
568
677
|
},
|
|
@@ -577,13 +686,28 @@
|
|
|
577
686
|
"default": false,
|
|
578
687
|
"event": "PreToolUse",
|
|
579
688
|
"tools": ["write", "delegation"],
|
|
580
|
-
"description": "
|
|
689
|
+
"description": "Before building a tool/helper (by folder, name pattern, or extension), requires evidence the wheel was checked: an audit phrase, the tool's name already in the map (structural match), or a matching installed dependency. Covers helpers beyond scripts/hooks/tools/gates and Spanish build-intent.",
|
|
581
690
|
"script": "gates/reuse-before-build/index.mjs",
|
|
582
691
|
"params": [
|
|
583
692
|
{
|
|
584
693
|
"name": "toolMapFile",
|
|
585
694
|
"type": "string",
|
|
586
695
|
"description": "Path to the per-project tool map (default .ai/tool-map.json)."
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"name": "toolFolders",
|
|
699
|
+
"type": "string[]",
|
|
700
|
+
"description": "Folder names marking a file as a tool/helper. Replaces the built-in list (scripts, hooks, tools, gates, lib, utils, helpers, composables, components, services...)."
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
"name": "toolNamePatterns",
|
|
704
|
+
"type": "string[]",
|
|
705
|
+
"description": "Regex sources; a new file whose basename matches any is treated as a helper regardless of folder (useX, XHelper, XUtil, XService...)."
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"name": "toolExtensions",
|
|
709
|
+
"type": "string[]",
|
|
710
|
+
"description": "File extensions considered code that can reinvent a wheel."
|
|
587
711
|
}
|
|
588
712
|
]
|
|
589
713
|
},
|
|
@@ -698,6 +822,52 @@
|
|
|
698
822
|
"tools": [],
|
|
699
823
|
"description": "Warns when a registered hook is missing or a script is orphaned.",
|
|
700
824
|
"script": "wiring-check.mjs"
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"id": "capability-map",
|
|
828
|
+
"configKey": "injectCapabilityMap",
|
|
829
|
+
"default": false,
|
|
830
|
+
"event": "UserPromptSubmit",
|
|
831
|
+
"tools": [],
|
|
832
|
+
"description": "Injects the current catalog of the project's AI capabilities (skills, agents/subagents, commands) as compact context on every message, grouped by kind, read fresh from disk. Also persists it to .ai/capability-map.json like the tool map. Autosynced: it lists the directories, never a hardcoded copy. Never blocks.",
|
|
833
|
+
"script": "gates/capability-map/index.mjs",
|
|
834
|
+
"params": [
|
|
835
|
+
{
|
|
836
|
+
"name": "kinds",
|
|
837
|
+
"type": "string[]",
|
|
838
|
+
"description": "Which capability kinds to include: skills, agents, commands. Drop one to stop scanning it."
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
"name": "maxClauseChars",
|
|
842
|
+
"type": "number",
|
|
843
|
+
"description": "Hard cap on each entry's one-line blurb length. Default 90."
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"name": "extraSkillsDirs",
|
|
847
|
+
"type": "string[]",
|
|
848
|
+
"description": "Extra skill roots (relative or absolute) scanned in addition to ~/.claude/skills and <project>/.claude/skills."
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
"name": "extraAgentsDirs",
|
|
852
|
+
"type": "string[]",
|
|
853
|
+
"description": "Extra agent roots scanned in addition to ~/.claude/agents and <project>/.claude/agents."
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
"name": "extraCommandsDirs",
|
|
857
|
+
"type": "string[]",
|
|
858
|
+
"description": "Extra command roots scanned in addition to ~/.claude/commands and <project>/.claude/commands."
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
"name": "persist",
|
|
862
|
+
"type": "boolean",
|
|
863
|
+
"description": "Whether to write the persisted map file. Default true."
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
"name": "mapFile",
|
|
867
|
+
"type": "string",
|
|
868
|
+
"description": "Path to the persisted capability map, relative to project root. Default .ai/capability-map.json."
|
|
869
|
+
}
|
|
870
|
+
]
|
|
701
871
|
}
|
|
702
872
|
]
|
|
703
873
|
},
|