Skip to content

bug(adf compile): refuses to overwrite the vendor files bootstrap just generated, requiring --force on first compile #295

Closed

Description

@stackbilt-admin

Problem

Following the documented order straight from the README:

npx @stackbilt/cli bootstrap --yes          # writes CLAUDE.md, AGENTS.md, .cursorrules, GEMINI.md
npx charter adf compile --target all --write

the second command refuses every file it was asked to write:

[warn] Refused to overwrite CLAUDE.md — no compile banner found (hand-written or pointer stub).
       Pass --force to overwrite. This protects hand-authored CLAUDE.md files.
[warn] Refused to overwrite AGENTS.md — no compile banner found ...
[warn] Refused to overwrite .cursorrules — no compile banner found ...
[warn] Refused to overwrite GEMINI.md — no compile banner found ...

The guard is right in principle: it protects hand-authored files. But here it fires on files Charter itself wrote seconds earlier, so a clean bootstrap leads to a wall of warnings and --force on the very first compile. That trains people to reach for --force, which is exactly the habit the guard exists to prevent.

Suggested fix

  1. Have bootstrap write the compile banner into the vendor files it generates. They are already generated artifacts, so the banner is accurate and the first compile proceeds untouched.
  2. Or record bootstrap-generated vendor files in .charter/ (a hash or a list) and let compile overwrite anything it recognises as its own.
  3. Or have bootstrap run the first compile itself, so the files exist only in compiled form.

Option 1 is smallest and makes the artifact self-describing.

Minor, same area

The bootstrap "Next steps" output suggests:

git add .charter .ai CLAUDE.md .cursorrules agents.md && git commit -m ...

agents.md is lowercase, and the file written on a case-sensitive filesystem is AGENTS.md; GEMINI.md is missing from the list.

Repro

@stackbilt/[email protected], Node 22.14, WSL2, fresh repo with no pre-existing agent files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions