agentleFS
iadr-deviadr-dev/greenlight/skills/adopt/SKILL.md

adopt

Skill2 starsChanged 5 days agoMITView on GitHub

Bring existing code under greenlight by writing rules and examples that describe what it already does, with tests that pass today and locks that keep them honest. Use when the user runs /greenlight:adopt "<area of the code>", or asks to add tests and specs to code that already exists before changing it.

27 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use create-stories, story-done and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • lilangMaxSkill

    create-stories

    Break a single epic into implementable story files. Reads the epic, its GDD, governing ADRs, and control manifest. Each story embeds its GDD requirement TR-ID, ADR guidance, acceptance criteria, story type, and test evidence path. Run after /create-epics for each epic.

    Also in 11 projects that use this

  • lilangMaxSkill

    story-done

    End-of-story completion review. Reads the story file, verifies each acceptance criterion against the implementation, checks for GDD/ADR deviations, prompts code review, updates story status to Complete, and surfaces the next ready story from the sprint.

    Also in 11 projects that use this

  • +10 more from lilangMax

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 25 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the person actually wants the behaviour to change, say so and offer /greenlight:feature instead.

    line 29
  2. Very specific:

    Follow the loop of the feature skill phase by phase with these differences (details in phases/adopt.md):

    line 36
  3. Distinctive:

    Verify with the spec-auditor as usual.

    line 45

“Common” is measured: kept by at least 6 in 10 of the 25 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

greenlight adopt (the orchestrator for existing code)

You run in the main session, exactly as the feature skill does: you drive the phases, you talk to the person, and you are the only one who records anything. The phase agents cannot ask the person and report instead of recording. Read ${CLAUDE_PLUGIN_ROOT}/skills/feature/SKILL.md for the loop, the rules for questions, change requests, costs and assumptions, and the human gates; they all apply. Then read ${CLAUDE_PLUGIN_ROOT}/phases/adopt.md: it lists what is different, and it is the plan.

Arguments: $ARGUMENTS

What an adoption is

A normal feature goes red, then green, with new code in between. An adoption describes behaviour the system already has: every scenario is tagged @existing, the tests pass from the start, and no production code is written or changed. Its value is the safety net: afterwards a change to that area goes through /greenlight:feature or /greenlight:change with locked, traced tests behind it.

Before anything

  • The project must be set up (.bdd/config.toml exists); if not, tell the person to run /greenlight:init and stop.
  • The arguments must name an area of the code that can be described in a handful of rules. If it is vague or large, look at the repository read-only, propose slices, and ask which one to start with. One slice per adoption.
  • If the person actually wants the behaviour to change, say so and offer /greenlight:feature instead.
  • Settle the autonomy level once, as the feature skill does.
  • The working tree should be committed or at least understood: the bind gate pins the production source as it is then.

Run it

  1. bdd state next-id, then bdd state init FEAT-n --title "<area>" --adopt --autonomy LEVEL.
  2. Follow the loop of the feature skill phase by phase with these differences (details in phases/adopt.md):
    • Tell every agent in its task: this is an adoption, describe existing behaviour, tag every scenario @existing, change no production code, cite where each rule was observed.
    • Code that looks wrong is a question for the person, never a rule and never a fix.
    • At bind: lock the bound files, then bdd gate FEAT-n bind --result pass --record-red (the run is a valid red because every scenario is @existing and passes).
    • tasks and implement have no agent. Pass tasks with --detail adopt=true. For implement run bdd run FEAT-n, bdd classify FEAT-n --expect green and bdd adopt FEAT-n --check yourself, then bdd gate FEAT-n implement --result pass --detail adopt=true. Never start the implementer.
    • Verify with the spec-auditor as usual.
  3. The person types /greenlight:approve FEAT-n rules and /greenlight:approve FEAT-n examples. You never do.

Never

  • Edit a production file, a feature file, a step or a driver yourself, or let an agent edit production code. The gates implement and verify refuse an adoption whose production source changed since the bind gate.
  • Turn a failing scenario into a passing one by changing the code. Fix the scenario (the reading was wrong) or ask the person.
  • Present an adoption as a change of behaviour, or the reverse.

When it is done

Show the report's verdict, bdd trace FEAT-n, the enforcement level, the assumptions, the cost per phase, any code that looked wrong (as questions the person may want to turn into a feature), and the next slice if there was one. Then stop; do not start the next adoption on your own.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.