Claude-skill-registry ctx-collector
Scan and aggregate task checkboxes from Speckit (.specify/) and context-planning (specs/) formats into a unified backlog.yaml, with automatic project context analysis and auto-update capabilities.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/ctx-collector" ~/.claude/skills/majiayu000-claude-skill-registry-ctx-collector && rm -rf "$T"
skills/data/ctx-collector/SKILL.mdctx-collector
Purpose
Aggregate task checkboxes from multiple task file formats across project repositories and maintain comprehensive project context reports. This skill operates in "no-clone mode"—it only reads from existing local directories under
projects/, making it safe and fast for continuous scanning.
Key Features:
- Multi-format support:
(Speckit) and.specify/
(context-planning) directoriesspecs/ - Project context analysis: Automatic tech stack, structure, and dependency extraction
- Auto-update system: Git hooks keep project reports synchronized
- Priority detection:
andP1/P2/P3
(Speckit) formats[P]
When to Use This Skill
Use this skill when:
- The user requests to scan tasks across projects (e.g.,
)/ctx.scan - Building or refreshing the project backlog before planning
- Collecting task status updates from multiple repositories
- Needing a unified view of all open and completed tasks
Do not use this skill when:
- Working with a single project's tasks directly
- The user wants to modify tasks (this skill only reads)
- Projects are not structured under
context/projects/
How It Works
Task Collection Process
-
Discover task files recursively in
directory:projects/- Speckit format:
directories with task files.specify/ - Context-planning format:
directories withspecs/tasks.md - Optional:
files (if configured)checklists/**/*.md - Works with any project structure you prefer
- Speckit format:
-
Parse checkboxes from discovered files:
- Open tasks:
- [ ] Task description - Completed tasks:
or- [X] Task description- [x] Task description
- Open tasks:
-
Extract metadata from task lines and headings:
- Task ID: Pattern
(e.g., T101, T250)T\d+ - Priority:
orP1|P2|P3
(Speckit format, treated as P1)[P] - Scope: Last two heading levels as context
- File location and line number for traceability
- Task ID: Pattern
Project Context Analysis
The skill also includes
scripts/analyze_project.py for comprehensive project analysis:
- Overview: Extract project name and description from README/pyproject.toml
- Tech Stack: Detect languages and frameworks (Python, JavaScript/TypeScript, Rust)
- Structure: Analyze directory organization and key files
- Entry Points: Identify CLI commands and main modules
- Specs: Detect Speckit or context-planning task specifications
- Tests: Discover test frameworks and coverage tools
- Documentation: Index markdown and RST documentation files
Results are saved to
reports/projects/ as both Markdown and JSON files.
Auto-Update System
Git hooks automatically update project contexts on changes:
- post-commit: Updates changed projects after local commits
- post-merge: Updates changed projects after
git pull - post-checkout: Updates when switching branches
Install hooks with:
bash scripts/install_hooks.sh
See
docs/AUTO_UPDATE.md for detailed documentation.
- Generate unified backlog at
with structure:state/backlog.yamlgenerated_at: "ISO-8601 timestamp" items: - uid: "my-project#T101" project: "my-project" file: "projects/my-project/specs/tasks.md" line: 42 id: "T101" title: "Task description" priority: "P1" status: "open" scope: section: "Feature Name" subsection: "Phase 1"
Note: Project names are derived from the directory structure automatically.
Using the Bundled Scripts
The skill includes two main scripts:
1. Task Scanner (
scripts/scan_tasks.py):
# Scan all tasks across projects python3 skills/ctx-collector/scripts/scan_tasks.py --verbose
The scanner automatically:
- Scans both
and.specify/
directoriesspecs/ - Supports
andP1/P2/P3
priority formats[P] - Handles missing YAML library (falls back to JSON)
- Generates unique IDs for tasks without explicit IDs
- Creates
directory if neededstate/ - Overwrites
with fresh scanstate/backlog.yaml
2. Project Analyzer (
scripts/analyze_project.py):
# Analyze a specific project python3 skills/ctx-collector/scripts/analyze_project.py \ projects/my-org/my-project \ --output reports/projects/my-project.md # Or use the auto-update system bash scripts/update_project_contexts.sh manual
The analyzer automatically:
- Extracts tech stack and dependencies
- Maps directory structure
- Finds entry points and CLI commands
- Detects test frameworks
- Indexes documentation
- Outputs both Markdown and JSON reports
Task ID and UID Generation
- Explicit IDs: Tasks with
pattern use that as IDT\d+ - Implicit UIDs: Tasks without IDs get hash-based UID from
project#path:line:title - Project prefix: All UIDs include
for cross-project uniquenessproject#
Priority Detection
Priority is determined in order:
- Speckit format:
in task line is treated as P1 (highest priority)[P] - Standard format:
marker in task line (e.g.,P1|P2|P3
)- [ ] T101 P1 Fix critical bug - Priority marker in nearest parent heading
- Default to
if not specifiedP2
Examples:
- [ ] [P] Critical bug fix # Treated as P1 (Speckit) - [ ] T101 P1 High priority task # P1 (standard) - [ ] T102 P2 Normal task # P2 (standard) - [ ] T103 Regular task # P2 (default)
Workflow Examples
Task Scanning (/ctx.scan
)
/ctx.scan- Verify
contains your project directoriesprojects/ - Execute
or implement inline scanningscripts/scan_tasks.py - Report summary: "Scanned X files, found Y tasks (Z open, W done)"
- Confirm
has been updatedstate/backlog.yaml
Project Analysis (/ctx.analyze <project>
)
/ctx.analyze <project>- Verify project exists in
directoryprojects/ - Execute
for the specific projectscripts/analyze_project.py - Generate
andreports/projects/<name>.md<name>.json - Update
with new project entryreports/projects/INDEX.md
Auto-Update on Git Operations
When you commit, pull, or checkout:
- Git hook detects changed projects
runs automaticallyscripts/update_project_contexts.sh- Updated reports are generated for changed projects
- Deleted projects have their reports removed
- INDEX.md is regenerated
Constraints
- Read-only operation: Never modifies source task files
- Local files only: No network access or git operations
- No cloning: Only processes existing local directories
- Stable output format: Other skills depend on backlog.yaml structure
Related Skills
: Consumesctx-planning
to generate daily/weekly plansstate/backlog.yaml- Use
to modify planning parameters in/ctx.updateBaseContext.yaml
Troubleshooting
If scanning produces unexpected results, check:
- Task files use proper checkbox syntax:
or- [ ]- [X] - Task IDs follow
pattern (e.g., T1, T100, not task-1)T\d+ - Priority markers use
,P1
, orP2
formatP3 - Files are UTF-8 encoded
directory is writablestate/