heimdall-agent 1.0.0 → 1.1.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/README.md +57 -26
- package/README.pt-BR.md +429 -0
- package/agents/cloud-engineer.md +77 -0
- package/agents/code-sentinel.md +66 -35
- package/agents/database-architect.md +31 -25
- package/agents/frontend-designer.md +30 -28
- package/agents/mobile-designer.md +25 -24
- package/agents/modernizer.md +66 -0
- package/agents/orchestrator.md +94 -93
- package/agents/reviewer.md +100 -71
- package/agents/security-auditor.md +27 -27
- package/agents/tester.md +97 -90
- package/commands/grill-me.md +20 -4
- package/commands/orchestrate.md +16 -0
- package/commands/orchestrator.md +16 -0
- package/commands/plan.md +17 -1
- package/config/agents.json +21 -3
- package/config/mcp.json +72 -0
- package/config/models.json +26 -16
- package/config/profiles.json +2 -4
- package/config/skills.json +210 -100
- package/docs/SKILLS.md +341 -245
- package/docs/designs/old/2026-10-31 plan-lifecycle-backlog-and-clean-code-skill.md +87 -0
- package/docs/designs/old/2026-11-02 skill-upstream-audit-and-update.md +105 -0
- package/docs/designs/old/2026-11-05 communication-doctrine-bluf-ste.md +94 -0
- package/docs/designs/old/2026-11-06-cloud-engineer-and-resilience-synthesis.md +67 -0
- package/docs/designs/old/2026-11-06-herdr-native-agent-orchestration.md +45 -0
- package/docs/runs/skill-audit/add_progressive_disclosure.cjs +30 -0
- package/docs/runs/skill-audit/check_heimdall_skills.ps1 +9 -0
- package/docs/runs/skill-audit/compare_classics.ps1 +26 -0
- package/docs/runs/skill-audit/compare_taste.ps1 +12 -0
- package/docs/runs/skill-audit/customization-report.json +380 -0
- package/docs/runs/skill-audit/diff_pending_skills.cjs +94 -0
- package/docs/runs/skill-audit/fetch_and_apply_skill.cjs +58 -0
- package/docs/runs/skill-audit/fetch_and_apply_taste_v2.cjs +65 -0
- package/docs/runs/skill-audit/inspect_pending_skills.cjs +71 -0
- package/docs/runs/skill-audit/inventory.json +308 -0
- package/docs/runs/skill-audit/list_local_taste.ps1 +1 -0
- package/docs/runs/skill-audit/phase5-update-plan.json +595 -0
- package/docs/runs/skill-audit/phase5-update-plan.md +138 -0
- package/docs/runs/skill-audit/probe.ps1 +16 -0
- package/docs/runs/skill-audit/probe_classics_branches.ps1 +3 -0
- package/docs/runs/skill-audit/probe_commits.ps1 +15 -0
- package/docs/runs/skill-audit/probe_repos.ps1 +17 -0
- package/docs/runs/skill-audit/probe_sentry_sec.ps1 +3 -0
- package/docs/runs/skill-audit/probe_sentry_sweep.ps1 +5 -0
- package/docs/runs/skill-audit/probe_snyk.ps1 +3 -0
- package/docs/runs/skill-audit/probe_snyk_recipes.ps1 +5 -0
- package/docs/runs/skill-audit/probe_taste_branches.ps1 +8 -0
- package/docs/runs/skill-audit/probe_taste_v19.ps1 +3 -0
- package/docs/runs/skill-audit/probe_user_repos.ps1 +19 -0
- package/docs/runs/skill-audit/prune_taste_skills.cjs +22 -0
- package/docs/runs/skill-audit/run_phase1_2.cjs +142 -0
- package/docs/runs/skill-audit/run_phase6_verification.cjs +107 -0
- package/docs/runs/skill-audit/show_16_details.ps1 +25 -0
- package/docs/runs/skill-audit/show_20_skills.ps1 +28 -0
- package/docs/runs/skill-audit/show_classics_diff.cjs +37 -0
- package/docs/runs/skill-audit/sync_agent_markdowns.cjs +30 -0
- package/docs/runs/skill-audit/taste-skill-upstream.md +542 -0
- package/docs/runs/skill-audit/update-manifest.md +88 -0
- package/docs/runs/skill-audit/update_config_skills.cjs +52 -0
- package/docs/runs/skill-audit/update_registry_phase7.cjs +83 -0
- package/docs/runs/skill-audit/upstream-status.json +563 -0
- package/docs/runs/skill-audit/verification-results.json +252 -0
- package/doctrine/AGENTS.md +39 -77
- package/hooks/git/pre-commit +11 -0
- package/hooks/heimdall-hook.cjs +81 -2
- package/hooks/herdr-agent-state.ps1 +55 -0
- package/hooks/hooks.json +0 -11
- package/lib/catalog-sync.cjs +162 -0
- package/lib/hermes-context.cjs +57 -0
- package/lib/model-context.cjs +123 -0
- package/lib/path-discovery.cjs +94 -0
- package/package.json +7 -3
- package/playbooks/01-interactive-grilling-gate.md +14 -1
- package/playbooks/02-fast-code-deep-verification.md +3 -2
- package/playbooks/03-adversarial-code-review.md +3 -3
- package/playbooks/05-canonical-plan-template.md +32 -18
- package/playbooks/06-model-registry-matrix.md +24 -13
- package/playbooks/07-legacy-code-modernization.md +74 -0
- package/playbooks/08-backlog-and-change-request-flow.md +122 -0
- package/setup.mjs +592 -172
- package/skills/antislop/SKILL.md +76 -56
- package/skills/antislop/VERSION +1 -0
- package/skills/antislop-copywriting/SKILL.md +372 -372
- package/skills/antislop-human/LICENSE-web-quality-skills +21 -0
- package/skills/antislop-human/SKILL.md +204 -147
- package/skills/antislop-human/contrast-check.py +168 -165
- package/skills/antislop-human/contrast-mcp.py +6 -3
- package/skills/antislop-human/references/A11Y-PATTERNS.md +249 -0
- package/skills/antislop-human/references/WCAG.md +127 -0
- package/skills/antislop-ui/LICENSE-web-quality-skills +21 -0
- package/skills/antislop-ui/SKILL.md +344 -304
- package/skills/antislop-ui/references/CORE-WEB-VITALS.md +181 -0
- package/skills/antislop-ui/references/WEB-BASELINE.md +28 -0
- package/skills/brainstorming/SKILL.md +274 -265
- package/skills/brainstorming/builder-check-prompt.md +23 -0
- package/skills/brainstorming/scripts/frame-template.html +213 -213
- package/skills/brainstorming/scripts/server.cjs +723 -723
- package/skills/brandkit/SKILL.md +798 -798
- package/skills/brutalist-skill/SKILL.md +93 -92
- package/skills/caveman/README.md +68 -0
- package/skills/caveman/SKILL.md +73 -38
- package/skills/claude-collaborator/SKILL.md +24 -44
- package/skills/clean-code/SKILL.md +152 -0
- package/skills/cloudflare-security-audit/AI-AND-LLM.md +83 -83
- package/skills/cloudflare-security-audit/ATTACK-CLASSES.md +130 -130
- package/skills/cloudflare-security-audit/CLIENT-SIDE.md +83 -83
- package/skills/cloudflare-security-audit/CLOUD-AND-DEPLOYMENT.md +86 -86
- package/skills/cloudflare-security-audit/DATA-ISOLATION-AND-LIFECYCLE.md +84 -84
- package/skills/cloudflare-security-audit/DESKTOP-MOBILE-AND-LOCAL-IPC.md +89 -89
- package/skills/cloudflare-security-audit/HUNTING.md +251 -251
- package/skills/cloudflare-security-audit/MEMORY-SAFETY-AND-BINARY.md +101 -101
- package/skills/cloudflare-security-audit/PROTOCOLS-RPC-AND-MESSAGING.md +81 -81
- package/skills/cloudflare-security-audit/RECONNAISSANCE.md +156 -156
- package/skills/cloudflare-security-audit/RESOURCE-EXHAUSTION-AND-AVAILABILITY.md +78 -78
- package/skills/cloudflare-security-audit/SKILL.md +192 -192
- package/skills/cloudflare-security-audit/SUPPLY-CHAIN-AND-RELEASE.md +73 -73
- package/skills/cloudflare-security-audit/VALIDATION-AND-REPORTING.md +186 -186
- package/skills/cloudflare-security-audit/WEB-PROTOCOL-AND-AUTH.md +105 -105
- package/skills/cloudflare-security-audit/report-schema.json +461 -461
- package/skills/cloudflare-security-audit/validate-coverage-ledger.cjs +872 -872
- package/skills/cloudflare-security-audit/validate-coverage-ledger.test.cjs +740 -740
- package/skills/cloudflare-security-audit/validate-findings.cjs +773 -773
- package/skills/cloudflare-security-audit/validate-findings.test.cjs +652 -652
- package/skills/codex-collaborator/SKILL.md +24 -45
- package/skills/communication-doctrine/SKILL.md +89 -0
- package/skills/diagnosing-superpowers/SKILL.md +1 -1
- package/skills/diagnosing-superpowers/references/github-issues.md +3 -3
- package/skills/diagnosing-superpowers/templates/issue.md +23 -4
- package/skills/executing-plans/SKILL.md +0 -52
- package/skills/executing-plans/scripts/task-done +52 -52
- package/skills/executing-plans/scripts/task-start +28 -28
- package/skills/gemini-collaborator/SKILL.md +24 -56
- package/skills/herdr/SKILL.md +243 -0
- package/skills/image-to-code-skill/SKILL.md +1228 -1228
- package/skills/imagegen-frontend-mobile/SKILL.md +1465 -1465
- package/skills/imagegen-frontend-web/SKILL.md +987 -987
- package/skills/karpathy-guidelines/SKILL.md +67 -67
- package/skills/mcp-engineering/SKILL.md +74 -0
- package/skills/minimalist-skill/SKILL.md +87 -85
- package/skills/output-skill/SKILL.md +49 -49
- package/skills/ponytail/SKILL.md +36 -52
- package/skills/postgres-best-practices/SKILL.md +30 -52
- package/skills/postgres-best-practices/references/backup-restore.md +372 -0
- package/skills/postgres-best-practices/references/bulk-loading.md +315 -0
- package/skills/postgres-best-practices/references/connection-pooling.md +310 -0
- package/skills/postgres-best-practices/references/hot-standby.md +221 -0
- package/skills/postgres-best-practices/references/indexing.md +318 -0
- package/skills/postgres-best-practices/references/logical-replication.md +610 -0
- package/skills/postgres-best-practices/references/major-version-upgrades.md +334 -0
- package/skills/postgres-best-practices/references/performance-diagnostics.md +553 -0
- package/skills/postgres-best-practices/references/query-optimization.md +294 -0
- package/skills/postgres-best-practices/references/query-patterns.md +566 -0
- package/skills/postgres-best-practices/references/schema-design.md +362 -0
- package/skills/postgres-best-practices/references/security-roles.md +489 -0
- package/skills/postgres-best-practices/references/transaction-isolation.md +344 -0
- package/skills/progressive-disclosure/SKILL.md +68 -0
- package/skills/pstack-discipline/SKILL.md +40 -0
- package/skills/receiving-code-review/SKILL.md +2 -23
- package/skills/requesting-code-review/SKILL.md +7 -36
- package/skills/soft-skill/SKILL.md +99 -98
- package/skills/stitch-skill/DESIGN.md +121 -121
- package/skills/stitch-skill/SKILL.md +185 -184
- package/skills/strix-security/SKILL.md +54 -53
- package/skills/subagent-driven-development/SKILL.md +28 -260
- package/skills/subagent-driven-development/references/batching.md +11 -0
- package/skills/subagent-driven-development/references/cannot-verify.md +10 -0
- package/skills/subagent-driven-development/references/final-review.md +47 -0
- package/skills/subagent-driven-development/references/fix-loop.md +77 -0
- package/skills/subagent-driven-development/references/handling-reports.md +15 -0
- package/skills/subagent-driven-development/references/preflight.md +26 -0
- package/skills/subagent-driven-development/references/resuming.md +12 -0
- package/skills/subagent-driven-development/scripts/review-package +53 -53
- package/skills/subagent-driven-development/scripts/sdd-workspace +87 -82
- package/skills/subagent-driven-development/scripts/task-brief +43 -43
- package/skills/systematic-debugging/SKILL.md +283 -306
- package/skills/taste-skill/SKILL.md +542 -1206
- package/skills/taste-skill/references/app-screens.md +1199 -0
- package/skills/taste-skill/references/colour.md +141 -0
- package/skills/taste-skill/references/copy.md +177 -0
- package/skills/taste-skill/references/critique.md +182 -0
- package/skills/taste-skill/references/imagery.md +791 -0
- package/skills/taste-skill/references/layout.md +292 -0
- package/skills/taste-skill/references/motion.md +980 -0
- package/skills/taste-skill/references/research.md +356 -0
- package/skills/taste-skill/references/scenes.md +174 -0
- package/skills/taste-skill/references/tells.md +115 -0
- package/skills/taste-skill/references/type.md +170 -0
- package/skills/test-driven-development/SKILL.md +330 -337
- package/skills/thermo/SKILL.md +67 -0
- package/skills/threat-modeling/SKILL.md +55 -0
- package/skills/trailofbits-audit-context/SKILL.md +72 -72
- package/skills/trailofbits-insecure-defaults/commands/audit.md +35 -0
- package/skills/trailofbits-insecure-defaults/references/debug-features.json +13 -13
- package/skills/trailofbits-insecure-defaults/references/debug-features.md +75 -75
- package/skills/trailofbits-insecure-defaults/references/default-credentials.json +12 -12
- package/skills/trailofbits-insecure-defaults/references/default-credentials.md +76 -76
- package/skills/trailofbits-insecure-defaults/references/fail-open-security.json +11 -11
- package/skills/trailofbits-insecure-defaults/references/fail-open-security.md +70 -70
- package/skills/trailofbits-insecure-defaults/references/fallback-secrets.json +11 -11
- package/skills/trailofbits-insecure-defaults/references/fallback-secrets.md +70 -70
- package/skills/trailofbits-insecure-defaults/references/permissive-access.json +13 -13
- package/skills/trailofbits-insecure-defaults/references/permissive-access.md +62 -62
- package/skills/trailofbits-insecure-defaults/references/weak-crypto.json +13 -13
- package/skills/trailofbits-insecure-defaults/references/weak-crypto.md +71 -71
- package/skills/trailofbits-triage-brocards/SKILL.md +208 -208
- package/skills/verification-before-completion/SKILL.md +0 -14
- package/skills/writing-plans/SKILL.md +11 -15
- package/skills/writing-skills/SKILL.md +21 -303
- package/skills/writing-skills/references/CLAUDE_MD_TESTING.md +189 -0
- package/skills/writing-skills/references/anthropic-best-practices.md +1150 -0
- package/skills/writing-skills/references/bulletproofing.md +80 -0
- package/skills/writing-skills/references/discovery.md +201 -0
- package/skills/writing-skills/references/flowcharts.md +37 -0
- package/skills/writing-skills/references/graphviz-conventions.dot +172 -0
- package/skills/writing-skills/references/persuasion-principles.md +187 -0
- package/skills/writing-skills/references/testing-skills-with-subagents.md +384 -0
- package/tools/{claude-bridge.ps1 → archive/claude-bridge.ps1} +10 -7
- package/tools/{codex-bridge.ps1 → archive/codex-bridge.ps1} +1 -1
- package/tools/{gemini-bridge.ps1 → archive/gemini-bridge.ps1} +12 -19
- package/skills/gpt-tasteskill/SKILL.md +0 -74
- package/skills/taste-skill-v1/SKILL.md +0 -226
- /package/tools/{claude-bridge.cmd → archive/claude-bridge.cmd} +0 -0
- /package/tools/{claude-bridge.sh → archive/claude-bridge.sh} +0 -0
- /package/tools/{codex-bridge.cmd → archive/codex-bridge.cmd} +0 -0
- /package/tools/{codex-bridge.sh → archive/codex-bridge.sh} +0 -0
- /package/tools/{codexcli-bridge.cmd → archive/codexcli-bridge.cmd} +0 -0
- /package/tools/{codexcli-bridge.ps1 → archive/codexcli-bridge.ps1} +0 -0
- /package/tools/{gemini-bridge.cmd → archive/gemini-bridge.cmd} +0 -0
- /package/tools/{gemini-bridge.sh → archive/gemini-bridge.sh} +0 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"skill": "antislop",
|
|
4
|
+
"status": "pass",
|
|
5
|
+
"error": null
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"skill": "antislop-code",
|
|
9
|
+
"status": "pass",
|
|
10
|
+
"error": null
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"skill": "antislop-copywriting",
|
|
14
|
+
"status": "pass",
|
|
15
|
+
"error": null
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"skill": "antislop-human",
|
|
19
|
+
"status": "pass",
|
|
20
|
+
"error": null
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"skill": "antislop-layoutmobile",
|
|
24
|
+
"status": "pass",
|
|
25
|
+
"error": null
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"skill": "antislop-ui",
|
|
29
|
+
"status": "pass",
|
|
30
|
+
"error": null
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"skill": "brainstorming",
|
|
34
|
+
"status": "pass",
|
|
35
|
+
"error": null
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"skill": "brandkit",
|
|
39
|
+
"status": "pass",
|
|
40
|
+
"error": null
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"skill": "brutalist-skill",
|
|
44
|
+
"status": "pass",
|
|
45
|
+
"error": null
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"skill": "caveman",
|
|
49
|
+
"status": "pass",
|
|
50
|
+
"error": null
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"skill": "claude-collaborator",
|
|
54
|
+
"status": "pass",
|
|
55
|
+
"error": null
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"skill": "cloudflare-security-audit",
|
|
59
|
+
"status": "pass",
|
|
60
|
+
"error": null
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"skill": "diagnosing-superpowers",
|
|
64
|
+
"status": "pass",
|
|
65
|
+
"error": null
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"skill": "dispatching-parallel-agents",
|
|
69
|
+
"status": "pass",
|
|
70
|
+
"error": null
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"skill": "executing-plans",
|
|
74
|
+
"status": "pass",
|
|
75
|
+
"error": null
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"skill": "finishing-a-development-branch",
|
|
79
|
+
"status": "pass",
|
|
80
|
+
"error": null
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"skill": "gemini-collaborator",
|
|
84
|
+
"status": "pass",
|
|
85
|
+
"error": null
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"skill": "image-to-code-skill",
|
|
89
|
+
"status": "pass",
|
|
90
|
+
"error": null
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"skill": "imagegen-frontend-mobile",
|
|
94
|
+
"status": "pass",
|
|
95
|
+
"error": null
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"skill": "imagegen-frontend-web",
|
|
99
|
+
"status": "pass",
|
|
100
|
+
"error": null
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"skill": "karpathy-guidelines",
|
|
104
|
+
"status": "pass",
|
|
105
|
+
"error": null
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"skill": "minimalist-skill",
|
|
109
|
+
"status": "pass",
|
|
110
|
+
"error": null
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"skill": "output-skill",
|
|
114
|
+
"status": "pass",
|
|
115
|
+
"error": null
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"skill": "owasp-security",
|
|
119
|
+
"status": "pass",
|
|
120
|
+
"error": null
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"skill": "ponytail",
|
|
124
|
+
"status": "pass",
|
|
125
|
+
"error": null
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"skill": "postgres-best-practices",
|
|
129
|
+
"status": "pass",
|
|
130
|
+
"error": null
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"skill": "project-hygiene",
|
|
134
|
+
"status": "pass",
|
|
135
|
+
"error": null
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"skill": "receiving-code-review",
|
|
139
|
+
"status": "pass",
|
|
140
|
+
"error": null
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"skill": "redesign-skill",
|
|
144
|
+
"status": "pass",
|
|
145
|
+
"error": null
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"skill": "requesting-code-review",
|
|
149
|
+
"status": "pass",
|
|
150
|
+
"error": null
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"skill": "security-audit-sweep",
|
|
154
|
+
"status": "pass",
|
|
155
|
+
"error": null
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"skill": "snyk-agent-scan",
|
|
159
|
+
"status": "pass",
|
|
160
|
+
"error": null
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"skill": "soft-skill",
|
|
164
|
+
"status": "pass",
|
|
165
|
+
"error": null
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"skill": "stitch-skill",
|
|
169
|
+
"status": "pass",
|
|
170
|
+
"error": null
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"skill": "strix-security",
|
|
174
|
+
"status": "pass",
|
|
175
|
+
"error": null
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"skill": "subagent-driven-development",
|
|
179
|
+
"status": "pass",
|
|
180
|
+
"error": null
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"skill": "systematic-debugging",
|
|
184
|
+
"status": "pass",
|
|
185
|
+
"error": null
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"skill": "taste-skill",
|
|
189
|
+
"status": "pass",
|
|
190
|
+
"error": null
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"skill": "test-driven-development",
|
|
194
|
+
"status": "pass",
|
|
195
|
+
"error": null
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"skill": "trailofbits-audit-context",
|
|
199
|
+
"status": "pass",
|
|
200
|
+
"error": null
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"skill": "trailofbits-insecure-defaults",
|
|
204
|
+
"status": "pass",
|
|
205
|
+
"error": null
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"skill": "trailofbits-triage-brocards",
|
|
209
|
+
"status": "pass",
|
|
210
|
+
"error": null
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"skill": "using-git-worktrees",
|
|
214
|
+
"status": "pass",
|
|
215
|
+
"error": null
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"skill": "using-superpowers",
|
|
219
|
+
"status": "pass",
|
|
220
|
+
"error": null
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"skill": "verification-before-completion",
|
|
224
|
+
"status": "pass",
|
|
225
|
+
"error": null
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"skill": "writing-plans",
|
|
229
|
+
"status": "pass",
|
|
230
|
+
"error": null
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"skill": "writing-skills",
|
|
234
|
+
"status": "pass",
|
|
235
|
+
"error": null
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"skill": "codex-collaborator",
|
|
239
|
+
"status": "pass",
|
|
240
|
+
"error": null
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"skill": "clean-code",
|
|
244
|
+
"status": "pass",
|
|
245
|
+
"error": null
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"skill": "progressive-disclosure",
|
|
249
|
+
"status": "pass",
|
|
250
|
+
"error": null
|
|
251
|
+
}
|
|
252
|
+
]
|
package/doctrine/AGENTS.md
CHANGED
|
@@ -4,89 +4,51 @@ Universal directives for Google Antigravity, Claude Code, and OpenAI Codex CLI a
|
|
|
4
4
|
|
|
5
5
|
<!-- cross-agent-harness-directives:start -->
|
|
6
6
|
<cross_agent_harness_discipline priority="CRITICAL_OVERRIDE">
|
|
7
|
+
<core_discipline>
|
|
8
|
+
- LOCAL TERMINAL AGENT: You are a local engineering agent running directly on the user's workstation with native filesystem and terminal tools (Edit, Write, Bash, PowerShell). Never behave like a remote web chatbot or claim you cannot edit local files.
|
|
9
|
+
- AUTONOMOUS INVESTIGATION FIRST (ZERO LAZY CLARIFICATION): Never ask the human how the project, domain, reverse proxy, database, service, or port is hosted, configured, or served. You have native filesystem and terminal tools (Glob, Grep, ReadFile, Bash, PowerShell). You MUST inspect configuration files (compose files, Caddyfiles/nginx, .env.example, package.json, scripts/) and docs/ before asking ANY infrastructure, architecture, or file path question. Asking questions answered by the repository is a doctrine violation.
|
|
10
|
+
- USER PRECEDENCE & NEGATIVE CONSTRAINTS (ABSOLUTE): If the user instructs "acknowledge only", "read-only", "for context/awareness only", or "do not take action", you MUST strictly obey. Do NOT edit files, execute scripts, or invoke mutating tools.
|
|
11
|
+
- STRICT ZERO DEV-SERVER POLICY (NON-NEGOTIABLE): NEVER start, launch, background, or run development servers (`npm run dev`, `pnpm dev`, `yarn dev`, `bun dev`, `vite`, `next dev`, `live-server`, `python manage.py runserver`, `nodemon`, `uvicorn`, `flask run`, etc.). NEVER attempt to make code work or verify features by launching dev servers. All testing and verification MUST be non-interactive, terminating commands: unit/integration test suites (`npm test`, `pytest`, `vitest run`, `jest --watchAll=false`), static typechecks (`tsc --noEmit`), linters (`eslint`, `oxlint`), and production builds (`npm run build`). If verification requires an active web server, that server must ALREADY be running externally by the human; you are strictly forbidden from spawning or managing server processes.
|
|
12
|
+
- CODE RESTRAINT (KARPATHY SIMPLICITY): Make minimal, surgical edits. Do not touch or refactor neighboring code unless explicitly instructed. Keep solutions minimal and simple.
|
|
13
|
+
- ZERO SIGNPOSTING & CONTINUOUS EXECUTION: For ordinary requests or approved plans, execute directly and autonomously. Never announce what tool you are about to run and yield the turn; call the tool immediately.
|
|
14
|
+
- PROGRESSIVE DISCLOSURE OVER SUBAGENT SPRAWL: Maintain a single execution loop by default. Do not spawn child subagents for single-turn, sequential, or conversational procedures that can be resolved via modular skills and deferred tool loading. Reserve child subagents strictly for:
|
|
15
|
+
a) Genuine parallel fan-out (e.g., concurrent test runs, parallel security sweeps).
|
|
16
|
+
b) Stateless adversarial peer review (Goldfish reviewer blinded to conversational trajectory).
|
|
17
|
+
c) Hard tool/permission isolation (sandboxed boundaries).
|
|
18
|
+
- ZERO-TRUST BLAST RADIUS & HUMAN STEP-UP: Read-only inspection is autonomous. Any action crossing a high blast-radius threshold (schema drops, data migration, modifying auth/crypto/billing flows, overwriting root configurations, or force-pushing git branches) requires explicit human confirmation before execution.
|
|
19
|
+
- SINGLE-WRITER MEMORY STEWARD: Parallel child subagents must never concurrently mutate shared repository source trees. Subagents write strictly to task-scoped scratchpads (`docs/runs/<task_id>/` or isolated artifacts); only the Lead Orchestrator or human merge gate commits changes to the shared tree.
|
|
20
|
+
- TOOL CONTEXT HYGIENE & PAYLOAD TRIMMING: Never dump raw wide payloads, massive JSON bodies (100+ keys), or multi-megabyte log files into the prompt. Always pipe or filter CLI outputs to project only relevant keys/lines.
|
|
21
|
+
- GEMINI 3-TIER INSTRUCTION STANDARD: All agent personas and system instructions must be structured into three sequential tiers:
|
|
22
|
+
1. Persona: Identity, core expertise, and voice traits.
|
|
23
|
+
2. Chronological Rules: Ordered lifecycle steps from initialization to handoff.
|
|
24
|
+
3. Unmistakable Guardrails: Explicit negative constraints and non-negotiable "If X, do Y" boundaries.
|
|
25
|
+
- CANONICAL MODEL NAMES: Anthropic models are strictly 'claude-opus-5-5' (Opus 5.5) and 'claude-sonnet-5' (Sonnet 5). There is NO 'sonnet-5-5' or 'sonnet 5.5' (hallucination trap). Never emit, invoke, or allocate 'claude-sonnet-5-5'.
|
|
26
|
+
- COMMUNICATION DISCIPLINE (BLUF & STE): Communication must prioritize zero-latency triage and testable clarity (skills/communication-doctrine). All status reports, review verdicts, and plan overviews must lead with Bottom Line Up Front (BLUF). All procedural execution steps must follow Simplified Technical English (STE): active imperative verbs, <= 20 words per step, zero banned vague qualifiers ('ensure', 'properly', 'appropriately', 'as needed').
|
|
27
|
+
</core_discipline>
|
|
28
|
+
|
|
7
29
|
<planning_protocol>
|
|
8
|
-
When receiving
|
|
9
|
-
1. TURN 1
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
30
|
+
When receiving an EXPLICIT planning or interview command (/plan or /grill-me):
|
|
31
|
+
1. TURN 1 INTERACTIVE GRILLING:
|
|
32
|
+
- Interrogate assumptions: Ask 2-3 probing questions on limits, failure modes, and edge cases.
|
|
33
|
+
- Propose 2 distinct concrete approaches with explicit architectural trade-offs.
|
|
34
|
+
- Render Scope, Questions, and Alternatives clearly in chat markdown, then pause for user approval.
|
|
35
|
+
2. TURN 2+ MULTI-MODEL PLAN GENERATION:
|
|
36
|
+
- Generate an authoritative plan strictly following `05-canonical-plan-template.md` (resolved via `playbooks/`, `../playbooks/`, or `../heimdall-agent/playbooks/`).
|
|
37
|
+
- PLAN STORAGE & LIFECYCLE: All plans MUST be created in `docs/designs/YYYY-MM-DD <plan name>.md`. Once implemented, verified, and confirmed working, the plan is moved to `docs/designs/old/YYYY-MM-DD <plan name>.md`.
|
|
38
|
+
- The plan MUST specify:
|
|
39
|
+
a) Multi-Agent Orchestration & Model Allocation Matrix (allocating tasks across Claude, Gemini, and Codex from `06-model-registry-matrix.md` in the same playbooks directory).
|
|
40
|
+
b) Symmetric Cross-Model Validation Loop (`herdr agent prompt`) and Non-Interactive Verification Harness.
|
|
41
|
+
c) Orchestrator Heartbeat (cadence for monitoring task progress and liveness).
|
|
42
|
+
d) Verification Harness (Non-interactive terminating test suites, static builds, and linters. Playwright E2E strictly against pre-existing human-managed servers or static build previews. NEVER include steps to start a dev server).
|
|
19
43
|
</planning_protocol>
|
|
20
44
|
|
|
21
45
|
<subagent_execution_contract>
|
|
22
|
-
When invoked as child subagent across ANY harness (Antigravity invoke_subagent, Claude Code Agent, Codex CLI):
|
|
46
|
+
When invoked as a child subagent across ANY harness (Antigravity invoke_subagent, Claude Code Agent, Codex CLI):
|
|
23
47
|
- Autonomous executor (Implementer, Tester, Reviewer, Code-Sentinel).
|
|
24
|
-
-
|
|
25
|
-
-
|
|
48
|
+
- Planning gate does NOT apply to child subagents. Do NOT ask conversational questions back to caller.
|
|
49
|
+
- NEVER start dev servers. Verify strictly through terminating unit tests, builds, typechecks, and lints.
|
|
26
50
|
- Inspect files, write failing tests first (TDD), write surgical code, verify, return diff report.
|
|
51
|
+
- Adhere strictly to the Single-Writer Memory Steward pattern: emit patches/reports to your isolated scratchpad with the mandatory 3-line BLUF header (Status, Blast Radius, Deliverable).
|
|
27
52
|
</subagent_execution_contract>
|
|
28
53
|
</cross_agent_harness_discipline>
|
|
29
54
|
<!-- cross-agent-harness-directives:end -->
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## 1. Skill Precedence & Contradiction Resolution
|
|
34
|
-
1. **`antislop` (Universal Baseline — Mandatory Throughout)**: Zero AI filler, boilerplate comments (`antislop-code`), conversational fluff, or unprompted refactoring.
|
|
35
|
-
2. **`taste-skill` (UI & Features — Mandatory)**: Output Design Read (page kind, audience, vibe, tokens). Enforce workspace design system tokens; ban generic AI defaults (mesh purple gradients, Inter+slate-900). Pick one cohesive aesthetic.
|
|
36
|
-
3. **`karpathy-guidelines` (Code Restraint — Mandatory)**: Simplicity first. Minimum code (50 lines over 200). Surgical edits only; never touch neighboring code.
|
|
37
|
-
4. **`superpowers` (`writing-plans`, `subagent-driven-development`)**: Governs lifecycle, subagent dispatch, and review checkpoints.
|
|
38
|
-
5. **Workspace Cleanup**: Use `purge-workspace` and `project-hygiene` for sweep audits and dead-code removal.
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## 2. Multi-Agent Orchestration & Model Allocation
|
|
43
|
-
- **Subagent Dispatch**: Multi-task plans must dispatch fresh specialized subagents (`orchestrator`, `frontend-designer`, `mobile-designer`, `tester`, `security-auditor`, `database-architect`, `code-sentinel`, `reviewer`). Fresh context per task, TDD first, surgical code, diff report.
|
|
44
|
-
- **Google Elephant-Goldfish Model (EGM) Core Architecture**: Absorbed natively into Heimdall personas (`google/elephant-goldfish-model`, `egm.dev`). The coordinator acts as the context-rich Elephant; Reviewers and Testers operate as stateless, context-blinded Goldfish.
|
|
45
|
-
- **Artifact-First Delivery**: Design docs, proposals, and review reports are saved to disk (`docs/designs/<feature>.md` or brain artifacts) rather than dumped in chat.
|
|
46
|
-
- **"No Glazing" & Plain-English**: Zero performative praise ("great", "smart", "brilliant") or apologetic filler. Direct, plain technical English.
|
|
47
|
-
- **3-Tier Smart Boundary Policy**:
|
|
48
|
-
- *Tier 1 (Spike / Bugfix < 50 LOC)*: Zero EGM ceremony. Pure Karpathy simplicity, failing test first, minimal surgical code.
|
|
49
|
-
- *Tier 2 (Bounded Feature)*: Lightweight in-chat design check, fast Critic & Readiness checks.
|
|
50
|
-
- *Tier 3 (Architectural / High-Stakes)*: Artifact-First spec in `docs/designs/` + 4-stage Goldfish review (Zoom Out, Comprehension, Critic, Readiness).
|
|
51
|
-
- **Adaptive Goldfish Execution**: Uses cross-model bridges (`gemini-bridge`, `claude-bridge`, `codex-bridge`) when present in the user environment; falls back gracefully to same-model stateless child subagents when bridges or credentials are not configured.
|
|
52
|
-
- **Canonical Plan Schema**: Plans must strictly use [`playbooks/05-canonical-plan-template.md`](file:///C:/Apps/heimdall-agent/playbooks/05-canonical-plan-template.md).
|
|
53
|
-
- **Model Registry & Effort**: Follow [`playbooks/06-model-registry-matrix.md`](file:///C:/Apps/heimdall-agent/playbooks/06-model-registry-matrix.md). Declare assigned model and allowed effort (`low`, `medium`, `high`, `xhigh`). Override Claude `/model` picker via Agent tool `model` parameter. Quota fallback: Argon -> Flash/Pro/GhostCLI.
|
|
54
|
-
- **Tri-Directional Cross-Model Reviews**: Claude validated by Gemini/Codex; Gemini validated by Claude/Codex; Codex validated by Claude/Gemini via shared bridge scripts.
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## 3. Playwright E2E Verification & Pseudo-Verification Ban
|
|
59
|
-
- **Primary Gate**: Playwright E2E at full capacity required for all interactive UI, web apps, and user journeys.
|
|
60
|
-
- **Visual & Runtime Assertions**: Verify DOM mount (`toBeVisible()`), non-zero bounding box (`expect(box.height).toBeGreaterThan(0)`), trap console errors (`page.on('pageerror')`).
|
|
61
|
-
- **Strict Pseudo-Verification Ban**: REJECT completion based on: `curl 200/302`, `grep` bundle, `tsc --noEmit`, container status, or reading file edits alone.
|
|
62
|
-
- **Backend with UI Impact**: Changes affecting user-facing views mandate Playwright E2E verification.
|
|
63
|
-
- **Missing Playwright**: Detect on Turn 1 planning; ask user for preferred setup. Silent fallback prohibited.
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## 4. Canonical Shared Tools (Zero Duplication)
|
|
68
|
-
- Cross-model bridges live centrally in `C:\Apps\tools\` (`claude-bridge.ps1`, `gemini-bridge.ps1`, `codex-bridge.ps1`) and user PATH.
|
|
69
|
-
- **Zero-Duplication Mandate**: Never copy bridge scripts into project repositories. Local `tools/` is strictly repo-specific.
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## 5. Strategic Context Compaction Cadence
|
|
74
|
-
- **The 40–50 Tool Invocations Threshold**: LLM reasoning quality, instruction adherence, and code restraint degrade as trajectories grow beyond 40–50 tool invocations.
|
|
75
|
-
- **Proactive Compaction Boundary**: Trigger strategic `/compact` (or manual state consolidation) after major milestones or upon approaching ~40 tool turns.
|
|
76
|
-
- **Pre-Compaction Preservation Invariant**: Before compacting or clearing context, you MUST persist all active state to disk:
|
|
77
|
-
- Record architectural rulings and decisions (`docs/designs/<feature>.md` or task scratchpads).
|
|
78
|
-
- Save pending items in the findings ledger.
|
|
79
|
-
- Note exact reproduction commands and verified file diffs.
|
|
80
|
-
*Never compact without leaving a clean disk breadcrumb.*
|
|
81
|
-
|
|
82
|
-
---
|
|
83
|
-
|
|
84
|
-
<!-- antislop:start -->
|
|
85
|
-
## antislop
|
|
86
|
-
For UI, copy, accessibility, mobile layout, or code comments, read `antislop` core and the task skill:
|
|
87
|
-
- UI / visual: `skills/antislop-ui/SKILL.md`
|
|
88
|
-
- Copy & text: `skills/antislop-copywriting/SKILL.md`
|
|
89
|
-
- People / accessibility: `skills/antislop-human/SKILL.md`
|
|
90
|
-
- Mobile / responsive: `skills/antislop-layoutmobile/SKILL.md`
|
|
91
|
-
- Code comments: `skills/antislop-code/SKILL.md`
|
|
92
|
-
<!-- antislop:end -->
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
# Heimdall Git Pre-Commit Guardrail
|
|
3
|
+
# Runs the automated verification suite before permitting any commit.
|
|
4
|
+
|
|
5
|
+
npm test || {
|
|
6
|
+
echo "" >&2
|
|
7
|
+
echo "[Heimdall Pre-Commit Guardrail] BLOCKED: npm test failed. Fix test failures or run 'heimdall sync-docs' before committing." >&2
|
|
8
|
+
exit 1
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exit 0
|
package/hooks/heimdall-hook.cjs
CHANGED
|
@@ -7,9 +7,71 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
const { execSync } = require('child_process');
|
|
10
|
+
const os = require('os');
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
10
13
|
|
|
11
14
|
const MAX_STDIN = 1024 * 1024; // 1 MiB
|
|
12
15
|
|
|
16
|
+
function getSessionFilePath() {
|
|
17
|
+
const ppid = process.ppid || 'global';
|
|
18
|
+
return path.join(os.tmpdir(), `heimdall-session-${ppid}.json`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function loadSessionState() {
|
|
22
|
+
try {
|
|
23
|
+
const p = getSessionFilePath();
|
|
24
|
+
if (fs.existsSync(p)) {
|
|
25
|
+
return JSON.parse(fs.readFileSync(p, 'utf8'));
|
|
26
|
+
}
|
|
27
|
+
} catch {}
|
|
28
|
+
return { turns: 0, estimatedTokens: 0, updatedAt: Date.now() };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function saveSessionState(state) {
|
|
32
|
+
try {
|
|
33
|
+
const p = getSessionFilePath();
|
|
34
|
+
fs.writeFileSync(p, JSON.stringify(state), 'utf8');
|
|
35
|
+
} catch {}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function clearSessionState() {
|
|
39
|
+
try {
|
|
40
|
+
const p = getSessionFilePath();
|
|
41
|
+
if (fs.existsSync(p)) fs.unlinkSync(p);
|
|
42
|
+
} catch {}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function getActiveContextLimit() {
|
|
46
|
+
if (process.env.HEIMDALL_ACTIVE_CONTEXT_LIMIT) {
|
|
47
|
+
const parsed = parseInt(process.env.HEIMDALL_ACTIVE_CONTEXT_LIMIT, 10);
|
|
48
|
+
if (parsed > 0) return parsed;
|
|
49
|
+
}
|
|
50
|
+
return 1000000; // 1M default maximum
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function trackContextUsage(payloadRaw) {
|
|
54
|
+
const session = loadSessionState();
|
|
55
|
+
session.turns = (session.turns || 0) + 1;
|
|
56
|
+
const turnTokens = Math.round((payloadRaw ? payloadRaw.length : 0) / 3.8);
|
|
57
|
+
session.estimatedTokens = (session.estimatedTokens || 0) + turnTokens;
|
|
58
|
+
session.updatedAt = Date.now();
|
|
59
|
+
saveSessionState(session);
|
|
60
|
+
|
|
61
|
+
const limit = getActiveContextLimit();
|
|
62
|
+
const warningTokens = Math.round(limit * 0.75);
|
|
63
|
+
|
|
64
|
+
if (session.estimatedTokens >= warningTokens || session.turns >= 40) {
|
|
65
|
+
const tokenDisplay = session.estimatedTokens >= 1000
|
|
66
|
+
? `${Math.round(session.estimatedTokens / 1000)}K`
|
|
67
|
+
: `${session.estimatedTokens}`;
|
|
68
|
+
const limitDisplay = limit >= 1000000
|
|
69
|
+
? `${Math.round(limit / 1000000)}M`
|
|
70
|
+
: `${Math.round(limit / 1000)}K`;
|
|
71
|
+
process.stderr.write(`[Heimdall Context Sentinel] WARNING: Session approaching context threshold (~${tokenDisplay} / ${limitDisplay} max tokens, turn ${session.turns} of 40-turn cadence). Trigger /compact or persist active state to disk.\n`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
13
75
|
function readStdin(timeoutMs = 800) {
|
|
14
76
|
return new Promise((resolve) => {
|
|
15
77
|
let raw = '';
|
|
@@ -72,6 +134,7 @@ async function main() {
|
|
|
72
134
|
|
|
73
135
|
switch (event) {
|
|
74
136
|
case 'pre-bash': {
|
|
137
|
+
trackContextUsage(raw);
|
|
75
138
|
const command = (toolInput.command || '').trim();
|
|
76
139
|
// Block destructive system commands
|
|
77
140
|
if (/(^|[;&|]\s*)(rm\s+-rf\s+(\/|~|\$HOME|\.\/|\*)|rmdir\s+\/s\s+\/q\s+[a-zA-Z]:\\)/i.test(command)) {
|
|
@@ -79,6 +142,19 @@ async function main() {
|
|
|
79
142
|
process.exit(2);
|
|
80
143
|
}
|
|
81
144
|
|
|
145
|
+
// Block dev server commands (STRICT ZERO DEV-SERVER POLICY)
|
|
146
|
+
const isDevServer =
|
|
147
|
+
/(^|[;&|\s])(npm|pnpm|yarn|bun)\s+(run\s+)?(dev|start|serve)(\b|:|\s)/i.test(command) ||
|
|
148
|
+
/(^|[;&|\s])(npx\s+)?(vite|live-server|http-server|nodemon)(\b|\s)/i.test(command) ||
|
|
149
|
+
/(^|[;&|\s])(next|nuxt)\s+dev(\b|\s)/i.test(command) ||
|
|
150
|
+
/(^|[;&|\s])python\s+manage\.py\s+runserver(\b|\s)/i.test(command) ||
|
|
151
|
+
/(^|[;&|\s])(flask\s+run|uvicorn)(\b|\s)/i.test(command);
|
|
152
|
+
|
|
153
|
+
if (isDevServer) {
|
|
154
|
+
process.stderr.write(`[Heimdall Sentinel Guardrail] BLOCKED: Dev server execution detected ("${command}"). Running development servers is strictly prohibited by user doctrine. Use non-interactive terminating checks (npm test, npm run build, vitest run, lint, typecheck).\n`);
|
|
155
|
+
process.exit(2);
|
|
156
|
+
}
|
|
157
|
+
|
|
82
158
|
// Branch-aware force push check
|
|
83
159
|
if (/git\s+push\s+.*(-f\b|--force\b|--force-with-lease\b)/i.test(command)) {
|
|
84
160
|
// Explicit protected branch in command target
|
|
@@ -119,21 +195,24 @@ async function main() {
|
|
|
119
195
|
}
|
|
120
196
|
|
|
121
197
|
case 'pre-write': {
|
|
198
|
+
trackContextUsage(raw);
|
|
122
199
|
const filePath = toolInput.file_path || toolInput.path || '';
|
|
123
200
|
const content = toolInput.content || '';
|
|
124
201
|
const lineCount = content ? content.split('\n').length : 0;
|
|
125
|
-
|
|
202
|
+
const isCanvasArtifact = /\.(html?|svg)$/i.test(filePath) || content.includes('data-od-id') || Boolean(process.env.OPENDESIGN);
|
|
203
|
+
if (lineCount > 800 && !isCanvasArtifact) {
|
|
126
204
|
process.stderr.write(`[Heimdall Karpathy Sentinel] Advisory: File '${filePath}' exceeds 800 lines (${lineCount} lines). Consider decomposing or keeping edits minimal.\n`);
|
|
127
205
|
}
|
|
128
206
|
break;
|
|
129
207
|
}
|
|
130
208
|
|
|
131
209
|
case 'post-write': {
|
|
132
|
-
|
|
210
|
+
// Post-write prompt injection removed to prevent agent stalling between tool calls
|
|
133
211
|
break;
|
|
134
212
|
}
|
|
135
213
|
|
|
136
214
|
case 'pre-compact': {
|
|
215
|
+
clearSessionState();
|
|
137
216
|
process.stderr.write('[Heimdall Lifecycle Sentinel] Context compaction occurring. Ensure active tasks, rulings, and pending ledger items are preserved on disk.\n');
|
|
138
217
|
break;
|
|
139
218
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# installed by herdr
|
|
2
|
+
# managed by herdr; reinstalling or updating the integration overwrites this file.
|
|
3
|
+
# add custom hooks beside this file instead of editing it.
|
|
4
|
+
# HERDR_INTEGRATION_ID=claude
|
|
5
|
+
# HERDR_INTEGRATION_VERSION=11
|
|
6
|
+
|
|
7
|
+
param([string]$Action = "")
|
|
8
|
+
|
|
9
|
+
if ($Action -ne "session") { exit 0 }
|
|
10
|
+
if ($env:HERDR_ENV -ne "1") { exit 0 }
|
|
11
|
+
if ([string]::IsNullOrWhiteSpace($env:HERDR_PANE_ID)) { exit 0 }
|
|
12
|
+
|
|
13
|
+
# Read hook input as raw bytes so UTF-8 payloads decode correctly even when the
|
|
14
|
+
# console input code page is not UTF-8 (for example CP949 on Korean Windows).
|
|
15
|
+
$stdinReader = New-Object System.IO.StreamReader([Console]::OpenStandardInput(), [System.Text.Encoding]::UTF8)
|
|
16
|
+
$inputText = $stdinReader.ReadToEnd()
|
|
17
|
+
try {
|
|
18
|
+
$payload = if ([string]::IsNullOrWhiteSpace($inputText)) { $null } else { $inputText | ConvertFrom-Json }
|
|
19
|
+
} catch {
|
|
20
|
+
exit 0
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
$propertyNames = @($payload.PSObject.Properties.Name)
|
|
24
|
+
if ((Test-Path Env:CURSOR_VERSION) -or $propertyNames -ccontains "cursor_version") { exit 0 }
|
|
25
|
+
if (-not ($propertyNames -ccontains "hook_event_name") -or $payload.hook_event_name -isnot [string] -or $payload.hook_event_name -cne "SessionStart") { exit 0 }
|
|
26
|
+
if (-not [string]::IsNullOrWhiteSpace($payload.agent_id)) { exit 0 }
|
|
27
|
+
|
|
28
|
+
$sessionId = $payload.session_id
|
|
29
|
+
if ([string]::IsNullOrWhiteSpace($sessionId)) { exit 0 }
|
|
30
|
+
|
|
31
|
+
$seq = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds()
|
|
32
|
+
$herdr = if ([string]::IsNullOrWhiteSpace($env:HERDR_BIN_PATH)) { "herdr" } else { $env:HERDR_BIN_PATH }
|
|
33
|
+
try {
|
|
34
|
+
$args = @(
|
|
35
|
+
"pane",
|
|
36
|
+
"report-agent-session",
|
|
37
|
+
$env:HERDR_PANE_ID,
|
|
38
|
+
"--source",
|
|
39
|
+
"herdr:claude",
|
|
40
|
+
"--agent",
|
|
41
|
+
"claude",
|
|
42
|
+
"--seq",
|
|
43
|
+
"$seq",
|
|
44
|
+
"--agent-session-id",
|
|
45
|
+
"$sessionId"
|
|
46
|
+
)
|
|
47
|
+
if ($payload.transcript_path -is [string] -and -not [string]::IsNullOrWhiteSpace($payload.transcript_path)) {
|
|
48
|
+
$args += @("--agent-session-path", "$($payload.transcript_path)")
|
|
49
|
+
}
|
|
50
|
+
if ($payload.hook_event_name -eq "SessionStart" -and $payload.source -is [string] -and -not [string]::IsNullOrWhiteSpace($payload.source)) {
|
|
51
|
+
$args += @("--session-start-source", "$($payload.source)")
|
|
52
|
+
}
|
|
53
|
+
& $herdr @args 2>$null | Out-Null
|
|
54
|
+
} catch {
|
|
55
|
+
}
|
package/hooks/hooks.json
CHANGED
|
@@ -21,17 +21,6 @@
|
|
|
21
21
|
]
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"PostToolUse": [
|
|
25
|
-
{
|
|
26
|
-
"matcher": "Edit|Write",
|
|
27
|
-
"hooks": [
|
|
28
|
-
{
|
|
29
|
-
"type": "command",
|
|
30
|
-
"command": "node \"{{HOOKS_DIR}}/heimdall-hook.cjs\" post-write"
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
24
|
"PreCompact": [
|
|
36
25
|
{
|
|
37
26
|
"matcher": ".*",
|