Skip to content

Commit f6909d8

Browse files
Alex Holmbergclaude
authored andcommitted
feat: rewrite command skills to use --agent flag
All 6 scan command skills now use --agent instead of --json/--format json. Each skill includes a Reading Results section documenting compressed output format and available retrieve query filters. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent cd6f565 commit f6909d8

6 files changed

Lines changed: 201 additions & 94 deletions

File tree

skills/commands/syncable-analyze.md

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Analyze a project directory to detect its tech stack: programming languages, fra
1414

1515
## Commands
1616

17-
### Basic analysis (JSON output for agent consumption)
17+
### Basic analysis (agent output)
1818

1919
```bash
20-
sync-ctl analyze <PATH> --json
20+
sync-ctl analyze <PATH> --agent
2121
```
2222

2323
### Human-readable matrix view
@@ -29,31 +29,54 @@ sync-ctl analyze <PATH> --display matrix
2929
### Filtered analysis (only specific aspects)
3030

3131
```bash
32-
sync-ctl analyze <PATH> --json --only languages,frameworks
33-
sync-ctl analyze <PATH> --json --only dependencies
32+
sync-ctl analyze <PATH> --agent --only languages,frameworks
33+
sync-ctl analyze <PATH> --agent --only dependencies
3434
```
3535

3636
### Key Flags
3737

3838
| Flag | Purpose |
3939
|------|---------|
40-
| `--json` | Machine-readable JSON output (always use when processing results) |
40+
| `--agent` | Compressed output for agent consumption (always use when processing results) |
4141
| `--detailed` | Show detailed analysis (legacy vertical format) |
4242
| `--display {matrix\|detailed\|summary}` | Display format for human-readable output |
4343
| `--only <filters>` | Comma-separated: `languages`, `frameworks`, `dependencies` |
4444

4545
## Output Interpretation
4646

47-
The JSON output contains:
47+
When reporting to the user, prioritize: primary language, main framework, runtime version, and whether Docker/K8s infrastructure exists.
4848

49-
- **languages** — detected programming languages with file counts and percentages
50-
- **frameworks** — detected frameworks with versions where available
51-
- **dependencies** — package managers found and dependency counts
52-
- **runtimes** — detected runtime versions (Node.js, Python, Go, Rust, Java)
53-
- **docker** — whether Dockerfiles or Docker Compose files exist
54-
- **monorepo** — whether the project is a monorepo and its structure
49+
## Reading Results
5550

56-
When reporting to the user, prioritize: primary language, main framework, runtime version, and whether Docker/K8s infrastructure exists.
51+
When you use `--agent`, the output is a compressed summary — not the full analysis. Act on it directly for most decisions.
52+
53+
The output JSON includes:
54+
- `summary` — project count, languages, frameworks detected
55+
- `full_data_ref` — reference ID for retrieving full data
56+
- `retrieval_hint` — exact command to get more details
57+
58+
To drill into specifics:
59+
```bash
60+
# Get framework details
61+
sync-ctl retrieve <ref_id> --query "section:frameworks"
62+
63+
# Get language breakdown
64+
sync-ctl retrieve <ref_id> --query "section:languages"
65+
66+
# Get specific project details (monorepos)
67+
sync-ctl retrieve <ref_id> --query "project:<project-name>"
68+
69+
# Get specific language details
70+
sync-ctl retrieve <ref_id> --query "language:Go"
71+
72+
# Get specific framework details
73+
sync-ctl retrieve <ref_id> --query "framework:React"
74+
75+
# List all stored outputs
76+
sync-ctl retrieve --list
77+
```
78+
79+
**Available query filters:** `section:summary`, `section:frameworks`, `section:languages`, `language:<name>`, `framework:<name>`, `project:<name>`, `compact:true`
5780

5881
## Error Handling
5982

@@ -67,15 +90,15 @@ When reporting to the user, prioritize: primary language, main framework, runtim
6790

6891
**Analyze current directory:**
6992
```bash
70-
sync-ctl analyze . --json
93+
sync-ctl analyze . --agent
7194
```
7295

7396
**Analyze a specific project:**
7497
```bash
75-
sync-ctl analyze /path/to/project --json
98+
sync-ctl analyze /path/to/project --agent
7699
```
77100

