-
Notifications
You must be signed in to change notification settings - Fork 0
fix(templates): sync task type system to CLI source templates #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
CLI source templates were not updated when the task type system was implemented. The project-manager plan-proposal.md was manually edited but slash-command-templates.ts remained outdated, causing regenerated commands via `splx update` to use old templates without type/blocked-by support. ### How It Works When users run `splx update`, the CLI regenerates slash commands from source templates. These templates now include instructions for reading task templates from workspace/templates/, using the type: field to specify task types, and expressing dependencies with blocked-by:. The AGENTS.md documentation also includes three new sections explaining templates, dependencies, and recommended ordering. ### Manual Testing Plan 1. Run `splx update` in any project 2. Open `.claude/commands/splx/plan-proposal.md` 3. Verify step 2 mentions "Read all task templates in workspace/templates/" 4. Verify step 7 includes "type: <template-type>" and "blocked-by:" in frontmatter description 5. Open `workspace/AGENTS.md` 6. Verify sections exist: "Task Templates", "Task Dependencies", "Recommended Task Ordering" 7. Run `splx create task "Test" --parent-id test --parent-type change` 8. Verify generated task includes type: field support ### Technical Details Updated 4 files: - slash-command-templates.ts: Added step 2 for template reading, updated step 7 with type/blocked-by, renumbered to step 8 - agents-template.ts: Added type/blocked-by to task example, added Task Templates/Dependencies/Ordering sections, updated happy path script - task-template.ts: Added type/blockedBy to TaskContext interface and template output - feedback-scanner.ts: Added type: bug to generated feedback tasks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR synchronizes CLI source templates with the task type system implementation by adding support for type: and blocked-by: fields throughout the task creation workflow.
Changes:
- Extended task template system to support task types and dependency blocking
- Added comprehensive documentation for task templates, dependencies, and recommended ordering patterns
- Updated proposal planning steps to incorporate template discovery and usage
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/services/feedback-scanner.ts | Added type: bug field to auto-generated feedback tasks |
| src/core/templates/task-template.ts | Extended TaskContext interface and template to support type and blockedBy fields |
| src/core/templates/slash-command-templates.ts | Updated proposal steps to include template discovery and document new frontmatter fields |
| src/core/templates/agents-template.ts | Added comprehensive documentation sections for Task Templates, Task Dependencies, and Recommended Task Ordering; updated examples to include new fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Extracted duplicated logic from create.ts and paste.ts into shared modules. Added ParentResolverService for centralized parent resolution with injectable cwd parameter for testability. Created task-utils.ts for shared frontmatter building, kebab-case conversion, and ID parsing functions. ### How It Works Task creation commands now share common logic through dedicated service and utility modules instead of duplicating code. Parent resolution (finding changes, reviews, specs by ID) uses a single service that properly preserves workspace metadata. Template fallback behavior is aligned: create shows a warning template when no type specified, paste uses simple format with clipboard content. ### Manual Testing Plan 1. Run `splx create task "Test task" --parent-id <existing-change>` - verify task created with warning template 2. Copy text to clipboard, run `splx paste task --parent-id <existing-change>` - verify clipboard content in task body 3. Run `splx paste task --parent-id <change> --type implementation` with no template file - verify falls back to generic template with warning 4. Run `npm test` - verify all 1493 tests pass ### Technical Details - `src/services/parent-resolver.ts`: New service extracting parent resolution logic from commands. Accepts DiscoveredWorkspace[] directly to preserve isRoot. Injectable cwd parameter defaults to process.cwd() for testability. - `src/utils/task-utils.ts`: New module with toKebabCase(), parseItemId(), parsePrefixedId(), buildTaskFrontmatter(), isValidTemplateType(), and KNOWN_TEMPLATE_TYPES constant. - `src/utils/centralized-task-discovery.ts`: Added getNextTaskSequenceForParent() shared helper eliminating ~20 lines of duplicated sequence-finding logic. - `src/commands/create.ts` and `src/commands/paste.ts`: Refactored to use shared modules, reduced by ~130 lines each. - Added comprehensive unit tests: 32 tests for task-utils.ts, 15 tests for parent-resolver.ts.
…loading
Migrated all template content from embedded TypeScript strings to markdown files in assets/templates/. Templates now load at runtime via template-loader.ts with caching. This reduces source code size by ~2300 lines and makes templates editable without recompilation.
### How It Works
Templates live in assets/templates/ organized by category (workspace, task-types, entities, slash-commands). When code requests a template, template-loader.ts reads the file from disk and caches it. The TemplateManager class provides the same API as before but delegates to the loader.
### Manual Testing Plan
1. Run `rm -rf /tmp/test-splx && mkdir /tmp/test-splx`
2. Run `node dist/cli/index.js init /tmp/test-splx --tools claude`
3. Verify `ls /tmp/test-splx/workspace/templates/` shows 12 .md files
4. Verify `cat /tmp/test-splx/.claude/commands/splx/plan-proposal.md` shows slash command content
5. Run `rm -rf /tmp/test-splx/workspace/templates && node dist/cli/index.js update /tmp/test-splx`
6. Verify templates recreated
### Technical Details
- Created template-loader.ts with loadTemplate(), loadTemplateWithReplacements(), clearTemplateCache()
- Moved 44 template files to assets/templates/{workspace,task-types,entities,slash-commands}/
- Deleted 15 template TypeScript files (agents-template.ts, slash-command-templates.ts, etc.)
- Added lazy getAgentsTemplate() export, removed eager TASK_TYPE_TEMPLATES export
- Added "assets" to package.json files array for npm distribution
- Converted template-loader tests from mocked to integration tests reading real files
Removed @workspace/ARCHITECTURE.md auto-linking and converted @workspace/AGENTS.md to plain text reference workspace/AGENTS.md across 6 slash command templates to reduce context waste and redundant loading. ### How It Works Slash commands no longer auto-load ARCHITECTURE.md. AGENTS.md is referenced as plain text instead of a file link, since agents may have already read it. This reduces unnecessary context consumption. ### Manual Testing Plan 1. Run `pnpm build` - verify build succeeds 2. Run `pnpm test` - verify all 1535 tests pass 3. Initialize test project: `splx init /tmp/test-splx --tools claude` 4. Check generated slash commands in `/tmp/test-splx/.claude/commands/splx/`: - `plan-proposal.md` should contain `workspace/AGENTS.md` (no @ prefix) - `plan-proposal.md` should NOT contain `@workspace/ARCHITECTURE.md` - Same pattern for `plan-request.md`, `plan-implementation.md`, `orchestrate.md`, `sync-workspace.md` - `prepare-release.md` should NOT contain `@workspace/ARCHITECTURE.md` but should still have `@workspace/RELEASE.md` ### Technical Details Modified 6 templates in `assets/templates/slash-commands/`: - plan-proposal.md, plan-request.md, plan-implementation.md, orchestrate.md, sync-workspace.md: replaced `@workspace/ARCHITECTURE.md` + `@workspace/AGENTS.md` with `workspace/AGENTS.md` - prepare-release.md: removed only `@workspace/ARCHITECTURE.md` reference Updated test expectations in `test/core/init.test.ts` to verify new behavior.
Fixed three bugs from PR review: clipboard content silently lost in paste task fallback, custom template types rejected despite documentation, and special $ patterns corrupting template output. Updated documentation for blocked-by YAML syntax and parent-type values. ### How It Works Custom templates in workspace/templates/ now work as documented. The paste task command preserves clipboard content when falling back to a minimal template. User input containing $ characters no longer gets corrupted during template processing. ### Manual Testing Plan 1. Run `splx paste task --type custom-type --parent-id test-change` with content in clipboard - Verify clipboard content appears in generated task even when custom-type doesn't exist 2. Create `workspace/templates/my-type.md` with frontmatter `type: my-type` 3. Run `splx create task "Test" --parent-id test-change --type my-type` - Verify custom template is used (no error about unknown type) 4. Run `splx create task "Fix $& bug" --parent-id test-change` - Verify title appears correctly as "Fix $& bug" (not corrupted) 5. Run `pnpm test` - all tests should pass ### Technical Details - paste.ts: Fallback creates minimal template structure with frontmatter + clipboard content instead of attempting injection into non-existent section - create.ts, paste.ts: Removed early `isValidTemplateType()` validation - workspace template lookup handles unknown types with warning - template-loader.ts: Changed `String.replace()` to function form `() => value` to prevent JavaScript special replacement pattern interpretation - agents.md: Fixed blocked-by syntax to show multi-line YAML format, added 'review' to parent-type - plan-proposal.md: Corrected frontmatter field order documentation
Applied missing fix for $ pattern corruption in paste.ts line 209. The clipboard content replacement now uses function form to prevent JavaScript special replacement pattern interpretation.
### How It Works
When pasting clipboard content into a task template's End Goal section, special characters like $& in the clipboard are now preserved literally instead of being interpreted as replacement tokens.
### Manual Testing Plan
1. Copy text containing "$& test $' content $`" to clipboard
2. Run `splx paste task --type implementation --parent-id test-change`
3. Verify the task file contains the exact clipboard content with $ characters intact
### Technical Details
Changed line 209 from direct string replacement to function form:
`body.replace(endGoalMatch[0], () => \`## 🎯 End Goal\n\${endGoalContent}\`)`
- Refactored template system to load from `assets/templates/` at runtime, reducing source code size by ~2300 lines and allowing for template edits without recompilation. - Optimized slash command context by removing automatic file linking to reduce context waste. - Fixed clipboard content replacement in paste command and ensured task type system syncs with CLI source templates. - Removed PROGRESS.md concept and cleaned up obsolete agent-related files. - Added new commands for task management and improved documentation for existing commands. This release enhances performance, simplifies template management, and improves user experience across the SPLX command suite.
… logic - Updated the `archive` command to normalize boolean flags for options, ensuring consistent behavior across commands. - Modified task completion checks to treat each task file as a single task, marking it complete only when no unchecked markdown checkboxes remain. - Enhanced documentation for the `archive` command to clarify the handling of the `--yes` flag and its implications for user confirmation prompts. - Added new specifications to reflect changes in task completion and storage rules, ensuring alignment with the updated logic. This refactor improves the reliability of task management commands and enhances user experience by providing clearer expectations for task completion status.
…structured task handoff - Added a new CLI command `splx create progress --change-id <id>` to generate a PROGRESS.md file with non-completed tasks. - Implemented the `/splx:plan-implementation` slash command to orchestrate multi-agent workflows with clear task instructions. - Modified existing files to support the new command, including updates to `create.ts`, `index.ts`, and template generation logic. - Introduced specifications for the new command and its requirements, ensuring alignment with the updated task management system. This enhancement improves the workflow for managing multi-agent tasks, providing a structured approach to task handoff and completion tracking.
Resolves merge conflicts between: - This PR: Refactored templates to load from assets/ directory - Main: Added task type and blocked-by options (#89) Resolution strategy: - Keep asset-based template loading from this PR - Add template-discovery.ts exports for getAvailableTypes() - Delete redundant hardcoded templates (now in assets/) - Add sync-tasks.md slash command to assets - Remove duplicate sections in workspace/AGENTS.md - Fix test to use TemplateManager.getSlashCommandBody
…ardcoding Removed ~1275 lines of hardcoded template content from template-discovery.ts. Built-in task type templates now load dynamically from assets/templates/task-types/ at runtime. AGENTS.md references workspace/templates/ instead of embedding a static task types table. ### How It Works Template discovery now uses the existing loadTemplate() function to read built-in templates from the filesystem. Documentation directs users to browse workspace/templates/ for available task types rather than maintaining a duplicate table that could drift out of sync. ### Manual Testing Plan 1. Run `npm run build` - verify build succeeds 2. Run `npm test` - verify all 1576 tests pass 3. Run `splx create task "Test" --type story` - verify template loads correctly 4. Open workspace/AGENTS.md - verify it references templates directory instead of hardcoded table ### Technical Details - template-discovery.ts: Replaced BUILT_IN_TEMPLATES constant (1300 lines) with getBuiltInTemplates() that iterates KNOWN_TEMPLATE_TYPES and calls loadTemplate() - workspace/AGENTS.md: Replaced 12-row task types table with "Browse workspace/templates/" reference - assets/templates/workspace/agents.md: Same reference update for template source - workspace/RELEASE.md: Updated primary sources to reference assets/templates/ paths - CHANGELOG.md: Updated 0.20.0 entry with template-discovery refactor details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Created missing slash command file for syncing tasks to external issue trackers. The template existed in assets/templates/slash-commands/sync-tasks.md but had no corresponding deployed command. ### How It Works The /splx/sync-tasks command enables syncing OpenSplx tasks to external issue trackers (Linear, GitHub, Jira) via MCP integrations. Users invoke the command with a change ID to create remote issues for all tasks in that change. ### Manual Testing Plan 1. Run `ls .claude/commands/splx/` and confirm sync-tasks.md appears 2. Compare `.claude/commands/splx/sync-tasks.md` with `assets/templates/slash-commands/sync-tasks.md` to verify content match (excluding frontmatter) 3. Run `splx validate all` to confirm no validation errors ### Technical Details Added `.claude/commands/splx/sync-tasks.md` with standard command frontmatter (name, description, category, tags) wrapping the template content from assets/templates/slash-commands/sync-tasks.md. Follows the same pattern as other deployed slash commands like sync-workspace.md.
Summary
type:andblocked-by:fields to task frontmatter instructionsTest plan
splx updatein any project.claude/commands/splx/plan-proposal.mdstep 2 mentions "Read all task templates in workspace/templates/"workspace/AGENTS.mdcontains "Task Templates", "Task Dependencies", "Recommended Task Ordering" sectionssplx create task "Test" --parent-id test --parent-type changeand verify type field supportNote
Major template system overhaul and documentation/command sync.
assets/templates/with discovery/caching; organizes byworkspace,task-types,entities,slash-commands.claude/commands/splx/*to reference themAGENTS.mdwith task templates/dependencies/ordering and updated workflows; adds workspace stubs/templatesworkspace/AGENTS.mdand reduces auto-linkingCHANGELOG.mdand bumpspackage.jsonto0.20.0; includes fixes (clipboard replace, template sync) and removals (PROGRESS.md concept)assets/in package files listWritten by Cursor Bugbot for commit 3e23dee. This will update automatically on new commits. Configure here.