Skip to content

Reference-don't-copy, agent adapter generation, and upward toolkit lookup - #58

Merged
dieterbaier merged 4 commits into
mainfrom
feature/agent-adapter-alignment
Jul 12, 2026
Merged

Reference-don't-copy, agent adapter generation, and upward toolkit lookup#58
dieterbaier merged 4 commits into
mainfrom
feature/agent-adapter-alignment

Conversation

@dieterbaier

Copy link
Copy Markdown
Member

Summary

Make the toolkit describe how a consuming project should use it, and align the bootstrap path with the generated agent-adapter approach.

  • Add a Consuming This Toolkit From a Project section to README.md and reinforce reference, don't copy in AGENTS.md: toolkit skills/**/SKILL.md, features/, and contract text are referenced, never copied; only executable tooling (schemas, templates, validators/generators, the adapter generator) is vendored and kept in sync.
  • Update skills/bootstrap-project/SKILL.md, templates/agents/*, and the bootstrap prompts so a new/existing project installs thin agent contracts and generates the Codex/Vibe/GitHub Copilot/Cursor adapters instead of hand-writing them, with .github/copilot-instructions.md as an entry point.
  • Make example/ a complete reference: thin adapter generator, generated adapters, and a Copilot entry point.
  • Upward toolkit lookup: local discovery no longer assumes a direct sibling. Agents search ../architecture-knowledge-toolkit, then each parent directory up to the filesystem root, before the recorded reference or public fallback. This supports projects outside the toolkit's parent folder.

Verification

  • node scripts/check-agent-adapters.js (toolkit and example/): adapters current.
  • node --test test/build-agent-adapters.test.mjs: 4/4 pass.

🤖 Generated with Claude Code

Dieter Baier and others added 2 commits July 11, 2026 10:54
Add a "Consuming This Toolkit From a Project" README section and reinforce in AGENTS.md that toolkit skills, features, and contracts are referenced, not copied; only executable tooling is vendored. Update the bootstrap-project skill, agent templates, and bootstrap prompts to install project contracts and generate thin agent adapters. Make the example a complete reference with a thin adapter generator, generated Codex/Vibe/Copilot/Cursor adapters, and a Copilot entry point.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Do not assume the architecture-knowledge-toolkit is a direct sibling of the consuming project. Change the local lookup order in AGENTS.md, README, the agent template, the prompts, and the example so agents search ../architecture-knowledge-toolkit and then each parent directory up to the filesystem root before falling back to a recorded reference or the public repository. This supports projects that live outside the toolkit's parent folder.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@dieterbaier dieterbaier left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Die konzeptionelle Richtung passt sehr gut. Ich habe allerdings einen Blocker im Bootstrap-Pfad gefunden: Der Skill weist konsumierende Projekte an, den Generator unverändert aus dem Toolkit zu kopieren. Dieser Generator ist aktuell toolkit-spezifisch (u. a. feste Cursor-Datei und Toolkit-Text) und erzeugt daher nicht die beschriebenen projektbezogenen Adapter. Dafür braucht es entweder einen generischen/parametrisierbaren Projektgenerator oder eine explizite Anpassungs-/Template-Stufe beim Bootstrap.

Comment thread skills/bootstrap-project/SKILL.md Outdated
Then set up thin, generated agent adapters instead of hand-writing per-agent
files:

- Copy `scripts/build-agent-adapters.js` and `scripts/check-agent-adapters.js`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocker: scripts/build-agent-adapters.js im Toolkit kann nicht unverändert in ein Zielprojekt kopiert werden. Er ist derzeit auf architecture-knowledge-toolkit fest verdrahtet (inkl. adapters/cursor/rules/architecture-knowledge-toolkit.mdc und toolkit-spezifischem Adaptertext). Damit erzeugt der hier beschriebene Bootstrap im Zielprojekt falsche Adapter. Bitte entweder einen generischen/parametrisierbaren Projektgenerator bereitstellen oder hier ausdrücklich vorgeben, dass der Generator aus einem Projekt-Template erzeugt bzw. für Projektname und Routingmodus angepasst wird.

Review blocker: the bootstrap path told projects to copy the toolkit's own scripts/build-agent-adapters.js, which is wired to the architecture-knowledge-toolkit name, Cursor file, and boundary text, so it produced adapters for the wrong project.

Add a parameterizable generator template under templates/scripts/ that derives the project name (AGENT_ADAPTER_PROJECT env, adapters/agent-adapters.config.json, or the repo directory name) and auto-detects routing (list local skills, else route to the toolkit). Point the bootstrap skill, agent template, prompts, and README at it, and switch the example to copy it verbatim. Add test/build-agent-adapters-template.test.mjs and wire it into build.sh test-js.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dieterbaier

Copy link
Copy Markdown
Member Author

Blocker behoben (42b9a43).

Statt Projekte den toolkit-eigenen, fest verdrahteten Generator kopieren zu lassen, gibt es jetzt einen generischen, parametrisierbaren Generator unter templates/scripts/build-agent-adapters.js (+ check-agent-adapters.js):

  • Projektname wird abgeleitet aus AGENT_ADAPTER_PROJECTadapters/agent-adapters.config.json (project) → Verzeichnisname; die Cursor-Regel heißt entsprechend adapters/cursor/rules/<project>.mdc.
  • Routing wird automatisch erkannt: lokale skills/**/SKILL.md → auflisten und Rest ans Toolkit delegieren; keine → vollständig ans Toolkit routen (kein falscher „no local skills"-Text mehr).
  • Bootstrap-Skill, templates/agents/project-agents.md, die Bootstrap-Prompts und die README verweisen jetzt ausdrücklich auf templates/scripts/ und warnen davor, den toolkit-eigenen Generator zu kopieren.
  • example/ verwendet den generischen Generator nun wörtlich (Beweis, dass der Bootstrap-Pfad korrekt funktioniert) — erzeugt example-benannte Adapter.
  • Neuer Test test/build-agent-adapters-template.test.mjs (Projektname-Ableitung, Skills-/Toolkit-Routing, Stale-Check) in build.sh test-js verdrahtet. CI (validate) grün.

@dieterbaier dieterbaier left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Der ursprüngliche Blocker ist mit 42b9a43 sauber behoben: generischer Projektgenerator, expliziter Template-Pfad, echte Verwendung im Beispiel und passende Tests. Ein kleiner Randfall bleibt: Ändert sich der aufgelöste Projektname (z. B. von Verzeichnisname auf Config/Environment), schreibt der Generator eine neue Cursor-Regel, entfernt die alte adapters/cursor/rules/<alter-name>.mdc aber nicht. Dadurch können mehrere alwaysApply: true-Regeln liegen bleiben, und --check bemerkt die zusätzliche Altdatei nicht. Bitte entweder alte generierte Cursor-Regeln bereinigen oder den Check auf unerwartete generierte .mdc-Dateien erweitern. CI ist grün; abgesehen davon sieht die Korrektur gut aus.

Review edge case: when the resolved project name changes, the generic generator wrote a new adapters/cursor/rules/<name>.mdc but left the old one in place, leaving several alwaysApply rules active without --check noticing. Treat generated .mdc files under adapters/cursor/rules as generator-owned: remove them on build and flag them on --check when they are not the current rule. Hand-authored rules (without the generated marker) are left untouched. Add tests and sync the example copy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dieterbaier

Copy link
Copy Markdown
Member Author

Randfall behoben (e4b69c7) — beide vorgeschlagenen Wege umgesetzt: Bereinigung und erweiterter Check.

Generierte Cursor-Regeln unter adapters/cursor/rules/*.mdc werden jetzt als generator-eigen behandelt (erkannt am Generated-Marker im Inhalt):

  • Build: veraltete generierte Regeln, die nicht der aktuellen <project>.mdc entsprechen, werden entfernt (removed …). Nach einer Umbenennung bleibt genau eine alwaysApply: true-Regel übrig.
  • --check: solche zusätzlichen generierten .mdc werden als stale gemeldet (Exit 1), nicht nur inhaltliche Drift.
  • Hand-geschriebene Regeln (ohne Generated-Marker) bleiben unangetastet.

Getestet in test/build-agent-adapters-template.test.mjs (Umbenennung entfernt Altregel; --check nennt die veraltete generierte Regel, nicht die manuelle) — 10/10 JS-Tests grün, example/ verwendet die aktualisierte Generatorkopie.

@dieterbaier
dieterbaier merged commit 94262dc into main Jul 12, 2026
1 check passed
@dieterbaier
dieterbaier deleted the feature/agent-adapter-alignment branch July 12, 2026 09:31
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.

1 participant