78101
**Quick language-only check:**
79102
```bash
80-
sync-ctl analyze . --json --only languages
103+
sync-ctl analyze . --agent --only languages
81104
```

skills/commands/syncable-dependencies.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,27 @@ Analyze project dependencies in detail: list all packages, check license types,
1717
### Full dependency analysis with licenses
1818

1919
```bash
20-
sync-ctl dependencies <PATH> --licenses --format json
20+
sync-ctl dependencies <PATH> --licenses --agent
2121
```
2222

2323
### Production dependencies only
2424

2525
```bash
26-
sync-ctl dependencies <PATH> --licenses --prod-only --format json
26+
sync-ctl dependencies <PATH> --licenses --prod-only --agent
2727
```
2828

2929
### Key Flags
3030

3131
| Flag | Purpose |
3232
|------|---------|
33-
| `--format json` | Machine-readable output (always use) |
33+
| `--agent` | Compressed output for agent consumption (always use) |
3434
| `--licenses` | Include license information for each dependency |
3535
| `--vulnerabilities` | Quick inline vulnerability check (for thorough CVE scanning, use the standalone `sync-ctl vulnerabilities` command instead) |
3636
| `--prod-only` | Show only production dependencies |
3737
| `--dev-only` | Show only development dependencies |
3838

3939
## Output Interpretation
4040

41-
The JSON output contains:
42-
43-
- **dependencies** — array of packages with name, version, license, and prod/dev classification
44-
- **summary** — total counts, license distribution
45-
4641
**Priority for reporting to user:**
4742
1. License concerns (copyleft in commercial projects, unknown licenses)
4843
2. Dependency counts (prod vs dev)
@@ -52,6 +47,27 @@ The JSON output contains:
5247
- Use `--vulnerabilities` here for a quick inline check alongside license info
5348
- Use `sync-ctl vulnerabilities` for a dedicated, thorough CVE scan
5449

50+
## Reading Results
51+
52+
When you use `--agent`, the output is a compressed summary. License distribution and dependency counts are always included. Individual package details are available via retrieve for large dependency trees.
53+
54+
The output JSON includes:
55+
- `summary` — total counts, license distribution, prod/dev split
56+
- `license_concerns` — packages with copyleft or unknown licenses
57+
- `full_data_ref` — reference ID for retrieving full data
58+
- `retrieval_hint` — exact command for drill-down
59+
60+
To drill into specifics:
61+
```bash
62+
# Get high-severity license findings
63+
sync-ctl retrieve <ref_id> --query "severity:high"
64+
65+
# Get findings for a specific file
66+
sync-ctl retrieve <ref_id> --query "file:package.json"
67+
```
68+
69+
**Available query filters:** `severity:<level>`, `file:<path>`
70+
5571
## Error Handling
5672

5773
| Error | Cause | Action |
@@ -63,15 +79,15 @@ The JSON output contains:
6379

6480
**Full audit with licenses:**
6581
```bash
66-
sync-ctl dependencies . --licenses --format json
82+
sync-ctl dependencies . --licenses --agent
6783
```
6884

6985
**Production-only for license compliance:**
7086
```bash
71-
sync-ctl dependencies . --licenses --prod-only --format json
87+
sync-ctl dependencies . --licenses --prod-only --agent
7288
```
7389

7490
**Quick vulnerability check alongside deps:**
7591
```bash
76-
sync-ctl dependencies . --licenses --vulnerabilities --format json
92+
sync-ctl dependencies . --licenses --vulnerabilities --agent
7793
```

skills/commands/syncable-optimize.md

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,39 @@ Analyze Kubernetes manifests and optionally live cluster metrics to recommend re
1919
### Static manifest analysis
2020

2121
```bash
22-
sync-ctl optimize <PATH> --format json
22+
sync-ctl optimize <PATH> --agent
2323
```
2424

2525
### Live cluster analysis
2626

2727
```bash
28-
sync-ctl optimize <PATH> --cluster --format json
29-
sync-ctl optimize <PATH> --cluster my-context --namespace default --format json
28+
sync-ctl optimize <PATH> --cluster --agent
29+
sync-ctl optimize <PATH> --cluster my-context --namespace default --agent
3030
```
3131

3232
### With Prometheus metrics
3333

