You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add sources --format, optimize gateway commands, improve test coverage
Features:
- Add --format json option to sources command per RFC-0002:C-SOURCES
Performance:
- outline: use pre-built headings index when available (O(1) vs O(n) file scan)
- sources: optimize mark_last_entries from O(n²) to O(n)
Tests:
- Add unit tests for index.rs (76% → 96%) and sync.rs (70% → 86%)
- Add unit tests for logging.rs (78% → 93%)
- Add integration tests for logging behavior
- Add outline tests for both built (index) and unbuilt (fallback) paths
- Add sources integration tests for all options
Docs:
- Update RFC-0002 with --format option for sources
- Update README with sources --format json example
- Update CHANGELOG with new features and performance improvements
- Fix outdated lint rule numbers in validating.md workflow
- Add tree output example to testing.md workflow
Overall test coverage: 87.93% → 88.48%
Copy file name to clipboardExpand all lines: gov/rfc/RFC-0002/clauses/C-SOURCES.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,6 @@
3
3
"title": "Sources Command",
4
4
"kind": "normative",
5
5
"status": "active",
6
-
"text": "**Syntax:** `skc sources <skill> [options]`\n\nThe sources command MUST list all files in the skill's source directory in a tree-style format.\n\n**Options:**\n\n| Option | Description |\n|--------|-------------|\n| `--depth <n>` | Maximum tree depth to display (default: unlimited) |\n| `--dir <path>` | Scope listing to a subdirectory |\n| `--limit <n>` | Maximum entries to display (default: 100) |\n| `--pattern <glob>` | Filter files by glob pattern (e.g., `*.md`) |\n\n**Output format:**\n\nThe command MUST output a tree-style directory listing:\n- Files are listed with their relative paths\n- Directories that are not expanded MUST show a file count suffix: `dirname/ (N files)`\n- When `--limit` is exceeded, output MUST end with a truncation indicator: `... (N more)`\n\n**Ordering:**\nEntries MUST be sorted lexicographically by relative path (bytewise ASCII order), with directories listed before files at each level.\n\n**Example output:**\n\n```\n$ skc sources cuda --depth 2\ncuda/\n├── SKILL.md\n├── references/\n│ ├── compilation.md\n│ ├── cuda-driver-docs/ (156 files)\n│ ├── cuda-runtime-docs/ (89 files)\n│ ├── debugging-tools.md\n│ └── ... (8 more)\n```\n\n**Scoped listing:**\n\nWhen `--dir` is provided, the command MUST:\n- Validate that the path exists within the skill root\n- Display the subtree rooted at that directory\n- Apply `--depth` relative to the specified directory\n\n**Path safety:**\nThe command MUST reject any `--dir` path that would resolve outside the skill source directory after canonicalization. See [[RFC-0005:C-CODES]] for error E012.",
6
+
"text": "**Syntax:** `skc sources <skill> [options]`\n\nThe sources command MUST list all files in the skill's source directory in a tree-style format.\n\n**Options:**\n\n| Option | Description |\n|--------|-------------|\n| `--depth <n>` | Maximum tree depth to display (default: unlimited) |\n| `--dir <path>` | Scope listing to a subdirectory |\n| `--limit <n>` | Maximum entries to display (default: 100) |\n| `--pattern <glob>` | Filter files by glob pattern (e.g., `*.md`) |\n| `--format <fmt>` | Output format: `text` (default) or `json` |\n\n**Output format:**\n\nThe command MUST output a tree-style directory listing:\n- Files are listed with their relative paths\n- Directories that are not expanded MUST show a file count suffix: `dirname/ (N files)`\n- When `--limit` is exceeded, output MUST end with a truncation indicator: `... (N more)`\n\n**Ordering:**\nEntries MUST be sorted lexicographically by relative path (bytewise ASCII order), with directories listed before files at each level.\n\n**Example output:**\n\n```\n$ skc sources cuda --depth 2\ncuda/\n├── SKILL.md\n├── references/\n│ ├── compilation.md\n│ ├── cuda-driver-docs/ (156 files)\n│ ├── cuda-runtime-docs/ (89 files)\n│ ├── debugging-tools.md\n│ └── ... (8 more)\n```\n\n**Scoped listing:**\n\nWhen `--dir` is provided, the command MUST:\n- Validate that the path exists within the skill root\n- Display the subtree rooted at that directory\n- Apply `--depth` relative to the specified directory\n\n**Path safety:**\nThe command MUST reject any `--dir` path that would resolve outside the skill source directory after canonicalization. See [[RFC-0005:C-CODES]] for error E012.",
0 commit comments