You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a mold's only content lives under a dot-prefixed top-level directory (e.g. .claude/, .cursor/, .codex/), ailloy cast silently installs nothing because discoverTopLevelDirs in pkg/mold/output.go:168 excludes any entry whose name starts with .. Authors must add an explicit output: mapping in flux.yaml like:
output:
.claude: .claude
This is a sharp edge — the canonical Ailloy use case is shipping commands and rules to AI coding agents, all of which conventionally live in dot-prefixed directories. A new mold author who scaffolds .claude/commands/foo.md, runs cast, and sees an empty target directory has no signal that anything went wrong.
This was found during end-to-end testing of the foundry index system in PR #81 against a private kriscoleman/foundry-test repo: a minimal mold with only .claude/commands/hello.md produced an "✅ Project casting complete!" message but installed no files.
Proposed Change
Add an allowlist of well-known AI-agent directories to pkg/mold/output.go that are auto-discovered despite their dot-prefix. Initial entries:
.claude (Claude Code)
.cursor (Cursor)
.codex (Codex)
.opencode (OpenCode)
.windsurf (Windsurf)
.continue (Continue)
.aider (Aider)
.github (GitHub Copilot lives at .github/copilot-instructions.md, plus shared workflow blanks)
.gemini (Gemini CLI)
Behavior:
A mold whose only top-level content is one of these dirs will install correctly with no flux.yaml output mapping.
An explicit output: mapping in flux.yaml continues to override auto-discovery (no behavior change for existing molds).
Other dot-prefixed dirs (e.g. .git, .idea, .vscode-test) remain excluded.
The same allowlist should be applied to discoverRootFiles for analogous root-level dotfiles where it makes sense (e.g. .cursorrules, .aider.conf.yml) — confirm during implementation whether that's symmetric.
Acceptance Criteria
pkg/mold/output.go exports a named allowlist (e.g. wellKnownAgentDirs) alongside reservedDirs with the directories listed above.
discoverTopLevelDirs includes a dot-prefixed dir if and only if its name is in the allowlist.
A mold containing only .claude/commands/hello.md (no flux.yaml) installs .claude/commands/hello.md to the project root via ailloy cast.
Same passes for .cursor/, .codex/, .opencode/, .windsurf/, .continue/, .aider/, .github/, .gemini/.
A mold containing .git/ or .idea/ is still excluded from auto-discovery.
Existing molds that use explicit output: mappings continue to behave unchanged.
Unit tests in pkg/mold/output_test.go (or equivalent) cover both allowlisted and non-allowlisted dot-prefixed dirs.
If discoverRootFiles gets symmetric treatment, well-known root dotfiles (.cursorrules, etc.) are covered by tests too.
assay lint output mentions when a mold relies on the allowlist, so authors aren't surprised (optional — confirm during implementation).
Notes
Source pointer: the exclusion lives at pkg/mold/output.go:168 (strings.HasPrefix(name, ".")) and at :190 for root files.
Keep the allowlist as a single source of truth — both auto-discovery paths (identity mode and the string output: parent form) use discoverTopLevelDirs, so a single change covers both.
Consider whether the allowlist should be configurable via mold.yaml (autoDiscover: [".myagent"]) for forward-compat with new tools — likely overkill for v1, but worth a sentence in the PR description.
When a mold's only content lives under a dot-prefixed top-level directory (e.g.
.claude/,.cursor/,.codex/),ailloy castsilently installs nothing becausediscoverTopLevelDirsinpkg/mold/output.go:168excludes any entry whose name starts with.. Authors must add an explicitoutput:mapping influx.yamllike:This is a sharp edge — the canonical Ailloy use case is shipping commands and rules to AI coding agents, all of which conventionally live in dot-prefixed directories. A new mold author who scaffolds
.claude/commands/foo.md, runscast, and sees an empty target directory has no signal that anything went wrong.This was found during end-to-end testing of the foundry index system in PR #81 against a private
kriscoleman/foundry-testrepo: a minimal mold with only.claude/commands/hello.mdproduced an "✅ Project casting complete!" message but installed no files.Proposed Change
Add an allowlist of well-known AI-agent directories to
pkg/mold/output.gothat are auto-discovered despite their dot-prefix. Initial entries:.claude(Claude Code).cursor(Cursor).codex(Codex).opencode(OpenCode).windsurf(Windsurf).continue(Continue).aider(Aider).github(GitHub Copilot lives at.github/copilot-instructions.md, plus shared workflow blanks).gemini(Gemini CLI)Behavior:
flux.yamloutput mapping.output:mapping influx.yamlcontinues to override auto-discovery (no behavior change for existing molds)..git,.idea,.vscode-test) remain excluded.discoverRootFilesfor analogous root-level dotfiles where it makes sense (e.g..cursorrules,.aider.conf.yml) — confirm during implementation whether that's symmetric.Acceptance Criteria
pkg/mold/output.goexports a named allowlist (e.g.wellKnownAgentDirs) alongsidereservedDirswith the directories listed above.discoverTopLevelDirsincludes a dot-prefixed dir if and only if its name is in the allowlist..claude/commands/hello.md(noflux.yaml) installs.claude/commands/hello.mdto the project root viaailloy cast..cursor/,.codex/,.opencode/,.windsurf/,.continue/,.aider/,.github/,.gemini/..git/or.idea/is still excluded from auto-discovery.output:mappings continue to behave unchanged.pkg/mold/output_test.go(or equivalent) cover both allowlisted and non-allowlisted dot-prefixed dirs.discoverRootFilesgets symmetric treatment, well-known root dotfiles (.cursorrules, etc.) are covered by tests too.assaylint output mentions when a mold relies on the allowlist, so authors aren't surprised (optional — confirm during implementation).Notes
pkg/mold/output.go:168(strings.HasPrefix(name, ".")) and at:190for root files.output:parent form) usediscoverTopLevelDirs, so a single change covers both.mold.yaml(autoDiscover: [".myagent"]) for forward-compat with new tools — likely overkill for v1, but worth a sentence in the PR description.