3434
```bash
35-
sync-ctl optimize <PATH> --cluster --prometheus http://localhost:9090 --period 30d --format json
35+
sync-ctl optimize <PATH> --cluster --prometheus http://localhost:9090 --period 30d --agent
3636
```
3737

3838
### Full analysis (includes kubelint + helmlint)
3939

4040
```bash
41-
sync-ctl optimize <PATH> --full --format json
41+
sync-ctl optimize <PATH> --full --agent
4242
```
4343

4444
### Cost estimation
4545

4646
```bash
47-
sync-ctl optimize <PATH> --cluster --cloud-provider aws --region us-east-1 --format json
47+
sync-ctl optimize <PATH> --cluster --cloud-provider aws --region us-east-1 --agent
4848
```
4949

5050
### Key Flags
5151

5252
| Flag | Purpose |
5353
|------|---------|
54-
| `--format json` | Machine-readable output (always use) |
54+
| `--agent` | Compressed output for agent consumption (always use) |
5555
| `--cluster [CONTEXT]` | Connect to live K8s cluster (uses current context if no name given) |
5656
| `--prometheus <URL>` | Prometheus URL for historical metrics |
5757
| `--namespace <NS>` | Target namespace (or `*` for all) |
@@ -67,23 +67,35 @@ sync-ctl optimize <PATH> --cluster --cloud-provider aws --region us-east-1 --for
6767

6868
## Output Interpretation
6969

70-
The JSON output contains:
71-
72-
- **recommendations** — array of optimization suggestions with:
73-
- Resource right-sizing (CPU/memory requests/limits)
74-
- Confidence score
75-
- Current vs recommended values
76-
- Estimated savings
77-
- **costs** — cost attribution per workload (if `--cloud-provider` set)
78-
- **drift** — configuration drift between manifests and running state (if `--cluster` set)
79-
- **security** — kubelint findings (if `--full` set)
80-
8170
**Priority for reporting to user:**
8271
1. High-confidence right-sizing recommendations with cost savings
8372
2. Critical security findings (from `--full`)
8473
3. Drift detection issues
8574
4. Cost breakdown summary
8675

76+
## Reading Results
77+
78+
When you use `--agent`, the output is a compressed summary. High-confidence right-sizing recommendations are included in full. Cost summary and drift findings are always present when applicable.
79+
80+
The output JSON includes:
81+
- `summary` — total recommendations, estimated savings, containers analyzed
82+
- `top_recommendations` — highest-impact right-sizing suggestions
83+
- `costs` — cost attribution summary (if `--cloud-provider` set)
84+
- `drift` — configuration drift issues (if `--cluster` set)
85+
- `full_data_ref` — reference ID for retrieving full data
86+
- `retrieval_hint` — exact command for drill-down
87+
88+
To drill into specifics:
89+
```bash
90+
# Get high-severity findings
91+
sync-ctl retrieve <ref_id> --query "severity:high"
92+
93+
# Get recommendations for a specific container
94+
sync-ctl retrieve <ref_id> --query "container:my-app"
95+
```
96+
97+
**Available query filters:** `severity:<level>`, `container:<name>`
98+
8799
## Safety
88100

89101
- `--fix` only generates suggestions — it does NOT modify files
@@ -95,23 +107,23 @@ The JSON output contains:
95107

96108
| Error | Cause | Action |
97109
|-------|-------|--------|
98-
| `No Kubernetes manifests found` | No YAML with K8s resources | Run `sync-ctl analyze <PATH> --json` to check for K8s presence |
110+
| `No Kubernetes manifests found` | No YAML with K8s resources | Run `sync-ctl analyze <PATH> --agent` to check for K8s presence |
99111
| `Cannot connect to cluster` | Invalid kubeconfig or cluster unreachable | Check `kubectl cluster-info` works, verify context name |
100112
| `Prometheus unreachable` | Wrong URL or Prometheus not running | Verify URL, fall back to static analysis without `--prometheus` |
101113

102114
## Examples
103115

104116
**Quick static analysis:**
105117
```bash
106-
sync-ctl optimize . --format json
118+
sync-ctl optimize . --agent
107119
```
108120

109121
**Full analysis with live cluster and cost estimation:**
110122
```bash
111-
sync-ctl optimize . --cluster --cloud-provider aws --full --format json
123+
sync-ctl optimize . --cluster --cloud-provider aws --full --agent
112124
```
113125

