Repo Adaptivity
Forge adapts to the repository it runs in. Rather than applying one fixed setup everywhere, it builds a repo profile — stack, test/lint commands, git provider, size, related repos — and uses it to decide what is actually relevant for this project.
The most visible payoff: skills that don't apply to your stack are pruned, so the agent's context stays focused instead of carrying Terraform guidance in a repo with no infrastructure.
What gets detected
| Signal | Source |
|---|---|
| Stack | marker files — go.mod → go, package.json → node (+ web when a UI framework dep is present), pyproject.toml/requirements.txt → python, Cargo.toml → rust, Gemfile → ruby, pom.xml/build.gradle → jvm, *.tf → terraform, Dockerfile/compose → docker, serverless.yml/functions/ → serverless, GitHub workflows or .gitlab-ci.yml → ci |
| Test / lint commands | the same detection forge verify uses |
| Provider | resolved via the provider adapters |
| Related repos | repo.related in .forge/config.yaml |
| Size | a rough source-file count → small (<200), medium (<2000), large (≥2000) |
forge profile
Read-only. Shows how forge sees this repository:
$ forge profile
Repo profile:
stack: ci, go
test: go test ./...
lint: go vet ./...
provider: GitLab
location: gitlab.com/acme/platform/api
cli: glab
size: medium (1259 files)
Skills: 26 relevant, 4 skipped for this stack
skipped:
- security-headers-audit
- serverless-security
- terraform-security-audit
- api-rate-limitingFour skills pruned here: this repository has no web surface, no serverless functions, and no Terraform — so guidance for those would be noise.
Skill relevance rules
A skill is skipped only when it requires a stack token the repo lacks. Everything else — all SDD and workflow skills, plus the stack-agnostic security skills (secrets-management, sbom-supply-chain, llm-guardrails, security-framework-mappings) — is always relevant.
| Skill | Requires |
|---|---|
go-testing | go |
terraform-security-audit | terraform |
serverless-security | serverless |
security-headers-audit | web |
api-rate-limiting | web |
devsecops-pipeline-scanning | ci |
Advisory today
forge profile reports the relevant/skipped split; it does not yet prune what install/sync inject. That wiring lands behind an opt-in flag so the existing behavior stays unchanged until you ask for it.
Why it matters
Context is the scarce resource for a coding agent. Every irrelevant skill, convention, or instruction competes with the ones that matter. Repo adaptivity is how forge keeps the harness proportional to the project: the same binary behaves differently — and more sharply — in a Go service, a Next.js app, and a Terraform module.
Adaptivity also runs through the workflow itself: adaptive depth scales ceremony to the size and risk of each change, so a typo doesn't pay the full pipeline tax.