Skip to content

Consolidate config loading - #230

Open
taminomara wants to merge 3 commits into
testdouble:v6.0.0-betafrom
taminomara:gh-203-consolidate-config-loading
Open

taminomara wants to merge 3 commits into
testdouble:v6.0.0-betafrom
taminomara:gh-203-consolidate-config-loading

Conversation

@taminomara

@taminomara taminomara commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR moves every skill's .han/config.md loading into one shared han-core:load-han-config skill, so that a chained run loads the config once and a change to config lookup edits one script instead of forty-odd skills.

Behavior changes

Each skill now reads its configuration by invoking han-core:load-han-config once per run. Before this PR, each skill had its own ~10-line config block. When one skill called another, such as plan-a-feature calling readability-guidance, a single context ended up with several copies of the config and several copies of the "go read it" instruction. A skill that has already loaded the config in this run skips the call.

The new skill is a single context-injection probe, meaning a shell command whose output is pasted into the prompt when the skill loads. The probe runs han-core/scripts/load-han-config.sh. That script prints the project and personal config files between BEGIN/END markers and then prints the config rule (the doc that says how to apply them). If the script fails, a guard swaps in a one-line "no configuration applies" message and the run continues.

To make this work, every plugin now depends on han-core. That adds five new dependency edges: han-communication, han-feedback, han-linear, han-plugin-builder, and han-reporting. han-communication used to depend on nothing. Codex resolves no plugin dependencies, so a Codex install now needs han-core installed beside each plugin. The twelve vendored copies of config-rule.md and the per-plugin han-config-dir.sh resolver are deleted, and the one remaining copy of the rule now starts at its schema. No plugin versions are bumped; the release does that.

What to look at first

  • The han-core dependency on every plugin. This is the one choice the maintainer may decline. It ends han-communication's "depends on nothing" status and changes Codex installs. Check the five plugin.json edges, then the updated install wording in the repo map and the plugin index page.
  • The guidance correction in han-plugin-builder (skill-composition.md, troubleshooting.md). The old guidance said a data-fetch sub-skill (a skill called only to fetch a value) was unreliable whether forked or inline. It now limits that warning to the forked form (context: fork). The evidence is two trials: 99 runs, then 48 against the shipped loader, with zero early exits. See docs/plans/gh-203-consolidate-config-loading/artifacts/trial2/trial-report.md.
  • The loader script and its tests. han-core/scripts/load-han-config.sh and its Bats tests cover neither file present, each file alone, both files in project-first order, and the personal lookup naming the project file. The same test file guards every shipped skill: each carries the loader line once, pre-approves the Skill tool, and keeps no old config block.
  • One rewired consumer, such as han-coding/skills/code-review/SKILL.md. The same pattern repeats across 44 skills. Each one adds Skill to its allowed tools, drops the old probe, and points later config references at the rule the loader prints.

Closes #203.

taminomara added a commit to taminomara/han that referenced this pull request Oct 23, 2026
Fix testdouble#203

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@taminomara
taminomara force-pushed the gh-203-consolidate-config-loading branch from 147d602 to 28f47e8 Compare October 23, 2026 14:42
@taminomara
taminomara marked this pull request as ready for review October 23, 2026 15:21
taminomara added a commit to taminomara/han that referenced this pull request Oct 23, 2026
Fix testdouble#203

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@taminomara
taminomara force-pushed the gh-203-consolidate-config-loading branch from 28f47e8 to 2f13894 Compare October 23, 2026 15:26
Fix testdouble#203

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@taminomara
taminomara force-pushed the gh-203-consolidate-config-loading branch from 2f13894 to a5ea4fa Compare October 23, 2026 15:30
taminomara added a commit to taminomara/han that referenced this pull request Oct 24, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mxriverlynn
mxriverlynn changed the base branch from main to v6.0.0-beta October 27, 2026 14:54
@mxriverlynn

Copy link
Copy Markdown
Collaborator

@taminomara this is great! been meaning to do this for a while now.

i've updated this PR to target the v6.0.0-beta branch as the merge target, and that opened a lot of merge conflicts. can you update the PR to clear these up with the new target branch? thank you

taminomara and others added 2 commits October 28, 2026 04:27
…oading

Resolve conflicts against the retargeted base (v6.0.0-beta):

- config-rule.md (canonical, han-core): keep v6's Code Review Types schema
  bullet, keyed-list resolution paragraph, and two-exception degradation
  intro; apply this branch's trim-to-schema and `###` heading nesting.
- The 12 vendored config-rule.md copies stay deleted (this branch retired
  them); v6's identical edits to them are carried by the canonical copy.
- code-review/SKILL.md and agent-dispatch.md: take v6's Code Review Types
  feature, then re-apply this branch's loader consolidation (invoke
  han-core:load-han-config, add the Skill grant, drop the probe block, and
  rewrite config-rule path citations to the printed rule).
- docs/configuration.md: combine v6's review-types list item with this
  branch's shared-loader sentence.

All 135 Bats tests pass; lint clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The base advanced after the previous merge, adding two skills that use the
old per-skill config probe. Resolve against the new tip:

- CLAUDE.md: keep this branch's removal of config-rule.md from the vendored
  reference lists; keep v6's addition of reassess-approach and restructure to
  the planning and coding skill lists.
- restructure and reassess-approach SKILL.md: migrate both to the loader,
  matching this branch's consolidation. Invoke han-core:load-han-config,
  pre-approve the Skill tool, drop the han-config-dir.sh grant and probe
  block, and rewrite config-rule path citations to the printed rule.

All 145 Bats tests pass; lint clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@taminomara
taminomara force-pushed the gh-203-consolidate-config-loading branch from 2cc509c to df86312 Compare October 28, 2026 05:55
@taminomara

Copy link
Copy Markdown
Contributor Author

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate config loading; the inline half of the data-fetch prohibition is unevidenced

3 participants