114126
**Preview fixes before applying:**
115127
```bash
116-
sync-ctl optimize . --fix --dry-run --format json
128+
sync-ctl optimize . --fix --dry-run --agent
117129
```

skills/commands/syncable-security.md

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Perform security analysis on a codebase: detect leaked secrets (API keys, tokens
1717
### Standard security scan
1818

1919
```bash
20-
sync-ctl security <PATH> --mode balanced --format json
20+
sync-ctl security <PATH> --mode balanced --agent
2121
```
2222

2323
### Mode Selection Guide
@@ -37,7 +37,7 @@ Always pass `--mode` explicitly. Choose based on context:
3737
| Flag | Purpose |
3838
|------|---------|
3939
| `--mode {lightning\|fast\|balanced\|thorough\|paranoid}` | Scan depth (always specify) |
40-
| `--format json` | Machine-readable output (always use when processing results) |
40+
| `--agent` | Compressed output for agent consumption (always use when processing results) |
4141
| `--include-low` | Include low-severity findings (off by default) |
4242
| `--no-secrets` | Skip secrets detection (only code patterns) |
4343
| `--no-code-patterns` | Skip code pattern analysis (only secrets) |
@@ -46,24 +46,39 @@ Always pass `--mode` explicitly. Choose based on context:
4646

4747
## Output Interpretation
4848

49-
The JSON output contains:
50-
51-
- **findings** — array of security issues, each with:
52-
- `severity` — Critical, High, Medium, Low, Info
53-
- `category` — secrets, code_pattern, configuration, infrastructure
54-
- `file` — exact file path
55-
- `line` — line number
56-
- `description` — what was found
57-
- `remediation` — how to fix it
58-
- **summary** — total counts by severity
59-
- **score** — overall security score (0-100)
60-
6149
**Priority for reporting to user:**
6250
1. Critical findings first (leaked secrets, hardcoded credentials)
6351
2. High findings (insecure patterns)
6452
3. Summary with score
6553
4. Remediation steps for top findings
6654

55+
## Reading Results
56+
57+
When you use `--agent`, the output is a compressed summary (~15KB max). All **critical** issues are included in full detail. High-severity issues show the first 10. Medium/low issues are deduplicated into patterns.
58+
59+
The output JSON includes:
60+
- `status` — e.g., "CRITICAL_ISSUES_FOUND", "HIGH_ISSUES_FOUND", "CLEAN"
61+
- `summary` — counts by severity (total, critical, high, medium, low, info)
62+
- `critical_issues` — full details for every critical finding
63+
- `high_issues` — first 10 high-severity findings
64+
- `patterns` — deduplicated medium/low findings with counts
65+
- `full_data_ref` — reference ID for retrieving full data
66+
- `retrieval_hint` — exact command for drill-down
67+
68+
To drill into specifics:
69+
```bash
70+
# Get all critical findings
71+
sync-ctl retrieve <ref_id> --query "severity:critical"
72+
73+
# Get findings for a specific file
74+
sync-ctl retrieve <ref_id> --query "file:src/auth.rs"
75+
76+
# Get findings by rule code
77+
sync-ctl retrieve <ref_id> --query "code:hardcoded-secret"
78+
```
79+
80+
**Available query filters:** `severity:critical|high|medium|low|info`, `file:<path>`, `code:<id>`
81+
6782
## Error Handling
6883

6984
| Error | Cause | Action |
@@ -76,20 +91,20 @@ The JSON output contains:
7691

7792
**Quick secrets check on current directory:**
7893
```bash
79-
sync-ctl security . --mode balanced --format json
94+
sync-ctl security . --mode balanced --agent
8095
```
8196

8297
**Deep pre-deploy audit:**
8398
```bash
84-
sync-ctl security . --mode paranoid --format json
99+
sync-ctl security . --mode paranoid --agent
85100
```
86101

87102
**Secrets-only scan (skip code patterns):**
88103
```bash
89-
sync-ctl security . --mode thorough --no-code-patterns --format json
104+
sync-ctl security . --mode thorough --no-code-patterns --agent
90105
```
91106

92107
**Save report to file:**
93108
```bash
94-
sync-ctl security . --mode thorough --format json --output security-report.json
109+
sync-ctl security . --mode thorough --agent --output security-report.json
95110
```

0 commit comments

Comments
 (0)