agentsclimarketplace

Profile scoped config dir

Skill kjuhwa/skills-hub/skills/cli/profile-scoped-config-dir

Per-profile CLI config directories (~/.myapp/profiles/<name>/) so users can run multiple environments (prod, staging, worktrees) side-by-side without collisions.From its SKILL.md

Install
npx -y skills add kjuhwa/skills-hub --skill profile-scoped-config-dir

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.4 KB, 657 tokens by cl100k_base, as published. Nobody here has run it

When to use

  • CLI that manages long-lived background state (daemon PID, local token, workspace roots).
  • Users want to point at cloud and a self-host at the same time, or run multiple dev environments.

Steps

  1. Define a profile root per-profile, everything in it is scoped:
    ~/.myapp/
      config.json               # default profile (legacy / implicit)
      daemon.pid                # default daemon PID
      profiles/
        staging/
          config.json
          daemon.pid
          daemon.log
        dev-feat-auth-347/
          config.json
          daemon.pid
          workspaces/           # per-profile work dir
    
  2. Accept --profile <name> on every command that reads/writes profile state. Without it, use the default root:
    profile, _ := cmd.Flags().GetString("profile")
    cfgDir := defaultConfigDir()
    if profile != "" { cfgDir = filepath.Join(defaultConfigDir(), "profiles", profile) }
    
  3. Derive per-profile ports deterministically from the profile name:
    func profileHealthPort(profile string) int {
        if profile == "" { return defaultHealthPort }
        h := fnv.New32a(); h.Write([]byte(profile))
        return defaultHealthPort + 1 + int(h.Sum32()%1000)
    }
    
  4. Include the profile name in log lines and in any daemon-registered runtime display name, so "which daemon is this?" is obvious from UI.
  5. Document the isolation table in CONTRIBUTING:
    ResourceDefaultProfile mode
    Config~/.myapp/config.json~/.myapp/profiles/<name>/config.json
    Daemon PID~/.myapp/daemon.pid~/.myapp/profiles/<name>/daemon.pid
    Health porte.g. 1951419514 + 1 + hash(name)%1000
    Workspaces dir~/myapp_workspaces/~/myapp_workspaces_<name>/

Example

Concurrent environments:

myapp setup                                  # default profile → cloud
myapp setup self-host                        # default profile → now localhost (overwrites!)
myapp setup self-host --profile staging      # staging profile → staging server
myapp daemon start --profile staging         # staging daemon
myapp daemon status --profile staging        # only reports this daemon
myapp daemon logs -f                         # default daemon's logs, unaffected

Caveats

  • Commands MUST error loud if a profile name doesn't exist, rather than silently falling back to default — users trust the flag to be strict.
  • Before setup overwrites an existing profile config, prompt "continue? y/N" unless --force.
  • When building PATH for the daemon's child processes, prepend the daemon's own binary dir so agent-spawned myapp calls hit the same binary.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,871. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.