agentleFS
openbootdotdevopenbootdotdev/openboot/.agents/skills/bootstrap-feature/SKILL.md

bootstrap-feature

Skill277 starsChanged 35 days agoMITView on GitHub

Use when adding a new CLI subcommand or feature to openboot. Walks through the canonical pattern: cobra command registration, runner wiring, archtest awareness, and test placement. Trigger when the user says "add a command", "new subcommand", "implement feature X for the CLI", or starts editing under internal/cli/.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Koroqe/claude-code-sdlc★ 52same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    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 your feature shells out, use the Runner pattern so L1 tests can fake subprocess calls.

    line 63
  2. Very specific:

    Default to faked-runner L1 unless the thing you're testing only exists when a real brew/git/npm is on the path — then add an integration …

    line 97
  3. Distinctive:

    If archtest fails with a new violation, fix the code rather than baselining — the baseline is for *intentional* exceptions and they require …

    line 108

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Bootstrap a new openboot feature

This skill gives the canonical recipe for adding a new CLI command or feature to openboot without violating project invariants.

Step 1 — Where the code goes

Kind of thingLocation
New CLI subcommandinternal/cli/<verb>.go, register in internal/cli/root.go init()
Subprocess call (any binary)internal/system.RunCommand / RunCommandSilent — do not call exec.Command directly
HTTP call (any URL)internal/httputil.Do — handles 429 + Retry-After
Path under ~os.UserHomeDir() — never os.Getenv("HOME"), never hardcode ~
User-visible outputinternal/ui.* helpers — never raw fmt.Println
Destructive actionguarded by cfg.DryRun check
Error returned to callerwrapped: fmt.Errorf("context: %w", err)

These are enforced (or planned) by internal/archtest. The rule that covers each invariant is listed in AGENTS.md.

Step 2 — Cobra command skeleton

// internal/cli/myverb.go
package cli

import "github.com/spf13/cobra"

func newMyVerbCmd() *cobra.Command {
	var flag string
	cmd := &cobra.Command{
		Use:   "myverb [arg]",
		Short: "One-line description",
		Long:  "Longer description if useful.",
		Args:  cobra.ExactArgs(1),
		RunE: func(cmd *cobra.Command, args []string) error {
			return runMyVerb(cmd.Context(), args[0], flag)
		},
	}
	cmd.Flags().StringVar(&flag, "flag", "", "Description of the flag")
	return cmd
}

Register it in internal/cli/root.go:

rootCmd.AddCommand(newMyVerbCmd())

Step 3 — Runner interface for testability

If your feature shells out, use the Runner pattern so L1 tests can fake subprocess calls. Example from internal/brew/runner.go:

type Runner interface {
	Output(args ...string) ([]byte, error)
	CombinedOutput(args ...string) ([]byte, error)
	// ...
}

// realRunner uses exec.Command — this file is in execAllowedPaths.
type realRunner struct{}

func New() *Brew { return &Brew{r: &realRunner{}} }

Then in tests:

type fakeRunner struct { ... }
func (f *fakeRunner) Output(args ...string) ([]byte, error) { ... }

This is the pattern that lets the fake-runner half of L1 stay fast and hermetic.

Step 4 — Test placement

ScopeTierBuild tagWhere
Pure logic + fakesL1none<pkg>/<feature>_test.go
Real subprocess in temp dirL1nonetest/integration/<feature>_integration_test.go
Compiled binary, no installsL3e2etest/e2e/...
Real installs on macOSL4 (VM)e2e,vmtest/e2e/...

Default to faked-runner L1 unless the thing you're testing only exists when a real brew/git/npm is on the path — then add an integration test under test/integration/ (no build tag; it runs as part of L1).

Step 5 — Verify before committing

go vet ./...
make test-unit                  # ~75s, includes archtest + integration

If archtest fails with a new violation, fix the code rather than baselining — the baseline is for intentional exceptions and they require justification in the commit message.

Step 6 — Conventional commit

feat: add openboot myverb command for X

One thing per commit. If you also fixed an unrelated bug along the way, split it into a separate commit.

Common mistakes

  1. Calling exec.Command from the feature file — refactor through internal/system or add a Runner. archtest will catch this.
  2. Skipping cfg.DryRun check — destructive ops must be a no-op under --dry-run. Print "[DRY-RUN] Would X" instead of doing X.
  3. Hardcoding ~/ — always os.UserHomeDir() then filepath.Join.
  4. Raw fmt.Println — use ui.Info, ui.Success, ui.Warn, ui.Error.
  5. Forgetting to register the command in root.go — cobra silently does nothing if AddCommand is missed.

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.