Skip to content

feat: search community extensions before creating custom models#777

Merged
stack72 merged 1 commit intomainfrom
search-before-build
Mar 19, 2026
Merged

feat: search community extensions before creating custom models#777
stack72 merged 1 commit intomainfrom
search-before-build

Conversation

@stack72
Copy link
Copy Markdown
Contributor

@stack72 stack72 commented Mar 19, 2026

feat: search community extensions before creating custom models

Summary

  • Rewrites Rule docs: add README with project logo #1 in the CLAUDE.md template from "Extension models for service integrations" to "Search before you build", with explicit steps: search local types → search community extensions (swamp extension pull) → install if found → only then create custom
  • Adds a community search step to the swamp-model skill workflow
  • Adds Scenario 5 ("Community Extension Found") to the swamp-extension-model skill showing the happy path where a community extension exists

User Impact

Previously, agents only saw guidance to "create an extension model" in the CLAUDE.md Rules section. The swamp-extension-model skill documented the search-first flow, but agents only loaded that skill after deciding to create a model — too late. Now agents see the search-first guidance immediately in Rule #1, prompting them to run swamp extension search before building anything custom.

Test Plan

  • New unit test: RepoService.init generates CLAUDE.md with extension search guidance — asserts generated CLAUDE.md contains extension search, Search before you build, and swamp model type search
  • All 78 repo service tests pass
  • Full test suite passes
  • deno check, deno lint, deno fmt all pass
  • deno run compile — binary recompiled
  • Manual verification: Asked an agent to "create me a model that I can use to create an aws ec2 instance" — the agent correctly ran swamp model type search "ec2" followed by swamp extension search "ec2 instance" before attempting to create anything, then found a community extension and used swamp extension pull to install it

Closes #757

🤖 Generated with Claude Code

Agents now see "search before you build" as Rule #1 in every swamp-managed
CLAUDE.md, prompting them to check local types and community extensions
before creating custom models. Previously this guidance only appeared in
the swamp-extension-model skill, which agents loaded too late — after
already deciding to build from scratch.

Closes #757

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
fix: use correct command `swamp extension pull` instead of `resolve`

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@stack72 stack72 force-pushed the search-before-build branch from 61c6bcb to 3d3c08e Compare March 19, 2026 15:52
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review: Approved ✅

This PR cleanly implements the "search before you build" guidance with consistent updates across documentation, skills, and code.

What I Verified

Code Quality

  • No any types, TypeScript strict mode compliance
  • Template string change in repo_service.ts is minimal and correct
  • Test follows existing patterns exactly (mirrors the skills section test at line 409)

CLAUDE.md Compliance

  • Unit test lives next to source file ✓
  • Named exports pattern ✓

DDD Principles

  • RepoService remains a well-structured Domain Service
  • No domain model changes - purely documentation/template updates

Test Coverage

  • New test covers 3 key assertions for the extension search guidance
  • Tests the generated CLAUDE.md content, not implementation details

Consistency

  • CLAUDE.md and repo_service.ts template are in sync
  • Skill updates are consistent across swamp-model and swamp-extension-model

No Blocking Issues

The changes are well-scoped, properly tested, and improve agent behavior by surfacing the search-first guidance earlier in Rule #1.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Adversarial Review

Critical / High

None found.

Medium

None found.

Low

None found.

Analysis Summary

This PR consists of:

  • Documentation changes (scenarios.md, SKILL.md, CLAUDE.md): Pure Markdown content additions/modifications
  • Template string update (repo_service.ts:570): Changes Rule #1 text in generateInstructionsBody() from "Extension models for service integrations" to "Search before you build" with expanded guidance
  • Test addition (repo_service_test.ts:426-440): Verifies the new template content

Security: No code injection vectors. The template string is static text that gets written to CLAUDE.md - it describes workflow guidance, not executable commands.

Logic: No branching logic, loops, or conditional paths affected. The change is a string literal substitution.

Error handling: Not applicable - no error paths in the changed code.

Edge cases: Template generation is deterministic. The test verifies substring presence which matches the pattern of existing tests.

API contracts: The public interface of RepoService.init() and RepoService.upgrade() is unchanged. Only the content of the generated CLAUDE.md changes.

Concurrency: Not applicable - no shared state or async coordination affected.

I verified the test assertions match the actual template content:

  • "extension search" ✓ present in template
  • "Search before you build" ✓ present in template
  • "swamp model type search" ✓ present in template

Verdict

PASS - This is a low-risk documentation change with an appropriate test. No logic errors, security issues, or edge cases identified.

@stack72 stack72 merged commit 5364c61 into main Mar 19, 2026
6 checks passed
@stack72 stack72 deleted the search-before-build branch March 19, 2026 15:58
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.

AI agents should search community extensions before offering to create custom models

1 participant