refactor: status always shows both skills and agents

Remove kind filter (agents/--all) from status command — it now defaults
to showing everything, matching diff behavior. Status is a read-only
overview command; users expect the full picture without extra flags.

- Remove parseKindArgWithAll from cmdStatus, hardcode kindAll
- Update help text and usage examples
- Simplify tests: merge agents/all variants into default tests
- Update runbook steps 9-11 → 9-10
This commit is contained in:
Willie
2026-04-08 21:40:03 +08:00
parent eadfcf3d6f
commit 525ae0b9f4
4 changed files with 37 additions and 79 deletions
+6 -17
View File
@@ -153,10 +153,10 @@ ss sync --all -g
Expected:
- exit_code: 0
### 9. Status agents — text output
### 9. Status — shows skills and agents by default
```bash
ss status agents -g
ss status -g
```
Expected:
@@ -164,10 +164,10 @@ Expected:
- regex: [Aa]gent
- regex: [Ss]ource
### 10. Status agents — JSON output
### 10. Status JSON — includes agents by default
```bash
ss status agents --json -g
ss status --json -g
```
Expected:
@@ -175,17 +175,6 @@ Expected:
- jq: .agents.exists == true
- jq: .agents.count == 3
### 11. Status all — includes both skills and agents
```bash
ss status --all --json -g
```
Expected:
- exit_code: 0
- jq: .agents != null
- jq: .agents.count == 3
### 12. Diff agents — no drift after sync
```bash
@@ -440,8 +429,8 @@ Expected:
- [ ] `sync agents --dry-run` makes no changes
- [ ] Default `sync` does NOT sync agents
- [ ] `sync all` syncs both skills and agents
- [ ] `status agents` shows agent source and target info
- [ ] `status agents --json` returns structured agent data
- [ ] `status` shows both skills and agents by default
- [ ] `status --json` includes agents section
- [ ] `diff agents` shows drift status
- [ ] `collect agents` collects local agent files to source
- [ ] `uninstall agents <name> --force` moves agent to trash
+6 -9
View File
@@ -91,8 +91,8 @@ func cmdStatus(args []string) error {
applyModeLabel(mode)
// Extract kind filter (e.g. "skillshare status agents" or "--all").
kind, rest := parseKindArgWithAll(rest)
// status always shows both skills and agents (no kind filter needed).
kind := kindAll
jsonOutput := hasFlag(rest, "--json")
@@ -531,21 +531,18 @@ func checkSkillVersion(cfg *config.Config) {
}
func printStatusHelp() {
fmt.Println(`Usage: skillshare status [agents] [options]
fmt.Println(`Usage: skillshare status [options]
Show status of source, skills, and all targets.
Show status of source, skills, agents, and all targets.
Options:
--all Show both skills and agents
--json Output results as JSON
--project, -p Use project-level config
--global, -g Use global config
--help, -h Show this help
Examples:
skillshare status Show current state
skillshare status Show current state (skills + agents)
skillshare status --json Output as JSON
skillshare status -p Show project status
skillshare status agents Show agents status only
skillshare status --all Show both skills and agents`)
skillshare status -p Show project status`)
}
+6 -24
View File
@@ -10,9 +10,9 @@ import (
"skillshare/internal/testutil"
)
// --- status agents ---
// --- status (always shows skills + agents) ---
func TestStatus_Agents_ShowsAgentInfo(t *testing.T) {
func TestStatus_ShowsAgentInfo(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
@@ -31,13 +31,13 @@ targets:
path: ` + claudeAgents + `
`)
result := sb.RunCLI("status", "agents")
result := sb.RunCLI("status")
result.AssertSuccess(t)
result.AssertAnyOutputContains(t, "Agents")
result.AssertAnyOutputContains(t, "2 agents")
}
func TestStatus_Agents_JSON_IncludesAgents(t *testing.T) {
func TestStatus_JSON_IncludesAgents(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
@@ -47,13 +47,13 @@ func TestStatus_Agents_JSON_IncludesAgents(t *testing.T) {
sb.WriteConfig(`source: ` + sb.SourcePath + "\ntargets: {}\n")
result := sb.RunCLI("status", "agents", "--json")
result := sb.RunCLI("status", "--json")
result.AssertSuccess(t)
result.AssertAnyOutputContains(t, `"agents"`)
result.AssertAnyOutputContains(t, `"count"`)
}
func TestStatus_Default_NoAgentSection(t *testing.T) {
func TestStatus_Default_ShowsBothSkillsAndAgents(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
@@ -67,24 +67,6 @@ func TestStatus_Default_NoAgentSection(t *testing.T) {
result := sb.RunCLI("status")
result.AssertSuccess(t)
// Default status should NOT include agent section
result.AssertOutputNotContains(t, "Agents")
}
func TestStatus_All_ShowsBoth(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
sb.CreateSkill("my-skill", map[string]string{
"SKILL.md": "---\nname: my-skill\n---\n# Content",
})
createAgentSource(t, sb, map[string]string{
"tutor.md": "# Tutor agent",
})
sb.WriteConfig(`source: ` + sb.SourcePath + "\ntargets: {}\n")
result := sb.RunCLI("status", "--all")
result.AssertSuccess(t)
result.AssertAnyOutputContains(t, "Source") // skill section
result.AssertAnyOutputContains(t, "Agents") // agent section
}
+19 -29
View File
@@ -50,42 +50,31 @@ func setupProjectWithAgents(t *testing.T, sb *testutil.Sandbox) string {
return projectDir
}
// --- status -p agents ---
// --- status -p (always shows skills + agents) ---
func TestStatusProject_Agents(t *testing.T) {
func TestStatusProject_ShowsAgents(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
projectDir := setupProjectWithAgents(t, sb)
result := sb.RunCLIInDir(projectDir, "status", "-p", "agents")
result.AssertSuccess(t)
result.AssertAnyOutputContains(t, "Agents")
result.AssertAnyOutputContains(t, "1 agents")
}
func TestStatusProject_Agents_JSON(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
projectDir := setupProjectWithAgents(t, sb)
result := sb.RunCLIInDir(projectDir, "status", "-p", "agents", "--json")
result.AssertSuccess(t)
result.AssertAnyOutputContains(t, `"agents"`)
result.AssertAnyOutputContains(t, `"count"`)
}
func TestStatusProject_All(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
projectDir := setupProjectWithAgents(t, sb)
result := sb.RunCLIInDir(projectDir, "status", "-p", "--all")
result := sb.RunCLIInDir(projectDir, "status", "-p")
result.AssertSuccess(t)
result.AssertAnyOutputContains(t, "Source") // skill section
result.AssertAnyOutputContains(t, "Agents") // agent section
result.AssertAnyOutputContains(t, "1 agents")
}
func TestStatusProject_JSON_IncludesAgents(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
projectDir := setupProjectWithAgents(t, sb)
result := sb.RunCLIInDir(projectDir, "status", "-p", "--json")
result.AssertSuccess(t)
result.AssertAnyOutputContains(t, `"agents"`)
result.AssertAnyOutputContains(t, `"count"`)
}
// --- check -p agents ---
@@ -266,14 +255,15 @@ func TestSyncProject_All_NestedAgentsSameBasename_FlattensAndStaysStable(t *test
// --- default -p (skills only, unchanged) ---
func TestStatusProject_Default_SkillsOnly(t *testing.T) {
func TestStatusProject_Default_ShowsBoth(t *testing.T) {
sb := testutil.NewSandbox(t)
defer sb.Cleanup()
projectDir := setupProjectWithAgents(t, sb)
// status now always shows both skills and agents
result := sb.RunCLIInDir(projectDir, "status", "-p")
result.AssertSuccess(t)
result.AssertAnyOutputContains(t, "Source")
result.AssertOutputNotContains(t, "Agents")
result.AssertAnyOutputContains(t, "Agents")
}