playbook/antigravity-awesome-skills/skills/ecl-harness-engineer/references/adapters/generic.md

4.4 KiB

adapter
language display_name version detection commands package_manager route_detection import_analysis layer_conventions dependency_detection linter naming ci
generic Generic (Auto-Discovery) 1.0
files confidence
0.10
build test lint lint_arch format start dev
null null null null null null null
detection default install_command
null null
server_indicators cli_indicators frontend_indicators patterns
pattern description frameworks
listen|serve|http|server Generic HTTP server indicator
pattern description frameworks
argv|args|argparse|getopt|flag Generic CLI argument parsing
pattern description frameworks
index\.html|<!DOCTYPE html> HTML file presence
list_packages import_pattern source_extensions module_root_file
null null
null
patterns
layer paths description
0
types
models
domain
entities
Core types (generic convention)
layer paths description
1
utils
lib
common
helpers
shared
Shared utilities (generic convention)
layer paths description
2
services
core
business
logic
Business logic (generic convention)
layer paths description
3
handlers
controllers
api
routes
endpoints
API layer (generic convention)
layer paths description
4
main
cmd
bin
app
src/index
src/main
Entry points (generic convention)
manifest_file databases services env_var_patterns
null
template_section script_extension run_command
null null null
file_pattern test_pattern directory_style
null null null
github_actions
image setup_steps cache_paths
ubuntu-latest

Generic Adapter (Auto-Discovery Fallback)

This adapter activates when no language-specific adapter matches. Instead of assuming a specific language (previous behavior: defaulting to Go), it discovers commands from project conventions.

Discovery Strategy

1. Makefile Discovery

If a Makefile exists, parse targets:

# Extract make targets
grep -E '^[a-zA-Z_-]+:' Makefile | sed 's/:.*//'

Common target mappings:

Target Pattern Mapped Command
build, compile commands.build
test, check commands.test
lint, lint-arch commands.lint, commands.lint_arch
fmt, format commands.format
run, start, serve commands.start
dev, watch commands.dev

2. README Discovery

If no Makefile, scan README.md for code blocks with common commands:

# Look for fenced code blocks with build/test commands
grep -A 2 '```' README.md

3. package.json Scripts Discovery (non-Node projects)

Some non-Node projects use package.json for script aliases:

# Check if package.json scripts exist
cat package.json | python3 -c "import sys,json; [print(k,v) for k,v in json.load(sys.stdin).get('scripts',{}).items()]"

4. docker-compose.yml Discovery

If docker-compose.yml exists, extract service definitions for environment setup.

When Generic Adapter Activates

The generic adapter is the last resort. It activates only when:

  1. No go.mod, package.json, pyproject.toml, pom.xml, Cargo.toml exists
  2. Or when the user explicitly requests generic mode

Behavior Differences from Language-Specific Adapters

Aspect Language Adapter Generic Adapter
Build command Hardcoded default Discovered from Makefile/README
Route detection Framework-specific regex Generic HTTP patterns only
Layer conventions Language-idiomatic paths Common directory names
Linter Language-specific template None (rely on existing tools)
CI template Language-specific image Ubuntu with custom steps

Extending to New Languages

If you find yourself repeatedly using the generic adapter for a specific language, that's a signal to create a proper language adapter. See adapter-schema.md for the schema to follow.